@plasmicapp/loader-react 1.0.396-beta.0 → 1.0.396
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.d.ts +2 -7
- package/dist/index.esm.js +4 -34
- package/dist/index.esm.js.map +3 -3
- package/dist/index.js +3 -33
- package/dist/index.js.map +2 -2
- package/dist/react-server.d.ts +2 -7
- package/dist/react-server.esm.js +3 -24
- package/dist/react-server.esm.js.map +3 -3
- package/dist/react-server.js +2 -23
- package/dist/react-server.js.map +2 -2
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -585,7 +585,6 @@ function prepComponentData(bundle, compMetas, opts) {
|
|
|
585
585
|
"entrypoint.css",
|
|
586
586
|
...compPaths,
|
|
587
587
|
"root-provider.js",
|
|
588
|
-
...bundle.projects.map((x) => x.styleTokensProviderFileName).filter((x) => !!x),
|
|
589
588
|
...bundle.projects.map((x) => x.globalContextsProviderFileName).filter((x) => !!x),
|
|
590
589
|
// We need to explicitly include global context provider components
|
|
591
590
|
// to make sure they are kept in bundle.components. That's because
|
|
@@ -753,16 +752,6 @@ var ComponentLookup = class {
|
|
|
753
752
|
context: this.registry.load(meta.contextFile).default
|
|
754
753
|
}));
|
|
755
754
|
}
|
|
756
|
-
/** Returns StyleTokensProvider if the project has style token overrides. */
|
|
757
|
-
maybeGetStyleTokensProvider(spec) {
|
|
758
|
-
const compMeta = getFirstCompMeta(this.bundle.components, spec);
|
|
759
|
-
const projectMeta = compMeta ? this.bundle.projects.find((x) => x.id === compMeta.projectId) : void 0;
|
|
760
|
-
if (!projectMeta || !projectMeta.styleTokensProviderFileName || !this.registry.hasModule(projectMeta.styleTokensProviderFileName) || !projectMeta.hasStyleTokenOverrides) {
|
|
761
|
-
return void 0;
|
|
762
|
-
}
|
|
763
|
-
const entry = this.registry.load(projectMeta.styleTokensProviderFileName);
|
|
764
|
-
return entry.StyleTokensProvider;
|
|
765
|
-
}
|
|
766
755
|
getGlobalContextsProvider(spec) {
|
|
767
756
|
const compMeta = getFirstCompMeta(this.bundle.components, spec);
|
|
768
757
|
const projectMeta = compMeta ? this.bundle.projects.find((x) => x.id === compMeta.projectId) : void 0;
|
|
@@ -833,7 +822,6 @@ var BaseInternalPlasmicComponentLoader = class {
|
|
|
833
822
|
};
|
|
834
823
|
this.opts = args.opts;
|
|
835
824
|
this.fetcher = args.fetcher;
|
|
836
|
-
this.tracker = args.tracker;
|
|
837
825
|
this.onBundleMerged = args.onBundleMerged;
|
|
838
826
|
this.onBundleFetched = args.onBundleFetched;
|
|
839
827
|
this.registerModules(args.builtinModules);
|
|
@@ -933,7 +921,6 @@ var BaseInternalPlasmicComponentLoader = class {
|
|
|
933
921
|
return __async(this, null, function* () {
|
|
934
922
|
var _a;
|
|
935
923
|
const bundle = yield this.fetcher.fetchAllData();
|
|
936
|
-
this.tracker.trackFetch();
|
|
937
924
|
this.mergeBundle(bundle);
|
|
938
925
|
(_a = this.onBundleFetched) == null ? void 0 : _a.call(this);
|
|
939
926
|
return bundle;
|
|
@@ -1036,8 +1023,7 @@ ${this.bundle.bundleKey}`
|
|
|
1036
1023
|
getLookup() {
|
|
1037
1024
|
return new ComponentLookup(this.getBundle(), this.registry);
|
|
1038
1025
|
}
|
|
1039
|
-
trackConversion(
|
|
1040
|
-
this.tracker.trackConversion(value);
|
|
1026
|
+
trackConversion(_value = 0) {
|
|
1041
1027
|
}
|
|
1042
1028
|
getActiveVariation(opts) {
|
|
1043
1029
|
return __async(this, null, function* () {
|
|
@@ -1061,8 +1047,7 @@ ${this.bundle.bundleKey}`
|
|
|
1061
1047
|
)
|
|
1062
1048
|
);
|
|
1063
1049
|
}
|
|
1064
|
-
trackRender(
|
|
1065
|
-
this.tracker.trackRender(opts);
|
|
1050
|
+
trackRender(_opts) {
|
|
1066
1051
|
}
|
|
1067
1052
|
loadServerQueriesModule(fileName) {
|
|
1068
1053
|
return this.registry.load(fileName);
|
|
@@ -1209,12 +1194,8 @@ var PlasmicComponentLoader = class {
|
|
|
1209
1194
|
// src/loader-client.ts
|
|
1210
1195
|
var InternalPlasmicComponentLoader = class extends BaseInternalPlasmicComponentLoader {
|
|
1211
1196
|
constructor(opts) {
|
|
1212
|
-
const tracker = new import_loader_core3.PlasmicTracker(__spreadProps(__spreadValues({}, opts), {
|
|
1213
|
-
projectIds: opts.projects.map((p) => p.id)
|
|
1214
|
-
}));
|
|
1215
1197
|
super({
|
|
1216
1198
|
opts,
|
|
1217
|
-
tracker,
|
|
1218
1199
|
fetcher: new import_loader_core3.PlasmicModulesFetcher(opts),
|
|
1219
1200
|
onBundleMerged: () => {
|
|
1220
1201
|
this.refreshRegistry();
|
|
@@ -1406,10 +1387,6 @@ function PlasmicComponent(props) {
|
|
|
1406
1387
|
if (isRootLoader) {
|
|
1407
1388
|
const lookup = loader.getLookup();
|
|
1408
1389
|
const ReactWebRootProvider = lookup.getRootProvider();
|
|
1409
|
-
const StyleTokensProvider = lookup.maybeGetStyleTokensProvider({
|
|
1410
|
-
name: component,
|
|
1411
|
-
projectId
|
|
1412
|
-
});
|
|
1413
1390
|
const GlobalContextsProvider = lookup.getGlobalContextsProvider({
|
|
1414
1391
|
name: component,
|
|
1415
1392
|
projectId
|
|
@@ -1431,14 +1408,7 @@ function PlasmicComponent(props) {
|
|
|
1431
1408
|
cond: !!GlobalContextsProvider,
|
|
1432
1409
|
wrapper: (children) => /* @__PURE__ */ React5.createElement(GlobalContextsProvider, __spreadValues({}, globalContextsProps), children)
|
|
1433
1410
|
},
|
|
1434
|
-
/* @__PURE__ */ React5.createElement(
|
|
1435
|
-
MaybeWrap,
|
|
1436
|
-
{
|
|
1437
|
-
cond: !!StyleTokensProvider,
|
|
1438
|
-
wrapper: (children) => /* @__PURE__ */ React5.createElement(StyleTokensProvider, null, children)
|
|
1439
|
-
},
|
|
1440
|
-
/* @__PURE__ */ React5.createElement(PlasmicComponentContext.Provider, { value: true }, elt)
|
|
1441
|
-
)
|
|
1411
|
+
/* @__PURE__ */ React5.createElement(PlasmicComponentContext.Provider, { value: true }, elt)
|
|
1442
1412
|
)
|
|
1443
1413
|
);
|
|
1444
1414
|
}
|