unifyedx-storybook-new 0.1.20 → 0.1.21

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/README.md CHANGED
@@ -47,3 +47,9 @@ yarn add unifyedx-storybook-new@latest
47
47
  # install peers your lib expects (react, router, headlessui, etc.)
48
48
  npm i react react-dom react-router-dom @headlessui/react framer-motion @floating-ui/react
49
49
  ```
50
+
51
+ ### css usage
52
+
53
+ ```js
54
+ import "unifyedx-storybook-new/style.css";
55
+ ```
@@ -0,0 +1,14 @@
1
+ // src/utils/apiEndpoints.js
2
+
3
+ const _isBrowser = () => typeof window !== "undefined";
4
+
5
+ /** Base URL: localhost -> dev, else protocol//hostname */
6
+ function getBaseUrl() {
7
+ if (!_isBrowser()) return "https://dev.unifyed.com"; // SSR fallback
8
+ return window.location.hostname === "localhost"
9
+ ? "https://dev.unifyed.com"
10
+ : `${window.location.protocol}//${window.location.hostname}`;
11
+ }
12
+
13
+ export { getBaseUrl as g };
14
+ //# sourceMappingURL=apiEndpoints.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiEndpoints.es.js","sources":["../src/utils/apiEndpoints.js"],"sourcesContent":["// src/utils/apiEndpoints.js\nimport { localStore } from \"./lib/storageHelpers\";\n\nconst _isBrowser = () => typeof window !== \"undefined\";\n\n/** Base URL: localhost -> dev, else protocol//hostname */\nexport function getBaseUrl() {\n if (!_isBrowser()) return \"https://dev.unifyed.com\"; // SSR fallback\n return window.location.hostname === \"localhost\"\n ? \"https://dev.unifyed.com\"\n : `${window.location.protocol}//${window.location.hostname}`;\n}\n\n/** Gateway path from localStorage.userProfile.gatewaypath (safe + quiet) */\nexport function gateWayUrl() {\n if (!_isBrowser()) return \"\";\n try {\n const stored = localStore.get(\"userProfile\"); // already parsed or string/null\n if (!stored && window.location.hostname === \"localhost\") {\n return \"/unifyd-gateway/api\";\n }\n const userProfile = stored && typeof stored === \"object\" ? stored : {};\n return userProfile?.gatewaypath ?? \"\";\n } catch {\n return \"\";\n }\n}\n\n/** Derived helpers (recompute each call) */\nexport function gatewayBase() {\n return `${getBaseUrl()}${gateWayUrl()}`;\n}\nexport function userSearchBase() {\n return `${gatewayBase()}/unifydidentity/user/search/findByEmailStartingWith?sort=email,ASC&page=0`;\n}\nexport function adGroupsListSearchApi() {\n return `${gatewayBase()}/unifyedstudioutility/commonutility/groupusers/list?type=AD&page=0&size=20&sortkey=name&sorder=1&createdbyme=false`;\n}\nexport function provisioningBase() {\n return `${gatewayBase()}/unifyedusergroupprovisioning/api`;\n}\nexport function rbacBase() {\n return `${provisioningBase()}/v2/roles`;\n}\nexport function searchRolesApi() {\n return `${rbacBase()}/search`;\n}\nexport function myDriveGatewayBaseV2() {\n return `${gatewayBase()}/unifyed-mydrive/v2`;\n}\nexport function directoryPermissionsApi() {\n return `${myDriveGatewayBaseV2()}/directory/permissions`;\n}\nexport function filePermissionsApi() {\n return `${myDriveGatewayBaseV2()}/file/permissions`;\n}\n\n/** If you still want a snapshot, make it LAZY so it doesn't run at import time */\nexport function getSnapshot() {\n return Object.freeze({\n REACT_APP_BASE_URL: getBaseUrl(),\n GATEWAY_BASE: gatewayBase(),\n USER_SEARCH_BASE: userSearchBase(),\n AD_GROUPS_LIST_SEARCH_API: adGroupsListSearchApi(),\n PROVISIONING_BASE: provisioningBase(),\n RBAC_BASE: rbacBase(),\n SEARCH_ROLES_API: searchRolesApi(),\n MY_DRIVE_GATEWAY_BASE_v2: myDriveGatewayBaseV2(),\n DIRECTORY_PERMISSIONS_API: directoryPermissionsApi(),\n FILE_PERMISSIONS_API: filePermissionsApi(),\n });\n}\n"],"names":[],"mappings":"AAAA;;AAGA,MAAM,UAAU,GAAG,MAAM,OAAO,MAAM,KAAK,WAAW;;AAEtD;AACO,SAAS,UAAU,GAAG;AAC7B,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,OAAO,yBAAyB,CAAC;AACtD,EAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK;AACtC,MAAM;AACN,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAChE;;;;"}