@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
package/dist/utils.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { ComponentMeta } from '@plasmicapp/loader-core';
|
|
2
|
-
export declare const isBrowser: boolean;
|
|
3
|
-
export
|
|
4
|
-
name: string;
|
|
5
|
-
projectId?: string;
|
|
6
|
-
isCode?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare function useForceUpdate(): () => void;
|
|
9
|
-
export declare function useStableLookupSpec(spec: ComponentLookupSpec): ComponentLookupSpec;
|
|
10
|
-
export declare function useStableLookupSpecs(...specs: ComponentLookupSpec[]): ComponentLookupSpec[];
|
|
11
|
-
export declare function useIsMounted(): () => boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Check if `lookup` resolves to `pagePath`. If it's a match, return an object
|
|
14
|
-
* containing path params; otherwise, returns false.
|
|
15
|
-
*
|
|
16
|
-
* For example,
|
|
17
|
-
* - `matchesPagePath("/hello/[name]", "/hello/world")` -> `{params: {name:
|
|
18
|
-
* "world"}}`
|
|
19
|
-
* - `matchesPagePath("/hello/[name]", "/")` -> `false`
|
|
20
|
-
* - `matchesPagePath("/", "")` -> `{params: {}}`
|
|
21
|
-
*/
|
|
22
|
-
export declare function matchesPagePath(pagePath: string, lookup: string): {
|
|
23
|
-
params: Record<string, string>;
|
|
24
|
-
} | false;
|
|
25
|
-
export declare function isDynamicPagePath(path: string): boolean;
|
|
26
|
-
export declare function getCompMetas(metas: ComponentMeta[], lookup: ComponentLookupSpec): (ComponentMeta & {
|
|
27
|
-
params?: Record<string, string> | undefined;
|
|
28
|
-
})[];
|
|
29
|
-
export declare function getLookupSpecName(lookup: ComponentLookupSpec): string;
|
|
30
|
-
export declare function uniq<T>(elements: T[]): T[];
|
|
1
|
+
import { ComponentMeta } from '@plasmicapp/loader-core';
|
|
2
|
+
export declare const isBrowser: boolean;
|
|
3
|
+
export type ComponentLookupSpec = string | {
|
|
4
|
+
name: string;
|
|
5
|
+
projectId?: string;
|
|
6
|
+
isCode?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function useForceUpdate(): () => void;
|
|
9
|
+
export declare function useStableLookupSpec(spec: ComponentLookupSpec): ComponentLookupSpec;
|
|
10
|
+
export declare function useStableLookupSpecs(...specs: ComponentLookupSpec[]): ComponentLookupSpec[];
|
|
11
|
+
export declare function useIsMounted(): () => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Check if `lookup` resolves to `pagePath`. If it's a match, return an object
|
|
14
|
+
* containing path params; otherwise, returns false.
|
|
15
|
+
*
|
|
16
|
+
* For example,
|
|
17
|
+
* - `matchesPagePath("/hello/[name]", "/hello/world")` -> `{params: {name:
|
|
18
|
+
* "world"}}`
|
|
19
|
+
* - `matchesPagePath("/hello/[name]", "/")` -> `false`
|
|
20
|
+
* - `matchesPagePath("/", "")` -> `{params: {}}`
|
|
21
|
+
*/
|
|
22
|
+
export declare function matchesPagePath(pagePath: string, lookup: string): {
|
|
23
|
+
params: Record<string, string>;
|
|
24
|
+
} | false;
|
|
25
|
+
export declare function isDynamicPagePath(path: string): boolean;
|
|
26
|
+
export declare function getCompMetas(metas: ComponentMeta[], lookup: ComponentLookupSpec): (ComponentMeta & {
|
|
27
|
+
params?: Record<string, string> | undefined;
|
|
28
|
+
})[];
|
|
29
|
+
export declare function getLookupSpecName(lookup: ComponentLookupSpec): string;
|
|
30
|
+
export declare function uniq<T>(elements: T[]): T[];
|
package/dist/variation.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Split } from
|
|
2
|
-
import type { GlobalVariantSpec } from
|
|
3
|
-
export declare function getPlasmicCookieValues(): {
|
|
4
|
-
[k: string]: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function updatePlasmicCookieValue(key: string, value: string): void;
|
|
7
|
-
export declare function ensureVariationCookies(variation?: Record<string, string>): void;
|
|
8
|
-
export declare const getGlobalVariantsFromSplits: (splits: Split[], variation: Record<string, string>) => GlobalVariantSpec[];
|
|
9
|
-
export declare const mergeGlobalVariantsSpec: (target: GlobalVariantSpec[], from: GlobalVariantSpec[]) => GlobalVariantSpec[];
|
|
1
|
+
import { Split } from "@plasmicapp/loader-core";
|
|
2
|
+
import type { GlobalVariantSpec } from "./PlasmicRootProvider";
|
|
3
|
+
export declare function getPlasmicCookieValues(): {
|
|
4
|
+
[k: string]: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function updatePlasmicCookieValue(key: string, value: string): void;
|
|
7
|
+
export declare function ensureVariationCookies(variation?: Record<string, string>): void;
|
|
8
|
+
export declare const getGlobalVariantsFromSplits: (splits: Split[], variation: Record<string, string>) => GlobalVariantSpec[];
|
|
9
|
+
export declare const mergeGlobalVariantsSpec: (target: GlobalVariantSpec[], from: GlobalVariantSpec[]) => GlobalVariantSpec[];
|
package/package.json
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/loader-react",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
3
|
+
"version": "1.0.254",
|
|
4
|
+
"types": "./dist/index.d.ts",
|
|
5
|
+
"main": "./dist/index.js",
|
|
7
6
|
"exports": {
|
|
8
7
|
".": {
|
|
9
8
|
"types": "./dist/index.d.ts",
|
|
10
9
|
"default": "./dist/index.js"
|
|
11
10
|
},
|
|
12
11
|
"./react-server": {
|
|
13
|
-
"types": "./dist
|
|
14
|
-
"default": "./dist
|
|
12
|
+
"types": "./dist/react-server.d.ts",
|
|
13
|
+
"default": "./dist/react-server.js"
|
|
15
14
|
},
|
|
16
15
|
"./react-server-conditional": {
|
|
17
16
|
"react-server": {
|
|
18
|
-
"types": "./dist
|
|
19
|
-
"default": "./dist
|
|
17
|
+
"types": "./dist/react-server.d.ts",
|
|
18
|
+
"default": "./dist/react-server.js"
|
|
20
19
|
},
|
|
21
20
|
"default": {
|
|
22
21
|
"types": "./dist/index.d.ts",
|
|
@@ -26,7 +25,6 @@
|
|
|
26
25
|
},
|
|
27
26
|
"files": [
|
|
28
27
|
"dist",
|
|
29
|
-
"dist-react-server",
|
|
30
28
|
"index.d.ts",
|
|
31
29
|
"react-server.d.ts",
|
|
32
30
|
"react-server-conditional.d.ts"
|
|
@@ -35,17 +33,17 @@
|
|
|
35
33
|
"node": ">=12"
|
|
36
34
|
},
|
|
37
35
|
"scripts": {
|
|
38
|
-
"
|
|
39
|
-
"build": "yarn
|
|
40
|
-
"build:
|
|
41
|
-
"build:react-server": "
|
|
42
|
-
"postbuild": "yarn postbuild:
|
|
43
|
-
"postbuild:
|
|
44
|
-
"postbuild:react-server": "node ../../print-module-api.js ./packages/loader-react/dist
|
|
36
|
+
"build": "yarn build:types && yarn build:index && yarn build:react-server",
|
|
37
|
+
"build:types": "yarn tsc",
|
|
38
|
+
"build:index": "node ../../build.mjs ./src/index.ts --use-client",
|
|
39
|
+
"build:react-server": "node ../../build.mjs ./src/react-server.ts",
|
|
40
|
+
"postbuild": "yarn postbuild:index && yarn postbuild:react-server",
|
|
41
|
+
"postbuild:index": "node ../../print-module-api.js ./packages/loader-react/dist/index.js > index-api.txt",
|
|
42
|
+
"postbuild:react-server": "node ../../print-module-api.js ./packages/loader-react/dist/react-server.js > index-react-server-api.txt",
|
|
45
43
|
"yalcp": "yalc publish --push",
|
|
46
44
|
"test": "yarn --cwd=../.. test",
|
|
47
45
|
"coverage": "yarn --cwd=../.. test --coverage --passWithNoTests",
|
|
48
|
-
"lint": "
|
|
46
|
+
"lint": "eslint",
|
|
49
47
|
"prepare": "if-env PREPARE_NO_BUILD=true || yarn build",
|
|
50
48
|
"size": "size-limit",
|
|
51
49
|
"analyze": "size-limit --why"
|
|
@@ -53,8 +51,8 @@
|
|
|
53
51
|
"dependencies": {
|
|
54
52
|
"@plasmicapp/data-sources-context": "0.1.11",
|
|
55
53
|
"@plasmicapp/host": "1.0.132",
|
|
56
|
-
"@plasmicapp/loader-core": "1.0.
|
|
57
|
-
"@plasmicapp/loader-splits": "1.0.
|
|
54
|
+
"@plasmicapp/loader-core": "1.0.101",
|
|
55
|
+
"@plasmicapp/loader-splits": "1.0.29",
|
|
58
56
|
"@plasmicapp/query": "0.1.63",
|
|
59
57
|
"@plasmicapp/react-ssr-prepass": "2.0.1",
|
|
60
58
|
"pascalcase": "^1.0.0",
|
|
@@ -65,52 +63,22 @@
|
|
|
65
63
|
"react": ">=16.8.0",
|
|
66
64
|
"react-dom": ">=16.8.0"
|
|
67
65
|
},
|
|
68
|
-
"husky": {
|
|
69
|
-
"hooks": {
|
|
70
|
-
"pre-commit": "tsdx lint"
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"prettier": {
|
|
74
|
-
"printWidth": 80,
|
|
75
|
-
"semi": true,
|
|
76
|
-
"singleQuote": true,
|
|
77
|
-
"trailingComma": "es5"
|
|
78
|
-
},
|
|
79
66
|
"size-limit": [
|
|
80
67
|
{
|
|
81
|
-
"path": "dist/
|
|
82
|
-
"limit": "15 KB"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"path": "dist/loader-react.esm.js",
|
|
86
|
-
"limit": "15 KB"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"path": "dist-react-server/loader-react.cjs.production.min.js",
|
|
68
|
+
"path": "dist/index.js",
|
|
90
69
|
"limit": "15 KB"
|
|
91
70
|
},
|
|
92
71
|
{
|
|
93
|
-
"path": "dist
|
|
72
|
+
"path": "dist/react-server.js",
|
|
94
73
|
"limit": "15 KB"
|
|
95
74
|
}
|
|
96
75
|
],
|
|
97
76
|
"devDependencies": {
|
|
98
|
-
"@rollup/plugin-commonjs": "^19.0.0",
|
|
99
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
100
|
-
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
101
|
-
"@size-limit/preset-small-lib": "^4.11.0",
|
|
102
77
|
"@types/pascalcase": "^1.0.0",
|
|
103
78
|
"@types/react": "^18.0.27",
|
|
104
79
|
"@types/react-dom": "^18.0.10",
|
|
105
|
-
"@types/react-is": "^17.0.3"
|
|
106
|
-
"husky": "^6.0.0",
|
|
107
|
-
"rollup": "^2.47.0",
|
|
108
|
-
"rollup-plugin-dts": "^3.0.1",
|
|
109
|
-
"rollup-plugin-typescript2": "^0.30.0",
|
|
110
|
-
"size-limit": "^4.11.0",
|
|
111
|
-
"tsdx": "^0.14.1",
|
|
112
|
-
"tslib": "^2.2.0"
|
|
80
|
+
"@types/react-is": "^17.0.3"
|
|
113
81
|
},
|
|
114
82
|
"license": "MIT",
|
|
115
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "1d6d699a0dfb9781ecac5e8df1dfc3a690c43559"
|
|
116
84
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import 'server-only';
|
|
2
|
-
import { InitOptions, ReactServerPlasmicComponentLoader } from './loader-react-server';
|
|
3
|
-
export * from './index-shared';
|
|
4
|
-
export { ReactServerPlasmicComponentLoader };
|
|
5
|
-
export declare function initPlasmicLoader(opts: InitOptions): ReactServerPlasmicComponentLoader;
|
package/dist/index-shared.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** Shared exports for both "default" and "react-server" exports live here. */
|
|
2
|
-
export type { ComponentMeta, PageMeta, PageMetadata, } from '@plasmicapp/loader-core';
|
|
3
|
-
export { convertBundlesToComponentRenderData } from './bundles';
|
|
4
|
-
export type { ComponentRenderData } from './loader';
|
|
5
|
-
export type { InitOptions } from './loader-react-server';
|
|
6
|
-
export { matchesPagePath } from './utils';
|