@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.
- package/dist/loader-react.cjs.development.js +20 -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 +20 -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 +4 -4
package/dist/loader-react.esm.js
CHANGED
|
@@ -176,6 +176,10 @@ function prepComponentData(bundle) {
|
|
|
176
176
|
return x.globalContextsProviderFileName;
|
|
177
177
|
}).filter(function (x) {
|
|
178
178
|
return !!x;
|
|
179
|
+
}), bundle.components.filter(function (c) {
|
|
180
|
+
return c.isGlobalContextProvider;
|
|
181
|
+
}).map(function (c) {
|
|
182
|
+
return c.entry;
|
|
179
183
|
}), bundle.globalGroups.map(function (g) {
|
|
180
184
|
return g.contextFile;
|
|
181
185
|
})));
|
|
@@ -1146,6 +1150,9 @@ function getLookupSpecName(lookup) {
|
|
|
1146
1150
|
return lookup.name;
|
|
1147
1151
|
}
|
|
1148
1152
|
}
|
|
1153
|
+
function uniq(elements) {
|
|
1154
|
+
return Array.from(new Set(elements));
|
|
1155
|
+
}
|
|
1149
1156
|
|
|
1150
1157
|
function getFirstCompMeta(metas, lookup) {
|
|
1151
1158
|
var filtered = getCompMetas(metas, lookup);
|
|
@@ -1368,7 +1375,8 @@ function PlasmicRootProvider(props) {
|
|
|
1368
1375
|
renderCtx: {
|
|
1369
1376
|
// We track the provider as a single entity
|
|
1370
1377
|
rootComponentId: 'provider',
|
|
1371
|
-
teamIds: loader.getTeamIds()
|
|
1378
|
+
teamIds: loader.getTeamIds(),
|
|
1379
|
+
projectIds: loader.getProjectIds()
|
|
1372
1380
|
},
|
|
1373
1381
|
variation: variation
|
|
1374
1382
|
});
|
|
@@ -1957,11 +1965,17 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
1957
1965
|
}();
|
|
1958
1966
|
|
|
1959
1967
|
_proto.getTeamIds = function getTeamIds() {
|
|
1960
|
-
return this.bundle.projects.map(function (p) {
|
|
1961
|
-
return p.teamId;
|
|
1968
|
+
return uniq(this.bundle.projects.map(function (p) {
|
|
1969
|
+
return p.teamId ? "" + p.teamId + (p.indirect ? '@indirect' : '') : null;
|
|
1962
1970
|
}).filter(function (x) {
|
|
1963
1971
|
return !!x;
|
|
1964
|
-
});
|
|
1972
|
+
}));
|
|
1973
|
+
};
|
|
1974
|
+
|
|
1975
|
+
_proto.getProjectIds = function getProjectIds() {
|
|
1976
|
+
return uniq(this.bundle.projects.map(function (p) {
|
|
1977
|
+
return "" + p.id + (p.indirect ? '@indirect' : '');
|
|
1978
|
+
}));
|
|
1965
1979
|
};
|
|
1966
1980
|
|
|
1967
1981
|
_proto.trackRender = function trackRender(opts) {
|
|
@@ -2453,7 +2467,8 @@ function PlasmicComponent(props) {
|
|
|
2453
2467
|
rootProjectId: meta.projectId,
|
|
2454
2468
|
rootComponentId: meta.id,
|
|
2455
2469
|
rootComponentName: component,
|
|
2456
|
-
teamIds: loader.getTeamIds()
|
|
2470
|
+
teamIds: loader.getTeamIds(),
|
|
2471
|
+
projectIds: loader.getProjectIds()
|
|
2457
2472
|
},
|
|
2458
2473
|
variation: variation
|
|
2459
2474
|
});
|