@plasmicapp/loader-react 1.0.57 → 1.0.61

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.
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
6
 
7
7
  var host = require('@plasmicapp/host');
8
- var query = require('@plasmicapp/query');
8
+ var PlasmicQuery = require('@plasmicapp/query');
9
9
  var loaderCore = require('@plasmicapp/loader-core');
10
10
  var React = require('react');
11
11
  var React__default = _interopDefault(React);
@@ -1230,7 +1230,7 @@ function PlasmicRootProvider(props) {
1230
1230
  loader: loader
1231
1231
  };
1232
1232
  }, [globalVariants, loader]);
1233
- return React.createElement(query.PlasmicQueryDataProvider, {
1233
+ return React.createElement(PlasmicQuery.PlasmicQueryDataProvider, {
1234
1234
  prefetchedCache: prefetchedQueryData,
1235
1235
  suspense: suspenseForQueryData
1236
1236
  }, React.createElement(PlasmicRootContext.Provider, {
@@ -1351,7 +1351,10 @@ function initPlasmicLoader(opts) {
1351
1351
  react: React__default,
1352
1352
  'react-dom': ReactDOM,
1353
1353
  'react/jsx-runtime': jsxRuntime,
1354
- 'react/jsx-dev-runtime': jsxDevRuntime
1354
+ 'react/jsx-dev-runtime': jsxDevRuntime,
1355
+ // Also inject @plasmicapp/query at run time, so that the same
1356
+ // context is used here and in loader-downloaded code
1357
+ '@plasmicapp/query': PlasmicQuery
1355
1358
  });
1356
1359
  return new PlasmicComponentLoader(internal);
1357
1360
  }
@@ -1428,7 +1431,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
1428
1431
  }));
1429
1432
  };
1430
1433
 
1431
- _proto.registerContext = function registerContext(context, meta) {
1434
+ _proto.registerGlobalContext = function registerGlobalContext(context, meta) {
1432
1435
  var _meta$importPath2;
1433
1436
 
1434
1437
  this.substituteComponent(context, {
@@ -1436,7 +1439,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
1436
1439
  isCode: true
1437
1440
  }); // Import path is not used as we will use component substitution
1438
1441
 
1439
- host.registerContext(context, _extends({}, meta, {
1442
+ host.registerGlobalContext(context, _extends({}, meta, {
1440
1443
  importPath: (_meta$importPath2 = meta.importPath) != null ? _meta$importPath2 : ''
1441
1444
  }));
1442
1445
  };
@@ -1900,8 +1903,8 @@ var PlasmicComponentLoader = /*#__PURE__*/function () {
1900
1903
  }
1901
1904
  };
1902
1905
 
1903
- _proto2.registerContext = function registerContext(context, meta) {
1904
- this.__internal.registerContext(context, meta);
1906
+ _proto2.registerGlobalContext = function registerGlobalContext(context, meta) {
1907
+ this.__internal.registerGlobalContext(context, meta);
1905
1908
  }
1906
1909
  /**
1907
1910
  * Pre-fetches component data needed to for PlasmicLoader to render
@@ -2203,7 +2206,7 @@ function _extractPlasmicQueryData() {
2203
2206
  cache = {};
2204
2207
  _context.prev = 1;
2205
2208
  _context.next = 4;
2206
- return plasmicPrepass(React__default.createElement(query.PrepassContext.Provider, {
2209
+ return plasmicPrepass(React__default.createElement(PlasmicQuery.PrepassContext.Provider, {
2207
2210
  value: {
2208
2211
  cache: cache
2209
2212
  }
@@ -2447,7 +2450,7 @@ Object.defineProperty(exports, 'repeatedElement', {
2447
2450
  Object.defineProperty(exports, 'usePlasmicQueryData', {
2448
2451
  enumerable: true,
2449
2452
  get: function () {
2450
- return query.usePlasmicQueryData;
2453
+ return PlasmicQuery.usePlasmicQueryData;
2451
2454
  }
2452
2455
  });
2453
2456
  exports.PlasmicComponent = PlasmicComponent;