@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.
@@ -1,27 +1,27 @@
1
-
2
- > @memberjunction/react-runtime@2.133.0 build
3
- > npm run build:node && npm run build:umd
4
-
5
-
6
- > @memberjunction/react-runtime@2.133.0 build:node
7
- > tsc
8
-
9
-
10
- > @memberjunction/react-runtime@2.133.0 build:umd
11
- > webpack --config webpack.umd.config.js
12
-
13
- (node:14304) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
14
- (Use `node --trace-deprecation ...` to show where the warning was created)
15
- [BABEL] Note: The code generator has deoptimised the styling of /home/runner/work/MJ/MJ/packages/MJCoreEntities/dist/generated/entity_subclasses.js as it exceeds the max of 500KB.
16
- asset runtime.umd.js 2.73 MiB [emitted] [minimized] [big] (name: main) 1 related asset
17
- orphan modules 513 KiB [orphan] 123 modules
18
- runtime modules 1010 bytes 5 modules
19
- modules by path ../../ 5.61 MiB
20
- modules by path ../../../node_modules/ 1.62 MiB 258 modules
21
- modules by path ../../MJCore/ 908 KiB 37 modules
22
- modules by path ../../MJGlobal/ 211 KiB 37 modules
23
- modules by path ../../MJCoreEntities/dist/ 2.73 MiB 23 modules
24
- modules by path ../../GraphQLDataProvider/ 133 KiB 22 modules
25
- modules by path ../../InteractiveComponents/dist/*.js 42.2 KiB 11 modules
26
- modules by path ./dist/ 453 KiB 28 modules
27
- webpack 5.92.1 compiled successfully in 149497 ms
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
+ â ™
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 runtime.umd.js 2.63 MiB [emitted] [minimized] [big] (name: main) 1 related asset
16
+ orphan modules 530 KiB [orphan] 125 modules
17
+ runtime modules 1010 bytes 5 modules
18
+ modules by path ../../ 5.51 MiB
19
+ modules by path ../../../node_modules/ 1.5 MiB 251 modules
20
+ modules by path ../../MJGlobal/ 211 KiB 37 modules
21
+ modules by path ../../MJCore/dist/ 839 KiB 34 modules
22
+ modules by path ../../MJCoreEntities/ 2.82 MiB 33 modules
23
+ modules by path ../../GraphQLDataProvider/ 133 KiB 22 modules
24
+ modules by path ../../InteractiveComponents/dist/*.js 39 KiB 11 modules
25
+ modules by path ./dist/ 421 KiB 28 modules
26
+ webpack 5.94.0 compiled successfully in 11714 ms
27
+ ⠙⠙
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 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,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;