@plasmicapp/loader-react 1.0.117 → 1.0.120

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