@intlayer/design-system 4.0.3 → 4.0.5
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 +34 -43
- package/dist/components/Auth/AuthModal/index.cjs +1 -1
- package/dist/components/Auth/AuthModal/index.mjs +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +2 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +2 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
- package/dist/components/Auth/useAuth/index.cjs +8 -4
- package/dist/components/Auth/useAuth/index.cjs.map +1 -1
- package/dist/components/Auth/useAuth/index.d.ts +3 -1
- package/dist/components/Auth/useAuth/index.d.ts.map +1 -1
- package/dist/components/Auth/useAuth/index.mjs +8 -4
- package/dist/components/Auth/useAuth/index.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.cjs +6 -3
- package/dist/components/Auth/useAuth/useCSRF.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.d.ts +2 -1
- package/dist/components/Auth/useAuth/useCSRF.d.ts.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.mjs +5 -2
- package/dist/components/Auth/useAuth/useCSRF.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.cjs +6 -5
- package/dist/components/Auth/useAuth/useOAuth2.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.d.ts +2 -1
- package/dist/components/Auth/useAuth/useOAuth2.d.ts.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.mjs +5 -4
- package/dist/components/Auth/useAuth/useOAuth2.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useSession.cjs +6 -3
- package/dist/components/Auth/useAuth/useSession.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useSession.d.ts +2 -1
- package/dist/components/Auth/useAuth/useSession.d.ts.map +1 -1
- package/dist/components/Auth/useAuth/useSession.mjs +6 -3
- package/dist/components/Auth/useAuth/useSession.mjs.map +1 -1
- package/dist/components/Auth/useUser/index.cjs +1 -1
- package/dist/components/Auth/useUser/index.mjs +1 -1
- package/dist/components/Button/Button.cjs +9 -9
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.mjs +9 -9
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Container/index.d.ts +2 -2
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs +5 -4
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.d.ts +1 -0
- package/dist/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs +5 -4
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.cjs +2 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.cjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs +2 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.cjs +2 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.cjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs +2 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs +3 -3
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/index.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +29 -12
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts +1 -0
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +31 -14
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs +32 -0
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts +4 -0
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs +32 -0
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +5 -3
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +5 -3
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +4 -2
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +4 -2
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +45 -14
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +48 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +32 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +4 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +32 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +7 -15
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +8 -16
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +8 -5
- 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 +7 -4
- 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/JSONEditor.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +6 -5
- 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 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.cjs +1 -9
- package/dist/components/DictionaryFieldEditor/NodeEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.mjs +2 -10
- package/dist/components/DictionaryFieldEditor/NodeEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +2 -1
- 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 +2 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +51 -22
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +52 -23
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +32 -0
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +4 -0
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +32 -0
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +2 -2
- package/dist/components/EditableField/EditableFieldLayout.cjs +8 -4
- package/dist/components/EditableField/EditableFieldLayout.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldLayout.d.ts.map +1 -1
- package/dist/components/EditableField/EditableFieldLayout.mjs +8 -4
- package/dist/components/EditableField/EditableFieldLayout.mjs.map +1 -1
- package/dist/components/IDE/CodeContext.cjs +2 -2
- package/dist/components/IDE/CodeContext.mjs +2 -2
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +4 -4
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +4 -4
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +2 -2
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +2 -2
- package/dist/components/Modal/Modal.cjs +11 -7
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.mjs +11 -7
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs +2 -2
- package/dist/components/Navbar/MobileNavbar.mjs +2 -2
- package/dist/components/Navbar/index.cjs +2 -2
- package/dist/components/Navbar/index.mjs +2 -2
- package/dist/components/RightDrawer/RightDrawer.cjs +32 -15
- package/dist/components/RightDrawer/RightDrawer.cjs.map +1 -1
- package/dist/components/RightDrawer/RightDrawer.d.ts.map +1 -1
- package/dist/components/RightDrawer/RightDrawer.mjs +32 -15
- package/dist/components/RightDrawer/RightDrawer.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs +2 -2
- package/dist/components/SwitchSelector/index.mjs +2 -2
- package/dist/components/TabSelector/TabSelector.cjs +2 -2
- package/dist/components/TabSelector/TabSelector.mjs +2 -2
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +3 -2
- package/dist/hooks/intlayerAPIHooks.cjs +15 -1
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +53 -49
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +16 -2
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.cjs +14 -0
- package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsync.mjs +14 -0
- package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.cjs +3 -2
- package/dist/hooks/useGetAllDictionaries.cjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.d.ts +2 -2
- package/dist/hooks/useGetAllDictionaries.d.ts.map +1 -1
- package/dist/hooks/useGetAllDictionaries.mjs +3 -2
- package/dist/hooks/useGetAllDictionaries.mjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.cjs +10 -7
- package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.d.ts +11 -2
- package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
- package/dist/hooks/useIntlayerAPI.mjs +10 -7
- package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
- package/dist/hooks/usePersistedStore.cjs +25 -18
- package/dist/hooks/usePersistedStore.cjs.map +1 -1
- package/dist/hooks/usePersistedStore.d.ts +2 -2
- package/dist/hooks/usePersistedStore.d.ts.map +1 -1
- package/dist/hooks/usePersistedStore.mjs +26 -19
- package/dist/hooks/usePersistedStore.mjs.map +1 -1
- package/dist/index-B-VAyQ9R.js +673 -0
- package/dist/index-B-VAyQ9R.js.map +1 -0
- package/dist/index-B-adg6xa.js +206 -0
- package/dist/index-B-adg6xa.js.map +1 -0
- package/dist/index-B1nU1-65.cjs +690 -0
- package/dist/index-B1nU1-65.cjs.map +1 -0
- package/dist/index-BIV0x_z2.js +206 -0
- package/dist/index-BIV0x_z2.js.map +1 -0
- package/dist/index-BIyA5LAs.js +691 -0
- package/dist/index-BIyA5LAs.js.map +1 -0
- package/dist/index-BNH9wXVj.cjs +205 -0
- package/dist/index-BNH9wXVj.cjs.map +1 -0
- package/dist/index-BqZwP4Lr.js +691 -0
- package/dist/index-BqZwP4Lr.js.map +1 -0
- package/dist/index-Buecpjbh.cjs +690 -0
- package/dist/index-Buecpjbh.cjs.map +1 -0
- package/dist/index-CDEJjmId.js +694 -0
- package/dist/index-CDEJjmId.js.map +1 -0
- package/dist/index-CTAyk6RY.cjs +693 -0
- package/dist/index-CTAyk6RY.cjs.map +1 -0
- package/dist/index-CVC2sfEj.js +693 -0
- package/dist/index-CVC2sfEj.js.map +1 -0
- package/dist/index-CVz0RdK6.js +691 -0
- package/dist/index-CVz0RdK6.js.map +1 -0
- package/dist/index-CjF2ksU7.cjs +693 -0
- package/dist/index-CjF2ksU7.cjs.map +1 -0
- package/dist/index-CuQs5759.cjs +692 -0
- package/dist/index-CuQs5759.cjs.map +1 -0
- package/dist/index-D69JRZcQ.js +206 -0
- package/dist/index-D69JRZcQ.js.map +1 -0
- package/dist/index-DAsui9u9.cjs +205 -0
- package/dist/index-DAsui9u9.cjs.map +1 -0
- package/dist/index-D_MDocy7.cjs +690 -0
- package/dist/index-D_MDocy7.cjs.map +1 -0
- package/dist/index-Djo2Jnua.cjs +693 -0
- package/dist/index-Djo2Jnua.cjs.map +1 -0
- package/dist/index-LFTthFne.js +694 -0
- package/dist/index-LFTthFne.js.map +1 -0
- package/dist/index-SOIahRpS.cjs +205 -0
- package/dist/index-SOIahRpS.cjs.map +1 -0
- package/dist/index-T-TjVQoD.js +671 -0
- package/dist/index-T-TjVQoD.js.map +1 -0
- package/dist/index-f8_VC6c8.cjs +672 -0
- package/dist/index-f8_VC6c8.cjs.map +1 -0
- package/dist/index-llGIfxqV.cjs +670 -0
- package/dist/index-llGIfxqV.cjs.map +1 -0
- package/dist/index-xZoGTokf.js +694 -0
- package/dist/index-xZoGTokf.js.map +1 -0
- package/dist/tailwind.config.cjs.map +1 -1
- package/dist/tailwind.config.mjs.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/useGetAllDictionaries-B1sqs2IB.cjs +34 -0
- package/dist/useGetAllDictionaries-B1sqs2IB.cjs.map +1 -0
- package/dist/useGetAllDictionaries-BbH8vTkY.js +35 -0
- package/dist/useGetAllDictionaries-BbH8vTkY.js.map +1 -0
- package/dist/useGetAllDictionaries-Bgkytpa2.cjs +34 -0
- package/dist/useGetAllDictionaries-Bgkytpa2.cjs.map +1 -0
- package/dist/useGetAllDictionaries-D8ma3h41.cjs +33 -0
- package/dist/useGetAllDictionaries-D8ma3h41.cjs.map +1 -0
- package/dist/useGetAllDictionaries-DHgHEbD5.js +34 -0
- package/dist/useGetAllDictionaries-DHgHEbD5.js.map +1 -0
- package/dist/useGetAllDictionaries-DUzm0rIa.js +35 -0
- package/dist/useGetAllDictionaries-DUzm0rIa.js.map +1 -0
- package/package.json +21 -16
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { getIntlayerAPI } from "@intlayer/api";
|
|
2
3
|
import { getConfiguration } from "@intlayer/config/client";
|
|
3
|
-
import { i as intlayerAPI } from "../../../index-DcWYZrJW.js";
|
|
4
4
|
import { useAsync } from "../../../hooks/useAsync/useAsync.mjs";
|
|
5
|
-
const useOAuth2 = (csrfToken) => {
|
|
6
|
-
const
|
|
5
|
+
const useOAuth2 = (csrfToken, intlayerConfiguration) => {
|
|
6
|
+
const config = intlayerConfiguration ?? getConfiguration();
|
|
7
|
+
const intlayerAPI = getIntlayerAPI(void 0, config);
|
|
7
8
|
const { data } = useAsync(
|
|
8
9
|
"getOAuth2AccessToken",
|
|
9
10
|
() => intlayerAPI.auth.getOAuth2AccessToken({
|
|
@@ -12,7 +13,7 @@ const useOAuth2 = (csrfToken) => {
|
|
|
12
13
|
{
|
|
13
14
|
cache: true,
|
|
14
15
|
autoFetch: true,
|
|
15
|
-
enable: !!(clientId && clientSecret && csrfToken)
|
|
16
|
+
enable: !!(config.editor.clientId && config.editor.clientSecret && csrfToken)
|
|
16
17
|
}
|
|
17
18
|
);
|
|
18
19
|
const oAuth2AccessToken = data?.data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOAuth2.mjs","sources":["../../../../src/components/Auth/useAuth/useOAuth2.ts"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"useOAuth2.mjs","sources":["../../../../src/components/Auth/useAuth/useOAuth2.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport { useAsync } from '../../../hooks/useAsync/useAsync';\n\nexport const useOAuth2 = (\n csrfToken: string | null | undefined,\n intlayerConfiguration?: IntlayerConfig\n) => {\n const config = intlayerConfiguration ?? getConfiguration();\n const intlayerAPI = getIntlayerAPI(undefined, config);\n\n const { data } = useAsync(\n 'getOAuth2AccessToken',\n () =>\n intlayerAPI.auth.getOAuth2AccessToken({\n body: { csrf_token: csrfToken },\n }),\n {\n cache: true,\n autoFetch: true,\n enable: !!(\n config.editor.clientId &&\n config.editor.clientSecret &&\n csrfToken\n ),\n }\n );\n\n const oAuth2AccessToken = data?.data;\n\n return {\n oAuth2AccessToken,\n };\n};\n"],"names":[],"mappings":";;;;AAMa,MAAA,YAAY,CACvB,WACA,0BACG;AACG,QAAA,SAAS,yBAAyB,iBAAiB;AACnD,QAAA,cAAc,eAAe,QAAW,MAAM;AAE9C,QAAA,EAAE,SAAS;AAAA,IACf;AAAA,IACA,MACE,YAAY,KAAK,qBAAqB;AAAA,MACpC,MAAM,EAAE,YAAY,UAAU;AAAA,IAAA,CAC/B;AAAA,IACH;AAAA,MACE,OAAO;AAAA,MACP,WAAW;AAAA,MACX,QAAQ,CAAC,EACP,OAAO,OAAO,YACd,OAAO,OAAO,gBACd;AAAA,IAAA;AAAA,EAGN;AAEA,QAAM,oBAAoB,MAAM;AAEzB,SAAA;AAAA,IACL;AAAA,EACF;AACF;"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const api = require("@intlayer/api");
|
|
5
|
+
const client = require("@intlayer/config/client");
|
|
4
6
|
const require$$0 = require("react");
|
|
5
|
-
const index = require("../../../index-DFc7og1d.cjs");
|
|
6
7
|
const hooks_useAsync_useAsync = require("../../../hooks/useAsync/useAsync.cjs");
|
|
7
8
|
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
8
|
-
const useSession = (sessionProp) => {
|
|
9
|
+
const useSession = (sessionProp, intlayerConfiguration) => {
|
|
10
|
+
const config = intlayerConfiguration ?? client.getConfiguration();
|
|
11
|
+
const intlayerAPI = api.getIntlayerAPI(void 0, config);
|
|
9
12
|
const {
|
|
10
13
|
getSession,
|
|
11
14
|
revalidate,
|
|
@@ -16,7 +19,7 @@ const useSession = (sessionProp) => {
|
|
|
16
19
|
"getSession",
|
|
17
20
|
async () => {
|
|
18
21
|
try {
|
|
19
|
-
const result = await
|
|
22
|
+
const result = await intlayerAPI.auth.getSession();
|
|
20
23
|
if (result.data) {
|
|
21
24
|
const { user, organization, project } = result.data;
|
|
22
25
|
const formattedSession = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSession.cjs","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"useSession.cjs","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport { getConfiguration, IntlayerConfig } from '@intlayer/config/client';\nimport { useMemo } from 'react';\nimport { useAsync } from '../../../hooks/useAsync';\nimport type { Session } from './index';\n\nexport const useSession = (\n sessionProp?: Session | null,\n intlayerConfiguration?: IntlayerConfig\n) => {\n const config = intlayerConfiguration ?? getConfiguration();\n const intlayerAPI = getIntlayerAPI(undefined, config);\n\n const {\n getSession,\n revalidate,\n data,\n setData: setSession,\n isFetched,\n } = useAsync(\n 'getSession',\n async () => {\n try {\n const result = await intlayerAPI.auth.getSession();\n\n if (result.data) {\n const { user, organization, project } = result.data;\n\n const formattedSession: Session = {\n user,\n organization,\n isOrganizationAdmin:\n (user && (organization?.adminsIds ?? []).includes(user._id!)) ??\n false,\n project,\n isProjectAdmin:\n (user && (project?.adminsIds ?? []).includes(user._id!)) ?? false,\n };\n\n return formattedSession;\n }\n } catch (_error) {\n console.error(_error);\n // Failed to fetch session\n }\n\n return null;\n },\n {\n cache: true,\n store: true,\n autoFetch: true,\n enable: !sessionProp,\n invalidateQueries: [\n 'getOrganizations',\n 'getProjects',\n 'getUsers',\n 'getDictionaries',\n ],\n }\n );\n\n const session = useMemo(\n () => data ?? (isFetched ? null : undefined),\n [data, isFetched]\n );\n\n return {\n session,\n fetchSession: getSession,\n revalidateSession: revalidate,\n setSession,\n };\n};\n"],"names":["getConfiguration","getIntlayerAPI","useAsync","useMemo"],"mappings":";;;;;;;;AAQa,MAAA,aAAa,CACxB,aACA,0BACG;AACG,QAAA,SAAS,yBAAyBA,wBAAiB;AACnD,QAAA,cAAcC,IAAAA,eAAe,QAAW,MAAM;AAE9C,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,EAAA,IACEC,wBAAA;AAAA,IACF;AAAA,IACA,YAAY;AACN,UAAA;AACF,cAAM,SAAS,MAAM,YAAY,KAAK,WAAW;AAEjD,YAAI,OAAO,MAAM;AACf,gBAAM,EAAE,MAAM,cAAc,YAAY,OAAO;AAE/C,gBAAM,mBAA4B;AAAA,YAChC;AAAA,YACA;AAAA,YACA,sBACG,SAAS,cAAc,aAAa,CAAI,GAAA,SAAS,KAAK,GAAI,MAC3D;AAAA,YACF;AAAA,YACA,iBACG,SAAS,SAAS,aAAa,CAAA,GAAI,SAAS,KAAK,GAAI,MAAM;AAAA,UAChE;AAEO,iBAAA;AAAA,QAAA;AAAA,eAEF,QAAQ;AACf,gBAAQ,MAAM,MAAM;AAAA,MAAA;AAIf,aAAA;AAAA,IACT;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,WAAW;AAAA,MACX,QAAQ,CAAC;AAAA,MACT,mBAAmB;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ;AAEA,QAAM,UAAUC,WAAA;AAAA,IACd,MAAM,SAAS,YAAY,OAAO;AAAA,IAClC,CAAC,MAAM,SAAS;AAAA,EAClB;AAEO,SAAA;AAAA,IACL;AAAA,IACA,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB;AAAA,EACF;AACF;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { IntlayerConfig } from '@intlayer/config/client';
|
|
1
2
|
import { Session } from './index';
|
|
2
|
-
export declare const useSession: (sessionProp?: Session | null) => {
|
|
3
|
+
export declare const useSession: (sessionProp?: Session | null, intlayerConfiguration?: IntlayerConfig) => {
|
|
3
4
|
session: Session | null | undefined;
|
|
4
5
|
fetchSession: () => Promise<Session | null>;
|
|
5
6
|
revalidateSession: () => Promise<Session | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSession.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSession.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,eAAO,MAAM,UAAU,iBACP,OAAO,GAAG,IAAI,0BACJ,cAAc;;;;;CAiEvC,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { getIntlayerAPI } from "@intlayer/api";
|
|
3
|
+
import { getConfiguration } from "@intlayer/config/client";
|
|
2
4
|
import { useMemo } from "react";
|
|
3
|
-
import { g as getIntlayerAPI } from "../../../index-DcWYZrJW.js";
|
|
4
5
|
import { useAsync } from "../../../hooks/useAsync/useAsync.mjs";
|
|
5
6
|
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
6
|
-
const useSession = (sessionProp) => {
|
|
7
|
+
const useSession = (sessionProp, intlayerConfiguration) => {
|
|
8
|
+
const config = intlayerConfiguration ?? getConfiguration();
|
|
9
|
+
const intlayerAPI = getIntlayerAPI(void 0, config);
|
|
7
10
|
const {
|
|
8
11
|
getSession,
|
|
9
12
|
revalidate,
|
|
@@ -14,7 +17,7 @@ const useSession = (sessionProp) => {
|
|
|
14
17
|
"getSession",
|
|
15
18
|
async () => {
|
|
16
19
|
try {
|
|
17
|
-
const result = await
|
|
20
|
+
const result = await intlayerAPI.auth.getSession();
|
|
18
21
|
if (result.data) {
|
|
19
22
|
const { user, organization, project } = result.data;
|
|
20
23
|
const formattedSession = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSession.mjs","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"useSession.mjs","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport { getConfiguration, IntlayerConfig } from '@intlayer/config/client';\nimport { useMemo } from 'react';\nimport { useAsync } from '../../../hooks/useAsync';\nimport type { Session } from './index';\n\nexport const useSession = (\n sessionProp?: Session | null,\n intlayerConfiguration?: IntlayerConfig\n) => {\n const config = intlayerConfiguration ?? getConfiguration();\n const intlayerAPI = getIntlayerAPI(undefined, config);\n\n const {\n getSession,\n revalidate,\n data,\n setData: setSession,\n isFetched,\n } = useAsync(\n 'getSession',\n async () => {\n try {\n const result = await intlayerAPI.auth.getSession();\n\n if (result.data) {\n const { user, organization, project } = result.data;\n\n const formattedSession: Session = {\n user,\n organization,\n isOrganizationAdmin:\n (user && (organization?.adminsIds ?? []).includes(user._id!)) ??\n false,\n project,\n isProjectAdmin:\n (user && (project?.adminsIds ?? []).includes(user._id!)) ?? false,\n };\n\n return formattedSession;\n }\n } catch (_error) {\n console.error(_error);\n // Failed to fetch session\n }\n\n return null;\n },\n {\n cache: true,\n store: true,\n autoFetch: true,\n enable: !sessionProp,\n invalidateQueries: [\n 'getOrganizations',\n 'getProjects',\n 'getUsers',\n 'getDictionaries',\n ],\n }\n );\n\n const session = useMemo(\n () => data ?? (isFetched ? null : undefined),\n [data, isFetched]\n );\n\n return {\n session,\n fetchSession: getSession,\n revalidateSession: revalidate,\n setSession,\n };\n};\n"],"names":[],"mappings":";;;;;;AAQa,MAAA,aAAa,CACxB,aACA,0BACG;AACG,QAAA,SAAS,yBAAyB,iBAAiB;AACnD,QAAA,cAAc,eAAe,QAAW,MAAM;AAE9C,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,EAAA,IACE;AAAA,IACF;AAAA,IACA,YAAY;AACN,UAAA;AACF,cAAM,SAAS,MAAM,YAAY,KAAK,WAAW;AAEjD,YAAI,OAAO,MAAM;AACf,gBAAM,EAAE,MAAM,cAAc,YAAY,OAAO;AAE/C,gBAAM,mBAA4B;AAAA,YAChC;AAAA,YACA;AAAA,YACA,sBACG,SAAS,cAAc,aAAa,CAAI,GAAA,SAAS,KAAK,GAAI,MAC3D;AAAA,YACF;AAAA,YACA,iBACG,SAAS,SAAS,aAAa,CAAA,GAAI,SAAS,KAAK,GAAI,MAAM;AAAA,UAChE;AAEO,iBAAA;AAAA,QAAA;AAAA,eAEF,QAAQ;AACf,gBAAQ,MAAM,MAAM;AAAA,MAAA;AAIf,aAAA;AAAA,IACT;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,WAAW;AAAA,MACX,QAAQ,CAAC;AAAA,MACT,mBAAmB;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ;AAEA,QAAM,UAAU;AAAA,IACd,MAAM,SAAS,YAAY,OAAO;AAAA,IAClC,CAAC,MAAM,SAAS;AAAA,EAClB;AAEO,SAAA;AAAA,IACL;AAAA,IACA,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB;AAAA,EACF;AACF;"}
|
|
@@ -5,7 +5,7 @@ require("react");
|
|
|
5
5
|
require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
6
6
|
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
7
7
|
const hooks_intlayerAPIHooks = require("../../../hooks/intlayerAPIHooks.cjs");
|
|
8
|
-
require("@intlayer/
|
|
8
|
+
require("@intlayer/editor-react");
|
|
9
9
|
require("deepmerge");
|
|
10
10
|
const components_Auth_useAuth_index = require("../useAuth/index.cjs");
|
|
11
11
|
const useUser = () => {
|
|
@@ -3,7 +3,7 @@ import "react";
|
|
|
3
3
|
import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
4
4
|
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
5
5
|
import { useLogout } from "../../../hooks/intlayerAPIHooks.mjs";
|
|
6
|
-
import "@intlayer/
|
|
6
|
+
import "@intlayer/editor-react";
|
|
7
7
|
import "deepmerge";
|
|
8
8
|
import { useAuth } from "../useAuth/index.mjs";
|
|
9
9
|
const useUser = () => {
|
|
@@ -11,10 +11,10 @@ const buttonIconVariants = classVarianceAuthority.cva("", {
|
|
|
11
11
|
md: "size-4 absolute top-1/2 -translate-y-1/2",
|
|
12
12
|
lg: "size-5 absolute top-1/2 -translate-y-1/2",
|
|
13
13
|
xl: "size-6 absolute top-1/2 -translate-y-1/2",
|
|
14
|
-
"icon-sm": "size-
|
|
15
|
-
"icon-md": "size-
|
|
16
|
-
"icon-lg": "size-
|
|
17
|
-
"icon-xl": "size-
|
|
14
|
+
"icon-sm": "size-3",
|
|
15
|
+
"icon-md": "size-4",
|
|
16
|
+
"icon-lg": "size-5",
|
|
17
|
+
"icon-xl": "size-6"
|
|
18
18
|
},
|
|
19
19
|
position: {
|
|
20
20
|
left: "left-3",
|
|
@@ -34,10 +34,10 @@ const buttonVariants = classVarianceAuthority.cva(
|
|
|
34
34
|
md: "min-h-8 px-6 max-md:py-2 text-sm",
|
|
35
35
|
lg: "min-h-10 px-8 max-md:py-3 text-base",
|
|
36
36
|
xl: "min-h-11 px-10 max-md:py-4 text-lg",
|
|
37
|
-
"icon-sm": "p-
|
|
38
|
-
"icon-md": "p-1",
|
|
39
|
-
"icon-lg": "p-
|
|
40
|
-
"icon-xl": "p-
|
|
37
|
+
"icon-sm": "p-1",
|
|
38
|
+
"icon-md": "p-1.5",
|
|
39
|
+
"icon-lg": "p-2",
|
|
40
|
+
"icon-xl": "p-3"
|
|
41
41
|
},
|
|
42
42
|
variant: {
|
|
43
43
|
default: "rounded-lg text-text-opposite dark:text-text-opposite-dark",
|
|
@@ -80,7 +80,7 @@ const buttonVariants = classVarianceAuthority.cva(
|
|
|
80
80
|
false: ""
|
|
81
81
|
},
|
|
82
82
|
hasIconRight: {
|
|
83
|
-
true: "pr-
|
|
83
|
+
true: "pr-8",
|
|
84
84
|
false: ""
|
|
85
85
|
}
|
|
86
86
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { LucideIcon } from 'lucide-react';\nimport {\n forwardRef,\n type ButtonHTMLAttributes,\n type DetailedHTMLProps,\n type FC,\n} from 'react';\nimport { Loader } from '../Loader';\n\nconst buttonIconVariants = cva('', {\n variants: {\n size: {\n sm: 'size-3 absolute top-1/2 -translate-y-1/2',\n md: 'size-4 absolute top-1/2 -translate-y-1/2',\n lg: 'size-5 absolute top-1/2 -translate-y-1/2',\n xl: 'size-6 absolute top-1/2 -translate-y-1/2',\n 'icon-sm': 'size-6 p-1',\n 'icon-md': 'size-7 p-1',\n 'icon-lg': 'size-9 p-1',\n 'icon-xl': 'size-10 p-1',\n },\n position: {\n left: 'left-3',\n right: 'right-3',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nconst buttonVariants = cva(\n 'relative truncate whitespace-nowrap font-medium transition focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n size: {\n sm: 'min-h-7 px-3 max-md:py-1 text-xs',\n md: 'min-h-8 px-6 max-md:py-2 text-sm',\n lg: 'min-h-10 px-8 max-md:py-3 text-base',\n xl: 'min-h-11 px-10 max-md:py-4 text-lg',\n 'icon-sm': 'p-0.5',\n 'icon-md': 'p-1',\n 'icon-lg': 'p-1.5',\n 'icon-xl': 'p-2',\n },\n variant: {\n default: 'rounded-lg text-text-opposite dark:text-text-opposite-dark',\n none: 'border-none bg-opacity-0 text-inherit hover:bg-opacity-0 dark:bg-opacity-0 dark:text-inherit dark:hover:bg-opacity-0',\n outline:\n 'rounded-lg border-[1.5px] bg-opacity-0 hover:bg-opacity-30 dark:bg-opacity-0',\n link: 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent hover:underline dark:bg-transparent hover:dark:bg-transparent',\n 'invisible-link':\n 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent dark:bg-transparent hover:dark:bg-transparent',\n hoverable:\n 'rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10 aria-[current]:bg-opacity-5 dark:border-none dark:bg-opacity-0 dark:hover:bg-opacity-10',\n input: [\n 'w-full select-text resize-none rounded-xl border-2 bg-input-background text-sm text-input-text shadow-none outline-0 transition-all dark:bg-input-background-dark dark:text-input-text-dark',\n 'border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none] dark:border-input-border-dark dark:hover:border-input-border-hover-dark dark:focus:border-input-border-focus',\n 'aria-[invalid=true]:border-error dark:aria-[invalid=true]:border-error-dark',\n 'disabled:opacity-50',\n ],\n },\n color: {\n primary:\n 'border-primary bg-primary text-primary hover:bg-primary-500 dark:border-primary-dark dark:bg-primary-dark dark:text-primary-dark hover:dark:bg-primary-300',\n secondary:\n 'border-secondary bg-secondary text-secondary hover:bg-secondary-300 dark:border-secondary-dark dark:bg-secondary-dark dark:text-secondary-dark hover:dark:bg-secondary-100',\n destructive:\n 'border-destructive bg-destructive text-destructive hover:bg-destructive-500 dark:border-destructive-dark dark:bg-destructive-dark hover:dark:bg-destructive-200',\n neutral:\n 'border-neutral bg-neutral text-neutral hover:bg-neutral-600 dark:border-neutral-dark dark:bg-neutral-dark dark:text-neutral-dark hover:dark:bg-neutral-400',\n light: 'border-white bg-white text-white hover:bg-neutral-500',\n dark: 'border-neutral-800 bg-neutral-800 text-neutral-800 hover:bg-neutral-900 dark:hover:bg-neutral-700',\n text: 'border-text bg-text text-text hover:opacity-80 dark:border-text-dark dark:bg-text-dark dark:text-text-dark',\n 'text-inverse':\n 'border-text-dark dark:border-text bg-text-dark dark:bg-text text-text-dark dark:text-text hover:opacity-80',\n error:\n 'border-error bg-error text-error hover:bg-error-500 dark:border-error-dark dark:bg-error-dark dark:text-error-dark hover:dark:bg-error-300',\n success:\n 'border-success bg-success text-success hover:bg-success-500 dark:border-success-dark dark:bg-success-dark dark:text-success-dark hover:dark:bg-success-300',\n custom: '',\n },\n\n textAlign: {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n },\n\n isFullWidth: {\n true: 'w-full',\n false: '',\n },\n\n hasIconLeft: {\n true: 'pl-12',\n false: '',\n },\n hasIconRight: {\n true: 'pr-12',\n false: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n color: 'primary',\n textAlign: 'center',\n isFullWidth: false,\n hasIconRight: false,\n hasIconLeft: false,\n },\n }\n);\n\nexport type ButtonProps = DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Optional icon to be displayed on the button\n */\n label: string;\n Icon?: FC | LucideIcon;\n IconRight?: FC | LucideIcon;\n iconClassName?: string;\n isLoading?: boolean;\n isActive?: boolean;\n isFullWidth?: boolean;\n };\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant,\n size,\n color,\n children,\n Icon,\n IconRight,\n iconClassName,\n isLoading,\n isActive,\n isFullWidth = false,\n textAlign,\n disabled,\n label,\n className,\n type = 'button',\n ...props\n },\n ref\n ) => {\n const isLink = variant === 'link' || variant === 'invisible-link';\n\n return (\n <button\n ref={ref}\n disabled={isLoading || disabled}\n aria-current={isActive ? 'page' : undefined}\n aria-label={label}\n aria-busy={isLoading}\n role={isLink ? 'link' : undefined}\n type={type}\n className={buttonVariants({\n variant,\n size,\n color,\n isFullWidth,\n textAlign: textAlign ?? (IconRight ? 'left' : 'center'),\n hasIconLeft: Boolean(\n typeof children !== 'undefined' &&\n (typeof Icon !== 'undefined' || typeof isLoading !== 'undefined')\n ),\n hasIconRight: Boolean(\n typeof children !== 'undefined' && typeof IconRight !== 'undefined'\n ),\n className,\n })}\n {...props}\n >\n {Icon && !isLoading && (\n <Icon\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: 'left',\n })}\n />\n )}\n\n <Loader\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: 'left',\n })}\n isLoading={isLoading ?? false}\n />\n\n {children}\n\n {IconRight && (\n <IconRight\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: 'right',\n })}\n />\n )}\n </button>\n );\n }\n);\n\nButton.displayName = 'Button';\n"],"names":["cva","forwardRef","jsxs","jsx","Loader"],"mappings":";;;;;;AAUA,MAAM,qBAAqBA,2BAAI,IAAI;AAAA,EACjC,UAAU;AAAA,IACR,MAAM;AAAA,MACJ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AA,gBACA,WAAW;AAAA,gBACX,UAAU;AAAA,cAAA,CACX;AAAA,cACD,WAAW,aAAa;AAAA,YAAA;AAAA,UAC1B;AAAA,UAEC;AAAA,UAEA,aACCD,2BAAA,kBAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,mBAAmB;AAAA,gBAC5B;AAAA,gBACA,WAAW;AAAA,gBACX,UAAU;AAAA,cACX,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAGN;AAEA,OAAO,cAAc;;"}
|
|
1
|
+
{"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { LucideIcon } from 'lucide-react';\nimport {\n forwardRef,\n type ButtonHTMLAttributes,\n type DetailedHTMLProps,\n type FC,\n} from 'react';\nimport { Loader } from '../Loader';\n\nconst buttonIconVariants = cva('', {\n variants: {\n size: {\n sm: 'size-3 absolute top-1/2 -translate-y-1/2',\n md: 'size-4 absolute top-1/2 -translate-y-1/2',\n lg: 'size-5 absolute top-1/2 -translate-y-1/2',\n xl: 'size-6 absolute top-1/2 -translate-y-1/2',\n 'icon-sm': 'size-3',\n 'icon-md': 'size-4',\n 'icon-lg': 'size-5',\n 'icon-xl': 'size-6',\n },\n position: {\n left: 'left-3',\n right: 'right-3',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nconst buttonVariants = cva(\n 'relative truncate whitespace-nowrap font-medium transition focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n size: {\n sm: 'min-h-7 px-3 max-md:py-1 text-xs',\n md: 'min-h-8 px-6 max-md:py-2 text-sm',\n lg: 'min-h-10 px-8 max-md:py-3 text-base',\n xl: 'min-h-11 px-10 max-md:py-4 text-lg',\n 'icon-sm': 'p-1',\n 'icon-md': 'p-1.5',\n 'icon-lg': 'p-2',\n 'icon-xl': 'p-3',\n },\n variant: {\n default: 'rounded-lg text-text-opposite dark:text-text-opposite-dark',\n none: 'border-none bg-opacity-0 text-inherit hover:bg-opacity-0 dark:bg-opacity-0 dark:text-inherit dark:hover:bg-opacity-0',\n outline:\n 'rounded-lg border-[1.5px] bg-opacity-0 hover:bg-opacity-30 dark:bg-opacity-0',\n link: 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent hover:underline dark:bg-transparent hover:dark:bg-transparent',\n 'invisible-link':\n 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent dark:bg-transparent hover:dark:bg-transparent',\n hoverable:\n 'rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10 aria-[current]:bg-opacity-5 dark:border-none dark:bg-opacity-0 dark:hover:bg-opacity-10',\n input: [\n 'w-full select-text resize-none rounded-xl border-2 bg-input-background text-sm text-input-text shadow-none outline-0 transition-all dark:bg-input-background-dark dark:text-input-text-dark',\n 'border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none] dark:border-input-border-dark dark:hover:border-input-border-hover-dark dark:focus:border-input-border-focus',\n 'aria-[invalid=true]:border-error dark:aria-[invalid=true]:border-error-dark',\n 'disabled:opacity-50',\n ],\n },\n color: {\n primary:\n 'border-primary bg-primary text-primary hover:bg-primary-500 dark:border-primary-dark dark:bg-primary-dark dark:text-primary-dark hover:dark:bg-primary-300',\n secondary:\n 'border-secondary bg-secondary text-secondary hover:bg-secondary-300 dark:border-secondary-dark dark:bg-secondary-dark dark:text-secondary-dark hover:dark:bg-secondary-100',\n destructive:\n 'border-destructive bg-destructive text-destructive hover:bg-destructive-500 dark:border-destructive-dark dark:bg-destructive-dark hover:dark:bg-destructive-200',\n neutral:\n 'border-neutral bg-neutral text-neutral hover:bg-neutral-600 dark:border-neutral-dark dark:bg-neutral-dark dark:text-neutral-dark hover:dark:bg-neutral-400',\n light: 'border-white bg-white text-white hover:bg-neutral-500',\n dark: 'border-neutral-800 bg-neutral-800 text-neutral-800 hover:bg-neutral-900 dark:hover:bg-neutral-700',\n text: 'border-text bg-text text-text hover:opacity-80 dark:border-text-dark dark:bg-text-dark dark:text-text-dark',\n 'text-inverse':\n 'border-text-dark dark:border-text bg-text-dark dark:bg-text text-text-dark dark:text-text hover:opacity-80',\n error:\n 'border-error bg-error text-error hover:bg-error-500 dark:border-error-dark dark:bg-error-dark dark:text-error-dark hover:dark:bg-error-300',\n success:\n 'border-success bg-success text-success hover:bg-success-500 dark:border-success-dark dark:bg-success-dark dark:text-success-dark hover:dark:bg-success-300',\n custom: '',\n },\n\n textAlign: {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n },\n\n isFullWidth: {\n true: 'w-full',\n false: '',\n },\n\n hasIconLeft: {\n true: 'pl-12',\n false: '',\n },\n hasIconRight: {\n true: 'pr-8',\n false: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n color: 'primary',\n textAlign: 'center',\n isFullWidth: false,\n hasIconRight: false,\n hasIconLeft: false,\n },\n }\n);\n\nexport type ButtonProps = DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Optional icon to be displayed on the button\n */\n label: string;\n Icon?: FC | LucideIcon;\n IconRight?: FC | LucideIcon;\n iconClassName?: string;\n isLoading?: boolean;\n isActive?: boolean;\n isFullWidth?: boolean;\n };\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant,\n size,\n color,\n children,\n Icon,\n IconRight,\n iconClassName,\n isLoading,\n isActive,\n isFullWidth = false,\n textAlign,\n disabled,\n label,\n className,\n type = 'button',\n ...props\n },\n ref\n ) => {\n const isLink = variant === 'link' || variant === 'invisible-link';\n\n return (\n <button\n ref={ref}\n disabled={isLoading || disabled}\n aria-current={isActive ? 'page' : undefined}\n aria-label={label}\n aria-busy={isLoading}\n role={isLink ? 'link' : undefined}\n type={type}\n className={buttonVariants({\n variant,\n size,\n color,\n isFullWidth,\n textAlign: textAlign ?? (IconRight ? 'left' : 'center'),\n hasIconLeft: Boolean(\n typeof children !== 'undefined' &&\n (typeof Icon !== 'undefined' || typeof isLoading !== 'undefined')\n ),\n hasIconRight: Boolean(\n typeof children !== 'undefined' && typeof IconRight !== 'undefined'\n ),\n className,\n })}\n {...props}\n >\n {Icon && !isLoading && (\n <Icon\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: 'left',\n })}\n />\n )}\n\n <Loader\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: 'left',\n })}\n isLoading={isLoading ?? false}\n />\n\n {children}\n\n {IconRight && (\n <IconRight\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: 'right',\n })}\n />\n )}\n </button>\n );\n }\n);\n\nButton.displayName = 'Button';\n"],"names":["cva","forwardRef","jsxs","jsx","Loader"],"mappings":";;;;;;AAUA,MAAM,qBAAqBA,2BAAI,IAAI;AAAA,EACjC,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,EAEX;AAAA,EACA,iBAAiB;AAAA,IACf,MAAM;AAAA,EAAA;AAEV,CAAC;AAED,MAAM,iBAAiBA,uBAAA;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,WAAW;AAAA,QACX,WAAW;AAAA,QACX,WAAW;AAAA,QACX,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,QACN,SACE;AAAA,QACF,MAAM;AAAA,QACN,kBACE;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ACxB;AAAA,QACA,WAAW,eAAe;AAAA,UACxB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,WAAW,cAAc,YAAY,SAAS;AAAA,UAC9C,aAAa;AAAA,YACX,OAAO,aAAa,gBACjB,OAAO,SAAS,eAAe,OAAO,cAAc;AAAA,UACzD;AAAA,UACA,cAAc;AAAA,YACZ,OAAO,aAAa,eAAe,OAAO,cAAc;AAAA,UAC1D;AAAA,UACA;AAAA,QAAA,CACD;AAAA,QACA,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,QAAQ,CAAC,aACRC,2BAAA,kBAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,mBAAmB;AAAA,gBAC5B;AAAA,gBACA,WAAW;AAAA,gBACX,UAAU;AAAA,cACX,CAAA;AAAA,YAAA;AAAA,UACH;AAAA,UAGFA,2BAAA,kBAAA;AAAA,YAACC,wBAAA;AAAA,YAAA;AAAA,cACC,WAAW,mBAAmB;AAAA,gBAC5B;AAAA,gBACA,WAAW;AAAA,gBACX,UAAU;AAAA,cAAA,CACX;AAAA,cACD,WAAW,aAAa;AAAA,YAAA;AAAA,UAC1B;AAAA,UAEC;AAAA,UAEA,aACCD,2BAAA,kBAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,mBAAmB;AAAA,gBAC5B;AAAA,gBACA,WAAW;AAAA,gBACX,UAAU;AAAA,cACX,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAGN;AAEA,OAAO,cAAc;;"}
|
|
@@ -9,10 +9,10 @@ const buttonIconVariants = cva("", {
|
|
|
9
9
|
md: "size-4 absolute top-1/2 -translate-y-1/2",
|
|
10
10
|
lg: "size-5 absolute top-1/2 -translate-y-1/2",
|
|
11
11
|
xl: "size-6 absolute top-1/2 -translate-y-1/2",
|
|
12
|
-
"icon-sm": "size-
|
|
13
|
-
"icon-md": "size-
|
|
14
|
-
"icon-lg": "size-
|
|
15
|
-
"icon-xl": "size-
|
|
12
|
+
"icon-sm": "size-3",
|
|
13
|
+
"icon-md": "size-4",
|
|
14
|
+
"icon-lg": "size-5",
|
|
15
|
+
"icon-xl": "size-6"
|
|
16
16
|
},
|
|
17
17
|
position: {
|
|
18
18
|
left: "left-3",
|
|
@@ -32,10 +32,10 @@ const buttonVariants = cva(
|
|
|
32
32
|
md: "min-h-8 px-6 max-md:py-2 text-sm",
|
|
33
33
|
lg: "min-h-10 px-8 max-md:py-3 text-base",
|
|
34
34
|
xl: "min-h-11 px-10 max-md:py-4 text-lg",
|
|
35
|
-
"icon-sm": "p-
|
|
36
|
-
"icon-md": "p-1",
|
|
37
|
-
"icon-lg": "p-
|
|
38
|
-
"icon-xl": "p-
|
|
35
|
+
"icon-sm": "p-1",
|
|
36
|
+
"icon-md": "p-1.5",
|
|
37
|
+
"icon-lg": "p-2",
|
|
38
|
+
"icon-xl": "p-3"
|
|
39
39
|
},
|
|
40
40
|
variant: {
|
|
41
41
|
default: "rounded-lg text-text-opposite dark:text-text-opposite-dark",
|
|
@@ -78,7 +78,7 @@ const buttonVariants = cva(
|
|
|
78
78
|
false: ""
|
|
79
79
|
},
|
|
80
80
|
hasIconRight: {
|
|
81
|
-
true: "pr-
|
|
81
|
+
true: "pr-8",
|
|
82
82
|
false: ""
|
|
83
83
|
}
|
|
84
84
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.mjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { LucideIcon } from 'lucide-react';\nimport {\n forwardRef,\n type ButtonHTMLAttributes,\n type DetailedHTMLProps,\n type FC,\n} from 'react';\nimport { Loader } from '../Loader';\n\nconst buttonIconVariants = cva('', {\n variants: {\n size: {\n sm: 'size-3 absolute top-1/2 -translate-y-1/2',\n md: 'size-4 absolute top-1/2 -translate-y-1/2',\n lg: 'size-5 absolute top-1/2 -translate-y-1/2',\n xl: 'size-6 absolute top-1/2 -translate-y-1/2',\n 'icon-sm': 'size-6 p-1',\n 'icon-md': 'size-7 p-1',\n 'icon-lg': 'size-9 p-1',\n 'icon-xl': 'size-10 p-1',\n },\n position: {\n left: 'left-3',\n right: 'right-3',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nconst buttonVariants = cva(\n 'relative truncate whitespace-nowrap font-medium transition focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n size: {\n sm: 'min-h-7 px-3 max-md:py-1 text-xs',\n md: 'min-h-8 px-6 max-md:py-2 text-sm',\n lg: 'min-h-10 px-8 max-md:py-3 text-base',\n xl: 'min-h-11 px-10 max-md:py-4 text-lg',\n 'icon-sm': 'p-0.5',\n 'icon-md': 'p-1',\n 'icon-lg': 'p-1.5',\n 'icon-xl': 'p-2',\n },\n variant: {\n default: 'rounded-lg text-text-opposite dark:text-text-opposite-dark',\n none: 'border-none bg-opacity-0 text-inherit hover:bg-opacity-0 dark:bg-opacity-0 dark:text-inherit dark:hover:bg-opacity-0',\n outline:\n 'rounded-lg border-[1.5px] bg-opacity-0 hover:bg-opacity-30 dark:bg-opacity-0',\n link: 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent hover:underline dark:bg-transparent hover:dark:bg-transparent',\n 'invisible-link':\n 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent dark:bg-transparent hover:dark:bg-transparent',\n hoverable:\n 'rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10 aria-[current]:bg-opacity-5 dark:border-none dark:bg-opacity-0 dark:hover:bg-opacity-10',\n input: [\n 'w-full select-text resize-none rounded-xl border-2 bg-input-background text-sm text-input-text shadow-none outline-0 transition-all dark:bg-input-background-dark dark:text-input-text-dark',\n 'border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none] dark:border-input-border-dark dark:hover:border-input-border-hover-dark dark:focus:border-input-border-focus',\n 'aria-[invalid=true]:border-error dark:aria-[invalid=true]:border-error-dark',\n 'disabled:opacity-50',\n ],\n },\n color: {\n primary:\n 'border-primary bg-primary text-primary hover:bg-primary-500 dark:border-primary-dark dark:bg-primary-dark dark:text-primary-dark hover:dark:bg-primary-300',\n secondary:\n 'border-secondary bg-secondary text-secondary hover:bg-secondary-300 dark:border-secondary-dark dark:bg-secondary-dark dark:text-secondary-dark hover:dark:bg-secondary-100',\n destructive:\n 'border-destructive bg-destructive text-destructive hover:bg-destructive-500 dark:border-destructive-dark dark:bg-destructive-dark hover:dark:bg-destructive-200',\n neutral:\n 'border-neutral bg-neutral text-neutral hover:bg-neutral-600 dark:border-neutral-dark dark:bg-neutral-dark dark:text-neutral-dark hover:dark:bg-neutral-400',\n light: 'border-white bg-white text-white hover:bg-neutral-500',\n dark: 'border-neutral-800 bg-neutral-800 text-neutral-800 hover:bg-neutral-900 dark:hover:bg-neutral-700',\n text: 'border-text bg-text text-text hover:opacity-80 dark:border-text-dark dark:bg-text-dark dark:text-text-dark',\n 'text-inverse':\n 'border-text-dark dark:border-text bg-text-dark dark:bg-text text-text-dark dark:text-text hover:opacity-80',\n error:\n 'border-error bg-error text-error hover:bg-error-500 dark:border-error-dark dark:bg-error-dark dark:text-error-dark hover:dark:bg-error-300',\n success:\n 'border-success bg-success text-success hover:bg-success-500 dark:border-success-dark dark:bg-success-dark dark:text-success-dark hover:dark:bg-success-300',\n custom: '',\n },\n\n textAlign: {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n },\n\n isFullWidth: {\n true: 'w-full',\n false: '',\n },\n\n hasIconLeft: {\n true: 'pl-12',\n false: '',\n },\n hasIconRight: {\n true: 'pr-12',\n false: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n color: 'primary',\n textAlign: 'center',\n isFullWidth: false,\n hasIconRight: false,\n hasIconLeft: false,\n },\n }\n);\n\nexport type ButtonProps = DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Optional icon to be displayed on the button\n */\n label: string;\n Icon?: FC | LucideIcon;\n IconRight?: FC | LucideIcon;\n iconClassName?: string;\n isLoading?: boolean;\n isActive?: boolean;\n isFullWidth?: boolean;\n };\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant,\n size,\n color,\n children,\n Icon,\n IconRight,\n iconClassName,\n isLoading,\n isActive,\n isFullWidth = false,\n textAlign,\n disabled,\n label,\n className,\n type = 'button',\n ...props\n },\n ref\n ) => {\n const isLink = variant === 'link' || variant === 'invisible-link';\n\n return (\n <button\n ref={ref}\n disabled={isLoading || disabled}\n aria-current={isActive ? 'page' : undefined}\n aria-label={label}\n aria-busy={isLoading}\n role={isLink ? 'link' : undefined}\n type={type}\n className={buttonVariants({\n variant,\n size,\n color,\n isFullWidth,\n textAlign: textAlign ?? (IconRight ? 'left' : 'center'),\n hasIconLeft: Boolean(\n typeof children !== 'undefined' &&\n (typeof Icon !== 'undefined' || typeof isLoading !== 'undefined')\n ),\n hasIconRight: Boolean(\n typeof children !== 'undefined' && typeof IconRight !== 'undefined'\n ),\n className,\n })}\n {...props}\n >\n {Icon && !isLoading && (\n <Icon\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: 'left',\n })}\n />\n )}\n\n <Loader\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: 'left',\n })}\n isLoading={isLoading ?? false}\n />\n\n {children}\n\n {IconRight && (\n <IconRight\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: 'right',\n })}\n />\n )}\n </button>\n );\n }\n);\n\nButton.displayName = 'Button';\n"],"names":["jsxs","jsx"],"mappings":";;;;AAUA,MAAM,qBAAqB,IAAI,IAAI;AAAA,EACjC,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,WAAW;AA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AAC;AAAA,YAAA;AAAA,cACC,WAAW,mBAAmB;AAAA,gBAC5B;AAAA,gBACA,WAAW;AAAA,gBACX,UAAU;AAAA,cACX,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAGN;AAEA,OAAO,cAAc;"}
|
|
1
|
+
{"version":3,"file":"Button.mjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { LucideIcon } from 'lucide-react';\nimport {\n forwardRef,\n type ButtonHTMLAttributes,\n type DetailedHTMLProps,\n type FC,\n} from 'react';\nimport { Loader } from '../Loader';\n\nconst buttonIconVariants = cva('', {\n variants: {\n size: {\n sm: 'size-3 absolute top-1/2 -translate-y-1/2',\n md: 'size-4 absolute top-1/2 -translate-y-1/2',\n lg: 'size-5 absolute top-1/2 -translate-y-1/2',\n xl: 'size-6 absolute top-1/2 -translate-y-1/2',\n 'icon-sm': 'size-3',\n 'icon-md': 'size-4',\n 'icon-lg': 'size-5',\n 'icon-xl': 'size-6',\n },\n position: {\n left: 'left-3',\n right: 'right-3',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nconst buttonVariants = cva(\n 'relative truncate whitespace-nowrap font-medium transition focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n size: {\n sm: 'min-h-7 px-3 max-md:py-1 text-xs',\n md: 'min-h-8 px-6 max-md:py-2 text-sm',\n lg: 'min-h-10 px-8 max-md:py-3 text-base',\n xl: 'min-h-11 px-10 max-md:py-4 text-lg',\n 'icon-sm': 'p-1',\n 'icon-md': 'p-1.5',\n 'icon-lg': 'p-2',\n 'icon-xl': 'p-3',\n },\n variant: {\n default: 'rounded-lg text-text-opposite dark:text-text-opposite-dark',\n none: 'border-none bg-opacity-0 text-inherit hover:bg-opacity-0 dark:bg-opacity-0 dark:text-inherit dark:hover:bg-opacity-0',\n outline:\n 'rounded-lg border-[1.5px] bg-opacity-0 hover:bg-opacity-30 dark:bg-opacity-0',\n link: 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent hover:underline dark:bg-transparent hover:dark:bg-transparent',\n 'invisible-link':\n 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent dark:bg-transparent hover:dark:bg-transparent',\n hoverable:\n 'rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10 aria-[current]:bg-opacity-5 dark:border-none dark:bg-opacity-0 dark:hover:bg-opacity-10',\n input: [\n 'w-full select-text resize-none rounded-xl border-2 bg-input-background text-sm text-input-text shadow-none outline-0 transition-all dark:bg-input-background-dark dark:text-input-text-dark',\n 'border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none] dark:border-input-border-dark dark:hover:border-input-border-hover-dark dark:focus:border-input-border-focus',\n 'aria-[invalid=true]:border-error dark:aria-[invalid=true]:border-error-dark',\n 'disabled:opacity-50',\n ],\n },\n color: {\n primary:\n 'border-primary bg-primary text-primary hover:bg-primary-500 dark:border-primary-dark dark:bg-primary-dark dark:text-primary-dark hover:dark:bg-primary-300',\n secondary:\n 'border-secondary bg-secondary text-secondary hover:bg-secondary-300 dark:border-secondary-dark dark:bg-secondary-dark dark:text-secondary-dark hover:dark:bg-secondary-100',\n destructive:\n 'border-destructive bg-destructive text-destructive hover:bg-destructive-500 dark:border-destructive-dark dark:bg-destructive-dark hover:dark:bg-destructive-200',\n neutral:\n 'border-neutral bg-neutral text-neutral hover:bg-neutral-600 dark:border-neutral-dark dark:bg-neutral-dark dark:text-neutral-dark hover:dark:bg-neutral-400',\n light: 'border-white bg-white text-white hover:bg-neutral-500',\n dark: 'border-neutral-800 bg-neutral-800 text-neutral-800 hover:bg-neutral-900 dark:hover:bg-neutral-700',\n text: 'border-text bg-text text-text hover:opacity-80 dark:border-text-dark dark:bg-text-dark dark:text-text-dark',\n 'text-inverse':\n 'border-text-dark dark:border-text bg-text-dark dark:bg-text text-text-dark dark:text-text hover:opacity-80',\n error:\n 'border-error bg-error text-error hover:bg-error-500 dark:border-error-dark dark:bg-error-dark dark:text-error-dark hover:dark:bg-error-300',\n success:\n 'border-success bg-success text-success hover:bg-success-500 dark:border-success-dark dark:bg-success-dark dark:text-success-dark hover:dark:bg-success-300',\n custom: '',\n },\n\n textAlign: {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n },\n\n isFullWidth: {\n true: 'w-full',\n false: '',\n },\n\n hasIconLeft: {\n true: 'pl-12',\n false: '',\n },\n hasIconRight: {\n true: 'pr-8',\n false: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n color: 'primary',\n textAlign: 'center',\n isFullWidth: false,\n hasIconRight: false,\n hasIconLeft: false,\n },\n }\n);\n\nexport type ButtonProps = DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Optional icon to be displayed on the button\n */\n label: string;\n Icon?: FC | LucideIcon;\n IconRight?: FC | LucideIcon;\n iconClassName?: string;\n isLoading?: boolean;\n isActive?: boolean;\n isFullWidth?: boolean;\n };\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant,\n size,\n color,\n children,\n Icon,\n IconRight,\n iconClassName,\n isLoading,\n isActive,\n isFullWidth = false,\n textAlign,\n disabled,\n label,\n className,\n type = 'button',\n ...props\n },\n ref\n ) => {\n const isLink = variant === 'link' || variant === 'invisible-link';\n\n return (\n <button\n ref={ref}\n disabled={isLoading || disabled}\n aria-current={isActive ? 'page' : undefined}\n aria-label={label}\n aria-busy={isLoading}\n role={isLink ? 'link' : undefined}\n type={type}\n className={buttonVariants({\n variant,\n size,\n color,\n isFullWidth,\n textAlign: textAlign ?? (IconRight ? 'left' : 'center'),\n hasIconLeft: Boolean(\n typeof children !== 'undefined' &&\n (typeof Icon !== 'undefined' || typeof isLoading !== 'undefined')\n ),\n hasIconRight: Boolean(\n typeof children !== 'undefined' && typeof IconRight !== 'undefined'\n ),\n className,\n })}\n {...props}\n >\n {Icon && !isLoading && (\n <Icon\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: 'left',\n })}\n />\n )}\n\n <Loader\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: 'left',\n })}\n isLoading={isLoading ?? false}\n />\n\n {children}\n\n {IconRight && (\n <IconRight\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: 'right',\n })}\n />\n )}\n </button>\n );\n }\n);\n\nButton.displayName = 'Button';\n"],"names":["jsxs","jsx"],"mappings":";;;;AAUA,MAAM,qBAAqB,IAAI,IAAI;AAAA,EACjC,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,EAEX;AAAA,EACA,iBAAiB;AAAA,IACf,MAAM;AAAA,EAAA;AAEV,CAAC;AAED,MAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,WAAW;AAAA,QACX,WAAW;AAAA,QACX,WAAW;AAAA,QACX,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,QACN,SACE;AAAA,QACF,MAAM;AAAA,QACN,kBACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,MAEJ;AAAA,MACA,OAAO;AAAA,QACL,SACE;AAAA,QACF,WACE;AAAA,QACF,aACE;AAAA,QACF,SACE;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ACzD;AAAA,UACA,cAAc;AAAA,YACZ,OAAO,aAAa,eAAe,OAAO,cAAc;AAAA,UAC1D;AAAA,UACA;AAAA,QAAA,CACD;AAAA,QACA,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,QAAQ,CAAC,aACRC,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,mBAAmB;AAAA,gBAC5B;AAAA,gBACA,WAAW;AAAA,gBACX,UAAU;AAAA,cACX,CAAA;AAAA,YAAA;AAAA,UACH;AAAA,UAGFA,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,mBAAmB;AAAA,gBAC5B;AAAA,gBACA,WAAW;AAAA,gBACX,UAAU;AAAA,cAAA,CACX;AAAA,cACD,WAAW,aAAa;AAAA,YAAA;AAAA,UAC1B;AAAA,UAEC;AAAA,UAEA,aACCA,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,mBAAmB;AAAA,gBAC5B;AAAA,gBACA,WAAW;AAAA,gBACX,UAAU;AAAA,cACX,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAGN;AAEA,OAAO,cAAc;"}
|
|
@@ -4,7 +4,7 @@ declare const containerVariants: (props?: ({
|
|
|
4
4
|
roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "full" | null | undefined;
|
|
5
5
|
transparency?: "sm" | "md" | "lg" | "xl" | "none" | "full" | null | undefined;
|
|
6
6
|
padding?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
7
|
-
separator?: "
|
|
7
|
+
separator?: "x" | "y" | "both" | "without" | null | undefined;
|
|
8
8
|
border?: "none" | "with" | null | undefined;
|
|
9
9
|
borderColor?: "text" | "primary" | "secondary" | "neutral" | null | undefined;
|
|
10
10
|
background?: "none" | "with" | null | undefined;
|
|
@@ -18,7 +18,7 @@ export declare const Container: import('react').ForwardRefExoticComponent<Omit<V
|
|
|
18
18
|
roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "full" | null | undefined;
|
|
19
19
|
transparency?: "sm" | "md" | "lg" | "xl" | "none" | "full" | null | undefined;
|
|
20
20
|
padding?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
21
|
-
separator?: "
|
|
21
|
+
separator?: "x" | "y" | "both" | "without" | null | undefined;
|
|
22
22
|
border?: "none" | "with" | null | undefined;
|
|
23
23
|
borderColor?: "text" | "primary" | "secondary" | "neutral" | null | undefined;
|
|
24
24
|
background?: "none" | "with" | null | undefined;
|
|
@@ -4,10 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const jsxRuntime = require("../../jsx-runtime-CgFM7lM3.cjs");
|
|
5
5
|
const require$$0 = require("react");
|
|
6
6
|
const editorReact = require("@intlayer/editor-react");
|
|
7
|
-
const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../index-
|
|
7
|
+
const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../index-DAsui9u9.cjs");
|
|
8
8
|
const components_DictionaryEditor_ValidDictionaryChangeButtons = require("./ValidDictionaryChangeButtons.cjs");
|
|
9
9
|
const DictionaryEditor = ({
|
|
10
10
|
dictionary,
|
|
11
|
+
mode,
|
|
11
12
|
...props
|
|
12
13
|
}) => {
|
|
13
14
|
const { editedContent, addEditedContent } = editorReact.useEditedContent();
|
|
@@ -20,9 +21,9 @@ const DictionaryEditor = ({
|
|
|
20
21
|
...props,
|
|
21
22
|
keyPath: [],
|
|
22
23
|
key: JSON.stringify(
|
|
23
|
-
(editedContent[dictionary.key] ?? dictionary).content
|
|
24
|
+
(editedContent?.[dictionary.key] ?? dictionary).content
|
|
24
25
|
),
|
|
25
|
-
editedContent: editedContent[dictionary.key]?.content,
|
|
26
|
+
editedContent: editedContent?.[dictionary.key]?.content,
|
|
26
27
|
focusedKeyPath,
|
|
27
28
|
section: dictionary.content,
|
|
28
29
|
onContentChange: (content) => {
|
|
@@ -31,7 +32,7 @@ const DictionaryEditor = ({
|
|
|
31
32
|
onFocusKeyPath: setFocusedContentKeyPath
|
|
32
33
|
}
|
|
33
34
|
) }),
|
|
34
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_DictionaryEditor_ValidDictionaryChangeButtons.ValidDictionaryChangeButtons, { dictionary })
|
|
35
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_DictionaryEditor_ValidDictionaryChangeButtons.ValidDictionaryChangeButtons, { dictionary, mode })
|
|
35
36
|
] });
|
|
36
37
|
};
|
|
37
38
|
exports.DictionaryEditor = DictionaryEditor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryEditor.cjs","sources":["../../../src/components/DictionaryEditor/DictionaryEditor.tsx"],"sourcesContent":["'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport type { Dictionary, KeyPath } from '@intlayer/core';\nimport { useEditedContent, useFocusDictionary } from '@intlayer/editor-react';\nimport type { FC } from 'react';\nimport { NodeWrapper } from './NodeWrapper';\nimport { ValidDictionaryChangeButtons } from './ValidDictionaryChangeButtons';\n\ntype DictionaryEditorProps = {\n dictionary: Dictionary;\n locale: Locales;\n onClickEdit?: (keyPath: KeyPath[]) => void;\n};\n\nexport const DictionaryEditor: FC<DictionaryEditorProps> = ({\n dictionary,\n ...props\n}) => {\n const { editedContent, addEditedContent } = useEditedContent();\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n return (\n <div className=\"flex h-full flex-col justify-between gap-2\">\n <div>\n <NodeWrapper\n {...props}\n keyPath={[]}\n key={JSON.stringify(\n (editedContent[dictionary.key] ?? dictionary).content\n )}\n editedContent={editedContent[dictionary.key]?.content}\n focusedKeyPath={focusedKeyPath}\n section={dictionary.content}\n onContentChange={(content) => {\n addEditedContent(dictionary.key, content.newValue, content.keyPath);\n }}\n onFocusKeyPath={setFocusedContentKeyPath}\n />\n </div>\n <ValidDictionaryChangeButtons dictionary={dictionary} />\n </div>\n );\n};\n"],"names":["useEditedContent","useFocusDictionary","jsxs","jsx","createElement","NodeWrapper","ValidDictionaryChangeButtons"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"DictionaryEditor.cjs","sources":["../../../src/components/DictionaryEditor/DictionaryEditor.tsx"],"sourcesContent":["'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport type { Dictionary, KeyPath } from '@intlayer/core';\nimport { useEditedContent, useFocusDictionary } from '@intlayer/editor-react';\nimport type { FC } from 'react';\nimport { NodeWrapper } from './NodeWrapper';\nimport { ValidDictionaryChangeButtons } from './ValidDictionaryChangeButtons';\n\ntype DictionaryEditorProps = {\n dictionary: Dictionary;\n locale: Locales;\n mode: 'local' | 'remote';\n onClickEdit?: (keyPath: KeyPath[]) => void;\n};\n\nexport const DictionaryEditor: FC<DictionaryEditorProps> = ({\n dictionary,\n mode,\n ...props\n}) => {\n const { editedContent, addEditedContent } = useEditedContent();\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n return (\n <div className=\"flex h-full flex-col justify-between gap-2\">\n <div>\n <NodeWrapper\n {...props}\n keyPath={[]}\n key={JSON.stringify(\n (editedContent?.[dictionary.key] ?? dictionary).content\n )}\n editedContent={editedContent?.[dictionary.key]?.content}\n focusedKeyPath={focusedKeyPath}\n section={dictionary.content}\n onContentChange={(content) => {\n addEditedContent(dictionary.key, content.newValue, content.keyPath);\n }}\n onFocusKeyPath={setFocusedContentKeyPath}\n />\n </div>\n <ValidDictionaryChangeButtons dictionary={dictionary} mode={mode} />\n </div>\n );\n};\n"],"names":["useEditedContent","useFocusDictionary","jsxs","jsx","createElement","NodeWrapper","ValidDictionaryChangeButtons"],"mappings":";;;;;;;;AAgBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA,GA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MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"DictionaryEditor.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/DictionaryEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,KAAK,qBAAqB,GAAG;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA+BtD,CAAC"}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import { j as jsxRuntimeExports } from "../../jsx-runtime-DQkoUcjV.js";
|
|
3
3
|
import { createElement } from "react";
|
|
4
4
|
import { useEditedContent, useFocusDictionary } from "@intlayer/editor-react";
|
|
5
|
-
import { N as NodeWrapper } from "../../index-
|
|
5
|
+
import { N as NodeWrapper } from "../../index-B-adg6xa.js";
|
|
6
6
|
import { ValidDictionaryChangeButtons } from "./ValidDictionaryChangeButtons.mjs";
|
|
7
7
|
const DictionaryEditor = ({
|
|
8
8
|
dictionary,
|
|
9
|
+
mode,
|
|
9
10
|
...props
|
|
10
11
|
}) => {
|
|
11
12
|
const { editedContent, addEditedContent } = useEditedContent();
|
|
@@ -18,9 +19,9 @@ const DictionaryEditor = ({
|
|
|
18
19
|
...props,
|
|
19
20
|
keyPath: [],
|
|
20
21
|
key: JSON.stringify(
|
|
21
|
-
(editedContent[dictionary.key] ?? dictionary).content
|
|
22
|
+
(editedContent?.[dictionary.key] ?? dictionary).content
|
|
22
23
|
),
|
|
23
|
-
editedContent: editedContent[dictionary.key]?.content,
|
|
24
|
+
editedContent: editedContent?.[dictionary.key]?.content,
|
|
24
25
|
focusedKeyPath,
|
|
25
26
|
section: dictionary.content,
|
|
26
27
|
onContentChange: (content) => {
|
|
@@ -29,7 +30,7 @@ const DictionaryEditor = ({
|
|
|
29
30
|
onFocusKeyPath: setFocusedContentKeyPath
|
|
30
31
|
}
|
|
31
32
|
) }),
|
|
32
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ValidDictionaryChangeButtons, { dictionary })
|
|
33
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ValidDictionaryChangeButtons, { dictionary, mode })
|
|
33
34
|
] });
|
|
34
35
|
};
|
|
35
36
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryEditor.mjs","sources":["../../../src/components/DictionaryEditor/DictionaryEditor.tsx"],"sourcesContent":["'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport type { Dictionary, KeyPath } from '@intlayer/core';\nimport { useEditedContent, useFocusDictionary } from '@intlayer/editor-react';\nimport type { FC } from 'react';\nimport { NodeWrapper } from './NodeWrapper';\nimport { ValidDictionaryChangeButtons } from './ValidDictionaryChangeButtons';\n\ntype DictionaryEditorProps = {\n dictionary: Dictionary;\n locale: Locales;\n onClickEdit?: (keyPath: KeyPath[]) => void;\n};\n\nexport const DictionaryEditor: FC<DictionaryEditorProps> = ({\n dictionary,\n ...props\n}) => {\n const { editedContent, addEditedContent } = useEditedContent();\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n return (\n <div className=\"flex h-full flex-col justify-between gap-2\">\n <div>\n <NodeWrapper\n {...props}\n keyPath={[]}\n key={JSON.stringify(\n (editedContent[dictionary.key] ?? dictionary).content\n )}\n editedContent={editedContent[dictionary.key]?.content}\n focusedKeyPath={focusedKeyPath}\n section={dictionary.content}\n onContentChange={(content) => {\n addEditedContent(dictionary.key, content.newValue, content.keyPath);\n }}\n onFocusKeyPath={setFocusedContentKeyPath}\n />\n </div>\n <ValidDictionaryChangeButtons dictionary={dictionary} />\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"DictionaryEditor.mjs","sources":["../../../src/components/DictionaryEditor/DictionaryEditor.tsx"],"sourcesContent":["'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport type { Dictionary, KeyPath } from '@intlayer/core';\nimport { useEditedContent, useFocusDictionary } from '@intlayer/editor-react';\nimport type { FC } from 'react';\nimport { NodeWrapper } from './NodeWrapper';\nimport { ValidDictionaryChangeButtons } from './ValidDictionaryChangeButtons';\n\ntype DictionaryEditorProps = {\n dictionary: Dictionary;\n locale: Locales;\n mode: 'local' | 'remote';\n onClickEdit?: (keyPath: KeyPath[]) => void;\n};\n\nexport const DictionaryEditor: FC<DictionaryEditorProps> = ({\n dictionary,\n mode,\n ...props\n}) => {\n const { editedContent, addEditedContent } = useEditedContent();\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n return (\n <div className=\"flex h-full flex-col justify-between gap-2\">\n <div>\n <NodeWrapper\n {...props}\n keyPath={[]}\n key={JSON.stringify(\n (editedContent?.[dictionary.key] ?? dictionary).content\n )}\n editedContent={editedContent?.[dictionary.key]?.content}\n focusedKeyPath={focusedKeyPath}\n section={dictionary.content}\n onContentChange={(content) => {\n addEditedContent(dictionary.key, content.newValue, content.keyPath);\n }}\n onFocusKeyPath={setFocusedContentKeyPath}\n />\n </div>\n <ValidDictionaryChangeButtons dictionary={dictionary} mode={mode} />\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;AAgBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,EAAE,eAAe,iBAAiB,IAAI,iBAAiB;AAC7D,QAAM,EAAE,gBAAgB,yBAAyB,IAAI,mBAAmB;AAExE,QAAM,iBAAiB,gBAAgB;AAGrC,SAAAA,kCAAA,KAAC,OAAI,EAAA,WAAU,8CACb,UAAA;AAAA,IAAAC,sCAAC,OACC,EAAA,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,QACJ,SAAS,CAAC;AAAA,QACV,KAAK,KAAK;AAAA,WACP,gBAAgB,WAAW,GAAG,KAAK,YAAY;AAAA,QAClD;AAAA,QACA,eAAe,gBAAgB,WAAW,GAAG,GAAG;AAAA,QAChD;AAAA,QACA,SAAS,WAAW;AAAA,QACpB,iBAAiB,CAAC,YAAY;AAC5B,2BAAiB,WAAW,KAAK,QAAQ,UAAU,QAAQ,OAAO;AAAA,QACpE;AAAA,QACA,gBAAgB;AAAA,MAAA;AAAA,IAAA,GAEpB;AAAA,IACAA,kCAAAA,IAAC,8BAA6B,EAAA,YAAwB,KAAY,CAAA;AAAA,EAAA,GACpE;AAEJ;"}
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
require("../../../jsx-runtime-CgFM7lM3.cjs");
|
|
4
4
|
require("@intlayer/core");
|
|
5
5
|
require("lucide-react");
|
|
6
|
+
require("../../Button/Button.cjs");
|
|
6
7
|
require("../ItemLayout.cjs");
|
|
7
|
-
const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-
|
|
8
|
+
const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-DAsui9u9.cjs");
|
|
8
9
|
exports.ArrayWrapper = components_DictionaryEditor_NodeWrapper_ArrayWrapper.ArrayWrapper;
|
|
9
10
|
//# sourceMappingURL=ArrayWrapper.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayWrapper.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ArrayWrapper.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/ArrayWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ArrayWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/ArrayWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE7D,KAAK,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAC3D,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA8C9C,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "../../../jsx-runtime-DQkoUcjV.js";
|
|
2
2
|
import "@intlayer/core";
|
|
3
3
|
import "lucide-react";
|
|
4
|
+
import "../../Button/Button.mjs";
|
|
4
5
|
import "../ItemLayout.mjs";
|
|
5
|
-
import { A } from "../../../index-
|
|
6
|
+
import { A } from "../../../index-B-adg6xa.js";
|
|
6
7
|
export {
|
|
7
8
|
A as ArrayWrapper
|
|
8
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayWrapper.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ArrayWrapper.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
require("../../../jsx-runtime-CgFM7lM3.cjs");
|
|
4
4
|
require("react");
|
|
5
5
|
require("@intlayer/core");
|
|
6
|
-
const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-
|
|
6
|
+
const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-DAsui9u9.cjs");
|
|
7
7
|
exports.EnumerationWrapper = components_DictionaryEditor_NodeWrapper_ArrayWrapper.EnumerationWrapper;
|
|
8
8
|
//# sourceMappingURL=EnumerationWrapper.cjs.map
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
require("../../../jsx-runtime-CgFM7lM3.cjs");
|
|
4
4
|
require("@intlayer/core");
|
|
5
5
|
require("lucide-react");
|
|
6
|
+
require("../../Button/Button.cjs");
|
|
6
7
|
require("../ItemLayout.cjs");
|
|
7
|
-
const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-
|
|
8
|
+
const components_DictionaryEditor_NodeWrapper_ArrayWrapper = require("../../../index-DAsui9u9.cjs");
|
|
8
9
|
exports.NestedObjectWrapper = components_DictionaryEditor_NodeWrapper_ArrayWrapper.NestedObjectWrapper;
|
|
9
10
|
//# sourceMappingURL=NestedObjectWrapper.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestedObjectWrapper.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NestedObjectWrapper.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestedObjectWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NestedObjectWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAExE,KAAK,wBAAwB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAClE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CA8C5D,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "../../../jsx-runtime-DQkoUcjV.js";
|
|
2
2
|
import "@intlayer/core";
|
|
3
3
|
import "lucide-react";
|
|
4
|
+
import "../../Button/Button.mjs";
|
|
4
5
|
import "../ItemLayout.mjs";
|
|
5
|
-
import { a } from "../../../index-
|
|
6
|
+
import { a } from "../../../index-B-adg6xa.js";
|
|
6
7
|
export {
|
|
7
8
|
a as NestedObjectWrapper
|
|
8
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestedObjectWrapper.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NestedObjectWrapper.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("../../../jsx-runtime-CgFM7lM3.cjs");
|
|
4
|
-
const
|
|
4
|
+
const editor = require("@intlayer/editor");
|
|
5
|
+
const utils_cn = require("../../../utils/cn.cjs");
|
|
5
6
|
require("../../EditableField/EditableFieldInput.cjs");
|
|
6
7
|
const components_EditableField_EditableFieldTextArea = require("../../EditableField/EditableFieldTextArea.cjs");
|
|
7
|
-
const utils_cn = require("../../../utils/cn.cjs");
|
|
8
8
|
const StringWrapper = ({
|
|
9
9
|
keyPath,
|
|
10
10
|
section,
|
|
@@ -12,7 +12,7 @@ const StringWrapper = ({
|
|
|
12
12
|
onContentChange,
|
|
13
13
|
onFocusKeyPath
|
|
14
14
|
}) => {
|
|
15
|
-
const editedContentValue =
|
|
15
|
+
const editedContentValue = editor.getDictionaryValueByKeyPath(
|
|
16
16
|
editedContent,
|
|
17
17
|
keyPath
|
|
18
18
|
);
|