@plasmicapp/loader-react 1.0.168 → 1.0.171
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 +1 -0
- package/dist/loader-react.cjs.development.js +14 -10
- 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 +14 -11
- package/dist/loader-react.esm.js.map +1 -1
- package/dist/loader.d.ts +10 -2
- package/dist/utils.d.ts +14 -0
- package/package.json +3 -3
package/dist/loader.d.ts
CHANGED
|
@@ -52,6 +52,14 @@ export declare type GlobalContextMeta<P> = Omit<InternalGlobalContextMeta<P>, 'i
|
|
|
52
52
|
*/
|
|
53
53
|
importPath?: string;
|
|
54
54
|
};
|
|
55
|
+
export declare type FetchPagesOpts = {
|
|
56
|
+
/**
|
|
57
|
+
* Whether to include dynamic pages in fetchPages() output. A page is
|
|
58
|
+
* considered dynamic if its path contains some param between brackets,
|
|
59
|
+
* e.g. "[slug]".
|
|
60
|
+
*/
|
|
61
|
+
includeDynamicPages?: boolean;
|
|
62
|
+
};
|
|
55
63
|
export declare class InternalPlasmicComponentLoader {
|
|
56
64
|
private opts;
|
|
57
65
|
private fetcher;
|
|
@@ -78,7 +86,7 @@ export declare class InternalPlasmicComponentLoader {
|
|
|
78
86
|
private maybeGetCompMetas;
|
|
79
87
|
maybeFetchComponentData(...specs: ComponentLookupSpec[]): Promise<ComponentRenderData | null>;
|
|
80
88
|
fetchComponentData(...specs: ComponentLookupSpec[]): Promise<ComponentRenderData>;
|
|
81
|
-
fetchPages(): Promise<PageMeta[]>;
|
|
89
|
+
fetchPages(opts?: FetchPagesOpts): Promise<PageMeta[]>;
|
|
82
90
|
fetchComponents(): Promise<ComponentMeta[]>;
|
|
83
91
|
getLookup(): ComponentLookup;
|
|
84
92
|
getActiveSplits(): import("@plasmicapp/loader-core").Split[];
|
|
@@ -161,7 +169,7 @@ export declare class PlasmicComponentLoader {
|
|
|
161
169
|
/**
|
|
162
170
|
* Returns all the page component metadata for these projects.
|
|
163
171
|
*/
|
|
164
|
-
fetchPages(): Promise<PageMeta[]>;
|
|
172
|
+
fetchPages(opts?: FetchPagesOpts): Promise<PageMeta[]>;
|
|
165
173
|
/**
|
|
166
174
|
* Returns all components metadata for these projects.
|
|
167
175
|
*/
|
package/dist/utils.d.ts
CHANGED
|
@@ -8,6 +8,20 @@ export declare function useForceUpdate(): () => void;
|
|
|
8
8
|
export declare function useStableLookupSpec(spec: ComponentLookupSpec): ComponentLookupSpec;
|
|
9
9
|
export declare function useStableLookupSpecs(...specs: ComponentLookupSpec[]): ComponentLookupSpec[];
|
|
10
10
|
export declare function useIsMounted(): () => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Check if `lookup` resolves to `pagePath`. If it's a match, return an object
|
|
13
|
+
* containing path params; otherwise, returns false.
|
|
14
|
+
*
|
|
15
|
+
* For example,
|
|
16
|
+
* - `matchesPagePath("/hello/[name]", "/hello/world")` -> `{params: {name:
|
|
17
|
+
* "world"}}`
|
|
18
|
+
* - `matchesPagePath("/hello/[name]", "/")` -> `false`
|
|
19
|
+
* - `matchesPagePath("/", "")` -> `{params: {}}`
|
|
20
|
+
*/
|
|
21
|
+
export declare function matchesPagePath(pagePath: string, lookup: string): {
|
|
22
|
+
params: Record<string, string>;
|
|
23
|
+
} | false;
|
|
24
|
+
export declare function isDynamicPagePath(path: string): boolean;
|
|
11
25
|
export declare function getCompMetas(metas: ComponentMeta[], lookup: ComponentLookupSpec): (ComponentMeta | {
|
|
12
26
|
params: Record<string, string>;
|
|
13
27
|
id: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/loader-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.171",
|
|
4
4
|
"module": "dist/loader-react.esm.js",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"analyze": "size-limit --why"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@plasmicapp/host": "1.0.
|
|
25
|
+
"@plasmicapp/host": "1.0.76",
|
|
26
26
|
"@plasmicapp/loader-core": "1.0.81",
|
|
27
27
|
"@plasmicapp/loader-splits": "1.0.15",
|
|
28
28
|
"@plasmicapp/query": "0.1.53",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"typescript": "^4.3.2"
|
|
75
75
|
},
|
|
76
76
|
"license": "MIT",
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "0aac832e536b40f15e6f12287d3b9212ae85d068"
|
|
78
78
|
}
|