@memberjunction/react-runtime 2.112.0 → 2.113.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.
Files changed (43) hide show
  1. package/.turbo/turbo-build.log +11 -10
  2. package/CHANGELOG.md +15 -1
  3. package/dist/compiler/component-compiler.d.ts.map +1 -1
  4. package/dist/compiler/component-compiler.js +56 -66
  5. package/dist/compiler/component-compiler.js.map +1 -1
  6. package/dist/component-manager/component-manager.d.ts.map +1 -1
  7. package/dist/component-manager/component-manager.js +42 -48
  8. package/dist/component-manager/component-manager.js.map +1 -1
  9. package/dist/component-manager/types.d.ts +1 -1
  10. package/dist/component-manager/types.d.ts.map +1 -1
  11. package/dist/component-manager/types.js.map +1 -1
  12. package/dist/registry/component-registry-service.d.ts +1 -1
  13. package/dist/registry/component-registry-service.d.ts.map +1 -1
  14. package/dist/registry/component-registry-service.js +34 -34
  15. package/dist/registry/component-registry-service.js.map +1 -1
  16. package/dist/registry/component-resolver.d.ts +1 -1
  17. package/dist/registry/component-resolver.d.ts.map +1 -1
  18. package/dist/registry/component-resolver.js +11 -10
  19. package/dist/registry/component-resolver.js.map +1 -1
  20. package/dist/runtime/component-hierarchy.d.ts +1 -1
  21. package/dist/runtime/component-hierarchy.d.ts.map +1 -1
  22. package/dist/runtime/component-hierarchy.js +43 -43
  23. package/dist/runtime/component-hierarchy.js.map +1 -1
  24. package/dist/runtime/prop-builder.d.ts.map +1 -1
  25. package/dist/runtime/prop-builder.js +24 -22
  26. package/dist/runtime/prop-builder.js.map +1 -1
  27. package/dist/runtime.umd.js +511 -494
  28. package/dist/types/index.d.ts.map +1 -1
  29. package/dist/types/index.js.map +1 -1
  30. package/dist/utilities/library-registry.d.ts +1 -1
  31. package/dist/utilities/library-registry.d.ts.map +1 -1
  32. package/dist/utilities/library-registry.js +10 -10
  33. package/dist/utilities/library-registry.js.map +1 -1
  34. package/package.json +6 -5
  35. package/src/compiler/component-compiler.ts +164 -186
  36. package/src/component-manager/component-manager.ts +216 -162
  37. package/src/component-manager/types.ts +27 -27
  38. package/src/registry/component-registry-service.ts +218 -190
  39. package/src/registry/component-resolver.ts +98 -87
  40. package/src/runtime/component-hierarchy.ts +94 -57
  41. package/src/runtime/prop-builder.ts +33 -28
  42. package/src/types/index.ts +4 -3
  43. package/src/utilities/library-registry.ts +19 -14
@@ -4,8 +4,8 @@
4
4
  * @module @memberjunction/react-runtime/utilities
5
5
  */
6
6
 
7
- import { UserInfo } from '@memberjunction/global';
8
- import { ComponentLibraryEntity, ComponentMetadataEngine } from '@memberjunction/core-entities';
7
+ import { UserInfo } from "@memberjunction/core";
8
+ import { ComponentLibraryEntity, ComponentMetadataEngine } from "@memberjunction/core-entities";
9
9
 
