@memberjunction/ng-skip-chat 2.69.0 → 2.70.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.
@@ -1,237 +0,0 @@
1
- import { SkipComponentCallbacks, SkipComponentRootSpec, SkipComponentStyles, SkipComponentUtilities } from '@memberjunction/skip-types';
2
- import { BaseSingleton } from '@memberjunction/global';
3
- /**
4
- * Component metadata for component registry system
5
- */
6
- export interface ComponentMetadata {
7
- /** List of child component names required by this component */
8
- requiredChildComponents: string[];
9
- /** Context for component resolution (e.g., 'CRM', 'Finance', 'Standard') */
10
- componentContext: string;
11
- /** Version of the component specification */
12
- version: string;
13
- }
14
- /**
15
- * Global component registry service for managing reusable React components
16
- * Extends BaseSingleton to ensure a truly global singleton instance across
17
- * the entire application, even if this code is loaded multiple times.
18
- */
19
- export declare class GlobalComponentRegistry extends BaseSingleton<GlobalComponentRegistry> {
20
- private components;
21
- protected constructor();
22
- /**
23
- * Get the singleton instance
24
- */
25
- static get Instance(): GlobalComponentRegistry;
26
- /**
27
- * Register a component with a simple key
28
- */
29
- register(key: string, component: any): void;
30
- /**
31
- * Get a component by key
32
- */
33
- get(key: string): any;
34
- /**
35
- * Register a component with metadata for versioning and context
36
- */
37
- registerWithMetadata(name: string, context: string, version: string, component: any, description?: string): void;
38
- /**
39
- * Create a standardized key from component metadata
40
- */
41
- private createKey;
42
- /**
43
- * Get all registered component keys (useful for debugging)
44
- */
45
- getRegisteredKeys(): string[];
46
- /**
47
- * Clear all registered components
48
- */
49
- clear(): void;
50
- /**
51
- * Check if a component is registered
52
- */
53
- has(key: string): boolean;
54
- /**
55
- * Get component with fallback options
56
- */
57
- getWithFallback(name: string, context: string, version: string): any;
58
- /**
59
- * Remove a component from the registry
60
- */
61
- remove(key: string): void;
62
- }
63
- /**
64
- * Configuration for a React component to be hosted in Angular
65
- */
66
- export interface ReactComponentConfig {
67
- component: SkipComponentRootSpec;
68
- /** The HTML container element where the React component will be rendered */
69
- container: HTMLElement;
70
- /** Data to pass to the component (e.g., entities, lists, etc.) */
71
- data?: any;
72
- /** Callbacks for component lifecycle events */
73
- callbacks?: SkipComponentCallbacks;
74
- /** Initial state for the component */
75
- initialState?: any;
76
- /** Utilities to pass to the component */
77
- utilities?: SkipComponentUtilities;
78
- /** Styles to pass to the component */
79
- styles?: SkipComponentStyles;
80
- /** Component metadata for registry integration */
81
- metadata?: ComponentMetadata;
82
- }
83
- /**
84
- * Interface for component factory function that's generated by Skip
85
- */
86
- export interface ComponentFactoryResult {
87
- component: any;
88
- print?: () => void;
89
- refresh?: (data?: any) => void;
90
- }
91
- /**
92
- * Host class for integrating Skip-generated React components into Angular applications.
93
- * This class handles the lifecycle management, state synchronization, and communication
94
- * between React components and their Angular host containers.
95
- */
96
- export declare class SkipReactComponentHost {
97
- private config;
98
- private componentResult;
99
- private reactRoot;
100
- private componentContainer;
101
- private destroyed;
102
- private currentState;
103
- private React;
104
- private ReactDOM;
105
- private static cachedStyleSystem;
106
- private static cachedLibraries;
107
- private static libraryLoadPromise;
108
- constructor(config: ReactComponentConfig);
109
- /**
110
- * Register all components in the hierarchy before initialization
111
- * This ensures all child components are available in the registry
112
- */
113
- private registerComponentHierarchy;
114
- /**
115
- * Recursively register child components
116
- */
117
- private registerChildComponent;
118
- /**
119
- * Create a plain JavaScript object containing only the components needed by the generated component
120
- */
121
- private createComponentsObject;
122
- /**
123
- * Load React and ReactDOM dynamically
124
- */
125
- private loadReactLibraries;
126
- /**
127
- * Generic method to load a script from CDN
128
- */
129
- private loadScriptFromCDN;
130
- /**
131
- * Load Babel standalone for JSX transpilation
132
- */
133
- private loadBabel;
134
- /**
135
- * Load a CSS file from CDN
136
- */
137
- private loadCSS;
138
- /**
139
- * Load a script from CDN with promise
140
- */
141
- private loadScript;
142
- /**
143
- * Load common UI and utility libraries
144
- */
145
- private loadCommonLibraries;
146
- /**
147
- * Actually load the libraries
148
- */
149
- private doLoadLibraries;
150
- /**
151
- * Initialize the React component
152
- */
153
- initialize(): Promise<void>;
154
- /**
155
- * Create an error boundary component
156
- */
157
- private createErrorBoundary;
158
- /**
159
- * Render or re-render the React component with new props
160
- */
161
- render(): void;
162
- /**
163
- * Update the component state
164
- */
165
- updateState(path: string, value: any): void;
166
- /**
167
- * Update the component data
168
- */
169
- updateData(newData: any): void;
170
- /**
171
- * Refresh the component with optional new data
172
- */
173
- refresh(newData?: any): void;
174
- /**
175
- * Print the component
176
- */
177
- print(): void;
178
- /**
179
- * Clean up resources
180
- */
181
- destroy(): void;
182
- /**
183
- * Create the callbacks object to pass to the React component
184
- */
185
- private createCallbacks;
186
- /**
187
- * Get or create the cached style system
188
- */
189
- private getOrCreateStyleSystem;
190
- /**
191
- * Create a unified style system for the component
192
- */
193
- private createStyleSystem;
194
- /**
195
- * Create the state updater utility function for the React component
196
- */
197
- private createStateUpdaterFunction;
198
- /**
199
- * Create the standard event handler utility function for the React component
200
- */
201
- private createStandardEventHandlerFunction;
202
- }
203
- /**
204
- * Example child components for testing the component registry system
205
- * These would normally be defined in separate files and imported
206
- */
207
- export declare const createSearchBoxComponent: (React: any) => ({ data, config, state, onEvent, styles, statePath }: any) => any;
208
- export declare const createOrderListComponent: (React: any) => ({ data, config, state, onEvent, styles, statePath }: any) => any;
209
- export declare const createCategoryChartComponent: (React: any, Chart: any) => ({ data, config, state, onEvent, styles, statePath }: any) => any;
210
- export declare const getActionCategoryListComponentString: () => string;
211
- export declare const getActionListComponentString: () => string;
212
- export declare const getActionBrowserComponentString: () => string;
213
- /**
214
- * Unit tests for GlobalComponentRegistry
215
- * These would normally be in a separate .spec.ts file
216
- * Run these tests to ensure the registry works correctly
217
- */
218
- export declare function testGlobalComponentRegistry(): {
219
- test: string;
220
- passed: boolean;
221
- error?: string | undefined;
222
- }[];
223
- /**
224
- * Compile and register a component from string code
225
- * Always wraps plain function components with createComponent factory
226
- */
227
- export declare function compileAndRegisterComponent(componentName: string, componentCode: string, context?: string, version?: string, reactContext?: {
228
- React: any;
229
- ReactDOM: any;
230
- libraries: any;
231
- }): Promise<boolean>;
232
- /**
233
- * Helper function to register example components for testing
234
- * Call this during application initialization
235
- */
236
- export declare function registerExampleComponents(React?: any, Chart?: any): Promise<boolean>;
237
- //# sourceMappingURL=skip-react-component-host.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skip-react-component-host.d.ts","sourceRoot":"","sources":["../../../src/lib/dynamic-report/skip-react-component-host.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,sBAAsB,EAA0B,MAAM,4BAA4B,CAAC;AAEhK,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA6BvD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC,4EAA4E;IAC5E,gBAAgB,EAAE,MAAM,CAAC;IACzB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;CACjB;AAcD;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,aAAa,CAAC,uBAAuB,CAAC;IACjF,OAAO,CAAC,UAAU,CAA6C;IAE/D,SAAS;IAIT;;OAEG;IACH,WAAkB,QAAQ,IAAI,uBAAuB,CAEpD;IAED;;OAEG;IACI,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI;IAIlD;;OAEG;IACI,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG;IAK5B;;OAEG;IACI,oBAAoB,CACzB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,GAAG,EACd,WAAW,CAAC,EAAE,MAAM,GACnB,IAAI;IAcP;;OAEG;IACH,OAAO,CAAC,SAAS;IAIjB;;OAEG;IACI,iBAAiB,IAAI,MAAM,EAAE;IAIpC;;OAEG;IACI,KAAK,IAAI,IAAI;IAIpB;;OAEG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