@unidy.io/sdk 1.1.1-alpha2 → 1.1.2
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/{esm/auth-DLKPv5Zm.js → sdk/auth-Che07PeV.js} +9 -9
- package/dist/{esm/auth-DLKPv5Zm.js.map → sdk/auth-Che07PeV.js.map} +1 -1
- package/dist/{components/auth-store.js → sdk/auth-store-CapiC8gJ.js} +4 -4
- package/dist/{esm/auth-store-BMqUdTpC.js.map → sdk/auth-store-CapiC8gJ.js.map} +1 -1
- package/dist/{components/flash-store.js → sdk/flash-store-DNcSEn2p.js} +4 -3
- package/dist/{esm/flash-store-CEvWSG0c.js.map → sdk/flash-store-DNcSEn2p.js.map} +1 -1
- package/dist/{components/i18n.js → sdk/i18n-BCI_ARJL.js} +25 -5
- package/dist/sdk/i18n-BCI_ARJL.js.map +1 -0
- package/dist/{esm/index-Bjp1XO-f.js → sdk/index-BnBstyfp.js} +3 -3
- package/dist/{esm/index-Bjp1XO-f.js.map → sdk/index-BnBstyfp.js.map} +1 -1
- package/dist/sdk/index-BqL27K_R.js +49640 -0
- package/dist/sdk/index-BqL27K_R.js.map +1 -0
- package/dist/{collection/auth/error-definitions.js → sdk/index-Cz3idqu9.js} +19 -2
- package/dist/sdk/index-Cz3idqu9.js.map +1 -0
- package/dist/sdk/index-gEcJztft.js +15349 -0
- package/dist/sdk/index-gEcJztft.js.map +1 -0
- package/dist/sdk/index.esm.js +22 -2
- package/dist/sdk/index.esm.js.map +1 -1
- package/dist/sdk/loader.esm.js.map +1 -1
- package/dist/sdk/locales/de.json +1 -0
- package/dist/sdk/locales/en.json +1 -0
- package/dist/sdk/locales/fr.json +1 -0
- package/dist/sdk/locales/it.json +1 -0
- package/dist/sdk/locales/nl_be.json +1 -0
- package/dist/sdk/locales/ro.json +1 -0
- package/dist/{esm/newsletter-helpers-Dh9k-4Ph.js → sdk/newsletter-helpers-DEXEBD0F.js} +16 -9
- package/dist/sdk/newsletter-helpers-DEXEBD0F.js.map +1 -0
- package/dist/sdk/newsletter-store-CvULKmsu.js +39 -0
- package/dist/sdk/newsletter-store-CvULKmsu.js.map +1 -0
- package/dist/{components/profile-helpers.js → sdk/profile-helpers-Bs3aj0CO.js} +4 -4
- package/dist/{esm/profile-helpers-7onubaoR.js.map → sdk/profile-helpers-Bs3aj0CO.js.map} +1 -1
- package/dist/{components/profile-store.js → sdk/profile-store-DD6sq42i.js} +3 -3
- package/dist/{esm/profile-store-RmZB2PTc.js.map → sdk/profile-store-DD6sq42i.js.map} +1 -1
- package/dist/sdk/sdk.esm.js +48 -2
- package/dist/sdk/sdk.esm.js.map +1 -1
- package/dist/sdk/u-conditional-render.entry.esm.js.map +1 -1
- package/dist/{esm → sdk}/u-conditional-render.entry.js +13 -12
- package/dist/sdk/u-config.entry.esm.js.map +1 -1
- package/dist/{esm → sdk}/u-config.entry.js +13 -12
- package/dist/sdk/u-email-field.entry.esm.js.map +1 -1
- package/dist/sdk/u-email-field.entry.js +75 -0
- package/dist/{esm → sdk}/u-error-message.entry.js +7 -7
- package/dist/sdk/u-field.entry.esm.js.map +1 -0
- package/dist/sdk/u-field.entry.js +101 -0
- package/dist/sdk/u-flash-message.entry.esm.js.map +1 -1
- package/dist/sdk/u-flash-message.entry.js +35 -0
- package/dist/sdk/u-full-profile.entry.esm.js.map +1 -1
- package/dist/sdk/u-full-profile.entry.js +35 -0
- package/dist/{esm → sdk}/u-logout-button.entry.js +11 -11
- package/dist/sdk/u-magic-code-field.entry.esm.js.map +1 -1
- package/dist/{esm → sdk}/u-magic-code-field.entry.js +10 -10
- package/dist/{esm → sdk}/u-missing-field.entry.js +5 -5
- package/dist/{esm → sdk}/u-missing-fields-submit-button.entry.js +9 -9
- package/dist/sdk/u-newsletter-checkbox.entry.esm.js.map +1 -1
- package/dist/{esm → sdk}/u-newsletter-checkbox.entry.js +25 -37
- package/dist/{esm → sdk}/u-newsletter-logout-button.entry.js +12 -12
- package/dist/sdk/u-newsletter-preference-checkbox.entry.esm.js.map +1 -1
- package/dist/{esm → sdk}/u-newsletter-preference-checkbox.entry.js +22 -33
- package/dist/sdk/u-newsletter-resend-doi-button.entry.esm.js.map +1 -1
- package/dist/sdk/u-newsletter-resend-doi-button.entry.js +47 -0
- package/dist/sdk/u-newsletter-root.entry.esm.js.map +1 -1
- package/dist/{esm → sdk}/u-newsletter-root.entry.js +19 -33
- package/dist/sdk/u-newsletter-toggle-subscription-button.entry.esm.js.map +1 -1
- package/dist/sdk/u-newsletter-toggle-subscription-button.entry.js +71 -0
- package/dist/{esm → sdk}/u-pagination-button.entry.js +2 -2
- package/dist/{esm → sdk}/u-pagination-page.entry.js +2 -2
- package/dist/{esm → sdk}/u-passkey.entry.js +10 -10
- package/dist/{esm → sdk}/u-password-field.entry.js +6 -6
- package/dist/sdk/u-profile.entry.esm.js.map +1 -0
- package/dist/{components/profile.js → sdk/u-profile.entry.js} +18 -38
- package/dist/sdk/u-raw-field.entry.esm.js.map +1 -0
- package/dist/{components/raw-field.js → sdk/u-raw-field.entry.js} +10 -51
- package/dist/{esm → sdk}/u-registration-button.entry.js +6 -6
- package/dist/{esm → sdk}/u-reset-password-button.entry.js +10 -10
- package/dist/{esm → sdk}/u-send-magic-code-button.entry.js +10 -10
- package/dist/{esm → sdk}/u-signed-in.entry.js +5 -5
- package/dist/{esm → sdk}/u-signin-root.entry.js +7 -7
- package/dist/sdk/u-signin-step.entry.esm.js.map +1 -1
- package/dist/{esm → sdk}/u-signin-step.entry.js +11 -10
- package/dist/{esm → sdk}/u-signin-strategy.entry.js +5 -5
- package/dist/{esm → sdk}/u-social-login-button.entry.js +6 -6
- package/dist/sdk/u-spinner.entry.esm.js.map +1 -1
- package/dist/{esm → sdk}/u-spinner.entry.js +3 -3
- package/dist/sdk/u-submit-button.entry.esm.js.map +1 -0
- package/dist/sdk/u-submit-button.entry.js +204 -0
- package/dist/sdk/u-ticketable-list.entry.esm.js.map +1 -1
- package/dist/{esm → sdk}/u-ticketable-list.entry.js +141 -73
- package/dist/{components/unidy-store.js → sdk/unidy-store-BwZym11Y.js} +4 -3
- package/dist/{esm/unidy-store-BldTAtO0.js.map → sdk/unidy-store-BwZym11Y.js.map} +1 -1
- package/dist/types/components.d.ts +0 -36
- package/dist/types/newsletter/components/newsletter-checkbox/newsletter-checkbox.d.ts +0 -5
- package/dist/types/newsletter/components/newsletter-root/newsletter-root.d.ts +0 -9
- package/dist/types/newsletter/components/preference-checkbox/preference-checkbox.d.ts +0 -5
- package/dist/types/newsletter/newsletter-helpers.d.ts +1 -1
- package/dist/types/newsletter/store/newsletter-store.d.ts +3 -0
- package/dist/types/shared/components/email-field/email-field.d.ts +0 -2
- package/package.json +1 -1
- package/dist/cjs/app-globals-DSKjcXX_.js +0 -10
- package/dist/cjs/app-globals-DSKjcXX_.js.map +0 -1
- package/dist/cjs/auth-BVKZHhXz.js +0 -573
- package/dist/cjs/auth-BVKZHhXz.js.map +0 -1
- package/dist/cjs/auth-store-DC9EVec8.js +0 -184
- package/dist/cjs/auth-store-DC9EVec8.js.map +0 -1
- package/dist/cjs/component-utils-BpMyeVQo.js +0 -35
- package/dist/cjs/component-utils-BpMyeVQo.js.map +0 -1
- package/dist/cjs/flash-store-BuIBuQDx.js +0 -50
- package/dist/cjs/flash-store-BuIBuQDx.js.map +0 -1
- package/dist/cjs/helpers-BcPlKlBG.js +0 -11
- package/dist/cjs/helpers-BcPlKlBG.js.map +0 -1
- package/dist/cjs/helpers-DJyRa0Qo.js +0 -11
- package/dist/cjs/helpers-DJyRa0Qo.js.map +0 -1
- package/dist/cjs/i18n-Xy1So-ba.js +0 -3224
- package/dist/cjs/i18n-Xy1So-ba.js.map +0 -1
- package/dist/cjs/index-B_N5xKgH.js +0 -12025
- package/dist/cjs/index-B_N5xKgH.js.map +0 -1
- package/dist/cjs/index-DLz3FT7T.js +0 -214
- package/dist/cjs/index-DLz3FT7T.js.map +0 -1
- package/dist/cjs/index-DiUlebpf.js +0 -5256
- package/dist/cjs/index-DiUlebpf.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -64
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -14
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/newsletter-helpers-D34j8zxr.js +0 -280
- package/dist/cjs/newsletter-helpers-D34j8zxr.js.map +0 -1
- package/dist/cjs/newsletter-store-dhtu8ywO.js +0 -27
- package/dist/cjs/newsletter-store-dhtu8ywO.js.map +0 -1
- package/dist/cjs/pagination-store-BEiW3MQd.js +0 -16
- package/dist/cjs/pagination-store-BEiW3MQd.js.map +0 -1
- package/dist/cjs/profile-helpers-DrcTgN5n.js +0 -39
- package/dist/cjs/profile-helpers-DrcTgN5n.js.map +0 -1
- package/dist/cjs/profile-store-P_BcYkef.js +0 -22
- package/dist/cjs/profile-store-P_BcYkef.js.map +0 -1
- package/dist/cjs/sdk.cjs.js +0 -26
- package/dist/cjs/sdk.cjs.js.map +0 -1
- package/dist/cjs/u-conditional-render.cjs.entry.js +0 -102
- package/dist/cjs/u-conditional-render.entry.cjs.js.map +0 -1
- package/dist/cjs/u-config.cjs.entry.js +0 -87
- package/dist/cjs/u-config.entry.cjs.js.map +0 -1
- package/dist/cjs/u-email-field.cjs.entry.js +0 -75
- package/dist/cjs/u-email-field.entry.cjs.js.map +0 -1
- package/dist/cjs/u-error-message.cjs.entry.js +0 -82
- package/dist/cjs/u-error-message.entry.cjs.js.map +0 -1
- package/dist/cjs/u-field.u-raw-field.entry.cjs.js.map +0 -1
- package/dist/cjs/u-field_2.cjs.entry.js +0 -375
- package/dist/cjs/u-flash-message.cjs.entry.js +0 -34
- package/dist/cjs/u-flash-message.entry.cjs.js.map +0 -1
- package/dist/cjs/u-full-profile.cjs.entry.js +0 -36
- package/dist/cjs/u-full-profile.entry.cjs.js.map +0 -1
- package/dist/cjs/u-logout-button.cjs.entry.js +0 -38
- package/dist/cjs/u-logout-button.entry.cjs.js.map +0 -1
- package/dist/cjs/u-magic-code-field.cjs.entry.js +0 -91
- package/dist/cjs/u-magic-code-field.entry.cjs.js.map +0 -1
- package/dist/cjs/u-missing-field.cjs.entry.js +0 -22
- package/dist/cjs/u-missing-field.entry.cjs.js.map +0 -1
- package/dist/cjs/u-missing-fields-submit-button.cjs.entry.js +0 -46
- package/dist/cjs/u-missing-fields-submit-button.entry.cjs.js.map +0 -1
- package/dist/cjs/u-newsletter-checkbox.cjs.entry.js +0 -75
- package/dist/cjs/u-newsletter-checkbox.entry.cjs.js.map +0 -1
- package/dist/cjs/u-newsletter-logout-button.cjs.entry.js +0 -36
- package/dist/cjs/u-newsletter-logout-button.entry.cjs.js.map +0 -1
- package/dist/cjs/u-newsletter-preference-checkbox.cjs.entry.js +0 -117
- package/dist/cjs/u-newsletter-preference-checkbox.entry.cjs.js.map +0 -1
- package/dist/cjs/u-newsletter-resend-doi-button.cjs.entry.js +0 -46
- package/dist/cjs/u-newsletter-resend-doi-button.entry.cjs.js.map +0 -1
- package/dist/cjs/u-newsletter-root.cjs.entry.js +0 -86
- package/dist/cjs/u-newsletter-root.entry.cjs.js.map +0 -1
- package/dist/cjs/u-newsletter-toggle-subscription-button.cjs.entry.js +0 -70
- package/dist/cjs/u-newsletter-toggle-subscription-button.entry.cjs.js.map +0 -1
- package/dist/cjs/u-pagination-button.cjs.entry.js +0 -63
- package/dist/cjs/u-pagination-button.entry.cjs.js.map +0 -1
- package/dist/cjs/u-pagination-page.cjs.entry.js +0 -44
- package/dist/cjs/u-pagination-page.entry.cjs.js.map +0 -1
- package/dist/cjs/u-passkey.cjs.entry.js +0 -47
- package/dist/cjs/u-passkey.entry.cjs.js.map +0 -1
- package/dist/cjs/u-password-field.cjs.entry.js +0 -104
- package/dist/cjs/u-password-field.entry.cjs.js.map +0 -1
- package/dist/cjs/u-profile.u-submit-button.entry.cjs.js.map +0 -1
- package/dist/cjs/u-profile_2.cjs.entry.js +0 -311
- package/dist/cjs/u-registration-button.cjs.entry.js +0 -48
- package/dist/cjs/u-registration-button.entry.cjs.js.map +0 -1
- package/dist/cjs/u-reset-password-button.cjs.entry.js +0 -47
- package/dist/cjs/u-reset-password-button.entry.cjs.js.map +0 -1
- package/dist/cjs/u-send-magic-code-button.cjs.entry.js +0 -68
- package/dist/cjs/u-send-magic-code-button.entry.cjs.js.map +0 -1
- package/dist/cjs/u-signed-in.cjs.entry.js +0 -25
- package/dist/cjs/u-signed-in.entry.cjs.js.map +0 -1
- package/dist/cjs/u-signin-root.cjs.entry.js +0 -43
- package/dist/cjs/u-signin-root.entry.cjs.js.map +0 -1
- package/dist/cjs/u-signin-step.cjs.entry.js +0 -66
- package/dist/cjs/u-signin-step.entry.cjs.js.map +0 -1
- package/dist/cjs/u-signin-strategy.cjs.entry.js +0 -30
- package/dist/cjs/u-signin-strategy.entry.cjs.js.map +0 -1
- package/dist/cjs/u-social-login-button.cjs.entry.js +0 -100
- package/dist/cjs/u-social-login-button.entry.cjs.js.map +0 -1
- package/dist/cjs/u-spinner.cjs.entry.js +0 -18
- package/dist/cjs/u-spinner.entry.cjs.js.map +0 -1
- package/dist/cjs/u-ticketable-list.cjs.entry.js +0 -6078
- package/dist/cjs/u-ticketable-list.entry.cjs.js.map +0 -1
- package/dist/cjs/unidy-store-7AbWnZ6g.js +0 -41
- package/dist/cjs/unidy-store-7AbWnZ6g.js.map +0 -1
- package/dist/collection/api/client.js +0 -144
- package/dist/collection/api/client.js.map +0 -1
- package/dist/collection/api/index.js +0 -42
- package/dist/collection/api/index.js.map +0 -1
- package/dist/collection/api/shared.js +0 -18
- package/dist/collection/api/shared.js.map +0 -1
- package/dist/collection/auth/api/auth.js +0 -264
- package/dist/collection/auth/api/auth.js.map +0 -1
- package/dist/collection/auth/auth-helpers.js +0 -291
- package/dist/collection/auth/auth-helpers.js.map +0 -1
- package/dist/collection/auth/auth.js +0 -121
- package/dist/collection/auth/auth.js.map +0 -1
- package/dist/collection/auth/components/helpers.js +0 -5
- package/dist/collection/auth/components/helpers.js.map +0 -1
- package/dist/collection/auth/components/logout-button/logout-button.js +0 -85
- package/dist/collection/auth/components/logout-button/logout-button.js.map +0 -1
- package/dist/collection/auth/components/magic-code-field/magic-code-field.css +0 -1
- package/dist/collection/auth/components/magic-code-field/magic-code-field.js +0 -113
- package/dist/collection/auth/components/magic-code-field/magic-code-field.js.map +0 -1
- package/dist/collection/auth/components/missing-field/missing-field.js +0 -14
- package/dist/collection/auth/components/missing-field/missing-field.js.map +0 -1
- package/dist/collection/auth/components/missing-fields-submit-button/missing-fields-submit-button.js +0 -39
- package/dist/collection/auth/components/missing-fields-submit-button/missing-fields-submit-button.js.map +0 -1
- package/dist/collection/auth/components/passkey/passkey.js +0 -103
- package/dist/collection/auth/components/passkey/passkey.js.map +0 -1
- package/dist/collection/auth/components/password-field/password-field.js +0 -166
- package/dist/collection/auth/components/password-field/password-field.js.map +0 -1
- package/dist/collection/auth/components/registration/registration-button.js +0 -104
- package/dist/collection/auth/components/registration/registration-button.js.map +0 -1
- package/dist/collection/auth/components/reset-pass-button/reset-pass-button.js +0 -59
- package/dist/collection/auth/components/reset-pass-button/reset-pass-button.js.map +0 -1
- package/dist/collection/auth/components/send-magic-code-button/send-magic-code-button.js +0 -104
- package/dist/collection/auth/components/send-magic-code-button/send-magic-code-button.js.map +0 -1
- package/dist/collection/auth/components/signed-in/signed-in.js +0 -59
- package/dist/collection/auth/components/signed-in/signed-in.js.map +0 -1
- package/dist/collection/auth/components/signin-root/signin-root.js +0 -97
- package/dist/collection/auth/components/signin-root/signin-root.js.map +0 -1
- package/dist/collection/auth/components/signin-step/signin-step.js +0 -135
- package/dist/collection/auth/components/signin-step/signin-step.js.map +0 -1
- package/dist/collection/auth/components/signin-strategy/signin-strategy.js +0 -64
- package/dist/collection/auth/components/signin-strategy/signin-strategy.js.map +0 -1
- package/dist/collection/auth/components/social-logins/logos/apple.js +0 -3
- package/dist/collection/auth/components/social-logins/logos/apple.js.map +0 -1
- package/dist/collection/auth/components/social-logins/logos/discord.js +0 -3
- package/dist/collection/auth/components/social-logins/logos/discord.js.map +0 -1
- package/dist/collection/auth/components/social-logins/logos/facebook.js +0 -3
- package/dist/collection/auth/components/social-logins/logos/facebook.js.map +0 -1
- package/dist/collection/auth/components/social-logins/logos/google.js +0 -3
- package/dist/collection/auth/components/social-logins/logos/google.js.map +0 -1
- package/dist/collection/auth/components/social-logins/logos/linkedin.js +0 -3
- package/dist/collection/auth/components/social-logins/logos/linkedin.js.map +0 -1
- package/dist/collection/auth/components/social-logins/social-login-button.css +0 -1
- package/dist/collection/auth/components/social-logins/social-login-button.js +0 -188
- package/dist/collection/auth/components/social-logins/social-login-button.js.map +0 -1
- package/dist/collection/auth/components/submit-button/auth-submit-button.js +0 -62
- package/dist/collection/auth/components/submit-button/auth-submit-button.js.map +0 -1
- package/dist/collection/auth/error-definitions.js.map +0 -1
- package/dist/collection/auth/index.js +0 -14
- package/dist/collection/auth/index.js.map +0 -1
- package/dist/collection/auth/passkey-auth.js +0 -106
- package/dist/collection/auth/passkey-auth.js.map +0 -1
- package/dist/collection/auth/store/auth-store.js +0 -175
- package/dist/collection/auth/store/auth-store.js.map +0 -1
- package/dist/collection/collection-manifest.json +0 -46
- package/dist/collection/globalScript.js +0 -18
- package/dist/collection/globalScript.js.map +0 -1
- package/dist/collection/i18n.js +0 -31
- package/dist/collection/i18n.js.map +0 -1
- package/dist/collection/index.js +0 -16
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/locales/de.json +0 -131
- package/dist/collection/locales/en.json +0 -131
- package/dist/collection/locales/fr.json +0 -131
- package/dist/collection/locales/it.json +0 -131
- package/dist/collection/locales/nl_be.json +0 -131
- package/dist/collection/locales/ro.json +0 -131
- package/dist/collection/logger.js +0 -106
- package/dist/collection/logger.js.map +0 -1
- package/dist/collection/newsletter/api/newsletters.js +0 -189
- package/dist/collection/newsletter/api/newsletters.js.map +0 -1
- package/dist/collection/newsletter/components/helpers.js +0 -5
- package/dist/collection/newsletter/components/helpers.js.map +0 -1
- package/dist/collection/newsletter/components/logout-button/logout-button.js +0 -48
- package/dist/collection/newsletter/components/logout-button/logout-button.js.map +0 -1
- package/dist/collection/newsletter/components/newsletter-checkbox/newsletter-checkbox.js +0 -163
- package/dist/collection/newsletter/components/newsletter-checkbox/newsletter-checkbox.js.map +0 -1
- package/dist/collection/newsletter/components/newsletter-root/newsletter-root.js +0 -164
- package/dist/collection/newsletter/components/newsletter-root/newsletter-root.js.map +0 -1
- package/dist/collection/newsletter/components/preference-checkbox/preference-checkbox.js +0 -231
- package/dist/collection/newsletter/components/preference-checkbox/preference-checkbox.js.map +0 -1
- package/dist/collection/newsletter/components/resend-doi-button/resend-doi-button.js +0 -79
- package/dist/collection/newsletter/components/resend-doi-button/resend-doi-button.js.map +0 -1
- package/dist/collection/newsletter/components/submit-button/newsletter-submit-button.js +0 -19
- package/dist/collection/newsletter/components/submit-button/newsletter-submit-button.js.map +0 -1
- package/dist/collection/newsletter/components/toggle-subscription-button/toggle-subscription-button.js +0 -144
- package/dist/collection/newsletter/components/toggle-subscription-button/toggle-subscription-button.js.map +0 -1
- package/dist/collection/newsletter/index.js +0 -11
- package/dist/collection/newsletter/index.js.map +0 -1
- package/dist/collection/newsletter/newsletter-helpers.js +0 -268
- package/dist/collection/newsletter/newsletter-helpers.js.map +0 -1
- package/dist/collection/newsletter/store/newsletter-store.js +0 -24
- package/dist/collection/newsletter/store/newsletter-store.js.map +0 -1
- package/dist/collection/profile/api/profile.js +0 -156
- package/dist/collection/profile/api/profile.js.map +0 -1
- package/dist/collection/profile/components/field/field.css +0 -1
- package/dist/collection/profile/components/field/field.js +0 -359
- package/dist/collection/profile/components/field/field.js.map +0 -1
- package/dist/collection/profile/components/full-profile/full-profile.css +0 -1
- package/dist/collection/profile/components/full-profile/full-profile.js +0 -77
- package/dist/collection/profile/components/full-profile/full-profile.js.map +0 -1
- package/dist/collection/profile/components/profile/profile.js +0 -189
- package/dist/collection/profile/components/profile/profile.js.map +0 -1
- package/dist/collection/profile/components/raw-field/raw-field.js +0 -697
- package/dist/collection/profile/components/raw-field/raw-field.js.map +0 -1
- package/dist/collection/profile/components/raw-input-fields/Input.js +0 -3
- package/dist/collection/profile/components/raw-input-fields/Input.js.map +0 -1
- package/dist/collection/profile/components/raw-input-fields/MultiSelect.js +0 -8
- package/dist/collection/profile/components/raw-input-fields/MultiSelect.js.map +0 -1
- package/dist/collection/profile/components/raw-input-fields/RadioGroup.js +0 -8
- package/dist/collection/profile/components/raw-input-fields/RadioGroup.js.map +0 -1
- package/dist/collection/profile/components/raw-input-fields/Select.js +0 -11
- package/dist/collection/profile/components/raw-input-fields/Select.js.map +0 -1
- package/dist/collection/profile/components/raw-input-fields/Textarea.js +0 -3
- package/dist/collection/profile/components/raw-input-fields/Textarea.js.map +0 -1
- package/dist/collection/profile/components/submit-button/profile-submit-button.js +0 -17
- package/dist/collection/profile/components/submit-button/profile-submit-button.js.map +0 -1
- package/dist/collection/profile/index.js +0 -13
- package/dist/collection/profile/index.js.map +0 -1
- package/dist/collection/profile/profile-helpers.js +0 -31
- package/dist/collection/profile/profile-helpers.js.map +0 -1
- package/dist/collection/profile/store/profile-store.js +0 -15
- package/dist/collection/profile/store/profile-store.js.map +0 -1
- package/dist/collection/sdk.css +0 -39
- package/dist/collection/shared/component-utils.js +0 -28
- package/dist/collection/shared/component-utils.js.map +0 -1
- package/dist/collection/shared/components/conditional-render/conditional-render.js +0 -177
- package/dist/collection/shared/components/conditional-render/conditional-render.js.map +0 -1
- package/dist/collection/shared/components/config/config.js +0 -260
- package/dist/collection/shared/components/config/config.js.map +0 -1
- package/dist/collection/shared/components/email-field/email-field.js +0 -161
- package/dist/collection/shared/components/email-field/email-field.js.map +0 -1
- package/dist/collection/shared/components/error-message/error-message.js +0 -141
- package/dist/collection/shared/components/error-message/error-message.js.map +0 -1
- package/dist/collection/shared/components/flash-message/close-icon.js +0 -3
- package/dist/collection/shared/components/flash-message/close-icon.js.map +0 -1
- package/dist/collection/shared/components/flash-message/flash-message.js +0 -69
- package/dist/collection/shared/components/flash-message/flash-message.js.map +0 -1
- package/dist/collection/shared/components/spinner/spinner.css +0 -1
- package/dist/collection/shared/components/spinner/spinner.js +0 -19
- package/dist/collection/shared/components/spinner/spinner.js.map +0 -1
- package/dist/collection/shared/components/submit-button/context.js +0 -10
- package/dist/collection/shared/components/submit-button/context.js.map +0 -1
- package/dist/collection/shared/components/submit-button/submit-button.js +0 -186
- package/dist/collection/shared/components/submit-button/submit-button.js.map +0 -1
- package/dist/collection/shared/store/flash-store.js +0 -43
- package/dist/collection/shared/store/flash-store.js.map +0 -1
- package/dist/collection/shared/store/unidy-store.js +0 -33
- package/dist/collection/shared/store/unidy-store.js.map +0 -1
- package/dist/collection/ticketable/api/get-with-schema.js +0 -35
- package/dist/collection/ticketable/api/get-with-schema.js.map +0 -1
- package/dist/collection/ticketable/api/schemas.js +0 -12
- package/dist/collection/ticketable/api/schemas.js.map +0 -1
- package/dist/collection/ticketable/api/subscriptions.js +0 -47
- package/dist/collection/ticketable/api/subscriptions.js.map +0 -1
- package/dist/collection/ticketable/api/tickets.js +0 -48
- package/dist/collection/ticketable/api/tickets.js.map +0 -1
- package/dist/collection/ticketable/components/pagination/pagination-button.js +0 -108
- package/dist/collection/ticketable/components/pagination/pagination-button.js.map +0 -1
- package/dist/collection/ticketable/components/pagination/pagination-page.js +0 -69
- package/dist/collection/ticketable/components/pagination/pagination-page.js.map +0 -1
- package/dist/collection/ticketable/components/ticketable-list/skeleton-helpers.js +0 -54
- package/dist/collection/ticketable/components/ticketable-list/skeleton-helpers.js.map +0 -1
- package/dist/collection/ticketable/components/ticketable-list/ticketable-list.js +0 -442
- package/dist/collection/ticketable/components/ticketable-list/ticketable-list.js.map +0 -1
- package/dist/collection/ticketable/index.js +0 -13
- package/dist/collection/ticketable/index.js.map +0 -1
- package/dist/collection/ticketable/store/pagination-store.js +0 -9
- package/dist/collection/ticketable/store/pagination-store.js.map +0 -1
- package/dist/components/auth-store.js.map +0 -1
- package/dist/components/auth.js +0 -572
- package/dist/components/auth.js.map +0 -1
- package/dist/components/component-utils.js +0 -32
- package/dist/components/component-utils.js.map +0 -1
- package/dist/components/exports.js +0 -4106
- package/dist/components/exports.js.map +0 -1
- package/dist/components/field.js +0 -144
- package/dist/components/field.js.map +0 -1
- package/dist/components/flash-store.js.map +0 -1
- package/dist/components/helpers.js +0 -9
- package/dist/components/helpers.js.map +0 -1
- package/dist/components/helpers2.js +0 -9
- package/dist/components/helpers2.js.map +0 -1
- package/dist/components/i18n.js.map +0 -1
- package/dist/components/index.js +0 -5902
- package/dist/components/index.js.map +0 -1
- package/dist/components/index2.js +0 -5245
- package/dist/components/index2.js.map +0 -1
- package/dist/components/index3.js +0 -212
- package/dist/components/index3.js.map +0 -1
- package/dist/components/logger.js +0 -111
- package/dist/components/logger.js.map +0 -1
- package/dist/components/newsletter-helpers.js +0 -269
- package/dist/components/newsletter-helpers.js.map +0 -1
- package/dist/components/newsletter-store.js +0 -24
- package/dist/components/newsletter-store.js.map +0 -1
- package/dist/components/pagination-store.js +0 -14
- package/dist/components/pagination-store.js.map +0 -1
- package/dist/components/profile-helpers.js.map +0 -1
- package/dist/components/profile-store.js.map +0 -1
- package/dist/components/profile.js.map +0 -1
- package/dist/components/raw-field.js.map +0 -1
- package/dist/components/spinner.js +0 -35
- package/dist/components/spinner.js.map +0 -1
- package/dist/components/submit-button.js +0 -229
- package/dist/components/submit-button.js.map +0 -1
- package/dist/components/u-conditional-render.js +0 -120
- package/dist/components/u-conditional-render.js.map +0 -1
- package/dist/components/u-config.js +0 -113
- package/dist/components/u-config.js.map +0 -1
- package/dist/components/u-email-field.js +0 -98
- package/dist/components/u-email-field.js.map +0 -1
- package/dist/components/u-error-message.js +0 -105
- package/dist/components/u-error-message.js.map +0 -1
- package/dist/components/u-field.js +0 -9
- package/dist/components/u-field.js.map +0 -1
- package/dist/components/u-flash-message.js +0 -55
- package/dist/components/u-flash-message.js.map +0 -1
- package/dist/components/u-full-profile.js +0 -86
- package/dist/components/u-full-profile.js.map +0 -1
- package/dist/components/u-logout-button.js +0 -53
- package/dist/components/u-logout-button.js.map +0 -1
- package/dist/components/u-magic-code-field.js +0 -106
- package/dist/components/u-magic-code-field.js.map +0 -1
- package/dist/components/u-missing-field.js +0 -57
- package/dist/components/u-missing-field.js.map +0 -1
- package/dist/components/u-missing-fields-submit-button.js +0 -70
- package/dist/components/u-missing-fields-submit-button.js.map +0 -1
- package/dist/components/u-newsletter-checkbox.js +0 -91
- package/dist/components/u-newsletter-checkbox.js.map +0 -1
- package/dist/components/u-newsletter-logout-button.js +0 -51
- package/dist/components/u-newsletter-logout-button.js.map +0 -1
- package/dist/components/u-newsletter-preference-checkbox.js +0 -137
- package/dist/components/u-newsletter-preference-checkbox.js.map +0 -1
- package/dist/components/u-newsletter-resend-doi-button.js +0 -67
- package/dist/components/u-newsletter-resend-doi-button.js.map +0 -1
- package/dist/components/u-newsletter-root.js +0 -104
- package/dist/components/u-newsletter-root.js.map +0 -1
- package/dist/components/u-newsletter-toggle-subscription-button.js +0 -94
- package/dist/components/u-newsletter-toggle-subscription-button.js.map +0 -1
- package/dist/components/u-pagination-button.js +0 -86
- package/dist/components/u-pagination-button.js.map +0 -1
- package/dist/components/u-pagination-page.js +0 -66
- package/dist/components/u-pagination-page.js.map +0 -1
- package/dist/components/u-passkey.js +0 -65
- package/dist/components/u-passkey.js.map +0 -1
- package/dist/components/u-password-field.js +0 -125
- package/dist/components/u-password-field.js.map +0 -1
- package/dist/components/u-profile.js +0 -9
- package/dist/components/u-profile.js.map +0 -1
- package/dist/components/u-raw-field.js +0 -9
- package/dist/components/u-raw-field.js.map +0 -1
- package/dist/components/u-registration-button.js +0 -70
- package/dist/components/u-registration-button.js.map +0 -1
- package/dist/components/u-reset-password-button.js +0 -63
- package/dist/components/u-reset-password-button.js.map +0 -1
- package/dist/components/u-send-magic-code-button.js +0 -85
- package/dist/components/u-send-magic-code-button.js.map +0 -1
- package/dist/components/u-signed-in.js +0 -44
- package/dist/components/u-signed-in.js.map +0 -1
- package/dist/components/u-signin-root.js +0 -63
- package/dist/components/u-signin-root.js.map +0 -1
- package/dist/components/u-signin-step.js +0 -84
- package/dist/components/u-signin-step.js.map +0 -1
- package/dist/components/u-signin-strategy.js +0 -50
- package/dist/components/u-signin-strategy.js.map +0 -1
- package/dist/components/u-social-login-button.js +0 -125
- package/dist/components/u-social-login-button.js.map +0 -1
- package/dist/components/u-spinner.js +0 -9
- package/dist/components/u-spinner.js.map +0 -1
- package/dist/components/u-submit-button.js +0 -9
- package/dist/components/u-submit-button.js.map +0 -1
- package/dist/components/u-ticketable-list.js +0 -6113
- package/dist/components/u-ticketable-list.js.map +0 -1
- package/dist/components/unidy-store.js.map +0 -1
- package/dist/esm/app-globals-CPU9ZcqZ.js +0 -8
- package/dist/esm/app-globals-CPU9ZcqZ.js.map +0 -1
- package/dist/esm/auth-store-BMqUdTpC.js +0 -179
- package/dist/esm/flash-store-CEvWSG0c.js +0 -47
- package/dist/esm/i18n-BR-AGAnn.js +0 -3221
- package/dist/esm/i18n-BR-AGAnn.js.map +0 -1
- package/dist/esm/index-Ci3aTmzp.js +0 -12007
- package/dist/esm/index-Ci3aTmzp.js.map +0 -1
- package/dist/esm/index-DKaIwo59.js +0 -5243
- package/dist/esm/index-DKaIwo59.js.map +0 -1
- package/dist/esm/index.js +0 -40
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -12
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/newsletter-helpers-Dh9k-4Ph.js.map +0 -1
- package/dist/esm/newsletter-store-BYmuLQg8.js +0 -24
- package/dist/esm/newsletter-store-BYmuLQg8.js.map +0 -1
- package/dist/esm/pagination-store-DzdJOp-n.js +0 -14
- package/dist/esm/pagination-store-DzdJOp-n.js.map +0 -1
- package/dist/esm/profile-helpers-7onubaoR.js +0 -36
- package/dist/esm/profile-store-RmZB2PTc.js +0 -18
- package/dist/esm/sdk.js +0 -22
- package/dist/esm/sdk.js.map +0 -1
- package/dist/esm/u-conditional-render.entry.js.map +0 -1
- package/dist/esm/u-config.entry.js.map +0 -1
- package/dist/esm/u-email-field.entry.js +0 -73
- package/dist/esm/u-email-field.entry.js.map +0 -1
- package/dist/esm/u-error-message.entry.js.map +0 -1
- package/dist/esm/u-field.u-raw-field.entry.js.map +0 -1
- package/dist/esm/u-field_2.entry.js +0 -372
- package/dist/esm/u-flash-message.entry.js +0 -32
- package/dist/esm/u-flash-message.entry.js.map +0 -1
- package/dist/esm/u-full-profile.entry.js +0 -34
- package/dist/esm/u-full-profile.entry.js.map +0 -1
- package/dist/esm/u-logout-button.entry.js.map +0 -1
- package/dist/esm/u-magic-code-field.entry.js.map +0 -1
- package/dist/esm/u-missing-field.entry.js.map +0 -1
- package/dist/esm/u-missing-fields-submit-button.entry.js.map +0 -1
- package/dist/esm/u-newsletter-checkbox.entry.js.map +0 -1
- package/dist/esm/u-newsletter-logout-button.entry.js.map +0 -1
- package/dist/esm/u-newsletter-preference-checkbox.entry.js.map +0 -1
- package/dist/esm/u-newsletter-resend-doi-button.entry.js +0 -44
- package/dist/esm/u-newsletter-resend-doi-button.entry.js.map +0 -1
- package/dist/esm/u-newsletter-root.entry.js.map +0 -1
- package/dist/esm/u-newsletter-toggle-subscription-button.entry.js +0 -68
- package/dist/esm/u-newsletter-toggle-subscription-button.entry.js.map +0 -1
- package/dist/esm/u-pagination-button.entry.js.map +0 -1
- package/dist/esm/u-pagination-page.entry.js.map +0 -1
- package/dist/esm/u-passkey.entry.js.map +0 -1
- package/dist/esm/u-password-field.entry.js.map +0 -1
- package/dist/esm/u-profile.u-submit-button.entry.js.map +0 -1
- package/dist/esm/u-profile_2.entry.js +0 -308
- package/dist/esm/u-registration-button.entry.js.map +0 -1
- package/dist/esm/u-reset-password-button.entry.js.map +0 -1
- package/dist/esm/u-send-magic-code-button.entry.js.map +0 -1
- package/dist/esm/u-signed-in.entry.js.map +0 -1
- package/dist/esm/u-signin-root.entry.js.map +0 -1
- package/dist/esm/u-signin-step.entry.js.map +0 -1
- package/dist/esm/u-signin-strategy.entry.js.map +0 -1
- package/dist/esm/u-social-login-button.entry.js.map +0 -1
- package/dist/esm/u-spinner.entry.js.map +0 -1
- package/dist/esm/u-ticketable-list.entry.js.map +0 -1
- package/dist/esm/unidy-store-BldTAtO0.js +0 -37
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/sdk/p-10e06612.entry.js +0 -2
- package/dist/sdk/p-10e06612.entry.js.map +0 -1
- package/dist/sdk/p-16f86a4d.entry.js +0 -2
- package/dist/sdk/p-16f86a4d.entry.js.map +0 -1
- package/dist/sdk/p-20240b02.entry.js +0 -2
- package/dist/sdk/p-20240b02.entry.js.map +0 -1
- package/dist/sdk/p-26f3d8db.entry.js +0 -2
- package/dist/sdk/p-26f3d8db.entry.js.map +0 -1
- package/dist/sdk/p-2da4497a.entry.js +0 -2
- package/dist/sdk/p-2da4497a.entry.js.map +0 -1
- package/dist/sdk/p-3f4c947d.entry.js +0 -2
- package/dist/sdk/p-3f4c947d.entry.js.map +0 -1
- package/dist/sdk/p-431ec460.entry.js +0 -2
- package/dist/sdk/p-431ec460.entry.js.map +0 -1
- package/dist/sdk/p-4f54194a.entry.js +0 -2
- package/dist/sdk/p-4f54194a.entry.js.map +0 -1
- package/dist/sdk/p-552056e7.entry.js +0 -2
- package/dist/sdk/p-552056e7.entry.js.map +0 -1
- package/dist/sdk/p-5da49d00.entry.js +0 -2
- package/dist/sdk/p-5da49d00.entry.js.map +0 -1
- package/dist/sdk/p-67096601.entry.js +0 -2
- package/dist/sdk/p-67096601.entry.js.map +0 -1
- package/dist/sdk/p-6893d167.entry.js +0 -2
- package/dist/sdk/p-6893d167.entry.js.map +0 -1
- package/dist/sdk/p-6e3c210c.entry.js +0 -2
- package/dist/sdk/p-6e3c210c.entry.js.map +0 -1
- package/dist/sdk/p-6febeead.entry.js +0 -2
- package/dist/sdk/p-6febeead.entry.js.map +0 -1
- package/dist/sdk/p-73c2ec89.entry.js +0 -2
- package/dist/sdk/p-73c2ec89.entry.js.map +0 -1
- package/dist/sdk/p-745742f1.entry.js +0 -2
- package/dist/sdk/p-745742f1.entry.js.map +0 -1
- package/dist/sdk/p-7a7c0db2.entry.js +0 -2
- package/dist/sdk/p-7a7c0db2.entry.js.map +0 -1
- package/dist/sdk/p-8d787494.entry.js +0 -2
- package/dist/sdk/p-8d787494.entry.js.map +0 -1
- package/dist/sdk/p-94dde7e5.entry.js +0 -2
- package/dist/sdk/p-94dde7e5.entry.js.map +0 -1
- package/dist/sdk/p-97d8ae02.entry.js +0 -2
- package/dist/sdk/p-97d8ae02.entry.js.map +0 -1
- package/dist/sdk/p-9da4dd6d.entry.js +0 -2
- package/dist/sdk/p-9da4dd6d.entry.js.map +0 -1
- package/dist/sdk/p-BZ1kW_eK.js +0 -2
- package/dist/sdk/p-BZ1kW_eK.js.map +0 -1
- package/dist/sdk/p-BlOjABPD.js +0 -2
- package/dist/sdk/p-BlOjABPD.js.map +0 -1
- package/dist/sdk/p-BqFCd65h.js +0 -2
- package/dist/sdk/p-BqFCd65h.js.map +0 -1
- package/dist/sdk/p-C0feI0p8.js +0 -2
- package/dist/sdk/p-C0feI0p8.js.map +0 -1
- package/dist/sdk/p-CDtLILSR.js +0 -2
- package/dist/sdk/p-CDtLILSR.js.map +0 -1
- package/dist/sdk/p-CFiZLMAA.js +0 -2
- package/dist/sdk/p-CFiZLMAA.js.map +0 -1
- package/dist/sdk/p-CR1oWC4S.js +0 -2
- package/dist/sdk/p-CR1oWC4S.js.map +0 -1
- package/dist/sdk/p-Ce8zGAi1.js +0 -2
- package/dist/sdk/p-Ce8zGAi1.js.map +0 -1
- package/dist/sdk/p-Ci3aTmzp.js +0 -3
- package/dist/sdk/p-Ci3aTmzp.js.map +0 -1
- package/dist/sdk/p-D1lzXl_Z.js +0 -2
- package/dist/sdk/p-D1lzXl_Z.js.map +0 -1
- package/dist/sdk/p-D4B6Zkq_.js +0 -2
- package/dist/sdk/p-D4B6Zkq_.js.map +0 -1
- package/dist/sdk/p-D8RGdjD3.js +0 -2
- package/dist/sdk/p-D8RGdjD3.js.map +0 -1
- package/dist/sdk/p-DGqadgLO.js +0 -2
- package/dist/sdk/p-DGqadgLO.js.map +0 -1
- package/dist/sdk/p-DSwwVdp1.js +0 -2
- package/dist/sdk/p-DSwwVdp1.js.map +0 -1
- package/dist/sdk/p-DUHc_Cx7.js +0 -2
- package/dist/sdk/p-DUHc_Cx7.js.map +0 -1
- package/dist/sdk/p-DYtgart8.js +0 -2
- package/dist/sdk/p-DYtgart8.js.map +0 -1
- package/dist/sdk/p-DsSffQBc.js +0 -2
- package/dist/sdk/p-DsSffQBc.js.map +0 -1
- package/dist/sdk/p-b79abe80.entry.js +0 -2
- package/dist/sdk/p-b79abe80.entry.js.map +0 -1
- package/dist/sdk/p-bb5ae222.entry.js +0 -2
- package/dist/sdk/p-bb5ae222.entry.js.map +0 -1
- package/dist/sdk/p-bbbec3d4.entry.js +0 -2
- package/dist/sdk/p-bbbec3d4.entry.js.map +0 -1
- package/dist/sdk/p-c2b6c674.entry.js +0 -2
- package/dist/sdk/p-c2b6c674.entry.js.map +0 -1
- package/dist/sdk/p-c2fba7c8.entry.js +0 -2
- package/dist/sdk/p-c2fba7c8.entry.js.map +0 -1
- package/dist/sdk/p-cba5d81e.entry.js +0 -2
- package/dist/sdk/p-cba5d81e.entry.js.map +0 -1
- package/dist/sdk/p-d2c6179a.entry.js +0 -2
- package/dist/sdk/p-d2c6179a.entry.js.map +0 -1
- package/dist/sdk/p-dcd4e8f0.entry.js +0 -2
- package/dist/sdk/p-dcd4e8f0.entry.js.map +0 -1
- package/dist/sdk/p-eaedb08e.entry.js +0 -2
- package/dist/sdk/p-eaedb08e.entry.js.map +0 -1
- package/dist/sdk/p-f0aecd55.entry.js +0 -2
- package/dist/sdk/p-f0aecd55.entry.js.map +0 -1
- package/dist/sdk/p-fc51c88d.entry.js +0 -2
- package/dist/sdk/p-fc51c88d.entry.js.map +0 -1
- package/dist/sdk/u-field.u-raw-field.entry.esm.js.map +0 -1
- package/dist/sdk/u-profile.u-submit-button.entry.esm.js.map +0 -1
- package/loader/cdn.js +0 -1
- package/loader/index.cjs.js +0 -1
- package/loader/index.d.ts +0 -24
- package/loader/index.es2017.js +0 -1
- package/loader/index.js +0 -2
- /package/dist/{esm → sdk}/component-utils-D1lzXl_Z.js +0 -0
- /package/dist/{esm → sdk}/component-utils-D1lzXl_Z.js.map +0 -0
- /package/dist/{esm → sdk}/helpers-BqFCd65h.js +0 -0
- /package/dist/{esm → sdk}/helpers-BqFCd65h.js.map +0 -0
- /package/dist/{esm → sdk}/helpers-DUHc_Cx7.js +0 -0
- /package/dist/{esm → sdk}/helpers-DUHc_Cx7.js.map +0 -0
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import * as Sentry from "@sentry/browser";
|
|
2
|
-
import { h } from "@stencil/core";
|
|
3
|
-
import i18n from "../../../i18n";
|
|
4
|
-
import { unidyState } from "../../store/unidy-store";
|
|
5
|
-
import { Auth } from "../../../auth";
|
|
6
|
-
import { getUnidyClient } from "../../../api/";
|
|
7
|
-
import { UnidyComponent } from "../../../logger";
|
|
8
|
-
export class UnidyConfig extends UnidyComponent {
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
11
|
-
}
|
|
12
|
-
mode = "production";
|
|
13
|
-
baseUrl = "";
|
|
14
|
-
apiKey = "";
|
|
15
|
-
customTranslations = "";
|
|
16
|
-
fallbackLocale = "en";
|
|
17
|
-
locale = "en";
|
|
18
|
-
unidyInitialized;
|
|
19
|
-
configChange;
|
|
20
|
-
componentWillLoad() {
|
|
21
|
-
if (!this.baseUrl || !this.apiKey) {
|
|
22
|
-
this.logger.error("baseUrl and apiKey are required");
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
unidyState.apiKey = this.apiKey;
|
|
26
|
-
unidyState.baseUrl = this.baseUrl;
|
|
27
|
-
unidyState.locale = this.locale;
|
|
28
|
-
unidyState.isConfigured = true;
|
|
29
|
-
this.unidyInitialized.emit({
|
|
30
|
-
apiKey: this.apiKey,
|
|
31
|
-
baseUrl: this.baseUrl,
|
|
32
|
-
locale: this.locale,
|
|
33
|
-
mode: this.mode,
|
|
34
|
-
});
|
|
35
|
-
i18n.options.fallbackLng = this.fallbackLocale;
|
|
36
|
-
this.loadCustomTranslations();
|
|
37
|
-
unidyState.locale = this.locale;
|
|
38
|
-
Auth.initialize(getUnidyClient());
|
|
39
|
-
}
|
|
40
|
-
// extend the list of properties that should be watched when new properties are added to the Config
|
|
41
|
-
onPropChange(newValue, oldValue, propName) {
|
|
42
|
-
if (oldValue === undefined)
|
|
43
|
-
return;
|
|
44
|
-
if (propName in unidyState) {
|
|
45
|
-
unidyState[propName] = newValue;
|
|
46
|
-
}
|
|
47
|
-
this.configChange.emit({
|
|
48
|
-
key: propName,
|
|
49
|
-
value: newValue,
|
|
50
|
-
previousValue: oldValue,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
render() {
|
|
54
|
-
return h("slot", { key: '1105e4e4e3732dfa457352ef7d9b3fdc1095f960' });
|
|
55
|
-
}
|
|
56
|
-
loadCustomTranslations() {
|
|
57
|
-
if (this.customTranslations) {
|
|
58
|
-
try {
|
|
59
|
-
const translations = typeof this.customTranslations === "string" ? JSON.parse(this.customTranslations) : this.customTranslations;
|
|
60
|
-
for (const lang in translations) {
|
|
61
|
-
if (Object.hasOwn(translations, lang)) {
|
|
62
|
-
i18n.addResourceBundle(lang, "translation", translations[lang], true, true);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
Sentry.captureException("Failed to parse customTranslations", error);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
static get is() { return "u-config"; }
|
|
72
|
-
static get properties() {
|
|
73
|
-
return {
|
|
74
|
-
"mode": {
|
|
75
|
-
"type": "string",
|
|
76
|
-
"mutable": false,
|
|
77
|
-
"complexType": {
|
|
78
|
-
"original": "\"production\" | \"development\"",
|
|
79
|
-
"resolved": "\"development\" | \"production\"",
|
|
80
|
-
"references": {}
|
|
81
|
-
},
|
|
82
|
-
"required": false,
|
|
83
|
-
"optional": false,
|
|
84
|
-
"docs": {
|
|
85
|
-
"tags": [],
|
|
86
|
-
"text": ""
|
|
87
|
-
},
|
|
88
|
-
"getter": false,
|
|
89
|
-
"setter": false,
|
|
90
|
-
"reflect": false,
|
|
91
|
-
"attribute": "mode",
|
|
92
|
-
"defaultValue": "\"production\""
|
|
93
|
-
},
|
|
94
|
-
"baseUrl": {
|
|
95
|
-
"type": "string",
|
|
96
|
-
"mutable": false,
|
|
97
|
-
"complexType": {
|
|
98
|
-
"original": "string",
|
|
99
|
-
"resolved": "string",
|
|
100
|
-
"references": {}
|
|
101
|
-
},
|
|
102
|
-
"required": false,
|
|
103
|
-
"optional": false,
|
|
104
|
-
"docs": {
|
|
105
|
-
"tags": [],
|
|
106
|
-
"text": ""
|
|
107
|
-
},
|
|
108
|
-
"getter": false,
|
|
109
|
-
"setter": false,
|
|
110
|
-
"reflect": false,
|
|
111
|
-
"attribute": "base-url",
|
|
112
|
-
"defaultValue": "\"\""
|
|
113
|
-
},
|
|
114
|
-
"apiKey": {
|
|
115
|
-
"type": "string",
|
|
116
|
-
"mutable": false,
|
|
117
|
-
"complexType": {
|
|
118
|
-
"original": "string",
|
|
119
|
-
"resolved": "string",
|
|
120
|
-
"references": {}
|
|
121
|
-
},
|
|
122
|
-
"required": false,
|
|
123
|
-
"optional": false,
|
|
124
|
-
"docs": {
|
|
125
|
-
"tags": [],
|
|
126
|
-
"text": ""
|
|
127
|
-
},
|
|
128
|
-
"getter": false,
|
|
129
|
-
"setter": false,
|
|
130
|
-
"reflect": false,
|
|
131
|
-
"attribute": "api-key",
|
|
132
|
-
"defaultValue": "\"\""
|
|
133
|
-
},
|
|
134
|
-
"customTranslations": {
|
|
135
|
-
"type": "string",
|
|
136
|
-
"mutable": false,
|
|
137
|
-
"complexType": {
|
|
138
|
-
"original": "string | Record<string, TranslationTree>",
|
|
139
|
-
"resolved": "string | { [x: string]: TranslationTree; }",
|
|
140
|
-
"references": {
|
|
141
|
-
"Record": {
|
|
142
|
-
"location": "global",
|
|
143
|
-
"id": "global::Record"
|
|
144
|
-
},
|
|
145
|
-
"TranslationTree": {
|
|
146
|
-
"location": "global",
|
|
147
|
-
"id": "global::TranslationTree"
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
"required": false,
|
|
152
|
-
"optional": false,
|
|
153
|
-
"docs": {
|
|
154
|
-
"tags": [],
|
|
155
|
-
"text": ""
|
|
156
|
-
},
|
|
157
|
-
"getter": false,
|
|
158
|
-
"setter": false,
|
|
159
|
-
"reflect": false,
|
|
160
|
-
"attribute": "custom-translations",
|
|
161
|
-
"defaultValue": "\"\""
|
|
162
|
-
},
|
|
163
|
-
"fallbackLocale": {
|
|
164
|
-
"type": "string",
|
|
165
|
-
"mutable": false,
|
|
166
|
-
"complexType": {
|
|
167
|
-
"original": "string",
|
|
168
|
-
"resolved": "string",
|
|
169
|
-
"references": {}
|
|
170
|
-
},
|
|
171
|
-
"required": false,
|
|
172
|
-
"optional": false,
|
|
173
|
-
"docs": {
|
|
174
|
-
"tags": [],
|
|
175
|
-
"text": ""
|
|
176
|
-
},
|
|
177
|
-
"getter": false,
|
|
178
|
-
"setter": false,
|
|
179
|
-
"reflect": false,
|
|
180
|
-
"attribute": "fallback-locale",
|
|
181
|
-
"defaultValue": "\"en\""
|
|
182
|
-
},
|
|
183
|
-
"locale": {
|
|
184
|
-
"type": "string",
|
|
185
|
-
"mutable": false,
|
|
186
|
-
"complexType": {
|
|
187
|
-
"original": "string",
|
|
188
|
-
"resolved": "string",
|
|
189
|
-
"references": {}
|
|
190
|
-
},
|
|
191
|
-
"required": false,
|
|
192
|
-
"optional": false,
|
|
193
|
-
"docs": {
|
|
194
|
-
"tags": [],
|
|
195
|
-
"text": ""
|
|
196
|
-
},
|
|
197
|
-
"getter": false,
|
|
198
|
-
"setter": false,
|
|
199
|
-
"reflect": false,
|
|
200
|
-
"attribute": "locale",
|
|
201
|
-
"defaultValue": "\"en\""
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
static get events() {
|
|
206
|
-
return [{
|
|
207
|
-
"method": "unidyInitialized",
|
|
208
|
-
"name": "unidyInitialized",
|
|
209
|
-
"bubbles": true,
|
|
210
|
-
"cancelable": true,
|
|
211
|
-
"composed": true,
|
|
212
|
-
"docs": {
|
|
213
|
-
"tags": [],
|
|
214
|
-
"text": ""
|
|
215
|
-
},
|
|
216
|
-
"complexType": {
|
|
217
|
-
"original": "Config",
|
|
218
|
-
"resolved": "Config",
|
|
219
|
-
"references": {
|
|
220
|
-
"Config": {
|
|
221
|
-
"location": "local",
|
|
222
|
-
"path": "/Users/fran/work/unidy-sdk/packages/sdk/src/shared/components/config/config.tsx",
|
|
223
|
-
"id": "src/shared/components/config/config.tsx::Config"
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}, {
|
|
228
|
-
"method": "configChange",
|
|
229
|
-
"name": "configChange",
|
|
230
|
-
"bubbles": true,
|
|
231
|
-
"cancelable": true,
|
|
232
|
-
"composed": true,
|
|
233
|
-
"docs": {
|
|
234
|
-
"tags": [],
|
|
235
|
-
"text": ""
|
|
236
|
-
},
|
|
237
|
-
"complexType": {
|
|
238
|
-
"original": "ConfigChange",
|
|
239
|
-
"resolved": "ConfigChange",
|
|
240
|
-
"references": {
|
|
241
|
-
"ConfigChange": {
|
|
242
|
-
"location": "local",
|
|
243
|
-
"path": "/Users/fran/work/unidy-sdk/packages/sdk/src/shared/components/config/config.tsx",
|
|
244
|
-
"id": "src/shared/components/config/config.tsx::ConfigChange"
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}];
|
|
249
|
-
}
|
|
250
|
-
static get watchers() {
|
|
251
|
-
return [{
|
|
252
|
-
"propName": "mode",
|
|
253
|
-
"methodName": "onPropChange"
|
|
254
|
-
}, {
|
|
255
|
-
"propName": "locale",
|
|
256
|
-
"methodName": "onPropChange"
|
|
257
|
-
}];
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/shared/components/config/config.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAqB,CAAC,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAuBjD,MAAM,OAAO,WAAY,SAAQ,cAAc;;;;IACrC,IAAI,GAAiC,YAAY,CAAC;IAClD,OAAO,GAAG,EAAE,CAAC;IACb,MAAM,GAAG,EAAE,CAAC;IACZ,kBAAkB,GAA6C,EAAE,CAAC;IAClE,cAAc,GAAG,IAAI,CAAC;IACtB,MAAM,GAAG,IAAI,CAAC;IAEb,gBAAgB,CAAwB;IACxC,YAAY,CAA8B;IAEnD,iBAAiB;QACf,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YAClC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;YACrD,OAAO;QACT,CAAC;QAED,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAChC,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAClC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAChC,UAAU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AE,IAAI,CAAC,EAAE,CAAC;wBACtC,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,aAAa,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;oBAC9E,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,gBAAgB,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import * as Sentry from \"@sentry/browser\";\nimport { Component, Prop, Watch, Event, type EventEmitter, h } from \"@stencil/core\";\nimport i18n from \"../../../i18n\";\nimport { unidyState } from \"../../store/unidy-store\";\nimport { Auth } from \"../../../auth\";\nimport { getUnidyClient } from \"../../../api/\";\nimport { UnidyComponent } from \"../../../logger\";\n\nexport interface Config {\n apiKey: string;\n baseUrl: string;\n locale: string;\n mode: \"production\" | \"development\";\n}\n\nexport interface ConfigChange {\n key: string;\n value: string;\n previousValue: string;\n}\n\ntype TranslationTree = {\n [key: string]: string | TranslationTree;\n};\n\n@Component({\n tag: \"u-config\",\n shadow: false,\n})\nexport class UnidyConfig extends UnidyComponent {\n @Prop() mode: \"production\" | \"development\" = \"production\";\n @Prop() baseUrl = \"\";\n @Prop() apiKey = \"\";\n @Prop() customTranslations: string | Record<string, TranslationTree> = \"\";\n @Prop() fallbackLocale = \"en\";\n @Prop() locale = \"en\";\n\n @Event() unidyInitialized!: EventEmitter<Config>;\n @Event() configChange!: EventEmitter<ConfigChange>;\n\n componentWillLoad() {\n if (!this.baseUrl || !this.apiKey) {\n this.logger.error(\"baseUrl and apiKey are required\");\n return;\n }\n\n unidyState.apiKey = this.apiKey;\n unidyState.baseUrl = this.baseUrl;\n unidyState.locale = this.locale;\n unidyState.isConfigured = true;\n\n this.unidyInitialized.emit({\n apiKey: this.apiKey,\n baseUrl: this.baseUrl,\n locale: this.locale,\n mode: this.mode,\n });\n\n i18n.options.fallbackLng = this.fallbackLocale;\n\n this.loadCustomTranslations();\n unidyState.locale = this.locale;\n\n Auth.initialize(getUnidyClient());\n }\n\n // extend the list of properties that should be watched when new properties are added to the Config\n @Watch(\"mode\")\n @Watch(\"locale\")\n onPropChange(newValue: string, oldValue: string, propName: keyof Config) {\n if (oldValue === undefined) return;\n\n if (propName in unidyState) {\n (unidyState as Record<keyof Config, string>)[propName] = newValue;\n }\n\n this.configChange.emit({\n key: propName,\n value: newValue,\n previousValue: oldValue,\n });\n }\n\n render() {\n return <slot />;\n }\n\n private loadCustomTranslations() {\n if (this.customTranslations) {\n try {\n const translations = typeof this.customTranslations === \"string\" ? JSON.parse(this.customTranslations) : this.customTranslations;\n\n for (const lang in translations) {\n if (Object.hasOwn(translations, lang)) {\n i18n.addResourceBundle(lang, \"translation\", translations[lang], true, true);\n }\n }\n } catch (error) {\n Sentry.captureException(\"Failed to parse customTranslations\", error);\n }\n }\n }\n}\n"]}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
2
|
-
import { getParentSigninStep } from "../../../auth/components/helpers";
|
|
3
|
-
import { authState, authStore } from "../../../auth/store/auth-store";
|
|
4
|
-
import { t } from "../../../i18n";
|
|
5
|
-
import { getParentNewsletterRoot } from "../../../newsletter/components/helpers";
|
|
6
|
-
import { newsletterStore } from "../../../newsletter/store/newsletter-store";
|
|
7
|
-
export class EmailField {
|
|
8
|
-
el;
|
|
9
|
-
componentClassName = "";
|
|
10
|
-
for;
|
|
11
|
-
ariaLabel = "Email";
|
|
12
|
-
disabled = false;
|
|
13
|
-
emailValue = "";
|
|
14
|
-
get context() {
|
|
15
|
-
if (this.el.closest("u-signin-root"))
|
|
16
|
-
return "auth";
|
|
17
|
-
if (this.el.closest("u-newsletter-root"))
|
|
18
|
-
return "newsletter";
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
get store() {
|
|
22
|
-
switch (this.context) {
|
|
23
|
-
case "auth":
|
|
24
|
-
return authStore;
|
|
25
|
-
case "newsletter":
|
|
26
|
-
return newsletterStore;
|
|
27
|
-
default:
|
|
28
|
-
throw new Error("No store found for email field. Make sure you are using the component within a u-signin-root or u-newsletter-root.");
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
handleInput = (event) => {
|
|
32
|
-
const target = event.target;
|
|
33
|
-
this.store.state.email = target.value;
|
|
34
|
-
if (this.context === "newsletter") {
|
|
35
|
-
this.store.state.errors = {};
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
this.store.clearFieldError("email");
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
handleSubmit = async (event) => {
|
|
42
|
-
event.preventDefault();
|
|
43
|
-
if (this.store.state.email === "")
|
|
44
|
-
return;
|
|
45
|
-
if (this.context === "auth")
|
|
46
|
-
return await getParentSigninStep(this.el)?.submit();
|
|
47
|
-
if (this.context === "newsletter")
|
|
48
|
-
return await getParentNewsletterRoot(this.el)?.submit(this.for);
|
|
49
|
-
};
|
|
50
|
-
isDisabled() {
|
|
51
|
-
if (this.disabled)
|
|
52
|
-
return true;
|
|
53
|
-
if (this.context === "auth")
|
|
54
|
-
return authState.loading || authState.step === "verification" || authState.step === "registration";
|
|
55
|
-
if (this.context === "newsletter") {
|
|
56
|
-
return !!newsletterStore.state.preferenceToken && !!newsletterStore.state.email;
|
|
57
|
-
}
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
render() {
|
|
61
|
-
const placeholderText = t("auth.email.placeholder", { defaultValue: "Enter your email" });
|
|
62
|
-
return (h("form", { key: 'a578ecb30bd45355bfa266a2ee8e9fc6a72760e6', onSubmit: this.handleSubmit }, h("input", { key: '7e7e323cb5b1aab9edba7f9fb8841f28aca8342b', id: "email", type: "email", value: this.store.state.email, autocomplete: "email", placeholder: placeholderText, disabled: this.isDisabled(), class: `${this.componentClassName} u:disabled:opacity-40 u:disabled:bg-gray-200 u:disabled:cursor-not-allowed`, onInput: this.handleInput, "aria-label": this.ariaLabel }), h("slot", { key: 'a2dcf0b021609bad22cfc7cddacdb0075d6d70ae' })));
|
|
63
|
-
}
|
|
64
|
-
static get is() { return "u-email-field"; }
|
|
65
|
-
static get properties() {
|
|
66
|
-
return {
|
|
67
|
-
"componentClassName": {
|
|
68
|
-
"type": "string",
|
|
69
|
-
"mutable": false,
|
|
70
|
-
"complexType": {
|
|
71
|
-
"original": "string",
|
|
72
|
-
"resolved": "string",
|
|
73
|
-
"references": {}
|
|
74
|
-
},
|
|
75
|
-
"required": false,
|
|
76
|
-
"optional": false,
|
|
77
|
-
"docs": {
|
|
78
|
-
"tags": [],
|
|
79
|
-
"text": ""
|
|
80
|
-
},
|
|
81
|
-
"getter": false,
|
|
82
|
-
"setter": false,
|
|
83
|
-
"reflect": false,
|
|
84
|
-
"attribute": "class-name",
|
|
85
|
-
"defaultValue": "\"\""
|
|
86
|
-
},
|
|
87
|
-
"for": {
|
|
88
|
-
"type": "string",
|
|
89
|
-
"mutable": false,
|
|
90
|
-
"complexType": {
|
|
91
|
-
"original": "NewsletterButtonFor",
|
|
92
|
-
"resolved": "\"create\" | \"login\"",
|
|
93
|
-
"references": {
|
|
94
|
-
"NewsletterButtonFor": {
|
|
95
|
-
"location": "import",
|
|
96
|
-
"path": "../../../newsletter/components/submit-button/newsletter-submit-button",
|
|
97
|
-
"id": "src/newsletter/components/submit-button/newsletter-submit-button.ts::NewsletterButtonFor"
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
"required": false,
|
|
102
|
-
"optional": true,
|
|
103
|
-
"docs": {
|
|
104
|
-
"tags": [],
|
|
105
|
-
"text": ""
|
|
106
|
-
},
|
|
107
|
-
"getter": false,
|
|
108
|
-
"setter": false,
|
|
109
|
-
"reflect": false,
|
|
110
|
-
"attribute": "for"
|
|
111
|
-
},
|
|
112
|
-
"ariaLabel": {
|
|
113
|
-
"type": "string",
|
|
114
|
-
"mutable": false,
|
|
115
|
-
"complexType": {
|
|
116
|
-
"original": "string",
|
|
117
|
-
"resolved": "string",
|
|
118
|
-
"references": {}
|
|
119
|
-
},
|
|
120
|
-
"required": false,
|
|
121
|
-
"optional": false,
|
|
122
|
-
"docs": {
|
|
123
|
-
"tags": [],
|
|
124
|
-
"text": ""
|
|
125
|
-
},
|
|
126
|
-
"getter": false,
|
|
127
|
-
"setter": false,
|
|
128
|
-
"reflect": false,
|
|
129
|
-
"attribute": "aria-label",
|
|
130
|
-
"defaultValue": "\"Email\""
|
|
131
|
-
},
|
|
132
|
-
"disabled": {
|
|
133
|
-
"type": "boolean",
|
|
134
|
-
"mutable": false,
|
|
135
|
-
"complexType": {
|
|
136
|
-
"original": "boolean",
|
|
137
|
-
"resolved": "boolean",
|
|
138
|
-
"references": {}
|
|
139
|
-
},
|
|
140
|
-
"required": false,
|
|
141
|
-
"optional": false,
|
|
142
|
-
"docs": {
|
|
143
|
-
"tags": [],
|
|
144
|
-
"text": ""
|
|
145
|
-
},
|
|
146
|
-
"getter": false,
|
|
147
|
-
"setter": false,
|
|
148
|
-
"reflect": false,
|
|
149
|
-
"attribute": "disabled",
|
|
150
|
-
"defaultValue": "false"
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
static get states() {
|
|
155
|
-
return {
|
|
156
|
-
"emailValue": {}
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
static get elementRef() { return "el"; }
|
|
160
|
-
}
|
|
161
|
-
//# sourceMappingURL=email-field.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"email-field.js","sourceRoot":"","sources":["../../../../src/shared/components/email-field/email-field.tsx"],"names":[],"m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8DACE,EAAE,EAAC,OAAO,EACV,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAC7B,YAAY,EAAC,OAAO,EACpB,WAAW,EAAE,eAAe,EAC5B,QAAQ,EAAE,IAAI,CAAC,UAAU,EAAE,EAC3B,KAAK,EAAE,GAAG,IAAI,CAAC,kBAAkB,6EAA6E,EAC9G,OAAO,EAAE,IAAI,CAAC,WAAW,gBACb,IAAI,CAAC,SAAS,GAC1B;YACF,8DAAQ,CACH,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, State } from \"@stencil/core\";\nimport { getParentSigninStep } from \"../../../auth/components/helpers\";\nimport { authState, authStore } from \"../../../auth/store/auth-store\";\nimport { t } from \"../../../i18n\";\nimport { getParentNewsletterRoot } from \"../../../newsletter/components/helpers\";\nimport type { NewsletterButtonFor } from \"../../../newsletter/components/submit-button/newsletter-submit-button\";\nimport { newsletterStore } from \"../../../newsletter/store/newsletter-store\";\n\n@Component({\n tag: \"u-email-field\",\n shadow: false,\n})\nexport class EmailField {\n @Element() el!: HTMLElement;\n\n @Prop({ attribute: \"class-name\" }) componentClassName = \"\";\n @Prop() for?: NewsletterButtonFor;\n @Prop() ariaLabel = \"Email\";\n @Prop() disabled = false;\n\n @State() emailValue = \"\";\n\n private get context(): \"auth\" | \"newsletter\" | null {\n if (this.el.closest(\"u-signin-root\")) return \"auth\";\n\n if (this.el.closest(\"u-newsletter-root\")) return \"newsletter\";\n\n return null;\n }\n\n private get store(): typeof authStore | typeof newsletterStore | null {\n switch (this.context) {\n case \"auth\":\n return authStore;\n case \"newsletter\":\n return newsletterStore;\n default:\n throw new Error(\n \"No store found for email field. Make sure you are using the component within a u-signin-root or u-newsletter-root.\",\n );\n }\n }\n\n private handleInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n\n (this.store as { state: { email: string } }).state.email = target.value;\n\n if (this.context === \"newsletter\") {\n this.store.state.errors = {};\n } else {\n (this.store as { clearFieldError: (field: \"email\") => void }).clearFieldError(\"email\");\n }\n };\n\n private handleSubmit = async (event: Event) => {\n event.preventDefault();\n\n if (this.store.state.email === \"\") return;\n\n if (this.context === \"auth\") return await getParentSigninStep(this.el)?.submit();\n\n if (this.context === \"newsletter\") return await getParentNewsletterRoot(this.el)?.submit(this.for);\n };\n\n private isDisabled(): boolean {\n if (this.disabled) return true;\n\n if (this.context === \"auth\") return authState.loading || authState.step === \"verification\" || authState.step === \"registration\";\n\n if (this.context === \"newsletter\") {\n return !!newsletterStore.state.preferenceToken && !!newsletterStore.state.email;\n }\n\n return false;\n }\n\n render() {\n const placeholderText = t(\"auth.email.placeholder\", { defaultValue: \"Enter your email\" });\n\n return (\n <form onSubmit={this.handleSubmit}>\n <input\n id=\"email\"\n type=\"email\"\n value={this.store.state.email}\n autocomplete=\"email\"\n placeholder={placeholderText}\n disabled={this.isDisabled()}\n class={`${this.componentClassName} u:disabled:opacity-40 u:disabled:bg-gray-200 u:disabled:cursor-not-allowed`}\n onInput={this.handleInput}\n aria-label={this.ariaLabel}\n />\n <slot />\n </form>\n );\n }\n}\n"]}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { t } from "../../../i18n";
|
|
3
|
-
import { authState } from "../../../auth/store/auth-store";
|
|
4
|
-
import { unidyState } from "../../store/unidy-store";
|
|
5
|
-
import { newsletterStore } from "../../../newsletter/store/newsletter-store";
|
|
6
|
-
import { hasSlotContent } from "../../component-utils";
|
|
7
|
-
export class ErrorMessage {
|
|
8
|
-
componentClassName = "";
|
|
9
|
-
for;
|
|
10
|
-
errorMessages;
|
|
11
|
-
el;
|
|
12
|
-
detectContext() {
|
|
13
|
-
if (this.el.closest("u-signin-root") || this.el.closest("u-signin-step"))
|
|
14
|
-
return "auth";
|
|
15
|
-
if (this.el.closest("u-profile"))
|
|
16
|
-
return "profile";
|
|
17
|
-
if (this.el.closest("u-newsletter-root"))
|
|
18
|
-
return "newsletter";
|
|
19
|
-
if (this.for === "general" || this.for === "connection")
|
|
20
|
-
return "other";
|
|
21
|
-
throw new Error("No context found for error message. Make sure you are using the component within a u-signin-root, u-profile, or u-newsletter-root.");
|
|
22
|
-
}
|
|
23
|
-
get context() {
|
|
24
|
-
return this.detectContext();
|
|
25
|
-
}
|
|
26
|
-
getAuthErrorMessage(errorCode) {
|
|
27
|
-
if (this.errorMessages?.[errorCode]) {
|
|
28
|
-
return this.errorMessages[errorCode];
|
|
29
|
-
}
|
|
30
|
-
const translatedError = t(`errors.${errorCode}`);
|
|
31
|
-
if (translatedError !== `errors.${errorCode}`) {
|
|
32
|
-
return translatedError;
|
|
33
|
-
}
|
|
34
|
-
return errorCode || t("errors.unknown", { defaultValue: "An error occurred" });
|
|
35
|
-
}
|
|
36
|
-
getNewsletterErrorMessage(errorIdentifier) {
|
|
37
|
-
return t(`newsletter.errors.${errorIdentifier}`) || t("errors.unknown", { defaultValue: "An unknown error occurred" });
|
|
38
|
-
}
|
|
39
|
-
getErrorMessage(errorCode) {
|
|
40
|
-
if (this.context === "auth") {
|
|
41
|
-
return this.getAuthErrorMessage(errorCode);
|
|
42
|
-
}
|
|
43
|
-
return this.getNewsletterErrorMessage(errorCode);
|
|
44
|
-
}
|
|
45
|
-
getAuthErrorCode() {
|
|
46
|
-
const forValue = this.for;
|
|
47
|
-
if (forValue === "connection") {
|
|
48
|
-
return unidyState.backendConnected ? null : "connection_failed";
|
|
49
|
-
}
|
|
50
|
-
if (forValue === "general") {
|
|
51
|
-
return authState.globalErrors.auth;
|
|
52
|
-
}
|
|
53
|
-
return authState.errors[forValue];
|
|
54
|
-
}
|
|
55
|
-
getNewsletterErrorCode() {
|
|
56
|
-
const error = newsletterStore.state.errors[this.for];
|
|
57
|
-
return error ?? null;
|
|
58
|
-
}
|
|
59
|
-
render() {
|
|
60
|
-
const errorCode = this.context === "newsletter" ? this.getNewsletterErrorCode() : this.getAuthErrorCode();
|
|
61
|
-
if (!errorCode) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
// Only render connection_failed for "general" and "connection" types
|
|
65
|
-
if (errorCode === "connection_failed" && this.for !== "general" && this.for !== "connection") {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
const errorMessage = this.getErrorMessage(errorCode);
|
|
69
|
-
const formattedMessage = errorMessage?.includes("\n") ? h("div", { style: { whiteSpace: "pre-line" } }, errorMessage) : errorMessage;
|
|
70
|
-
return h(Host, { class: this.componentClassName }, hasSlotContent(this.el) ? h("slot", null) : formattedMessage);
|
|
71
|
-
}
|
|
72
|
-
static get is() { return "u-error-message"; }
|
|
73
|
-
static get encapsulation() { return "shadow"; }
|
|
74
|
-
static get properties() {
|
|
75
|
-
return {
|
|
76
|
-
"componentClassName": {
|
|
77
|
-
"type": "string",
|
|
78
|
-
"mutable": false,
|
|
79
|
-
"complexType": {
|
|
80
|
-
"original": "string",
|
|
81
|
-
"resolved": "string",
|
|
82
|
-
"references": {}
|
|
83
|
-
},
|
|
84
|
-
"required": false,
|
|
85
|
-
"optional": false,
|
|
86
|
-
"docs": {
|
|
87
|
-
"tags": [],
|
|
88
|
-
"text": ""
|
|
89
|
-
},
|
|
90
|
-
"getter": false,
|
|
91
|
-
"setter": false,
|
|
92
|
-
"reflect": false,
|
|
93
|
-
"attribute": "class-name",
|
|
94
|
-
"defaultValue": "\"\""
|
|
95
|
-
},
|
|
96
|
-
"for": {
|
|
97
|
-
"type": "string",
|
|
98
|
-
"mutable": false,
|
|
99
|
-
"complexType": {
|
|
100
|
-
"original": "string",
|
|
101
|
-
"resolved": "string",
|
|
102
|
-
"references": {}
|
|
103
|
-
},
|
|
104
|
-
"required": true,
|
|
105
|
-
"optional": false,
|
|
106
|
-
"docs": {
|
|
107
|
-
"tags": [],
|
|
108
|
-
"text": ""
|
|
109
|
-
},
|
|
110
|
-
"getter": false,
|
|
111
|
-
"setter": false,
|
|
112
|
-
"reflect": false,
|
|
113
|
-
"attribute": "for"
|
|
114
|
-
},
|
|
115
|
-
"errorMessages": {
|
|
116
|
-
"type": "unknown",
|
|
117
|
-
"mutable": false,
|
|
118
|
-
"complexType": {
|
|
119
|
-
"original": "Record<string, string>",
|
|
120
|
-
"resolved": "{ [x: string]: string; }",
|
|
121
|
-
"references": {
|
|
122
|
-
"Record": {
|
|
123
|
-
"location": "global",
|
|
124
|
-
"id": "global::Record"
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
"required": false,
|
|
129
|
-
"optional": true,
|
|
130
|
-
"docs": {
|
|
131
|
-
"tags": [],
|
|
132
|
-
"text": ""
|
|
133
|
-
},
|
|
134
|
-
"getter": false,
|
|
135
|
-
"setter": false
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
static get elementRef() { return "el"; }
|
|
140
|
-
}
|
|
141
|
-
//# sourceMappingURL=error-message.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-message.js","sourceRoot":"","sources":["../../../../src/shared/components/error-message/error-message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAkC,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7G,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAQvD,MAAM,OAAO,YAAY;IACY,kBAAkB,GAAG,EAAE,CAAC;IACnD,GAAG,CAAU;IAEb,aAAa,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CAAC,CAAC,WAAK,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,IAAG,YAAY,CAAO,CAAC,CAAC,CAAC,YAAY,CAAC;QAEpI,OAAO,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,IAAG,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,eAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAQ,CAAC;IAC9G,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop } from \"@stencil/core\";\nimport { t } from \"../../../i18n\";\nimport { authState } from \"../../../auth/store/auth-store\";\nimport { unidyState } from \"../../store/unidy-store\";\nimport { type NewsletterErrorIdentifier, newsletterStore } from \"../../../newsletter/store/newsletter-store\";\nimport { hasSlotContent } from \"../../component-utils\";\n\nexport type AuthErrorType = \"email\" | \"password\" | \"magicCode\" | \"resetPassword\" | \"general\" | \"connection\";\n\n@Component({\n tag: \"u-error-message\",\n shadow: true,\n})\nexport class ErrorMessage {\n @Prop({ attribute: \"class-name\" }) componentClassName = \"\";\n @Prop() for!: string;\n\n @Prop() errorMessages?: Record<string, string>;\n @Element() el!: HTMLElement;\n\n private detectContext(): \"auth\" | \"newsletter\" | \"profile\" | \"other\" {\n if (this.el.closest(\"u-signin-root\") || this.el.closest(\"u-signin-step\")) return \"auth\";\n\n if (this.el.closest(\"u-profile\")) return \"profile\";\n\n if (this.el.closest(\"u-newsletter-root\")) return \"newsletter\";\n\n if (this.for === \"general\" || this.for === \"connection\") return \"other\";\n\n throw new Error(\n \"No context found for error message. Make sure you are using the component within a u-signin-root, u-profile, or u-newsletter-root.\",\n );\n }\n\n private get context(): \"auth\" | \"newsletter\" | \"profile\" | \"other\" {\n return this.detectContext();\n }\n\n private getAuthErrorMessage(errorCode: string): string {\n if (this.errorMessages?.[errorCode]) {\n return this.errorMessages[errorCode];\n }\n\n const translatedError = t(`errors.${errorCode}`);\n if (translatedError !== `errors.${errorCode}`) {\n return translatedError;\n }\n\n return errorCode || t(\"errors.unknown\", { defaultValue: \"An error occurred\" });\n }\n\n private getNewsletterErrorMessage(errorIdentifier: NewsletterErrorIdentifier): string {\n return t(`newsletter.errors.${errorIdentifier}`) || t(\"errors.unknown\", { defaultValue: \"An unknown error occurred\" });\n }\n\n private getErrorMessage(errorCode: string): string | null {\n if (this.context === \"auth\") {\n return this.getAuthErrorMessage(errorCode);\n }\n\n return this.getNewsletterErrorMessage(errorCode as NewsletterErrorIdentifier);\n }\n\n private getAuthErrorCode(): string | null {\n const forValue = this.for as AuthErrorType;\n\n if (forValue === \"connection\") {\n return unidyState.backendConnected ? null : \"connection_failed\";\n }\n\n if (forValue === \"general\") {\n return authState.globalErrors.auth;\n }\n\n return authState.errors[forValue];\n }\n\n private getNewsletterErrorCode(): string | null {\n const error = newsletterStore.state.errors[this.for];\n return error ?? null;\n }\n\n render() {\n const errorCode = this.context === \"newsletter\" ? this.getNewsletterErrorCode() : this.getAuthErrorCode();\n\n if (!errorCode) {\n return null;\n }\n\n // Only render connection_failed for \"general\" and \"connection\" types\n if (errorCode === \"connection_failed\" && this.for !== \"general\" && this.for !== \"connection\") {\n return null;\n }\n\n const errorMessage = this.getErrorMessage(errorCode);\n const formattedMessage = errorMessage?.includes(\"\\n\") ? <div style={{ whiteSpace: \"pre-line\" }}>{errorMessage}</div> : errorMessage;\n\n return <Host class={this.componentClassName}>{hasSlotContent(this.el) ? <slot /> : formattedMessage}</Host>;\n }\n}\n"]}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
2
|
-
export const CloseIcon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("title", null, "Close"), h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })));
|
|
3
|
-
//# sourceMappingURL=close-icon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"close-icon.js","sourceRoot":"","sources":["../../../../src/shared/components/flash-message/close-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CAC7B,WACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,kBACR,GAAG,oBACD,OAAO,qBACN,OAAO;IAEvB,yBAAoB;IACpB,YAAM,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,GAAG;IACtC,YAAM,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,GAAG,CAClC,CACP,CAAC","sourcesContent":["import { h } from \"@stencil/core\";\n\nexport const CloseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <title>Close</title>\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n);\n"]}
|