@plasmicapp/react-web 0.2.295 → 0.2.297
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/all.d.ts +4 -2
- package/dist/index.cjs.js +9 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/react-web.esm.js +8 -0
- package/dist/react-web.esm.js.map +1 -1
- package/package.json +9 -9
- package/skinny/dist/index.js +8 -0
- package/skinny/dist/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/react-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.297",
|
|
4
4
|
"description": "plasmic library for rendering in the presentational style",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -86,13 +86,13 @@
|
|
|
86
86
|
"test-storybook": "test-storybook"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@plasmicapp/auth-react": "0.0.
|
|
90
|
-
"@plasmicapp/data-sources": "0.1.
|
|
91
|
-
"@plasmicapp/data-sources-context": "0.1.
|
|
92
|
-
"@plasmicapp/host": "1.0.
|
|
93
|
-
"@plasmicapp/loader-splits": "1.0.
|
|
94
|
-
"@plasmicapp/prepass": "1.0.
|
|
95
|
-
"@plasmicapp/query": "0.1.
|
|
89
|
+
"@plasmicapp/auth-react": "0.0.18",
|
|
90
|
+
"@plasmicapp/data-sources": "0.1.137",
|
|
91
|
+
"@plasmicapp/data-sources-context": "0.1.19",
|
|
92
|
+
"@plasmicapp/host": "1.0.179",
|
|
93
|
+
"@plasmicapp/loader-splits": "1.0.48",
|
|
94
|
+
"@plasmicapp/prepass": "1.0.12",
|
|
95
|
+
"@plasmicapp/query": "0.1.76",
|
|
96
96
|
"@react-aria/checkbox": "^3.11.2",
|
|
97
97
|
"@react-aria/focus": "^3.14.3",
|
|
98
98
|
"@react-aria/interactions": "^3.19.1",
|
|
@@ -157,5 +157,5 @@
|
|
|
157
157
|
"react": ">=16.8.0",
|
|
158
158
|
"react-dom": ">=16.8.0"
|
|
159
159
|
},
|
|
160
|
-
"gitHead": "
|
|
160
|
+
"gitHead": "38cab034aeababf443235fa79b62b421fd972622"
|
|
161
161
|
}
|
package/skinny/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import classNames$1 from 'classnames';
|
|
|
2
2
|
import { _ as __awaiter, a as __assign, b as __generator, c as __rest, d as __spreadArray, e as __read, o as omit, p as pick, f as __values, i as isSubset, g as chainSingleArgFuncs, n as notNil, h as __extends, j as ensure } from './common-7e2bbe30.js';
|
|
3
3
|
import { usePlasmicDataSourceContext } from '@plasmicapp/data-sources-context';
|
|
4
4
|
export { PlasmicDataSourceContextProvider, useCurrentUser } from '@plasmicapp/data-sources-context';
|
|
5
|
+
import * as plasmicQuery from '@plasmicapp/query';
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import React__default, { useLayoutEffect, useEffect } from 'react';
|
|
7
8
|
import get from 'dlv';
|
|
@@ -78,6 +79,7 @@ function triggerLogin(appId, authorizeEndpoint, redirectUri) {
|
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
81
|
function PlasmicPageGuard(props) {
|
|
82
|
+
var _a;
|
|
81
83
|
var appId = props.appId, authorizeEndpoint = props.authorizeEndpoint, minRole = props.minRole, canTriggerLogin = props.canTriggerLogin, children = props.children, unauthorizedComp = props.unauthorizedComp;
|
|
82
84
|
var dataSourceCtxValue = usePlasmicDataSourceContext();
|
|
83
85
|
React__default.useEffect(function () {
|
|
@@ -109,6 +111,12 @@ function PlasmicPageGuard(props) {
|
|
|
109
111
|
}
|
|
110
112
|
return dataSourceCtxValue.user.roleIds.includes(minRole);
|
|
111
113
|
}
|
|
114
|
+
// If we are in prepass, PlasmicPageGuard should not render anything
|
|
115
|
+
// it's expected that pages are only equipped with PlasmicPageGuard
|
|
116
|
+
// when it's known that it will disable prepass/prefetching
|
|
117
|
+
if ((_a = plasmicQuery.isPlasmicPrepass) === null || _a === void 0 ? void 0 : _a.call(plasmicQuery)) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
112
120
|
/*
|
|
113
121
|
PlasmicPageGuard has three cases:
|
|
114
122
|
1. No value of dataSourceCtxValue, user is loading or a trigger login should be performed.
|