@plasmicapp/loader-react 1.0.113 → 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.
@@ -1,3 +1,4 @@
1
+ import * as PlasmicHost from '@plasmicapp/host';
1
2
  import { registerComponent, registerGlobalContext, registerTrait } from '@plasmicapp/host';
2
3
  export { PlasmicCanvasContext, PlasmicCanvasHost, repeatedElement, usePlasmicCanvasContext } from '@plasmicapp/host';
3
4
  import * as PlasmicQuery from '@plasmicapp/query';
@@ -392,11 +393,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
392
393
 
393
394
 
394
395
  var IteratorPrototype = {};
395
-
396
- IteratorPrototype[iteratorSymbol] = function () {
396
+ define(IteratorPrototype, iteratorSymbol, function () {
397
397
  return this;
398
- };
399
-
398
+ });
400
399
  var getProto = Object.getPrototypeOf;
401
400
  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
402
401
 
@@ -407,8 +406,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
407
406
  }
408
407
 
409
408
  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
410
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
411
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
409
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
410
+ define(Gp, "constructor", GeneratorFunctionPrototype);
411
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
412
412
  GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
413
413
  // Iterator interface in terms of a single ._invoke method.
414
414
 
@@ -513,11 +513,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
513
513
  }
514
514
 
515
515
  defineIteratorMethods(AsyncIterator.prototype);
516
-
517
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
516
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
518
517
  return this;
519
- };
520
-
518
+ });
521
519
  exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
522
520
  // AsyncIterator objects; they just return a Promise for the value of
523
521
  // the final result produced by the iterator.
@@ -694,13 +692,12 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
694
692
  // object to not be returned from this call. This ensures that doesn't happen.
695
693
  // See https://github.com/facebook/regenerator/issues/274 for more details.
696
694
 
697
- Gp[iteratorSymbol] = function () {
695
+ define(Gp, iteratorSymbol, function () {
698
696
  return this;
699
- };
700
-
701
- Gp.toString = function () {
697
+ });
698
+ define(Gp, "toString", function () {
702
699
  return "[object Generator]";
703
- };
700
+ });
704
701
 
705
702
  function pushTryEntry(locs) {
706
703
  var entry = {
@@ -1012,14 +1009,19 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
1012
1009
  } catch (accidentalStrictMode) {
1013
1010
  // This module should not be running in strict mode, so the above
1014
1011
  // assignment should always work unless something is misconfigured. Just
1015
- // in case runtime.js accidentally runs in strict mode, we can escape
1012
+ // in case runtime.js accidentally runs in strict mode, in modern engines
1013
+ // we can explicitly access globalThis. In older engines we can escape
1016
1014
  // strict mode using a global Function call. This could conceivably fail
1017
1015
  // if a Content Security Policy forbids using Function, but in that case
1018
1016
  // the proper solution is to fix the accidental strict mode problem. If
1019
1017
  // you've misconfigured your bundler to force strict mode and applied a
1020
1018
  // CSP to forbid Function, and you're not willing to fix either of those
1021
1019
  // problems, please detail your unique predicament in a GitHub issue.
1022
- Function("r", "regeneratorRuntime = r")(runtime);
1020
+ if (typeof globalThis === "object") {
1021
+ globalThis.regeneratorRuntime = runtime;
1022
+ } else {
1023
+ Function("r", "regeneratorRuntime = r")(runtime);
1024
+ }
1023
1025
  }
1024
1026
  });
1025
1027
 
@@ -1471,15 +1473,6 @@ function createUseGlobalVariant(name, projectId) {
1471
1473
  var isBrowser = typeof window !== 'undefined';
1472
1474
  function initPlasmicLoader(opts) {
1473
1475
  var internal = new InternalPlasmicComponentLoader(opts);
1474
- internal.registerModules({
1475
- react: React__default,
1476
- 'react-dom': ReactDOM,
1477
- 'react/jsx-runtime': jsxRuntime,
1478
- 'react/jsx-dev-runtime': jsxDevRuntime,
1479
- // Also inject @plasmicapp/query at run time, so that the same
1480
- // context is used here and in loader-downloaded code
1481
- '@plasmicapp/query': PlasmicQuery
1482
- });
1483
1476
  return new PlasmicComponentLoader(internal);
1484
1477
  }
1485
1478
  var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
@@ -1501,6 +1494,16 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
1501
1494
  };
1502
1495
  this.registry = Registry.getInstance();
1503
1496
  this.fetcher = new PlasmicModulesFetcher(opts);
1497
+ this.registerModules({
1498
+ react: React__default,
1499
+ 'react-dom': ReactDOM,
1500
+ 'react/jsx-runtime': jsxRuntime,
1501
+ 'react/jsx-dev-runtime': jsxDevRuntime,
1502
+ // Also inject @plasmicapp/query and @plasmicapp/host to use the
1503
+ // same contexts here and in loader-downloaded code.
1504
+ '@plasmicapp/query': PlasmicQuery,
1505
+ '@plasmicapp/host': PlasmicHost
1506
+ });
1504
1507
  }
1505
1508
 
1506
1509
  var _proto = InternalPlasmicComponentLoader.prototype;