@plasmicapp/loader-react 1.0.156 → 1.0.159

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.
@@ -85,6 +85,36 @@ function _setPrototypeOf(o, p) {
85
85
  return _setPrototypeOf(o, p);
86
86
  }
87
87
 
88
+ function _isNativeReflectConstruct() {
89
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
90
+ if (Reflect.construct.sham) return false;
91
+ if (typeof Proxy === "function") return true;
92
+
93
+ try {
94
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
95
+ return true;
96
+ } catch (e) {
97
+ return false;
98
+ }
99
+ }
100
+
101
+ function _construct(Parent, args, Class) {
102
+ if (_isNativeReflectConstruct()) {
103
+ _construct = Reflect.construct;
104
+ } else {
105
+ _construct = function _construct(Parent, args, Class) {
106
+ var a = [null];
107
+ a.push.apply(a, args);
108
+ var Constructor = Function.bind.apply(Parent, a);
109
+ var instance = new Constructor();
110
+ if (Class) _setPrototypeOf(instance, Class.prototype);
111
+ return instance;
112
+ };
113
+ }
114
+
115
+ return _construct.apply(null, arguments);
116
+ }
117
+
88
118
  function _unsupportedIterableToArray(o, minLen) {
89
119
  if (!o) return;
90
120
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -1146,6 +1176,9 @@ function getLookupSpecName(lookup) {
1146
1176
  return lookup.name;
1147
1177
  }
1148
1178
  }
1179
+ function uniq(elements) {
1180
+ return _construct(Array, new Set(elements));
1181
+ }
1149
1182
 
1150
1183
  function getFirstCompMeta(metas, lookup) {
1151
1184
  var filtered = getCompMetas(metas, lookup);
@@ -1368,7 +1401,8 @@ function PlasmicRootProvider(props) {
1368
1401
  renderCtx: {
1369
1402
  // We track the provider as a single entity
1370
1403
  rootComponentId: 'provider',
1371
- teamIds: loader.getTeamIds()
1404
+ teamIds: loader.getTeamIds(),
1405
+ projectIds: loader.getProjectIds()
1372
1406
  },
1373
1407
  variation: variation
1374
1408
  });
@@ -1957,11 +1991,17 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
1957
1991
  }();
1958
1992
 
1959
1993
  _proto.getTeamIds = function getTeamIds() {
1960
- return this.bundle.projects.map(function (p) {
1961
- return p.teamId;
1994
+ return uniq(this.bundle.projects.map(function (p) {
1995
+ return p.teamId ? "" + p.teamId + (p.indirect ? '@indirect' : '') : null;
1962
1996
  }).filter(function (x) {
1963
1997
  return !!x;
1964
- });
1998
+ }));
1999
+ };
2000
+
2001
+ _proto.getProjectIds = function getProjectIds() {
2002
+ return uniq(this.bundle.projects.map(function (p) {
2003
+ return "" + p.id + (p.indirect ? '@indirect' : '');
2004
+ }));
1965
2005
  };
1966
2006
 
1967
2007
  _proto.trackRender = function trackRender(opts) {
@@ -2453,7 +2493,8 @@ function PlasmicComponent(props) {
2453
2493
  rootProjectId: meta.projectId,
2454
2494
  rootComponentId: meta.id,
2455
2495
  rootComponentName: component,
2456
- teamIds: loader.getTeamIds()
2496
+ teamIds: loader.getTeamIds(),
2497
+ projectIds: loader.getProjectIds()
2457
2498
  },
2458
2499
  variation: variation
2459
2500
  });