@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.
- package/dist/loader-react.cjs.development.js +46 -5
- package/dist/loader-react.cjs.development.js.map +1 -1
- package/dist/loader-react.cjs.production.min.js +1 -1
- package/dist/loader-react.cjs.production.min.js.map +1 -1
- package/dist/loader-react.esm.js +46 -5
- package/dist/loader-react.esm.js.map +1 -1
- package/dist/loader.d.ts +1 -0
- package/dist/utils.d.ts +1 -0
- package/package.json +6 -6
|
@@ -88,6 +88,36 @@ function _setPrototypeOf(o, p) {
|
|
|
88
88
|
return _setPrototypeOf(o, p);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
function _isNativeReflectConstruct() {
|
|
92
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
93
|
+
if (Reflect.construct.sham) return false;
|
|
94
|
+
if (typeof Proxy === "function") return true;
|
|
95
|
+
|
|
96
|
+
try {
|
|
97
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
98
|
+
return true;
|
|
99
|
+
} catch (e) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function _construct(Parent, args, Class) {
|
|
105
|
+
if (_isNativeReflectConstruct()) {
|
|
106
|
+
_construct = Reflect.construct;
|
|
107
|
+
} else {
|
|
108
|
+
_construct = function _construct(Parent, args, Class) {
|
|
109
|
+
var a = [null];
|
|
110
|
+
a.push.apply(a, args);
|
|
111
|
+
var Constructor = Function.bind.apply(Parent, a);
|
|
112
|
+
var instance = new Constructor();
|
|
113
|
+
if (Class) _setPrototypeOf(instance, Class.prototype);
|
|
114
|
+
return instance;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return _construct.apply(null, arguments);
|
|
119
|
+
}
|
|
120
|
+
|
|
91
121
|
function _unsupportedIterableToArray(o, minLen) {
|
|
92
122
|
if (!o) return;
|
|
93
123
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
@@ -1149,6 +1179,9 @@ function getLookupSpecName(lookup) {
|
|
|
1149
1179
|
return lookup.name;
|
|
1150
1180
|
}
|
|
1151
1181
|
}
|
|
1182
|
+
function uniq(elements) {
|
|
1183
|
+
return _construct(Array, new Set(elements));
|
|
1184
|
+
}
|
|
1152
1185
|
|
|
1153
1186
|
function getFirstCompMeta(metas, lookup) {
|
|
1154
1187
|
var filtered = getCompMetas(metas, lookup);
|
|
@@ -1371,7 +1404,8 @@ function PlasmicRootProvider(props) {
|
|
|
1371
1404
|
renderCtx: {
|
|
1372
1405
|
// We track the provider as a single entity
|
|
1373
1406
|
rootComponentId: 'provider',
|
|
1374
|
-
teamIds: loader.getTeamIds()
|
|
1407
|
+
teamIds: loader.getTeamIds(),
|
|
1408
|
+
projectIds: loader.getProjectIds()
|
|
1375
1409
|
},
|
|
1376
1410
|
variation: variation
|
|
1377
1411
|
});
|
|
@@ -1960,11 +1994,17 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
1960
1994
|
}();
|
|
1961
1995
|
|
|
1962
1996
|
_proto.getTeamIds = function getTeamIds() {
|
|
1963
|
-
return this.bundle.projects.map(function (p) {
|
|
1964
|
-
return p.teamId;
|
|
1997
|
+
return uniq(this.bundle.projects.map(function (p) {
|
|
1998
|
+
return p.teamId ? "" + p.teamId + (p.indirect ? '@indirect' : '') : null;
|
|
1965
1999
|
}).filter(function (x) {
|
|
1966
2000
|
return !!x;
|
|
1967
|
-
});
|
|
2001
|
+
}));
|
|
2002
|
+
};
|
|
2003
|
+
|
|
2004
|
+
_proto.getProjectIds = function getProjectIds() {
|
|
2005
|
+
return uniq(this.bundle.projects.map(function (p) {
|
|
2006
|
+
return "" + p.id + (p.indirect ? '@indirect' : '');
|
|
2007
|
+
}));
|
|
1968
2008
|
};
|
|
1969
2009
|
|
|
1970
2010
|
_proto.trackRender = function trackRender(opts) {
|
|
@@ -2456,7 +2496,8 @@ function PlasmicComponent(props) {
|
|
|
2456
2496
|
rootProjectId: meta.projectId,
|
|
2457
2497
|
rootComponentId: meta.id,
|
|
2458
2498
|
rootComponentName: component,
|
|
2459
|
-
teamIds: loader.getTeamIds()
|
|
2499
|
+
teamIds: loader.getTeamIds(),
|
|
2500
|
+
projectIds: loader.getProjectIds()
|
|
2460
2501
|
},
|
|
2461
2502
|
variation: variation
|
|
2462
2503
|
});
|