@memberjunction/react-runtime 2.133.0 → 3.0.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 +27 -27
- package/CHANGELOG.md +10 -5
- package/dist/runtime/component-wrapper.d.ts +18 -0
- package/dist/runtime/component-wrapper.d.ts.map +1 -0
- package/dist/runtime/component-wrapper.js +108 -0
- package/dist/runtime.umd.js +4 -4
- package/dist/utilities/runtime-utilities.d.ts +10 -0
- package/dist/utilities/runtime-utilities.d.ts.map +1 -0
- package/dist/utilities/runtime-utilities.js +92 -0
- package/package.json +6 -6
- package/tsconfig.tsbuildinfo +1 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
[
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
modules by path
|
|
20
|
-
modules by path
|
|
21
|
-
modules by path ../../MJCore/
|
|
22
|
-
modules by path ../../
|
|
23
|
-
modules by path ../../
|
|
24
|
-
modules by path ../../
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @memberjunction/react-runtime@3.0.0 build
|
|
4
|
+
> npm run build:node && npm run build:umd
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
> @memberjunction/react-runtime@3.0.0 build:node
|
|
8
|
+
> tsc
|
|
9
|
+
|
|
10
|
+
â ™[1G[0K
|
|
11
|
+
> @memberjunction/react-runtime@3.0.0 build:umd
|
|
12
|
+
> webpack --config webpack.umd.config.js
|
|
13
|
+
|
|
14
|
+
[BABEL] Note: The code generator has deoptimised the styling of /Users/ethanlin/Projects/MJ/MJ/packages/MJCoreEntities/dist/generated/entity_subclasses.js as it exceeds the max of 500KB.
|
|
15
|
+
asset [1m[33mruntime.umd.js[39m[22m [1m[33m2.63 MiB[39m[22m [1m[32m[emitted][39m[22m [1m[32m[minimized][39m[22m [1m[33m[big][39m[22m (name: main) 1 related asset
|
|
16
|
+
orphan modules 530 KiB [1m[33m[orphan][39m[22m 125 modules
|
|
17
|
+
runtime modules 1010 bytes 5 modules
|
|
18
|
+
modules by path [1m../../[39m[22m 5.51 MiB
|
|
19
|
+
modules by path [1m../../../node_modules/[39m[22m 1.5 MiB 251 modules
|
|
20
|
+
modules by path [1m../../MJGlobal/[39m[22m 211 KiB 37 modules
|
|
21
|
+
modules by path [1m../../MJCore/dist/[39m[22m 839 KiB 34 modules
|
|
22
|
+
modules by path [1m../../MJCoreEntities/[39m[22m 2.82 MiB 33 modules
|
|
23
|
+
modules by path [1m../../GraphQLDataProvider/[39m[22m 133 KiB 22 modules
|
|
24
|
+
modules by path [1m../../InteractiveComponents/dist/*.js[39m[22m 39 KiB 11 modules
|
|
25
|
+
modules by path [1m./dist/[39m[22m 421 KiB 28 modules
|
|
26
|
+
webpack 5.94.0 compiled [1m[32msuccessfully[39m[22m in 11714 ms
|
|
27
|
+
â ™[1G[0Kâ ™[1G[0K
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @memberjunction/react-runtime
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @memberjunction/graphql-dataprovider@3.0.0
|
|
8
|
+
- @memberjunction/interactive-component-types@3.0.0
|
|
9
|
+
- @memberjunction/core@3.0.0
|
|
10
|
+
- @memberjunction/core-entities@3.0.0
|
|
11
|
+
- @memberjunction/global@3.0.0
|
|
12
|
+
|
|
3
13
|
## 2.133.0
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -400,7 +410,6 @@
|
|
|
400
410
|
- 4567af3: **Component Feedback System (Registry-Agnostic)**
|
|
401
411
|
|
|
402
412
|
Implement comprehensive component feedback system that works across any component registry (Skip, MJ Central, etc.) with support for custom feedback handlers.
|
|
403
|
-
|
|
404
413
|
- Add skip-component-feedback-panel component with sliding panel UI (444 lines CSS, 161 lines HTML, 274 lines TS)
|
|
405
414
|
- Add star ratings (0-5 scale), comments, and component hierarchy visualization
|
|
406
415
|
- Add FeedbackHandler interface for customizable feedback logic per registry
|
|
@@ -417,7 +426,6 @@
|
|
|
417
426
|
**React Runtime Debug Logging Enhancements**
|
|
418
427
|
|
|
419
428
|
Restore debug logging with production guards for better debugging capabilities.
|
|
420
|
-
|
|
421
429
|
- Restore 12 debug console.log statements throughout React runtime (prop-builder, component-hierarchy)
|
|
422
430
|
- Wrap all debug logs with LogStatus/GetProductionStatus checks
|
|
423
431
|
- Add comprehensive README.md documentation (95 lines) for debug configuration
|
|
@@ -427,7 +435,6 @@
|
|
|
427
435
|
**AI Prompt Error Handling Improvements**
|
|
428
436
|
|
|
429
437
|
Replace hardcoded error truncation with configurable maxErrorLength parameter.
|
|
430
|
-
|
|
431
438
|
- Add maxErrorLength?: number property to AIPromptParams class
|
|
432
439
|
- Update AIPromptRunner.logError() to accept maxErrorLength in options
|
|
433
440
|
- Thread maxErrorLength through 18 logError calls throughout AIPromptRunner
|
|
@@ -436,7 +443,6 @@
|
|
|
436
443
|
- When set, errors are truncated with "... [truncated]" suffix
|
|
437
444
|
|
|
438
445
|
**Bug Fixes**
|
|
439
|
-
|
|
440
446
|
- Fix AI parameter extraction edge cases in AIPromptRunner and QueryEntity
|
|
441
447
|
- Fix mj.config.cjs configuration
|
|
442
448
|
- Fix component hierarchy tracking in dynamic reports
|
|
@@ -458,7 +464,6 @@
|
|
|
458
464
|
|
|
459
465
|
- bd75336: ix: Improve React component system registry handling and chart
|
|
460
466
|
flexibility
|
|
461
|
-
|
|
462
467
|
- Enhanced component manager to optimize pre-registered component loading
|
|
463
468
|
by skipping redundant fetches
|
|
464
469
|
- Fixed SimpleChart component to accept any field for grouping, not just
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentProps, ComponentLifecycle } from '../types';
|
|
2
|
+
export interface WrapperOptions {
|
|
3
|
+
displayName?: string;
|
|
4
|
+
enableProfiling?: boolean;
|
|
5
|
+
logProps?: boolean;
|
|
6
|
+
lifecycle?: ComponentLifecycle;
|
|
7
|
+
defaultProps?: Partial<ComponentProps>;
|
|
8
|
+
}
|
|
9
|
+
export declare function wrapComponent(React: any, Component: any, options?: WrapperOptions): any;
|
|
10
|
+
export declare function memoizeComponent(React: any, Component: any, propsAreEqual?: (prevProps: any, nextProps: any) => boolean): any;
|
|
11
|
+
export declare function lazyComponent(React: any, loader: () => Promise<{
|
|
12
|
+
default: any;
|
|
13
|
+
}>, fallback?: any): any;
|
|
14
|
+
export declare function injectProps(React: any, Component: any, injectedProps: any): any;
|
|
15
|
+
export declare function conditionalComponent(React: any, Component: any, condition: boolean | ((props: any) => boolean), fallback?: any): any;
|
|
16
|
+
export declare function withErrorHandler(React: any, Component: any, errorHandler: (error: Error) => void): any;
|
|
17
|
+
export declare function portalComponent(React: any, ReactDOM: any, Component: any, container: Element | string): any;
|
|
18
|
+
//# sourceMappingURL=component-wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-wrapper.d.ts","sourceRoot":"","sources":["../../src/runtime/component-wrapper.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAK9D,MAAM,WAAW,cAAc;IAE7B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAE/B,YAAY,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CACxC;AASD,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,GAAE,cAAmB,GAAG,GAAG,CA+E3F;AASD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,GAAG,EACV,SAAS,EAAE,GAAG,EACd,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,KAAK,OAAO,GAC1D,GAAG,CAEL;AASD,wBAAgB,aAAa,CAC3B,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,CAAC,EACvC,QAAQ,CAAC,EAAE,GAAG,GACb,GAAG,CAYL;AASD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,GAAG,GAAG,CAK/E;AAUD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,GAAG,EACV,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,OAAO,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,EAC9C,QAAQ,CAAC,EAAE,GAAG,GACb,GAAG,CAUL;AASD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,GAAG,EACV,SAAS,EAAE,GAAG,EACd,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GACnC,GAAG,CAUL;AAUD,wBAAgB,eAAe,CAC7B,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,GAAG,EACb,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,OAAO,GAAG,MAAM,GAC1B,GAAG,CAqBL"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.portalComponent = exports.withErrorHandler = exports.conditionalComponent = exports.injectProps = exports.lazyComponent = exports.memoizeComponent = exports.wrapComponent = void 0;
|
|
4
|
+
function wrapComponent(React, Component, options = {}) {
|
|
5
|
+
const { displayName, enableProfiling = false, logProps = false, lifecycle = {}, defaultProps = {} } = options;
|
|
6
|
+
const WrappedComponent = React.forwardRef((props, ref) => {
|
|
7
|
+
const mergedProps = { ...defaultProps, ...props };
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
if (logProps) {
|
|
10
|
+
console.log(`[${displayName || Component.name}] Props:`, mergedProps);
|
|
11
|
+
}
|
|
12
|
+
}, [mergedProps]);
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
if (lifecycle.beforeMount) {
|
|
15
|
+
lifecycle.beforeMount();
|
|
16
|
+
}
|
|
17
|
+
if (lifecycle.afterMount) {
|
|
18
|
+
lifecycle.afterMount();
|
|
19
|
+
}
|
|
20
|
+
return () => {
|
|
21
|
+
if (lifecycle.beforeUnmount) {
|
|
22
|
+
lifecycle.beforeUnmount();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}, []);
|
|
26
|
+
const prevPropsRef = React.useRef(mergedProps);
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
const prevProps = prevPropsRef.current;
|
|
29
|
+
if (lifecycle.beforeUpdate) {
|
|
30
|
+
lifecycle.beforeUpdate(prevProps, mergedProps);
|
|
31
|
+
}
|
|
32
|
+
if (lifecycle.afterUpdate) {
|
|
33
|
+
Promise.resolve().then(() => {
|
|
34
|
+
lifecycle.afterUpdate(prevProps, mergedProps);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
prevPropsRef.current = mergedProps;
|
|
38
|
+
});
|
|
39
|
+
if (enableProfiling && React.Profiler) {
|
|
40
|
+
return React.createElement(React.Profiler, {
|
|
41
|
+
id: displayName || Component.name || 'WrappedComponent',
|
|
42
|
+
onRender: (id, phase, actualDuration) => {
|
|
43
|
+
console.log(`[Profiler] ${id} (${phase}): ${actualDuration.toFixed(2)}ms`);
|
|
44
|
+
}
|
|
45
|
+
}, React.createElement(Component, { ...mergedProps, ref }));
|
|
46
|
+
}
|
|
47
|
+
return React.createElement(Component, { ...mergedProps, ref });
|
|
48
|
+
});
|
|
49
|
+
WrappedComponent.displayName = displayName || `Wrapped(${Component.displayName || Component.name || 'Component'})`;
|
|
50
|
+
return WrappedComponent;
|
|
51
|
+
}
|
|
52
|
+
exports.wrapComponent = wrapComponent;
|
|
53
|
+
function memoizeComponent(React, Component, propsAreEqual) {
|
|
54
|
+
return React.memo(Component, propsAreEqual);
|
|
55
|
+
}
|
|
56
|
+
exports.memoizeComponent = memoizeComponent;
|
|
57
|
+
function lazyComponent(React, loader, fallback) {
|
|
58
|
+
const LazyComponent = React.lazy(loader);
|
|
59
|
+
if (fallback) {
|
|
60
|
+
return (props) => React.createElement(React.Suspense, { fallback }, React.createElement(LazyComponent, props));
|
|
61
|
+
}
|
|
62
|
+
return LazyComponent;
|
|
63
|
+
}
|
|
64
|
+
exports.lazyComponent = lazyComponent;
|
|
65
|
+
function injectProps(React, Component, injectedProps) {
|
|
66
|
+
return React.forwardRef((props, ref) => {
|
|
67
|
+
const mergedProps = { ...injectedProps, ...props };
|
|
68
|
+
return React.createElement(Component, { ...mergedProps, ref });
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
exports.injectProps = injectProps;
|
|
72
|
+
function conditionalComponent(React, Component, condition, fallback) {
|
|
73
|
+
return (props) => {
|
|
74
|
+
const shouldRender = typeof condition === 'function' ? condition(props) : condition;
|
|
75
|
+
if (shouldRender) {
|
|
76
|
+
return React.createElement(Component, props);
|
|
77
|
+
}
|
|
78
|
+
return fallback || null;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
exports.conditionalComponent = conditionalComponent;
|
|
82
|
+
function withErrorHandler(React, Component, errorHandler) {
|
|
83
|
+
return class extends React.Component {
|
|
84
|
+
componentDidCatch(error, errorInfo) {
|
|
85
|
+
errorHandler(error);
|
|
86
|
+
}
|
|
87
|
+
render() {
|
|
88
|
+
return React.createElement(Component, this.props);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
exports.withErrorHandler = withErrorHandler;
|
|
93
|
+
function portalComponent(React, ReactDOM, Component, container) {
|
|
94
|
+
return (props) => {
|
|
95
|
+
const [mountNode, setMountNode] = React.useState(null);
|
|
96
|
+
React.useEffect(() => {
|
|
97
|
+
const node = typeof container === 'string'
|
|
98
|
+
? document.querySelector(container)
|
|
99
|
+
: container;
|
|
100
|
+
setMountNode(node);
|
|
101
|
+
}, []);
|
|
102
|
+
if (!mountNode || !ReactDOM.createPortal) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
return ReactDOM.createPortal(React.createElement(Component, props), mountNode);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
exports.portalComponent = portalComponent;
|