@clerk/chrome-extension 2.8.2-snapshot.v20251117213621 → 2.8.2-snapshot.v20251117224912
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/cjs/background/index.js +1 -1
- package/dist/cjs/index.js +170 -160
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react/index.js +129 -119
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/esm/background/index.js +1 -1
- package/dist/esm/{chunk-ESIPBL55.js → chunk-4CWNHWNO.js} +112 -102
- package/dist/esm/chunk-4CWNHWNO.js.map +1 -0
- package/dist/esm/{chunk-2FARA3ID.js → chunk-ZM32VYQ5.js} +3 -3
- package/dist/esm/{chunk-2FARA3ID.js.map → chunk-ZM32VYQ5.js.map} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/react/index.js +2 -2
- package/package.json +4 -4
- package/dist/esm/chunk-ESIPBL55.js.map +0 -1
package/dist/cjs/react/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React8 = require('react');
|
|
4
4
|
require('use-sync-external-store/shim/index.js');
|
|
5
5
|
var reactDom = require('react-dom');
|
|
6
6
|
var noRhc = require('@clerk/clerk-js/no-rhc');
|
|
@@ -9,7 +9,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
9
9
|
|
|
10
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var React8__default = /*#__PURE__*/_interopDefault(React8);
|
|
13
13
|
var browser__default = /*#__PURE__*/_interopDefault(browser);
|
|
14
14
|
|
|
15
15
|
var __defProp = Object.defineProperty;
|
|
@@ -374,9 +374,9 @@ var defaultConfigOptions = {
|
|
|
374
374
|
initFocus,
|
|
375
375
|
initReconnect
|
|
376
376
|
};
|
|
377
|
-
!
|
|
377
|
+
!React8__default.default.useId;
|
|
378
378
|
var IS_SERVER = !isWindowDefined || isLegacyDeno;
|
|
379
|
-
var useIsomorphicLayoutEffect = IS_SERVER ?
|
|
379
|
+
var useIsomorphicLayoutEffect = IS_SERVER ? React8.useEffect : React8.useLayoutEffect;
|
|
380
380
|
var navigatorConnection = typeof navigator !== "undefined" && navigator.connection;
|
|
381
381
|
var slowConnection = !IS_SERVER && navigatorConnection && ([
|
|
382
382
|
"slow-2g",
|
|
@@ -678,23 +678,23 @@ var mergeConfigs = (a, b) => {
|
|
|
678
678
|
}
|
|
679
679
|
return v;
|
|
680
680
|
};
|
|
681
|
-
var SWRConfigContext =
|
|
681
|
+
var SWRConfigContext = React8.createContext({});
|
|
682
682
|
var SWRConfig = (props) => {
|
|
683
683
|
const { value } = props;
|
|
684
|
-
const parentConfig =
|
|
684
|
+
const parentConfig = React8.useContext(SWRConfigContext);
|
|
685
685
|
const isFunctionalConfig = isFunction(value);
|
|
686
|
-
const config =
|
|
686
|
+
const config = React8.useMemo(() => isFunctionalConfig ? value(parentConfig) : value, [
|
|
687
687
|
isFunctionalConfig,
|
|
688
688
|
parentConfig,
|
|
689
689
|
value
|
|
690
690
|
]);
|
|
691
|
-
const extendedConfig =
|
|
691
|
+
const extendedConfig = React8.useMemo(() => isFunctionalConfig ? config : mergeConfigs(parentConfig, config), [
|
|
692
692
|
isFunctionalConfig,
|
|
693
693
|
parentConfig,
|
|
694
694
|
config
|
|
695
695
|
]);
|
|
696
696
|
const provider = config && config.provider;
|
|
697
|
-
const cacheContextRef =
|
|
697
|
+
const cacheContextRef = React8.useRef(UNDEFINED);
|
|
698
698
|
if (provider && !cacheContextRef.current) {
|
|
699
699
|
cacheContextRef.current = initCache(provider(extendedConfig.cache || cache), config);
|
|
700
700
|
}
|
|
@@ -709,7 +709,7 @@ var SWRConfig = (props) => {
|
|
|
709
709
|
return cacheContext[3];
|
|
710
710
|
}
|
|
711
711
|
}, []);
|
|
712
|
-
return
|
|
712
|
+
return React8.createElement(SWRConfigContext.Provider, mergeObjects(props, {
|
|
713
713
|
value: extendedConfig
|
|
714
714
|
}));
|
|
715
715
|
};
|
|
@@ -720,7 +720,7 @@ var enableDevtools = isWindowDefined && window.__SWR_DEVTOOLS_USE__;
|
|
|
720
720
|
var use = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];
|
|
721
721
|
var setupDevTools = () => {
|
|
722
722
|
if (enableDevtools) {
|
|
723
|
-
window.__SWR_DEVTOOLS_REACT__ =
|
|
723
|
+
window.__SWR_DEVTOOLS_REACT__ = React8__default.default;
|
|
724
724
|
}
|
|
725
725
|
};
|
|
726
726
|
var middleware = (useSWRNext) => (key_, fetcher_, config) => {
|
|
@@ -739,7 +739,7 @@ var middleware = (useSWRNext) => (key_, fetcher_, config) => {
|
|
|
739
739
|
};
|
|
740
740
|
use.concat(middleware);
|
|
741
741
|
setupDevTools();
|
|
742
|
-
|
|
742
|
+
React8__default.default.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
|
|
743
743
|
// and emitting an error.
|
|
744
744
|
// We assume that this is only for the `use(thenable)` case, not `use(context)`.
|
|
745
745
|
// https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45
|
|
@@ -850,15 +850,15 @@ function assertContextExists(contextVal, msgOrCtx) {
|
|
|
850
850
|
}
|
|
851
851
|
var createContextAndHook = (displayName, options) => {
|
|
852
852
|
const { assertCtxFn = assertContextExists } = {};
|
|
853
|
-
const Ctx =
|
|
853
|
+
const Ctx = React8__default.default.createContext(void 0);
|
|
854
854
|
Ctx.displayName = displayName;
|
|
855
855
|
const useCtx = () => {
|
|
856
|
-
const ctx =
|
|
856
|
+
const ctx = React8__default.default.useContext(Ctx);
|
|
857
857
|
assertCtxFn(ctx, `${displayName} not found`);
|
|
858
858
|
return ctx.value;
|
|
859
859
|
};
|
|
860
860
|
const useCtxWithoutGuarantee = () => {
|
|
861
|
-
const ctx =
|
|
861
|
+
const ctx = React8__default.default.useContext(Ctx);
|
|
862
862
|
return ctx ? ctx.value : {};
|
|
863
863
|
};
|
|
864
864
|
return [
|
|
@@ -868,23 +868,23 @@ var createContextAndHook = (displayName, options) => {
|
|
|
868
868
|
];
|
|
869
869
|
};
|
|
870
870
|
function SWRConfigCompat({ swrConfig, children }) {
|
|
871
|
-
return /* @__PURE__ */
|
|
871
|
+
return /* @__PURE__ */ React8__default.default.createElement(SWRConfig2, { value: swrConfig }, children);
|
|
872
872
|
}
|
|
873
873
|
var [ClerkInstanceContext, useClerkInstanceContext] = createContextAndHook("ClerkInstanceContext");
|
|
874
874
|
var [UserContext] = createContextAndHook("UserContext");
|
|
875
875
|
var [ClientContext] = createContextAndHook("ClientContext");
|
|
876
876
|
var [SessionContext] = createContextAndHook("SessionContext");
|
|
877
|
-
|
|
877
|
+
React8__default.default.createContext({});
|
|
878
878
|
var [CheckoutContext] = createContextAndHook("CheckoutContext");
|
|
879
879
|
var __experimental_CheckoutProvider = ({ children, ...rest }) => {
|
|
880
|
-
return /* @__PURE__ */
|
|
880
|
+
return /* @__PURE__ */ React8__default.default.createElement(CheckoutContext.Provider, { value: { value: rest } }, children);
|
|
881
881
|
};
|
|
882
882
|
var [OrganizationContextInternal] = createContextAndHook("OrganizationContext");
|
|
883
883
|
var OrganizationProvider = ({ children, organization, swrConfig }) => {
|
|
884
|
-
return /* @__PURE__ */
|
|
884
|
+
return /* @__PURE__ */ React8__default.default.createElement(SWRConfigCompat, { swrConfig }, /* @__PURE__ */ React8__default.default.createElement(OrganizationContextInternal.Provider, { value: { value: { organization } } }, children));
|
|
885
885
|
};
|
|
886
886
|
function useAssertWrappedByClerkProvider(displayNameOrFn) {
|
|
887
|
-
if (!
|
|
887
|
+
if (!React8__default.default.useContext(ClerkInstanceContext)) {
|
|
888
888
|
if (typeof displayNameOrFn === "function") {
|
|
889
889
|
displayNameOrFn();
|
|
890
890
|
return;
|
|
@@ -898,22 +898,22 @@ Possible fixes:
|
|
|
898
898
|
Learn more: https://clerk.com/docs/components/clerk-provider`.trim());
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
|
-
typeof window !== "undefined" ?
|
|
901
|
+
typeof window !== "undefined" ? React8__default.default.useLayoutEffect : React8__default.default.useEffect;
|
|
902
902
|
var isDeeplyEqual = dequal2;
|
|
903
903
|
var usePrevious = (value) => {
|
|
904
|
-
const ref =
|
|
905
|
-
|
|
904
|
+
const ref = React8.useRef(value);
|
|
905
|
+
React8.useEffect(() => {
|
|
906
906
|
ref.current = value;
|
|
907
907
|
}, [value]);
|
|
908
908
|
return ref.current;
|
|
909
909
|
};
|
|
910
910
|
var useAttachEvent = (element, event, cb) => {
|
|
911
911
|
const cbDefined = !!cb;
|
|
912
|
-
const cbRef =
|
|
913
|
-
|
|
912
|
+
const cbRef = React8.useRef(cb);
|
|
913
|
+
React8.useEffect(() => {
|
|
914
914
|
cbRef.current = cb;
|
|
915
915
|
}, [cb]);
|
|
916
|
-
|
|
916
|
+
React8.useEffect(() => {
|
|
917
917
|
if (!cbDefined || !element) return () => {
|
|
918
918
|
};
|
|
919
919
|
const decoratedCb = (...args) => {
|
|
@@ -930,7 +930,7 @@ var useAttachEvent = (element, event, cb) => {
|
|
|
930
930
|
cbRef
|
|
931
931
|
]);
|
|
932
932
|
};
|
|
933
|
-
var ElementsContext =
|
|
933
|
+
var ElementsContext = React8__default.default.createContext(null);
|
|
934
934
|
ElementsContext.displayName = "ElementsContext";
|
|
935
935
|
var parseElementsContext = (ctx, useCase) => {
|
|
936
936
|
if (!ctx) throw new Error(`Could not find Elements context; You need to wrap the part of your app that ${useCase} in an <Elements> provider.`);
|
|
@@ -978,7 +978,7 @@ var isEqual = (left, right) => {
|
|
|
978
978
|
return allKeys.every(pred);
|
|
979
979
|
};
|
|
980
980
|
var useElementsOrCheckoutSdkContextWithUseCase = (useCaseString) => {
|
|
981
|
-
return parseElementsContext(
|
|
981
|
+
return parseElementsContext(React8__default.default.useContext(ElementsContext), useCaseString);
|
|
982
982
|
};
|
|
983
983
|
var capitalized = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
984
984
|
var createElementComponent = (type, isServer) => {
|
|
@@ -986,10 +986,10 @@ var createElementComponent = (type, isServer) => {
|
|
|
986
986
|
const ClientElement = ({ id, className, fallback, options = {}, onBlur, onFocus, onReady, onChange, onEscape, onClick, onLoadError, onLoaderStart, onNetworksChange, onConfirm, onCancel, onShippingAddressChange, onShippingRateChange }) => {
|
|
987
987
|
const ctx = useElementsOrCheckoutSdkContextWithUseCase(`mounts <${displayName}>`);
|
|
988
988
|
const elements = "elements" in ctx ? ctx.elements : null;
|
|
989
|
-
const [element, setElement] =
|
|
990
|
-
const elementRef =
|
|
991
|
-
const domNode =
|
|
992
|
-
const [isReady, setReady] =
|
|
989
|
+
const [element, setElement] = React8__default.default.useState(null);
|
|
990
|
+
const elementRef = React8__default.default.useRef(null);
|
|
991
|
+
const domNode = React8__default.default.useRef(null);
|
|
992
|
+
const [isReady, setReady] = React8.useState(false);
|
|
993
993
|
useAttachEvent(element, "blur", onBlur);
|
|
994
994
|
useAttachEvent(element, "focus", onFocus);
|
|
995
995
|
useAttachEvent(element, "escape", onEscape);
|
|
@@ -1008,7 +1008,7 @@ var createElementComponent = (type, isServer) => {
|
|
|
1008
1008
|
onReady(element);
|
|
1009
1009
|
};
|
|
1010
1010
|
useAttachEvent(element, "ready", readyCallback);
|
|
1011
|
-
|
|
1011
|
+
React8__default.default.useLayoutEffect(() => {
|
|
1012
1012
|
if (elementRef.current === null && domNode.current !== null && elements) {
|
|
1013
1013
|
let newElement = null;
|
|
1014
1014
|
if (elements) newElement = elements.create(type, options);
|
|
@@ -1018,12 +1018,12 @@ var createElementComponent = (type, isServer) => {
|
|
|
1018
1018
|
}
|
|
1019
1019
|
}, [elements, options]);
|
|
1020
1020
|
const prevOptions = usePrevious(options);
|
|
1021
|
-
|
|
1021
|
+
React8__default.default.useEffect(() => {
|
|
1022
1022
|
if (!elementRef.current) return;
|
|
1023
1023
|
const updates = extractAllowedOptionsUpdates(options, prevOptions, ["paymentRequest"]);
|
|
1024
1024
|
if (updates && "update" in elementRef.current) elementRef.current.update(updates);
|
|
1025
1025
|
}, [options, prevOptions]);
|
|
1026
|
-
|
|
1026
|
+
React8__default.default.useLayoutEffect(() => {
|
|
1027
1027
|
return () => {
|
|
1028
1028
|
if (elementRef.current && typeof elementRef.current.destroy === "function") try {
|
|
1029
1029
|
elementRef.current.destroy();
|
|
@@ -1032,7 +1032,7 @@ var createElementComponent = (type, isServer) => {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
};
|
|
1034
1034
|
}, []);
|
|
1035
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, !isReady && fallback, /* @__PURE__ */ React8__default.default.createElement("div", {
|
|
1036
1036
|
id,
|
|
1037
1037
|
style: {
|
|
1038
1038
|
height: isReady ? "unset" : "0px",
|
|
@@ -1045,7 +1045,7 @@ var createElementComponent = (type, isServer) => {
|
|
|
1045
1045
|
const ServerElement = (props) => {
|
|
1046
1046
|
useElementsOrCheckoutSdkContextWithUseCase(`mounts <${displayName}>`);
|
|
1047
1047
|
const { id, className } = props;
|
|
1048
|
-
return /* @__PURE__ */
|
|
1048
|
+
return /* @__PURE__ */ React8__default.default.createElement("div", {
|
|
1049
1049
|
id,
|
|
1050
1050
|
className
|
|
1051
1051
|
});
|
|
@@ -1099,7 +1099,7 @@ var withClerk = (Component, displayNameOrOptions) => {
|
|
|
1099
1099
|
if (!clerk2.loaded && !(options == null ? void 0 : options.renderWhileLoading)) {
|
|
1100
1100
|
return null;
|
|
1101
1101
|
}
|
|
1102
|
-
return /* @__PURE__ */
|
|
1102
|
+
return /* @__PURE__ */ React8__default.default.createElement(
|
|
1103
1103
|
Component,
|
|
1104
1104
|
{
|
|
1105
1105
|
...props,
|
|
@@ -1151,7 +1151,7 @@ withClerk(({ clerk: clerk2, ...props }) => {
|
|
|
1151
1151
|
// Compat for clerk-js<5.54.0 (which was released with the `signedInSessions` property)
|
|
1152
1152
|
client.activeSessions && client.activeSessions.length > 0
|
|
1153
1153
|
);
|
|
1154
|
-
|
|
1154
|
+
React8__default.default.useEffect(() => {
|
|
1155
1155
|
if (session === null && hasSignedInSessions) {
|
|
1156
1156
|
void clerk2.redirectToAfterSignOut();
|
|
1157
1157
|
} else {
|
|
@@ -1161,33 +1161,33 @@ withClerk(({ clerk: clerk2, ...props }) => {
|
|
|
1161
1161
|
return null;
|
|
1162
1162
|
}, "RedirectToSignIn");
|
|
1163
1163
|
withClerk(({ clerk: clerk2, ...props }) => {
|
|
1164
|
-
|
|
1164
|
+
React8__default.default.useEffect(() => {
|
|
1165
1165
|
void clerk2.redirectToSignUp(props);
|
|
1166
1166
|
}, []);
|
|
1167
1167
|
return null;
|
|
1168
1168
|
}, "RedirectToSignUp");
|
|
1169
1169
|
withClerk(({ clerk: clerk2, ...props }) => {
|
|
1170
|
-
|
|
1170
|
+
React8__default.default.useEffect(() => {
|
|
1171
1171
|
void clerk2.redirectToTasks(props);
|
|
1172
1172
|
}, []);
|
|
1173
1173
|
return null;
|
|
1174
1174
|
}, "RedirectToTasks");
|
|
1175
1175
|
withClerk(({ clerk: clerk2 }) => {
|
|
1176
|
-
|
|
1176
|
+
React8__default.default.useEffect(() => {
|
|
1177
1177
|
deprecated("RedirectToUserProfile", "Use the `redirectToUserProfile()` method instead.");
|
|
1178
1178
|
void clerk2.redirectToUserProfile();
|
|
1179
1179
|
}, []);
|
|
1180
1180
|
return null;
|
|
1181
1181
|
}, "RedirectToUserProfile");
|
|
1182
1182
|
withClerk(({ clerk: clerk2 }) => {
|
|
1183
|
-
|
|
1183
|
+
React8__default.default.useEffect(() => {
|
|
1184
1184
|
deprecated("RedirectToOrganizationProfile", "Use the `redirectToOrganizationProfile()` method instead.");
|
|
1185
1185
|
void clerk2.redirectToOrganizationProfile();
|
|
1186
1186
|
}, []);
|
|
1187
1187
|
return null;
|
|
1188
1188
|
}, "RedirectToOrganizationProfile");
|
|
1189
1189
|
withClerk(({ clerk: clerk2 }) => {
|
|
1190
|
-
|
|
1190
|
+
React8__default.default.useEffect(() => {
|
|
1191
1191
|
deprecated("RedirectToCreateOrganization", "Use the `redirectToCreateOrganization()` method instead.");
|
|
1192
1192
|
void clerk2.redirectToCreateOrganization();
|
|
1193
1193
|
}, []);
|
|
@@ -1195,7 +1195,7 @@ withClerk(({ clerk: clerk2 }) => {
|
|
|
1195
1195
|
}, "RedirectToCreateOrganization");
|
|
1196
1196
|
withClerk(
|
|
1197
1197
|
({ clerk: clerk2, ...handleRedirectCallbackParams }) => {
|
|
1198
|
-
|
|
1198
|
+
React8__default.default.useEffect(() => {
|
|
1199
1199
|
void clerk2.handleRedirectCallback(handleRedirectCallbackParams);
|
|
1200
1200
|
}, []);
|
|
1201
1201
|
return null;
|
|
@@ -1221,9 +1221,13 @@ var without = (obj, ...props) => {
|
|
|
1221
1221
|
for (const prop of props) delete copy[prop];
|
|
1222
1222
|
return copy;
|
|
1223
1223
|
};
|
|
1224
|
+
var PortalContext = React8.createContext(void 0);
|
|
1225
|
+
function usePortalConfig() {
|
|
1226
|
+
return React8.useContext(PortalContext);
|
|
1227
|
+
}
|
|
1224
1228
|
var assertSingleChild = (children) => (name) => {
|
|
1225
1229
|
try {
|
|
1226
|
-
return
|
|
1230
|
+
return React8__default.default.Children.only(children);
|
|
1227
1231
|
} catch {
|
|
1228
1232
|
return errorThrower.throw(multipleChildrenInButtonComponent(name));
|
|
1229
1233
|
}
|
|
@@ -1233,7 +1237,7 @@ var normalizeWithDefaultValue = (children, defaultText) => {
|
|
|
1233
1237
|
children = defaultText;
|
|
1234
1238
|
}
|
|
1235
1239
|
if (typeof children === "string") {
|
|
1236
|
-
children = /* @__PURE__ */
|
|
1240
|
+
children = /* @__PURE__ */ React8__default.default.createElement("button", null, children);
|
|
1237
1241
|
}
|
|
1238
1242
|
return children;
|
|
1239
1243
|
};
|
|
@@ -1247,7 +1251,7 @@ function isConstructor(f) {
|
|
|
1247
1251
|
}
|
|
1248
1252
|
var counts = /* @__PURE__ */ new Map();
|
|
1249
1253
|
function useMaxAllowedInstancesGuard(name, error, maxCount = 1) {
|
|
1250
|
-
|
|
1254
|
+
React8__default.default.useEffect(() => {
|
|
1251
1255
|
const count = counts.get(name) || 0;
|
|
1252
1256
|
if (count == maxCount) {
|
|
1253
1257
|
return errorThrower.throw(error);
|
|
@@ -1262,13 +1266,13 @@ function withMaxAllowedInstancesGuard(WrappedComponent, name, error) {
|
|
|
1262
1266
|
const displayName = WrappedComponent.displayName || WrappedComponent.name || name || "Component";
|
|
1263
1267
|
const Hoc = (props) => {
|
|
1264
1268
|
useMaxAllowedInstancesGuard(name, error);
|
|
1265
|
-
return /* @__PURE__ */
|
|
1269
|
+
return /* @__PURE__ */ React8__default.default.createElement(WrappedComponent, { ...props });
|
|
1266
1270
|
};
|
|
1267
1271
|
Hoc.displayName = `withMaxAllowedInstancesGuard(${displayName})`;
|
|
1268
1272
|
return Hoc;
|
|
1269
1273
|
}
|
|
1270
1274
|
var useCustomElementPortal = (elements) => {
|
|
1271
|
-
const [nodeMap, setNodeMap] =
|
|
1275
|
+
const [nodeMap, setNodeMap] = React8.useState(/* @__PURE__ */ new Map());
|
|
1272
1276
|
return elements.map((el) => ({
|
|
1273
1277
|
id: el.id,
|
|
1274
1278
|
mount: (node) => setNodeMap((prev) => new Map(prev).set(String(el.id), node)),
|
|
@@ -1284,7 +1288,7 @@ var useCustomElementPortal = (elements) => {
|
|
|
1284
1288
|
}));
|
|
1285
1289
|
};
|
|
1286
1290
|
var isThatComponent = (v, component) => {
|
|
1287
|
-
return !!v &&
|
|
1291
|
+
return !!v && React8__default.default.isValidElement(v) && (v == null ? void 0 : v.type) === component;
|
|
1288
1292
|
};
|
|
1289
1293
|
var useUserProfileCustomPages = (children, options) => {
|
|
1290
1294
|
const reorderItemsLabels = ["account", "security"];
|
|
@@ -1322,7 +1326,7 @@ var useSanitizedChildren = (children) => {
|
|
|
1322
1326
|
UserProfilePage,
|
|
1323
1327
|
UserProfileLink
|
|
1324
1328
|
];
|
|
1325
|
-
|
|
1329
|
+
React8__default.default.Children.forEach(children, (child) => {
|
|
1326
1330
|
if (!excludedComponents.some((component) => isThatComponent(child, component))) {
|
|
1327
1331
|
sanitizedChildren.push(child);
|
|
1328
1332
|
}
|
|
@@ -1333,7 +1337,7 @@ var useCustomPages = (params, options) => {
|
|
|
1333
1337
|
const { children, LinkComponent, PageComponent, MenuItemsComponent, reorderItemsLabels, componentName } = params;
|
|
1334
1338
|
const { allowForAnyChildren = false } = options || {};
|
|
1335
1339
|
const validChildren = [];
|
|
1336
|
-
|
|
1340
|
+
React8__default.default.Children.forEach(children, (child) => {
|
|
1337
1341
|
if (!isThatComponent(child, PageComponent) && !isThatComponent(child, LinkComponent) && !isThatComponent(child, MenuItemsComponent)) {
|
|
1338
1342
|
if (child && !allowForAnyChildren) {
|
|
1339
1343
|
logErrorInDevMode(customPagesIgnoredComponent(componentName));
|
|
@@ -1452,7 +1456,7 @@ var useCustomMenuItems = ({
|
|
|
1452
1456
|
const validChildren = [];
|
|
1453
1457
|
const customMenuItems = [];
|
|
1454
1458
|
const customMenuItemsPortals = [];
|
|
1455
|
-
|
|
1459
|
+
React8__default.default.Children.forEach(children, (child) => {
|
|
1456
1460
|
if (!isThatComponent(child, MenuItemsComponent) && !isThatComponent(child, UserProfileLinkComponent) && !isThatComponent(child, UserProfilePageComponent)) {
|
|
1457
1461
|
if (child && !allowForAnyChildren) {
|
|
1458
1462
|
logErrorInDevMode(userButtonIgnoredComponent);
|
|
@@ -1463,7 +1467,7 @@ var useCustomMenuItems = ({
|
|
|
1463
1467
|
return;
|
|
1464
1468
|
}
|
|
1465
1469
|
const { props } = child;
|
|
1466
|
-
|
|
1470
|
+
React8__default.default.Children.forEach(props.children, (child2) => {
|
|
1467
1471
|
if (!isThatComponent(child2, MenuActionComponent) && !isThatComponent(child2, MenuLinkComponent)) {
|
|
1468
1472
|
if (child2) {
|
|
1469
1473
|
logErrorInDevMode(customMenuItemsIgnoredComponent);
|
|
@@ -1623,9 +1627,9 @@ var waitForElementChildren = createAwaitableMutationObserver({
|
|
|
1623
1627
|
}
|
|
1624
1628
|
});
|
|
1625
1629
|
function useWaitForComponentMount(component, options) {
|
|
1626
|
-
const watcherRef =
|
|
1627
|
-
const [status, setStatus] =
|
|
1628
|
-
|
|
1630
|
+
const watcherRef = React8.useRef();
|
|
1631
|
+
const [status, setStatus] = React8.useState("rendering");
|
|
1632
|
+
React8.useEffect(() => {
|
|
1629
1633
|
if (!component) {
|
|
1630
1634
|
throw new Error("Clerk: no component name provided, unable to detect mount.");
|
|
1631
1635
|
}
|
|
@@ -1655,10 +1659,10 @@ var isOpenProps = (props) => {
|
|
|
1655
1659
|
var stripMenuItemIconHandlers = (menuItems) => {
|
|
1656
1660
|
return menuItems == null ? void 0 : menuItems.map(({ mountIcon, unmountIcon, ...rest }) => rest);
|
|
1657
1661
|
};
|
|
1658
|
-
var ClerkHostRenderer = class extends
|
|
1662
|
+
var ClerkHostRenderer = class extends React8__default.default.PureComponent {
|
|
1659
1663
|
constructor() {
|
|
1660
1664
|
super(...arguments);
|
|
1661
|
-
this.rootRef =
|
|
1665
|
+
this.rootRef = React8__default.default.createRef();
|
|
1662
1666
|
}
|
|
1663
1667
|
componentDidUpdate(_prevProps) {
|
|
1664
1668
|
var _a5, _b, _c, _d;
|
|
@@ -1704,12 +1708,12 @@ var ClerkHostRenderer = class extends React7__default.default.PureComponent {
|
|
|
1704
1708
|
...this.props.rootProps,
|
|
1705
1709
|
...this.props.component && { "data-clerk-component": this.props.component }
|
|
1706
1710
|
};
|
|
1707
|
-
return /* @__PURE__ */
|
|
1711
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, !hideRootHtmlElement && /* @__PURE__ */ React8__default.default.createElement("div", { ...rootAttributes }), this.props.children);
|
|
1708
1712
|
}
|
|
1709
1713
|
};
|
|
1710
1714
|
var CustomPortalsRenderer = (props) => {
|
|
1711
1715
|
var _a5, _b;
|
|
1712
|
-
return /* @__PURE__ */
|
|
1716
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, (_a5 = props == null ? void 0 : props.customPagesPortals) == null ? void 0 : _a5.map((portal, index) => React8.createElement(portal, { key: index })), (_b = props == null ? void 0 : props.customMenuItemsPortals) == null ? void 0 : _b.map((portal, index) => React8.createElement(portal, { key: index })));
|
|
1713
1717
|
};
|
|
1714
1718
|
withClerk(
|
|
1715
1719
|
({ clerk: clerk2, component, fallback, ...props }) => {
|
|
@@ -1718,7 +1722,7 @@ withClerk(
|
|
|
1718
1722
|
const rendererRootProps = {
|
|
1719
1723
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
1720
1724
|
};
|
|
1721
|
-
return /* @__PURE__ */
|
|
1725
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, shouldShowFallback && fallback, clerk2.loaded && /* @__PURE__ */ React8__default.default.createElement(
|
|
1722
1726
|
ClerkHostRenderer,
|
|
1723
1727
|
{
|
|
1724
1728
|
component,
|
|
@@ -1739,7 +1743,7 @@ withClerk(
|
|
|
1739
1743
|
const rendererRootProps = {
|
|
1740
1744
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
1741
1745
|
};
|
|
1742
|
-
return /* @__PURE__ */
|
|
1746
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, shouldShowFallback && fallback, clerk2.loaded && /* @__PURE__ */ React8__default.default.createElement(
|
|
1743
1747
|
ClerkHostRenderer,
|
|
1744
1748
|
{
|
|
1745
1749
|
component,
|
|
@@ -1755,11 +1759,11 @@ withClerk(
|
|
|
1755
1759
|
);
|
|
1756
1760
|
function UserProfilePage({ children }) {
|
|
1757
1761
|
logErrorInDevMode(userProfilePageRenderedError);
|
|
1758
|
-
return /* @__PURE__ */
|
|
1762
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, children);
|
|
1759
1763
|
}
|
|
1760
1764
|
function UserProfileLink({ children }) {
|
|
1761
1765
|
logErrorInDevMode(userProfileLinkRenderedError);
|
|
1762
|
-
return /* @__PURE__ */
|
|
1766
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, children);
|
|
1763
1767
|
}
|
|
1764
1768
|
var _UserProfile = withClerk(
|
|
1765
1769
|
({
|
|
@@ -1770,21 +1774,23 @@ var _UserProfile = withClerk(
|
|
|
1770
1774
|
}) => {
|
|
1771
1775
|
const mountingStatus = useWaitForComponentMount(component);
|
|
1772
1776
|
const shouldShowFallback = mountingStatus === "rendering" || !clerk2.loaded;
|
|
1777
|
+
const portalFromContext = usePortalConfig();
|
|
1778
|
+
const portal = props.portal !== void 0 ? props.portal : portalFromContext;
|
|
1773
1779
|
const rendererRootProps = {
|
|
1774
1780
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
1775
1781
|
};
|
|
1776
1782
|
const { customPages, customPagesPortals } = useUserProfileCustomPages(props.children);
|
|
1777
|
-
return /* @__PURE__ */
|
|
1783
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, shouldShowFallback && fallback, /* @__PURE__ */ React8__default.default.createElement(
|
|
1778
1784
|
ClerkHostRenderer,
|
|
1779
1785
|
{
|
|
1780
1786
|
component,
|
|
1781
1787
|
mount: clerk2.mountUserProfile,
|
|
1782
1788
|
unmount: clerk2.unmountUserProfile,
|
|
1783
1789
|
updateProps: clerk2.__unstable__updateProps,
|
|
1784
|
-
props: { ...props, customPages },
|
|
1790
|
+
props: { ...props, portal, customPages },
|
|
1785
1791
|
rootProps: rendererRootProps
|
|
1786
1792
|
},
|
|
1787
|
-
/* @__PURE__ */
|
|
1793
|
+
/* @__PURE__ */ React8__default.default.createElement(CustomPortalsRenderer, { customPagesPortals })
|
|
1788
1794
|
));
|
|
1789
1795
|
},
|
|
1790
1796
|
{ component: "UserProfile", renderWhileLoading: true }
|
|
@@ -1793,7 +1799,7 @@ Object.assign(_UserProfile, {
|
|
|
1793
1799
|
Page: UserProfilePage,
|
|
1794
1800
|
Link: UserProfileLink
|
|
1795
1801
|
});
|
|
1796
|
-
var UserButtonContext =
|
|
1802
|
+
var UserButtonContext = React8.createContext({
|
|
1797
1803
|
mount: () => {
|
|
1798
1804
|
},
|
|
1799
1805
|
unmount: () => {
|
|
@@ -1810,6 +1816,8 @@ var _UserButton = withClerk(
|
|
|
1810
1816
|
}) => {
|
|
1811
1817
|
const mountingStatus = useWaitForComponentMount(component);
|
|
1812
1818
|
const shouldShowFallback = mountingStatus === "rendering" || !clerk2.loaded;
|
|
1819
|
+
const portalFromContext = usePortalConfig();
|
|
1820
|
+
const portal = props.portal !== void 0 ? props.portal : portalFromContext;
|
|
1813
1821
|
const rendererRootProps = {
|
|
1814
1822
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
1815
1823
|
};
|
|
@@ -1825,13 +1833,13 @@ var _UserButton = withClerk(
|
|
|
1825
1833
|
mount: clerk2.mountUserButton,
|
|
1826
1834
|
unmount: clerk2.unmountUserButton,
|
|
1827
1835
|
updateProps: clerk2.__unstable__updateProps,
|
|
1828
|
-
props: { ...props, userProfileProps, customMenuItems }
|
|
1836
|
+
props: { ...props, portal, userProfileProps, customMenuItems }
|
|
1829
1837
|
};
|
|
1830
1838
|
const portalProps = {
|
|
1831
1839
|
customPagesPortals,
|
|
1832
1840
|
customMenuItemsPortals
|
|
1833
1841
|
};
|
|
1834
|
-
return /* @__PURE__ */
|
|
1842
|
+
return /* @__PURE__ */ React8__default.default.createElement(UserButtonContext.Provider, { value: passableProps }, shouldShowFallback && fallback, clerk2.loaded && /* @__PURE__ */ React8__default.default.createElement(
|
|
1835
1843
|
ClerkHostRenderer,
|
|
1836
1844
|
{
|
|
1837
1845
|
component,
|
|
@@ -1840,25 +1848,25 @@ var _UserButton = withClerk(
|
|
|
1840
1848
|
rootProps: rendererRootProps
|
|
1841
1849
|
},
|
|
1842
1850
|
props.__experimental_asProvider ? sanitizedChildren : null,
|
|
1843
|
-
/* @__PURE__ */
|
|
1851
|
+
/* @__PURE__ */ React8__default.default.createElement(CustomPortalsRenderer, { ...portalProps })
|
|
1844
1852
|
));
|
|
1845
1853
|
},
|
|
1846
1854
|
{ component: "UserButton", renderWhileLoading: true }
|
|
1847
1855
|
);
|
|
1848
1856
|
function MenuItems({ children }) {
|
|
1849
1857
|
logErrorInDevMode(userButtonMenuItemsRenderedError);
|
|
1850
|
-
return /* @__PURE__ */
|
|
1858
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, children);
|
|
1851
1859
|
}
|
|
1852
1860
|
function MenuAction({ children }) {
|
|
1853
1861
|
logErrorInDevMode(userButtonMenuActionRenderedError);
|
|
1854
|
-
return /* @__PURE__ */
|
|
1862
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, children);
|
|
1855
1863
|
}
|
|
1856
1864
|
function MenuLink({ children }) {
|
|
1857
1865
|
logErrorInDevMode(userButtonMenuLinkRenderedError);
|
|
1858
|
-
return /* @__PURE__ */
|
|
1866
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, children);
|
|
1859
1867
|
}
|
|
1860
1868
|
function UserButtonOutlet(outletProps) {
|
|
1861
|
-
const providerProps =
|
|
1869
|
+
const providerProps = React8.useContext(UserButtonContext);
|
|
1862
1870
|
const portalProps = {
|
|
1863
1871
|
...providerProps,
|
|
1864
1872
|
props: {
|
|
@@ -1866,7 +1874,7 @@ function UserButtonOutlet(outletProps) {
|
|
|
1866
1874
|
...outletProps
|
|
1867
1875
|
}
|
|
1868
1876
|
};
|
|
1869
|
-
return /* @__PURE__ */
|
|
1877
|
+
return /* @__PURE__ */ React8__default.default.createElement(ClerkHostRenderer, { ...portalProps });
|
|
1870
1878
|
}
|
|
1871
1879
|
Object.assign(_UserButton, {
|
|
1872
1880
|
UserProfilePage,
|
|
@@ -1878,11 +1886,11 @@ Object.assign(_UserButton, {
|
|
|
1878
1886
|
});
|
|
1879
1887
|
function OrganizationProfilePage({ children }) {
|
|
1880
1888
|
logErrorInDevMode(organizationProfilePageRenderedError);
|
|
1881
|
-
return /* @__PURE__ */
|
|
1889
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, children);
|
|
1882
1890
|
}
|
|
1883
1891
|
function OrganizationProfileLink({ children }) {
|
|
1884
1892
|
logErrorInDevMode(organizationProfileLinkRenderedError);
|
|
1885
|
-
return /* @__PURE__ */
|
|
1893
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, children);
|
|
1886
1894
|
}
|
|
1887
1895
|
var _OrganizationProfile = withClerk(
|
|
1888
1896
|
({
|
|
@@ -1897,7 +1905,7 @@ var _OrganizationProfile = withClerk(
|
|
|
1897
1905
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
1898
1906
|
};
|
|
1899
1907
|
const { customPages, customPagesPortals } = useOrganizationProfileCustomPages(props.children);
|
|
1900
|
-
return /* @__PURE__ */
|
|
1908
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, shouldShowFallback && fallback, clerk2.loaded && /* @__PURE__ */ React8__default.default.createElement(
|
|
1901
1909
|
ClerkHostRenderer,
|
|
1902
1910
|
{
|
|
1903
1911
|
component,
|
|
@@ -1907,7 +1915,7 @@ var _OrganizationProfile = withClerk(
|
|
|
1907
1915
|
props: { ...props, customPages },
|
|
1908
1916
|
rootProps: rendererRootProps
|
|
1909
1917
|
},
|
|
1910
|
-
/* @__PURE__ */
|
|
1918
|
+
/* @__PURE__ */ React8__default.default.createElement(CustomPortalsRenderer, { customPagesPortals })
|
|
1911
1919
|
));
|
|
1912
1920
|
},
|
|
1913
1921
|
{ component: "OrganizationProfile", renderWhileLoading: true }
|
|
@@ -1923,7 +1931,7 @@ withClerk(
|
|
|
1923
1931
|
const rendererRootProps = {
|
|
1924
1932
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
1925
1933
|
};
|
|
1926
|
-
return /* @__PURE__ */
|
|
1934
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, shouldShowFallback && fallback, clerk2.loaded && /* @__PURE__ */ React8__default.default.createElement(
|
|
1927
1935
|
ClerkHostRenderer,
|
|
1928
1936
|
{
|
|
1929
1937
|
component,
|
|
@@ -1937,7 +1945,7 @@ withClerk(
|
|
|
1937
1945
|
},
|
|
1938
1946
|
{ component: "CreateOrganization", renderWhileLoading: true }
|
|
1939
1947
|
);
|
|
1940
|
-
var OrganizationSwitcherContext =
|
|
1948
|
+
var OrganizationSwitcherContext = React8.createContext({
|
|
1941
1949
|
mount: () => {
|
|
1942
1950
|
},
|
|
1943
1951
|
unmount: () => {
|
|
@@ -1954,6 +1962,8 @@ var _OrganizationSwitcher = withClerk(
|
|
|
1954
1962
|
}) => {
|
|
1955
1963
|
const mountingStatus = useWaitForComponentMount(component);
|
|
1956
1964
|
const shouldShowFallback = mountingStatus === "rendering" || !clerk2.loaded;
|
|
1965
|
+
const portalFromContext = usePortalConfig();
|
|
1966
|
+
const portal = props.portal !== void 0 ? props.portal : portalFromContext;
|
|
1957
1967
|
const rendererRootProps = {
|
|
1958
1968
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
1959
1969
|
};
|
|
@@ -1966,25 +1976,25 @@ var _OrganizationSwitcher = withClerk(
|
|
|
1966
1976
|
mount: clerk2.mountOrganizationSwitcher,
|
|
1967
1977
|
unmount: clerk2.unmountOrganizationSwitcher,
|
|
1968
1978
|
updateProps: clerk2.__unstable__updateProps,
|
|
1969
|
-
props: { ...props, organizationProfileProps },
|
|
1979
|
+
props: { ...props, portal, organizationProfileProps },
|
|
1970
1980
|
rootProps: rendererRootProps,
|
|
1971
1981
|
component
|
|
1972
1982
|
};
|
|
1973
1983
|
clerk2.__experimental_prefetchOrganizationSwitcher();
|
|
1974
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ React8__default.default.createElement(OrganizationSwitcherContext.Provider, { value: passableProps }, /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, shouldShowFallback && fallback, clerk2.loaded && /* @__PURE__ */ React8__default.default.createElement(
|
|
1975
1985
|
ClerkHostRenderer,
|
|
1976
1986
|
{
|
|
1977
1987
|
...passableProps,
|
|
1978
1988
|
hideRootHtmlElement: !!props.__experimental_asProvider
|
|
1979
1989
|
},
|
|
1980
1990
|
props.__experimental_asProvider ? sanitizedChildren : null,
|
|
1981
|
-
/* @__PURE__ */
|
|
1991
|
+
/* @__PURE__ */ React8__default.default.createElement(CustomPortalsRenderer, { customPagesPortals })
|
|
1982
1992
|
)));
|
|
1983
1993
|
},
|
|
1984
1994
|
{ component: "OrganizationSwitcher", renderWhileLoading: true }
|
|
1985
1995
|
);
|
|
1986
1996
|
function OrganizationSwitcherOutlet(outletProps) {
|
|
1987
|
-
const providerProps =
|
|
1997
|
+
const providerProps = React8.useContext(OrganizationSwitcherContext);
|
|
1988
1998
|
const portalProps = {
|
|
1989
1999
|
...providerProps,
|
|
1990
2000
|
props: {
|
|
@@ -1992,7 +2002,7 @@ function OrganizationSwitcherOutlet(outletProps) {
|
|
|
1992
2002
|
...outletProps
|
|
1993
2003
|
}
|
|
1994
2004
|
};
|
|
1995
|
-
return /* @__PURE__ */
|
|
2005
|
+
return /* @__PURE__ */ React8__default.default.createElement(ClerkHostRenderer, { ...portalProps });
|
|
1996
2006
|
}
|
|
1997
2007
|
Object.assign(_OrganizationSwitcher, {
|
|
1998
2008
|
OrganizationProfilePage,
|
|
@@ -2006,7 +2016,7 @@ withClerk(
|
|
|
2006
2016
|
const rendererRootProps = {
|
|
2007
2017
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
2008
2018
|
};
|
|
2009
|
-
return /* @__PURE__ */
|
|
2019
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, shouldShowFallback && fallback, clerk2.loaded && /* @__PURE__ */ React8__default.default.createElement(
|
|
2010
2020
|
ClerkHostRenderer,
|
|
2011
2021
|
{
|
|
2012
2022
|
component,
|
|
@@ -2027,7 +2037,7 @@ withClerk(
|
|
|
2027
2037
|
const rendererRootProps = {
|
|
2028
2038
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
2029
2039
|
};
|
|
2030
|
-
return /* @__PURE__ */
|
|
2040
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, shouldShowFallback && fallback, clerk2.loaded && /* @__PURE__ */ React8__default.default.createElement(
|
|
2031
2041
|
ClerkHostRenderer,
|
|
2032
2042
|
{
|
|
2033
2043
|
component,
|
|
@@ -2048,7 +2058,7 @@ withClerk(
|
|
|
2048
2058
|
const rendererRootProps = {
|
|
2049
2059
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
2050
2060
|
};
|
|
2051
|
-
return /* @__PURE__ */
|
|
2061
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, shouldShowFallback && fallback, clerk2.loaded && /* @__PURE__ */ React8__default.default.createElement(
|
|
2052
2062
|
ClerkHostRenderer,
|
|
2053
2063
|
{
|
|
2054
2064
|
component,
|
|
@@ -2072,7 +2082,7 @@ withClerk(
|
|
|
2072
2082
|
const rendererRootProps = {
|
|
2073
2083
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
2074
2084
|
};
|
|
2075
|
-
return /* @__PURE__ */
|
|
2085
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, shouldShowFallback && fallback, clerk2.loaded && /* @__PURE__ */ React8__default.default.createElement(
|
|
2076
2086
|
ClerkHostRenderer,
|
|
2077
2087
|
{
|
|
2078
2088
|
component,
|
|
@@ -2093,7 +2103,7 @@ withClerk(
|
|
|
2093
2103
|
const rendererRootProps = {
|
|
2094
2104
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
2095
2105
|
};
|
|
2096
|
-
return /* @__PURE__ */
|
|
2106
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, shouldShowFallback && fallback, clerk2.loaded && /* @__PURE__ */ React8__default.default.createElement(
|
|
2097
2107
|
ClerkHostRenderer,
|
|
2098
2108
|
{
|
|
2099
2109
|
component,
|
|
@@ -2114,7 +2124,7 @@ withClerk(
|
|
|
2114
2124
|
const rendererRootProps = {
|
|
2115
2125
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
2116
2126
|
};
|
|
2117
|
-
return /* @__PURE__ */
|
|
2127
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, shouldShowFallback && fallback, clerk2.loaded && /* @__PURE__ */ React8__default.default.createElement(
|
|
2118
2128
|
ClerkHostRenderer,
|
|
2119
2129
|
{
|
|
2120
2130
|
component,
|
|
@@ -2135,7 +2145,7 @@ withClerk(
|
|
|
2135
2145
|
const rendererRootProps = {
|
|
2136
2146
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
2137
2147
|
};
|
|
2138
|
-
return /* @__PURE__ */
|
|
2148
|
+
return /* @__PURE__ */ React8__default.default.createElement(React8__default.default.Fragment, null, shouldShowFallback && fallback, clerk2.loaded && /* @__PURE__ */ React8__default.default.createElement(
|
|
2139
2149
|
ClerkHostRenderer,
|
|
2140
2150
|
{
|
|
2141
2151
|
component,
|
|
@@ -2315,7 +2325,7 @@ withClerk(
|
|
|
2315
2325
|
return clickHandler();
|
|
2316
2326
|
};
|
|
2317
2327
|
const childProps = { ...rest, onClick: wrappedChildClickHandler };
|
|
2318
|
-
return
|
|
2328
|
+
return React8__default.default.cloneElement(child, childProps);
|
|
2319
2329
|
},
|
|
2320
2330
|
{ component: "SignInButton", renderWhileLoading: true }
|
|
2321
2331
|
);
|
|
@@ -2335,7 +2345,7 @@ withClerk(
|
|
|
2335
2345
|
return clickHandler();
|
|
2336
2346
|
};
|
|
2337
2347
|
const childProps = { ...rest, onClick: wrappedChildClickHandler };
|
|
2338
|
-
return
|
|
2348
|
+
return React8__default.default.cloneElement(child, childProps);
|
|
2339
2349
|
},
|
|
2340
2350
|
{ component: "SignInWithMetamask", renderWhileLoading: true }
|
|
2341
2351
|
);
|
|
@@ -2350,7 +2360,7 @@ withClerk(
|
|
|
2350
2360
|
return clickHandler();
|
|
2351
2361
|
};
|
|
2352
2362
|
const childProps = { ...rest, onClick: wrappedChildClickHandler };
|
|
2353
|
-
return
|
|
2363
|
+
return React8__default.default.cloneElement(child, childProps);
|
|
2354
2364
|
},
|
|
2355
2365
|
{ component: "SignOutButton", renderWhileLoading: true }
|
|
2356
2366
|
);
|
|
@@ -2397,7 +2407,7 @@ withClerk(
|
|
|
2397
2407
|
return clickHandler();
|
|
2398
2408
|
};
|
|
2399
2409
|
const childProps = { ...rest, onClick: wrappedChildClickHandler };
|
|
2400
|
-
return
|
|
2410
|
+
return React8__default.default.cloneElement(child, childProps);
|
|
2401
2411
|
},
|
|
2402
2412
|
{ component: "SignUpButton", renderWhileLoading: true }
|
|
2403
2413
|
);
|
|
@@ -2677,7 +2687,7 @@ if (typeof globalThis.__BUILD_DISABLE_RHC__ === "undefined") {
|
|
|
2677
2687
|
}
|
|
2678
2688
|
var SDK_METADATA = {
|
|
2679
2689
|
name: "@clerk/clerk-react",
|
|
2680
|
-
version: "5.56.0-snapshot.
|
|
2690
|
+
version: "5.56.0-snapshot.v20251117224912",
|
|
2681
2691
|
environment: process.env.NODE_ENV
|
|
2682
2692
|
};
|
|
2683
2693
|
var _status;
|
|
@@ -3911,24 +3921,24 @@ var IsomorphicClerk = _IsomorphicClerk;
|
|
|
3911
3921
|
function ClerkContextProvider(props) {
|
|
3912
3922
|
const { isomorphicClerkOptions, initialState, children } = props;
|
|
3913
3923
|
const { isomorphicClerk: clerk2, clerkStatus } = useLoadedIsomorphicClerk(isomorphicClerkOptions);
|
|
3914
|
-
const [state, setState] =
|
|
3924
|
+
const [state, setState] = React8__default.default.useState({
|
|
3915
3925
|
client: clerk2.client,
|
|
3916
3926
|
session: clerk2.session,
|
|
3917
3927
|
user: clerk2.user,
|
|
3918
3928
|
organization: clerk2.organization
|
|
3919
3929
|
});
|
|
3920
|
-
|
|
3930
|
+
React8__default.default.useEffect(() => {
|
|
3921
3931
|
return clerk2.addListener((e) => setState({ ...e }));
|
|
3922
3932
|
}, []);
|
|
3923
3933
|
const derivedState = deriveState(clerk2.loaded, state, initialState);
|
|
3924
|
-
const clerkCtx =
|
|
3934
|
+
const clerkCtx = React8__default.default.useMemo(
|
|
3925
3935
|
() => ({ value: clerk2 }),
|
|
3926
3936
|
[
|
|
3927
3937
|
// Only update the clerk reference on status change
|
|
3928
3938
|
clerkStatus
|
|
3929
3939
|
]
|
|
3930
3940
|
);
|
|
3931
|
-
const clientCtx =
|
|
3941
|
+
const clientCtx = React8__default.default.useMemo(() => ({ value: state.client }), [state.client]);
|
|
3932
3942
|
const {
|
|
3933
3943
|
sessionId,
|
|
3934
3944
|
sessionStatus,
|
|
@@ -3944,7 +3954,7 @@ function ClerkContextProvider(props) {
|
|
|
3944
3954
|
orgPermissions,
|
|
3945
3955
|
factorVerificationAge
|
|
3946
3956
|
} = derivedState;
|
|
3947
|
-
const authCtx =
|
|
3957
|
+
const authCtx = React8__default.default.useMemo(() => {
|
|
3948
3958
|
const value = {
|
|
3949
3959
|
sessionId,
|
|
3950
3960
|
sessionStatus,
|
|
@@ -3959,9 +3969,9 @@ function ClerkContextProvider(props) {
|
|
|
3959
3969
|
};
|
|
3960
3970
|
return { value };
|
|
3961
3971
|
}, [sessionId, sessionStatus, userId, actor, orgId, orgRole, orgSlug, factorVerificationAge, sessionClaims == null ? void 0 : sessionClaims.__raw]);
|
|
3962
|
-
const sessionCtx =
|
|
3963
|
-
const userCtx =
|
|
3964
|
-
const organizationCtx =
|
|
3972
|
+
const sessionCtx = React8__default.default.useMemo(() => ({ value: session }), [sessionId, session]);
|
|
3973
|
+
const userCtx = React8__default.default.useMemo(() => ({ value: user }), [userId, user]);
|
|
3974
|
+
const organizationCtx = React8__default.default.useMemo(() => {
|
|
3965
3975
|
const value = {
|
|
3966
3976
|
organization
|
|
3967
3977
|
};
|
|
@@ -3969,7 +3979,7 @@ function ClerkContextProvider(props) {
|
|
|
3969
3979
|
}, [orgId, organization]);
|
|
3970
3980
|
return (
|
|
3971
3981
|
// @ts-expect-error value passed is of type IsomorphicClerk where the context expects LoadedClerk
|
|
3972
|
-
/* @__PURE__ */
|
|
3982
|
+
/* @__PURE__ */ React8__default.default.createElement(IsomorphicClerkContext.Provider, { value: clerkCtx }, /* @__PURE__ */ React8__default.default.createElement(ClientContext.Provider, { value: clientCtx }, /* @__PURE__ */ React8__default.default.createElement(SessionContext.Provider, { value: sessionCtx }, /* @__PURE__ */ React8__default.default.createElement(OrganizationProvider, { ...organizationCtx.value }, /* @__PURE__ */ React8__default.default.createElement(AuthContext.Provider, { value: authCtx }, /* @__PURE__ */ React8__default.default.createElement(UserContext.Provider, { value: userCtx }, /* @__PURE__ */ React8__default.default.createElement(
|
|
3973
3983
|
__experimental_CheckoutProvider,
|
|
3974
3984
|
{
|
|
3975
3985
|
value: void 0
|
|
@@ -3979,15 +3989,15 @@ function ClerkContextProvider(props) {
|
|
|
3979
3989
|
);
|
|
3980
3990
|
}
|
|
3981
3991
|
var useLoadedIsomorphicClerk = (options) => {
|
|
3982
|
-
const isomorphicClerkRef =
|
|
3983
|
-
const [clerkStatus, setClerkStatus] =
|
|
3984
|
-
|
|
3992
|
+
const isomorphicClerkRef = React8__default.default.useRef(IsomorphicClerk.getOrCreateInstance(options));
|
|
3993
|
+
const [clerkStatus, setClerkStatus] = React8__default.default.useState(isomorphicClerkRef.current.status);
|
|
3994
|
+
React8__default.default.useEffect(() => {
|
|
3985
3995
|
void isomorphicClerkRef.current.__unstable__updateProps({ appearance: options.appearance });
|
|
3986
3996
|
}, [options.appearance]);
|
|
3987
|
-
|
|
3997
|
+
React8__default.default.useEffect(() => {
|
|
3988
3998
|
void isomorphicClerkRef.current.__unstable__updateProps({ options });
|
|
3989
3999
|
}, [options.localization]);
|
|
3990
|
-
|
|
4000
|
+
React8__default.default.useEffect(() => {
|
|
3991
4001
|
isomorphicClerkRef.current.on("status", setClerkStatus);
|
|
3992
4002
|
return () => {
|
|
3993
4003
|
if (isomorphicClerkRef.current) {
|
|
@@ -4008,7 +4018,7 @@ function ClerkProviderBase(props) {
|
|
|
4008
4018
|
errorThrower.throwInvalidPublishableKeyError({ key: publishableKey });
|
|
4009
4019
|
}
|
|
4010
4020
|
}
|
|
4011
|
-
return /* @__PURE__ */
|
|
4021
|
+
return /* @__PURE__ */ React8__default.default.createElement(
|
|
4012
4022
|
ClerkContextProvider,
|
|
4013
4023
|
{
|
|
4014
4024
|
initialState,
|
|
@@ -4221,7 +4231,7 @@ var BrowserStorageCache = createBrowserStorageCache();
|
|
|
4221
4231
|
var clerk;
|
|
4222
4232
|
noRhc.Clerk.sdkMetadata = {
|
|
4223
4233
|
name: "@clerk/chrome-extension",
|
|
4224
|
-
version: "2.8.2-snapshot.
|
|
4234
|
+
version: "2.8.2-snapshot.v20251117224912"
|
|
4225
4235
|
};
|
|
4226
4236
|
async function createClerkClient({
|
|
4227
4237
|
__experimental_syncHostListener = false,
|
|
@@ -4274,8 +4284,8 @@ async function createClerkClient({
|
|
|
4274
4284
|
function ClerkProvider2(props) {
|
|
4275
4285
|
const { children, storageCache, syncHost, __experimental_syncHostListener, ...rest } = props;
|
|
4276
4286
|
const { publishableKey = "" } = props;
|
|
4277
|
-
const [clerkInstance, setClerkInstance] =
|
|
4278
|
-
|
|
4287
|
+
const [clerkInstance, setClerkInstance] = React8__default.default.useState(null);
|
|
4288
|
+
React8__default.default.useEffect(() => {
|
|
4279
4289
|
void (async () => {
|
|
4280
4290
|
setClerkInstance(
|
|
4281
4291
|
await createClerkClient({ publishableKey, storageCache, syncHost, __experimental_syncHostListener })
|