@rebasepro/client-firebase 0.0.1-canary.4d4fb3e → 0.0.1-canary.ca2cb6e
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/components/RebaseFirebaseAppProps.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useAppCheck.d.ts +1 -1
- package/dist/hooks/useBuildUserManagement.d.ts +46 -0
- package/dist/index.es.js +451 -148
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +452 -152
- package/dist/index.umd.js.map +1 -1
- package/package.json +61 -59
- package/src/components/FirebaseLoginView.tsx +37 -47
- package/src/components/RebaseFirebaseApp.tsx +42 -26
- package/src/components/RebaseFirebaseAppProps.tsx +1 -1
- package/src/components/social_icons.tsx +8 -8
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useAppCheck.ts +1 -1
- package/src/hooks/useBuildUserManagement.tsx +374 -0
- package/src/hooks/useFirebaseAuthController.ts +1 -1
- package/src/hooks/useFirebaseRealTimeDBDelegate.ts +8 -8
- package/src/hooks/useFirebaseStorageSource.ts +15 -16
- package/src/hooks/useFirestoreDriver.ts +19 -13
- package/src/utils/algolia.ts +1 -1
- package/src/utils/collections_firestore.ts +4 -5
- package/src/utils/local_text_search_controller.ts +4 -4
- package/src/utils/pinecone.ts +1 -1
- package/src/utils/rebase_search_controller.ts +6 -5
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("fast-equals"), require("@firebase/auth"), require("@firebase/storage"), require("@firebase/app"), require("@firebase/app-check"), require("@rebasepro/types"), require("@firebase/firestore"), require("@rebasepro/common"), require("fuse.js"), require("@firebase/functions"), require("react-compiler-runtime"), require("@firebase/database"), require("react/jsx-runtime"), require("@rebasepro/core"), require("@rebasepro/
|
|
3
|
-
})(this, (function(exports2, React, fastEquals, auth, storage, app, appCheck, types, firestore, common, Fuse, functions, reactCompilerRuntime, database, jsxRuntime, core,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("fast-equals"), require("@firebase/auth"), require("@firebase/storage"), require("@firebase/app"), require("@firebase/app-check"), require("@rebasepro/types"), require("@firebase/firestore"), require("@rebasepro/common"), require("fuse.js"), require("@firebase/functions"), require("react-compiler-runtime"), require("@firebase/database"), require("react-fast-compare"), require("@rebasepro/utils"), require("react/jsx-runtime"), require("@rebasepro/core"), require("@rebasepro/admin"), require("@rebasepro/ui"), require("react-router-dom"), require("lucide-react")) : typeof define === "function" && define.amd ? define(["exports", "react", "fast-equals", "@firebase/auth", "@firebase/storage", "@firebase/app", "@firebase/app-check", "@rebasepro/types", "@firebase/firestore", "@rebasepro/common", "fuse.js", "@firebase/functions", "react-compiler-runtime", "@firebase/database", "react-fast-compare", "@rebasepro/utils", "react/jsx-runtime", "@rebasepro/core", "@rebasepro/admin", "@rebasepro/ui", "react-router-dom", "lucide-react"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["Rebase Firebase"] = {}, global.React, global.fastEquals, global.auth, global.storage, global.app, global.appCheck, global.types, global.firestore, global.common, global.Fuse, global.functions, global.reactCompilerRuntime, global.database, global.equal, global.utils, global.jsxRuntime, global.core, global.admin, global.ui, global.reactRouterDom, global.lucideReact));
|
|
3
|
+
})(this, (function(exports2, React, fastEquals, auth, storage, app, appCheck, types, firestore, common, Fuse, functions, reactCompilerRuntime, database, equal, utils, jsxRuntime, core, admin, ui, reactRouterDom, lucideReact) {
|
|
4
4
|
"use strict";
|
|
5
5
|
const useFirebaseAuthController = ({
|
|
6
6
|
loading,
|
|
@@ -248,10 +248,9 @@
|
|
|
248
248
|
const projectId = firebaseApp?.options?.projectId;
|
|
249
249
|
const urlsCache = {};
|
|
250
250
|
return {
|
|
251
|
-
|
|
251
|
+
putObject({
|
|
252
252
|
file,
|
|
253
|
-
|
|
254
|
-
path,
|
|
253
|
+
key,
|
|
255
254
|
metadata,
|
|
256
255
|
bucket
|
|
257
256
|
}) {
|
|
@@ -260,8 +259,7 @@
|
|
|
260
259
|
const storageBucketUrl = bucket ?? bucketUrl;
|
|
261
260
|
const storage$1 = storage.getStorage(firebaseApp, storageBucketUrl);
|
|
262
261
|
if (!storage$1) throw Error("useFirebaseStorageSource Firebase not initialised");
|
|
263
|
-
const
|
|
264
|
-
const storageRef = storage.ref(storage$1, `${path}/${usedFilename}`);
|
|
262
|
+
const storageRef = storage.ref(storage$1, key);
|
|
265
263
|
const uploadTask = storage.uploadBytesResumable(storageRef, file, metadata);
|
|
266
264
|
return new Promise((resolve, reject) => {
|
|
267
265
|
let lastProgress = 0;
|
|
@@ -316,9 +314,9 @@
|
|
|
316
314
|
const fullPath = uploadTask.snapshot.ref.fullPath;
|
|
317
315
|
const bucketName = uploadTask.snapshot.ref.bucket;
|
|
318
316
|
resolve({
|
|
319
|
-
|
|
317
|
+
key: fullPath,
|
|
320
318
|
bucket: bucketName,
|
|
321
|
-
storageUrl: `
|
|
319
|
+
storageUrl: `s3://${bucketName}/${fullPath}`
|
|
322
320
|
});
|
|
323
321
|
});
|
|
324
322
|
});
|
|
@@ -326,7 +324,7 @@
|
|
|
326
324
|
return Promise.reject(error);
|
|
327
325
|
}
|
|
328
326
|
},
|
|
329
|
-
async
|
|
327
|
+
async getObject(path, bucket) {
|
|
330
328
|
try {
|
|
331
329
|
if (!firebaseApp) throw Error("useFirebaseStorageSource Firebase not initialised");
|
|
332
330
|
const storageBucketUrl = bucket ?? bucketUrl;
|
|
@@ -342,12 +340,14 @@
|
|
|
342
340
|
throw e;
|
|
343
341
|
}
|
|
344
342
|
},
|
|
345
|
-
async
|
|
343
|
+
async getSignedUrl(storagePathOrUrl, bucket) {
|
|
346
344
|
if (!firebaseApp) throw Error("useFirebaseStorageSource Firebase not initialised");
|
|
347
345
|
let resolvedPathOrUrl = storagePathOrUrl;
|
|
348
346
|
let resolvedBucket = bucket;
|
|
349
|
-
|
|
350
|
-
|
|
347
|
+
const match = storagePathOrUrl.match(/^(s3|gs):\/\//);
|
|
348
|
+
if (match) {
|
|
349
|
+
const protocolLength = match[0].length;
|
|
350
|
+
const withoutProtocol = storagePathOrUrl.substring(protocolLength);
|
|
351
351
|
const firstSlash = withoutProtocol.indexOf("/");
|
|
352
352
|
if (firstSlash > 0) {
|
|
353
353
|
resolvedBucket = withoutProtocol.substring(0, firstSlash);
|
|
@@ -375,18 +375,18 @@
|
|
|
375
375
|
throw e;
|
|
376
376
|
}
|
|
377
377
|
},
|
|
378
|
-
async
|
|
378
|
+
async listObjects(prefix, options) {
|
|
379
379
|
if (!firebaseApp) throw Error("useFirebaseStorageSource Firebase not initialised");
|
|
380
380
|
const storageBucketUrl = options?.bucket ?? bucketUrl;
|
|
381
381
|
const storage$1 = storage.getStorage(firebaseApp, storageBucketUrl);
|
|
382
382
|
if (!storage$1) throw Error("useFirebaseStorageSource Firebase not initialised");
|
|
383
|
-
const folderRef = storage.ref(storage$1,
|
|
383
|
+
const folderRef = storage.ref(storage$1, prefix);
|
|
384
384
|
return await storage.list(folderRef, {
|
|
385
385
|
maxResults: options?.maxResults,
|
|
386
386
|
pageToken: options?.pageToken
|
|
387
387
|
});
|
|
388
388
|
},
|
|
389
|
-
async
|
|
389
|
+
async deleteObject(path, bucket) {
|
|
390
390
|
if (!firebaseApp) throw Error("useFirebaseStorageSource Firebase not initialised");
|
|
391
391
|
const storageBucketUrl = bucket ?? bucketUrl;
|
|
392
392
|
const storage$1 = storage.getStorage(firebaseApp, storageBucketUrl);
|
|
@@ -1458,6 +1458,8 @@
|
|
|
1458
1458
|
} else if (data.isEntityReference && data.isEntityReference()) {
|
|
1459
1459
|
const targetFirestore = data.databaseId ? firestore.getFirestore(firestore$1.app, data.databaseId) : firestore$1;
|
|
1460
1460
|
return firestore.doc(targetFirestore, data.path, data.id);
|
|
1461
|
+
} else if (data && typeof data === "object" && data.__type === "relation" && data.path && data.id) {
|
|
1462
|
+
return firestore.doc(firestore$1, data.path, String(data.id));
|
|
1461
1463
|
} else if (data instanceof types.GeoPoint) {
|
|
1462
1464
|
return new firestore.GeoPoint(data.latitude, data.longitude);
|
|
1463
1465
|
} else if (data instanceof Date) {
|
|
@@ -1828,7 +1830,282 @@
|
|
|
1828
1830
|
size: "invisible"
|
|
1829
1831
|
});
|
|
1830
1832
|
}
|
|
1831
|
-
|
|
1833
|
+
function useBuildUserManagement({
|
|
1834
|
+
authController,
|
|
1835
|
+
dataSourceDelegate,
|
|
1836
|
+
roles: rolesProp,
|
|
1837
|
+
usersPath = "__FIRECMS/config/users",
|
|
1838
|
+
rolesPath = "__FIRECMS/config/roles",
|
|
1839
|
+
allowDefaultRolesCreation,
|
|
1840
|
+
includeCollectionConfigPermissions
|
|
1841
|
+
}) {
|
|
1842
|
+
if (!authController) {
|
|
1843
|
+
throw Error("useBuildUserManagement: You need to provide an authController since version 3.0.0-beta.11. Check https://firecms.co/docs/pro/migrating_from_v3_beta");
|
|
1844
|
+
}
|
|
1845
|
+
const rolesDefinedInCode = (rolesProp ?? [])?.length > 0;
|
|
1846
|
+
const [rolesLoading, setRolesLoading] = React.useState(!rolesDefinedInCode);
|
|
1847
|
+
const [usersLoading, setUsersLoading] = React.useState(true);
|
|
1848
|
+
const [roles, setRoles] = React.useState(rolesProp ?? []);
|
|
1849
|
+
const [usersWithRoleIds, setUsersWithRoleIds] = React.useState([]);
|
|
1850
|
+
const users = usersWithRoleIds.map((u) => ({
|
|
1851
|
+
...u
|
|
1852
|
+
}));
|
|
1853
|
+
const [rolesError, setRolesError] = React.useState();
|
|
1854
|
+
const [usersError, setUsersError] = React.useState();
|
|
1855
|
+
const _usersLoading = usersLoading;
|
|
1856
|
+
const _rolesLoading = rolesLoading;
|
|
1857
|
+
const loading = _rolesLoading || _usersLoading;
|
|
1858
|
+
React.useEffect(() => {
|
|
1859
|
+
if (rolesDefinedInCode) return;
|
|
1860
|
+
if (!dataSourceDelegate || !rolesPath) return;
|
|
1861
|
+
if (dataSourceDelegate.initialised !== void 0 && !dataSourceDelegate.initialised) return;
|
|
1862
|
+
if (authController?.initialLoading) return;
|
|
1863
|
+
setRolesLoading(true);
|
|
1864
|
+
return dataSourceDelegate.listenCollection?.({
|
|
1865
|
+
path: rolesPath,
|
|
1866
|
+
onUpdate(entities) {
|
|
1867
|
+
setRolesError(void 0);
|
|
1868
|
+
console.debug("Updating roles", entities);
|
|
1869
|
+
try {
|
|
1870
|
+
const newRoles = entityToRoles(entities);
|
|
1871
|
+
if (!equal(newRoles, roles)) {
|
|
1872
|
+
setRoles(newRoles);
|
|
1873
|
+
}
|
|
1874
|
+
} catch (e) {
|
|
1875
|
+
setRoles([]);
|
|
1876
|
+
console.error("Error loading roles", e);
|
|
1877
|
+
setRolesError(e);
|
|
1878
|
+
}
|
|
1879
|
+
setRolesLoading(false);
|
|
1880
|
+
},
|
|
1881
|
+
onError(e_0) {
|
|
1882
|
+
setRoles([]);
|
|
1883
|
+
console.error("Error loading roles", e_0);
|
|
1884
|
+
setRolesError(e_0);
|
|
1885
|
+
setRolesLoading(false);
|
|
1886
|
+
}
|
|
1887
|
+
});
|
|
1888
|
+
}, [rolesDefinedInCode, dataSourceDelegate?.initialised, authController?.initialLoading, authController?.user?.uid, rolesPath]);
|
|
1889
|
+
React.useEffect(() => {
|
|
1890
|
+
if (!dataSourceDelegate || !usersPath) return;
|
|
1891
|
+
if (dataSourceDelegate.initialised !== void 0 && !dataSourceDelegate.initialised) {
|
|
1892
|
+
return;
|
|
1893
|
+
}
|
|
1894
|
+
if (authController?.initialLoading) {
|
|
1895
|
+
return;
|
|
1896
|
+
}
|
|
1897
|
+
setUsersLoading(true);
|
|
1898
|
+
return dataSourceDelegate.listenCollection?.({
|
|
1899
|
+
path: usersPath,
|
|
1900
|
+
onUpdate(entities_0) {
|
|
1901
|
+
console.debug("Updating users", entities_0);
|
|
1902
|
+
setUsersError(void 0);
|
|
1903
|
+
try {
|
|
1904
|
+
const newUsers = entitiesToUsers(entities_0);
|
|
1905
|
+
setUsersWithRoleIds(newUsers);
|
|
1906
|
+
} catch (e_1) {
|
|
1907
|
+
setUsersWithRoleIds([]);
|
|
1908
|
+
console.error("Error loading users", e_1);
|
|
1909
|
+
setUsersError(e_1);
|
|
1910
|
+
}
|
|
1911
|
+
setUsersLoading(false);
|
|
1912
|
+
},
|
|
1913
|
+
onError(e_2) {
|
|
1914
|
+
console.error("Error loading users", e_2);
|
|
1915
|
+
setUsersWithRoleIds([]);
|
|
1916
|
+
setUsersError(e_2);
|
|
1917
|
+
setUsersLoading(false);
|
|
1918
|
+
}
|
|
1919
|
+
});
|
|
1920
|
+
}, [dataSourceDelegate?.initialised, authController?.initialLoading, authController?.user?.uid, usersPath]);
|
|
1921
|
+
const saveUser = React.useCallback(async (user) => {
|
|
1922
|
+
if (!dataSourceDelegate) throw Error("useBuildUserManagement Firebase not initialised");
|
|
1923
|
+
if (!usersPath) throw Error("useBuildUserManagement Firestore not initialised");
|
|
1924
|
+
console.debug("Persisting user", user);
|
|
1925
|
+
const roleIds = user.roles;
|
|
1926
|
+
const email = user.email?.toLowerCase().trim();
|
|
1927
|
+
if (!email) throw Error("Email is required");
|
|
1928
|
+
const userExists = users.find((u_0) => u_0.email?.toLowerCase() === email);
|
|
1929
|
+
const data = {
|
|
1930
|
+
...user,
|
|
1931
|
+
roles: roleIds ?? []
|
|
1932
|
+
};
|
|
1933
|
+
if (!userExists) {
|
|
1934
|
+
data.created_on = /* @__PURE__ */ new Date();
|
|
1935
|
+
}
|
|
1936
|
+
if (userExists && userExists.uid !== user.uid) {
|
|
1937
|
+
const entity = {
|
|
1938
|
+
values: {},
|
|
1939
|
+
path: usersPath,
|
|
1940
|
+
id: userExists.uid
|
|
1941
|
+
};
|
|
1942
|
+
await dataSourceDelegate.deleteEntity({
|
|
1943
|
+
entity
|
|
1944
|
+
}).then(() => {
|
|
1945
|
+
console.debug("Deleted previous user", userExists);
|
|
1946
|
+
}).catch((e_3) => {
|
|
1947
|
+
console.error("Error deleting user", e_3);
|
|
1948
|
+
});
|
|
1949
|
+
}
|
|
1950
|
+
return dataSourceDelegate.saveEntity({
|
|
1951
|
+
status: "existing",
|
|
1952
|
+
path: usersPath,
|
|
1953
|
+
entityId: email,
|
|
1954
|
+
values: utils.removeUndefined(data)
|
|
1955
|
+
}).then(() => user);
|
|
1956
|
+
}, [usersPath, dataSourceDelegate?.initialised]);
|
|
1957
|
+
const saveRole = React.useCallback((role) => {
|
|
1958
|
+
if (!dataSourceDelegate) throw Error("useBuildUserManagement Firebase not initialised");
|
|
1959
|
+
if (!rolesPath) throw Error("useBuildUserManagement Firestore not initialised");
|
|
1960
|
+
console.debug("Persisting role", role);
|
|
1961
|
+
const {
|
|
1962
|
+
id,
|
|
1963
|
+
...roleData
|
|
1964
|
+
} = role;
|
|
1965
|
+
return dataSourceDelegate.saveEntity({
|
|
1966
|
+
status: "existing",
|
|
1967
|
+
path: rolesPath,
|
|
1968
|
+
entityId: id,
|
|
1969
|
+
values: utils.removeUndefined(roleData)
|
|
1970
|
+
}).then(() => {
|
|
1971
|
+
return;
|
|
1972
|
+
});
|
|
1973
|
+
}, [rolesPath, dataSourceDelegate?.initialised]);
|
|
1974
|
+
const deleteUser = React.useCallback(async (user_0) => {
|
|
1975
|
+
if (!dataSourceDelegate) throw Error("useBuildUserManagement Firebase not initialised");
|
|
1976
|
+
if (!usersPath) throw Error("useBuildUserManagement Firestore not initialised");
|
|
1977
|
+
console.debug("Deleting", user_0);
|
|
1978
|
+
const {
|
|
1979
|
+
uid
|
|
1980
|
+
} = user_0;
|
|
1981
|
+
const entity_0 = {
|
|
1982
|
+
path: usersPath,
|
|
1983
|
+
id: uid,
|
|
1984
|
+
values: {}
|
|
1985
|
+
};
|
|
1986
|
+
await dataSourceDelegate.deleteEntity({
|
|
1987
|
+
entity: entity_0
|
|
1988
|
+
});
|
|
1989
|
+
}, [usersPath, dataSourceDelegate?.initialised]);
|
|
1990
|
+
const deleteRole = React.useCallback(async (role_0) => {
|
|
1991
|
+
if (!dataSourceDelegate) throw Error("useBuildUserManagement Firebase not initialised");
|
|
1992
|
+
if (!rolesPath) throw Error("useBuildUserManagement Firestore not initialised");
|
|
1993
|
+
console.debug("Deleting", role_0);
|
|
1994
|
+
const {
|
|
1995
|
+
id: id_0
|
|
1996
|
+
} = role_0;
|
|
1997
|
+
const entity_1 = {
|
|
1998
|
+
path: rolesPath,
|
|
1999
|
+
id: id_0,
|
|
2000
|
+
values: {}
|
|
2001
|
+
};
|
|
2002
|
+
await dataSourceDelegate.deleteEntity({
|
|
2003
|
+
entity: entity_1
|
|
2004
|
+
});
|
|
2005
|
+
}, [rolesPath, dataSourceDelegate?.initialised]);
|
|
2006
|
+
const defineRolesFor = React.useCallback((user_1) => {
|
|
2007
|
+
if (!usersWithRoleIds) throw Error("Users not loaded");
|
|
2008
|
+
const mgmtUser = usersWithRoleIds.find((u_1) => u_1.email?.toLowerCase() === user_1?.email?.toLowerCase());
|
|
2009
|
+
if (!mgmtUser || !mgmtUser.roles) return void 0;
|
|
2010
|
+
return roles.filter((r) => mgmtUser.roles.includes(r.id));
|
|
2011
|
+
}, [roles, usersWithRoleIds]);
|
|
2012
|
+
const authenticator = React.useCallback(({
|
|
2013
|
+
user: user_2
|
|
2014
|
+
}) => {
|
|
2015
|
+
if (loading) {
|
|
2016
|
+
return false;
|
|
2017
|
+
}
|
|
2018
|
+
if (user_2 === null) {
|
|
2019
|
+
console.warn("User is null, returning");
|
|
2020
|
+
return false;
|
|
2021
|
+
}
|
|
2022
|
+
if (users.length === 0) {
|
|
2023
|
+
console.warn("No users created yet");
|
|
2024
|
+
return true;
|
|
2025
|
+
}
|
|
2026
|
+
const mgmtUser_0 = users.find((u_2) => u_2.email?.toLowerCase() === user_2?.email?.toLowerCase());
|
|
2027
|
+
if (mgmtUser_0) {
|
|
2028
|
+
const needsUidUpdate = mgmtUser_0.uid !== user_2.uid;
|
|
2029
|
+
const needsPhotoUpdate = user_2.photoURL && mgmtUser_0.photoURL !== user_2.photoURL;
|
|
2030
|
+
if (needsUidUpdate || needsPhotoUpdate) {
|
|
2031
|
+
const updateReason = needsUidUpdate ? "uid" : "photoURL";
|
|
2032
|
+
console.debug(`User ${updateReason} has changed, updating user in user management system`);
|
|
2033
|
+
saveUser({
|
|
2034
|
+
...mgmtUser_0,
|
|
2035
|
+
uid: user_2.uid,
|
|
2036
|
+
...needsPhotoUpdate ? {
|
|
2037
|
+
photoURL: user_2.photoURL
|
|
2038
|
+
} : {}
|
|
2039
|
+
}).then(() => {
|
|
2040
|
+
console.debug("User updated in user management system", mgmtUser_0);
|
|
2041
|
+
}).catch((e_4) => {
|
|
2042
|
+
console.error("Error updating user in user management system", e_4);
|
|
2043
|
+
});
|
|
2044
|
+
}
|
|
2045
|
+
console.debug("User found in user management system", mgmtUser_0);
|
|
2046
|
+
return true;
|
|
2047
|
+
}
|
|
2048
|
+
throw Error("Could not find a user with the provided email in the user management system.");
|
|
2049
|
+
}, [loading, users]);
|
|
2050
|
+
const userRoles = authController.user ? defineRolesFor(authController.user) : void 0;
|
|
2051
|
+
const isAdmin = (userRoles ?? []).some((r_0) => r_0.id === "admin");
|
|
2052
|
+
const userRoleIds = userRoles?.map((r_1) => r_1.id);
|
|
2053
|
+
React.useEffect(() => {
|
|
2054
|
+
console.debug("Setting user roles", {
|
|
2055
|
+
userRoles,
|
|
2056
|
+
roles
|
|
2057
|
+
});
|
|
2058
|
+
authController.setUserRoles?.(userRoles ?? []);
|
|
2059
|
+
}, [userRoleIds]);
|
|
2060
|
+
const getUser = React.useCallback((uid_0) => {
|
|
2061
|
+
if (!users) return null;
|
|
2062
|
+
const user_3 = users.find((u_3) => u_3.uid === uid_0);
|
|
2063
|
+
return user_3 ?? null;
|
|
2064
|
+
}, [users]);
|
|
2065
|
+
return {
|
|
2066
|
+
loading,
|
|
2067
|
+
roles,
|
|
2068
|
+
users,
|
|
2069
|
+
saveUser,
|
|
2070
|
+
saveRole,
|
|
2071
|
+
rolesError,
|
|
2072
|
+
deleteUser,
|
|
2073
|
+
deleteRole,
|
|
2074
|
+
usersError,
|
|
2075
|
+
isAdmin,
|
|
2076
|
+
allowDefaultRolesCreation: allowDefaultRolesCreation === void 0 ? true : allowDefaultRolesCreation,
|
|
2077
|
+
includeCollectionConfigPermissions: Boolean(includeCollectionConfigPermissions),
|
|
2078
|
+
defineRolesFor,
|
|
2079
|
+
authenticator,
|
|
2080
|
+
...authController,
|
|
2081
|
+
initialLoading: authController.initialLoading || loading,
|
|
2082
|
+
userRoles,
|
|
2083
|
+
getUser,
|
|
2084
|
+
user: authController.user ? {
|
|
2085
|
+
...authController.user,
|
|
2086
|
+
roles: userRoles
|
|
2087
|
+
} : null
|
|
2088
|
+
};
|
|
2089
|
+
}
|
|
2090
|
+
const entitiesToUsers = (docs) => {
|
|
2091
|
+
return docs.map((doc) => {
|
|
2092
|
+
const data = doc.values;
|
|
2093
|
+
const newVar = {
|
|
2094
|
+
uid: doc.id,
|
|
2095
|
+
...data,
|
|
2096
|
+
created_on: data?.created_on,
|
|
2097
|
+
updated_on: data?.updated_on
|
|
2098
|
+
};
|
|
2099
|
+
return newVar;
|
|
2100
|
+
});
|
|
2101
|
+
};
|
|
2102
|
+
const entityToRoles = (entities) => {
|
|
2103
|
+
return entities.map((doc) => ({
|
|
2104
|
+
id: doc.id,
|
|
2105
|
+
...doc.values
|
|
2106
|
+
}));
|
|
2107
|
+
};
|
|
2108
|
+
const googleIcon = (mode) => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", width: 24, height: 24, children: [
|
|
1832
2109
|
/* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: "95yY7w43Oj6n2vH63j6HJb", x1: "29.401", x2: "29.401", y1: "4.064", y2: "106.734", gradientTransform: "matrix(1 0 0 -1 0 66)", gradientUnits: "userSpaceOnUse", children: [
|
|
1833
2110
|
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0", stopColor: "#ff5840" }),
|
|
1834
2111
|
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: ".007", stopColor: "#ff5840" }),
|
|
@@ -1857,13 +2134,13 @@
|
|
|
1857
2134
|
] }),
|
|
1858
2135
|
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "url(#95yY7w43Oj6n2vH63j6HJe)", d: "M59,31.97c0.01,7.73-3.26,14.58-8.55,19.31l-7.62-6.72c2.1-1.61,3.77-3.71,4.84-6.15\n c0.29-0.66-0.2-1.41-0.92-1.41H37c-2.21,0-4-1.79-4-4v-2c0-2.21,1.79-4,4-4h17C56.75,27,59,29.22,59,31.97z" })
|
|
1859
2136
|
] }) });
|
|
1860
|
-
const appleIcon = (mode) => /* @__PURE__ */ jsxRuntime.jsx("svg", { width:
|
|
2137
|
+
const appleIcon = (mode) => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: 24, height: 24, viewBox: "0 0 56 56", style: {
|
|
1861
2138
|
transform: "scale(2.8)"
|
|
1862
2139
|
}, version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("g", { stroke: mode === "light" ? "#424245" : "white", strokeWidth: "0.5", fillRule: "evenodd", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M28.2226562,20.3846154 C29.0546875,20.3846154 30.0976562,19.8048315 30.71875,19.0317864 C31.28125,18.3312142 31.6914062,17.352829 31.6914062,16.3744437 C31.6914062,16.2415766 31.6796875,16.1087095 31.65625,16 C30.7304687,16.0362365 29.6171875,16.640178 28.9492187,17.4494596 C28.421875,18.06548 27.9414062,19.0317864 27.9414062,20.0222505 C27.9414062,20.1671964 27.9648438,20.3121424 27.9765625,20.3604577 C28.0351562,20.3725366 28.1289062,20.3846154 28.2226562,20.3846154 Z M25.2929688,35 C26.4296875,35 26.9335938,34.214876 28.3515625,34.214876 C29.7929688,34.214876 30.109375,34.9758423 31.375,34.9758423 C32.6171875,34.9758423 33.4492188,33.792117 34.234375,32.6325493 C35.1132812,31.3038779 35.4765625,29.9993643 35.5,29.9389701 C35.4179688,29.9148125 33.0390625,28.9122695 33.0390625,26.0979021 C33.0390625,23.6579784 34.9140625,22.5588048 35.0195312,22.474253 C33.7773438,20.6382708 31.890625,20.5899555 31.375,20.5899555 C29.9804688,20.5899555 28.84375,21.4596313 28.1289062,21.4596313 C27.3554688,21.4596313 26.3359375,20.6382708 25.1289062,20.6382708 C22.8320312,20.6382708 20.5,22.5950413 20.5,26.2911634 C20.5,28.5861411 21.3671875,31.013986 22.4335938,32.5842339 C23.3476562,33.9129053 24.1445312,35 25.2929688,35 Z", fill: mode === "light" ? "#424245" : "white", fillRule: "nonzero" }) }) });
|
|
1863
|
-
const githubIcon = (mode) => /* @__PURE__ */ jsxRuntime.jsx("svg", { fill: mode === "light" ? "#1c1e21" : "white", role: "img", viewBox: "0 0 24 24", width:
|
|
1864
|
-
const facebookIcon = (mode) => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width:
|
|
1865
|
-
const microsoftIcon = (mode) => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width:
|
|
1866
|
-
const twitterIcon = (mode) => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width:
|
|
2140
|
+
const githubIcon = (mode) => /* @__PURE__ */ jsxRuntime.jsx("svg", { fill: mode === "light" ? "#1c1e21" : "white", role: "img", viewBox: "0 0 24 24", width: 24, height: 24, xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" }) });
|
|
2141
|
+
const facebookIcon = (mode) => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 90 90", children: /* @__PURE__ */ jsxRuntime.jsx("g", { children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M90,15.001C90,7.119,82.884,0,75,0H15C7.116,0,0,7.119,0,15.001v59.998 C0,82.881,7.116,90,15.001,90H45V56H34V41h11v-5.844C45,25.077,52.568,16,61.875,16H74v15H61.875C60.548,31,59,32.611,59,35.024V41 h15v15H59v34h16c7.884,0,15-7.119,15-15.001V15.001z", fill: mode === "light" ? "#39569c" : "white" }) }) });
|
|
2142
|
+
const microsoftIcon = (mode) => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 480 480", children: /* @__PURE__ */ jsxRuntime.jsx("g", { children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0.176,224L0.001,67.963l192-26.072V224H0.176z M224.001,37.241L479.937,0v224H224.001V37.241z M479.999,256l-0.062,224 l-255.936-36.008V256H479.999z M192.001,439.918L0.157,413.621L0.147,256h191.854V439.918z", fill: mode === "light" ? "#00a2ed" : "white" }) }) });
|
|
2143
|
+
const twitterIcon = (mode) => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: mode === "light" ? "#00acee" : "white", d: "M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-5.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z" }) });
|
|
1867
2144
|
function FirebaseLoginView({
|
|
1868
2145
|
children,
|
|
1869
2146
|
allowSkipLogin,
|
|
@@ -1975,9 +2252,9 @@
|
|
|
1975
2252
|
buildErrorView(),
|
|
1976
2253
|
!passwordLoginSelected && !phoneLoginSelected && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-4 w-full", children: [
|
|
1977
2254
|
buildOauthLoginButtons(authController, resolvedSignInOptions, modeState.mode, disabled),
|
|
1978
|
-
resolvedSignInOptions.includes("password") && /* @__PURE__ */ jsxRuntime.jsx(LoginButton, { disabled, text: "Email/password", icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1979
|
-
resolvedSignInOptions.includes("phone") && /* @__PURE__ */ jsxRuntime.jsx(LoginButton, { disabled, text: "
|
|
1980
|
-
resolvedSignInOptions.includes("anonymous") && /* @__PURE__ */ jsxRuntime.jsx(LoginButton, { disabled, text: "Log in anonymously", icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2255
|
+
resolvedSignInOptions.includes("password") && /* @__PURE__ */ jsxRuntime.jsx(LoginButton, { disabled, text: "Email/password", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MailIcon, { size: ui.iconSize.medium }), onClick: () => setPasswordLoginSelected(true) }),
|
|
2256
|
+
resolvedSignInOptions.includes("phone") && /* @__PURE__ */ jsxRuntime.jsx(LoginButton, { disabled, text: "PhoneIcon number", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PhoneIcon, { size: ui.iconSize.medium }), onClick: () => setPhoneLoginSelected(true) }),
|
|
2257
|
+
resolvedSignInOptions.includes("anonymous") && /* @__PURE__ */ jsxRuntime.jsx(LoginButton, { disabled, text: "Log in anonymously", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserIcon, { size: "medium" }), onClick: authController.anonymousLogin }),
|
|
1981
2258
|
allowSkipLogin && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { className: "m-1 mb-4", variant: "text", disabled, onClick: authController.skipLogin, children: "Skip login" })
|
|
1982
2259
|
] }),
|
|
1983
2260
|
passwordLoginSelected && /* @__PURE__ */ jsxRuntime.jsx(LoginForm, { authController, onClose: () => setPasswordLoginSelected(false), mode: modeState.mode, noUserComponent, disableSignupScreen, disableResetPassword }),
|
|
@@ -1994,10 +2271,10 @@
|
|
|
1994
2271
|
text,
|
|
1995
2272
|
disabled
|
|
1996
2273
|
} = t0;
|
|
1997
|
-
const t1 = disabled ? "" : "hover:text-surface-
|
|
2274
|
+
const t1 = disabled ? "" : "hover:text-surface-950 hover:dark:text-white";
|
|
1998
2275
|
let t2;
|
|
1999
2276
|
if ($[0] !== t1) {
|
|
2000
|
-
t2 = ui.cls("w-full bg-white dark:bg-surface-
|
|
2277
|
+
t2 = ui.cls("w-full bg-white dark:bg-surface-950 text-surface-900 dark:text-surface-100", t1);
|
|
2001
2278
|
$[0] = t1;
|
|
2002
2279
|
$[1] = t2;
|
|
2003
2280
|
} else {
|
|
@@ -2107,7 +2384,7 @@
|
|
|
2107
2384
|
}
|
|
2108
2385
|
let t4;
|
|
2109
2386
|
if ($[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2110
|
-
t4 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2387
|
+
t4 = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeftIcon, { className: "w-5 h-5" });
|
|
2111
2388
|
$[7] = t4;
|
|
2112
2389
|
} else {
|
|
2113
2390
|
t4 = $[7];
|
|
@@ -2288,7 +2565,7 @@
|
|
|
2288
2565
|
};
|
|
2289
2566
|
const label = loginState === "registration" ? "Please enter your email and password to create an account" : loginState === "password" ? "Please enter your password" : "Please enter your email";
|
|
2290
2567
|
return /* @__PURE__ */ jsxRuntime.jsx("form", { className: "w-full", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-[480px] w-full flex flex-col gap-4", children: [
|
|
2291
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { onClick: onBackPressed, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2568
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { onClick: onBackPressed, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeftIcon, { className: "w-5 h-5" }) }),
|
|
2292
2569
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: loginState === "registration" && noUserComponent }),
|
|
2293
2570
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { className: `${loginState === "registration" && disableSignupScreen ? "hidden" : "flex"}`, variant: "subtitle2", children: label }),
|
|
2294
2571
|
(loginState === "email" || loginState === "registration") && /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { placeholder: "Email", autoFocus: true, value: email ?? "", disabled: authController.authLoading, type: "email", onChange: (event_1) => setEmail(event_1.target.value) }),
|
|
@@ -2341,7 +2618,7 @@
|
|
|
2341
2618
|
}
|
|
2342
2619
|
const DEFAULT_SIGN_IN_OPTIONS = [auth.GoogleAuthProvider.PROVIDER_ID];
|
|
2343
2620
|
function RebaseFirebaseApp(t0) {
|
|
2344
|
-
const $ = reactCompilerRuntime.c(
|
|
2621
|
+
const $ = reactCompilerRuntime.c(98);
|
|
2345
2622
|
const {
|
|
2346
2623
|
name,
|
|
2347
2624
|
logo,
|
|
@@ -2504,7 +2781,7 @@
|
|
|
2504
2781
|
} else {
|
|
2505
2782
|
t12 = $[28];
|
|
2506
2783
|
}
|
|
2507
|
-
const collectionRegistryController =
|
|
2784
|
+
const collectionRegistryController = admin.useBuildCollectionRegistryController(t12);
|
|
2508
2785
|
const t13 = basePath ?? "/";
|
|
2509
2786
|
const t14 = baseCollectionPath ?? "/c";
|
|
2510
2787
|
let t15;
|
|
@@ -2521,84 +2798,99 @@
|
|
|
2521
2798
|
} else {
|
|
2522
2799
|
t15 = $[32];
|
|
2523
2800
|
}
|
|
2524
|
-
const urlController =
|
|
2801
|
+
const urlController = admin.useBuildUrlController(t15);
|
|
2525
2802
|
let t16;
|
|
2526
|
-
if ($[33] !== firestoreDelegate) {
|
|
2527
|
-
t16 =
|
|
2528
|
-
|
|
2529
|
-
|
|
2803
|
+
if ($[33] !== authController || $[34] !== firestoreDelegate) {
|
|
2804
|
+
t16 = {
|
|
2805
|
+
authController,
|
|
2806
|
+
dataSourceDelegate: firestoreDelegate
|
|
2807
|
+
};
|
|
2808
|
+
$[33] = authController;
|
|
2809
|
+
$[34] = firestoreDelegate;
|
|
2810
|
+
$[35] = t16;
|
|
2530
2811
|
} else {
|
|
2531
|
-
t16 = $[
|
|
2812
|
+
t16 = $[35];
|
|
2532
2813
|
}
|
|
2814
|
+
const defaultUserManagement = useBuildUserManagement(t16);
|
|
2815
|
+
const activeUserManagement = userManagement ?? defaultUserManagement;
|
|
2533
2816
|
let t17;
|
|
2534
|
-
if ($[
|
|
2535
|
-
t17 =
|
|
2817
|
+
if ($[36] !== firestoreDelegate) {
|
|
2818
|
+
t17 = common.buildRebaseData(firestoreDelegate);
|
|
2819
|
+
$[36] = firestoreDelegate;
|
|
2820
|
+
$[37] = t17;
|
|
2821
|
+
} else {
|
|
2822
|
+
t17 = $[37];
|
|
2823
|
+
}
|
|
2824
|
+
const t18 = activeUserManagement;
|
|
2825
|
+
let t19;
|
|
2826
|
+
if ($[38] !== adminModeController.mode || $[39] !== adminViews || $[40] !== authController || $[41] !== collectionRegistryController || $[42] !== collections || $[43] !== plugins || $[44] !== t17 || $[45] !== t18 || $[46] !== urlController || $[47] !== views) {
|
|
2827
|
+
t19 = {
|
|
2536
2828
|
collections,
|
|
2537
2829
|
views,
|
|
2538
2830
|
adminViews,
|
|
2539
2831
|
authController,
|
|
2540
|
-
data:
|
|
2832
|
+
data: t17,
|
|
2541
2833
|
plugins,
|
|
2542
2834
|
collectionRegistryController,
|
|
2543
2835
|
urlController,
|
|
2544
2836
|
adminMode: adminModeController.mode,
|
|
2545
|
-
userManagement
|
|
2837
|
+
userManagement: t18
|
|
2546
2838
|
};
|
|
2547
|
-
$[
|
|
2548
|
-
$[
|
|
2549
|
-
$[
|
|
2550
|
-
$[
|
|
2551
|
-
$[
|
|
2552
|
-
$[
|
|
2553
|
-
$[
|
|
2554
|
-
$[
|
|
2555
|
-
$[
|
|
2556
|
-
$[
|
|
2557
|
-
$[
|
|
2839
|
+
$[38] = adminModeController.mode;
|
|
2840
|
+
$[39] = adminViews;
|
|
2841
|
+
$[40] = authController;
|
|
2842
|
+
$[41] = collectionRegistryController;
|
|
2843
|
+
$[42] = collections;
|
|
2844
|
+
$[43] = plugins;
|
|
2845
|
+
$[44] = t17;
|
|
2846
|
+
$[45] = t18;
|
|
2847
|
+
$[46] = urlController;
|
|
2848
|
+
$[47] = views;
|
|
2849
|
+
$[48] = t19;
|
|
2558
2850
|
} else {
|
|
2559
|
-
|
|
2851
|
+
t19 = $[48];
|
|
2560
2852
|
}
|
|
2561
|
-
const navigationStateController =
|
|
2853
|
+
const navigationStateController = admin.useBuildNavigationStateController(t19);
|
|
2562
2854
|
if (firebaseConfigLoading || !firebaseApp || loading) {
|
|
2563
|
-
let
|
|
2564
|
-
if ($[
|
|
2565
|
-
|
|
2566
|
-
$[
|
|
2855
|
+
let t202;
|
|
2856
|
+
if ($[49] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2857
|
+
t202 = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgressCenter, {}) });
|
|
2858
|
+
$[49] = t202;
|
|
2567
2859
|
} else {
|
|
2568
|
-
|
|
2860
|
+
t202 = $[49];
|
|
2569
2861
|
}
|
|
2570
|
-
return
|
|
2862
|
+
return t202;
|
|
2571
2863
|
}
|
|
2572
2864
|
if (configError) {
|
|
2573
|
-
let
|
|
2574
|
-
if ($[
|
|
2575
|
-
|
|
2576
|
-
$[
|
|
2577
|
-
$[
|
|
2865
|
+
let t202;
|
|
2866
|
+
if ($[50] !== configError) {
|
|
2867
|
+
t202 = /* @__PURE__ */ jsxRuntime.jsx(ui.CenteredView, { children: configError });
|
|
2868
|
+
$[50] = configError;
|
|
2869
|
+
$[51] = t202;
|
|
2578
2870
|
} else {
|
|
2579
|
-
|
|
2871
|
+
t202 = $[51];
|
|
2580
2872
|
}
|
|
2581
|
-
return
|
|
2873
|
+
return t202;
|
|
2582
2874
|
}
|
|
2583
|
-
let
|
|
2584
|
-
if ($[
|
|
2585
|
-
|
|
2875
|
+
let t20;
|
|
2876
|
+
if ($[52] !== firebaseApp.options.projectId) {
|
|
2877
|
+
t20 = (t212) => {
|
|
2586
2878
|
const {
|
|
2587
2879
|
entity
|
|
2588
|
-
} =
|
|
2880
|
+
} = t212;
|
|
2589
2881
|
return `https://console.firebase.google.com/project/${firebaseApp.options.projectId}/firestore/data/${entity.path}/${entity.id}`;
|
|
2590
2882
|
};
|
|
2591
|
-
$[
|
|
2592
|
-
$[
|
|
2883
|
+
$[52] = firebaseApp.options.projectId;
|
|
2884
|
+
$[53] = t20;
|
|
2593
2885
|
} else {
|
|
2594
|
-
|
|
2886
|
+
t20 = $[53];
|
|
2595
2887
|
}
|
|
2596
|
-
let
|
|
2597
|
-
if ($[
|
|
2598
|
-
|
|
2888
|
+
let t21;
|
|
2889
|
+
if ($[54] !== allowSkipLogin || $[55] !== authController || $[56] !== authLoading || $[57] !== autoOpenDrawer || $[58] !== canAccessMainView || $[59] !== components || $[60] !== firebaseApp || $[61] !== logo || $[62] !== logoDark || $[63] !== modeController || $[64] !== name || $[65] !== navigationStateController || $[66] !== notAllowedError || $[67] !== signInOptions || $[68] !== urlController) {
|
|
2890
|
+
t21 = (t222) => {
|
|
2599
2891
|
const {
|
|
2600
2892
|
loading: loading_0
|
|
2601
|
-
} =
|
|
2893
|
+
} = t222;
|
|
2602
2894
|
let component;
|
|
2603
2895
|
if (loading_0 || authLoading) {
|
|
2604
2896
|
component = /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgressCenter, { size: "large" });
|
|
@@ -2608,101 +2900,108 @@
|
|
|
2608
2900
|
const LoginViewUsed = components?.LoginView ?? FirebaseLoginView;
|
|
2609
2901
|
component = /* @__PURE__ */ jsxRuntime.jsx(LoginViewUsed, { logo: usedLogo, allowSkipLogin, signInOptions: signInOptions ?? DEFAULT_SIGN_IN_OPTIONS, firebaseApp, authController, notAllowedError });
|
|
2610
2902
|
} else {
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2903
|
+
const firstCollectionEntry = navigationStateController.topLevelNavigation?.navigationEntries.find(_temp3);
|
|
2904
|
+
const fallbackRoute = firstCollectionEntry ? /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: urlController.buildUrlCollectionPath(firstCollectionEntry.id), replace: true }) : /* @__PURE__ */ jsxRuntime.jsx(ui.CenteredView, { children: "No home page or collections provided." });
|
|
2905
|
+
component = /* @__PURE__ */ jsxRuntime.jsx(admin.SideEntityProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(core.RebaseRoutes, { children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Route, { element: /* @__PURE__ */ jsxRuntime.jsxs(admin.Scaffold, { logo: usedLogo, autoOpenDrawer, children: [
|
|
2906
|
+
/* @__PURE__ */ jsxRuntime.jsx(admin.AppBar, { title: name, logo: usedLogo }),
|
|
2907
|
+
/* @__PURE__ */ jsxRuntime.jsx(admin.Drawer, {}),
|
|
2614
2908
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {}),
|
|
2615
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2909
|
+
/* @__PURE__ */ jsxRuntime.jsx(admin.SideDialogs, {})
|
|
2616
2910
|
] }), children: [
|
|
2617
|
-
|
|
2618
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "/c/*", element: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2619
|
-
] }) });
|
|
2911
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "/", element: components?.HomePage ? /* @__PURE__ */ jsxRuntime.jsx(components.HomePage, {}) : fallbackRoute }),
|
|
2912
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "/c/*", element: /* @__PURE__ */ jsxRuntime.jsx(admin.RebaseRoute, {}) })
|
|
2913
|
+
] }) }) });
|
|
2620
2914
|
}
|
|
2621
2915
|
}
|
|
2622
2916
|
return component;
|
|
2623
2917
|
};
|
|
2624
|
-
$[
|
|
2625
|
-
$[
|
|
2626
|
-
$[
|
|
2627
|
-
$[
|
|
2628
|
-
$[
|
|
2629
|
-
$[
|
|
2630
|
-
$[
|
|
2631
|
-
$[
|
|
2632
|
-
$[
|
|
2633
|
-
$[
|
|
2634
|
-
$[
|
|
2635
|
-
$[
|
|
2636
|
-
$[
|
|
2637
|
-
$[
|
|
2918
|
+
$[54] = allowSkipLogin;
|
|
2919
|
+
$[55] = authController;
|
|
2920
|
+
$[56] = authLoading;
|
|
2921
|
+
$[57] = autoOpenDrawer;
|
|
2922
|
+
$[58] = canAccessMainView;
|
|
2923
|
+
$[59] = components;
|
|
2924
|
+
$[60] = firebaseApp;
|
|
2925
|
+
$[61] = logo;
|
|
2926
|
+
$[62] = logoDark;
|
|
2927
|
+
$[63] = modeController;
|
|
2928
|
+
$[64] = name;
|
|
2929
|
+
$[65] = navigationStateController;
|
|
2930
|
+
$[66] = notAllowedError;
|
|
2931
|
+
$[67] = signInOptions;
|
|
2932
|
+
$[68] = urlController;
|
|
2933
|
+
$[69] = t21;
|
|
2638
2934
|
} else {
|
|
2639
|
-
|
|
2935
|
+
t21 = $[69];
|
|
2640
2936
|
}
|
|
2641
|
-
let
|
|
2642
|
-
if ($[
|
|
2643
|
-
|
|
2644
|
-
$[
|
|
2645
|
-
$[
|
|
2646
|
-
$[
|
|
2647
|
-
$[
|
|
2648
|
-
$[
|
|
2649
|
-
$[
|
|
2650
|
-
$[
|
|
2651
|
-
$[
|
|
2652
|
-
$[
|
|
2653
|
-
$[74] = t19;
|
|
2654
|
-
$[75] = userConfigPersistence;
|
|
2655
|
-
$[76] = userManagement;
|
|
2656
|
-
$[77] = t20;
|
|
2657
|
-
} else {
|
|
2658
|
-
t20 = $[77];
|
|
2659
|
-
}
|
|
2660
|
-
let t21;
|
|
2661
|
-
if ($[78] !== navigationStateController || $[79] !== t20) {
|
|
2662
|
-
t21 = /* @__PURE__ */ jsxRuntime.jsx(cms.NavigationStateContext.Provider, { value: navigationStateController, children: t20 });
|
|
2663
|
-
$[78] = navigationStateController;
|
|
2937
|
+
let t22;
|
|
2938
|
+
if ($[70] !== activeUserManagement || $[71] !== authController || $[72] !== dateTimeFormat || $[73] !== firestoreDelegate || $[74] !== locale || $[75] !== onAnalyticsEvent || $[76] !== plugins || $[77] !== propertyConfigs || $[78] !== storageSource || $[79] !== t20 || $[80] !== t21 || $[81] !== userConfigPersistence) {
|
|
2939
|
+
t22 = /* @__PURE__ */ jsxRuntime.jsx(core.Rebase, { authController, userConfigPersistence, dateTimeFormat, driver: firestoreDelegate, storageSource, userManagement: activeUserManagement, entityLinkBuilder: t20, locale, onAnalyticsEvent, plugins, propertyConfigs, children: t21 });
|
|
2940
|
+
$[70] = activeUserManagement;
|
|
2941
|
+
$[71] = authController;
|
|
2942
|
+
$[72] = dateTimeFormat;
|
|
2943
|
+
$[73] = firestoreDelegate;
|
|
2944
|
+
$[74] = locale;
|
|
2945
|
+
$[75] = onAnalyticsEvent;
|
|
2946
|
+
$[76] = plugins;
|
|
2947
|
+
$[77] = propertyConfigs;
|
|
2948
|
+
$[78] = storageSource;
|
|
2664
2949
|
$[79] = t20;
|
|
2665
2950
|
$[80] = t21;
|
|
2951
|
+
$[81] = userConfigPersistence;
|
|
2952
|
+
$[82] = t22;
|
|
2666
2953
|
} else {
|
|
2667
|
-
|
|
2668
|
-
}
|
|
2669
|
-
let t22;
|
|
2670
|
-
if ($[81] !== t21 || $[82] !== urlController) {
|
|
2671
|
-
t22 = /* @__PURE__ */ jsxRuntime.jsx(cms.UrlContext.Provider, { value: urlController, children: t21 });
|
|
2672
|
-
$[81] = t21;
|
|
2673
|
-
$[82] = urlController;
|
|
2674
|
-
$[83] = t22;
|
|
2675
|
-
} else {
|
|
2676
|
-
t22 = $[83];
|
|
2954
|
+
t22 = $[82];
|
|
2677
2955
|
}
|
|
2678
2956
|
let t23;
|
|
2679
|
-
if ($[
|
|
2680
|
-
t23 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2681
|
-
$[
|
|
2682
|
-
$[
|
|
2683
|
-
$[
|
|
2957
|
+
if ($[83] !== navigationStateController || $[84] !== t22) {
|
|
2958
|
+
t23 = /* @__PURE__ */ jsxRuntime.jsx(admin.NavigationStateContext.Provider, { value: navigationStateController, children: t22 });
|
|
2959
|
+
$[83] = navigationStateController;
|
|
2960
|
+
$[84] = t22;
|
|
2961
|
+
$[85] = t23;
|
|
2684
2962
|
} else {
|
|
2685
|
-
t23 = $[
|
|
2963
|
+
t23 = $[85];
|
|
2686
2964
|
}
|
|
2687
2965
|
let t24;
|
|
2688
|
-
if ($[
|
|
2689
|
-
t24 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2690
|
-
$[
|
|
2691
|
-
$[
|
|
2692
|
-
$[
|
|
2966
|
+
if ($[86] !== t23 || $[87] !== urlController) {
|
|
2967
|
+
t24 = /* @__PURE__ */ jsxRuntime.jsx(admin.UrlContext.Provider, { value: urlController, children: t23 });
|
|
2968
|
+
$[86] = t23;
|
|
2969
|
+
$[87] = urlController;
|
|
2970
|
+
$[88] = t24;
|
|
2693
2971
|
} else {
|
|
2694
|
-
t24 = $[
|
|
2972
|
+
t24 = $[88];
|
|
2695
2973
|
}
|
|
2696
2974
|
let t25;
|
|
2697
|
-
if ($[
|
|
2698
|
-
t25 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2699
|
-
$[
|
|
2700
|
-
$[
|
|
2701
|
-
$[
|
|
2975
|
+
if ($[89] !== collectionRegistryController || $[90] !== t24) {
|
|
2976
|
+
t25 = /* @__PURE__ */ jsxRuntime.jsx(admin.CollectionRegistryContext.Provider, { value: collectionRegistryController, children: t24 });
|
|
2977
|
+
$[89] = collectionRegistryController;
|
|
2978
|
+
$[90] = t24;
|
|
2979
|
+
$[91] = t25;
|
|
2980
|
+
} else {
|
|
2981
|
+
t25 = $[91];
|
|
2982
|
+
}
|
|
2983
|
+
let t26;
|
|
2984
|
+
if ($[92] !== adminModeController || $[93] !== t25) {
|
|
2985
|
+
t26 = /* @__PURE__ */ jsxRuntime.jsx(core.AdminModeControllerProvider, { value: adminModeController, children: t25 });
|
|
2986
|
+
$[92] = adminModeController;
|
|
2987
|
+
$[93] = t25;
|
|
2988
|
+
$[94] = t26;
|
|
2702
2989
|
} else {
|
|
2703
|
-
|
|
2990
|
+
t26 = $[94];
|
|
2991
|
+
}
|
|
2992
|
+
let t27;
|
|
2993
|
+
if ($[95] !== modeController || $[96] !== t26) {
|
|
2994
|
+
t27 = /* @__PURE__ */ jsxRuntime.jsx(core.SnackbarProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(core.ModeControllerProvider, { value: modeController, children: t26 }) });
|
|
2995
|
+
$[95] = modeController;
|
|
2996
|
+
$[96] = t26;
|
|
2997
|
+
$[97] = t27;
|
|
2998
|
+
} else {
|
|
2999
|
+
t27 = $[97];
|
|
2704
3000
|
}
|
|
2705
|
-
return
|
|
3001
|
+
return t27;
|
|
3002
|
+
}
|
|
3003
|
+
function _temp3(e) {
|
|
3004
|
+
return e.type === "collection";
|
|
2706
3005
|
}
|
|
2707
3006
|
function _temp2(a, b) {
|
|
2708
3007
|
return {
|
|
@@ -2732,6 +3031,7 @@
|
|
|
2732
3031
|
exports2.performAlgoliaTextSearch = performAlgoliaTextSearch;
|
|
2733
3032
|
exports2.performPineconeTextSearch = performPineconeTextSearch;
|
|
2734
3033
|
exports2.useAppCheck = useAppCheck;
|
|
3034
|
+
exports2.useBuildUserManagement = useBuildUserManagement;
|
|
2735
3035
|
exports2.useFirebaseAuthController = useFirebaseAuthController;
|
|
2736
3036
|
exports2.useFirebaseRTDBDelegate = useFirebaseRTDBDelegate;
|
|
2737
3037
|
exports2.useFirebaseStorageSource = useFirebaseStorageSource;
|