@plasmicapp/loader-react 1.0.253 → 1.0.254
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/PlasmicComponent.d.ts +19 -19
- package/dist/PlasmicRootProvider.d.ts +92 -92
- package/dist/bundles.d.ts +7 -7
- package/dist/component-lookup.d.ts +21 -21
- package/dist/global-variants.d.ts +13 -13
- package/dist/index.d.ts +15 -12
- package/dist/index.js +1464 -5
- package/dist/index.js.map +7 -0
- package/dist/loader-react-server.d.ts +72 -72
- package/dist/loader.d.ts +173 -173
- package/dist/prepass.d.ts +43 -43
- package/dist/react-server.d.ts +5 -0
- package/dist/react-server.js +473 -0
- package/dist/react-server.js.map +7 -0
- package/dist/render.d.ts +27 -27
- package/dist/shared-exports.d.ts +6 -0
- package/dist/usePlasmicComponent.d.ts +15 -15
- package/dist/utils.d.ts +30 -30
- package/dist/variation.d.ts +9 -9
- package/package.json +21 -53
- package/dist/index-react-server.d.ts +0 -5
- package/dist/index-shared.d.ts +0 -6
- package/dist/loader-react.cjs.development.js +0 -2748
- package/dist/loader-react.cjs.development.js.map +0 -1
- package/dist/loader-react.cjs.production.min.js +0 -2
- package/dist/loader-react.cjs.production.min.js.map +0 -1
- package/dist/loader-react.esm.js +0 -2666
- package/dist/loader-react.esm.js.map +0 -1
- package/dist-react-server/PlasmicComponent.d.ts +0 -19
- package/dist-react-server/PlasmicRootProvider.d.ts +0 -92
- package/dist-react-server/bundles.d.ts +0 -7
- package/dist-react-server/component-lookup.d.ts +0 -21
- package/dist-react-server/global-variants.d.ts +0 -13
- package/dist-react-server/index-react-server.d.ts +0 -5
- package/dist-react-server/index-shared.d.ts +0 -6
- package/dist-react-server/index.d.ts +0 -12
- package/dist-react-server/index.js +0 -8
- package/dist-react-server/loader-react-server.d.ts +0 -72
- package/dist-react-server/loader-react.cjs.development.js +0 -1315
- package/dist-react-server/loader-react.cjs.development.js.map +0 -1
- package/dist-react-server/loader-react.cjs.production.min.js +0 -2
- package/dist-react-server/loader-react.cjs.production.min.js.map +0 -1
- package/dist-react-server/loader-react.esm.js +0 -1306
- package/dist-react-server/loader-react.esm.js.map +0 -1
- package/dist-react-server/loader.d.ts +0 -173
- package/dist-react-server/prepass.d.ts +0 -43
- package/dist-react-server/render.d.ts +0 -27
- package/dist-react-server/usePlasmicComponent.d.ts +0 -15
- package/dist-react-server/utils.d.ts +0 -30
- package/dist-react-server/variation.d.ts +0 -9
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { LoaderBundleCache, PageMeta, PlasmicModulesFetcher, PlasmicTracker } from '@plasmicapp/loader-core';
|
|
2
|
-
import { ComponentMeta, LoaderBundleOutput } from '@plasmicapp/loader-fetcher';
|
|
3
|
-
import { ComponentRenderData, FetchPagesOpts } from './loader';
|
|
4
|
-
import { ComponentLookupSpec } from './utils';
|
|
5
|
-
export interface InitOptions {
|
|
6
|
-
projects: {
|
|
7
|
-
id: string;
|
|
8
|
-
token: string;
|
|
9
|
-
version?: string;
|
|
10
|
-
}[];
|
|
11
|
-
cache?: LoaderBundleCache;
|
|
12
|
-
platform?: 'react' | 'nextjs' | 'gatsby';
|
|
13
|
-
preview?: boolean;
|
|
14
|
-
host?: string;
|
|
15
|
-
onClientSideFetch?: 'warn' | 'error';
|
|
16
|
-
i18nKeyScheme?: 'content' | 'hash';
|
|
17
|
-
/**
|
|
18
|
-
* By default, fetchComponentData() and fetchPages() calls cached in memory
|
|
19
|
-
* with the PlasmicComponentLoader instance. If alwaysFresh is true, then
|
|
20
|
-
* data is always freshly fetched over the network.
|
|
21
|
-
*/
|
|
22
|
-
alwaysFresh?: boolean;
|
|
23
|
-
}
|
|
24
|
-
/** Subset of loader functionality that works on React Server Components. */
|
|
25
|
-
export declare class ReactServerPlasmicComponentLoader {
|
|
26
|
-
private readonly opts;
|
|
27
|
-
private readonly fetcher;
|
|
28
|
-
private readonly tracker;
|
|
29
|
-
private readonly onBundleMerged?;
|
|
30
|
-
private readonly onBundleFetched?;
|
|
31
|
-
private bundle;
|
|
32
|
-
constructor(args: {
|
|
33
|
-
opts: InitOptions;
|
|
34
|
-
fetcher: PlasmicModulesFetcher;
|
|
35
|
-
tracker: PlasmicTracker;
|
|
36
|
-
/** Called after `mergeBundle` (including `fetch` calls). */
|
|
37
|
-
onBundleMerged?: () => void;
|
|
38
|
-
/** Called after any `fetch` calls. */
|
|
39
|
-
onBundleFetched?: () => void;
|
|
40
|
-
});
|
|
41
|
-
private maybeGetCompMetas;
|
|
42
|
-
maybeFetchComponentData(specs: ComponentLookupSpec[], opts?: FetchComponentDataOpts): Promise<ComponentRenderData | null>;
|
|
43
|
-
maybeFetchComponentData(...specs: ComponentLookupSpec[]): Promise<ComponentRenderData | null>;
|
|
44
|
-
fetchComponentData(specs: ComponentLookupSpec[], opts?: FetchComponentDataOpts): Promise<ComponentRenderData>;
|
|
45
|
-
fetchComponentData(...specs: ComponentLookupSpec[]): Promise<ComponentRenderData>;
|
|
46
|
-
fetchPages(opts?: FetchPagesOpts): Promise<PageMeta[]>;
|
|
47
|
-
fetchComponents(): Promise<ComponentMeta[]>;
|
|
48
|
-
getActiveSplits(): import("@plasmicapp/loader-core").Split[];
|
|
49
|
-
private fetchMissingData;
|
|
50
|
-
private maybeReportClientSideFetch;
|
|
51
|
-
private fetchAllData;
|
|
52
|
-
mergeBundle(bundle: LoaderBundleOutput): void;
|
|
53
|
-
getBundle(): LoaderBundleOutput;
|
|
54
|
-
clearCache(): void;
|
|
55
|
-
}
|
|
56
|
-
export interface FetchComponentDataOpts {
|
|
57
|
-
/**
|
|
58
|
-
* Will fetch either code targeting SSR or browser hydration in the
|
|
59
|
-
* returned bundle.
|
|
60
|
-
*
|
|
61
|
-
* By default, the target is browser. That's okay, because even when
|
|
62
|
-
* doing SSR, as long as you are using the same instance of PlasmicLoader
|
|
63
|
-
* that was used to fetch component data, it will still know how to get at
|
|
64
|
-
* the server code.
|
|
65
|
-
*
|
|
66
|
-
* But, if you are building your own SSR solution, where fetching and rendering
|
|
67
|
-
* are using different instances of PlasmicLoader, then you'll want to make
|
|
68
|
-
* sure that when you fetch, you are fetching the right one to be used in the
|
|
69
|
-
* right environment for either SSR or browser hydration.
|
|
70
|
-
*/
|
|
71
|
-
target?: 'server' | 'browser';
|
|
72
|
-
}
|