@memberjunction/ng-react 5.21.0 → 5.23.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.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @fileoverview Runtime hook that fixes antd dropdown positioning
3
+ * when running inside Angular's CSS transform context.
4
+ *
5
+ * antd's popup positioning (via rc-trigger / dom-align) calculates wrong
6
+ * coordinates inside Angular because Angular applies CSS transforms that
7
+ * break getBoundingClientRect-based positioning. This hook:
8
+ *
9
+ * 1. Injects a CSS rule using !important with CSS custom properties to
10
+ * override antd's inline left/top values. The fallback (-9999px) hides
11
+ * dropdowns until positioned, preventing flash-of-wrong-position.
12
+ *
13
+ * 2. Creates a MutationObserver that catches dropdown elements when
14
+ * added to the DOM and sets the CSS variables to correct viewport-
15
+ * relative coordinates based on the trigger element's position.
16
+ *
17
+ * This hook is Angular-specific and should only be registered when
18
+ * running inside an Angular host application.
19
+ *
20
+ * @module @memberjunction/ng-react
21
+ */
22
+ import { RuntimeHook } from '@memberjunction/react-runtime';
23
+ /**
24
+ * Creates a RuntimeHook that fixes antd dropdown positioning inside Angular.
25
+ * Uses position:absolute (antd's default) rather than position:fixed to
26
+ * preserve antd's virtual scroll behavior inside dropdown panels.
27
+ */
28
+ export declare function createAntdDropdownPositionHook(): RuntimeHook;
@@ -0,0 +1,81 @@
1
+ const DROPDOWN_SELECTOR = '.ant-select-dropdown, .ant-picker-dropdown, .ant-cascader-dropdown';
2
+ const TRIGGER_SELECTOR = '.ant-select-open, .ant-picker-focused, .ant-dropdown-open';
3
+ /**
4
+ * Creates a RuntimeHook that fixes antd dropdown positioning inside Angular.
5
+ * Uses position:absolute (antd's default) rather than position:fixed to
6
+ * preserve antd's virtual scroll behavior inside dropdown panels.
7
+ */
8
+ export function createAntdDropdownPositionHook() {
9
+ let observer = null;
10
+ let styleElement = null;
11
+ const fixDropdown = (dd) => {
12
+ if (dd.hasAttribute('data-pos-fixed'))
13
+ return;
14
+ const trigger = document.querySelector(TRIGGER_SELECTOR);
15
+ if (!trigger)
16
+ return;
17
+ const tRect = trigger.getBoundingClientRect();
18
+ const op = dd.offsetParent;
19
+ if (op) {
20
+ // Position relative to offset parent (keeps position:absolute working)
21
+ const opRect = op.getBoundingClientRect();
22
+ dd.style.setProperty('--dd-left', `${tRect.left - opRect.left}px`);
23
+ dd.style.setProperty('--dd-top', `${tRect.bottom - opRect.top + 2}px`);
24
+ }
25
+ else {
26
+ // No offset parent — fall back to viewport coordinates
27
+ dd.style.setProperty('--dd-left', `${tRect.left}px`);
28
+ dd.style.setProperty('--dd-top', `${tRect.bottom + 2}px`);
29
+ }
30
+ dd.setAttribute('data-pos-fixed', '1');
31
+ };
32
+ return {
33
+ name: 'antd-dropdown-position-fix',
34
+ OnFirstRootCreated(_context) {
35
+ if (typeof document === 'undefined')
36
+ return;
37
+ // CSS !important overrides antd's inline left/top permanently.
38
+ // CSS custom properties (--dd-left, --dd-top) are set per-element from JS.
39
+ // Fallback of -9999px hides dropdowns until the observer positions them.
40
+ styleElement = document.createElement('style');
41
+ styleElement.textContent =
42
+ DROPDOWN_SELECTOR +
43
+ ' { left: var(--dd-left, -9999px) !important; top: var(--dd-top, -9999px) !important; z-index: 99999 !important; }';
44
+ document.head.appendChild(styleElement);
45
+ // Watch for dropdown elements being added to the DOM.
46
+ // Only watches childList (not attributes) to avoid firing during scroll/hover.
47
+ observer = new MutationObserver((mutations) => {
48
+ for (const m of mutations) {
49
+ const addedNodes = Array.from(m.addedNodes);
50
+ for (const node of addedNodes) {
51
+ if (node.nodeType !== 1)
52
+ continue;
53
+ const el = node;
54
+ // Check if the added node itself is a dropdown
55
+ if (el.className && typeof el.className === 'string' &&
56
+ /\bant-(select|picker|cascader)-dropdown\b/.test(el.className)) {
57
+ fixDropdown(el);
58
+ }
59
+ // Check descendants (dropdown may be nested inside a wrapper)
60
+ if (el.querySelectorAll) {
61
+ const nested = el.querySelectorAll(DROPDOWN_SELECTOR);
62
+ nested.forEach((n) => fixDropdown(n));
63
+ }
64
+ }
65
+ }
66
+ });
67
+ observer.observe(document.body, { childList: true, subtree: true });
68
+ },
69
+ OnCleanup() {
70
+ if (observer) {
71
+ observer.disconnect();
72
+ observer = null;
73
+ }
74
+ if (styleElement && styleElement.parentNode) {
75
+ styleElement.parentNode.removeChild(styleElement);
76
+ styleElement = null;
77
+ }
78
+ }
79
+ };
80
+ }
81
+ //# sourceMappingURL=antd-dropdown-position-hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"antd-dropdown-position-hook.js","sourceRoot":"","sources":["../../../src/lib/hooks/antd-dropdown-position-hook.ts"],"names":[],"mappings":"AAuBA,MAAM,iBAAiB,GAAG,oEAAoE,CAAC;AAC/F,MAAM,gBAAgB,GAAG,2DAA2D,CAAC;AAErF;;;;GAIG;AACH,MAAM,UAAU,8BAA8B;IAC5C,IAAI,QAAQ,GAA4B,IAAI,CAAC;IAC7C,IAAI,YAAY,GAA4B,IAAI,CAAC;IAEjD,MAAM,WAAW,GAAG,CAAC,EAAe,EAAQ,EAAE;QAC5C,IAAI,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC;YAAE,OAAO;QAC9C,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QACzD,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,MAAM,KAAK,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;QAC9C,MAAM,EAAE,GAAG,EAAE,CAAC,YAAkC,CAAC;QAEjD,IAAI,EAAE,EAAE,CAAC;YACP,uEAAuE;YACvE,MAAM,MAAM,GAAG,EAAE,CAAC,qBAAqB,EAAE,CAAC;YAC1C,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC;YACnE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,EAAE,GAAG,KAAK,CAAC,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AAI,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;4BACnE,WAAW,CAAC,EAAE,CAAC,CAAC;wBAClB,CAAC;wBAED,8DAA8D;wBAC9D,IAAI,EAAE,CAAC,gBAAgB,EAAE,CAAC;4BACxB,MAAM,MAAM,GAAG,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;4BACtD,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAgB,CAAC,CAAC,CAAC;wBACvD,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QACtE,CAAC;QAED,SAAS;YACP,IAAI,QAAQ,EAAE,CAAC;gBACb,QAAQ,CAAC,UAAU,EAAE,CAAC;gBACtB,QAAQ,GAAG,IAAI,CAAC;YAClB,CAAC;YACD,IAAI,YAAY,IAAI,YAAY,CAAC,UAAU,EAAE,CAAC;gBAC5C,YAAY,CAAC,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;gBAClD,YAAY,GAAG,IAAI,CAAC;YACtB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @fileoverview Runtime hook that fixes antd dropdown positioning\n * when running inside Angular's CSS transform context.\n *\n * antd's popup positioning (via rc-trigger / dom-align) calculates wrong\n * coordinates inside Angular because Angular applies CSS transforms that\n * break getBoundingClientRect-based positioning. This hook:\n *\n * 1. Injects a CSS rule using !important with CSS custom properties to\n * override antd's inline left/top values. The fallback (-9999px) hides\n * dropdowns until positioned, preventing flash-of-wrong-position.\n *\n * 2. Creates a MutationObserver that catches dropdown elements when\n * added to the DOM and sets the CSS variables to correct viewport-\n * relative coordinates based on the trigger element's position.\n *\n * This hook is Angular-specific and should only be registered when\n * running inside an Angular host application.\n *\n * @module @memberjunction/ng-react\n */\nimport { RuntimeHook, RootHookContext } from '@memberjunction/react-runtime';\n\nconst DROPDOWN_SELECTOR = '.ant-select-dropdown, .ant-picker-dropdown, .ant-cascader-dropdown';\nconst TRIGGER_SELECTOR = '.ant-select-open, .ant-picker-focused, .ant-dropdown-open';\n\n/**\n * Creates a RuntimeHook that fixes antd dropdown positioning inside Angular.\n * Uses position:absolute (antd's default) rather than position:fixed to\n * preserve antd's virtual scroll behavior inside dropdown panels.\n */\nexport function createAntdDropdownPositionHook(): RuntimeHook {\n let observer: MutationObserver | null = null;\n let styleElement: HTMLStyleElement | null = null;\n\n const fixDropdown = (dd: HTMLElement): void => {\n if (dd.hasAttribute('data-pos-fixed')) return;\n const trigger = document.querySelector(TRIGGER_SELECTOR);\n if (!trigger) return;\n\n const tRect = trigger.getBoundingClientRect();\n const op = dd.offsetParent as HTMLElement | null;\n\n if (op) {\n // Position relative to offset parent (keeps position:absolute working)\n const opRect = op.getBoundingClientRect();\n dd.style.setProperty('--dd-left', `${tRect.left - opRect.left}px`);\n dd.style.setProperty('--dd-top', `${tRect.bottom - opRect.top + 2}px`);\n } else {\n // No offset parent — fall back to viewport coordinates\n dd.style.setProperty('--dd-left', `${tRect.left}px`);\n dd.style.setProperty('--dd-top', `${tRect.bottom + 2}px`);\n }\n dd.setAttribute('data-pos-fixed', '1');\n };\n\n return {\n name: 'antd-dropdown-position-fix',\n\n OnFirstRootCreated(_context: RootHookContext): void {\n if (typeof document === 'undefined') return;\n\n // CSS !important overrides antd's inline left/top permanently.\n // CSS custom properties (--dd-left, --dd-top) are set per-element from JS.\n // Fallback of -9999px hides dropdowns until the observer positions them.\n styleElement = document.createElement('style');\n styleElement.textContent =\n DROPDOWN_SELECTOR +\n ' { left: var(--dd-left, -9999px) !important; top: var(--dd-top, -9999px) !important; z-index: 99999 !important; }';\n document.head.appendChild(styleElement);\n\n // Watch for dropdown elements being added to the DOM.\n // Only watches childList (not attributes) to avoid firing during scroll/hover.\n observer = new MutationObserver((mutations) => {\n for (const m of mutations) {\n const addedNodes = Array.from(m.addedNodes);\n for (const node of addedNodes) {\n if (node.nodeType !== 1) continue;\n const el = node as HTMLElement;\n\n // Check if the added node itself is a dropdown\n if (el.className && typeof el.className === 'string' &&\n /\\bant-(select|picker|cascader)-dropdown\\b/.test(el.className)) {\n fixDropdown(el);\n }\n\n // Check descendants (dropdown may be nested inside a wrapper)\n if (el.querySelectorAll) {\n const nested = el.querySelectorAll(DROPDOWN_SELECTOR);\n nested.forEach((n) => fixDropdown(n as HTMLElement));\n }\n }\n }\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n },\n\n OnCleanup(): void {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n if (styleElement && styleElement.parentNode) {\n styleElement.parentNode.removeChild(styleElement);\n styleElement = null;\n }\n }\n };\n}\n"]}
@@ -11,6 +11,23 @@ export declare class AngularAdapterService {
11
11
  private runtimeContext?;
12
12
  private initializationPromise;
13
13
  constructor(scriptLoader: ScriptLoaderService);
14
+ /**
15
+ * Eagerly start loading the React runtime in the background.
16
+ * Call this at app startup (e.g., in APP_INITIALIZER or after auth) so that
17
+ * React, ReactDOM, and Babel are already downloaded from CDN by the time the
18
+ * user opens an interactive component artifact.
19
+ *
20
+ * Two-phase approach:
21
+ * 1. Immediately inject `<link rel="preload">` hints so the browser starts
22
+ * downloading the CDN scripts in parallel with other page work.
23
+ * 2. Fire-and-forget `initialize()` which creates `<script>` tags and
24
+ * executes them. If the preload hints already fetched the bytes, the
25
+ * script load is nearly instant (served from HTTP cache).
26
+ *
27
+ * Safe to call multiple times — the underlying initialize() deduplicates.
28
+ * Does not block: returns immediately, initialization continues in background.
29
+ */
30
+ preload(): void;
14
31
  /**
15
32
  * Initialize the React runtime with Angular-specific configuration
16
33
  * @param config Optional library configuration
@@ -4,7 +4,7 @@
4
4
  * @module @memberjunction/ng-react
5
5
  */
6
6
  import { Injectable } from '@angular/core';
7
- import { createReactRuntime, SetupStyles } from '@memberjunction/react-runtime';
7
+ import { createReactRuntime, LibraryLoader, SetupStyles } from '@memberjunction/react-runtime';
8
8
  import { ScriptLoaderService } from './script-loader.service';
9
9
  import * as i0 from "@angular/core";
10
10
  import * as i1 from "./script-loader.service";
@@ -16,6 +16,30 @@ export class AngularAdapterService {
16
16
  constructor(scriptLoader) {
17
17
  this.scriptLoader = scriptLoader;
18
18
  }
19
+ /**
20
+ * Eagerly start loading the React runtime in the background.
21
+ * Call this at app startup (e.g., in APP_INITIALIZER or after auth) so that
22
+ * React, ReactDOM, and Babel are already downloaded from CDN by the time the
23
+ * user opens an interactive component artifact.
24
+ *
25
+ * Two-phase approach:
26
+ * 1. Immediately inject `<link rel="preload">` hints so the browser starts
27
+ * downloading the CDN scripts in parallel with other page work.
28
+ * 2. Fire-and-forget `initialize()` which creates `<script>` tags and
29
+ * executes them. If the preload hints already fetched the bytes, the
30
+ * script load is nearly instant (served from HTTP cache).
31
+ *
32
+ * Safe to call multiple times — the underlying initialize() deduplicates.
33
+ * Does not block: returns immediately, initialization continues in background.
34
+ */
35
+ preload() {
36
+ // Phase 1: Inject browser preload hints for CDN scripts
37
+ LibraryLoader.preloadCoreScripts();
38
+ // Phase 2: Fire-and-forget full initialization (script execution + runtime setup)
39
+ this.initialize().catch(err => {
40
+ console.warn('React runtime preload failed (will retry on demand):', err);
41
+ });
42
+ }
19
43
  /**
20
44
  * Initialize the React runtime with Angular-specific configuration
21
45
  * @param config Optional library configuration
@@ -1 +1 @@
1
- {"version":3,"file":"angular-adapter.service.js","sourceRoot":"","sources":["../../../src/lib/services/angular-adapter.service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAKL,kBAAkB,EAKlB,WAAW,EACZ,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;;;AAG9D;;;GAGG;AAEH,MAAM,OAAO,qBAA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AAS,CAAC,IAAI,EAAE;gBACnC,OAAO,EAAE,CAAC,OAAO,CAAC;gBAClB,QAAQ,EAAE,QAAQ,IAAI,eAAe;aACtC,CAAC,CAAC;YACH,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;sHA/QU,qBAAqB;uEAArB,qBAAqB,WAArB,qBAAqB,mBADR,MAAM;;iFACnB,qBAAqB;cADjC,UAAU;eAAC,EAAE,UAAU,EAAE,MAAM,EAAE","sourcesContent":["/**\n * @fileoverview Angular adapter service that bridges the React runtime with Angular.\n * Provides Angular-specific functionality for the platform-agnostic React runtime.\n * @module @memberjunction/ng-react\n */\n\nimport { Injectable } from '@angular/core';\nimport { \n ComponentCompiler,\n ComponentRegistry,\n ComponentResolver,\n ComponentManager,\n createReactRuntime,\n CompileOptions,\n RuntimeContext,\n ExternalLibraryConfig,\n LibraryConfiguration,\n SetupStyles\n} from '@memberjunction/react-runtime';\nimport { ScriptLoaderService } from './script-loader.service';\nimport { ComponentStyles } from '@memberjunction/interactive-component-types';\n\n/**\n * Angular-specific adapter for the React runtime.\n * Manages the integration between Angular services and the platform-agnostic React runtime.\n */\n@Injectable({ providedIn: 'root' })\nexport class AngularAdapterService {\n private runtime?: {\n compiler: ComponentCompiler;\n registry: ComponentRegistry;\n resolver: ComponentResolver;\n manager: ComponentManager;\n version: string;\n };\n private runtimeContext?: RuntimeContext;\n private initializationPromise: Promise<void> | undefined;\n\n constructor(private scriptLoader: ScriptLoaderService) {}\n\n /**\n * Initialize the React runtime with Angular-specific configuration\n * @param config Optional library configuration\n * @param additionalLibraries Optional additional libraries to merge\n * @param options Optional options including debug flag\n * @returns Promise resolving when runtime is ready\n */\n async initialize(\n config?: LibraryConfiguration,\n additionalLibraries?: ExternalLibraryConfig[],\n options?: { debug?: boolean }\n ): Promise<void> {\n if (this.runtime) {\n return; // Already initialized\n }\n if (this.initializationPromise) {\n return this.initializationPromise; // in progress\n }\n\n // Start initialization and store the promise immediately\n this.initializationPromise = this.doInitialize(config, additionalLibraries, options);\n\n try {\n await this.initializationPromise;\n } catch (error) {\n // Clear the promise on error so it can be retried\n this.initializationPromise = undefined;\n throw error;\n }\n\n return;\n }\n\n private async doInitialize(\n config?: LibraryConfiguration,\n additionalLibraries?: ExternalLibraryConfig[],\n options?: { debug?: boolean }\n ): Promise<void> {\n // Load React ecosystem with optional additional libraries\n const ecosystem = await this.scriptLoader.loadReactEcosystem(config, additionalLibraries, options);\n \n // Create runtime context\n this.runtimeContext = {\n React: ecosystem.React,\n ReactDOM: ecosystem.ReactDOM,\n libraries: ecosystem.libraries,\n utilities: {\n // Add any Angular-specific utilities here\n }\n };\n\n // Create the React runtime with runtime context for registry support\n this.runtime = createReactRuntime(ecosystem.Babel, {\n compiler: {\n cache: true,\n maxCacheSize: 100,\n debug: options?.debug\n },\n registry: {\n maxComponents: 1000,\n cleanupInterval: 60000,\n useLRU: true,\n enableNamespaces: true,\n debug: options?.debug\n }\n }, this.runtimeContext, options?.debug);\n }\n\n /**\n * Get the component compiler\n * @returns Component compiler instance\n */\n getCompiler(): ComponentCompiler {\n if (!this.runtime) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtime.compiler;\n }\n\n /**\n * Get the component registry\n * @returns Component registry instance\n */\n getRegistry(): ComponentRegistry {\n if (!this.runtime) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtime.registry;\n }\n\n /**\n * Get the component resolver\n * @returns Component resolver instance\n */\n getResolver(): ComponentResolver {\n if (!this.runtime) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtime.resolver;\n }\n\n /**\n * Get the runtime context\n * @returns Runtime context with React and libraries\n */\n getRuntimeContext(): RuntimeContext {\n if (!this.runtimeContext) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtimeContext;\n }\n\n /**\n * Get the unified component manager\n * @returns Component manager instance\n */\n getComponentManager(): ComponentManager {\n if (!this.runtime) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtime.manager;\n }\n\n\n /**\n * Compile a component with Angular-specific defaults\n * @param options - Compilation options\n * @returns Promise resolving to compilation result\n */\n async compileComponent(options: CompileOptions) {\n // Validate options before initialization\n if (!options) {\n throw new Error(\n 'Angular adapter error: No compilation options provided.\\n' +\n 'This usually means the component spec is null or undefined.\\n' +\n 'Please check that:\\n' +\n '1. Your component data is loaded properly\\n' +\n '2. The component spec has \"name\" and \"code\" properties\\n' +\n '3. The component input is not undefined'\n );\n }\n\n if (!options.componentName || options.componentName.trim() === '') {\n throw new Error(\n 'Angular adapter error: Component name is missing or empty.\\n' +\n `Received options: ${JSON.stringify(options, null, 2)}\\n` +\n 'Make sure your component spec includes a \"name\" property.'\n );\n }\n\n if (!options.componentCode || options.componentCode.trim() === '') {\n throw new Error(\n `Angular adapter error: Component code is missing or empty for component \"${options.componentName}\".\\n` +\n 'Make sure your component spec includes a \"code\" property with the React component source.'\n );\n }\n\n await this.initialize();\n \n // Apply default styles if not provided\n const optionsWithDefaults = {\n ...options,\n styles: options.styles || SetupStyles()\n };\n\n return this.runtime!.compiler.compile(optionsWithDefaults);\n }\n\n /**\n * Register a component in the registry\n * @param name - Component name\n * @param component - Compiled component\n * @param namespace - Component namespace\n * @param version - Component version\n * @returns Component metadata\n */\n registerComponent(\n name: string,\n component: any,\n namespace: string = 'Global',\n version: string = 'v1'\n ) {\n if (!this.runtime) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtime.registry.register(name, component, namespace, version);\n }\n\n /**\n * Get a component from the registry\n * @param name - Component name\n * @param namespace - Component namespace\n * @param version - Component version\n * @returns Component if found\n */\n getComponent(name: string, namespace: string = 'Global', version?: string) {\n if (!this.runtime) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtime.registry.get(name, namespace, version);\n }\n\n /**\n * Check if runtime is initialized\n * @returns true if initialized\n */\n isInitialized(): boolean {\n return !!this.runtime && !!this.runtimeContext;\n }\n\n /**\n * Get runtime version\n * @returns Runtime version string\n */\n getVersion(): string {\n return this.runtime?.version || 'unknown';\n }\n\n /**\n * Clean up resources\n */\n destroy(): void {\n if (this.runtime) {\n this.runtime.registry.destroy();\n this.runtime = undefined;\n this.runtimeContext = undefined;\n }\n }\n\n /**\n * Get Babel instance for direct use\n * @returns Babel instance\n */\n getBabel(): any {\n return this.runtimeContext?.libraries?.Babel || (window as any).Babel;\n }\n\n /**\n * Transpile JSX code directly\n * @param code - JSX code to transpile\n * @param filename - Optional filename for better error messages\n * @returns Transpiled JavaScript code\n */\n transpileJSX(code: string, filename?: string): string {\n const babel = this.getBabel();\n if (!babel) {\n throw new Error('Babel not loaded. Initialize the runtime first.');\n }\n\n try {\n const result = babel.transform(code, {\n presets: ['react'],\n filename: filename || 'component.jsx'\n });\n return result.code;\n } catch (error: any) {\n throw new Error(`Failed to transpile JSX: ${error.message}`);\n }\n }\n}"]}
1
+ {"version":3,"file":"angular-adapter.service.js","sourceRoot":"","sources":["../../../src/lib/services/angular-adapter.service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAKL,kBAAkB,EAKlB,aAAa,EACb,WAAW,EACZ,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;;;AAG9D;;;GAGG;AAEH,MAAM,OAAO,qBAAqB;IAWhC,YAAoB,YAAiC;QAAjC,iBAAY,GAAZ,YAAY,CAAqB;IAAG,CAAC;IAEzD;;;;;;;;;;;;;;;OAeG;IACH,OAAO;QACL,wDAAwD;QACxD,aAAa,CAAC,kBAAkB,EAAE,CAAC;QAEnC,kFAAkF;QAClF,IAAI,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,GAAG,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;YACH,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE;gBACnC,OAAO,EAAE,CAAC,OAAO,CAAC;gBAClB,QAAQ,EAAE,QAAQ,IAAI,eAAe;aACtC,CAAC,CAAC;YACH,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;sHAzSU,qBAAqB;uEAArB,qBAAqB,WAArB,qBAAqB,mBADR,MAAM;;iFACnB,qBAAqB;cADjC,UAAU;eAAC,EAAE,UAAU,EAAE,MAAM,EAAE","sourcesContent":["/**\n * @fileoverview Angular adapter service that bridges the React runtime with Angular.\n * Provides Angular-specific functionality for the platform-agnostic React runtime.\n * @module @memberjunction/ng-react\n */\n\nimport { Injectable } from '@angular/core';\nimport {\n ComponentCompiler,\n ComponentRegistry,\n ComponentResolver,\n ComponentManager,\n createReactRuntime,\n CompileOptions,\n RuntimeContext,\n ExternalLibraryConfig,\n LibraryConfiguration,\n LibraryLoader,\n SetupStyles\n} from '@memberjunction/react-runtime';\nimport { ScriptLoaderService } from './script-loader.service';\nimport { ComponentStyles } from '@memberjunction/interactive-component-types';\n\n/**\n * Angular-specific adapter for the React runtime.\n * Manages the integration between Angular services and the platform-agnostic React runtime.\n */\n@Injectable({ providedIn: 'root' })\nexport class AngularAdapterService {\n private runtime?: {\n compiler: ComponentCompiler;\n registry: ComponentRegistry;\n resolver: ComponentResolver;\n manager: ComponentManager;\n version: string;\n };\n private runtimeContext?: RuntimeContext;\n private initializationPromise: Promise<void> | undefined;\n\n constructor(private scriptLoader: ScriptLoaderService) {}\n\n /**\n * Eagerly start loading the React runtime in the background.\n * Call this at app startup (e.g., in APP_INITIALIZER or after auth) so that\n * React, ReactDOM, and Babel are already downloaded from CDN by the time the\n * user opens an interactive component artifact.\n *\n * Two-phase approach:\n * 1. Immediately inject `<link rel=\"preload\">` hints so the browser starts\n * downloading the CDN scripts in parallel with other page work.\n * 2. Fire-and-forget `initialize()` which creates `<script>` tags and\n * executes them. If the preload hints already fetched the bytes, the\n * script load is nearly instant (served from HTTP cache).\n *\n * Safe to call multiple times — the underlying initialize() deduplicates.\n * Does not block: returns immediately, initialization continues in background.\n */\n preload(): void {\n // Phase 1: Inject browser preload hints for CDN scripts\n LibraryLoader.preloadCoreScripts();\n\n // Phase 2: Fire-and-forget full initialization (script execution + runtime setup)\n this.initialize().catch(err => {\n console.warn('React runtime preload failed (will retry on demand):', err);\n });\n }\n\n /**\n * Initialize the React runtime with Angular-specific configuration\n * @param config Optional library configuration\n * @param additionalLibraries Optional additional libraries to merge\n * @param options Optional options including debug flag\n * @returns Promise resolving when runtime is ready\n */\n async initialize(\n config?: LibraryConfiguration,\n additionalLibraries?: ExternalLibraryConfig[],\n options?: { debug?: boolean }\n ): Promise<void> {\n if (this.runtime) {\n return; // Already initialized\n }\n if (this.initializationPromise) {\n return this.initializationPromise; // in progress\n }\n\n // Start initialization and store the promise immediately\n this.initializationPromise = this.doInitialize(config, additionalLibraries, options);\n\n try {\n await this.initializationPromise;\n } catch (error) {\n // Clear the promise on error so it can be retried\n this.initializationPromise = undefined;\n throw error;\n }\n\n return;\n }\n\n private async doInitialize(\n config?: LibraryConfiguration,\n additionalLibraries?: ExternalLibraryConfig[],\n options?: { debug?: boolean }\n ): Promise<void> {\n // Load React ecosystem with optional additional libraries\n const ecosystem = await this.scriptLoader.loadReactEcosystem(config, additionalLibraries, options);\n \n // Create runtime context\n this.runtimeContext = {\n React: ecosystem.React,\n ReactDOM: ecosystem.ReactDOM,\n libraries: ecosystem.libraries,\n utilities: {\n // Add any Angular-specific utilities here\n }\n };\n\n // Create the React runtime with runtime context for registry support\n this.runtime = createReactRuntime(ecosystem.Babel, {\n compiler: {\n cache: true,\n maxCacheSize: 100,\n debug: options?.debug\n },\n registry: {\n maxComponents: 1000,\n cleanupInterval: 60000,\n useLRU: true,\n enableNamespaces: true,\n debug: options?.debug\n }\n }, this.runtimeContext, options?.debug);\n }\n\n /**\n * Get the component compiler\n * @returns Component compiler instance\n */\n getCompiler(): ComponentCompiler {\n if (!this.runtime) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtime.compiler;\n }\n\n /**\n * Get the component registry\n * @returns Component registry instance\n */\n getRegistry(): ComponentRegistry {\n if (!this.runtime) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtime.registry;\n }\n\n /**\n * Get the component resolver\n * @returns Component resolver instance\n */\n getResolver(): ComponentResolver {\n if (!this.runtime) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtime.resolver;\n }\n\n /**\n * Get the runtime context\n * @returns Runtime context with React and libraries\n */\n getRuntimeContext(): RuntimeContext {\n if (!this.runtimeContext) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtimeContext;\n }\n\n /**\n * Get the unified component manager\n * @returns Component manager instance\n */\n getComponentManager(): ComponentManager {\n if (!this.runtime) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtime.manager;\n }\n\n\n /**\n * Compile a component with Angular-specific defaults\n * @param options - Compilation options\n * @returns Promise resolving to compilation result\n */\n async compileComponent(options: CompileOptions) {\n // Validate options before initialization\n if (!options) {\n throw new Error(\n 'Angular adapter error: No compilation options provided.\\n' +\n 'This usually means the component spec is null or undefined.\\n' +\n 'Please check that:\\n' +\n '1. Your component data is loaded properly\\n' +\n '2. The component spec has \"name\" and \"code\" properties\\n' +\n '3. The component input is not undefined'\n );\n }\n\n if (!options.componentName || options.componentName.trim() === '') {\n throw new Error(\n 'Angular adapter error: Component name is missing or empty.\\n' +\n `Received options: ${JSON.stringify(options, null, 2)}\\n` +\n 'Make sure your component spec includes a \"name\" property.'\n );\n }\n\n if (!options.componentCode || options.componentCode.trim() === '') {\n throw new Error(\n `Angular adapter error: Component code is missing or empty for component \"${options.componentName}\".\\n` +\n 'Make sure your component spec includes a \"code\" property with the React component source.'\n );\n }\n\n await this.initialize();\n \n // Apply default styles if not provided\n const optionsWithDefaults = {\n ...options,\n styles: options.styles || SetupStyles()\n };\n\n return this.runtime!.compiler.compile(optionsWithDefaults);\n }\n\n /**\n * Register a component in the registry\n * @param name - Component name\n * @param component - Compiled component\n * @param namespace - Component namespace\n * @param version - Component version\n * @returns Component metadata\n */\n registerComponent(\n name: string,\n component: any,\n namespace: string = 'Global',\n version: string = 'v1'\n ) {\n if (!this.runtime) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtime.registry.register(name, component, namespace, version);\n }\n\n /**\n * Get a component from the registry\n * @param name - Component name\n * @param namespace - Component namespace\n * @param version - Component version\n * @returns Component if found\n */\n getComponent(name: string, namespace: string = 'Global', version?: string) {\n if (!this.runtime) {\n throw new Error('React runtime not initialized. Call initialize() first.');\n }\n return this.runtime.registry.get(name, namespace, version);\n }\n\n /**\n * Check if runtime is initialized\n * @returns true if initialized\n */\n isInitialized(): boolean {\n return !!this.runtime && !!this.runtimeContext;\n }\n\n /**\n * Get runtime version\n * @returns Runtime version string\n */\n getVersion(): string {\n return this.runtime?.version || 'unknown';\n }\n\n /**\n * Clean up resources\n */\n destroy(): void {\n if (this.runtime) {\n this.runtime.registry.destroy();\n this.runtime = undefined;\n this.runtimeContext = undefined;\n }\n }\n\n /**\n * Get Babel instance for direct use\n * @returns Babel instance\n */\n getBabel(): any {\n return this.runtimeContext?.libraries?.Babel || (window as any).Babel;\n }\n\n /**\n * Transpile JSX code directly\n * @param code - JSX code to transpile\n * @param filename - Optional filename for better error messages\n * @returns Transpiled JavaScript code\n */\n transpileJSX(code: string, filename?: string): string {\n const babel = this.getBabel();\n if (!babel) {\n throw new Error('Babel not loaded. Initialize the runtime first.');\n }\n\n try {\n const result = babel.transform(code, {\n presets: ['react'],\n filename: filename || 'component.jsx'\n });\n return result.code;\n } catch (error: any) {\n throw new Error(`Failed to transpile JSX: ${error.message}`);\n }\n }\n}"]}
@@ -7,7 +7,9 @@ import { Injectable } from '@angular/core';
7
7
  import { BehaviorSubject, firstValueFrom } from 'rxjs';
8
8
  import { filter } from 'rxjs/operators';
9
9
  import { AngularAdapterService } from './angular-adapter.service';
10
+ import { reactRootManager } from '@memberjunction/react-runtime';
10
11
  import { ReactDebugConfig } from '../config/react-debug.config';
12
+ import { createAntdDropdownPositionHook } from '../hooks/antd-dropdown-position-hook';
11
13
  import * as i0 from "@angular/core";
12
14
  import * as i1 from "./angular-adapter.service";
13
15
  /**
@@ -42,6 +44,8 @@ export class ReactBridgeService {
42
44
  console.log(`ReactBridgeService: Initializing React with debug mode = ${this.debug} (from ReactDebugConfig)`);
43
45
  // Pass debug flag to get development builds when debug is enabled
44
46
  await this.adapter.initialize(undefined, undefined, { debug: this.debug });
47
+ // Register Angular-specific runtime hooks for library compatibility
48
+ reactRootManager.RegisterHook(createAntdDropdownPositionHook());
45
49
  if (this.debug) {
46
50
  console.log('React ecosystem pre-loaded successfully with DEVELOPMENT builds (detailed error messages)');
47
51
  }
@@ -177,6 +181,8 @@ export class ReactBridgeService {
177
181
  // Reset readiness state
178
182
  this.reactReadySubject.next(false);
179
183
  this.firstComponentAttempted = false;
184
+ // Clean up runtime hooks (disconnects observers, removes injected styles, etc.)
185
+ reactRootManager.cleanup();
180
186
  // Clean up adapter
181
187
  this.adapter.destroy();
182
188
  }
@@ -1 +1 @@
1
- {"version":3,"file":"react-bridge.service.js","sourceRoot":"","sources":["../../../src/lib/services/react-bridge.service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA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GG;IACH,mBAAmB;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAC9B,CAAC;mHAvMU,kBAAkB;uEAAlB,kBAAkB,WAAlB,kBAAkB,mBADL,MAAM;;iFACnB,kBAAkB;cAD9B,UAAU;eAAC,EAAE,UAAU,EAAE,MAAM,EAAE","sourcesContent":["/**\n * @fileoverview Service to manage React and ReactDOM instances with proper lifecycle.\n * Bridges Angular components with React rendering capabilities.\n * @module @memberjunction/ng-react\n */\n\nimport { Injectable, OnDestroy } from '@angular/core';\nimport { BehaviorSubject, firstValueFrom } from 'rxjs';\nimport { filter } from 'rxjs/operators';\nimport { AngularAdapterService } from './angular-adapter.service';\nimport { RuntimeContext } from '@memberjunction/react-runtime';\nimport { ReactDebugConfig } from '../config/react-debug.config';\n\n/**\n * Service to manage React and ReactDOM instances with proper lifecycle.\n * Provides methods for creating and managing React roots in Angular applications.\n */\n@Injectable({ providedIn: 'root' })\nexport class ReactBridgeService implements OnDestroy {\n private reactRoots = new Set<any>();\n \n // Track React readiness state\n private reactReadySubject = new BehaviorSubject<boolean>(false);\n public reactReady$ = this.reactReadySubject.asObservable();\n \n // Track if this is the first component trying to use React\n private firstComponentAttempted = false;\n private maxWaitTime = 5000; // Maximum 5 seconds wait time\n private checkInterval = 200; // Check every 200ms\n \n // Debug flag from project configuration\n public debug: boolean = ReactDebugConfig.getDebugMode();\n\n constructor(private adapter: AngularAdapterService) {\n // Bootstrap React immediately on service initialization\n this.bootstrapReact();\n }\n\n ngOnDestroy(): void {\n this.cleanup();\n }\n\n /**\n * Bootstrap React early during service initialization\n */\n private async bootstrapReact(): Promise<void> {\n try {\n // Log the debug mode being used\n console.log(`ReactBridgeService: Initializing React with debug mode = ${this.debug} (from ReactDebugConfig)`);\n \n // Pass debug flag to get development builds when debug is enabled\n await this.adapter.initialize(undefined, undefined, { debug: this.debug });\n \n if (this.debug) {\n console.log('React ecosystem pre-loaded successfully with DEVELOPMENT builds (detailed error messages)');\n } else {\n console.log('React ecosystem pre-loaded successfully with PRODUCTION builds (minified)');\n }\n } catch (error) {\n console.error('Failed to pre-load React ecosystem:', error);\n }\n }\n\n /**\n * Wait for React to be ready, with special handling for first component\n */\n async waitForReactReady(): Promise<void> {\n // If already ready, return immediately\n if (this.reactReadySubject.value) {\n return;\n }\n\n // Check if this is the first component attempting to use React\n const isFirstComponent = !this.firstComponentAttempted;\n this.firstComponentAttempted = true;\n\n if (isFirstComponent) {\n // First component - check periodically until React is ready\n if (this.debug) {\n console.log('First React component loading - checking for React initialization');\n }\n \n const startTime = Date.now();\n \n while (Date.now() - startTime < this.maxWaitTime) {\n try {\n const testDiv = document.createElement('div');\n const context = this.adapter.getRuntimeContext();\n \n if (context.ReactDOM?.createRoot) {\n // Try to create a test root\n const testRoot = context.ReactDOM.createRoot(testDiv);\n if (testRoot) {\n testRoot.unmount();\n // React is ready!\n this.reactReadySubject.next(true);\n if (this.debug) {\n console.log(`React is fully ready after ${Date.now() - startTime}ms`);\n }\n return;\n }\n }\n } catch (error) {\n // Not ready yet, continue checking\n }\n \n // Wait before next check\n await new Promise(resolve => setTimeout(resolve, this.checkInterval));\n }\n \n // If we've exhausted the wait time, throw error\n console.error('React readiness test failed after maximum wait time');\n this.firstComponentAttempted = false;\n throw new Error(`ReactDOM.createRoot not available after ${this.maxWaitTime}ms`);\n } else {\n // Subsequent components wait for the ready signal\n await firstValueFrom(this.reactReady$.pipe(filter(ready => ready)));\n }\n }\n\n /**\n * Get the current React context if loaded\n * @returns React context with React, ReactDOM, Babel, and libraries\n */\n async getReactContext(): Promise<RuntimeContext> {\n await this.adapter.initialize(undefined, undefined, {debug: this.debug});\n return this.adapter.getRuntimeContext();\n }\n\n /**\n * Get the current React context synchronously\n * @returns React context or null if not loaded\n */\n getCurrentContext(): RuntimeContext | null {\n if (!this.adapter.isInitialized()) {\n return null;\n }\n return this.adapter.getRuntimeContext();\n }\n\n /**\n * Create a React root for rendering\n * @param container - DOM element to render into\n * @returns React root instance\n */\n createRoot(container: HTMLElement): any {\n const context = this.getCurrentContext();\n if (!context?.ReactDOM?.createRoot) {\n throw new Error('ReactDOM.createRoot not available');\n }\n\n const root = context.ReactDOM.createRoot(container);\n this.reactRoots.add(root);\n return root;\n }\n\n /**\n * Unmount and clean up a React root\n * @param root - React root to unmount\n */\n unmountRoot(root: any): void {\n if (root && typeof root.unmount === 'function') {\n try {\n root.unmount();\n } catch (error) {\n console.warn('Failed to unmount React root:', error);\n }\n }\n this.reactRoots.delete(root);\n }\n\n /**\n * Transpile JSX code to JavaScript\n * @param code - JSX code to transpile\n * @param filename - Optional filename for error messages\n * @returns Transpiled JavaScript code\n */\n transpileJSX(code: string, filename: string): string {\n return this.adapter.transpileJSX(code, filename);\n }\n\n /**\n * Clean up all React roots and reset context\n */\n private cleanup(): void {\n // Unmount all tracked React roots\n for (const root of this.reactRoots) {\n try {\n root.unmount();\n } catch (error) {\n console.warn('Failed to unmount React root:', error);\n }\n }\n this.reactRoots.clear();\n \n // Reset readiness state\n this.reactReadySubject.next(false);\n this.firstComponentAttempted = false;\n\n // Clean up adapter\n this.adapter.destroy();\n }\n\n /**\n * Check if React is currently ready\n * @returns true if React is ready\n */\n isReady(): boolean {\n return this.reactReadySubject.value;\n }\n\n /**\n * Get the number of active React roots\n * @returns Number of active roots\n */\n getActiveRootsCount(): number {\n return this.reactRoots.size;\n }\n}"]}
1
+ {"version":3,"file":"react-bridge.service.js","sourceRoot":"","sources":["../../../src/lib/services/react-bridge.service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAkB,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,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ChF,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAE3B,mBAAmB;QACnB,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;IACtC,CAAC;IAED;;;OAGG;IACH,mBAAmB;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAC9B,CAAC;mHA7MU,kBAAkB;uEAAlB,kBAAkB,WAAlB,kBAAkB,mBADL,MAAM;;iFACnB,kBAAkB;cAD9B,UAAU;eAAC,EAAE,UAAU,EAAE,MAAM,EAAE","sourcesContent":["/**\n * @fileoverview Service to manage React and ReactDOM instances with proper lifecycle.\n * Bridges Angular components with React rendering capabilities.\n * @module @memberjunction/ng-react\n */\n\nimport { Injectable, OnDestroy } from '@angular/core';\nimport { BehaviorSubject, firstValueFrom } from 'rxjs';\nimport { filter } from 'rxjs/operators';\nimport { AngularAdapterService } from './angular-adapter.service';\nimport { RuntimeContext, reactRootManager } from '@memberjunction/react-runtime';\nimport { ReactDebugConfig } from '../config/react-debug.config';\nimport { createAntdDropdownPositionHook } from '../hooks/antd-dropdown-position-hook';\n\n/**\n * Service to manage React and ReactDOM instances with proper lifecycle.\n * Provides methods for creating and managing React roots in Angular applications.\n */\n@Injectable({ providedIn: 'root' })\nexport class ReactBridgeService implements OnDestroy {\n private reactRoots = new Set<any>();\n \n // Track React readiness state\n private reactReadySubject = new BehaviorSubject<boolean>(false);\n public reactReady$ = this.reactReadySubject.asObservable();\n \n // Track if this is the first component trying to use React\n private firstComponentAttempted = false;\n private maxWaitTime = 5000; // Maximum 5 seconds wait time\n private checkInterval = 200; // Check every 200ms\n \n // Debug flag from project configuration\n public debug: boolean = ReactDebugConfig.getDebugMode();\n\n constructor(private adapter: AngularAdapterService) {\n // Bootstrap React immediately on service initialization\n this.bootstrapReact();\n }\n\n ngOnDestroy(): void {\n this.cleanup();\n }\n\n /**\n * Bootstrap React early during service initialization\n */\n private async bootstrapReact(): Promise<void> {\n try {\n // Log the debug mode being used\n console.log(`ReactBridgeService: Initializing React with debug mode = ${this.debug} (from ReactDebugConfig)`);\n \n // Pass debug flag to get development builds when debug is enabled\n await this.adapter.initialize(undefined, undefined, { debug: this.debug });\n\n // Register Angular-specific runtime hooks for library compatibility\n reactRootManager.RegisterHook(createAntdDropdownPositionHook());\n\n if (this.debug) {\n console.log('React ecosystem pre-loaded successfully with DEVELOPMENT builds (detailed error messages)');\n } else {\n console.log('React ecosystem pre-loaded successfully with PRODUCTION builds (minified)');\n }\n } catch (error) {\n console.error('Failed to pre-load React ecosystem:', error);\n }\n }\n\n /**\n * Wait for React to be ready, with special handling for first component\n */\n async waitForReactReady(): Promise<void> {\n // If already ready, return immediately\n if (this.reactReadySubject.value) {\n return;\n }\n\n // Check if this is the first component attempting to use React\n const isFirstComponent = !this.firstComponentAttempted;\n this.firstComponentAttempted = true;\n\n if (isFirstComponent) {\n // First component - check periodically until React is ready\n if (this.debug) {\n console.log('First React component loading - checking for React initialization');\n }\n \n const startTime = Date.now();\n \n while (Date.now() - startTime < this.maxWaitTime) {\n try {\n const testDiv = document.createElement('div');\n const context = this.adapter.getRuntimeContext();\n \n if (context.ReactDOM?.createRoot) {\n // Try to create a test root\n const testRoot = context.ReactDOM.createRoot(testDiv);\n if (testRoot) {\n testRoot.unmount();\n // React is ready!\n this.reactReadySubject.next(true);\n if (this.debug) {\n console.log(`React is fully ready after ${Date.now() - startTime}ms`);\n }\n return;\n }\n }\n } catch (error) {\n // Not ready yet, continue checking\n }\n \n // Wait before next check\n await new Promise(resolve => setTimeout(resolve, this.checkInterval));\n }\n \n // If we've exhausted the wait time, throw error\n console.error('React readiness test failed after maximum wait time');\n this.firstComponentAttempted = false;\n throw new Error(`ReactDOM.createRoot not available after ${this.maxWaitTime}ms`);\n } else {\n // Subsequent components wait for the ready signal\n await firstValueFrom(this.reactReady$.pipe(filter(ready => ready)));\n }\n }\n\n /**\n * Get the current React context if loaded\n * @returns React context with React, ReactDOM, Babel, and libraries\n */\n async getReactContext(): Promise<RuntimeContext> {\n await this.adapter.initialize(undefined, undefined, {debug: this.debug});\n return this.adapter.getRuntimeContext();\n }\n\n /**\n * Get the current React context synchronously\n * @returns React context or null if not loaded\n */\n getCurrentContext(): RuntimeContext | null {\n if (!this.adapter.isInitialized()) {\n return null;\n }\n return this.adapter.getRuntimeContext();\n }\n\n /**\n * Create a React root for rendering\n * @param container - DOM element to render into\n * @returns React root instance\n */\n createRoot(container: HTMLElement): any {\n const context = this.getCurrentContext();\n if (!context?.ReactDOM?.createRoot) {\n throw new Error('ReactDOM.createRoot not available');\n }\n\n const root = context.ReactDOM.createRoot(container);\n this.reactRoots.add(root);\n return root;\n }\n\n /**\n * Unmount and clean up a React root\n * @param root - React root to unmount\n */\n unmountRoot(root: any): void {\n if (root && typeof root.unmount === 'function') {\n try {\n root.unmount();\n } catch (error) {\n console.warn('Failed to unmount React root:', error);\n }\n }\n this.reactRoots.delete(root);\n }\n\n /**\n * Transpile JSX code to JavaScript\n * @param code - JSX code to transpile\n * @param filename - Optional filename for error messages\n * @returns Transpiled JavaScript code\n */\n transpileJSX(code: string, filename: string): string {\n return this.adapter.transpileJSX(code, filename);\n }\n\n /**\n * Clean up all React roots and reset context\n */\n private cleanup(): void {\n // Unmount all tracked React roots\n for (const root of this.reactRoots) {\n try {\n root.unmount();\n } catch (error) {\n console.warn('Failed to unmount React root:', error);\n }\n }\n this.reactRoots.clear();\n \n // Reset readiness state\n this.reactReadySubject.next(false);\n this.firstComponentAttempted = false;\n\n // Clean up runtime hooks (disconnects observers, removes injected styles, etc.)\n reactRootManager.cleanup();\n\n // Clean up adapter\n this.adapter.destroy();\n }\n\n /**\n * Check if React is currently ready\n * @returns true if React is ready\n */\n isReady(): boolean {\n return this.reactReadySubject.value;\n }\n\n /**\n * Get the number of active React roots\n * @returns Number of active roots\n */\n getActiveRootsCount(): number {\n return this.reactRoots.size;\n }\n}"]}
@@ -9,3 +9,4 @@ export * from './lib/services/script-loader.service';
9
9
  export * from './lib/services/react-bridge.service';
10
10
  export * from './lib/services/angular-adapter.service';
11
11
  export * from './lib/config/react-debug.config';
12
+ export * from './lib/hooks/antd-dropdown-position-hook';
@@ -13,4 +13,6 @@ export * from './lib/services/react-bridge.service';
13
13
  export * from './lib/services/angular-adapter.service';
14
14
  // Configuration
15
15
  export * from './lib/config/react-debug.config';
16
+ // Hooks
17
+ export * from './lib/hooks/antd-dropdown-position-hook';
16
18
  //# sourceMappingURL=public-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,SAAS;AACT,cAAc,cAAc,CAAC;AAE7B,aAAa;AACb,cAAc,+CAA+C,CAAC;AAE9D,WAAW;AACX,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AAEvD,gBAAgB;AAChB,cAAc,iCAAiC,CAAC","sourcesContent":["/**\n * @fileoverview Public API Surface of @memberjunction/ng-react\n * This file exports all public APIs from the Angular React integration library.\n * @module @memberjunction/ng-react\n */\n\n// Module\nexport * from './lib/module';\n\n// Components\nexport * from './lib/components/mj-react-component.component';\n\n// Services\nexport * from './lib/services/script-loader.service';\nexport * from './lib/services/react-bridge.service';\nexport * from './lib/services/angular-adapter.service';\n\n// Configuration\nexport * from './lib/config/react-debug.config';\n"]}
1
+ {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,SAAS;AACT,cAAc,cAAc,CAAC;AAE7B,aAAa;AACb,cAAc,+CAA+C,CAAC;AAE9D,WAAW;AACX,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AAEvD,gBAAgB;AAChB,cAAc,iCAAiC,CAAC;AAEhD,QAAQ;AACR,cAAc,yCAAyC,CAAC","sourcesContent":["/**\n * @fileoverview Public API Surface of @memberjunction/ng-react\n * This file exports all public APIs from the Angular React integration library.\n * @module @memberjunction/ng-react\n */\n\n// Module\nexport * from './lib/module';\n\n// Components\nexport * from './lib/components/mj-react-component.component';\n\n// Services\nexport * from './lib/services/script-loader.service';\nexport * from './lib/services/react-bridge.service';\nexport * from './lib/services/angular-adapter.service';\n\n// Configuration\nexport * from './lib/config/react-debug.config';\n\n// Hooks\nexport * from './lib/hooks/antd-dropdown-position-hook';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-react",
3
- "version": "5.21.0",
3
+ "version": "5.23.0",
4
4
  "description": "Angular components for hosting React components in MemberJunction applications",
5
5
  "scripts": {
6
6
  "build": "ngc -p tsconfig.json",
@@ -41,14 +41,14 @@
41
41
  "styles"
42
42
  ],
43
43
  "dependencies": {
44
- "@memberjunction/ai-vectors-memory": "5.21.0",
45
- "@memberjunction/core": "5.21.0",
46
- "@memberjunction/core-entities": "5.21.0",
47
- "@memberjunction/global": "5.21.0",
48
- "@memberjunction/graphql-dataprovider": "5.21.0",
49
- "@memberjunction/interactive-component-types": "5.21.0",
50
- "@memberjunction/ng-notifications": "5.21.0",
51
- "@memberjunction/react-runtime": "5.21.0",
44
+ "@memberjunction/ai-vectors-memory": "5.23.0",
45
+ "@memberjunction/core": "5.23.0",
46
+ "@memberjunction/core-entities": "5.23.0",
47
+ "@memberjunction/global": "5.23.0",
48
+ "@memberjunction/graphql-dataprovider": "5.23.0",
49
+ "@memberjunction/interactive-component-types": "5.23.0",
50
+ "@memberjunction/ng-notifications": "5.23.0",
51
+ "@memberjunction/react-runtime": "5.23.0",
52
52
  "@angular/common": "21.1.3",
53
53
  "@angular/core": "21.1.3",
54
54
  "@angular/platform-browser": "21.1.3",