@flipdish/portal-library 7.12.1 → 8.0.0
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 +22 -4
- package/dist/components/atoms/Tag/index.cjs.js +1 -1
- package/dist/components/atoms/Tag/index.cjs.js.map +1 -1
- package/dist/components/atoms/Tag/index.d.ts +3 -7
- package/dist/components/atoms/Tag/index.js +1 -1
- package/dist/components/atoms/Tag/index.js.map +1 -1
- package/dist/components/atoms/TextArea/index.cjs.js.map +1 -1
- package/dist/components/atoms/TextArea/index.d.ts +1 -1
- package/dist/components/atoms/TextArea/index.js.map +1 -1
- package/dist/components/atoms/TextField/index.cjs.js +1 -1
- package/dist/components/atoms/TextField/index.cjs.js.map +1 -1
- package/dist/components/atoms/TextField/index.d.ts +5 -22
- package/dist/components/atoms/TextField/index.js +1 -1
- package/dist/components/atoms/TextField/index.js.map +1 -1
- package/dist/components/molecules/AlertGlobal/index.cjs.js +1 -1
- package/dist/components/molecules/AlertGlobal/index.cjs.js.map +1 -1
- package/dist/components/molecules/AlertGlobal/index.d.ts +1 -8
- package/dist/components/molecules/AlertGlobal/index.js +1 -1
- package/dist/components/molecules/AlertGlobal/index.js.map +1 -1
- package/dist/components/molecules/Autocomplete/index.cjs.js +1 -1
- package/dist/components/molecules/Autocomplete/index.cjs.js.map +1 -1
- package/dist/components/molecules/Autocomplete/index.d.ts +1 -16
- package/dist/components/molecules/Autocomplete/index.js +1 -1
- package/dist/components/molecules/Autocomplete/index.js.map +1 -1
- package/dist/components/molecules/Pagination/index.cjs.js +1 -1
- package/dist/components/molecules/Pagination/index.cjs.js.map +1 -1
- package/dist/components/molecules/Pagination/index.d.ts +1 -12
- package/dist/components/molecules/Pagination/index.js +1 -1
- package/dist/components/molecules/Pagination/index.js.map +1 -1
- package/dist/components/molecules/QuantitySelector/index.cjs.js +1 -1
- package/dist/components/molecules/QuantitySelector/index.cjs.js.map +1 -1
- package/dist/components/molecules/QuantitySelector/index.d.ts +1 -7
- package/dist/components/molecules/QuantitySelector/index.js +1 -1
- package/dist/components/molecules/QuantitySelector/index.js.map +1 -1
- package/dist/components/molecules/Rating/index.cjs.js +1 -1
- package/dist/components/molecules/Rating/index.cjs.js.map +1 -1
- package/dist/components/molecules/Rating/index.d.ts +0 -15
- package/dist/components/molecules/Rating/index.js +1 -1
- package/dist/components/molecules/Rating/index.js.map +1 -1
- package/dist/components/molecules/SearchInput/index.cjs.js +1 -1
- package/dist/components/molecules/SearchInput/index.cjs.js.map +1 -1
- package/dist/components/molecules/SearchInput/index.d.ts +1 -5
- package/dist/components/molecules/SearchInput/index.js +1 -1
- package/dist/components/molecules/SearchInput/index.js.map +1 -1
- package/dist/components/organisms/FileUpload/components/FileDropZone.cjs.js +1 -1
- package/dist/components/organisms/FileUpload/components/FileDropZone.cjs.js.map +1 -1
- package/dist/components/organisms/FileUpload/components/FileDropZone.js +1 -1
- package/dist/components/organisms/FileUpload/components/FileDropZone.js.map +1 -1
- package/dist/components/organisms/Heading/Heading.cjs.js +1 -1
- package/dist/components/organisms/Heading/Heading.cjs.js.map +1 -1
- package/dist/components/organisms/Heading/Heading.d.ts +0 -1
- package/dist/components/organisms/Heading/Heading.js +1 -1
- package/dist/components/organisms/Heading/Heading.js.map +1 -1
- package/dist/localization/de.json.cjs.js +1 -1
- package/dist/localization/de.json.js +1 -1
- package/dist/localization/en-US.json.cjs.js +1 -1
- package/dist/localization/en-US.json.js +1 -1
- package/dist/localization/en.json.cjs.js +1 -1
- package/dist/localization/en.json.d.ts +116 -1
- package/dist/localization/en.json.js +1 -1
- package/dist/localization/es-MX.json.cjs.js +1 -1
- package/dist/localization/es-MX.json.js +1 -1
- package/dist/localization/es.json.cjs.js +1 -1
- package/dist/localization/es.json.js +1 -1
- package/dist/localization/fr.json.cjs.js +1 -1
- package/dist/localization/fr.json.js +1 -1
- package/dist/localization/it.json.cjs.js +1 -1
- package/dist/localization/it.json.js +1 -1
- package/dist/localization/nl.json.cjs.js +1 -1
- package/dist/localization/nl.json.js +1 -1
- package/dist/localization/pt.json.cjs.js +1 -1
- package/dist/localization/pt.json.js +1 -1
- package/dist/providers/TranslationProvider.cjs.js.map +1 -1
- package/dist/providers/TranslationProvider.d.ts +6 -2
- package/dist/providers/TranslationProvider.js +1 -1
- package/dist/providers/TranslationProvider.js.map +1 -1
- package/dist/utilities/renderUtilities.cjs.js +1 -1
- package/dist/utilities/renderUtilities.cjs.js.map +1 -1
- package/dist/utilities/renderUtilities.d.ts +14 -1
- package/dist/utilities/renderUtilities.js +1 -1
- package/dist/utilities/renderUtilities.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderUtilities.js","sources":["../../src/utilities/renderUtilities.ts"],"sourcesContent":["import { lazy } from 'react';\n\nexport const getMicroFrontendAttribute = (key: string): string => {\n const microFrontendDiv = document.getElementById('flipdish-micro-frontend');\n return microFrontendDiv?.getAttribute(key) || '';\n};\n\n/**\n * Retrieves the AppId.\n *\n * Attempts to get the value from the environment variable `VITE_APPID_OVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-app-id`.\n * Fallbacks to `data-appid` for backwards compatibility @flipdish/portal-library@5.1.0 and below\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getAppId = (): string => {\n
|
|
1
|
+
{"version":3,"file":"renderUtilities.js","sources":["../../src/utilities/renderUtilities.ts"],"sourcesContent":["import { lazy } from 'react';\n\n/**\n * Retrieves an environment variable.\n *\n * @param key The key of the environment variable to retrieve.\n * @returns The value of the environment variable.\n */\nexport const getEnvironmentVariable = (key: string): string => {\n // Prefer Node env in tests/SSR\n if (typeof process !== 'undefined' && process.env && typeof process.env[key] === 'string') {\n return process.env[key] as string;\n }\n // Fallback to Vite env when available; use eval to avoid parse errors in non‑Vite/CJS\n try {\n // @typescript-eslint/no-unsafe-member-access\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const viteEnv = eval('import.meta')?.env as Record<string, string | undefined> | undefined;\n return viteEnv?.[key] ?? '';\n } catch {\n return '';\n }\n};\n\n/**\n * Retrieves a micro-frontend attribute.\n *\n * @param key The key of the attribute to retrieve.\n * @returns The value of the attribute.\n */\nexport const getMicroFrontendAttribute = (key: string): string => {\n if (typeof document === 'undefined') {\n return '';\n }\n const microFrontendDiv = document.getElementById('flipdish-micro-frontend');\n return microFrontendDiv?.getAttribute(key) || '';\n};\n\n/**\n * Retrieves the AppId.\n *\n * Attempts to get the value from the environment variable `VITE_APPID_OVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-app-id`.\n * Fallbacks to `data-appid` for backwards compatibility @flipdish/portal-library@5.1.0 and below\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getAppId = (): string => {\n return (\n getEnvironmentVariable('VITE_APPID_OVERRIDE') ||\n getMicroFrontendAttribute('data-app-id') ||\n getMicroFrontendAttribute('data-appid')\n );\n};\n\n/**\n * Retrieves the OrgId.\n *\n * Attempts to get the value from the environment variable `VITE_ORGID_OVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-org-id`.\n * Fallbacks to `data-orgid` for backwards compatibility @flipdish/portal-library@5.1.0 and below\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getOrgId = (): string => {\n return (\n getEnvironmentVariable('VITE_ORGID_OVERRIDE') ||\n getMicroFrontendAttribute('data-org-id') ||\n getMicroFrontendAttribute('data-orgid')\n );\n};\n\n/**\n * Retrieves the BrandId.\n *\n * Attempts to get the value from the environment variable `VITE_BRANDID_OVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-brand-id`.\n * Fallbacks to `data-brandid` for backwards compatibility @flipdish/portal-library@5.1.0 and below\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getBrandId = (): string => {\n return (\n getEnvironmentVariable('VITE_BRANDID_OVERRIDE') ||\n getMicroFrontendAttribute('data-brand-id') ||\n getMicroFrontendAttribute('data-brandid')\n );\n};\n\n/**\n * Retrieves the isFlipdishStaff attribute.\n *\n * Attempts to get the value from the environment variable `VITE_ISFLIPDISHSTAFFOVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-is-flipdish-staff`.\n * Fallbacks to `data-isflipdishstaff` for backwards compatibility @flipdish/portal-library@5.1.0 and below\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getIsFlipdishStaff = (): boolean => {\n const stringValue =\n getEnvironmentVariable('VITE_ISFLIPDISHSTAFFOVERRIDE') ||\n getMicroFrontendAttribute('data-is-flipdish-staff') ||\n getMicroFrontendAttribute('data-isflipdishstaff');\n return stringValue?.toString() === 'true';\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const lazyWithRetry = (componentImport: () => any) =>\n lazy(async () => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const pageHasAlreadyBeenForceRefreshed = JSON.parse(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n window.sessionStorage.getItem('page-has-been-force-refreshed') || 'false',\n );\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const component = await componentImport();\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n window.sessionStorage.setItem('page-has-been-force-refreshed', 'false');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return component;\n } catch (error) {\n if (!pageHasAlreadyBeenForceRefreshed) {\n // Assuming that the user is not on the latest version of the application.\n // Let's refresh the page immediately.\n window.sessionStorage.setItem('page-has-been-force-refreshed', 'true');\n return window.location.reload();\n }\n\n // The page has already been reloaded\n // Assuming that user is already using the latest version of the application.\n // Let's let the application crash and raise the error.\n throw error;\n }\n });\n"],"names":["getEnvironmentVariable","key","process","env","viteEnv","eval","getMicroFrontendAttribute","document","microFrontendDiv","getElementById","getAttribute","getAppId","getOrgId","getBrandId","getIsFlipdishStaff","stringValue","toString","lazyWithRetry","componentImport","lazy","async","pageHasAlreadyBeenForceRefreshed","JSON","parse","window","sessionStorage","getItem","component","setItem","error","location","reload"],"mappings":"wBAQO,MAAMA,uBAA0BC,MAErC,GAAuB,oBAAZC,SAA2BA,QAAQC,KAAmC,iBAArBD,QAAQC,IAAIF,KACtE,OAAOC,QAAQC,IAAIF,KAGrB,IAGE,MAAMG,QAAUC,KAAK,gBAAgBF,IACrC,OAAOC,UAAUH,MAAQ,EAC3B,CAAE,MACA,MAAO,EACT,GASWK,0BAA6BL,IACxC,GAAwB,oBAAbM,SACT,MAAO,GAET,MAAMC,EAAmBD,SAASE,eAAe,2BACjD,OAAOD,GAAkBE,aAAaT,IAAQ,IAYnCU,SAAW,IAEpBX,uBAAuB,wBACvBM,0BAA0B,gBAC1BA,0BAA0B,cAajBM,SAAW,IAEpBZ,uBAAuB,wBACvBM,0BAA0B,gBAC1BA,0BAA0B,cAajBO,WAAa,IAEtBb,uBAAuB,0BACvBM,0BAA0B,kBAC1BA,0BAA0B,gBAajBQ,mBAAqB,KAChC,MAAMC,EACJf,uBAAuB,iCACvBM,0BAA0B,2BAC1BA,0BAA0B,wBAC5B,MAAmC,SAA5BS,GAAaC,YAITC,cAAiBC,GAC5BC,MAAKC,UAEH,MAAMC,EAAmCC,KAAKC,MAE5CC,OAAOC,eAAeC,QAAQ,kCAAoC,SAGpE,IAEE,MAAMC,QAAkBT,IAKxB,OAHAM,OAAOC,eAAeG,QAAQ,gCAAiC,SAGxDD,CACT,CAAE,MAAOE,GACP,IAAKR,EAIH,OADAG,OAAOC,eAAeG,QAAQ,gCAAiC,QACxDJ,OAAOM,SAASC,SAMzB,MAAMF,CACR"}
|