@plasmicapp/loader-react 1.0.117 → 1.0.118

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.
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
6
 
7
- var host = require('@plasmicapp/host');
7
+ var PlasmicHost = require('@plasmicapp/host');
8
8
  var PlasmicQuery = require('@plasmicapp/query');
9
9
  var loaderCore = require('@plasmicapp/loader-core');
10
10
  var loaderSplits = require('@plasmicapp/loader-splits');
@@ -1476,15 +1476,6 @@ function createUseGlobalVariant(name, projectId) {
1476
1476
  var isBrowser = typeof window !== 'undefined';
1477
1477
  function initPlasmicLoader(opts) {
1478
1478
  var internal = new InternalPlasmicComponentLoader(opts);
1479
- internal.registerModules({
1480
- react: React__default,
1481
- 'react-dom': ReactDOM,
1482
- 'react/jsx-runtime': jsxRuntime,
1483
- 'react/jsx-dev-runtime': jsxDevRuntime,
1484
- // Also inject @plasmicapp/query at run time, so that the same
1485
- // context is used here and in loader-downloaded code
1486
- '@plasmicapp/query': PlasmicQuery
1487
- });
1488
1479
  return new PlasmicComponentLoader(internal);
1489
1480
  }
1490
1481
  var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
@@ -1506,6 +1497,16 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
1506
1497
  };
1507
1498
  this.registry = loaderCore.Registry.getInstance();
1508
1499
  this.fetcher = new loaderCore.PlasmicModulesFetcher(opts);
1500
+ this.registerModules({
1501
+ react: React__default,
1502
+ 'react-dom': ReactDOM,
1503
+ 'react/jsx-runtime': jsxRuntime,
1504
+ 'react/jsx-dev-runtime': jsxDevRuntime,
1505
+ // Also inject @plasmicapp/query and @plasmicapp/host to use the
1506
+ // same contexts here and in loader-downloaded code.
1507
+ '@plasmicapp/query': PlasmicQuery,
1508
+ '@plasmicapp/host': PlasmicHost
1509
+ });
1509
1510
  }
1510
1511
 
1511
1512
  var _proto = InternalPlasmicComponentLoader.prototype;
@@ -1556,7 +1557,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
1556
1557
  isCode: true
1557
1558
  }); // Import path is not used as we will use component substitution
1558
1559
 
1559
- host.registerComponent(component, _extends({}, meta, {
1560
+ PlasmicHost.registerComponent(component, _extends({}, meta, {
1560
1561
  importPath: (_meta$importPath = meta.importPath) != null ? _meta$importPath : ''
1561
1562
  }));
1562
1563
  };
@@ -1569,13 +1570,13 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
1569
1570
  isCode: true
1570
1571
  }); // Import path is not used as we will use component substitution
1571
1572
 
1572
- host.registerGlobalContext(context, _extends({}, meta, {
1573
+ PlasmicHost.registerGlobalContext(context, _extends({}, meta, {
1573
1574
  importPath: (_meta$importPath2 = meta.importPath) != null ? _meta$importPath2 : ''
1574
1575
  }));
1575
1576
  };
1576
1577
 
1577
1578
  _proto.registerTrait = function registerTrait(trait, meta) {
1578
- host.registerTrait(trait, meta);
1579
+ PlasmicHost.registerTrait(trait, meta);
1579
1580
  };
1580
1581
 
1581
1582
  _proto.registerPrefetchedBundle = function registerPrefetchedBundle(bundle) {
@@ -2720,25 +2721,25 @@ function makeElement(loader, lookup, opts) {
2720
2721
  Object.defineProperty(exports, 'PlasmicCanvasContext', {
2721
2722
  enumerable: true,
2722
2723
  get: function () {
2723
- return host.PlasmicCanvasContext;
2724
+ return PlasmicHost.PlasmicCanvasContext;
2724
2725
  }
2725
2726
  });
2726
2727
  Object.defineProperty(exports, 'PlasmicCanvasHost', {
2727
2728
  enumerable: true,
2728
2729
  get: function () {
2729
- return host.PlasmicCanvasHost;
2730
+ return PlasmicHost.PlasmicCanvasHost;
2730
2731
  }
2731
2732
  });
2732
2733
  Object.defineProperty(exports, 'repeatedElement', {
2733
2734
  enumerable: true,
2734
2735
  get: function () {
2735
- return host.repeatedElement;
2736
+ return PlasmicHost.repeatedElement;
2736
2737
  }
2737
2738
  });
2738
2739
  Object.defineProperty(exports, 'usePlasmicCanvasContext', {
2739
2740
  enumerable: true,
2740
2741
  get: function () {
2741
- return host.usePlasmicCanvasContext;
2742
+ return PlasmicHost.usePlasmicCanvasContext;
2742
2743
  }
2743
2744
  });
2744
2745
  Object.defineProperty(exports, 'usePlasmicQueryData', {