10
10
  /**
11
11
  * Library definition in the registry
@@ -38,7 +38,7 @@ export class LibraryRegistry {
38
38
  private static _configured: boolean = false;
39
39
  public static async Config(forceRefresh: boolean = false, componentLibraries: ComponentLibraryEntity[]) {
40
40
  if (!this._configured || forceRefresh) {
41
- // next up, we need to map the component metadata to the library definitions
41
+ // next up, we need to map the component metadata to the library definitions
42
42
  // with two steps - first step is that we need to group the libraries in the engine
43
43
  // by name and then we'll have all the versions for that particular library we can break
44
44
  // into versions in our structure
@@ -55,15 +55,15 @@ export class LibraryRegistry {
55
55
  for (const [name, versions] of libraryGroups) {
56
56
  const libDef: LibraryDefinition = {
57
57
  name,
58
- globalVariable: versions[0].GlobalVariable || '',
59
- category: versions[0].Category || '',
58
+ globalVariable: versions[0].GlobalVariable || "",
59
+ category: versions[0].Category || "",
60
60
  versions: {},
61
- defaultVersion: versions[0].Version || '',
61
+ defaultVersion: versions[0].Version || ""
62
62
  };
63
63
  for (const version of versions) {
64
64
  libDef.versions[version.Version!] = {
65
- cdnUrl: version.CDNUrl || '',
66
- cssUrls: version.CDNCssUrl?.split(',') || [],
65
+ cdnUrl: version.CDNUrl || "",
66
+ cssUrls: version.CDNCssUrl?.split(",") || []
67
67
  };
68
68
  }
69
69
  this.libraries.set(name, libDef);
@@ -78,7 +78,8 @@ export class LibraryRegistry {
78
78
  * Get library definition by name
79
79
  */
80
80
  static getLibrary(name: string): LibraryDefinition | undefined {
81
- if (!this._configured) throw new Error('LibraryRegistry is not configured, call LibraryRegistry.Config() before using!');
81
+ if (!this._configured)
82
+ throw new Error("LibraryRegistry is not configured, call LibraryRegistry.Config() before using!");
82
83
 
83
84
  return this.libraries.get(name?.trim().toLowerCase());
84
85
  }
@@ -90,7 +91,8 @@ export class LibraryRegistry {
90
91
  * @returns CDN URL or undefined if library/version not found
91
92
  */
92
93
  static getCdnUrl(name: string, version?: string): string | undefined {
93
- if (!this._configured) throw new Error('LibraryRegistry is not configured, call LibraryRegistry.Config() before using!');
94
+ if (!this._configured)
95
+ throw new Error("LibraryRegistry is not configured, call LibraryRegistry.Config() before using!");
94
96
 
95
97
  const library = this.libraries.get(name?.trim().toLowerCase());
96
98
  if (!library) return undefined;
@@ -103,7 +105,8 @@ export class LibraryRegistry {
103
105
  * Check if a library is approved
104
106
  */
105
107
  static isApproved(name: string): boolean {
106
- if (!this._configured) throw new Error('LibraryRegistry is not configured, call LibraryRegistry.Config() before using!');
108
+ if (!this._configured)
109
+ throw new Error("LibraryRegistry is not configured, call LibraryRegistry.Config() before using!");
107
110
 
108
111
  return this.libraries.has(name?.trim().toLowerCase());
109
112
  }
@@ -114,7 +117,8 @@ export class LibraryRegistry {
114
117
  * TODO: Implement proper semver resolution
115
118
  */
116
119
  static resolveVersion(name: string, versionPattern?: string): string | undefined {
117
- if (!this._configured) throw new Error('LibraryRegistry is not configured, call LibraryRegistry.Config() before using!');
120
+ if (!this._configured)
121
+ throw new Error("LibraryRegistry is not configured, call LibraryRegistry.Config() before using!");
118
122
 
119
123
  const library = this.libraries.get(name?.trim().toLowerCase());
120
124
  if (!library) return undefined;
@@ -137,8 +141,9 @@ export class LibraryRegistry {
137
141
  * with libraries loaded from a database
138
142
  */
139
143
  static registerLibrary(definition: LibraryDefinition): void {
140
- if (!this._configured) throw new Error('LibraryRegistry is not configured, call LibraryRegistry.Config() before using!');
144
+ if (!this._configured)
145
+ throw new Error("LibraryRegistry is not configured, call LibraryRegistry.Config() before using!");
141
146
 
142
147
  this.libraries.set(definition.name?.trim().toLowerCase(), definition);
143
148
  }
144
- }
149
+ }