@intlayer/design-system 5.0.1 → 5.0.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/.vite/manifest.json +10 -10
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +10 -10
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +10 -10
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.cjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.d.ts.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.mjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +3 -3
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +3 -3
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +6 -6
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +6 -6
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.cjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.d.ts.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.mjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.cjs +7 -7
- package/dist/components/Auth/SignInForm/SignInForm.cjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.d.ts.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.mjs +7 -7
- package/dist/components/Auth/SignInForm/SignInForm.mjs.map +1 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.cjs.map +1 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.d.ts.map +1 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.mjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs +8 -8
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.d.ts.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs +8 -8
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +1 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.cjs.map +1 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.d.ts.map +1 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.mjs.map +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs.map +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.d.ts.map +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs.map +1 -1
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +4 -4
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +4 -4
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +6 -6
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +6 -6
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +22 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +22 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +10 -4
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +10 -4
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +6 -6
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +6 -6
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs +59 -14
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +4 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs +59 -14
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs.map +1 -1
- package/dist/components/IDE/CopyButton.cjs +1 -1
- package/dist/components/IDE/CopyButton.cjs.map +1 -1
- package/dist/components/IDE/CopyButton.d.ts.map +1 -1
- package/dist/components/IDE/CopyButton.mjs +1 -1
- package/dist/components/IDE/CopyButton.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +5 -5
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +5 -5
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts +6 -6
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs +3 -3
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +3 -3
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
- package/dist/{index-Di_3dNqI.js → index-BVYRWLUL.js} +3 -2
- package/dist/index-BVYRWLUL.js.map +1 -0
- package/dist/{index-ZARcTrR0.cjs → index-DTQyeqio.cjs} +3 -2
- package/dist/index-DTQyeqio.cjs.map +1 -0
- package/package.json +19 -19
- package/dist/index-Di_3dNqI.js.map +0 -1
- package/dist/index-ZARcTrR0.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignInForm.cjs","sources":["../../../../src/components/Auth/SignInForm/SignInForm.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"SignInForm.cjs","sources":["../../../../src/components/Auth/SignInForm/SignInForm.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Form, useForm } from '../../Form';\nimport { ExternalsLoginButtons } from '../ExternalsLoginButtons';\nimport { signInContent } from './signIn.content';\nimport { useSignInSchema, type SignIn } from './useSignInSchema';\n\ntype SignInFormProps = {\n onSubmitSuccess: (data: SignIn) => Promise<void>;\n onClickForgotPassword: () => void;\n onClickSignUp: () => void;\n onSubmitError?: (error: Error) => void;\n};\n\nexport const SignInForm: FC<SignInFormProps> = ({\n onSubmitSuccess,\n onSubmitError,\n onClickForgotPassword,\n onClickSignUp,\n}) => {\n const SignInSchema = useSignInSchema();\n const { form, isSubmitting } = useForm(SignInSchema);\n const {\n emailInput,\n passwordInput,\n forgotPasswordLink,\n loginButton,\n signUpLink,\n } = useDictionary(signInContent);\n\n return (\n <>\n <Form\n schema={SignInSchema}\n onSubmitSuccess={onSubmitSuccess}\n onSubmitError={onSubmitError}\n autoComplete\n className=\"gap-y-0\"\n {...form}\n >\n <div className=\"flex flex-col gap-y-6\">\n <Form.Input\n name=\"email\"\n label={emailInput.label.value}\n placeholder={emailInput.placeholder.value}\n isRequired\n autoComplete=\"email\"\n />\n\n <Form.InputPassword\n name=\"password\"\n label={passwordInput.label.value}\n placeholder={passwordInput.placeholder.value}\n isRequired\n autoComplete=\"current-password\"\n />\n </div>\n\n <Form.Button\n className=\"ml-auto mt-2 block\"\n variant=\"link\"\n label={forgotPasswordLink.ariaLabel.value}\n color=\"text\"\n size=\"sm\"\n onClick={onClickForgotPassword}\n >\n {forgotPasswordLink.text}\n </Form.Button>\n\n <Form.Button\n className=\"mt-12 w-full\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={loginButton.ariaLabel.value}\n >\n {loginButton.text}\n </Form.Button>\n\n <span className=\"text-neutral dark:text-neutral-dark m-auto mt-3 flex w-full items-center justify-center text-xs\">\n {signUpLink.message}\n <Form.Button\n variant=\"link\"\n label={signUpLink.ariaLabel.value}\n color=\"text\"\n size=\"sm\"\n onClick={onClickSignUp}\n >\n {signUpLink.text}\n </Form.Button>\n </span>\n </Form>\n <ExternalsLoginButtons />\n </>\n );\n};\n"],"names":["useSignInSchema","useForm","useDictionary","signInContent","jsxs","Fragment","Form","jsx","ExternalsLoginButtons"],"mappings":";;;;;;;;;;;AAgBO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAeA,2CAAAA,gBAAgB;AACrC,QAAM,EAAE,MAAM,iBAAiBC,yBAAAA,QAAQ,YAAY;AAC7C,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEC,cAAAA,cAAcC,0CAAAA,aAAa;AAE/B,SAEIC,2BAAA,kBAAA,KAAAC,uCAAA,EAAA,UAAA;AAAA,IAAAD,2BAAA,kBAAA;AAAA,MAACE,sCAAA;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR;AAAA,QACA;AAAA,QACA,cAAY;AAAA,QACZ,WAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAA;AAAA,UAACF,2BAAAA,kBAAAA,KAAA,OAAA,EAAI,WAAU,yBACb,UAAA;AAAA,YAAAG,2BAAA,kBAAA;AAAA,cAACD,sCAAAA,KAAK;AAAA,cAAL;AAAA,gBACC,MAAK;AAAA,gBACL,OAAO,WAAW,MAAM;AAAA,gBACxB,aAAa,WAAW,YAAY;AAAA,gBACpC,YAAU;AAAA,gBACV,cAAa;AAAA,cAAA;AAAA,YACf;AAAA,YAEAC,2BAAA,kBAAA;AAAA,cAACD,sCAAAA,KAAK;AAAA,cAAL;AAAA,gBACC,MAAK;AAAA,gBACL,OAAO,cAAc,MAAM;AAAA,gBAC3B,aAAa,cAAc,YAAY;AAAA,gBACvC,YAAU;AAAA,gBACV,cAAa;AAAA,cAAA;AAAA,YAAA;AAAA,UACf,GACF;AAAA,UAEAC,2BAAA,kBAAA;AAAA,YAACD,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,WAAU;AAAA,cACV,SAAQ;AAAA,cACR,OAAO,mBAAmB,UAAU;AAAA,cACpC,OAAM;AAAA,cACN,MAAK;AAAA,cACL,SAAS;AAAA,cAER,UAAmB,mBAAA;AAAA,YAAA;AAAA,UACtB;AAAA,UAEAC,2BAAA,kBAAA;AAAA,YAACD,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,WAAU;AAAA,cACV,MAAK;AAAA,cACL,OAAM;AAAA,cACN,WAAW;AAAA,cACX,OAAO,YAAY,UAAU;AAAA,cAE5B,UAAY,YAAA;AAAA,YAAA;AAAA,UACf;AAAA,UAEAF,2BAAAA,kBAAAA,KAAC,QAAK,EAAA,WAAU,mGACb,UAAA;AAAA,YAAW,WAAA;AAAA,YACZG,2BAAA,kBAAA;AAAA,cAACD,sCAAAA,KAAK;AAAA,cAAL;AAAA,gBACC,SAAQ;AAAA,gBACR,OAAO,WAAW,UAAU;AAAA,gBAC5B,OAAM;AAAA,gBACN,MAAK;AAAA,gBACL,SAAS;AAAA,gBAER,UAAW,WAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACd,EACF,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,qDACCE,4DAAsB,uBAAA,CAAA,CAAA;AAAA,EAAA,GACzB;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignInForm.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/SignInForm/SignInForm.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SignInForm.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/SignInForm/SignInForm.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,OAAO,EAAmB,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEjE,KAAK,eAAe,GAAG;IACrB,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAiF1C,CAAC"}
|
|
@@ -38,8 +38,8 @@ const SignInForm = ({
|
|
|
38
38
|
Form.Input,
|
|
39
39
|
{
|
|
40
40
|
name: "email",
|
|
41
|
-
label: emailInput.label,
|
|
42
|
-
placeholder: emailInput.placeholder,
|
|
41
|
+
label: emailInput.label.value,
|
|
42
|
+
placeholder: emailInput.placeholder.value,
|
|
43
43
|
isRequired: true,
|
|
44
44
|
autoComplete: "email"
|
|
45
45
|
}
|
|
@@ -48,8 +48,8 @@ const SignInForm = ({
|
|
|
48
48
|
Form.InputPassword,
|
|
49
49
|
{
|
|
50
50
|
name: "password",
|
|
51
|
-
label: passwordInput.label,
|
|
52
|
-
placeholder: passwordInput.placeholder,
|
|
51
|
+
label: passwordInput.label.value,
|
|
52
|
+
placeholder: passwordInput.placeholder.value,
|
|
53
53
|
isRequired: true,
|
|
54
54
|
autoComplete: "current-password"
|
|
55
55
|
}
|
|
@@ -60,7 +60,7 @@ const SignInForm = ({
|
|
|
60
60
|
{
|
|
61
61
|
className: "ml-auto mt-2 block",
|
|
62
62
|
variant: "link",
|
|
63
|
-
label: forgotPasswordLink.ariaLabel,
|
|
63
|
+
label: forgotPasswordLink.ariaLabel.value,
|
|
64
64
|
color: "text",
|
|
65
65
|
size: "sm",
|
|
66
66
|
onClick: onClickForgotPassword,
|
|
@@ -74,7 +74,7 @@ const SignInForm = ({
|
|
|
74
74
|
type: "submit",
|
|
75
75
|
color: "text",
|
|
76
76
|
isLoading: isSubmitting,
|
|
77
|
-
label: loginButton.ariaLabel,
|
|
77
|
+
label: loginButton.ariaLabel.value,
|
|
78
78
|
children: loginButton.text
|
|
79
79
|
}
|
|
80
80
|
),
|
|
@@ -84,7 +84,7 @@ const SignInForm = ({
|
|
|
84
84
|
Form.Button,
|
|
85
85
|
{
|
|
86
86
|
variant: "link",
|
|
87
|
-
label: signUpLink.ariaLabel,
|
|
87
|
+
label: signUpLink.ariaLabel.value,
|
|
88
88
|
color: "text",
|
|
89
89
|
size: "sm",
|
|
90
90
|
onClick: onClickSignUp,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignInForm.mjs","sources":["../../../../src/components/Auth/SignInForm/SignInForm.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"SignInForm.mjs","sources":["../../../../src/components/Auth/SignInForm/SignInForm.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Form, useForm } from '../../Form';\nimport { ExternalsLoginButtons } from '../ExternalsLoginButtons';\nimport { signInContent } from './signIn.content';\nimport { useSignInSchema, type SignIn } from './useSignInSchema';\n\ntype SignInFormProps = {\n onSubmitSuccess: (data: SignIn) => Promise<void>;\n onClickForgotPassword: () => void;\n onClickSignUp: () => void;\n onSubmitError?: (error: Error) => void;\n};\n\nexport const SignInForm: FC<SignInFormProps> = ({\n onSubmitSuccess,\n onSubmitError,\n onClickForgotPassword,\n onClickSignUp,\n}) => {\n const SignInSchema = useSignInSchema();\n const { form, isSubmitting } = useForm(SignInSchema);\n const {\n emailInput,\n passwordInput,\n forgotPasswordLink,\n loginButton,\n signUpLink,\n } = useDictionary(signInContent);\n\n return (\n <>\n <Form\n schema={SignInSchema}\n onSubmitSuccess={onSubmitSuccess}\n onSubmitError={onSubmitError}\n autoComplete\n className=\"gap-y-0\"\n {...form}\n >\n <div className=\"flex flex-col gap-y-6\">\n <Form.Input\n name=\"email\"\n label={emailInput.label.value}\n placeholder={emailInput.placeholder.value}\n isRequired\n autoComplete=\"email\"\n />\n\n <Form.InputPassword\n name=\"password\"\n label={passwordInput.label.value}\n placeholder={passwordInput.placeholder.value}\n isRequired\n autoComplete=\"current-password\"\n />\n </div>\n\n <Form.Button\n className=\"ml-auto mt-2 block\"\n variant=\"link\"\n label={forgotPasswordLink.ariaLabel.value}\n color=\"text\"\n size=\"sm\"\n onClick={onClickForgotPassword}\n >\n {forgotPasswordLink.text}\n </Form.Button>\n\n <Form.Button\n className=\"mt-12 w-full\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={loginButton.ariaLabel.value}\n >\n {loginButton.text}\n </Form.Button>\n\n <span className=\"text-neutral dark:text-neutral-dark m-auto mt-3 flex w-full items-center justify-center text-xs\">\n {signUpLink.message}\n <Form.Button\n variant=\"link\"\n label={signUpLink.ariaLabel.value}\n color=\"text\"\n size=\"sm\"\n onClick={onClickSignUp}\n >\n {signUpLink.text}\n </Form.Button>\n </span>\n </Form>\n <ExternalsLoginButtons />\n </>\n );\n};\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;AAgBO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,gBAAgB;AACrC,QAAM,EAAE,MAAM,iBAAiB,QAAQ,YAAY;AAC7C,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,cAAc,aAAa;AAE/B,SAEIA,kCAAA,KAAAC,4BAAA,EAAA,UAAA;AAAA,IAAAD,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR;AAAA,QACA;AAAA,QACA,cAAY;AAAA,QACZ,WAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAA;AAAA,UAACA,kCAAAA,KAAA,OAAA,EAAI,WAAU,yBACb,UAAA;AAAA,YAAAE,kCAAA;AAAA,cAAC,KAAK;AAAA,cAAL;AAAA,gBACC,MAAK;AAAA,gBACL,OAAO,WAAW,MAAM;AAAA,gBACxB,aAAa,WAAW,YAAY;AAAA,gBACpC,YAAU;AAAA,gBACV,cAAa;AAAA,cAAA;AAAA,YACf;AAAA,YAEAA,kCAAA;AAAA,cAAC,KAAK;AAAA,cAAL;AAAA,gBACC,MAAK;AAAA,gBACL,OAAO,cAAc,MAAM;AAAA,gBAC3B,aAAa,cAAc,YAAY;AAAA,gBACvC,YAAU;AAAA,gBACV,cAAa;AAAA,cAAA;AAAA,YAAA;AAAA,UACf,GACF;AAAA,UAEAA,kCAAA;AAAA,YAAC,KAAK;AAAA,YAAL;AAAA,cACC,WAAU;AAAA,cACV,SAAQ;AAAA,cACR,OAAO,mBAAmB,UAAU;AAAA,cACpC,OAAM;AAAA,cACN,MAAK;AAAA,cACL,SAAS;AAAA,cAER,UAAmB,mBAAA;AAAA,YAAA;AAAA,UACtB;AAAA,UAEAA,kCAAA;AAAA,YAAC,KAAK;AAAA,YAAL;AAAA,cACC,WAAU;AAAA,cACV,MAAK;AAAA,cACL,OAAM;AAAA,cACN,WAAW;AAAA,cACX,OAAO,YAAY,UAAU;AAAA,cAE5B,UAAY,YAAA;AAAA,YAAA;AAAA,UACf;AAAA,UAEAF,kCAAAA,KAAC,QAAK,EAAA,WAAU,mGACb,UAAA;AAAA,YAAW,WAAA;AAAA,YACZE,kCAAA;AAAA,cAAC,KAAK;AAAA,cAAL;AAAA,gBACC,SAAQ;AAAA,gBACR,OAAO,WAAW,UAAU;AAAA,gBAC5B,OAAM;AAAA,gBACN,MAAK;AAAA,gBACL,SAAS;AAAA,gBAER,UAAW,WAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACd,EACF,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,0CACC,uBAAsB,CAAA,CAAA;AAAA,EAAA,GACzB;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignInSchema.cjs","sources":["../../../../src/components/Auth/SignInForm/useSignInSchema.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"useSignInSchema.cjs","sources":["../../../../src/components/Auth/SignInForm/useSignInSchema.ts"],"sourcesContent":["import { useDictionary } from 'react-intlayer';\nimport { z } from 'zod';\nimport { signInSchemaContent } from './useSignInSchema.content';\n\nexport const useSignInSchema = () => {\n const {\n requiredErrorEmail,\n invalidTypeErrorEmail,\n requiredErrorPassword,\n invalidTypeErrorPassword,\n } = useDictionary(signInSchemaContent);\n\n return z.object({\n email: z\n .string({\n required_error: requiredErrorEmail,\n invalid_type_error: invalidTypeErrorEmail,\n })\n .min(1, { message: invalidTypeErrorEmail })\n .default(''),\n password: z\n .string({\n required_error: requiredErrorPassword,\n invalid_type_error: invalidTypeErrorPassword,\n })\n .min(1, { message: invalidTypeErrorPassword })\n .default(''),\n });\n};\nexport type SignIn = z.infer<ReturnType<typeof useSignInSchema>>;\n"],"names":["useDictionary","signInSchemaContent","z"],"mappings":";;;;;AAIO,MAAM,kBAAkB,MAAM;AAC7B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEA,cAAAA,cAAcC,mDAAAA,mBAAmB;AAErC,SAAOC,IAAAA,EAAE,OAAO;AAAA,IACd,OAAOA,MACJ,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IAAA,CACrB,EACA,IAAI,GAAG,EAAE,SAAS,uBAAuB,EACzC,QAAQ,EAAE;AAAA,IACb,UAAUA,MACP,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IAAA,CACrB,EACA,IAAI,GAAG,EAAE,SAAS,yBAA0B,CAAA,EAC5C,QAAQ,EAAE;AAAA,EAAA,CACd;AACH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignInSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/SignInForm/useSignInSchema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignInSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/SignInForm/useSignInSchema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe;;;;;;;;;EAwB3B,CAAC;AACF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignInSchema.mjs","sources":["../../../../src/components/Auth/SignInForm/useSignInSchema.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"useSignInSchema.mjs","sources":["../../../../src/components/Auth/SignInForm/useSignInSchema.ts"],"sourcesContent":["import { useDictionary } from 'react-intlayer';\nimport { z } from 'zod';\nimport { signInSchemaContent } from './useSignInSchema.content';\n\nexport const useSignInSchema = () => {\n const {\n requiredErrorEmail,\n invalidTypeErrorEmail,\n requiredErrorPassword,\n invalidTypeErrorPassword,\n } = useDictionary(signInSchemaContent);\n\n return z.object({\n email: z\n .string({\n required_error: requiredErrorEmail,\n invalid_type_error: invalidTypeErrorEmail,\n })\n .min(1, { message: invalidTypeErrorEmail })\n .default(''),\n password: z\n .string({\n required_error: requiredErrorPassword,\n invalid_type_error: invalidTypeErrorPassword,\n })\n .min(1, { message: invalidTypeErrorPassword })\n .default(''),\n });\n};\nexport type SignIn = z.infer<ReturnType<typeof useSignInSchema>>;\n"],"names":[],"mappings":";;;AAIO,MAAM,kBAAkB,MAAM;AAC7B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,cAAc,mBAAmB;AAErC,SAAO,EAAE,OAAO;AAAA,IACd,OAAO,EACJ,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IAAA,CACrB,EACA,IAAI,GAAG,EAAE,SAAS,uBAAuB,EACzC,QAAQ,EAAE;AAAA,IACb,UAAU,EACP,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IAAA,CACrB,EACA,IAAI,GAAG,EAAE,SAAS,yBAA0B,CAAA,EAC5C,QAAQ,EAAE;AAAA,EAAA,CACd;AACH;"}
|
|
@@ -36,8 +36,8 @@ const SignUpForm = ({
|
|
|
36
36
|
components_Form_layout_FormItemLayout.Form.Input,
|
|
37
37
|
{
|
|
38
38
|
name: "email",
|
|
39
|
-
label: emailInput.label,
|
|
40
|
-
placeholder: emailInput.placeholder,
|
|
39
|
+
label: emailInput.label.value,
|
|
40
|
+
placeholder: emailInput.placeholder.value,
|
|
41
41
|
isRequired: true,
|
|
42
42
|
autoComplete: "email",
|
|
43
43
|
minLength: 5,
|
|
@@ -48,8 +48,8 @@ const SignUpForm = ({
|
|
|
48
48
|
components_Form_layout_FormItemLayout.Form.InputPassword,
|
|
49
49
|
{
|
|
50
50
|
name: "password",
|
|
51
|
-
label: passwordInput.label,
|
|
52
|
-
placeholder: passwordInput.placeholder,
|
|
51
|
+
label: passwordInput.label.value,
|
|
52
|
+
placeholder: passwordInput.placeholder.value,
|
|
53
53
|
autoComplete: "new-password",
|
|
54
54
|
isRequired: true
|
|
55
55
|
}
|
|
@@ -58,8 +58,8 @@ const SignUpForm = ({
|
|
|
58
58
|
components_Form_layout_FormItemLayout.Form.InputPassword,
|
|
59
59
|
{
|
|
60
60
|
name: "passwordConfirmation",
|
|
61
|
-
label: passwordConfirmationInput.label,
|
|
62
|
-
placeholder: passwordConfirmationInput.placeholder,
|
|
61
|
+
label: passwordConfirmationInput.label.value,
|
|
62
|
+
placeholder: passwordConfirmationInput.placeholder.value,
|
|
63
63
|
autoComplete: "new-password",
|
|
64
64
|
isRequired: true
|
|
65
65
|
}
|
|
@@ -72,7 +72,7 @@ const SignUpForm = ({
|
|
|
72
72
|
type: "submit",
|
|
73
73
|
color: "text",
|
|
74
74
|
isLoading: isSubmitting,
|
|
75
|
-
label: signUpButton.ariaLabel,
|
|
75
|
+
label: signUpButton.ariaLabel.value,
|
|
76
76
|
children: signUpButton.text
|
|
77
77
|
}
|
|
78
78
|
),
|
|
@@ -82,7 +82,7 @@ const SignUpForm = ({
|
|
|
82
82
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
83
83
|
{
|
|
84
84
|
variant: "link",
|
|
85
|
-
label: loginLink.ariaLabel,
|
|
85
|
+
label: loginLink.ariaLabel.value,
|
|
86
86
|
color: "text",
|
|
87
87
|
onClick: onClickBackToSignIn,
|
|
88
88
|
children: loginLink.text
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignUpForm.cjs","sources":["../../../../src/components/Auth/SignUpForm/SignUpForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"SignUpForm.cjs","sources":["../../../../src/components/Auth/SignUpForm/SignUpForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Form, useForm } from '../../Form';\nimport content from './signUpForm.content';\nimport { useSignUpSchema, type SignUp } from './useSignUpSchema';\n\ntype SignUpFormProps = {\n onSubmitSuccess: (data: SignUp) => Promise<void>;\n onClickBackToSignIn: () => void;\n onSubmitError?: (error: Error) => void;\n};\n\nexport const SignUpForm: FC<SignUpFormProps> = ({\n onSubmitSuccess,\n onSubmitError,\n onClickBackToSignIn,\n}) => {\n const {\n emailInput,\n passwordInput,\n passwordConfirmationInput,\n signUpButton,\n loginLink,\n } = useDictionary(content);\n const SignUpSchema = useSignUpSchema();\n const { form, isSubmitting } = useForm(SignUpSchema);\n\n return (\n <Form\n schema={SignUpSchema}\n onSubmitSuccess={onSubmitSuccess}\n onSubmitError={onSubmitError}\n autoComplete\n {...form}\n >\n <div className=\"flex flex-col gap-y-6\">\n <Form.Input\n name=\"email\"\n label={emailInput.label.value}\n placeholder={emailInput.placeholder.value}\n isRequired\n autoComplete=\"email\"\n minLength={5}\n maxLength={50}\n />\n\n <Form.InputPassword\n name=\"password\"\n label={passwordInput.label.value}\n placeholder={passwordInput.placeholder.value}\n autoComplete=\"new-password\"\n isRequired\n />\n\n <Form.InputPassword\n name=\"passwordConfirmation\"\n label={passwordConfirmationInput.label.value}\n placeholder={passwordConfirmationInput.placeholder.value}\n autoComplete=\"new-password\"\n isRequired\n />\n </div>\n\n <Form.Button\n className=\"mt-12 w-full\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={signUpButton.ariaLabel.value}\n >\n {signUpButton.text}\n </Form.Button>\n\n <span className=\"text-neutral dark:text-neutral-dark m-auto mt-3 flex w-full items-center justify-center text-center align-middle text-xs\">\n {loginLink.message}\n <Form.Button\n variant=\"link\"\n label={loginLink.ariaLabel.value}\n color=\"text\"\n onClick={onClickBackToSignIn}\n >\n {loginLink.text}\n </Form.Button>\n </span>\n </Form>\n );\n};\n"],"names":["useDictionary","content","useSignUpSchema","useForm","jsxs","Form","jsx"],"mappings":";;;;;;;;;;AAcO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACE,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEA,cAAAA,cAAcC,6CAAO;AACzB,QAAM,eAAeC,2CAAAA,gBAAgB;AACrC,QAAM,EAAE,MAAM,iBAAiBC,yBAAAA,QAAQ,YAAY;AAGjD,SAAAC,2BAAA,kBAAA;AAAA,IAACC,sCAAA;AAAA,IAAA;AAAA,MACC,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,MACA,cAAY;AAAA,MACX,GAAG;AAAA,MAEJ,UAAA;AAAA,QAACD,2BAAAA,kBAAAA,KAAA,OAAA,EAAI,WAAU,yBACb,UAAA;AAAA,UAAAE,2BAAA,kBAAA;AAAA,YAACD,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,MAAK;AAAA,cACL,OAAO,WAAW,MAAM;AAAA,cACxB,aAAa,WAAW,YAAY;AAAA,cACpC,YAAU;AAAA,cACV,cAAa;AAAA,cACb,WAAW;AAAA,cACX,WAAW;AAAA,YAAA;AAAA,UACb;AAAA,UAEAC,2BAAA,kBAAA;AAAA,YAACD,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,MAAK;AAAA,cACL,OAAO,cAAc,MAAM;AAAA,cAC3B,aAAa,cAAc,YAAY;AAAA,cACvC,cAAa;AAAA,cACb,YAAU;AAAA,YAAA;AAAA,UACZ;AAAA,UAEAC,2BAAA,kBAAA;AAAA,YAACD,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,MAAK;AAAA,cACL,OAAO,0BAA0B,MAAM;AAAA,cACvC,aAAa,0BAA0B,YAAY;AAAA,cACnD,cAAa;AAAA,cACb,YAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACZ,GACF;AAAA,QAEAC,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,WAAU;AAAA,YACV,MAAK;AAAA,YACL,OAAM;AAAA,YACN,WAAW;AAAA,YACX,OAAO,aAAa,UAAU;AAAA,YAE7B,UAAa,aAAA;AAAA,UAAA;AAAA,QAChB;AAAA,QAEAD,2BAAAA,kBAAAA,KAAC,QAAK,EAAA,WAAU,4HACb,UAAA;AAAA,UAAU,UAAA;AAAA,UACXE,2BAAA,kBAAA;AAAA,YAACD,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,SAAQ;AAAA,cACR,OAAO,UAAU,UAAU;AAAA,cAC3B,OAAM;AAAA,cACN,SAAS;AAAA,cAER,UAAU,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACb,EACF,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignUpForm.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/SignUpForm/SignUpForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SignUpForm.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/SignUpForm/SignUpForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,EAAmB,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEjE,KAAK,eAAe,GAAG;IACrB,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA0E1C,CAAC"}
|
|
@@ -34,8 +34,8 @@ const SignUpForm = ({
|
|
|
34
34
|
Form.Input,
|
|
35
35
|
{
|
|
36
36
|
name: "email",
|
|
37
|
-
label: emailInput.label,
|
|
38
|
-
placeholder: emailInput.placeholder,
|
|
37
|
+
label: emailInput.label.value,
|
|
38
|
+
placeholder: emailInput.placeholder.value,
|
|
39
39
|
isRequired: true,
|
|
40
40
|
autoComplete: "email",
|
|
41
41
|
minLength: 5,
|
|
@@ -46,8 +46,8 @@ const SignUpForm = ({
|
|
|
46
46
|
Form.InputPassword,
|
|
47
47
|
{
|
|
48
48
|
name: "password",
|
|
49
|
-
label: passwordInput.label,
|
|
50
|
-
placeholder: passwordInput.placeholder,
|
|
49
|
+
label: passwordInput.label.value,
|
|
50
|
+
placeholder: passwordInput.placeholder.value,
|
|
51
51
|
autoComplete: "new-password",
|
|
52
52
|
isRequired: true
|
|
53
53
|
}
|
|
@@ -56,8 +56,8 @@ const SignUpForm = ({
|
|
|
56
56
|
Form.InputPassword,
|
|
57
57
|
{
|
|
58
58
|
name: "passwordConfirmation",
|
|
59
|
-
label: passwordConfirmationInput.label,
|
|
60
|
-
placeholder: passwordConfirmationInput.placeholder,
|
|
59
|
+
label: passwordConfirmationInput.label.value,
|
|
60
|
+
placeholder: passwordConfirmationInput.placeholder.value,
|
|
61
61
|
autoComplete: "new-password",
|
|
62
62
|
isRequired: true
|
|
63
63
|
}
|
|
@@ -70,7 +70,7 @@ const SignUpForm = ({
|
|
|
70
70
|
type: "submit",
|
|
71
71
|
color: "text",
|
|
72
72
|
isLoading: isSubmitting,
|
|
73
|
-
label: signUpButton.ariaLabel,
|
|
73
|
+
label: signUpButton.ariaLabel.value,
|
|
74
74
|
children: signUpButton.text
|
|
75
75
|
}
|
|
76
76
|
),
|
|
@@ -80,7 +80,7 @@ const SignUpForm = ({
|
|
|
80
80
|
Form.Button,
|
|
81
81
|
{
|
|
82
82
|
variant: "link",
|
|
83
|
-
label: loginLink.ariaLabel,
|
|
83
|
+
label: loginLink.ariaLabel.value,
|
|
84
84
|
color: "text",
|
|
85
85
|
onClick: onClickBackToSignIn,
|
|
86
86
|
children: loginLink.text
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignUpForm.mjs","sources":["../../../../src/components/Auth/SignUpForm/SignUpForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"SignUpForm.mjs","sources":["../../../../src/components/Auth/SignUpForm/SignUpForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Form, useForm } from '../../Form';\nimport content from './signUpForm.content';\nimport { useSignUpSchema, type SignUp } from './useSignUpSchema';\n\ntype SignUpFormProps = {\n onSubmitSuccess: (data: SignUp) => Promise<void>;\n onClickBackToSignIn: () => void;\n onSubmitError?: (error: Error) => void;\n};\n\nexport const SignUpForm: FC<SignUpFormProps> = ({\n onSubmitSuccess,\n onSubmitError,\n onClickBackToSignIn,\n}) => {\n const {\n emailInput,\n passwordInput,\n passwordConfirmationInput,\n signUpButton,\n loginLink,\n } = useDictionary(content);\n const SignUpSchema = useSignUpSchema();\n const { form, isSubmitting } = useForm(SignUpSchema);\n\n return (\n <Form\n schema={SignUpSchema}\n onSubmitSuccess={onSubmitSuccess}\n onSubmitError={onSubmitError}\n autoComplete\n {...form}\n >\n <div className=\"flex flex-col gap-y-6\">\n <Form.Input\n name=\"email\"\n label={emailInput.label.value}\n placeholder={emailInput.placeholder.value}\n isRequired\n autoComplete=\"email\"\n minLength={5}\n maxLength={50}\n />\n\n <Form.InputPassword\n name=\"password\"\n label={passwordInput.label.value}\n placeholder={passwordInput.placeholder.value}\n autoComplete=\"new-password\"\n isRequired\n />\n\n <Form.InputPassword\n name=\"passwordConfirmation\"\n label={passwordConfirmationInput.label.value}\n placeholder={passwordConfirmationInput.placeholder.value}\n autoComplete=\"new-password\"\n isRequired\n />\n </div>\n\n <Form.Button\n className=\"mt-12 w-full\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={signUpButton.ariaLabel.value}\n >\n {signUpButton.text}\n </Form.Button>\n\n <span className=\"text-neutral dark:text-neutral-dark m-auto mt-3 flex w-full items-center justify-center text-center align-middle text-xs\">\n {loginLink.message}\n <Form.Button\n variant=\"link\"\n label={loginLink.ariaLabel.value}\n color=\"text\"\n onClick={onClickBackToSignIn}\n >\n {loginLink.text}\n </Form.Button>\n </span>\n </Form>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;AAcO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACE,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,cAAc,OAAO;AACzB,QAAM,eAAe,gBAAgB;AACrC,QAAM,EAAE,MAAM,iBAAiB,QAAQ,YAAY;AAGjD,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,MACA,cAAY;AAAA,MACX,GAAG;AAAA,MAEJ,UAAA;AAAA,QAACA,kCAAAA,KAAA,OAAA,E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/SignUpForm/useSignUpSchema.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"useSignUpSchema.cjs","sources":["../../../../src/components/Auth/SignUpForm/useSignUpSchema.ts"],"sourcesContent":["import { t, useDictionary } from 'react-intlayer';\nimport { z } from 'zod';\nimport { signUpSchemaContent } from './useSignUpSchema.content';\n\nexport const useSignUpSchema = () => {\n const {\n requiredErrorEmail,\n invalidTypeErrorEmail,\n requiredErrorPassword,\n invalidTypeErrorPassword,\n requiredErrorPasswordConfirmation,\n invalidTypeErrorPasswordConfirmation,\n passwordNotMatchError,\n } = useDictionary(signUpSchemaContent);\n\n return z\n .object({\n email: z\n .string({\n required_error: requiredErrorEmail,\n invalid_type_error: invalidTypeErrorEmail,\n })\n .min(1, { message: invalidTypeErrorEmail })\n .email({ message: invalidTypeErrorEmail }),\n password: z\n .string({\n required_error: requiredErrorPassword,\n invalid_type_error: invalidTypeErrorPassword,\n })\n .min(8, { message: invalidTypeErrorPassword }),\n passwordConfirmation: z\n .string({\n required_error: requiredErrorPasswordConfirmation,\n invalid_type_error: invalidTypeErrorPasswordConfirmation,\n })\n .min(8, { message: invalidTypeErrorPasswordConfirmation }),\n })\n .refine((data) => data.password === data.passwordConfirmation, {\n message: passwordNotMatchError,\n path: ['passwordConfirmation'], // This specifies which field the error should be associated with\n });\n};\n\nexport type SignUp = z.infer<ReturnType<typeof useSignUpSchema>>;\n"],"names":["useDictionary","signUpSchemaContent","z"],"mappings":";;;;;AAIO,MAAM,kBAAkB,MAAM;AAC7B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEA,cAAAA,cAAcC,mDAAAA,mBAAmB;AAErC,SAAOC,IAAAA,EACJ,OAAO;AAAA,IACN,OAAOA,MACJ,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IACrB,CAAA,EACA,IAAI,GAAG,EAAE,SAAS,uBAAuB,EACzC,MAAM,EAAE,SAAS,uBAAuB;AAAA,IAC3C,UAAUA,MACP,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IACrB,CAAA,EACA,IAAI,GAAG,EAAE,SAAS,0BAA0B;AAAA,IAC/C,sBAAsBA,MACnB,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IACrB,CAAA,EACA,IAAI,GAAG,EAAE,SAAS,qCAAsC,CAAA;AAAA,EAAA,CAC5D,EACA,OAAO,CAAC,SAAS,KAAK,aAAa,KAAK,sBAAsB;AAAA,IAC7D,SAAS;AAAA,IACT,MAAM,CAAC,sBAAsB;AAAA;AAAA,EAAA,CAC9B;AACL;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignUpSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/SignUpForm/useSignUpSchema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignUpSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/SignUpForm/useSignUpSchema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;EAqC3B,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignUpSchema.mjs","sources":["../../../../src/components/Auth/SignUpForm/useSignUpSchema.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"useSignUpSchema.mjs","sources":["../../../../src/components/Auth/SignUpForm/useSignUpSchema.ts"],"sourcesContent":["import { t, useDictionary } from 'react-intlayer';\nimport { z } from 'zod';\nimport { signUpSchemaContent } from './useSignUpSchema.content';\n\nexport const useSignUpSchema = () => {\n const {\n requiredErrorEmail,\n invalidTypeErrorEmail,\n requiredErrorPassword,\n invalidTypeErrorPassword,\n requiredErrorPasswordConfirmation,\n invalidTypeErrorPasswordConfirmation,\n passwordNotMatchError,\n } = useDictionary(signUpSchemaContent);\n\n return z\n .object({\n email: z\n .string({\n required_error: requiredErrorEmail,\n invalid_type_error: invalidTypeErrorEmail,\n })\n .min(1, { message: invalidTypeErrorEmail })\n .email({ message: invalidTypeErrorEmail }),\n password: z\n .string({\n required_error: requiredErrorPassword,\n invalid_type_error: invalidTypeErrorPassword,\n })\n .min(8, { message: invalidTypeErrorPassword }),\n passwordConfirmation: z\n .string({\n required_error: requiredErrorPasswordConfirmation,\n invalid_type_error: invalidTypeErrorPasswordConfirmation,\n })\n .min(8, { message: invalidTypeErrorPasswordConfirmation }),\n })\n .refine((data) => data.password === data.passwordConfirmation, {\n message: passwordNotMatchError,\n path: ['passwordConfirmation'], // This specifies which field the error should be associated with\n });\n};\n\nexport type SignUp = z.infer<ReturnType<typeof useSignUpSchema>>;\n"],"names":[],"mappings":";;;AAIO,MAAM,kBAAkB,MAAM;AAC7B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,cAAc,mBAAmB;AAErC,SAAO,EACJ,OAAO;AAAA,IACN,OAAO,EACJ,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IACrB,CAAA,EACA,IAAI,GAAG,EAAE,SAAS,uBAAuB,EACzC,MAAM,EAAE,SAAS,uBAAuB;AAAA,IAC3C,UAAU,EACP,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IACrB,CAAA,EACA,IAAI,GAAG,EAAE,SAAS,0BAA0B;AAAA,IAC/C,sBAAsB,EACnB,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IACrB,CAAA,EACA,IAAI,GAAG,EAAE,SAAS,qCAAsC,CAAA;AAAA,EAAA,CAC5D,EACA,OAAO,CAAC,SAAS,KAAK,aAAa,KAAK,sBAAsB;AAAA,IAC7D,SAAS;AAAA,IACT,MAAM,CAAC,sBAAsB;AAAA;AAAA,EAAA,CAC9B;AACL;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerifyEmailForm.cjs","sources":["../../../../src/components/Auth/VerifyEmailForm/VerifyEmailForm.tsx"],"sourcesContent":["'use client';\n\nimport { intlayerAPI } from '@intlayer/api';\nimport { Check } from 'lucide-react';\
|
|
1
|
+
{"version":3,"file":"VerifyEmailForm.cjs","sources":["../../../../src/components/Auth/VerifyEmailForm/VerifyEmailForm.tsx"],"sourcesContent":["'use client';\n\nimport { intlayerAPI } from '@intlayer/api';\nimport { Check } from 'lucide-react';\nimport { useEffect, useMemo, useState, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../../Button';\nimport { Form, useForm } from '../../Form';\nimport { H3 } from '../../Headers';\nimport { Loader } from '../../Loader';\nimport { useUser } from '../useUser';\nimport content from './index.content';\nimport { getVerifyEmailSchema, VerifyEmail } from './VerifyEmailSchema';\n\ntype VerifyEmailFormProps = {\n onSubmitSuccess: (data: VerifyEmail) => Promise<void>;\n onSubmitError?: (error: Error) => void;\n userId?: string;\n};\n\nexport const VerifyEmailForm: FC<VerifyEmailFormProps> = ({\n userId,\n onSubmitSuccess,\n onSubmitError,\n}) => {\n const VerifyEmailSchema = getVerifyEmailSchema();\n const { revalidateSession, user } = useUser();\n const { verifyEmail, doneButton } = useDictionary(content);\n const [isEmailVerified, setIsEmailVerified] = useState(false);\n const { form } = useForm(VerifyEmailSchema, {});\n\n const targetedUserId = useMemo(\n () => userId ?? user?._id,\n [userId, user?._id]\n );\n\n useEffect(() => {\n if (!targetedUserId) return;\n if (isEmailVerified) return;\n\n // EventSource alow to receive server-sent events from the server\n // In this case, we are listening to the email verification status\n const eventSource = new EventSource(\n intlayerAPI.auth.getVerifyEmailStatusURL(targetedUserId!)\n );\n\n eventSource.onmessage = async (event) => {\n const data = JSON.parse(event.data);\n\n if (data.status === 'verified') {\n // Update your UI to reflect the verification\n\n setIsEmailVerified(true);\n\n await revalidateSession();\n\n eventSource.close(); // Close the connection if no longer needed\n }\n };\n\n eventSource.onerror = (event) => {\n console.error(event);\n // Handle errors or reconnection logic\n eventSource.close();\n };\n\n return () => eventSource.close(); // Clean up on component unmount\n }, [revalidateSession, targetedUserId, userId, user?._id, isEmailVerified]);\n\n return (\n <Form\n schema={VerifyEmailSchema}\n autoComplete\n {...form}\n onSubmitSuccess={onSubmitSuccess}\n onSubmitError={onSubmitError}\n >\n <H3>{verifyEmail.title}</H3>\n <span className=\"text-neutral dark:text-neutral text-sm\">\n {verifyEmail.description}\n </span>\n <Loader isLoading={!isEmailVerified}>\n <div className=\"bg-success/30 dark:bg-success-dark/30 m-auto aspect-square rounded-full p-5\">\n <Check className=\"text-success dark:text-success-dark\" size={50} />\n </div>\n </Loader>\n <Button\n disabled={!isEmailVerified}\n label={doneButton.text.value}\n type=\"submit\"\n color=\"text\"\n >\n {doneButton.text}\n </Button>\n </Form>\n );\n};\n"],"names":["getVerifyEmailSchema","useUser","useDictionary","content","useState","useForm","useMemo","useEffect","intlayerAPI","jsxs","Form","jsx","H3","Loader","Check","Button"],"mappings":";;;;;;;;;;;;;;;;;AAoBO,MAAM,kBAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,oBAAoBA,kDAAAA,qBAAqB;AAC/C,QAAM,EAAE,mBAAmB,KAAK,IAAIC,sCAAQ;AAC5C,QAAM,EAAE,aAAa,eAAeC,cAAAA,cAAcC,6CAAO;AACzD,QAAM,CAAC,iBAAiB,kBAAkB,IAAIC,WAAAA,SAAS,KAAK;AAC5D,QAAM,EAAE,KAAK,IAAIC,iCAAQ,mBAAmB,CAAA,CAAE;AAE9C,QAAM,iBAAiBC,WAAA;AAAA,IACrB,MAAM,UAAU,MAAM;AAAA,IACtB,CAAC,QAAQ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AAAA,IAAA;AAAA,EACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerifyEmailForm.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/VerifyEmailForm/VerifyEmailForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VerifyEmailForm.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/VerifyEmailForm/VerifyEmailForm.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAgC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAQ9D,OAAO,EAAwB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAExE,KAAK,oBAAoB,GAAG;IAC1B,eAAe,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA4EpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerifyEmailForm.mjs","sources":["../../../../src/components/Auth/VerifyEmailForm/VerifyEmailForm.tsx"],"sourcesContent":["'use client';\n\nimport { intlayerAPI } from '@intlayer/api';\nimport { Check } from 'lucide-react';\
|
|
1
|
+
{"version":3,"file":"VerifyEmailForm.mjs","sources":["../../../../src/components/Auth/VerifyEmailForm/VerifyEmailForm.tsx"],"sourcesContent":["'use client';\n\nimport { intlayerAPI } from '@intlayer/api';\nimport { Check } from 'lucide-react';\nimport { useEffect, useMemo, useState, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../../Button';\nimport { Form, useForm } from '../../Form';\nimport { H3 } from '../../Headers';\nimport { Loader } from '../../Loader';\nimport { useUser } from '../useUser';\nimport content from './index.content';\nimport { getVerifyEmailSchema, VerifyEmail } from './VerifyEmailSchema';\n\ntype VerifyEmailFormProps = {\n onSubmitSuccess: (data: VerifyEmail) => Promise<void>;\n onSubmitError?: (error: Error) => void;\n userId?: string;\n};\n\nexport const VerifyEmailForm: FC<VerifyEmailFormProps> = ({\n userId,\n onSubmitSuccess,\n onSubmitError,\n}) => {\n const VerifyEmailSchema = getVerifyEmailSchema();\n const { revalidateSession, user } = useUser();\n const { verifyEmail, doneButton } = useDictionary(content);\n const [isEmailVerified, setIsEmailVerified] = useState(false);\n const { form } = useForm(VerifyEmailSchema, {});\n\n const targetedUserId = useMemo(\n () => userId ?? user?._id,\n [userId, user?._id]\n );\n\n useEffect(() => {\n if (!targetedUserId) return;\n if (isEmailVerified) return;\n\n // EventSource alow to receive server-sent events from the server\n // In this case, we are listening to the email verification status\n const eventSource = new EventSource(\n intlayerAPI.auth.getVerifyEmailStatusURL(targetedUserId!)\n );\n\n eventSource.onmessage = async (event) => {\n const data = JSON.parse(event.data);\n\n if (data.status === 'verified') {\n // Update your UI to reflect the verification\n\n setIsEmailVerified(true);\n\n await revalidateSession();\n\n eventSource.close(); // Close the connection if no longer needed\n }\n };\n\n eventSource.onerror = (event) => {\n console.error(event);\n // Handle errors or reconnection logic\n eventSource.close();\n };\n\n return () => eventSource.close(); // Clean up on component unmount\n }, [revalidateSession, targetedUserId, userId, user?._id, isEmailVerified]);\n\n return (\n <Form\n schema={VerifyEmailSchema}\n autoComplete\n {...form}\n onSubmitSuccess={onSubmitSuccess}\n onSubmitError={onSubmitError}\n >\n <H3>{verifyEmail.title}</H3>\n <span className=\"text-neutral dark:text-neutral text-sm\">\n {verifyEmail.description}\n </span>\n <Loader isLoading={!isEmailVerified}>\n <div className=\"bg-success/30 dark:bg-success-dark/30 m-auto aspect-square rounded-full p-5\">\n <Check className=\"text-success dark:text-success-dark\" size={50} />\n </div>\n </Loader>\n <Button\n disabled={!isEmailVerified}\n label={doneButton.text.value}\n type=\"submit\"\n color=\"text\"\n >\n {doneButton.text}\n </Button>\n </Form>\n );\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AAY,aACf;AAAA,8CACC,QAAO,EAAA,WAAW,CAAC,iBAClB,gDAAC,OAAI,EAAA,WAAU,+EACb,UAAAA,kCAAA,IAAC,SAAM,WAAU,uCAAsC,MAAM,GAAA,CAAI,EACnE,CAAA,GACF;AAAA,QACAA,kCAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,UAAU,CAAC;AAAA,YACX,OAAO,WAAW,KAAK;AAAA,YACvB,MAAK;AAAA,YACL,OAAM;AAAA,YAEL,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":["'use client';\n\nimport { Locales } from '@intlayer/config/client';\nimport { ChevronRightIcon } from 'lucide-react';\nimport { Fragment, HTMLAttributes, type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":["'use client';\n\nimport { Locales } from '@intlayer/config/client';\nimport { ChevronRightIcon } from 'lucide-react';\nimport { Fragment, HTMLAttributes, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { cn } from '../../utils/cn';\nimport { Button, type ButtonProps } from '../Button';\nimport { Link, type LinkProps } from '../Link';\nimport { breadCrumbContent } from './breadcrumb.content';\n\ntype LinkLinkProps = {\n children: string;\n position: number;\n locale?: Locales;\n} & Omit<LinkProps, 'children' | 'label'>;\n\nconst LinkLink: FC<LinkLinkProps> = ({\n href,\n lang,\n children,\n onClick,\n color,\n position,\n locale,\n ...props\n}) => {\n const { linkLabel } = useDictionary(breadCrumbContent);\n\n return (\n <>\n <Link\n href={href}\n locale={locale}\n color={color}\n onClick={onClick}\n itemProp=\"item\"\n itemScope\n itemType=\"https://schema.org/WebPage\"\n {...props}\n label={`${linkLabel} ${children}`}\n itemID={href}\n >\n <span itemProp=\"name\">{children}</span>\n </Link>\n <meta itemProp=\"position\" content={position.toString()} />\n </>\n );\n};\n\ntype ButtonButtonProps = {\n children: string;\n position: number;\n} & Omit<ButtonProps, 'children' | 'label'>;\n\nconst ButtonLink: FC<ButtonButtonProps> = ({\n children: text,\n onClick,\n color,\n position,\n ...props\n}) => {\n const { linkLabel } = useDictionary(breadCrumbContent);\n\n return (\n <>\n <Button\n onClick={onClick}\n variant=\"link\"\n label={`${linkLabel} ${text}`}\n color={color}\n itemProp=\"item\"\n {...props}\n >\n <span itemProp=\"name\">{text}</span>\n </Button>\n <meta itemProp=\"position\" content={position.toString()} />\n </>\n );\n};\n\ntype SpanProps = {\n children: string;\n position: number;\n} & HTMLAttributes<HTMLSpanElement>;\n\nconst Span: FC<SpanProps> = ({ children, position, ...props }) => (\n <span itemProp=\"item\">\n <span itemProp=\"name\" {...props}>\n {children}\n </span>\n <meta itemProp=\"position\" content={position.toString()} />\n </span>\n);\n\ntype DetailedBreadcrumbLink = {\n href?: string;\n text: string;\n onClick?: () => void;\n};\nexport type BreadcrumbLink = string | DetailedBreadcrumbLink;\n\nexport type BreadcrumbProps = {\n links: BreadcrumbLink[];\n color?:\n | 'primary'\n | 'destructive'\n | 'neutral'\n | 'light'\n | 'dark'\n | 'text'\n | 'custom';\n locale?: Locales;\n elementType?: 'page' | 'location';\n} & HTMLAttributes<HTMLOListElement>;\n\nexport const Breadcrumb: FC<BreadcrumbProps> = ({\n links,\n className,\n color = 'text',\n locale,\n elementType = 'page',\n ...props\n}) => (\n <nav aria-label=\"breadcrumb\">\n <ol\n className={cn(\n 'flex flex-row flex-wrap items-center gap-2 text-sm',\n className\n )}\n itemScope\n itemType=\"http://schema.org/BreadcrumbList\"\n {...props}\n >\n {links.map((link, index) => {\n const isLastLink = index === links.length - 1;\n const isLink =\n typeof link === 'object' && typeof link.href === 'string';\n const isButton =\n typeof link === 'object' && typeof link.onClick === 'function';\n const isActive = index === links.length - 1;\n const ariaCurrent = isActive ? elementType : undefined;\n\n const text = (link as DetailedBreadcrumbLink).text ?? link;\n\n let section = (\n <Span key={text} position={index + 1} aria-current={ariaCurrent}>\n {text}\n </Span>\n );\n\n if (isLink) {\n section = (\n <LinkLink\n key={text}\n href={link.href!}\n color={color}\n position={index + 1}\n locale={locale}\n aria-current={ariaCurrent}\n >\n {text}\n </LinkLink>\n );\n } else if (isButton) {\n section = (\n <ButtonLink\n key={text}\n onClick={link.onClick!}\n color={color}\n position={index + 1}\n aria-current={ariaCurrent}\n >\n {text}\n </ButtonLink>\n );\n }\n\n const listElement = (\n <li\n itemProp=\"itemListElement\"\n itemScope\n itemType=\"https://schema.org/ListItem\"\n key={text}\n >\n {section}\n </li>\n );\n\n if (isLastLink) {\n return listElement;\n }\n\n return (\n <Fragment key={text}>\n {listElement}\n <ChevronRightIcon size={10} />\n </Fragment>\n );\n })}\n </ol>\n </nav>\n);\n"],"names":["useDictionary","breadCrumbContent","jsxs","Fragment","jsx","Link","Button","cn","ChevronRightIcon"],"mappings":";;;;;;;;;;;AAiBA,MAAM,WAA8B,CAAC;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,EAAE,UAAA,IAAcA,cAAA,cAAcC,0DAAiB;AAErD,SAEIC,2BAAA,kBAAA,KAAAC,uCAAA,EAAA,UAAA;AAAA,IAAAC,2BAAA,kBAAA;AAAA,MAACC,qBAAA;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAS;AAAA,QACT,WAAS;AAAA,QACT,UAAS;AAAA,QACR,GAAG;AAAA,QACJ,OAAO,GAAG,SAAS,IAAI,QAAQ;AAAA,QAC/B,QAAQ;AAAA,QAER,UAACD,2BAAA,kBAAA,IAAA,QAAA,EAAK,UAAS,QAAQ,SAAS,CAAA;AAAA,MAAA;AAAA,IAClC;AAAA,qDACC,QAAK,EAAA,UAAS,YAAW,SAAS,SA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|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumb/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,OAAO,EAAY,cAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumb/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,OAAO,EAAY,cAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AA2F1D,KAAK,sBAAsB,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AACF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,sBAAsB,CAAC;AAE7D,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,KAAK,CAAC,EACF,SAAS,GACT,aAAa,GACb,SAAS,GACT,OAAO,GACP,MAAM,GACN,MAAM,GACN,QAAQ,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;CACnC,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAC;AAErC,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAsF1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":["'use client';\n\nimport { Locales } from '@intlayer/config/client';\nimport { ChevronRightIcon } from 'lucide-react';\nimport { Fragment, HTMLAttributes, type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":["'use client';\n\nimport { Locales } from '@intlayer/config/client';\nimport { ChevronRightIcon } from 'lucide-react';\nimport { Fragment, HTMLAttributes, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { cn } from '../../utils/cn';\nimport { Button, type ButtonProps } from '../Button';\nimport { Link, type LinkProps } from '../Link';\nimport { breadCrumbContent } from './breadcrumb.content';\n\ntype LinkLinkProps = {\n children: string;\n position: number;\n locale?: Locales;\n} & Omit<LinkProps, 'children' | 'label'>;\n\nconst LinkLink: FC<LinkLinkProps> = ({\n href,\n lang,\n children,\n onClick,\n color,\n position,\n locale,\n ...props\n}) => {\n const { linkLabel } = useDictionary(breadCrumbContent);\n\n return (\n <>\n <Link\n href={href}\n locale={locale}\n color={color}\n onClick={onClick}\n itemProp=\"item\"\n itemScope\n itemType=\"https://schema.org/WebPage\"\n {...props}\n label={`${linkLabel} ${children}`}\n itemID={href}\n >\n <span itemProp=\"name\">{children}</span>\n </Link>\n <meta itemProp=\"position\" content={position.toString()} />\n </>\n );\n};\n\ntype ButtonButtonProps = {\n children: string;\n position: number;\n} & Omit<ButtonProps, 'children' | 'label'>;\n\nconst ButtonLink: FC<ButtonButtonProps> = ({\n children: text,\n onClick,\n color,\n position,\n ...props\n}) => {\n const { linkLabel } = useDictionary(breadCrumbContent);\n\n return (\n <>\n <Button\n onClick={onClick}\n variant=\"link\"\n label={`${linkLabel} ${text}`}\n color={color}\n itemProp=\"item\"\n {...props}\n >\n <span itemProp=\"name\">{text}</span>\n </Button>\n <meta itemProp=\"position\" content={position.toString()} />\n </>\n );\n};\n\ntype SpanProps = {\n children: string;\n position: number;\n} & HTMLAttributes<HTMLSpanElement>;\n\nconst Span: FC<SpanProps> = ({ children, position, ...props }) => (\n <span itemProp=\"item\">\n <span itemProp=\"name\" {...props}>\n {children}\n </span>\n <meta itemProp=\"position\" content={position.toString()} />\n </span>\n);\n\ntype DetailedBreadcrumbLink = {\n href?: string;\n text: string;\n onClick?: () => void;\n};\nexport type BreadcrumbLink = string | DetailedBreadcrumbLink;\n\nexport type BreadcrumbProps = {\n links: BreadcrumbLink[];\n color?:\n | 'primary'\n | 'destructive'\n | 'neutral'\n | 'light'\n | 'dark'\n | 'text'\n | 'custom';\n locale?: Locales;\n elementType?: 'page' | 'location';\n} & HTMLAttributes<HTMLOListElement>;\n\nexport const Breadcrumb: FC<BreadcrumbProps> = ({\n links,\n className,\n color = 'text',\n locale,\n elementType = 'page',\n ...props\n}) => (\n <nav aria-label=\"breadcrumb\">\n <ol\n className={cn(\n 'flex flex-row flex-wrap items-center gap-2 text-sm',\n className\n )}\n itemScope\n itemType=\"http://schema.org/BreadcrumbList\"\n {...props}\n >\n {links.map((link, index) => {\n const isLastLink = index === links.length - 1;\n const isLink =\n typeof link === 'object' && typeof link.href === 'string';\n const isButton =\n typeof link === 'object' && typeof link.onClick === 'function';\n const isActive = index === links.length - 1;\n const ariaCurrent = isActive ? elementType : undefined;\n\n const text = (link as DetailedBreadcrumbLink).text ?? link;\n\n let section = (\n <Span key={text} position={index + 1} aria-current={ariaCurrent}>\n {text}\n </Span>\n );\n\n if (isLink) {\n section = (\n <LinkLink\n key={text}\n href={link.href!}\n color={color}\n position={index + 1}\n locale={locale}\n aria-current={ariaCurrent}\n >\n {text}\n </LinkLink>\n );\n } else if (isButton) {\n section = (\n <ButtonLink\n key={text}\n onClick={link.onClick!}\n color={color}\n position={index + 1}\n aria-current={ariaCurrent}\n >\n {text}\n </ButtonLink>\n );\n }\n\n const listElement = (\n <li\n itemProp=\"itemListElement\"\n itemScope\n itemType=\"https://schema.org/ListItem\"\n key={text}\n >\n {section}\n </li>\n );\n\n if (isLastLink) {\n return listElement;\n }\n\n return (\n <Fragment key={text}>\n {listElement}\n <ChevronRightIcon size={10} />\n </Fragment>\n );\n })}\n </ol>\n </nav>\n);\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;AAiBA,MAAM,WAA8B,CAAC;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA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CAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,WAAS;AAAA,UACT,UAAS;AAAA,UAGR,UAAA;AAAA,QAAA;AAAA,QAFI;AAAA,MAGP;AAGF,UAAI,YAAY;AACP,eAAA;AAAA,MAAA;AAIP,aAAAF,kCAAA,KAACC,UAAA,EACE,UAAA;AAAA,QAAA;AAAA,QACDC,kCAAAA,IAAC,kBAAiB,EAAA,MAAM,GAAI,CAAA;AAAA,MAAA,EAAA,GAFf,IAGf;AAAA,IAEH,CAAA;AAAA,EAAA;AACH,EACF,CAAA;"}
|
|
@@ -71,7 +71,7 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
|
|
|
71
71
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
72
72
|
{
|
|
73
73
|
type: "button",
|
|
74
|
-
label: resetButton.label,
|
|
74
|
+
label: resetButton.label.value,
|
|
75
75
|
disabled: !isEdited || isSubmitting,
|
|
76
76
|
className: "ml-auto",
|
|
77
77
|
Icon: lucideReact.RotateCcw,
|
|
@@ -87,7 +87,7 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
|
|
|
87
87
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
88
88
|
{
|
|
89
89
|
type: "submit",
|
|
90
|
-
label: publishButton.label,
|
|
90
|
+
label: publishButton.label.value,
|
|
91
91
|
disabled: !isEdited || isSubmitting,
|
|
92
92
|
Icon: lucideReact.ArrowUpFromLine,
|
|
93
93
|
color: "text",
|
|
@@ -99,7 +99,7 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
|
|
|
99
99
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
100
100
|
{
|
|
101
101
|
type: "submit",
|
|
102
|
-
label: saveButton.label,
|
|
102
|
+
label: saveButton.label.value,
|
|
103
103
|
disabled: !isEdited || isSubmitting,
|
|
104
104
|
Icon: lucideReact.Save,
|
|
105
105
|
color: "text",
|
|
@@ -111,7 +111,7 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
|
|
|
111
111
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
112
112
|
{
|
|
113
113
|
type: "submit",
|
|
114
|
-
label: downloadButton.label,
|
|
114
|
+
label: downloadButton.label.value,
|
|
115
115
|
disabled: !isEdited || isSubmitting,
|
|
116
116
|
Icon: lucideReact.Download,
|
|
117
117
|
color: "text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidDictionaryChangeButtons.cjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { ArrowUpFromLine, Download, RotateCcw, Save } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"ValidDictionaryChangeButtons.cjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { ArrowUpFromLine, Download, RotateCcw, Save } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries, useWriteDictionary } from '../../hooks';\nimport { Form, useForm } from '../Form';\nimport { validDictionaryChangeButtonsContent } from './validDictionaryChangeButtons.content';\nimport { getValidDictionaryChangeButtonsSchemaSchema } from './validDictionaryChangeButtonsSchema';\n\ntype ValidDictionaryChangeButtonsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const ValidDictionaryChangeButtons: FC<\n ValidDictionaryChangeButtonsProps\n> = ({ dictionary, mode }) => {\n const ValidDictionaryChangeButtonsSchemaSchema =\n getValidDictionaryChangeButtonsSchemaSchema();\n\n const { resetButton, saveButton, publishButton, downloadButton } =\n useDictionary(validDictionaryChangeButtonsContent);\n\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { writeDictionary } = useWriteDictionary();\n const { pushDictionaries } = usePushDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const { form, isSubmitting } = useForm(\n ValidDictionaryChangeButtonsSchemaSchema\n );\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(dictionary?.content),\n [editedDictionary, dictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n if (mode === 'remote') {\n await pushDictionaries([updatedDictionary]);\n } else {\n await writeDictionary(updatedDictionary);\n }\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }, [\n dictionary,\n editedContent,\n pushDictionaries,\n setLocaleDictionary,\n writeDictionary,\n restoreEditedContent,\n mode,\n ]);\n\n return (\n <div className=\"mb-4\">\n <Form\n className=\"flex w-full flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={ValidDictionaryChangeButtonsSchemaSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label.value}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </Form>\n </div>\n );\n};\n"],"names":["getValidDictionaryChangeButtonsSchemaSchema","useDictionary","validDictionaryChangeButtonsContent","useDictionariesRecordActions","useWriteDictionary","usePushDictionaries","useEditedContent","useForm","useMemo","useCallback","jsx","jsxs","Form","RotateCcw","ArrowUpFromLine","Save","Download"],"mappings":";;;;;;;;;;;;;;;;;AAqBO,MAAM,+BAET,CAAC,EAAE,YAAY,WAAW;AAC5B,QAAM,2CACJA,+DAAAA,4CAA4C;AAE9C,QAAM,EAAE,aAAa,YAAY,eAAe,eAAe,IAC7DC,4BAAcC,oGAAmC;AAE7C,QAAA,EAAE,oBAAoB,IAAIC,yCAA6B;AACvD,QAAA,EAAE,gBAAgB,IAAIC,0CAAmB;AACzC,QAAA,EAAE,iBAAiB,IAAIC,2CAAoB;AAEjD,QAAM,EAAE,eAAe,qBAAqB,IAAIC,6BAAiB;AAC3D,QAAA,EAAE,MAAM,aAAA,IAAiBC,yBAAA;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,mBAAmBC,WAAA;AAAA,IACvB,MAAM,gBAAgB,WAAW,GAAG;AAAA,IACpC,CAAC,eAAe,WAAW,GAAG;AAAA,EAChC;AAEA,QAAM,WAAWA,WAAA;AAAA,IACf,MACE,oBACA,KAAK,UAAU,kBAAkB,OA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A,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc,MAAM;AAAA,YAC3B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAME,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEJ,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMG,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA,IAKlBL,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,eAAe,MAAM;AAAA,YAC5B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMI,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAe,eAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidDictionaryChangeButtons.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ValidDictionaryChangeButtons.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAOtD,KAAK,iCAAiC,GAAG;IACvC,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAC3C,iCAAiC,CAgIlC,CAAC"}
|