@memberjunction/ng-skip-chat 2.57.0 → 2.59.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/lib/dynamic-report/skip-react-component-host.d.ts +97 -0
- package/dist/lib/dynamic-report/skip-react-component-host.d.ts.map +1 -1
- package/dist/lib/dynamic-report/skip-react-component-host.js +1223 -1
- package/dist/lib/dynamic-report/skip-react-component-host.js.map +1 -1
- package/dist/lib/skip-chat/skip-chat.component.d.ts +22 -1
- package/dist/lib/skip-chat/skip-chat.component.d.ts.map +1 -1
- package/dist/lib/skip-chat/skip-chat.component.js +688 -32
- package/dist/lib/skip-chat/skip-chat.component.js.map +1 -1
- package/package.json +13 -13
|
@@ -1,4 +1,65 @@
|
|
|
1
1
|
import { SkipComponentCallbacks, 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
|
+
}
|
|
2
63
|
/**
|
|
3
64
|
* Configuration for a React component to be hosted in Angular
|
|
4
65
|
*/
|
|
@@ -17,6 +78,8 @@ export interface ReactComponentConfig {
|
|
|
17
78
|
utilities?: SkipComponentUtilities;
|
|
18
79
|
/** Styles to pass to the component */
|
|
19
80
|
styles?: SkipComponentStyles;
|
|
81
|
+
/** Component metadata for registry integration */
|
|
82
|
+
metadata?: ComponentMetadata;
|
|
20
83
|
}
|
|
21
84
|
/**
|
|
22
85
|
* Interface for component factory function that's generated by Skip
|
|
@@ -44,6 +107,10 @@ export declare class SkipReactComponentHost {
|
|
|
44
107
|
private static cachedLibraries;
|
|
45
108
|
private static libraryLoadPromise;
|
|
46
109
|
constructor(config: ReactComponentConfig);
|
|
110
|
+
/**
|
|
111
|
+
* Create a plain JavaScript object containing only the components needed by the generated component
|
|
112
|
+
*/
|
|
113
|
+
private createComponentsObject;
|
|
47
114
|
/**
|
|
48
115
|
* Load React and ReactDOM dynamically
|
|
49
116
|
*/
|
|
@@ -125,4 +192,34 @@ export declare class SkipReactComponentHost {
|
|
|
125
192
|
*/
|
|
126
193
|
private createStandardEventHandlerFunction;
|
|
127
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Example child components for testing the component registry system
|
|
197
|
+
* These would normally be defined in separate files and imported
|
|
198
|
+
*/
|
|
199
|
+
export declare const createSearchBoxComponent: (React: any) => ({ data, config, state, onEvent, styles, statePath }: any) => any;
|
|
200
|
+
export declare const createOrderListComponent: (React: any) => ({ data, config, state, onEvent, styles, statePath }: any) => any;
|
|
201
|
+
export declare const createCategoryChartComponent: (React: any, Chart: any) => ({ data, config, state, onEvent, styles, statePath }: any) => any;
|
|
202
|
+
export declare const getActionCategoryListComponentString: () => string;
|
|
203
|
+
export declare const getActionListComponentString: () => string;
|
|
204
|
+
export declare const getActionBrowserComponentString: () => string;
|
|
205
|
+
/**
|
|
206
|
+
* Unit tests for GlobalComponentRegistry
|
|
207
|
+
* These would normally be in a separate .spec.ts file
|
|
208
|
+
* Run these tests to ensure the registry works correctly
|
|
209
|
+
*/
|
|
210
|
+
export declare function testGlobalComponentRegistry(): {
|
|
211
|
+
test: string;
|
|
212
|
+
passed: boolean;
|
|
213
|
+
error?: string | undefined;
|
|
214
|
+
}[];
|
|
215
|
+
/**
|
|
216
|
+
* Compile and register a component from string code
|
|
217
|
+
* This simulates how AI-generated components are processed
|
|
218
|
+
*/
|
|
219
|
+
export declare function compileAndRegisterComponent(componentName: string, componentCode: string, context?: string, version?: string): Promise<boolean>;
|
|
220
|
+
/**
|
|
221
|
+
* Helper function to register example components for testing
|
|
222
|
+
* Call this during application initialization
|
|
223
|
+
*/
|
|
224
|
+
export declare function registerExampleComponents(React?: any, Chart?: any): Promise<boolean>;
|
|
128
225
|
//# sourceMappingURL=skip-react-component-host.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;
|
|
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,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEjH,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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