@dropins/storefront-auth 2.1.0 → 2.1.1-beta1

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/render.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","sources":["/@dropins/storefront-auth/src/render/Provider.tsx","/@dropins/storefront-auth/src/render/render.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { UIProvider } from '@adobe-commerce/elsie/components';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { config } from '@/auth/api';\nimport { deepmerge } from '@adobe-commerce/elsie/lib';\n\nimport en_US from '../i18n/en_US.json';\n\n// Langs\nconst langDefinitions = {\n default: en_US,\n};\n\ninterface CartProviderProps {\n children?: any;\n}\n\nexport const Provider: FunctionComponent<CartProviderProps> = ({\n children,\n}) => {\n const [locale, setLang] = useState<Lang>('en_US');\n\n const userLangDefinitions = config?.getConfig()?.langDefinitions;\n\n // Events\n useEffect(() => {\n const localeEvent = events.on(\n 'locale',\n (payload) => {\n if (payload !== locale) setLang(payload as Lang);\n },\n { eager: true }\n );\n return () => {\n localeEvent?.off();\n };\n }, [locale]);\n\n // Merge language definitions with user language definitions\n const definitions = deepmerge(langDefinitions, userLangDefinitions ?? {});\n\n return (\n <UIProvider lang={locale} langDefinitions={definitions}>\n {children}\n </UIProvider>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Render } from '@adobe-commerce/elsie/lib';\nimport { Provider } from './Provider';\n\nexport const render = new Render(<Provider />);\n"],"names":["langDefinitions","en_US","Provider","children","locale","setLang","useState","userLangDefinitions","_b","_a","config","useEffect","localeEvent","events","payload","definitions","deepmerge","UIProvider","render","Render","jsx"],"mappings":"ioHA4BMA,EAAkB,CACtB,QAASC,CACX,EAMaC,EAAiD,CAAC,CAC7D,SAAAC,CACF,IAAM,SACJ,KAAM,CAACC,EAAQC,CAAO,EAAIC,EAAe,OAAO,EAE1CC,GAAsBC,GAAAC,EAAAC,IAAA,YAAAD,EAAQ,cAAR,YAAAD,EAAqB,gBAGjDG,EAAU,IAAM,CACd,MAAMC,EAAcC,EAAO,GACzB,SACCC,GAAY,CACPA,IAAYV,GAAQC,EAAQS,CAAe,CACjD,EACA,CAAE,MAAO,EAAK,CAChB,EACA,MAAO,IAAM,CACXF,GAAA,MAAAA,EAAa,KACf,CAAA,EACC,CAACR,CAAM,CAAC,EAGX,MAAMW,EAAcC,EAAUhB,EAAiBO,GAAuB,CAAA,CAAE,EAExE,SACGU,EAAW,CAAA,KAAMb,EAAQ,gBAAiBW,EACxC,SAAAZ,EACH,CAEJ,EC7Cae,EAAS,IAAIC,EAAOC,EAAClB,IAAS,CAAE"}
1
+ {"version":3,"file":"render.js","sources":["/@dropins/storefront-auth/src/render/Provider.tsx","/@dropins/storefront-auth/src/render/render.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { UIProvider } from '@adobe-commerce/elsie/components';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { config } from '@/auth/api';\nimport { deepmerge } from '@adobe-commerce/elsie/lib';\n\nimport en_US from '../i18n/en_US.json';\n\n// Langs\nconst langDefinitions = {\n default: en_US,\n};\n\ninterface CartProviderProps {\n children?: any;\n}\n\nexport const Provider: FunctionComponent<CartProviderProps> = ({\n children,\n}) => {\n const [locale, setLang] = useState<Lang>('en_US');\n\n const userLangDefinitions = config?.getConfig()?.langDefinitions;\n\n // Events\n useEffect(() => {\n const localeEvent = events.on(\n 'locale',\n (payload) => {\n if (payload !== locale) setLang(payload as Lang);\n },\n { eager: true }\n );\n return () => {\n localeEvent?.off();\n };\n }, [locale]);\n\n // Merge language definitions with user language definitions\n const definitions = deepmerge(langDefinitions, userLangDefinitions ?? {});\n\n return (\n <UIProvider lang={locale} langDefinitions={definitions}>\n {children}\n </UIProvider>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Render } from '@adobe-commerce/elsie/lib';\nimport { Provider } from './Provider';\n\nexport const render = new Render(<Provider />);\n"],"names":["langDefinitions","en_US","Provider","children","locale","setLang","useState","userLangDefinitions","_b","_a","config","useEffect","localeEvent","events","payload","definitions","deepmerge","UIProvider","render","Render","jsx"],"mappings":"ioHA4BMA,EAAkB,CACtB,QAASC,CACX,EAMaC,EAAiD,CAAC,CAC7D,SAAAC,CACF,IAAM,SACJ,KAAM,CAACC,EAAQC,CAAO,EAAIC,EAAe,OAAO,EAE1CC,GAAsBC,GAAAC,EAAAC,IAAA,YAAAD,EAAQ,cAAR,YAAAD,EAAqB,gBAGjDG,EAAU,IAAM,CACd,MAAMC,EAAcC,EAAO,GACzB,SACCC,GAAY,CACPA,IAAYV,GAAQC,EAAQS,CAAe,CACjD,EACA,CAAE,MAAO,EAAA,CAAK,EAEhB,MAAO,IAAM,CACXF,GAAA,MAAAA,EAAa,KACf,CACF,EAAG,CAACR,CAAM,CAAC,EAGX,MAAMW,EAAcC,EAAUhB,EAAiBO,GAAuB,CAAA,CAAE,EAExE,SACGU,EAAA,CAAW,KAAMb,EAAQ,gBAAiBW,EACxC,SAAAZ,EACH,CAEJ,EC7Cae,EAAS,IAAIC,EAAOC,EAAClB,IAAS,CAAE"}