@poly-x/react 0.1.0-alpha.15 → 0.1.0-alpha.16
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.cjs +1 -16
- package/dist/index.d.cts +4 -5
- package/dist/index.d.mts +4 -5
- package/dist/index.mjs +1 -16
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -567,7 +567,6 @@ const DEFAULT_LABELS$3 = {
|
|
|
567
567
|
submit: "Sign in",
|
|
568
568
|
submitting: "Signing in…",
|
|
569
569
|
forgotPassword: "Forgot password?",
|
|
570
|
-
shareLocation: "Share my location for added account security",
|
|
571
570
|
chooseWorkspace: "Choose a workspace",
|
|
572
571
|
chooseWorkspaceSubheading: "You have access to more than one workspace.",
|
|
573
572
|
securedBy: "Secured by PolyX",
|
|
@@ -681,7 +680,6 @@ function SignIn(props) {
|
|
|
681
680
|
const [tenants, setTenants] = (0, react.useState)(null);
|
|
682
681
|
const [submitting, setSubmitting] = (0, react.useState)(false);
|
|
683
682
|
const [error, setError] = (0, react.useState)(null);
|
|
684
|
-
const [shareLocation, setShareLocation] = (0, react.useState)(false);
|
|
685
683
|
const polyx = (0, react.useContext)(PolyXContext);
|
|
686
684
|
const [branding, setBranding] = (0, react.useState)({});
|
|
687
685
|
(0, react.useEffect)(() => {
|
|
@@ -714,7 +712,7 @@ function SignIn(props) {
|
|
|
714
712
|
setSubmitting(true);
|
|
715
713
|
setError(null);
|
|
716
714
|
try {
|
|
717
|
-
const geo = props.captureLocation ? await capturePreciseLocation(
|
|
715
|
+
const geo = props.captureLocation ? await capturePreciseLocation(true) : void 0;
|
|
718
716
|
const body = await (await fetch(action, {
|
|
719
717
|
method: "POST",
|
|
720
718
|
headers: { "content-type": "application/json" },
|
|
@@ -927,19 +925,6 @@ function SignIn(props) {
|
|
|
927
925
|
children: labels.forgotPassword
|
|
928
926
|
})
|
|
929
927
|
}) : null,
|
|
930
|
-
props.captureLocation ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
931
|
-
className: "polyx-signin__consent",
|
|
932
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
933
|
-
type: "checkbox",
|
|
934
|
-
className: "polyx-signin__checkbox",
|
|
935
|
-
checked: shareLocation,
|
|
936
|
-
disabled: submitting,
|
|
937
|
-
onChange: (event) => setShareLocation(event.target.checked)
|
|
938
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
939
|
-
className: "polyx-signin__consent-label",
|
|
940
|
-
children: labels.shareLocation
|
|
941
|
-
})]
|
|
942
|
-
}) : null,
|
|
943
928
|
errorNode,
|
|
944
929
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
945
930
|
type: "submit",
|
package/dist/index.d.cts
CHANGED
|
@@ -225,8 +225,6 @@ interface SignInLabels {
|
|
|
225
225
|
submit: string;
|
|
226
226
|
submitting: string;
|
|
227
227
|
forgotPassword: string;
|
|
228
|
-
/** Consent checkbox label shown when `captureLocation` is enabled (v6). */
|
|
229
|
-
shareLocation: string;
|
|
230
228
|
chooseWorkspace: string;
|
|
231
229
|
chooseWorkspaceSubheading: string;
|
|
232
230
|
securedBy: string;
|
|
@@ -265,9 +263,10 @@ interface SignInProps {
|
|
|
265
263
|
*/
|
|
266
264
|
forgotPasswordUrl?: string;
|
|
267
265
|
/**
|
|
268
|
-
* v6 (FR-CNST):
|
|
269
|
-
*
|
|
270
|
-
*
|
|
266
|
+
* v6 (FR-CNST): capture precise location for security/presence. When enabled, sign-in asks the
|
|
267
|
+
* browser for a position — the browser's own native permission prompt is the consent gate (no
|
|
268
|
+
* in-form checkbox), and it's remembered per-origin after the first choice. A block, denial, or
|
|
269
|
+
* timeout never blocks sign-in (coarse IP fallback). Off by default.
|
|
271
270
|
*/
|
|
272
271
|
captureLocation?: boolean;
|
|
273
272
|
/** Where to send the browser after success. Overrides the server's default redirect. */
|
package/dist/index.d.mts
CHANGED
|
@@ -225,8 +225,6 @@ interface SignInLabels {
|
|
|
225
225
|
submit: string;
|
|
226
226
|
submitting: string;
|
|
227
227
|
forgotPassword: string;
|
|
228
|
-
/** Consent checkbox label shown when `captureLocation` is enabled (v6). */
|
|
229
|
-
shareLocation: string;
|
|
230
228
|
chooseWorkspace: string;
|
|
231
229
|
chooseWorkspaceSubheading: string;
|
|
232
230
|
securedBy: string;
|
|
@@ -265,9 +263,10 @@ interface SignInProps {
|
|
|
265
263
|
*/
|
|
266
264
|
forgotPasswordUrl?: string;
|
|
267
265
|
/**
|
|
268
|
-
* v6 (FR-CNST):
|
|
269
|
-
*
|
|
270
|
-
*
|
|
266
|
+
* v6 (FR-CNST): capture precise location for security/presence. When enabled, sign-in asks the
|
|
267
|
+
* browser for a position — the browser's own native permission prompt is the consent gate (no
|
|
268
|
+
* in-form checkbox), and it's remembered per-origin after the first choice. A block, denial, or
|
|
269
|
+
* timeout never blocks sign-in (coarse IP fallback). Off by default.
|
|
271
270
|
*/
|
|
272
271
|
captureLocation?: boolean;
|
|
273
272
|
/** Where to send the browser after success. Overrides the server's default redirect. */
|
package/dist/index.mjs
CHANGED
|
@@ -566,7 +566,6 @@ const DEFAULT_LABELS$3 = {
|
|
|
566
566
|
submit: "Sign in",
|
|
567
567
|
submitting: "Signing in…",
|
|
568
568
|
forgotPassword: "Forgot password?",
|
|
569
|
-
shareLocation: "Share my location for added account security",
|
|
570
569
|
chooseWorkspace: "Choose a workspace",
|
|
571
570
|
chooseWorkspaceSubheading: "You have access to more than one workspace.",
|
|
572
571
|
securedBy: "Secured by PolyX",
|
|
@@ -680,7 +679,6 @@ function SignIn(props) {
|
|
|
680
679
|
const [tenants, setTenants] = useState(null);
|
|
681
680
|
const [submitting, setSubmitting] = useState(false);
|
|
682
681
|
const [error, setError] = useState(null);
|
|
683
|
-
const [shareLocation, setShareLocation] = useState(false);
|
|
684
682
|
const polyx = useContext(PolyXContext);
|
|
685
683
|
const [branding, setBranding] = useState({});
|
|
686
684
|
useEffect(() => {
|
|
@@ -713,7 +711,7 @@ function SignIn(props) {
|
|
|
713
711
|
setSubmitting(true);
|
|
714
712
|
setError(null);
|
|
715
713
|
try {
|
|
716
|
-
const geo = props.captureLocation ? await capturePreciseLocation(
|
|
714
|
+
const geo = props.captureLocation ? await capturePreciseLocation(true) : void 0;
|
|
717
715
|
const body = await (await fetch(action, {
|
|
718
716
|
method: "POST",
|
|
719
717
|
headers: { "content-type": "application/json" },
|
|
@@ -926,19 +924,6 @@ function SignIn(props) {
|
|
|
926
924
|
children: labels.forgotPassword
|
|
927
925
|
})
|
|
928
926
|
}) : null,
|
|
929
|
-
props.captureLocation ? /* @__PURE__ */ jsxs("label", {
|
|
930
|
-
className: "polyx-signin__consent",
|
|
931
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
932
|
-
type: "checkbox",
|
|
933
|
-
className: "polyx-signin__checkbox",
|
|
934
|
-
checked: shareLocation,
|
|
935
|
-
disabled: submitting,
|
|
936
|
-
onChange: (event) => setShareLocation(event.target.checked)
|
|
937
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
938
|
-
className: "polyx-signin__consent-label",
|
|
939
|
-
children: labels.shareLocation
|
|
940
|
-
})]
|
|
941
|
-
}) : null,
|
|
942
927
|
errorNode,
|
|
943
928
|
/* @__PURE__ */ jsx("button", {
|
|
944
929
|
type: "submit",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poly-x/react",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.16",
|
|
4
4
|
"description": "PolyX SDK for React SPAs - provider, hooks, drop-in auth UI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"module": "./dist/index.mjs",
|
|
28
28
|
"types": "./dist/index.d.cts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@poly-x/core": "0.1.0-alpha.
|
|
30
|
+
"@poly-x/core": "0.1.0-alpha.16"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": ">=18",
|