@plasmicapp/loader-react 1.0.144 → 1.0.147

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.
@@ -7,7 +7,7 @@ export declare class ComponentLookup {
7
7
  constructor(bundle: LoaderBundleOutput, registry: Registry);
8
8
  getComponent<P extends React.ComponentType = any>(spec: ComponentLookupSpec, opts?: {
9
9
  forceOriginal?: boolean;
10
- }): P;
10
+ }): any;
11
11
  hasComponent(spec: ComponentLookupSpec): boolean;
12
12
  getGlobalContexts(): {
13
13
  meta: GlobalGroupMeta;
@@ -1183,7 +1183,7 @@ var ComponentLookup = /*#__PURE__*/function () {
1183
1183
  var entry = this.registry.load(moduleName, {
1184
1184
  forceOriginal: opts.forceOriginal
1185
1185
  });
1186
- return entry["default"];
1186
+ return !opts.forceOriginal && typeof (entry == null ? void 0 : entry.getPlasmicComponent) === 'function' ? entry.getPlasmicComponent() : entry["default"];
1187
1187
  };
1188
1188
 
1189
1189
  _proto.hasComponent = function hasComponent(spec) {
@@ -1221,7 +1221,7 @@ var ComponentLookup = /*#__PURE__*/function () {
1221
1221
  }
1222
1222
 
1223
1223
  var entry = this.registry.load(projectMeta.globalContextsProviderFileName);
1224
- return entry["default"];
1224
+ return typeof (entry == null ? void 0 : entry.getPlasmicComponent) === 'function' ? entry.getPlasmicComponent() : entry["default"];
1225
1225
  };
1226
1226
 
1227
1227
  _proto.getRootProvider = function getRootProvider() {
@@ -1495,6 +1495,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
1495
1495
  projects: [],
1496
1496
  activeSplits: []
1497
1497
  };
1498
+ this.substitutedComponents = {};
1498
1499
  this.registry = loaderCore.Registry.getInstance();
1499
1500
  this.fetcher = new loaderCore.PlasmicModulesFetcher(opts);
1500
1501
  this.registerModules({
@@ -1505,7 +1506,10 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
1505
1506
  // Also inject @plasmicapp/query and @plasmicapp/host to use the
1506
1507
  // same contexts here and in loader-downloaded code.
1507
1508
  '@plasmicapp/query': PlasmicQuery,
1508
- '@plasmicapp/host': PlasmicHost
1509
+ '@plasmicapp/host': PlasmicHost,
1510
+ '@plasmicapp/loader-runtime-registry': {
1511
+ components: this.substitutedComponents
1512
+ }
1509
1513
  });
1510
1514
  }
1511
1515
 
@@ -1957,9 +1961,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
1957
1961
  var sub = _step.value;
1958
1962
  var metas = getCompMetas(_this3.bundle.components, sub.lookup);
1959
1963
  metas.forEach(function (meta) {
1960
- return _this3.registry.register(meta.entry, {
1961
- "default": sub.component
1962
- });
1964
+ _this3.substitutedComponents[meta.id] = sub.component;
1963
1965
  });
1964
1966
  };
1965
1967