@plasmicapp/loader-react 2.0.3 → 2.0.5

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.
package/dist/index.js CHANGED
@@ -56,6 +56,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
56
56
  mod
57
57
  ));
58
58
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
59
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
59
60
  var __async = (__this, __arguments, generator) => {
60
61
  return new Promise((resolve, reject) => {
61
62
  var fulfilled = (value) => {
@@ -78,8 +79,8 @@ var __async = (__this, __arguments, generator) => {
78
79
  };
79
80
 
80
81
  // src/index.ts
81
- var src_exports = {};
82
- __export(src_exports, {
82
+ var index_exports = {};
83
+ __export(index_exports, {
83
84
  DataCtxReader: () => import_host3.DataCtxReader,
84
85
  DataProvider: () => import_host3.DataProvider,
85
86
  GlobalActionsContext: () => import_host3.GlobalActionsContext,
@@ -109,7 +110,7 @@ __export(src_exports, {
109
110
  useSelector: () => import_host3.useSelector,
110
111
  useSelectors: () => import_host3.useSelectors
111
112
  });
112
- module.exports = __toCommonJS(src_exports);
113
+ module.exports = __toCommonJS(index_exports);
113
114
 
114
115
  // src/loader-client.ts
115
116
  var PlasmicDataSourcesContext = __toESM(require("@plasmicapp/data-sources-context"));
@@ -707,8 +708,8 @@ function getFirstCompMeta(metas, lookup) {
707
708
  }
708
709
  var ComponentLookup = class {
709
710
  constructor(bundle, registry) {
710
- this.bundle = bundle;
711
- this.registry = registry;
711
+ __publicField(this, "bundle", bundle);
712
+ __publicField(this, "registry", registry);
712
713
  }
713
714
  getComponentMeta(spec) {
714
715
  const compMeta = getFirstCompMeta(this.bundle.components, spec);
@@ -838,10 +839,14 @@ function parseFetchComponentDataArgs(...args) {
838
839
  }
839
840
  var BaseInternalPlasmicComponentLoader = class {
840
841
  constructor(args) {
841
- this.registry = new import_loader_core2.Registry();
842
- this.globalVariants = [];
843
- this.subs = [];
844
- this.bundle = {
842
+ __publicField(this, "opts");
843
+ __publicField(this, "registry", new import_loader_core2.Registry());
844
+ __publicField(this, "fetcher");
845
+ __publicField(this, "onBundleMerged");
846
+ __publicField(this, "onBundleFetched");
847
+ __publicField(this, "globalVariants", []);
848
+ __publicField(this, "subs", []);
849
+ __publicField(this, "bundle", {
845
850
  modules: {
846
851
  browser: [],
847
852
  server: []
@@ -854,7 +859,7 @@ var BaseInternalPlasmicComponentLoader = class {
854
859
  deferChunksByDefault: false,
855
860
  disableRootLoadingBoundaryByDefault: false,
856
861
  filteredIds: {}
857
- };
862
+ });
858
863
  this.opts = args.opts;
859
864
  this.fetcher = args.fetcher;
860
865
  this.onBundleMerged = args.onBundleMerged;
@@ -1086,6 +1091,7 @@ ${this.bundle.bundleKey}`
1086
1091
  };
1087
1092
  var PlasmicComponentLoader = class {
1088
1093
  constructor(internal) {
1094
+ __publicField(this, "__internal");
1089
1095
  this.__internal = internal;
1090
1096
  }
1091
1097
  /**
@@ -1196,7 +1202,7 @@ var PlasmicComponentLoader = class {
1196
1202
  }
1197
1203
  return this.__internal.loadServerQueriesModule(fileName);
1198
1204
  }
1199
- unstable__getServerQueriesData(renderData, $ctx) {
1205
+ unstable__getServerQueriesData(renderData, $ctx, $props) {
1200
1206
  return __async(this, null, function* () {
1201
1207
  var _a;
1202
1208
  const module2 = this.getExecFuncModule(
@@ -1208,7 +1214,7 @@ var PlasmicComponentLoader = class {
1208
1214
  (_a = renderData.entryCompMetas[0]) == null ? void 0 : _a.displayName
1209
1215
  );
1210
1216
  try {
1211
- const $serverQueries = yield module2 == null ? void 0 : module2.executeServerQueries($ctx);
1217
+ const $serverQueries = yield module2 == null ? void 0 : module2.executeServerQueries($ctx, $props);
1212
1218
  return $serverQueries;
1213
1219
  } catch (err) {
1214
1220
  console.error("Error executing server queries function", err);
@@ -1271,7 +1277,7 @@ var InternalPlasmicComponentLoader = class extends BaseInternalPlasmicComponentL
1271
1277
  }
1272
1278
  }
1273
1279
  });
1274
- this.roots = [];
1280
+ __publicField(this, "roots", []);
1275
1281
  }
1276
1282
  registerComponent(component, meta) {
1277
1283
  var _a, _b;
@@ -1365,7 +1371,7 @@ function usePlasmicComponent(spec, opts = {}) {
1365
1371
  const forceUpdate = useForceUpdate();
1366
1372
  React4.useEffect(() => {
1367
1373
  if (!component) {
1368
- (() => __async(this, null, function* () {
1374
+ (() => __async(null, null, function* () {
1369
1375
  yield loader.fetchComponentData(stableSpec);
1370
1376
  if (isMounted()) {
1371
1377
  forceUpdate();