@memberjunction/react-runtime 2.103.0 → 2.105.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,25 +1,25 @@
1
1
 
2
- > @memberjunction/react-runtime@2.103.0 build
2
+ > @memberjunction/react-runtime@2.105.0 build
3
3
  > npm run build:node && npm run build:umd
4
4
 
5
5
 
6
- > @memberjunction/react-runtime@2.103.0 build:node
6
+ > @memberjunction/react-runtime@2.105.0 build:node
7
7
  > tsc
8
8
 
9
9
 
10
- > @memberjunction/react-runtime@2.103.0 build:umd
10
+ > @memberjunction/react-runtime@2.105.0 build:umd
11
11
  > webpack --config webpack.umd.config.js
12
12
 
13
13
  [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.
14
- asset runtime.umd.js 2.32 MiB [emitted] [minimized] [big] (name: main) 1 related asset
14
+ asset runtime.umd.js 2.38 MiB [emitted] [minimized] [big] (name: main) 1 related asset
15
15
  orphan modules 513 KiB [orphan] 123 modules
16
16
  runtime modules 1010 bytes 5 modules
17
- modules by path ../../ 4.71 MiB
17
+ modules by path ../../ 4.81 MiB
18
18
  modules by path ../../../node_modules/ 1.62 MiB 258 modules
19
19
  modules by path ../../MJGlobal/ 174 KiB 35 modules
20
- modules by path ../../MJCore/ 644 KiB 31 modules
21
- modules by path ../../GraphQLDataProvider/ 111 KiB 22 modules
22
- modules by path ../../MJCoreEntities/dist/ 2.15 MiB 21 modules
20
+ modules by path ../../MJCore/ 645 KiB 31 modules
21
+ modules by path ../../MJCoreEntities/dist/ 2.25 MiB 26 modules
22
+ modules by path ../../GraphQLDataProvider/ 113 KiB 22 modules
23
23
  modules by path ../../InteractiveComponents/dist/*.js 36.8 KiB 10 modules
24
- modules by path ./dist/ 472 KiB 28 modules
25
- webpack 5.92.1 compiled successfully in 134689 ms
24
+ modules by path ./dist/ 473 KiB 28 modules
25
+ webpack 5.92.1 compiled successfully in 133533 ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,76 @@
1
1
  # @memberjunction/react-runtime
2
2
 
3
+ ## 2.105.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [4807f35]
8
+ - Updated dependencies [9b67e0c]
9
+ - @memberjunction/core-entities@2.105.0
10
+ - @memberjunction/graphql-dataprovider@2.105.0
11
+ - @memberjunction/interactive-component-types@2.105.0
12
+ - @memberjunction/core@2.105.0
13
+ - @memberjunction/global@2.105.0
14
+
15
+ ## 2.104.0
16
+
17
+ ### Patch Changes
18
+
19
+ - 4567af3: **Component Feedback System (Registry-Agnostic)**
20
+
21
+ Implement comprehensive component feedback system that works across any component registry (Skip, MJ Central, etc.) with support for custom feedback handlers.
22
+
23
+ - Add skip-component-feedback-panel component with sliding panel UI (444 lines CSS, 161 lines HTML, 274 lines TS)
24
+ - Add star ratings (0-5 scale), comments, and component hierarchy visualization
25
+ - Add FeedbackHandler interface for customizable feedback logic per registry
26
+ - Add ComponentFeedbackParams and ComponentFeedbackResponse types with full parameter set
27
+ - Add POST /api/v1/feedback endpoint to ComponentRegistryAPIServer
28
+ - Add submitFeedback() method to ComponentRegistryClient SDK
29
+ - Add SendComponentFeedback mutation to ComponentRegistryResolver (replaces AskSkipResolver implementation)
30
+ - Use ComponentRegistryClient SDK with REGISTRY*URI_OVERRIDE*_ and REGISTRY*API_KEY*_ support
31
+ - Update skip-artifact-viewer to use GraphQLComponentRegistryClient for feedback submission
32
+ - Extract registry name from component spec with fallback to 'Skip'
33
+ - Update dynamic-ui-component and linear-report with component hierarchy tracking
34
+ - Pass conversationID and authenticated user email for contact resolution
35
+
36
+ **React Runtime Debug Logging Enhancements**
37
+
38
+ Restore debug logging with production guards for better debugging capabilities.
39
+
40
+ - Restore 12 debug console.log statements throughout React runtime (prop-builder, component-hierarchy)
41
+ - Wrap all debug logs with LogStatus/GetProductionStatus checks
42
+ - Add comprehensive README.md documentation (95 lines) for debug configuration
43
+ - Logs only execute when not in production mode
44
+ - Update ReactDebugConfig with enhanced environment variable support
45
+
46
+ **AI Prompt Error Handling Improvements**
47
+
48
+ Replace hardcoded error truncation with configurable maxErrorLength parameter.
49
+
50
+ - Add maxErrorLength?: number property to AIPromptParams class
51
+ - Update AIPromptRunner.logError() to accept maxErrorLength in options
52
+ - Thread maxErrorLength through 18 logError calls throughout AIPromptRunner
53
+ - Remove hardcoded MAX_ERROR_LENGTH constant (500 chars)
54
+ - When undefined (default), errors are returned in full for debugging
55
+ - When set, errors are truncated with "... [truncated]" suffix
56
+
57
+ **Bug Fixes**
58
+
59
+ - Fix AI parameter extraction edge cases in AIPromptRunner and QueryEntity
60
+ - Fix mj.config.cjs configuration
61
+ - Fix component hierarchy tracking in dynamic reports
62
+
63
+ Addresses PR #1426 comments #5, #7, and #8
64
+
65
+ - Updated dependencies [2ff5428]
66
+ - Updated dependencies [4567af3]
67
+ - Updated dependencies [9ad6353]
68
+ - @memberjunction/global@2.104.0
69
+ - @memberjunction/graphql-dataprovider@2.104.0
70
+ - @memberjunction/core-entities@2.104.0
71
+ - @memberjunction/core@2.104.0
72
+ - @memberjunction/interactive-component-types@2.104.0
73
+
3
74
  ## 2.103.0
4
75
 
5
76
  ### Patch Changes
package/README.md CHANGED
@@ -591,6 +591,101 @@ The runtime uses SHA-256 hashing to ensure cached components are up-to-date:
591
591
  - **Local Registry** (`registry` field undefined): Components stored in local database
592
592
  - **External Registry** (`registry` field defined): Components fetched from remote registries via MJServer
593
593
 
594
+ ## Debug Configuration
595
+
596
+ The React runtime includes comprehensive debug logging that can be controlled via environment configuration. This is useful for troubleshooting component loading, compilation, and runtime issues.
597
+
598
+ ### Enabling Debug Mode
599
+
600
+ Debug mode controls verbose console logging throughout the React runtime. When enabled, you'll see detailed information about:
601
+
602
+ - Component compilation and registration
603
+ - Library loading and initialization
604
+ - Component lifecycle events
605
+ - Method registration and invocation
606
+ - Cache hits and misses
607
+ - Performance metrics
608
+
609
+ ### Configuration Methods
610
+
611
+ #### Option 1: Angular Environment (Recommended for MJExplorer)
612
+
613
+ Set the `DEBUG` flag in your Angular environment files:
614
+
615
+ ```typescript
616
+ // In environment.development.ts
617
+ export const environment = {
618
+ // ... other settings
619
+ DEBUG: true // Enable detailed debug logging
620
+ };
621
+
622
+ // In main.ts (before Angular bootstraps)
623
+ import { environment } from './environments/environment';
624
+ import { ReactDebugConfig } from '@memberjunction/ng-react';
625
+
626
+ ReactDebugConfig.setDebugMode(environment.DEBUG || false);
627
+ ```
628
+
629
+ #### Option 2: Window Global (For Quick Testing)
630
+
631
+ Useful for temporarily enabling debug mode without changing code:
632
+
633
+ ```typescript
634
+ // In browser console or before React components load
635
+ (window as any).__MJ_REACT_DEBUG_MODE__ = true;
636
+ ```
637
+
638
+ #### Option 3: Direct API Call
639
+
640
+ Call the API directly in your initialization code:
641
+
642
+ ```typescript
643
+ import { ReactDebugConfig } from '@memberjunction/ng-react';
644
+
645
+ // Enable debug mode
646
+ ReactDebugConfig.setDebugMode(true);
647
+
648
+ // Check current debug mode
649
+ const isDebug = ReactDebugConfig.getDebugMode();
650
+ ```
651
+
652
+ ### Debug Mode Priority
653
+
654
+ The debug mode follows this priority order (highest to lowest):
655
+
656
+ 1. **Window global override** (`__MJ_REACT_DEBUG_MODE__`) - Highest priority
657
+ 2. **Static property** (set via `setDebugMode()` or environment) - Default
658
+ 3. **Default** - `false` (debug disabled)
659
+
660
+ ### When to Enable Debug Mode
661
+
662
+ ✅ **Enable in these scenarios:**
663
+ - During local development
664
+ - When troubleshooting component loading failures
665
+ - When debugging component compilation errors
666
+ - When investigating library dependency issues
667
+ - When analyzing runtime performance
668
+
669
+ ❌ **Disable in these scenarios:**
670
+ - Production environments (cleaner console output)
671
+ - Staging environments (unless actively debugging)
672
+ - Performance profiling (reduces console overhead)
673
+ - Automated testing (reduces noise in logs)
674
+
675
+ ### Example Debug Output
676
+
677
+ When debug mode is enabled, you'll see output like:
678
+
679
+ ```
680
+ [ReactRuntime] Compiling component: Dashboard
681
+ [ReactRuntime] Component registered: Dashboard (namespace: analytics, version: 1.0.0)
682
+ [ReactRuntime] Loading library: lodash (version: 4.17.21)
683
+ [ReactRuntime] Library loaded successfully: lodash
684
+ [ReactRuntime] Cache hit for component: Chart@analytics:1.0.0
685
+ [ReactRuntime] Method registered: getCurrentDataState
686
+ [ReactRuntime] Component hierarchy loaded: 5 components in 234ms
687
+ ```
688
+
594
689
  ## Configuration
595
690
 
596
691
  ### Compiler Configuration
@@ -1 +1 @@
1
- {"version":3,"file":"component-hierarchy.d.ts","sourceRoot":"","sources":["../../src/runtime/component-hierarchy.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,cAAc,EAEf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAKvE,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,MAAM,EAAE,0BAA0B,EAAE,CAAC;IACrC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAEnB,YAAY,CAAC,EAAE,aAAa,CAAC;CAC9B;AAKD,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,GAAG,cAAc,GAAG,YAAY,CAAC;CACtD;AAKD,MAAM,WAAW,4BAA4B;IAE3C,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,eAAe,CA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AChB,OAAO,CAAC,cAAc;gBAFd,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,EAAE,iBAAiB,EAC3B,cAAc,EAAE,cAAc;YAM1B,sBAAsB;IA2C9B,iBAAiB,CACrB,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,2BAA2B,CAAC;IAuLjC,uBAAuB,CAC3B,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE;QACP,MAAM,CAAC,EAAE,eAAe,CAAC;QACzB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,YAAY,EAAE,sBAAsB,EAAE,CAAC;KACxC,GACA,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,0BAA0B,CAAA;KAAE,CAAC;YAuHtD,uBAAuB;CAyCtC;AAWD,wBAAsB,0BAA0B,CAC9C,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,EAAE,iBAAiB,EAC3B,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,2BAA2B,CAAC,CAGtC;AAOD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,EAAE,CA2BnE;AAOD,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,aAAa,GAAG,aAAa,EAAE,CASlF;AAQD,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,aAAa,EACvB,YAAY,GAAE,OAAe,GAC5B,MAAM,CAaR"}
@@ -47,7 +47,9 @@ class ComponentHierarchyRegistrar {
47
47
  version: spec.version || 'latest'
48
48
  });
49
49
  if (fullSpec && fullSpec.code) {
50
- console.log(`✅ [ComponentHierarchyRegistrar] Fetched external component ${spec.name} with code (${fullSpec.code.length} chars)`);
50
+ if (!(0, core_1.GetProductionStatus)()) {
51
+ (0, core_1.LogStatus)(`✅ [ComponentHierarchyRegistrar] Fetched external component ${spec.name} with code (${fullSpec.code.length} chars)`);
52
+ }
51
53
  return fullSpec;
52
54
  }
53
55
  else {
@@ -63,19 +65,22 @@ class ComponentHierarchyRegistrar {
63
65
  async registerHierarchy(rootSpec, options) {
64
66
  let resolvedRootSpec = rootSpec;
65
67
  if (rootSpec.location === 'registry' && rootSpec.registry && !rootSpec.code) {
66
- console.log(`🌐 [ComponentHierarchyRegistrar] Fetching external registry component: ${rootSpec.registry}/${rootSpec.name}`);
68
+ if (!(0, core_1.GetProductionStatus)()) {
69
+ (0, core_1.LogStatus)(`🌐 [ComponentHierarchyRegistrar] Fetching external registry component: ${rootSpec.registry}/${rootSpec.name}`);
70
+ }
67
71
  resolvedRootSpec = await this.fetchExternalComponent(rootSpec, options.contextUser) || rootSpec;
68
72
  }
69
73
  const { styles, namespace = 'Global', version = 'v1', continueOnError = true, allowOverride = true } = options;
70
- console.log('🌳 ComponentHierarchyRegistrar.registerHierarchy:', {
71
- rootComponent: resolvedRootSpec.name,
72
- hasLibraries: !!(resolvedRootSpec.libraries && resolvedRootSpec.libraries.length > 0),
73
- libraryCount: resolvedRootSpec.libraries?.length || 0,
74
- libraries: resolvedRootSpec.libraries?.map(l => l.name)
75
- });
76
74
  const registeredComponents = [];
77
75
  const errors = [];
78
76
  const warnings = [];
77
+ if (!(0, core_1.GetProductionStatus)()) {
78
+ (0, core_1.LogStatus)('🌳 ComponentHierarchyRegistrar.registerHierarchy:', undefined, {
79
+ rootComponent: resolvedRootSpec.name,
80
+ hasLibraries: !!(resolvedRootSpec.libraries && resolvedRootSpec.libraries.length > 0),
81
+ libraryCount: resolvedRootSpec.libraries?.length || 0
82
+ });
83
+ }
79
84
  const compiledMap = new Map();
80
85
  const specMap = new Map();
81
86
  const allLoadedLibraries = new Map();
@@ -108,7 +113,9 @@ class ComponentHierarchyRegistrar {
108
113
  result.loadedLibraries.forEach((value, key) => {
109
114
  if (!allLoadedLibraries.has(key)) {
110
115
  allLoadedLibraries.set(key, value);
111
- console.log(`📚 [registerHierarchy] Added library ${key} to accumulated libraries`);
116
+ if (!(0, core_1.GetProductionStatus)()) {
117
+ (0, core_1.LogStatus)(`📚 [registerHierarchy] Added library ${key} to accumulated libraries`);
118
+ }
112
119
  }
113
120
  });
114
121
  }
@@ -170,7 +177,9 @@ class ComponentHierarchyRegistrar {
170
177
  }
171
178
  allLoadedLibraries.forEach((value, key) => {
172
179
  this.runtimeContext.libraries[key] = value;
173
- console.log(`✅ [registerHierarchy] Added ${key} to runtime context libraries`);
180
+ if (!(0, core_1.GetProductionStatus)()) {
181
+ (0, core_1.LogStatus)(`✅ [registerHierarchy] Added ${key} to runtime context libraries`);
182
+ }
174
183
  });
175
184
  }
176
185
  for (const [name, compiled] of compiledMap) {
@@ -221,6 +230,13 @@ class ComponentHierarchyRegistrar {
221
230
  return false;
222
231
  return true;
223
232
  });
233
+ if (!(0, core_1.GetProductionStatus)()) {
234
+ (0, core_1.LogStatus)(`🔧 Compiling component ${spec.name} with libraries:`, undefined, {
235
+ originalCount: spec.libraries?.length || 0,
236
+ filteredCount: validLibraries?.length || 0,
237
+ libraries: validLibraries?.map(l => l.name) || []
238
+ });
239
+ }
224
240
  const compileOptions = {
225
241
  componentName: spec.name,
226
242
  componentCode: spec.code,
@@ -229,11 +245,6 @@ class ComponentHierarchyRegistrar {
229
245
  dependencies: spec.dependencies,
230
246
  allLibraries: options.allLibraries
231
247
  };
232
- console.log(`🔧 Compiling component ${spec.name} with libraries:`, {
233
- originalCount: spec.libraries?.length || 0,
234
- filteredCount: validLibraries?.length || 0,
235
- validLibraries: validLibraries?.map(l => ({ name: l.name, globalVariable: l.globalVariable }))
236
- });
237
248
  const compilationResult = await this.compiler.compile(compileOptions);
238
249
  if (!compilationResult.success) {
239
250
  return {
@@ -251,14 +262,18 @@ class ComponentHierarchyRegistrar {
251
262
  }
252
263
  compilationResult.loadedLibraries.forEach((value, key) => {
253
264
  this.runtimeContext.libraries[key] = value;
254
- console.log(`✅ [registerSingleComponent] Added ${key} to runtime context libraries`);
265
+ if (!(0, core_1.GetProductionStatus)()) {
266
+ (0, core_1.LogStatus)(`✅ [registerSingleComponent] Added ${key} to runtime context libraries`);
267
+ }
268
+ });
269
+ }
270
+ if (!(0, core_1.GetProductionStatus)()) {
271
+ (0, core_1.LogStatus)(`🏭 Calling factory for ${spec.name} with runtime context:`, undefined, {
272
+ hasReact: !!this.runtimeContext.React,
273
+ hasReactDOM: !!this.runtimeContext.ReactDOM,
274
+ libraryCount: Object.keys(this.runtimeContext.libraries || {}).length
255
275
  });
256
276
  }
257
- console.log(`🏭 Calling factory for ${spec.name} with runtime context:`, {
258
- hasReact: !!this.runtimeContext.React,
259
- hasReactDOM: !!this.runtimeContext.ReactDOM,
260
- libraryKeys: Object.keys(this.runtimeContext.libraries || {})
261
- });
262
277
  const componentObject = compilationResult.component.factory(this.runtimeContext, styles);
263
278
  this.registry.register(spec.name, componentObject, spec.namespace || namespace, version);
264
279
  return { success: true };
@@ -1 +1 @@
1
- {"version":3,"file":"component-hierarchy.js","sourceRoot":"","sources":["../../src/runtime/component-hierarchy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,+CAA0D;AAkD1D,MAAa,2BAA2B;IACtC,YACU,QAA2B,EAC3B,QAA2B,EAC3B,cAA8B;QAF9B,aAAQ,GAAR,QAAQ,CAAmB;QAC3B,aAAQ,GAAR,QAAQ,CAAmB;QAC3B,mBAAc,GAAd,cAAc,CAAgB;IACrC,CAAC;IAKI,KAAK,CAAC,sBAAsB,CAClC,IAAmB,EACnB,WAAsB;QAEtB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,eAAQ,EAAE,QAAQ,CAAC;YACpC,IAAI,CAAC,QAAQ,IAAI,CAAE,QAAgB,CAAC,UAAU,EAAE,CAAC;gBAC/C,OAAO,CAAC,IAAI,CAAC,4FAA4F,CAAC,CAAC;gBAC3G,OAAO,IAAI,C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ities for MemberJunction React Runtime.\n * Provides functionality to register a hierarchy of components from Skip component specifications.\n * @module @memberjunction/react-runtime/hierarchy\n */\n\nimport { \n CompilationResult,\n CompileOptions,\n RuntimeContext,\n CompiledComponent\n} from '../types';\nimport { ComponentCompiler } from '../compiler';\nimport { ComponentRegistry } from '../registry';\n\nimport { ComponentSpec, ComponentStyles } from '@memberjunction/interactive-component-types';\nimport { UserInfo, Metadata } from '@memberjunction/core';\nimport { ComponentLibraryEntity } from '@memberjunction/core-entities';\n\n/**\n * Result of a hierarchy registration operation\n */\nexport interface HierarchyRegistrationResult {\n success: boolean;\n registeredComponents: string[];\n errors: ComponentRegistrationError[];\n warnings: string[];\n /** The fully resolved component specification with all dependencies and libraries */\n resolvedSpec?: ComponentSpec;\n}\n\n/**\n * Error information for component registration\n */\nexport interface ComponentRegistrationError {\n componentName: string;\n error: string;\n phase: 'compilation' | 'registration' | 'validation';\n}\n\n/**\n * Options for hierarchy registration\n */\nexport interface HierarchyRegistrationOptions {\n /** Component styles to apply to all components */\n styles?: ComponentStyles;\n /** Namespace for component registration */\n namespace?: string;\n /** Version for component registration */\n version?: string;\n /** Whether to continue on errors */\n continueOnError?: boolean;\n /** Whether to override existing components */\n allowOverride?: boolean;\n /**\n * Required, metadata for all possible libraries allowed by the system\n */\n allLibraries: ComponentLibraryEntity[];\n debug?: boolean;\n /** Optional user context for fetching from external registries */\n contextUser?: UserInfo;\n}\n\n/**\n * Utility class for registering component hierarchies\n */\nexport class ComponentHierarchyRegistrar {\n constructor(\n private compiler: ComponentCompiler,\n private registry: ComponentRegistry,\n private runtimeContext: RuntimeContext\n ) {}\n \n /**\n * Fetches a component specification from an external registry\n */\n private async fetchExternalComponent(\n spec: ComponentSpec,\n contextUser?: UserInfo\n ): Promise<ComponentSpec | null> {\n try {\n const provider = Metadata?.Provider;\n if (!provider || !(provider as any).ExecuteGQL) {\n console.warn('⚠️ [ComponentHierarchyRegistrar] No GraphQL provider available for external registry fetch');\n return null;\n }\n \n // Dynamically import the GraphQL client to avoid circular dependencies\n const { GraphQLComponentRegistryClient } = await import('@memberjunction/graphql-dataprovider');\n const graphQLClient = new GraphQLComponentRegistryClient(provider as any);\n \n const fullSpec = await graphQLClient.GetRegistryComponent({\n registryName: spec.registry!,\n namespace: spec.namespace || 'Global',\n name: spec.name,\n version: spec.version || 'latest'\n });\n \n if (fullSpec && fullSpec.code) {\n console.log(`✅ [ComponentHierarchyRegistrar] Fetched external component ${spec.name} with code (${fullSpec.code.length} chars)`);\n return fullSpec;\n } else {\n console.warn(`⚠️ [ComponentHierarchyRegistrar] Failed to fetch external component ${spec.name} or no code`);\n return null;\n }\n } catch (error) {\n console.error(`❌ [ComponentHierarchyRegistrar] Error fetching external component ${spec.name}:`, error);\n return null;\n }\n }\n\n /**\n * Registers a complete component hierarchy from a root specification\n * @param rootSpec - The root component specification\n * @param options - Registration options\n * @returns Registration result with details about success/failures\n */\n async registerHierarchy(\n rootSpec: ComponentSpec,\n options: HierarchyRegistrationOptions\n ): Promise<HierarchyRegistrationResult> {\n // If this is an external registry component without code, fetch it first\n let resolvedRootSpec = rootSpec;\n if (rootSpec.location === 'registry' && rootSpec.registry && !rootSpec.code) {\n console.log(`🌐 [ComponentHierarchyRegistrar] Fetching external registry component: ${rootSpec.registry}/${rootSpec.name}`);\n resolvedRootSpec = await this.fetchExternalComponent(rootSpec, options.contextUser) || rootSpec;\n }\n const {\n styles,\n namespace = 'Global',\n version = 'v1',\n continueOnError = true,\n allowOverride = true\n } = options;\n\n console.log('🌳 ComponentHierarchyRegistrar.registerHierarchy:', {\n rootComponent: resolvedRootSpec.name,\n hasLibraries: !!(resolvedRootSpec.libraries && resolvedRootSpec.libraries.length > 0),\n libraryCount: resolvedRootSpec.libraries?.length || 0,\n libraries: resolvedRootSpec.libraries?.map(l => l.name)\n });\n\n const registeredComponents: string[] = [];\n const errors: ComponentRegistrationError[] = [];\n const warnings: string[] = [];\n\n // PHASE 1: Compile all components first (but defer factory execution)\n const compiledMap = new Map<string, CompiledComponent>();\n const specMap = new Map<string, ComponentSpec>();\n const allLoadedLibraries = new Map<string, any>(); // Track all loaded libraries\n \n // Helper to compile a component without calling its factory\n const compileOnly = async (spec: ComponentSpec): Promise<{ success: boolean; error?: ComponentRegistrationError }> => {\n if (!spec.code) return { success: true };\n \n try {\n // Filter out invalid library entries before compilation\n const validLibraries = spec.libraries?.filter(lib => {\n if (!lib || typeof lib !== 'object') return false;\n if (!lib.name || lib.name === 'unknown' || lib.name === 'null' || lib.name === 'undefined') return false;\n if (!lib.globalVariable || lib.globalVariable === 'undefined' || lib.globalVariable === 'null') return false;\n return true;\n });\n \n const compileOptions: CompileOptions = {\n componentName: spec.name,\n componentCode: spec.code,\n styles,\n libraries: validLibraries,\n dependencies: spec.dependencies,\n allLibraries: options.allLibraries\n };\n \n const result = await this.compiler.compile(compileOptions);\n if (result.success && result.component) {\n compiledMap.set(spec.name, result.component);\n specMap.set(spec.name, spec);\n \n // Extract and accumulate loaded libraries from the compilation\n if (result.loadedLibraries) {\n result.loadedLibraries.forEach((value, key) => {\n if (!allLoadedLibraries.has(key)) {\n allLoadedLibraries.set(key, value);\n console.log(`📚 [registerHierarchy] Added library ${key} to accumulated libraries`);\n }\n });\n }\n \n return { success: true };\n } else {\n return {\n success: false,\n error: {\n componentName: spec.name,\n error: result.error?.message || 'Unknown compilation error',\n phase: 'compilation'\n }\n };\n }\n } catch (error) {\n return {\n success: false,\n error: {\n componentName: spec.name,\n error: error instanceof Error ? error.message : String(error),\n phase: 'compilation'\n }\n };\n }\n };\n \n // Compile all components in hierarchy\n const compileQueue = [resolvedRootSpec];\n const visited = new Set<string>();\n \n while (compileQueue.length > 0) {\n let spec = compileQueue.shift()!;\n if (visited.has(spec.name)) continue;\n visited.add(spec.name);\n \n // If this is an external registry component without code, fetch it first\n if (spec.location === 'registry' && spec.registry && !spec.code) {\n const fetched = await this.fetchExternalComponent(spec, options.contextUser);\n if (fetched) {\n spec = fetched;\n } else {\n console.warn(`⚠️ [ComponentHierarchyRegistrar] Could not fetch external component ${spec.name}, skipping`);\n continue;\n }\n }\n \n const result = await compileOnly(spec);\n if (!result.success) {\n errors.push(result.error!);\n if (!continueOnError) {\n return { success: false, registeredComponents, errors, warnings, resolvedSpec: resolvedRootSpec };\n }\n }\n \n if (spec.dependencies) {\n compileQueue.push(...spec.dependencies);\n }\n }\n \n // Add all accumulated libraries to runtime context\n if (allLoadedLibraries.size > 0) {\n if (!this.runtimeContext.libraries) {\n this.runtimeContext.libraries = {};\n }\n allLoadedLibraries.forEach((value, key) => {\n this.runtimeContext.libraries![key] = value;\n console.log(`✅ [registerHierarchy] Added ${key} to runtime context libraries`);\n });\n }\n \n // PHASE 2: Execute all factories with components available\n for (const [name, compiled] of compiledMap) {\n const spec = specMap.get(name)!;\n \n // Build components object from all registered components\n const components: Record<string, any> = {};\n for (const [depName, depCompiled] of compiledMap) {\n // Call factory to get ComponentObject, then extract React component\n const depObject = depCompiled.factory(this.runtimeContext, styles);\n components[depName] = depObject.component;\n }\n \n // Now call factory with components available\n const componentObject = compiled.factory(this.runtimeContext, styles, components);\n \n // Register in registry\n this.registry.register(\n spec.name,\n componentObject,\n spec.namespace || namespace,\n version\n );\n \n registeredComponents.push(spec.name);\n }\n\n return {\n success: errors.length === 0,\n registeredComponents,\n errors,\n warnings,\n resolvedSpec: resolvedRootSpec\n };\n }\n\n /**\n * Registers a single component from a specification\n * @param spec - Component specification\n * @param options - Registration options\n * @returns Registration result for this component\n */\n async registerSingleComponent(\n spec: ComponentSpec,\n options: {\n styles?: ComponentStyles;\n namespace?: string;\n version?: string;\n allowOverride?: boolean;\n allLibraries: ComponentLibraryEntity[];\n }\n ): Promise<{ success: boolean; error?: ComponentRegistrationError }> {\n const { styles, namespace = 'Global', version = 'v1', allowOverride = true } = options;\n\n try {\n // Skip if no component code\n if (!spec.code) {\n return {\n success: true,\n error: undefined\n };\n }\n\n // Check if component already exists\n const existingComponent = this.registry.get(spec.name, namespace, version);\n if (existingComponent && !allowOverride) {\n return {\n success: false,\n error: {\n componentName: spec.name,\n error: `Component already registered in ${namespace}/${version}`,\n phase: 'registration'\n }\n };\n }\n\n // Filter out invalid library entries before compilation\n const validLibraries = spec.libraries?.filter(lib => {\n if (!lib || typeof lib !== 'object') return false;\n if (!lib.name || lib.name === 'unknown' || lib.name === 'null' || lib.name === 'undefined') return false;\n if (!lib.globalVariable || lib.globalVariable === 'undefined' || lib.globalVariable === 'null') return false;\n return true;\n });\n \n // Compile the component\n const compileOptions: CompileOptions = {\n componentName: spec.name,\n componentCode: spec.code,\n styles,\n libraries: validLibraries, // Pass along filtered library dependencies\n dependencies: spec.dependencies, // Pass along child component dependencies\n allLibraries: options.allLibraries\n };\n\n console.log(`🔧 Compiling component ${spec.name} with libraries:`, {\n originalCount: spec.libraries?.length || 0,\n filteredCount: validLibraries?.length || 0,\n validLibraries: validLibraries?.map(l => ({ name: l.name, globalVariable: l.globalVariable }))\n });\n\n const compilationResult = await this.compiler.compile(compileOptions);\n\n if (!compilationResult.success) {\n return {\n success: false,\n error: {\n componentName: spec.name,\n error: compilationResult.error?.message || 'Unknown compilation error',\n phase: 'compilation'\n }\n };\n }\n\n // Add loaded libraries to runtime context\n if (compilationResult.loadedLibraries && compilationResult.loadedLibraries.size > 0) {\n if (!this.runtimeContext.libraries) {\n this.runtimeContext.libraries = {};\n }\n compilationResult.loadedLibraries.forEach((value, key) => {\n this.runtimeContext.libraries![key] = value;\n console.log(`✅ [registerSingleComponent] Added ${key} to runtime context libraries`);\n });\n }\n\n // Call the factory to create the ComponentObject\n // IMPORTANT: We don't pass components here because child components may not be registered yet\n // Components are resolved later when the component is actually rendered\n console.log(`🏭 Calling factory for ${spec.name} with runtime context:`, {\n hasReact: !!this.runtimeContext.React,\n hasReactDOM: !!this.runtimeContext.ReactDOM,\n libraryKeys: Object.keys(this.runtimeContext.libraries || {})\n });\n const componentObject = compilationResult.component!.factory(this.runtimeContext, styles);\n\n // Register the full ComponentObject (not just the React component)\n this.registry.register(\n spec.name,\n componentObject,\n spec.namespace || namespace,\n version\n );\n\n return { success: true };\n\n } catch (error) {\n return {\n success: false,\n error: {\n componentName: spec.name,\n error: error instanceof Error ? error.message : String(error),\n phase: 'registration'\n }\n };\n }\n }\n\n /**\n * Recursively registers child components\n * @param children - Array of child component specifications\n * @param options - Registration options\n * @param registeredComponents - Array to track registered components\n * @param errors - Array to collect errors\n * @param warnings - Array to collect warnings\n */\n private async registerChildComponents(\n children: ComponentSpec[],\n options: HierarchyRegistrationOptions,\n registeredComponents: string[],\n errors: ComponentRegistrationError[],\n warnings: string[]\n ): Promise<void> {\n for (const child of children) {\n // Register this child\n const childResult = await this.registerSingleComponent(child, {\n styles: options.styles,\n namespace: options.namespace,\n version: options.version,\n allowOverride: options.allowOverride,\n allLibraries: options.allLibraries\n });\n\n if (childResult.success) {\n if (child.code) {\n registeredComponents.push(child.name);\n }\n } else {\n errors.push(childResult.error!);\n if (!options.continueOnError) {\n return;\n }\n }\n\n // Register nested children recursively\n const nestedChildren = child.dependencies || [];\n if (nestedChildren.length > 0) {\n await this.registerChildComponents(\n nestedChildren,\n options,\n registeredComponents,\n errors,\n warnings\n );\n }\n }\n }\n}\n\n/**\n * Convenience function to register a component hierarchy\n * @param rootSpec - The root component specification\n * @param compiler - Component compiler instance\n * @param registry - Component registry instance\n * @param runtimeContext - Runtime context with React and other libraries\n * @param options - Registration options\n * @returns Registration result\n */\nexport async function registerComponentHierarchy(\n rootSpec: ComponentSpec,\n compiler: ComponentCompiler,\n registry: ComponentRegistry,\n runtimeContext: RuntimeContext,\n options: HierarchyRegistrationOptions\n): Promise<HierarchyRegistrationResult> {\n const registrar = new ComponentHierarchyRegistrar(compiler, registry, runtimeContext);\n return registrar.registerHierarchy(rootSpec, options);\n}\n\n/**\n * Validates a component specification before registration\n * @param spec - Component specification to validate\n * @returns Array of validation errors (empty if valid)\n */\nexport function validateComponentSpec(spec: ComponentSpec): string[] {\n const errors: string[] = [];\n\n if (!spec.name) {\n errors.push('Component specification must have a name');\n }\n\n // If componentCode is provided, do basic validation\n if (spec.code) {\n if (typeof spec.code !== 'string') {\n errors.push(`Component code for ${spec.name} must be a string`);\n }\n if (spec.code.trim().length === 0) {\n errors.push(`Component code for ${spec.name} cannot be empty`);\n }\n }\n\n // Validate child components recursively\n const children = spec.dependencies || [];\n children.forEach((child, index) => {\n const childErrors = validateComponentSpec(child);\n childErrors.forEach(error => {\n errors.push(`Child ${index} (${child.name || 'unnamed'}): ${error}`);\n });\n });\n\n return errors;\n}\n\n/**\n * Flattens a component hierarchy into a list of all components\n * @param rootSpec - The root component specification\n * @returns Array of all component specifications in the hierarchy\n */\nexport function flattenComponentHierarchy(rootSpec: ComponentSpec): ComponentSpec[] {\n const components: ComponentSpec[] = [rootSpec];\n \n const children = rootSpec.dependencies || [];\n children.forEach(child => {\n components.push(...flattenComponentHierarchy(child));\n });\n\n return components;\n}\n\n/**\n * Counts the total number of components in a hierarchy\n * @param rootSpec - The root component specification\n * @param includeEmpty - Whether to include components without code\n * @returns Total component count\n */\nexport function countComponentsInHierarchy(\n rootSpec: ComponentSpec,\n includeEmpty: boolean = false\n): number {\n let count = 0;\n \n if (includeEmpty || rootSpec.code) {\n count = 1;\n }\n\n const children = rootSpec.dependencies || [];\n children.forEach(child => {\n count += countComponentsInHierarchy(child, includeEmpty);\n });\n\n return count;\n}"]}
1
+ {"version":3,"file":"component-hierarchy.js","sourceRoot":"","sources":["../../src/runtime/component-hierarchy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,+CAA0F;AAkD1F,MAAa,2BAA2B;IACtC,YACU,QAA2B,EAC3B,QAA2B,EAC3B,cAA8B;QAF9B,aAAQ,GAAR,QAAQ,CAAmB;QAC3B,aAAQ,GAAR,QAAQ,CAAmB;QAC3B,mBAAc,GAAd,cAAc,CAAgB;IACrC,CAAC;IAKI,KAAK,CAAC,sBAAsB,CAClC,IAAmB,EACnB,WAAsB;QAEtB,IAAI,CAAC;YACH,MAAM,QAAQ,GA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C,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC;AATD,8DASC;AAQD,SAAgB,0BAA0B,CACxC,QAAuB,EACvB,eAAwB,KAAK;IAE7B,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,IAAI,YAAY,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;QAClC,KAAK,GAAG,CAAC,CAAC;IACZ,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,IAAI,EAAE,CAAC;IAC7C,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACvB,KAAK,IAAI,0BAA0B,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC;AAhBD,gEAgBC","sourcesContent":["/**\n * @fileoverview Component hierarchy registration utilities for MemberJunction React Runtime.\n * Provides functionality to register a hierarchy of components from Skip component specifications.\n * @module @memberjunction/react-runtime/hierarchy\n */\n\nimport {\n CompilationResult,\n CompileOptions,\n RuntimeContext,\n CompiledComponent\n} from '../types';\nimport { ComponentCompiler } from '../compiler';\nimport { ComponentRegistry } from '../registry';\n\nimport { ComponentSpec, ComponentStyles } from '@memberjunction/interactive-component-types';\nimport { UserInfo, Metadata, LogStatus, GetProductionStatus } from '@memberjunction/core';\nimport { ComponentLibraryEntity } from '@memberjunction/core-entities';\n\n/**\n * Result of a hierarchy registration operation\n */\nexport interface HierarchyRegistrationResult {\n success: boolean;\n registeredComponents: string[];\n errors: ComponentRegistrationError[];\n warnings: string[];\n /** The fully resolved component specification with all dependencies and libraries */\n resolvedSpec?: ComponentSpec;\n}\n\n/**\n * Error information for component registration\n */\nexport interface ComponentRegistrationError {\n componentName: string;\n error: string;\n phase: 'compilation' | 'registration' | 'validation';\n}\n\n/**\n * Options for hierarchy registration\n */\nexport interface HierarchyRegistrationOptions {\n /** Component styles to apply to all components */\n styles?: ComponentStyles;\n /** Namespace for component registration */\n namespace?: string;\n /** Version for component registration */\n version?: string;\n /** Whether to continue on errors */\n continueOnError?: boolean;\n /** Whether to override existing components */\n allowOverride?: boolean;\n /**\n * Required, metadata for all possible libraries allowed by the system\n */\n allLibraries: ComponentLibraryEntity[];\n debug?: boolean;\n /** Optional user context for fetching from external registries */\n contextUser?: UserInfo;\n}\n\n/**\n * Utility class for registering component hierarchies\n */\nexport class ComponentHierarchyRegistrar {\n constructor(\n private compiler: ComponentCompiler,\n private registry: ComponentRegistry,\n private runtimeContext: RuntimeContext\n ) {}\n \n /**\n * Fetches a component specification from an external registry\n */\n private async fetchExternalComponent(\n spec: ComponentSpec,\n contextUser?: UserInfo\n ): Promise<ComponentSpec | null> {\n try {\n const provider = Metadata?.Provider;\n if (!provider || !(provider as any).ExecuteGQL) {\n console.warn('⚠️ [ComponentHierarchyRegistrar] No GraphQL provider available for external registry fetch');\n return null;\n }\n \n // Dynamically import the GraphQL client to avoid circular dependencies\n const { GraphQLComponentRegistryClient } = await import('@memberjunction/graphql-dataprovider');\n const graphQLClient = new GraphQLComponentRegistryClient(provider as any);\n \n const fullSpec = await graphQLClient.GetRegistryComponent({\n registryName: spec.registry!,\n namespace: spec.namespace || 'Global',\n name: spec.name,\n version: spec.version || 'latest'\n });\n\n if (fullSpec && fullSpec.code) {\n if (!GetProductionStatus()) {\n LogStatus(`✅ [ComponentHierarchyRegistrar] Fetched external component ${spec.name} with code (${fullSpec.code.length} chars)`);\n }\n return fullSpec;\n } else {\n console.warn(`⚠️ [ComponentHierarchyRegistrar] Failed to fetch external component ${spec.name} or no code`);\n return null;\n }\n } catch (error) {\n console.error(`❌ [ComponentHierarchyRegistrar] Error fetching external component ${spec.name}:`, error);\n return null;\n }\n }\n\n /**\n * Registers a complete component hierarchy from a root specification\n * @param rootSpec - The root component specification\n * @param options - Registration options\n * @returns Registration result with details about success/failures\n */\n async registerHierarchy(\n rootSpec: ComponentSpec,\n options: HierarchyRegistrationOptions\n ): Promise<HierarchyRegistrationResult> {\n // If this is an external registry component without code, fetch it first\n let resolvedRootSpec = rootSpec;\n if (rootSpec.location === 'registry' && rootSpec.registry && !rootSpec.code) {\n if (!GetProductionStatus()) {\n LogStatus(`🌐 [ComponentHierarchyRegistrar] Fetching external registry component: ${rootSpec.registry}/${rootSpec.name}`);\n }\n resolvedRootSpec = await this.fetchExternalComponent(rootSpec, options.contextUser) || rootSpec;\n }\n const {\n styles,\n namespace = 'Global',\n version = 'v1',\n continueOnError = true,\n allowOverride = true\n } = options;\n\n const registeredComponents: string[] = [];\n const errors: ComponentRegistrationError[] = [];\n const warnings: string[] = [];\n\n if (!GetProductionStatus()) {\n LogStatus('🌳 ComponentHierarchyRegistrar.registerHierarchy:', undefined, {\n rootComponent: resolvedRootSpec.name,\n hasLibraries: !!(resolvedRootSpec.libraries && resolvedRootSpec.libraries.length > 0),\n libraryCount: resolvedRootSpec.libraries?.length || 0\n });\n }\n\n // PHASE 1: Compile all components first (but defer factory execution)\n const compiledMap = new Map<string, CompiledComponent>();\n const specMap = new Map<string, ComponentSpec>();\n const allLoadedLibraries = new Map<string, any>(); // Track all loaded libraries\n \n // Helper to compile a component without calling its factory\n const compileOnly = async (spec: ComponentSpec): Promise<{ success: boolean; error?: ComponentRegistrationError }> => {\n if (!spec.code) return { success: true };\n \n try {\n // Filter out invalid library entries before compilation\n const validLibraries = spec.libraries?.filter(lib => {\n if (!lib || typeof lib !== 'object') return false;\n if (!lib.name || lib.name === 'unknown' || lib.name === 'null' || lib.name === 'undefined') return false;\n if (!lib.globalVariable || lib.globalVariable === 'undefined' || lib.globalVariable === 'null') return false;\n return true;\n });\n \n const compileOptions: CompileOptions = {\n componentName: spec.name,\n componentCode: spec.code,\n styles,\n libraries: validLibraries,\n dependencies: spec.dependencies,\n allLibraries: options.allLibraries\n };\n \n const result = await this.compiler.compile(compileOptions);\n if (result.success && result.component) {\n compiledMap.set(spec.name, result.component);\n specMap.set(spec.name, spec);\n \n // Extract and accumulate loaded libraries from the compilation\n if (result.loadedLibraries) {\n result.loadedLibraries.forEach((value, key) => {\n if (!allLoadedLibraries.has(key)) {\n allLoadedLibraries.set(key, value);\n if (!GetProductionStatus()) {\n LogStatus(`📚 [registerHierarchy] Added library ${key} to accumulated libraries`);\n }\n }\n });\n }\n \n return { success: true };\n } else {\n return {\n success: false,\n error: {\n componentName: spec.name,\n error: result.error?.message || 'Unknown compilation error',\n phase: 'compilation'\n }\n };\n }\n } catch (error) {\n return {\n success: false,\n error: {\n componentName: spec.name,\n error: error instanceof Error ? error.message : String(error),\n phase: 'compilation'\n }\n };\n }\n };\n \n // Compile all components in hierarchy\n const compileQueue = [resolvedRootSpec];\n const visited = new Set<string>();\n \n while (compileQueue.length > 0) {\n let spec = compileQueue.shift()!;\n if (visited.has(spec.name)) continue;\n visited.add(spec.name);\n \n // If this is an external registry component without code, fetch it first\n if (spec.location === 'registry' && spec.registry && !spec.code) {\n const fetched = await this.fetchExternalComponent(spec, options.contextUser);\n if (fetched) {\n spec = fetched;\n } else {\n console.warn(`⚠️ [ComponentHierarchyRegistrar] Could not fetch external component ${spec.name}, skipping`);\n continue;\n }\n }\n \n const result = await compileOnly(spec);\n if (!result.success) {\n errors.push(result.error!);\n if (!continueOnError) {\n return { success: false, registeredComponents, errors, warnings, resolvedSpec: resolvedRootSpec };\n }\n }\n \n if (spec.dependencies) {\n compileQueue.push(...spec.dependencies);\n }\n }\n \n // Add all accumulated libraries to runtime context\n if (allLoadedLibraries.size > 0) {\n if (!this.runtimeContext.libraries) {\n this.runtimeContext.libraries = {};\n }\n allLoadedLibraries.forEach((value, key) => {\n this.runtimeContext.libraries![key] = value;\n if (!GetProductionStatus()) {\n LogStatus(`✅ [registerHierarchy] Added ${key} to runtime context libraries`);\n }\n });\n }\n \n // PHASE 2: Execute all factories with components available\n for (const [name, compiled] of compiledMap) {\n const spec = specMap.get(name)!;\n \n // Build components object from all registered components\n const components: Record<string, any> = {};\n for (const [depName, depCompiled] of compiledMap) {\n // Call factory to get ComponentObject, then extract React component\n const depObject = depCompiled.factory(this.runtimeContext, styles);\n components[depName] = depObject.component;\n }\n \n // Now call factory with components available\n const componentObject = compiled.factory(this.runtimeContext, styles, components);\n \n // Register in registry\n this.registry.register(\n spec.name,\n componentObject,\n spec.namespace || namespace,\n version\n );\n \n registeredComponents.push(spec.name);\n }\n\n return {\n success: errors.length === 0,\n registeredComponents,\n errors,\n warnings,\n resolvedSpec: resolvedRootSpec\n };\n }\n\n /**\n * Registers a single component from a specification\n * @param spec - Component specification\n * @param options - Registration options\n * @returns Registration result for this component\n */\n async registerSingleComponent(\n spec: ComponentSpec,\n options: {\n styles?: ComponentStyles;\n namespace?: string;\n version?: string;\n allowOverride?: boolean;\n allLibraries: ComponentLibraryEntity[];\n }\n ): Promise<{ success: boolean; error?: ComponentRegistrationError }> {\n const { styles, namespace = 'Global', version = 'v1', allowOverride = true } = options;\n\n try {\n // Skip if no component code\n if (!spec.code) {\n return {\n success: true,\n error: undefined\n };\n }\n\n // Check if component already exists\n const existingComponent = this.registry.get(spec.name, namespace, version);\n if (existingComponent && !allowOverride) {\n return {\n success: false,\n error: {\n componentName: spec.name,\n error: `Component already registered in ${namespace}/${version}`,\n phase: 'registration'\n }\n };\n }\n\n // Filter out invalid library entries before compilation\n const validLibraries = spec.libraries?.filter(lib => {\n if (!lib || typeof lib !== 'object') return false;\n if (!lib.name || lib.name === 'unknown' || lib.name === 'null' || lib.name === 'undefined') return false;\n if (!lib.globalVariable || lib.globalVariable === 'undefined' || lib.globalVariable === 'null') return false;\n return true;\n });\n\n if (!GetProductionStatus()) {\n LogStatus(`🔧 Compiling component ${spec.name} with libraries:`, undefined, {\n originalCount: spec.libraries?.length || 0,\n filteredCount: validLibraries?.length || 0,\n libraries: validLibraries?.map(l => l.name) || []\n });\n }\n\n // Compile the component\n const compileOptions: CompileOptions = {\n componentName: spec.name,\n componentCode: spec.code,\n styles,\n libraries: validLibraries, // Pass along filtered library dependencies\n dependencies: spec.dependencies, // Pass along child component dependencies\n allLibraries: options.allLibraries\n };\n\n const compilationResult = await this.compiler.compile(compileOptions);\n\n if (!compilationResult.success) {\n return {\n success: false,\n error: {\n componentName: spec.name,\n error: compilationResult.error?.message || 'Unknown compilation error',\n phase: 'compilation'\n }\n };\n }\n\n // Add loaded libraries to runtime context\n if (compilationResult.loadedLibraries && compilationResult.loadedLibraries.size > 0) {\n if (!this.runtimeContext.libraries) {\n this.runtimeContext.libraries = {};\n }\n compilationResult.loadedLibraries.forEach((value, key) => {\n this.runtimeContext.libraries![key] = value;\n if (!GetProductionStatus()) {\n LogStatus(`✅ [registerSingleComponent] Added ${key} to runtime context libraries`);\n }\n });\n }\n\n // Call the factory to create the ComponentObject\n // IMPORTANT: We don't pass components here because child components may not be registered yet\n // Components are resolved later when the component is actually rendered\n if (!GetProductionStatus()) {\n LogStatus(`🏭 Calling factory for ${spec.name} with runtime context:`, undefined, {\n hasReact: !!this.runtimeContext.React,\n hasReactDOM: !!this.runtimeContext.ReactDOM,\n libraryCount: Object.keys(this.runtimeContext.libraries || {}).length\n });\n }\n const componentObject = compilationResult.component!.factory(this.runtimeContext, styles);\n\n // Register the full ComponentObject (not just the React component)\n this.registry.register(\n spec.name,\n componentObject,\n spec.namespace || namespace,\n version\n );\n\n return { success: true };\n\n } catch (error) {\n return {\n success: false,\n error: {\n componentName: spec.name,\n error: error instanceof Error ? error.message : String(error),\n phase: 'registration'\n }\n };\n }\n }\n\n /**\n * Recursively registers child components\n * @param children - Array of child component specifications\n * @param options - Registration options\n * @param registeredComponents - Array to track registered components\n * @param errors - Array to collect errors\n * @param warnings - Array to collect warnings\n */\n private async registerChildComponents(\n children: ComponentSpec[],\n options: HierarchyRegistrationOptions,\n registeredComponents: string[],\n errors: ComponentRegistrationError[],\n warnings: string[]\n ): Promise<void> {\n for (const child of children) {\n // Register this child\n const childResult = await this.registerSingleComponent(child, {\n styles: options.styles,\n namespace: options.namespace,\n version: options.version,\n allowOverride: options.allowOverride,\n allLibraries: options.allLibraries\n });\n\n if (childResult.success) {\n if (child.code) {\n registeredComponents.push(child.name);\n }\n } else {\n errors.push(childResult.error!);\n if (!options.continueOnError) {\n return;\n }\n }\n\n // Register nested children recursively\n const nestedChildren = child.dependencies || [];\n if (nestedChildren.length > 0) {\n await this.registerChildComponents(\n nestedChildren,\n options,\n registeredComponents,\n errors,\n warnings\n );\n }\n }\n }\n}\n\n/**\n * Convenience function to register a component hierarchy\n * @param rootSpec - The root component specification\n * @param compiler - Component compiler instance\n * @param registry - Component registry instance\n * @param runtimeContext - Runtime context with React and other libraries\n * @param options - Registration options\n * @returns Registration result\n */\nexport async function registerComponentHierarchy(\n rootSpec: ComponentSpec,\n compiler: ComponentCompiler,\n registry: ComponentRegistry,\n runtimeContext: RuntimeContext,\n options: HierarchyRegistrationOptions\n): Promise<HierarchyRegistrationResult> {\n const registrar = new ComponentHierarchyRegistrar(compiler, registry, runtimeContext);\n return registrar.registerHierarchy(rootSpec, options);\n}\n\n/**\n * Validates a component specification before registration\n * @param spec - Component specification to validate\n * @returns Array of validation errors (empty if valid)\n */\nexport function validateComponentSpec(spec: ComponentSpec): string[] {\n const errors: string[] = [];\n\n if (!spec.name) {\n errors.push('Component specification must have a name');\n }\n\n // If componentCode is provided, do basic validation\n if (spec.code) {\n if (typeof spec.code !== 'string') {\n errors.push(`Component code for ${spec.name} must be a string`);\n }\n if (spec.code.trim().length === 0) {\n errors.push(`Component code for ${spec.name} cannot be empty`);\n }\n }\n\n // Validate child components recursively\n const children = spec.dependencies || [];\n children.forEach((child, index) => {\n const childErrors = validateComponentSpec(child);\n childErrors.forEach(error => {\n errors.push(`Child ${index} (${child.name || 'unnamed'}): ${error}`);\n });\n });\n\n return errors;\n}\n\n/**\n * Flattens a component hierarchy into a list of all components\n * @param rootSpec - The root component specification\n * @returns Array of all component specifications in the hierarchy\n */\nexport function flattenComponentHierarchy(rootSpec: ComponentSpec): ComponentSpec[] {\n const components: ComponentSpec[] = [rootSpec];\n \n const children = rootSpec.dependencies || [];\n children.forEach(child => {\n components.push(...flattenComponentHierarchy(child));\n });\n\n return components;\n}\n\n/**\n * Counts the total number of components in a hierarchy\n * @param rootSpec - The root component specification\n * @param includeEmpty - Whether to include components without code\n * @returns Total component count\n */\nexport function countComponentsInHierarchy(\n rootSpec: ComponentSpec,\n includeEmpty: boolean = false\n): number {\n let count = 0;\n \n if (includeEmpty || rootSpec.code) {\n count = 1;\n }\n\n const children = rootSpec.dependencies || [];\n children.forEach(child => {\n count += countComponentsInHierarchy(child, includeEmpty);\n });\n\n return count;\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"prop-builder.d.ts","sourceRoot":"","sources":["../../src/runtime/prop-builder.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM1C,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;CAClC;AAaD,wBAAgB,mBAAmB,CACjC,IAAI,GAAE,GAAQ,EACd,SAAS,GAAE,GAAQ,EACnB,SAAS,GAAE,GAAQ,EACnB,SAAS,GAAE,kBAIV,EACD,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EACpC,MAAM,CAAC,EAAE,eAAe,EACxB,OAAO,GAAE,kBAAuB,EAChC,cAAc,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,GAC1D,cAAc,CA6BhB;AA0CD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,GAAG,EAAE,UAAU,GAAE,MAAa,GAAG,kBAAkB,CAkB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AC,EAAE,eAAe,EACxB,OAAO,GAAE,kBAAuB,EAChC,cAAc,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,GAC1D,cAAc,CA6BhB;AA0CD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,GAAG,EAAE,UAAU,GAAE,MAAa,GAAG,kBAAkB,CAkBhG;AAOD,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,CAKjD;AAOD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,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,CA+CpB;AAOD,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,CAmBhE"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractPropPaths = exports.wrapCallbacksWithLogging = exports.createPropsTransformer = exports.mergeProps = exports.validateComponentProps = exports.normalizeStyles = exports.normalizeCallbacks = exports.buildComponentProps = void 0;
4
+ const core_1 = require("@memberjunction/core");
4
5
  function buildComponentProps(data = {}, userState = {}, utilities = {}, callbacks = {
5
6
  OpenEntityRecord: () => { },
6
7
  RegisterMethod: () => { },
@@ -148,26 +149,34 @@ function wrapCallbacksWithLogging(callbacks, componentName) {
148
149
  Object.keys(callbacks).forEach(key => {
149
150
  if (key !== 'OpenEntityRecord' && key !== 'RegisterMethod' && key !== 'CreateSimpleNotification' && typeof callbacks[key] === 'function') {
150
151
  wrapped[key] = (...args) => {
151
- console.log(`[${componentName}] ${key} called with args:`, args);
152
+ if (!(0, core_1.GetProductionStatus)()) {
153
+ (0, core_1.LogStatus)(`[${componentName}] ${key} called with args:`, undefined, args);
154
+ }
152
155
  return callbacks[key](...args);
153
156
  };
154
157
  }
155
158
  });
156
159
  if (callbacks.OpenEntityRecord) {
157
160
  wrapped.OpenEntityRecord = (entityName, key) => {
158
- console.log(`[${componentName}] OpenEntityRecord called:`, { entityName, key });
161
+ if (!(0, core_1.GetProductionStatus)()) {
162
+ (0, core_1.LogStatus)(`[${componentName}] OpenEntityRecord called:`, undefined, { entityName, key });
163
+ }
159
164
  callbacks.OpenEntityRecord(entityName, key);
160
165
  };
161
166
  }
162
167
  if (callbacks.RegisterMethod) {
163
168
  wrapped.RegisterMethod = (methodName, handler) => {
164
- console.log(`[${componentName}] RegisterMethod called for:`, methodName);
169
+ if (!(0, core_1.GetProductionStatus)()) {
170
+ (0, core_1.LogStatus)(`[${componentName}] RegisterMethod called for:`, undefined, methodName);
171
+ }
165
172
  callbacks.RegisterMethod(methodName, handler);
166
173
  };
167
174
  }
168
175
  if (callbacks.CreateSimpleNotification) {
169
176
  wrapped.CreateSimpleNotification = (message, style, hideAfter) => {
170
- console.log(`[${componentName}] CreateSimpleNotification called:`, { message, style, hideAfter });
177
+ if (!(0, core_1.GetProductionStatus)()) {
178
+ (0, core_1.LogStatus)(`[${componentName}] CreateSimpleNotification called:`, undefined, { message, style, hideAfter });
179
+ }
171
180
  callbacks.CreateSimpleNotification(message, style, hideAfter);
172
181
  };
173
182
  }