@plasmicapp/loader-react 1.0.158 → 1.0.161

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.
@@ -179,6 +179,10 @@ function prepComponentData(bundle) {
179
179
  return x.globalContextsProviderFileName;
180
180
  }).filter(function (x) {
181
181
  return !!x;
182
+ }), bundle.components.filter(function (c) {
183
+ return c.isGlobalContextProvider;
184
+ }).map(function (c) {
185
+ return c.entry;
182
186
  }), bundle.globalGroups.map(function (g) {
183
187
  return g.contextFile;
184
188
  })));
@@ -1149,6 +1153,9 @@ function getLookupSpecName(lookup) {
1149
1153
  return lookup.name;
1150
1154
  }
1151
1155
  }
1156
+ function uniq(elements) {
1157
+ return Array.from(new Set(elements));
1158
+ }
1152
1159
 
1153
1160
  function getFirstCompMeta(metas, lookup) {
1154
1161
  var filtered = getCompMetas(metas, lookup);
@@ -1371,7 +1378,8 @@ function PlasmicRootProvider(props) {
1371
1378
  renderCtx: {
1372
1379
  // We track the provider as a single entity
1373
1380
  rootComponentId: 'provider',
1374
- teamIds: loader.getTeamIds()
1381
+ teamIds: loader.getTeamIds(),
1382
+ projectIds: loader.getProjectIds()
1375
1383
  },
1376
1384
  variation: variation
1377
1385
  });
@@ -1960,11 +1968,17 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
1960
1968
  }();
1961
1969
 
1962
1970
  _proto.getTeamIds = function getTeamIds() {
1963
- return this.bundle.projects.map(function (p) {
1964
- return p.teamId;
1971
+ return uniq(this.bundle.projects.map(function (p) {
1972
+ return p.teamId ? "" + p.teamId + (p.indirect ? '@indirect' : '') : null;
1965
1973
  }).filter(function (x) {
1966
1974
  return !!x;
1967
- });
1975
+ }));
1976
+ };
1977
+
1978
+ _proto.getProjectIds = function getProjectIds() {
1979
+ return uniq(this.bundle.projects.map(function (p) {
1980
+ return "" + p.id + (p.indirect ? '@indirect' : '');
1981
+ }));
1968
1982
  };
1969
1983
 
1970
1984
  _proto.trackRender = function trackRender(opts) {
@@ -2456,7 +2470,8 @@ function PlasmicComponent(props) {
2456
2470
  rootProjectId: meta.projectId,
2457
2471
  rootComponentId: meta.id,
2458
2472
  rootComponentName: component,
2459
- teamIds: loader.getTeamIds()
2473
+ teamIds: loader.getTeamIds(),
2474
+ projectIds: loader.getProjectIds()
2460
2475
  },
2461
2476
  variation: variation
2462
2477
  });