@memberjunction/react-runtime 2.74.0 → 2.76.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +27 -0
- package/README.md +96 -4
- package/dist/compiler/component-compiler.d.ts +0 -1
- package/dist/compiler/component-compiler.d.ts.map +1 -1
- package/dist/compiler/component-compiler.js +34 -25
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -6
- package/dist/registry/component-resolver.d.ts +1 -6
- package/dist/registry/component-resolver.d.ts.map +1 -1
- package/dist/registry/component-resolver.js +19 -19
- package/dist/registry/index.d.ts +2 -1
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +3 -1
- package/dist/runtime/component-hierarchy.d.ts +1 -1
- package/dist/runtime/component-hierarchy.d.ts.map +1 -1
- package/dist/runtime/component-hierarchy.js +25 -25
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -2
- package/dist/runtime/prop-builder.d.ts +1 -2
- package/dist/runtime/prop-builder.d.ts.map +1 -1
- package/dist/runtime/prop-builder.js +4 -76
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +15 -0
- package/dist/types/library-config.d.ts +32 -0
- package/dist/types/library-config.d.ts.map +1 -0
- package/dist/types/library-config.js +2 -0
- package/dist/utilities/core-libraries.d.ts +5 -0
- package/dist/utilities/core-libraries.d.ts.map +1 -0
- package/dist/utilities/core-libraries.js +52 -0
- package/dist/utilities/library-loader.d.ts +3 -2
- package/dist/utilities/library-loader.d.ts.map +1 -1
- package/dist/utilities/library-loader.js +65 -76
- package/dist/utilities/standard-libraries.d.ts +13 -24
- package/dist/utilities/standard-libraries.d.ts.map +1 -1
- package/dist/utilities/standard-libraries.js +58 -47
- package/package.json +4 -4
- package/samples/entities-1.js +493 -0
- package/src/compiler/component-compiler.ts +64 -35
- package/src/index.ts +1 -5
- package/src/registry/component-resolver.ts +21 -30
- package/src/registry/index.ts +2 -1
- package/src/runtime/component-hierarchy.ts +26 -26
- package/src/runtime/index.ts +0 -1
- package/src/runtime/prop-builder.ts +5 -112
- package/src/types/index.ts +6 -1
- package/src/types/library-config.ts +75 -0
- package/src/utilities/core-libraries.ts +61 -0
- package/src/utilities/library-loader.ts +113 -93
- package/src/utilities/standard-libraries.ts +104 -71
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -14,7 +14,7 @@ class ComponentHierarchyRegistrar {
|
|
|
14
14
|
const warnings = [];
|
|
15
15
|
const rootResult = await this.registerSingleComponent(rootSpec, { styles, namespace, version, allowOverride });
|
|
16
16
|
if (rootResult.success) {
|
|
17
|
-
registeredComponents.push(rootSpec.
|
|
17
|
+
registeredComponents.push(rootSpec.name);
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
20
20
|
errors.push(rootResult.error);
|
|
@@ -22,7 +22,7 @@ class ComponentHierarchyRegistrar {
|
|
|
22
22
|
return { success: false, registeredComponents, errors, warnings };
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
const childComponents = rootSpec.
|
|
25
|
+
const childComponents = rootSpec.dependencies || [];
|
|
26
26
|
if (childComponents.length > 0) {
|
|
27
27
|
const childResult = await this.registerChildComponents(childComponents, { styles, namespace, version, continueOnError, allowOverride }, registeredComponents, errors, warnings);
|
|
28
28
|
}
|
|
@@ -36,26 +36,26 @@ class ComponentHierarchyRegistrar {
|
|
|
36
36
|
async registerSingleComponent(spec, options) {
|
|
37
37
|
const { styles, namespace = 'Global', version = 'v1', allowOverride = true } = options;
|
|
38
38
|
try {
|
|
39
|
-
if (!spec.
|
|
39
|
+
if (!spec.code) {
|
|
40
40
|
return {
|
|
41
41
|
success: true,
|
|
42
42
|
error: undefined
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
const existingComponent = this.registry.get(spec.
|
|
45
|
+
const existingComponent = this.registry.get(spec.name, namespace, version);
|
|
46
46
|
if (existingComponent && !allowOverride) {
|
|
47
47
|
return {
|
|
48
48
|
success: false,
|
|
49
49
|
error: {
|
|
50
|
-
componentName: spec.
|
|
50
|
+
componentName: spec.name,
|
|
51
51
|
error: `Component already registered in ${namespace}/${version}`,
|
|
52
52
|
phase: 'registration'
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
const compileOptions = {
|
|
57
|
-
componentName: spec.
|
|
58
|
-
componentCode: spec.
|
|
57
|
+
componentName: spec.name,
|
|
58
|
+
componentCode: spec.code,
|
|
59
59
|
styles
|
|
60
60
|
};
|
|
61
61
|
const compilationResult = await this.compiler.compile(compileOptions);
|
|
@@ -63,21 +63,21 @@ class ComponentHierarchyRegistrar {
|
|
|
63
63
|
return {
|
|
64
64
|
success: false,
|
|
65
65
|
error: {
|
|
66
|
-
componentName: spec.
|
|
66
|
+
componentName: spec.name,
|
|
67
67
|
error: compilationResult.error?.message || 'Unknown compilation error',
|
|
68
68
|
phase: 'compilation'
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
const componentFactory = compilationResult.component.component(this.runtimeContext, styles);
|
|
73
|
-
this.registry.register(spec.
|
|
73
|
+
this.registry.register(spec.name, componentFactory.component, namespace, version);
|
|
74
74
|
return { success: true };
|
|
75
75
|
}
|
|
76
76
|
catch (error) {
|
|
77
77
|
return {
|
|
78
78
|
success: false,
|
|
79
79
|
error: {
|
|
80
|
-
componentName: spec.
|
|
80
|
+
componentName: spec.name,
|
|
81
81
|
error: error instanceof Error ? error.message : String(error),
|
|
82
82
|
phase: 'registration'
|
|
83
83
|
}
|
|
@@ -93,8 +93,8 @@ class ComponentHierarchyRegistrar {
|
|
|
93
93
|
allowOverride: options.allowOverride
|
|
94
94
|
});
|
|
95
95
|
if (childResult.success) {
|
|
96
|
-
if (child.
|
|
97
|
-
registeredComponents.push(child.
|
|
96
|
+
if (child.code) {
|
|
97
|
+
registeredComponents.push(child.name);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
else {
|
|
@@ -103,7 +103,7 @@ class ComponentHierarchyRegistrar {
|
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
const nestedChildren = child.
|
|
106
|
+
const nestedChildren = child.dependencies || [];
|
|
107
107
|
if (nestedChildren.length > 0) {
|
|
108
108
|
await this.registerChildComponents(nestedChildren, options, registeredComponents, errors, warnings);
|
|
109
109
|
}
|
|
@@ -118,22 +118,22 @@ async function registerComponentHierarchy(rootSpec, compiler, registry, runtimeC
|
|
|
118
118
|
exports.registerComponentHierarchy = registerComponentHierarchy;
|
|
119
119
|
function validateComponentSpec(spec) {
|
|
120
120
|
const errors = [];
|
|
121
|
-
if (!spec.
|
|
122
|
-
errors.push('Component specification must have a
|
|
121
|
+
if (!spec.name) {
|
|
122
|
+
errors.push('Component specification must have a name');
|
|
123
123
|
}
|
|
124
|
-
if (spec.
|
|
125
|
-
if (typeof spec.
|
|
126
|
-
errors.push(`Component code for ${spec.
|
|
124
|
+
if (spec.code) {
|
|
125
|
+
if (typeof spec.code !== 'string') {
|
|
126
|
+
errors.push(`Component code for ${spec.name} must be a string`);
|
|
127
127
|
}
|
|
128
|
-
if (spec.
|
|
129
|
-
errors.push(`Component code for ${spec.
|
|
128
|
+
if (spec.code.trim().length === 0) {
|
|
129
|
+
errors.push(`Component code for ${spec.name} cannot be empty`);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
const children = spec.
|
|
132
|
+
const children = spec.dependencies || [];
|
|
133
133
|
children.forEach((child, index) => {
|
|
134
134
|
const childErrors = validateComponentSpec(child);
|
|
135
135
|
childErrors.forEach(error => {
|
|
136
|
-
errors.push(`Child ${index} (${child.
|
|
136
|
+
errors.push(`Child ${index} (${child.name || 'unnamed'}): ${error}`);
|
|
137
137
|
});
|
|
138
138
|
});
|
|
139
139
|
return errors;
|
|
@@ -141,7 +141,7 @@ function validateComponentSpec(spec) {
|
|
|
141
141
|
exports.validateComponentSpec = validateComponentSpec;
|
|
142
142
|
function flattenComponentHierarchy(rootSpec) {
|
|
143
143
|
const components = [rootSpec];
|
|
144
|
-
const children = rootSpec.
|
|
144
|
+
const children = rootSpec.dependencies || [];
|
|
145
145
|
children.forEach(child => {
|
|
146
146
|
components.push(...flattenComponentHierarchy(child));
|
|
147
147
|
});
|
|
@@ -150,10 +150,10 @@ function flattenComponentHierarchy(rootSpec) {
|
|
|
150
150
|
exports.flattenComponentHierarchy = flattenComponentHierarchy;
|
|
151
151
|
function countComponentsInHierarchy(rootSpec, includeEmpty = false) {
|
|
152
152
|
let count = 0;
|
|
153
|
-
if (includeEmpty || rootSpec.
|
|
153
|
+
if (includeEmpty || rootSpec.code) {
|
|
154
154
|
count = 1;
|
|
155
155
|
}
|
|
156
|
-
const children = rootSpec.
|
|
156
|
+
const children = rootSpec.dependencies || [];
|
|
157
157
|
children.forEach(child => {
|
|
158
158
|
count += countComponentsInHierarchy(child, includeEmpty);
|
|
159
159
|
});
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createErrorBoundary, withErrorBoundary, formatComponentError, createErrorLogger } from './error-boundary';
|
|
2
2
|
export { wrapComponent, memoizeComponent, lazyComponent, injectProps, conditionalComponent, withErrorHandler, portalComponent, WrapperOptions } from './component-wrapper';
|
|
3
|
-
export { buildComponentProps,
|
|
3
|
+
export { buildComponentProps, normalizeCallbacks, normalizeStyles, validateComponentProps, mergeProps, createPropsTransformer, wrapCallbacksWithLogging, extractPropPaths, PropBuilderOptions } from './prop-builder';
|
|
4
4
|
export { ComponentHierarchyRegistrar, registerComponentHierarchy, validateComponentSpec, flattenComponentHierarchy, countComponentsInHierarchy, HierarchyRegistrationResult, ComponentRegistrationError, HierarchyRegistrationOptions } from './component-hierarchy';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC"}
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.countComponentsInHierarchy = exports.flattenComponentHierarchy = exports.validateComponentSpec = exports.registerComponentHierarchy = exports.ComponentHierarchyRegistrar = exports.extractPropPaths = exports.wrapCallbacksWithLogging = exports.createPropsTransformer = exports.mergeProps = exports.validateComponentProps = exports.normalizeStyles = exports.normalizeCallbacks = exports.
|
|
3
|
+
exports.countComponentsInHierarchy = exports.flattenComponentHierarchy = exports.validateComponentSpec = exports.registerComponentHierarchy = exports.ComponentHierarchyRegistrar = exports.extractPropPaths = exports.wrapCallbacksWithLogging = exports.createPropsTransformer = exports.mergeProps = exports.validateComponentProps = exports.normalizeStyles = exports.normalizeCallbacks = exports.buildComponentProps = exports.portalComponent = exports.withErrorHandler = exports.conditionalComponent = exports.injectProps = exports.lazyComponent = exports.memoizeComponent = exports.wrapComponent = exports.createErrorLogger = exports.formatComponentError = exports.withErrorBoundary = exports.createErrorBoundary = void 0;
|
|
4
4
|
var error_boundary_1 = require("./error-boundary");
|
|
5
5
|
Object.defineProperty(exports, "createErrorBoundary", { enumerable: true, get: function () { return error_boundary_1.createErrorBoundary; } });
|
|
6
6
|
Object.defineProperty(exports, "withErrorBoundary", { enumerable: true, get: function () { return error_boundary_1.withErrorBoundary; } });
|
|
@@ -16,7 +16,6 @@ Object.defineProperty(exports, "withErrorHandler", { enumerable: true, get: func
|
|
|
16
16
|
Object.defineProperty(exports, "portalComponent", { enumerable: true, get: function () { return component_wrapper_1.portalComponent; } });
|
|
17
17
|
var prop_builder_1 = require("./prop-builder");
|
|
18
18
|
Object.defineProperty(exports, "buildComponentProps", { enumerable: true, get: function () { return prop_builder_1.buildComponentProps; } });
|
|
19
|
-
Object.defineProperty(exports, "cleanupPropBuilder", { enumerable: true, get: function () { return prop_builder_1.cleanupPropBuilder; } });
|
|
20
19
|
Object.defineProperty(exports, "normalizeCallbacks", { enumerable: true, get: function () { return prop_builder_1.normalizeCallbacks; } });
|
|
21
20
|
Object.defineProperty(exports, "normalizeStyles", { enumerable: true, get: function () { return prop_builder_1.normalizeStyles; } });
|
|
22
21
|
Object.defineProperty(exports, "validateComponentProps", { enumerable: true, get: function () { return prop_builder_1.validateComponentProps; } });
|
|
@@ -6,12 +6,11 @@ export interface PropBuilderOptions {
|
|
|
6
6
|
transformState?: (state: any) => any;
|
|
7
7
|
debounceUpdateUserState?: number;
|
|
8
8
|
}
|
|
9
|
-
export declare function buildComponentProps(data?: any, userState?: any, utilities?: any, callbacks?: ComponentCallbacks, components?: Record<string, any>, styles?: ComponentStyles, options?: PropBuilderOptions): ComponentProps;
|
|
9
|
+
export declare function buildComponentProps(data?: any, userState?: any, utilities?: any, callbacks?: ComponentCallbacks, components?: Record<string, any>, styles?: ComponentStyles, options?: PropBuilderOptions, onStateChanged?: (stateUpdate: Record<string, any>) => void): ComponentProps;
|
|
10
10
|
export declare function normalizeCallbacks(callbacks: any, debounceMs?: number): ComponentCallbacks;
|
|
11
11
|
export declare function normalizeStyles(styles?: any): any;
|
|
12
12
|
export declare function validateComponentProps(props: ComponentProps): void;
|
|
13
13
|
export declare function mergeProps(...propsList: Partial<ComponentProps>[]): ComponentProps;
|
|
14
|
-
export declare function cleanupPropBuilder(callbacks: ComponentCallbacks): void;
|
|
15
14
|
export declare function createPropsTransformer(transformations: Record<string, (value: any) => any>): (props: ComponentProps) => ComponentProps;
|
|
16
15
|
export declare function wrapCallbacksWithLogging(callbacks: ComponentCallbacks, componentName: string): ComponentCallbacks;
|
|
17
16
|
export declare function extractPropPaths(componentCode: string): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-builder.d.ts","sourceRoot":"","sources":["../../src/runtime/prop-builder.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAM/E,MAAM,WAAW,kBAAkB;IAEjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;IAEnC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;IAErC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CACl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,cAAc,GAAG,IAAI,CA2BlE;AAOD,wBAAgB,UAAU,CAAC,GAAG,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE,GAAG,cAAc,CAqClF;AAOD,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC,GACnD,CAAC,KAAK,EAAE,cAAc,KAAK,cAAc,CAyB3C;AAQD,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,kBAAkB,EAC7B,aAAa,EAAE,MAAM,GACpB,kBAAkB,CAkBpB;AAOD,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,CAmBhE"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extractPropPaths = exports.wrapCallbacksWithLogging = exports.createPropsTransformer = exports.
|
|
4
|
-
|
|
5
|
-
function buildComponentProps(data = {}, userState = {}, utilities = {}, callbacks = {}, components = {}, styles, options = {}) {
|
|
3
|
+
exports.extractPropPaths = exports.wrapCallbacksWithLogging = exports.createPropsTransformer = exports.mergeProps = exports.validateComponentProps = exports.normalizeStyles = exports.normalizeCallbacks = exports.buildComponentProps = void 0;
|
|
4
|
+
function buildComponentProps(data = {}, userState = {}, utilities = {}, callbacks = {}, components = {}, styles, options = {}, onStateChanged) {
|
|
6
5
|
const { validate = true, transformData, transformState, debounceUpdateUserState = 3000 } = options;
|
|
7
6
|
const transformedData = transformData ? transformData(data) : data;
|
|
8
7
|
const transformedState = transformState ? transformState(userState) : userState;
|
|
@@ -12,7 +11,8 @@ function buildComponentProps(data = {}, userState = {}, utilities = {}, callback
|
|
|
12
11
|
utilities,
|
|
13
12
|
callbacks: normalizeCallbacks(callbacks, debounceUpdateUserState),
|
|
14
13
|
components,
|
|
15
|
-
styles: normalizeStyles(styles)
|
|
14
|
+
styles: normalizeStyles(styles),
|
|
15
|
+
onStateChanged
|
|
16
16
|
};
|
|
17
17
|
if (validate) {
|
|
18
18
|
validateComponentProps(props);
|
|
@@ -50,49 +50,6 @@ function normalizeCallbacks(callbacks, debounceMs = 3000) {
|
|
|
50
50
|
if (callbacks.OpenEntityRecord && typeof callbacks.OpenEntityRecord === 'function') {
|
|
51
51
|
normalized.OpenEntityRecord = callbacks.OpenEntityRecord;
|
|
52
52
|
}
|
|
53
|
-
if (callbacks.UpdateUserState && typeof callbacks.UpdateUserState === 'function') {
|
|
54
|
-
const originalCallback = callbacks.UpdateUserState;
|
|
55
|
-
let subject = updateUserStateSubjects.get(originalCallback);
|
|
56
|
-
if (!subject) {
|
|
57
|
-
subject = new rxjs_1.Subject();
|
|
58
|
-
updateUserStateSubjects.set(originalCallback, subject);
|
|
59
|
-
const subscription = subject.pipe((0, rxjs_1.debounceTime)(debounceMs)).subscribe(state => {
|
|
60
|
-
console.log(`[Skip Component] UpdateUserState called after ${debounceMs}ms debounce`);
|
|
61
|
-
originalCallback(state);
|
|
62
|
-
});
|
|
63
|
-
updateUserStateSubscriptions.set(originalCallback, subscription);
|
|
64
|
-
}
|
|
65
|
-
let loopState = loopDetectionStates.get(originalCallback);
|
|
66
|
-
if (!loopState) {
|
|
67
|
-
loopState = { count: 0, lastUpdate: 0, lastState: null };
|
|
68
|
-
loopDetectionStates.set(originalCallback, loopState);
|
|
69
|
-
}
|
|
70
|
-
normalized.UpdateUserState = (state) => {
|
|
71
|
-
if (loopState.lastState && deepEqual(state, loopState.lastState)) {
|
|
72
|
-
console.log('[Skip Component] Skipping redundant state update');
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const now = Date.now();
|
|
76
|
-
const timeSinceLastUpdate = now - loopState.lastUpdate;
|
|
77
|
-
if (timeSinceLastUpdate < 100) {
|
|
78
|
-
loopState.count++;
|
|
79
|
-
if (loopState.count > 5) {
|
|
80
|
-
console.error('[Skip Component] Rapid state updates detected - possible infinite loop');
|
|
81
|
-
console.error('Updates in last 100ms:', loopState.count);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
loopState.count = 0;
|
|
86
|
-
}
|
|
87
|
-
loopState.lastUpdate = now;
|
|
88
|
-
loopState.lastState = JSON.parse(JSON.stringify(state));
|
|
89
|
-
console.log('[Skip Component] Processing state update');
|
|
90
|
-
subject.next(state);
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
if (callbacks.NotifyEvent && typeof callbacks.NotifyEvent === 'function') {
|
|
94
|
-
normalized.NotifyEvent = callbacks.NotifyEvent;
|
|
95
|
-
}
|
|
96
53
|
return normalized;
|
|
97
54
|
}
|
|
98
55
|
exports.normalizeCallbacks = normalizeCallbacks;
|
|
@@ -152,23 +109,6 @@ function mergeProps(...propsList) {
|
|
|
152
109
|
return merged;
|
|
153
110
|
}
|
|
154
111
|
exports.mergeProps = mergeProps;
|
|
155
|
-
function cleanupPropBuilder(callbacks) {
|
|
156
|
-
if (callbacks.UpdateUserState && typeof callbacks.UpdateUserState === 'function') {
|
|
157
|
-
const originalCallback = callbacks.UpdateUserState;
|
|
158
|
-
const subscription = updateUserStateSubscriptions.get(originalCallback);
|
|
159
|
-
if (subscription) {
|
|
160
|
-
subscription.unsubscribe();
|
|
161
|
-
updateUserStateSubscriptions.delete(originalCallback);
|
|
162
|
-
}
|
|
163
|
-
const subject = updateUserStateSubjects.get(originalCallback);
|
|
164
|
-
if (subject) {
|
|
165
|
-
subject.complete();
|
|
166
|
-
updateUserStateSubjects.delete(originalCallback);
|
|
167
|
-
}
|
|
168
|
-
loopDetectionStates.delete(originalCallback);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
exports.cleanupPropBuilder = cleanupPropBuilder;
|
|
172
112
|
function createPropsTransformer(transformations) {
|
|
173
113
|
return (props) => {
|
|
174
114
|
const transformed = { ...props };
|
|
@@ -204,18 +144,6 @@ function wrapCallbacksWithLogging(callbacks, componentName) {
|
|
|
204
144
|
callbacks.OpenEntityRecord(entityName, key);
|
|
205
145
|
};
|
|
206
146
|
}
|
|
207
|
-
if (callbacks.UpdateUserState) {
|
|
208
|
-
wrapped.UpdateUserState = (state) => {
|
|
209
|
-
console.log(`[${componentName}] UpdateUserState called:`, state);
|
|
210
|
-
callbacks.UpdateUserState(state);
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
if (callbacks.NotifyEvent) {
|
|
214
|
-
wrapped.NotifyEvent = (event, data) => {
|
|
215
|
-
console.log(`[${componentName}] NotifyEvent called:`, { event, data });
|
|
216
|
-
callbacks.NotifyEvent(event, data);
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
147
|
return wrapped;
|
|
220
148
|
}
|
|
221
149
|
exports.wrapCallbacksWithLogging = wrapCallbacksWithLogging;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export interface ComponentProps {
|
|
|
46
46
|
callbacks: ComponentCallbacks;
|
|
47
47
|
components?: Record<string, any>;
|
|
48
48
|
styles?: ComponentStyles;
|
|
49
|
+
onStateChanged?: (stateUpdate: Record<string, any>) => void;
|
|
49
50
|
}
|
|
50
51
|
export interface ComponentCallbacks {
|
|
51
52
|
RefreshData?: () => void;
|
|
@@ -95,4 +96,5 @@ export interface ErrorBoundaryOptions {
|
|
|
95
96
|
logErrors?: boolean;
|
|
96
97
|
recovery?: 'retry' | 'reset' | 'none';
|
|
97
98
|
}
|
|
99
|
+
export * from './library-config';
|
|
98
100
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,iBAAiB;IAEhC,SAAS,EAAE,GAAG,CAAC;IAEf,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,IAAI,CAAC;IAEjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;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
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./library-config"), exports);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface ExternalLibraryConfig {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
category: 'core' | 'runtime' | 'ui' | 'charting' | 'utility';
|
|
6
|
+
globalVariable: string;
|
|
7
|
+
version: string;
|
|
8
|
+
cdnUrl: string;
|
|
9
|
+
cdnCssUrl?: string;
|
|
10
|
+
description: string;
|
|
11
|
+
aiInstructions?: string;
|
|
12
|
+
exampleUsage?: string;
|
|
13
|
+
isEnabled: boolean;
|
|
14
|
+
isCore: boolean;
|
|
15
|
+
isRuntimeOnly?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface LibraryConfigurationMetadata {
|
|
18
|
+
version: string;
|
|
19
|
+
lastUpdated: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface LibraryConfiguration {
|
|
23
|
+
libraries: ExternalLibraryConfig[];
|
|
24
|
+
metadata: LibraryConfigurationMetadata;
|
|
25
|
+
}
|
|
26
|
+
export interface LibraryLoadOptions {
|
|
27
|
+
skipIfLoaded?: boolean;
|
|
28
|
+
timeout?: number;
|
|
29
|
+
categories?: Array<ExternalLibraryConfig['category']>;
|
|
30
|
+
excludeRuntimeOnly?: boolean;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=library-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-config.d.ts","sourceRoot":"","sources":["../../src/types/library-config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IAEpC,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,WAAW,EAAE,MAAM,CAAC;IAGpB,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,UAAU,GAAG,SAAS,CAAC;IAG7D,cAAc,EAAE,MAAM,CAAC;IAGvB,OAAO,EAAE,MAAM,CAAC;IAGhB,MAAM,EAAE,MAAM,CAAC;IAGf,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,WAAW,EAAE,MAAM,CAAC;IAGpB,cAAc,CAAC,EAAE,MAAM,CAAC;IAGxB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,SAAS,EAAE,OAAO,CAAC;IAGnB,MAAM,EAAE,OAAO,CAAC;IAGhB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,qBAAqB,EAAE,CAAC;IACnC,QAAQ,EAAE,4BAA4B,CAAC;CACxC;AAKD,MAAM,WAAW,kBAAkB;IAEjC,YAAY,CAAC,EAAE,OAAO,CAAC;IAGvB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,UAAU,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC;IAGtD,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ExternalLibraryConfig } from '../types/library-config';
|
|
2
|
+
export declare const CORE_RUNTIME_LIBRARIES: ExternalLibraryConfig[];
|
|
3
|
+
export declare function getCoreRuntimeLibraries(): ExternalLibraryConfig[];
|
|
4
|
+
export declare function isCoreRuntimeLibrary(libraryId: string): boolean;
|
|
5
|
+
//# sourceMappingURL=core-libraries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-libraries.d.ts","sourceRoot":"","sources":["../../src/utilities/core-libraries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAMhE,eAAO,MAAM,sBAAsB,EAAE,qBAAqB,EAwCzD,CAAC;AAKF,wBAAgB,uBAAuB,IAAI,qBAAqB,EAAE,CAEjE;AAKD,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE/D"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isCoreRuntimeLibrary = exports.getCoreRuntimeLibraries = exports.CORE_RUNTIME_LIBRARIES = void 0;
|
|
4
|
+
exports.CORE_RUNTIME_LIBRARIES = [
|
|
5
|
+
{
|
|
6
|
+
id: 'react',
|
|
7
|
+
name: 'react',
|
|
8
|
+
displayName: 'React',
|
|
9
|
+
category: 'runtime',
|
|
10
|
+
globalVariable: 'React',
|
|
11
|
+
version: '18.2.0',
|
|
12
|
+
cdnUrl: 'https://unpkg.com/react@18.2.0/umd/react.production.min.js',
|
|
13
|
+
description: 'React core library',
|
|
14
|
+
isEnabled: true,
|
|
15
|
+
isCore: true,
|
|
16
|
+
isRuntimeOnly: true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: 'react-dom',
|
|
20
|
+
name: 'react-dom',
|
|
21
|
+
displayName: 'ReactDOM',
|
|
22
|
+
category: 'runtime',
|
|
23
|
+
globalVariable: 'ReactDOM',
|
|
24
|
+
version: '18.2.0',
|
|
25
|
+
cdnUrl: 'https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js',
|
|
26
|
+
description: 'React DOM library',
|
|
27
|
+
isEnabled: true,
|
|
28
|
+
isCore: true,
|
|
29
|
+
isRuntimeOnly: true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'babel-standalone',
|
|
33
|
+
name: '@babel/standalone',
|
|
34
|
+
displayName: 'Babel Standalone',
|
|
35
|
+
category: 'runtime',
|
|
36
|
+
globalVariable: 'Babel',
|
|
37
|
+
version: '7.24.4',
|
|
38
|
+
cdnUrl: 'https://unpkg.com/@babel/standalone@7.24.4/babel.min.js',
|
|
39
|
+
description: 'Babel compiler for JSX transformation',
|
|
40
|
+
isEnabled: true,
|
|
41
|
+
isCore: true,
|
|
42
|
+
isRuntimeOnly: true
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
function getCoreRuntimeLibraries() {
|
|
46
|
+
return exports.CORE_RUNTIME_LIBRARIES;
|
|
47
|
+
}
|
|
48
|
+
exports.getCoreRuntimeLibraries = getCoreRuntimeLibraries;
|
|
49
|
+
function isCoreRuntimeLibrary(libraryId) {
|
|
50
|
+
return exports.CORE_RUNTIME_LIBRARIES.some(lib => lib.id === libraryId);
|
|
51
|
+
}
|
|
52
|
+
exports.isCoreRuntimeLibrary = isCoreRuntimeLibrary;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StandardLibraries } from './standard-libraries';
|
|
2
|
+
import { LibraryConfiguration, ExternalLibraryConfig, LibraryLoadOptions as ConfigLoadOptions } from '../types/library-config';
|
|
2
3
|
interface LoadedResource {
|
|
3
4
|
element: HTMLScriptElement | HTMLLinkElement;
|
|
4
5
|
promise: Promise<any>;
|
|
@@ -20,12 +21,12 @@ export interface LibraryLoadResult {
|
|
|
20
21
|
}
|
|
21
22
|
export declare class LibraryLoader {
|
|
22
23
|
private static loadedResources;
|
|
23
|
-
static loadAllLibraries(): Promise<LibraryLoadResult>;
|
|
24
|
+
static loadAllLibraries(config?: LibraryConfiguration, additionalLibraries?: ExternalLibraryConfig[]): Promise<LibraryLoadResult>;
|
|
25
|
+
static loadLibrariesFromConfig(options?: ConfigLoadOptions): Promise<LibraryLoadResult>;
|
|
24
26
|
static loadLibraries(options: LibraryLoadOptions): Promise<LibraryLoadResult>;
|
|
25
27
|
private static loadScript;
|
|
26
28
|
private static loadCSS;
|
|
27
29
|
private static waitForScriptLoad;
|
|
28
|
-
private static getLibraryNameFromUrl;
|
|
29
30
|
static getLoadedResources(): Map<string, LoadedResource>;
|
|
30
31
|
static clearCache(): void;
|
|
31
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library-loader.d.ts","sourceRoot":"","sources":["../../src/utilities/library-loader.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"library-loader.d.ts","sourceRoot":"","sources":["../../src/utilities/library-loader.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,iBAAiB,EAElB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,kBAAkB,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAM/H,UAAU,cAAc;IACtB,OAAO,EAAE,iBAAiB,GAAG,eAAe,CAAC;IAC7C,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;CACvB;AAMD,MAAM,WAAW,kBAAkB;IAEjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,eAAe,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACzD;AAKD,MAAM,WAAW,iBAAiB;IAChC,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