@intlayer/design-system 3.2.0 → 3.2.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 +13 -78
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +1 -6
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +1 -6
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +1 -6
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -6
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +1 -6
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +1 -6
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +1 -6
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +1 -6
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +1 -6
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +1 -6
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +1 -6
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +1 -6
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +1 -6
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +1 -6
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +1 -6
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +1 -6
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs +1 -6
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.mjs +1 -6
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs +1 -6
- package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.mjs +1 -6
- package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
- package/dist/components/Navbar/index.cjs +1 -6
- package/dist/components/Navbar/index.cjs.map +1 -1
- package/dist/components/Navbar/index.mjs +1 -6
- package/dist/components/Navbar/index.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs +1 -6
- package/dist/components/SwitchSelector/index.cjs.map +1 -1
- package/dist/components/SwitchSelector/index.mjs +1 -6
- package/dist/components/SwitchSelector/index.mjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.cjs +1 -6
- package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.mjs +1 -6
- package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
- package/dist/libs/intlayer-api/auth.cjs +3 -3
- package/dist/libs/intlayer-api/auth.cjs.map +1 -1
- package/dist/libs/intlayer-api/auth.d.ts +2 -1
- package/dist/libs/intlayer-api/auth.d.ts.map +1 -1
- package/dist/libs/intlayer-api/auth.mjs +3 -3
- package/dist/libs/intlayer-api/auth.mjs.map +1 -1
- package/dist/libs/intlayer-api/dictionary.cjs +3 -3
- package/dist/libs/intlayer-api/dictionary.cjs.map +1 -1
- package/dist/libs/intlayer-api/dictionary.d.ts +2 -1
- package/dist/libs/intlayer-api/dictionary.d.ts.map +1 -1
- package/dist/libs/intlayer-api/dictionary.mjs +3 -3
- package/dist/libs/intlayer-api/dictionary.mjs.map +1 -1
- package/dist/libs/intlayer-api/index.cjs +6 -6
- package/dist/libs/intlayer-api/index.cjs.map +1 -1
- package/dist/libs/intlayer-api/index.d.ts +2 -1
- package/dist/libs/intlayer-api/index.d.ts.map +1 -1
- package/dist/libs/intlayer-api/index.mjs +6 -6
- package/dist/libs/intlayer-api/index.mjs.map +1 -1
- package/dist/libs/intlayer-api/organization.cjs +3 -2
- package/dist/libs/intlayer-api/organization.cjs.map +1 -1
- package/dist/libs/intlayer-api/organization.d.ts +2 -1
- package/dist/libs/intlayer-api/organization.d.ts.map +1 -1
- package/dist/libs/intlayer-api/organization.mjs +3 -2
- package/dist/libs/intlayer-api/organization.mjs.map +1 -1
- package/dist/libs/intlayer-api/project.cjs +3 -3
- package/dist/libs/intlayer-api/project.cjs.map +1 -1
- package/dist/libs/intlayer-api/project.d.ts +2 -1
- package/dist/libs/intlayer-api/project.d.ts.map +1 -1
- package/dist/libs/intlayer-api/project.mjs +3 -3
- package/dist/libs/intlayer-api/project.mjs.map +1 -1
- package/dist/libs/intlayer-api/stripe.cjs +1 -1
- package/dist/libs/intlayer-api/stripe.cjs.map +1 -1
- package/dist/libs/intlayer-api/stripe.d.ts +2 -1
- package/dist/libs/intlayer-api/stripe.d.ts.map +1 -1
- package/dist/libs/intlayer-api/stripe.mjs +1 -1
- package/dist/libs/intlayer-api/stripe.mjs.map +1 -1
- package/dist/libs/intlayer-api/user.cjs +3 -3
- package/dist/libs/intlayer-api/user.cjs.map +1 -1
- package/dist/libs/intlayer-api/user.d.ts +2 -1
- package/dist/libs/intlayer-api/user.d.ts.map +1 -1
- package/dist/libs/intlayer-api/user.mjs +3 -3
- package/dist/libs/intlayer-api/user.mjs.map +1 -1
- package/package.json +14 -14
package/dist/.vite/manifest.json
CHANGED
|
@@ -712,12 +712,7 @@
|
|
|
712
712
|
"_jsx-runtime-DvCoRj5u.cjs",
|
|
713
713
|
"src/hooks/useScrollBlockage/useScrollBlockageStore.ts",
|
|
714
714
|
"src/hooks/useAsync/useAsyncStateStore.ts",
|
|
715
|
-
"src/libs/intlayer-api/
|
|
716
|
-
"src/libs/intlayer-api/dictionary.ts",
|
|
717
|
-
"src/libs/intlayer-api/organization.ts",
|
|
718
|
-
"src/libs/intlayer-api/project.ts",
|
|
719
|
-
"src/libs/intlayer-api/stripe.ts",
|
|
720
|
-
"src/libs/intlayer-api/user.ts",
|
|
715
|
+
"src/libs/intlayer-api/index.ts",
|
|
721
716
|
"src/components/Toaster/Toast.tsx",
|
|
722
717
|
"src/hooks/useGetAllDictionaries.tsx",
|
|
723
718
|
"src/components/DictionaryEditor/useEditedContentStore.ts",
|
|
@@ -748,12 +743,7 @@
|
|
|
748
743
|
"imports": [
|
|
749
744
|
"_jsx-runtime-DvCoRj5u.cjs",
|
|
750
745
|
"src/hooks/intlayerAPIHooks.ts",
|
|
751
|
-
"src/libs/intlayer-api/
|
|
752
|
-
"src/libs/intlayer-api/dictionary.ts",
|
|
753
|
-
"src/libs/intlayer-api/organization.ts",
|
|
754
|
-
"src/libs/intlayer-api/project.ts",
|
|
755
|
-
"src/libs/intlayer-api/stripe.ts",
|
|
756
|
-
"src/libs/intlayer-api/user.ts",
|
|
746
|
+
"src/libs/intlayer-api/index.ts",
|
|
757
747
|
"src/components/Button/Button.tsx",
|
|
758
748
|
"src/components/Form/FormBase.tsx",
|
|
759
749
|
"src/components/Form/FormField.tsx",
|
|
@@ -791,12 +781,7 @@
|
|
|
791
781
|
"src/hooks/useAsync/useAsyncStateStore.ts",
|
|
792
782
|
"src/hooks/intlayerAPIHooks.ts",
|
|
793
783
|
"src/utils/cn.ts",
|
|
794
|
-
"src/libs/intlayer-api/
|
|
795
|
-
"src/libs/intlayer-api/dictionary.ts",
|
|
796
|
-
"src/libs/intlayer-api/organization.ts",
|
|
797
|
-
"src/libs/intlayer-api/project.ts",
|
|
798
|
-
"src/libs/intlayer-api/stripe.ts",
|
|
799
|
-
"src/libs/intlayer-api/user.ts",
|
|
784
|
+
"src/libs/intlayer-api/index.ts",
|
|
800
785
|
"src/components/Button/Button.tsx",
|
|
801
786
|
"src/components/Form/FormBase.tsx",
|
|
802
787
|
"src/components/Form/FormField.tsx",
|
|
@@ -836,12 +821,7 @@
|
|
|
836
821
|
"src/components/EditableField/EditableFieldTextArea.tsx",
|
|
837
822
|
"src/hooks/useScrollBlockage/useScrollBlockageStore.ts",
|
|
838
823
|
"src/hooks/useAsync/useAsyncStateStore.ts",
|
|
839
|
-
"src/libs/intlayer-api/
|
|
840
|
-
"src/libs/intlayer-api/dictionary.ts",
|
|
841
|
-
"src/libs/intlayer-api/organization.ts",
|
|
842
|
-
"src/libs/intlayer-api/project.ts",
|
|
843
|
-
"src/libs/intlayer-api/stripe.ts",
|
|
844
|
-
"src/libs/intlayer-api/user.ts",
|
|
824
|
+
"src/libs/intlayer-api/index.ts",
|
|
845
825
|
"src/components/Toaster/Toast.tsx",
|
|
846
826
|
"src/components/Form/FormBase.tsx",
|
|
847
827
|
"src/components/Form/FormField.tsx",
|
|
@@ -872,12 +852,7 @@
|
|
|
872
852
|
"src/components/DictionaryEditor/useEditionPanelStore.ts",
|
|
873
853
|
"src/hooks/useScrollBlockage/useScrollBlockageStore.ts",
|
|
874
854
|
"src/hooks/useAsync/useAsyncStateStore.ts",
|
|
875
|
-
"src/libs/intlayer-api/
|
|
876
|
-
"src/libs/intlayer-api/dictionary.ts",
|
|
877
|
-
"src/libs/intlayer-api/organization.ts",
|
|
878
|
-
"src/libs/intlayer-api/project.ts",
|
|
879
|
-
"src/libs/intlayer-api/stripe.ts",
|
|
880
|
-
"src/libs/intlayer-api/user.ts",
|
|
855
|
+
"src/libs/intlayer-api/index.ts",
|
|
881
856
|
"src/components/Toaster/Toast.tsx",
|
|
882
857
|
"src/components/Form/FormBase.tsx",
|
|
883
858
|
"src/components/Form/FormField.tsx",
|
|
@@ -907,12 +882,7 @@
|
|
|
907
882
|
"src/components/EditableField/EditableFieldTextArea.tsx",
|
|
908
883
|
"src/hooks/useScrollBlockage/useScrollBlockageStore.ts",
|
|
909
884
|
"src/hooks/useAsync/useAsyncStateStore.ts",
|
|
910
|
-
"src/libs/intlayer-api/
|
|
911
|
-
"src/libs/intlayer-api/dictionary.ts",
|
|
912
|
-
"src/libs/intlayer-api/organization.ts",
|
|
913
|
-
"src/libs/intlayer-api/project.ts",
|
|
914
|
-
"src/libs/intlayer-api/stripe.ts",
|
|
915
|
-
"src/libs/intlayer-api/user.ts",
|
|
885
|
+
"src/libs/intlayer-api/index.ts",
|
|
916
886
|
"src/components/Toaster/Toast.tsx",
|
|
917
887
|
"src/components/Form/FormBase.tsx",
|
|
918
888
|
"src/components/Form/FormField.tsx",
|
|
@@ -964,12 +934,7 @@
|
|
|
964
934
|
"src/components/EditableField/EditableFieldTextArea.tsx",
|
|
965
935
|
"src/hooks/useScrollBlockage/useScrollBlockageStore.ts",
|
|
966
936
|
"src/hooks/useAsync/useAsyncStateStore.ts",
|
|
967
|
-
"src/libs/intlayer-api/
|
|
968
|
-
"src/libs/intlayer-api/dictionary.ts",
|
|
969
|
-
"src/libs/intlayer-api/organization.ts",
|
|
970
|
-
"src/libs/intlayer-api/project.ts",
|
|
971
|
-
"src/libs/intlayer-api/stripe.ts",
|
|
972
|
-
"src/libs/intlayer-api/user.ts",
|
|
937
|
+
"src/libs/intlayer-api/index.ts",
|
|
973
938
|
"src/components/Toaster/Toast.tsx",
|
|
974
939
|
"src/components/Form/FormBase.tsx",
|
|
975
940
|
"src/components/Form/FormField.tsx",
|
|
@@ -1000,12 +965,7 @@
|
|
|
1000
965
|
"src/components/EditableField/EditableFieldTextArea.tsx",
|
|
1001
966
|
"src/hooks/useScrollBlockage/useScrollBlockageStore.ts",
|
|
1002
967
|
"src/hooks/useAsync/useAsyncStateStore.ts",
|
|
1003
|
-
"src/libs/intlayer-api/
|
|
1004
|
-
"src/libs/intlayer-api/dictionary.ts",
|
|
1005
|
-
"src/libs/intlayer-api/organization.ts",
|
|
1006
|
-
"src/libs/intlayer-api/project.ts",
|
|
1007
|
-
"src/libs/intlayer-api/stripe.ts",
|
|
1008
|
-
"src/libs/intlayer-api/user.ts",
|
|
968
|
+
"src/libs/intlayer-api/index.ts",
|
|
1009
969
|
"src/components/Toaster/Toast.tsx",
|
|
1010
970
|
"src/components/Form/FormBase.tsx",
|
|
1011
971
|
"src/components/Form/FormField.tsx",
|
|
@@ -1830,12 +1790,7 @@
|
|
|
1830
1790
|
"src/hooks/useGetElementOrWindow.ts",
|
|
1831
1791
|
"src/hooks/useScrollBlockage/index.tsx",
|
|
1832
1792
|
"src/hooks/useAsync/useAsyncStateStore.ts",
|
|
1833
|
-
"src/libs/intlayer-api/
|
|
1834
|
-
"src/libs/intlayer-api/dictionary.ts",
|
|
1835
|
-
"src/libs/intlayer-api/organization.ts",
|
|
1836
|
-
"src/libs/intlayer-api/project.ts",
|
|
1837
|
-
"src/libs/intlayer-api/stripe.ts",
|
|
1838
|
-
"src/libs/intlayer-api/user.ts",
|
|
1793
|
+
"src/libs/intlayer-api/index.ts",
|
|
1839
1794
|
"src/components/Toaster/Toast.tsx",
|
|
1840
1795
|
"src/utils/cn.ts",
|
|
1841
1796
|
"src/components/Container/index.tsx",
|
|
@@ -1881,12 +1836,7 @@
|
|
|
1881
1836
|
"src/hooks/useScrollBlockage/index.tsx",
|
|
1882
1837
|
"src/hooks/useScrollDetection.ts",
|
|
1883
1838
|
"src/hooks/useAsync/useAsyncStateStore.ts",
|
|
1884
|
-
"src/libs/intlayer-api/
|
|
1885
|
-
"src/libs/intlayer-api/dictionary.ts",
|
|
1886
|
-
"src/libs/intlayer-api/organization.ts",
|
|
1887
|
-
"src/libs/intlayer-api/project.ts",
|
|
1888
|
-
"src/libs/intlayer-api/stripe.ts",
|
|
1889
|
-
"src/libs/intlayer-api/user.ts",
|
|
1839
|
+
"src/libs/intlayer-api/index.ts",
|
|
1890
1840
|
"src/components/Toaster/Toast.tsx",
|
|
1891
1841
|
"src/utils/cn.ts",
|
|
1892
1842
|
"src/components/MaxHeightSmoother/index.tsx",
|
|
@@ -1904,12 +1854,7 @@
|
|
|
1904
1854
|
"src/hooks/useScrollBlockage/useScrollBlockageStore.ts",
|
|
1905
1855
|
"src/hooks/useIsMounted.ts",
|
|
1906
1856
|
"src/hooks/useAsync/useAsyncStateStore.ts",
|
|
1907
|
-
"src/libs/intlayer-api/
|
|
1908
|
-
"src/libs/intlayer-api/dictionary.ts",
|
|
1909
|
-
"src/libs/intlayer-api/organization.ts",
|
|
1910
|
-
"src/libs/intlayer-api/project.ts",
|
|
1911
|
-
"src/libs/intlayer-api/stripe.ts",
|
|
1912
|
-
"src/libs/intlayer-api/user.ts",
|
|
1857
|
+
"src/libs/intlayer-api/index.ts",
|
|
1913
1858
|
"src/components/Toaster/Toast.tsx",
|
|
1914
1859
|
"src/components/Navbar/DesktopNavbar.tsx",
|
|
1915
1860
|
"src/components/Navbar/MobileNavbar.tsx"
|
|
@@ -2074,12 +2019,7 @@
|
|
|
2074
2019
|
"_jsx-runtime-DvCoRj5u.cjs",
|
|
2075
2020
|
"src/hooks/useScrollBlockage/useScrollBlockageStore.ts",
|
|
2076
2021
|
"src/hooks/useAsync/useAsyncStateStore.ts",
|
|
2077
|
-
"src/libs/intlayer-api/
|
|
2078
|
-
"src/libs/intlayer-api/dictionary.ts",
|
|
2079
|
-
"src/libs/intlayer-api/organization.ts",
|
|
2080
|
-
"src/libs/intlayer-api/project.ts",
|
|
2081
|
-
"src/libs/intlayer-api/stripe.ts",
|
|
2082
|
-
"src/libs/intlayer-api/user.ts",
|
|
2022
|
+
"src/libs/intlayer-api/index.ts",
|
|
2083
2023
|
"src/components/Toaster/Toast.tsx",
|
|
2084
2024
|
"src/hooks/useItemSelector.ts",
|
|
2085
2025
|
"src/utils/cn.ts"
|
|
@@ -2094,12 +2034,7 @@
|
|
|
2094
2034
|
"_jsx-runtime-DvCoRj5u.cjs",
|
|
2095
2035
|
"src/hooks/useScrollBlockage/useScrollBlockageStore.ts",
|
|
2096
2036
|
"src/hooks/useAsync/useAsyncStateStore.ts",
|
|
2097
|
-
"src/libs/intlayer-api/
|
|
2098
|
-
"src/libs/intlayer-api/dictionary.ts",
|
|
2099
|
-
"src/libs/intlayer-api/organization.ts",
|
|
2100
|
-
"src/libs/intlayer-api/project.ts",
|
|
2101
|
-
"src/libs/intlayer-api/stripe.ts",
|
|
2102
|
-
"src/libs/intlayer-api/user.ts",
|
|
2037
|
+
"src/libs/intlayer-api/index.ts",
|
|
2103
2038
|
"src/components/Toaster/Toast.tsx",
|
|
2104
2039
|
"src/hooks/useItemSelector.ts",
|
|
2105
2040
|
"src/utils/cn.ts"
|
|
@@ -6,12 +6,7 @@ const require$$0 = require("react");
|
|
|
6
6
|
const reactIntlayer = require("react-intlayer");
|
|
7
7
|
require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
8
8
|
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
9
|
-
require("../../../libs/intlayer-api/
|
|
10
|
-
require("../../../libs/intlayer-api/dictionary.cjs");
|
|
11
|
-
require("../../../libs/intlayer-api/organization.cjs");
|
|
12
|
-
require("../../../libs/intlayer-api/project.cjs");
|
|
13
|
-
require("../../../libs/intlayer-api/stripe.cjs");
|
|
14
|
-
require("../../../libs/intlayer-api/user.cjs");
|
|
9
|
+
require("../../../libs/intlayer-api/index.cjs");
|
|
15
10
|
require("@intlayer/config/client");
|
|
16
11
|
require("../../Toaster/Toast.cjs");
|
|
17
12
|
const hooks_useGetAllDictionaries = require("../../../hooks/useGetAllDictionaries.cjs");
|
package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionariesSelector.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetAllDictionaries } from '../../../hooks';\nimport { useEditionPanelStore } from '../../DictionaryEditor';\nimport { Loader } from '../../Loader';\nimport { DictionaryFieldEditor } from '../DictionaryFieldEditor';\nimport { dictionariesSelectorContent } from './dictionariesSelector.content';\n\ntype DictionariesSelectorProps = {\n onClickDictionaryList: () => void;\n};\n\nexport const DictionariesSelector: FC<DictionariesSelectorProps> = ({\n onClickDictionaryList,\n}) => {\n const { online, locale, isLoading } = useGetAllDictionaries();\n const { focusedContent } = useEditionPanelStore((s) => ({\n focusedContent: s.focusedContent,\n }));\n const { noDictionaryMessage, dictionaryNotFoundMessage } = useDictionary(\n dictionariesSelectorContent\n );\n const dictionary = useMemo(\n () =>\n focusedContent?.dictionaryId\n ? (online?.[focusedContent?.dictionaryId] ??\n locale?.[focusedContent?.dictionaryId])\n : null,\n [online, locale, focusedContent?.dictionaryId]\n );\n\n if (isLoading) return <Loader />;\n\n if (!focusedContent?.dictionaryId) return noDictionaryMessage;\n\n if (!dictionary) return dictionaryNotFoundMessage;\n\n return (\n <DictionaryFieldEditor\n dictionary={dictionary}\n onClickDictionaryList={onClickDictionaryList}\n />\n );\n};\n"],"names":["useGetAllDictionaries","useEditionPanelStore","useDictionary","dictionariesSelectorContent","useMemo","jsx","Loader","DictionaryFieldEditor"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DictionariesSelector.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetAllDictionaries } from '../../../hooks';\nimport { useEditionPanelStore } from '../../DictionaryEditor';\nimport { Loader } from '../../Loader';\nimport { DictionaryFieldEditor } from '../DictionaryFieldEditor';\nimport { dictionariesSelectorContent } from './dictionariesSelector.content';\n\ntype DictionariesSelectorProps = {\n onClickDictionaryList: () => void;\n};\n\nexport const DictionariesSelector: FC<DictionariesSelectorProps> = ({\n onClickDictionaryList,\n}) => {\n const { online, locale, isLoading } = useGetAllDictionaries();\n const { focusedContent } = useEditionPanelStore((s) => ({\n focusedContent: s.focusedContent,\n }));\n const { noDictionaryMessage, dictionaryNotFoundMessage } = useDictionary(\n dictionariesSelectorContent\n );\n const dictionary = useMemo(\n () =>\n focusedContent?.dictionaryId\n ? (online?.[focusedContent?.dictionaryId] ??\n locale?.[focusedContent?.dictionaryId])\n : null,\n [online, locale, focusedContent?.dictionaryId]\n );\n\n if (isLoading) return <Loader />;\n\n if (!focusedContent?.dictionaryId) return noDictionaryMessage;\n\n if (!dictionary) return dictionaryNotFoundMessage;\n\n return (\n <DictionaryFieldEditor\n dictionary={dictionary}\n onClickDictionaryList={onClickDictionaryList}\n />\n );\n};\n"],"names":["useGetAllDictionaries","useEditionPanelStore","useDictionary","dictionariesSelectorContent","useMemo","jsx","Loader","DictionaryFieldEditor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,uBAAsD,CAAC;AAAA,EAClE;AACF,MAAM;AACJ,QAAM,EAAE,QAAQ,QAAQ,cAAcA,4BAAsB,sBAAA;AAC5D,QAAM,EAAE,eAAA,IAAmBC,iDAAA,qBAAqB,CAAC,OAAO;AAAA,IACtD,gBAAgB,EAAE;AAAA,EAClB,EAAA;AACI,QAAA,EAAE,qBAAqB,0BAAA,IAA8BC,cAAA;AAAA,IACzDC,mFAAA;AAAA,EAAA;AAEF,QAAM,aAAaC,WAAA;AAAA,IACjB,MACE,gBAAgB,eACX,SAAS,gBAAgB,YAAY,KACtC,SAAS,gBAAgB,YAAY,IACrC;AAAA,IACN,CAAC,QAAQ,QAAQ,gBAAgB,YAAY;AAAA,EAAA;AAG3C,MAAA,UAAkB,QAAAC,2BAAAA,kBAAAA,IAACC,wBAAO,QAAA,CAAA,CAAA;AAE1B,MAAA,CAAC,gBAAgB,aAAqB,QAAA;AAEtC,MAAA,CAAC,WAAmB,QAAA;AAGtB,SAAAD,2BAAA,kBAAA;AAAA,IAACE,uDAAA;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,IAAA;AAAA,EAAA;AAGN;;"}
|
|
@@ -4,12 +4,7 @@ import { useMemo } from "react";
|
|
|
4
4
|
import { useDictionary } from "react-intlayer";
|
|
5
5
|
import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
6
6
|
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
7
|
-
import "../../../libs/intlayer-api/
|
|
8
|
-
import "../../../libs/intlayer-api/dictionary.mjs";
|
|
9
|
-
import "../../../libs/intlayer-api/organization.mjs";
|
|
10
|
-
import "../../../libs/intlayer-api/project.mjs";
|
|
11
|
-
import "../../../libs/intlayer-api/stripe.mjs";
|
|
12
|
-
import "../../../libs/intlayer-api/user.mjs";
|
|
7
|
+
import "../../../libs/intlayer-api/index.mjs";
|
|
13
8
|
import "@intlayer/config/client";
|
|
14
9
|
import "../../Toaster/Toast.mjs";
|
|
15
10
|
import { useGetAllDictionaries } from "../../../hooks/useGetAllDictionaries.mjs";
|
package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionariesSelector.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetAllDictionaries } from '../../../hooks';\nimport { useEditionPanelStore } from '../../DictionaryEditor';\nimport { Loader } from '../../Loader';\nimport { DictionaryFieldEditor } from '../DictionaryFieldEditor';\nimport { dictionariesSelectorContent } from './dictionariesSelector.content';\n\ntype DictionariesSelectorProps = {\n onClickDictionaryList: () => void;\n};\n\nexport const DictionariesSelector: FC<DictionariesSelectorProps> = ({\n onClickDictionaryList,\n}) => {\n const { online, locale, isLoading } = useGetAllDictionaries();\n const { focusedContent } = useEditionPanelStore((s) => ({\n focusedContent: s.focusedContent,\n }));\n const { noDictionaryMessage, dictionaryNotFoundMessage } = useDictionary(\n dictionariesSelectorContent\n );\n const dictionary = useMemo(\n () =>\n focusedContent?.dictionaryId\n ? (online?.[focusedContent?.dictionaryId] ??\n locale?.[focusedContent?.dictionaryId])\n : null,\n [online, locale, focusedContent?.dictionaryId]\n );\n\n if (isLoading) return <Loader />;\n\n if (!focusedContent?.dictionaryId) return noDictionaryMessage;\n\n if (!dictionary) return dictionaryNotFoundMessage;\n\n return (\n <DictionaryFieldEditor\n dictionary={dictionary}\n onClickDictionaryList={onClickDictionaryList}\n />\n );\n};\n"],"names":["jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DictionariesSelector.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetAllDictionaries } from '../../../hooks';\nimport { useEditionPanelStore } from '../../DictionaryEditor';\nimport { Loader } from '../../Loader';\nimport { DictionaryFieldEditor } from '../DictionaryFieldEditor';\nimport { dictionariesSelectorContent } from './dictionariesSelector.content';\n\ntype DictionariesSelectorProps = {\n onClickDictionaryList: () => void;\n};\n\nexport const DictionariesSelector: FC<DictionariesSelectorProps> = ({\n onClickDictionaryList,\n}) => {\n const { online, locale, isLoading } = useGetAllDictionaries();\n const { focusedContent } = useEditionPanelStore((s) => ({\n focusedContent: s.focusedContent,\n }));\n const { noDictionaryMessage, dictionaryNotFoundMessage } = useDictionary(\n dictionariesSelectorContent\n );\n const dictionary = useMemo(\n () =>\n focusedContent?.dictionaryId\n ? (online?.[focusedContent?.dictionaryId] ??\n locale?.[focusedContent?.dictionaryId])\n : null,\n [online, locale, focusedContent?.dictionaryId]\n );\n\n if (isLoading) return <Loader />;\n\n if (!focusedContent?.dictionaryId) return noDictionaryMessage;\n\n if (!dictionary) return dictionaryNotFoundMessage;\n\n return (\n <DictionaryFieldEditor\n dictionary={dictionary}\n onClickDictionaryList={onClickDictionaryList}\n />\n );\n};\n"],"names":["jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,uBAAsD,CAAC;AAAA,EAClE;AACF,MAAM;AACJ,QAAM,EAAE,QAAQ,QAAQ,cAAc,sBAAsB;AAC5D,QAAM,EAAE,eAAA,IAAmB,qBAAqB,CAAC,OAAO;AAAA,IACtD,gBAAgB,EAAE;AAAA,EAClB,EAAA;AACI,QAAA,EAAE,qBAAqB,0BAAA,IAA8B;AAAA,IACzD;AAAA,EAAA;AAEF,QAAM,aAAa;AAAA,IACjB,MACE,gBAAgB,eACX,SAAS,gBAAgB,YAAY,KACtC,SAAS,gBAAgB,YAAY,IACrC;AAAA,IACN,CAAC,QAAQ,QAAQ,gBAAgB,YAAY;AAAA,EAAA;AAG3C,MAAA,UAAkB,QAAAA,kCAAAA,IAAC,QAAO,CAAA,CAAA;AAE1B,MAAA,CAAC,gBAAgB,aAAqB,QAAA;AAEtC,MAAA,CAAC,WAAmB,QAAA;AAGtB,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs
CHANGED
|
@@ -4,12 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const jsxRuntime = require("../../../jsx-runtime-DvCoRj5u.cjs");
|
|
5
5
|
const reactIntlayer = require("react-intlayer");
|
|
6
6
|
const hooks_intlayerAPIHooks = require("../../../hooks/intlayerAPIHooks.cjs");
|
|
7
|
-
require("../../../libs/intlayer-api/
|
|
8
|
-
require("../../../libs/intlayer-api/dictionary.cjs");
|
|
9
|
-
require("../../../libs/intlayer-api/organization.cjs");
|
|
10
|
-
require("../../../libs/intlayer-api/project.cjs");
|
|
11
|
-
require("../../../libs/intlayer-api/stripe.cjs");
|
|
12
|
-
require("../../../libs/intlayer-api/user.cjs");
|
|
7
|
+
require("../../../libs/intlayer-api/index.cjs");
|
|
13
8
|
require("../../Button/Button.cjs");
|
|
14
9
|
const components_Form_FormBase = require("../../Form/FormBase.cjs");
|
|
15
10
|
require("../../Form/FormField.cjs");
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryCreationForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n useAddDictionary,\n useGetProjects,\n} from '../../../hooks/intlayerAPIHooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryFormContent } from './dictionaryCreationForm.content';\nimport {\n getDictionarySchema,\n type DictionaryFormData,\n} from './dictionaryFormSchema';\n\nexport const DictionaryCreationForm: FC = () => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { addDictionary } = useAddDictionary();\n const { data: projects } = useGetProjects();\n const DictionarySchema = getDictionarySchema(String(project?._id));\n const { form, isSubmitting } = useForm(DictionarySchema);\n const { keyInput, createDictionaryButton, projectInput } = useDictionary(\n dictionaryFormContent\n );\n\n const onSubmitSuccess = async (data: DictionaryFormData) => {\n await addDictionary(data);\n };\n\n return (\n <Form\n schema={DictionarySchema}\n onSubmitSuccess={onSubmitSuccess}\n className=\"w-full max-w-[400px]\"\n {...form}\n >\n <Form.Input\n name=\"key\"\n label={keyInput.label}\n placeholder={keyInput.placeholder.value}\n isRequired\n />\n\n <Form.MultiSelect name=\"projectIds\" label={projectInput.label.value}>\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <MultiSelect.List>\n {projects?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project._id)}\n value={String(project._id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n <Form.Button\n className=\"ml-auto mt-12\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={createDictionaryButton.ariaLabel.value}\n >\n {createDictionaryButton.text}\n </Form.Button>\n </Form>\n );\n};\n"],"names":["useAuth","useAddDictionary","useGetProjects","getDictionarySchema","useForm","useDictionary","dictionaryFormContent","jsxs","Form","jsx","MultiSelect","project"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DictionaryCreationForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n useAddDictionary,\n useGetProjects,\n} from '../../../hooks/intlayerAPIHooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryFormContent } from './dictionaryCreationForm.content';\nimport {\n getDictionarySchema,\n type DictionaryFormData,\n} from './dictionaryFormSchema';\n\nexport const DictionaryCreationForm: FC = () => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { addDictionary } = useAddDictionary();\n const { data: projects } = useGetProjects();\n const DictionarySchema = getDictionarySchema(String(project?._id));\n const { form, isSubmitting } = useForm(DictionarySchema);\n const { keyInput, createDictionaryButton, projectInput } = useDictionary(\n dictionaryFormContent\n );\n\n const onSubmitSuccess = async (data: DictionaryFormData) => {\n await addDictionary(data);\n };\n\n return (\n <Form\n schema={DictionarySchema}\n onSubmitSuccess={onSubmitSuccess}\n className=\"w-full max-w-[400px]\"\n {...form}\n >\n <Form.Input\n name=\"key\"\n label={keyInput.label}\n placeholder={keyInput.placeholder.value}\n isRequired\n />\n\n <Form.MultiSelect name=\"projectIds\" label={projectInput.label.value}>\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <MultiSelect.List>\n {projects?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project._id)}\n value={String(project._id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n <Form.Button\n className=\"ml-auto mt-12\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={createDictionaryButton.ariaLabel.value}\n >\n {createDictionaryButton.text}\n </Form.Button>\n </Form>\n );\n};\n"],"names":["useAuth","useAddDictionary","useGetProjects","getDictionarySchema","useForm","useDictionary","dictionaryFormContent","jsxs","Form","jsx","MultiSelect","project"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,yBAA6B,MAAM;AACxC,QAAA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AAA,MAAM,IAAI,CAACC,aACpBF,2BAAA,kBAAA;AAAA,YAACC,8BAAAA,YAAY;AAAA,YAAZ;AAAA,cAEC,OAAO,OAAOC,SAAQ,GAAG;AAAA,cAExB,UAAAA,SAAQ;AAAA,YAAA;AAAA,YAHJ,OAAOA,SAAQ,GAAG;AAAA,UAAA,CAK1B,GACH,EACF,CAAA;AAAA,QAAA,GACF;AAAA,QAEAF,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,WAAU;AAAA,YACV,MAAK;AAAA,YACL,OAAM;AAAA,YACN,WAAW;AAAA,YACX,OAAO,uBAAuB,UAAU;AAAA,YAEvC,UAAuB,uBAAA;AAAA,UAAA;AAAA,QAC1B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs
CHANGED
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
import { j as jsxRuntimeExports } from "../../../jsx-runtime-BgSF1HG2.js";
|
|
3
3
|
import { useDictionary } from "react-intlayer";
|
|
4
4
|
import { useAddDictionary, useGetProjects } from "../../../hooks/intlayerAPIHooks.mjs";
|
|
5
|
-
import "../../../libs/intlayer-api/
|
|
6
|
-
import "../../../libs/intlayer-api/dictionary.mjs";
|
|
7
|
-
import "../../../libs/intlayer-api/organization.mjs";
|
|
8
|
-
import "../../../libs/intlayer-api/project.mjs";
|
|
9
|
-
import "../../../libs/intlayer-api/stripe.mjs";
|
|
10
|
-
import "../../../libs/intlayer-api/user.mjs";
|
|
5
|
+
import "../../../libs/intlayer-api/index.mjs";
|
|
11
6
|
import "../../Button/Button.mjs";
|
|
12
7
|
import { useForm } from "../../Form/FormBase.mjs";
|
|
13
8
|
import "../../Form/FormField.mjs";
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryCreationForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n useAddDictionary,\n useGetProjects,\n} from '../../../hooks/intlayerAPIHooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryFormContent } from './dictionaryCreationForm.content';\nimport {\n getDictionarySchema,\n type DictionaryFormData,\n} from './dictionaryFormSchema';\n\nexport const DictionaryCreationForm: FC = () => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { addDictionary } = useAddDictionary();\n const { data: projects } = useGetProjects();\n const DictionarySchema = getDictionarySchema(String(project?._id));\n const { form, isSubmitting } = useForm(DictionarySchema);\n const { keyInput, createDictionaryButton, projectInput } = useDictionary(\n dictionaryFormContent\n );\n\n const onSubmitSuccess = async (data: DictionaryFormData) => {\n await addDictionary(data);\n };\n\n return (\n <Form\n schema={DictionarySchema}\n onSubmitSuccess={onSubmitSuccess}\n className=\"w-full max-w-[400px]\"\n {...form}\n >\n <Form.Input\n name=\"key\"\n label={keyInput.label}\n placeholder={keyInput.placeholder.value}\n isRequired\n />\n\n <Form.MultiSelect name=\"projectIds\" label={projectInput.label.value}>\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <MultiSelect.List>\n {projects?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project._id)}\n value={String(project._id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n <Form.Button\n className=\"ml-auto mt-12\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={createDictionaryButton.ariaLabel.value}\n >\n {createDictionaryButton.text}\n </Form.Button>\n </Form>\n );\n};\n"],"names":["jsxs","jsx","project"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DictionaryCreationForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n useAddDictionary,\n useGetProjects,\n} from '../../../hooks/intlayerAPIHooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryFormContent } from './dictionaryCreationForm.content';\nimport {\n getDictionarySchema,\n type DictionaryFormData,\n} from './dictionaryFormSchema';\n\nexport const DictionaryCreationForm: FC = () => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { addDictionary } = useAddDictionary();\n const { data: projects } = useGetProjects();\n const DictionarySchema = getDictionarySchema(String(project?._id));\n const { form, isSubmitting } = useForm(DictionarySchema);\n const { keyInput, createDictionaryButton, projectInput } = useDictionary(\n dictionaryFormContent\n );\n\n const onSubmitSuccess = async (data: DictionaryFormData) => {\n await addDictionary(data);\n };\n\n return (\n <Form\n schema={DictionarySchema}\n onSubmitSuccess={onSubmitSuccess}\n className=\"w-full max-w-[400px]\"\n {...form}\n >\n <Form.Input\n name=\"key\"\n label={keyInput.label}\n placeholder={keyInput.placeholder.value}\n isRequired\n />\n\n <Form.MultiSelect name=\"projectIds\" label={projectInput.label.value}>\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <MultiSelect.List>\n {projects?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project._id)}\n value={String(project._id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n <Form.Button\n className=\"ml-auto mt-12\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={createDictionaryButton.ariaLabel.value}\n >\n {createDictionaryButton.text}\n </Form.Button>\n </Form>\n );\n};\n"],"names":["jsxs","jsx","project"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,yBAA6B,MAAM;AACxC,QAAA,EAAE,YAAY;AACpB,QAAM,EAAE,QAAA,IAAY,WAAW;AACzB,QAAA,EAAE,kBAAkB;AAC1B,QAAM,EAAE,MAAM,SAAS,IAAI,eAAe;AAC1C,QAAM,mBAAmB,oBAAoB,OAAO,SAAS,GAAG,CAAC;AACjE,QAAM,EAAE,MAAM,aAAa,IAAI,QAAQ,gBAAgB;AACvD,QAAM,EAAE,UAAU,wBAAwB,aAAiB,IAAA;AAAA,IACzD;AAAA,EAAA;AAGI,QAAA,kBAAkB,OAAO,SAA6B;AAC1D,UAAM,cAAc,IAAI;AAAA,EAAA;AAIxB,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,QAAQ;AAAA,MACR;AAAA,MACA,WAAU;AAAA,MACT,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAAC,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,SAAS;AAAA,YAChB,aAAa,SAAS,YAAY;AAAA,YAClC,YAAU;AAAA,UAAA;AAAA,QACZ;AAAA,QAEAD,kCAAAA,KAAC,KAAK,aAAL,EAAiB,MAAK,cAAa,OAAO,aAAa,MAAM,OAC5D,UAAA;AAAA,UAAAC,kCAAA;AAAA,YAAC,YAAY;AAAA,YAAZ;AAAA,cACC,eAAe,CAAC,UACd,UAAU,MAAM,KAAK,CAACC,aAAY,OAAOA,SAAQ,GAAG,MAAM,KAAK,GAC3D,QAAQ;AAAA,cAGd,gDAAC,YAAY,OAAZ,EAAkB,aAAa,aAAa,YAAY,OAAO;AAAA,YAAA;AAAA,UAClE;AAAA,UACCD,kCAAAA,IAAA,YAAY,SAAZ,EACC,UAACA,kCAAA,IAAA,YAAY,MAAZ,EACE,UAAU,UAAA,MAAM,IAAI,CAACC,aACpBD,kCAAA;AAAA,YAAC,YAAY;AAAA,YAAZ;AAAA,cAEC,OAAO,OAAOC,SAAQ,GAAG;AAAA,cAExB,UAAAA,SAAQ;AAAA,YAAA;AAAA,YAHJ,OAAOA,SAAQ,GAAG;AAAA,UAAA,CAK1B,GACH,EACF,CAAA;AAAA,QAAA,GACF;AAAA,QAEAD,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,WAAU;AAAA,YACV,MAAK;AAAA,YACL,OAAM;AAAA,YACN,WAAW;AAAA,YACX,OAAO,uBAAuB,UAAU;AAAA,YAEvC,UAAuB,uBAAA;AAAA,UAAA;AAAA,QAC1B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -11,12 +11,7 @@ const hooks_intlayerAPIHooks = require("../../../hooks/intlayerAPIHooks.cjs");
|
|
|
11
11
|
require("@intlayer/dictionaries-entry");
|
|
12
12
|
require("deepmerge");
|
|
13
13
|
const utils_cn = require("../../../utils/cn.cjs");
|
|
14
|
-
require("../../../libs/intlayer-api/
|
|
15
|
-
require("../../../libs/intlayer-api/dictionary.cjs");
|
|
16
|
-
require("../../../libs/intlayer-api/organization.cjs");
|
|
17
|
-
require("../../../libs/intlayer-api/project.cjs");
|
|
18
|
-
require("../../../libs/intlayer-api/stripe.cjs");
|
|
19
|
-
require("../../../libs/intlayer-api/user.cjs");
|
|
14
|
+
require("../../../libs/intlayer-api/index.cjs");
|
|
20
15
|
require("../../Button/Button.cjs");
|
|
21
16
|
const components_Form_FormBase = require("../../Form/FormBase.cjs");
|
|
22
17
|
require("../../Form/FormField.cjs");
|
package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryDetailsForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, Save } from 'lucide-react';\nimport { type FC, useEffect } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetProjects, usePushDictionaries } from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryDetailsContent } from './dictionaryDetails.content';\nimport {\n getDictionaryDetailsSchema,\n DictionaryDetailsFormData,\n} from './DictionaryDetailsSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const DictionaryDetailsForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n}) => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { pushDictionaries } = usePushDictionaries();\n const { data: projects } = useGetProjects();\n\n const DictionaryDetailsSchema = getDictionaryDetailsSchema(\n String(project?._id)\n );\n const { form, isSubmitting } = useForm(DictionaryDetailsSchema, {\n defaultValues: dictionary,\n });\n const {\n titleInput,\n keyInput,\n descriptionInput,\n publishButton,\n saveButton,\n projectInput,\n } = useDictionary(dictionaryDetailsContent);\n\n useEffect(() => {\n form.reset(dictionary);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dictionary, form?.reset]);\n\n const isFormEdited = form.formState.isDirty;\n const isLocalDictionary =\n typeof (dictionary as DistantDictionary)?._id === 'undefined';\n\n const onSubmitSuccess = async (data: DictionaryDetailsFormData) => {\n await pushDictionaries([\n {\n ...dictionary,\n ...data,\n },\n ]);\n };\n\n return (\n <Form\n className=\"flex size-full flex-1 flex-col gap-8\"\n {...form}\n schema={DictionaryDetailsSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.EditableFieldInput\n name=\"title\"\n label={titleInput.label.value}\n placeholder={titleInput.placeholder.value}\n description={titleInput.description.value}\n disabled={isSubmitting}\n />\n <Form.EditableFieldInput\n name=\"key\"\n label={keyInput.label.value}\n placeholder={keyInput.label.value}\n description={keyInput.description.value}\n disabled={isSubmitting}\n required\n />\n </div>\n\n <Form.EditableFieldTextArea\n name=\"description\"\n label={descriptionInput.label.value}\n placeholder={descriptionInput.placeholder.value}\n description={descriptionInput.description.value}\n disabled={isSubmitting}\n />\n\n <Form.MultiSelect\n name=\"projectIds\"\n label={projectInput.label.value}\n description={projectInput.description.value}\n >\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <MultiSelect.List>\n {projects?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project._id)}\n value={String(project._id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={isSubmitting || !isFormEdited}\n Icon={ArrowUpFromLine}\n isFullWidth={false}\n color=\"text\"\n isLoading={isSubmitting}\n className=\"ml-auto\"\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={isSubmitting}\n isFullWidth={false}\n className={cn('ml-auto', isFormEdited ? '' : 'invisible')}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["useAuth","usePushDictionaries","useGetProjects","getDictionaryDetailsSchema","useForm","useDictionary","dictionaryDetailsContent","useEffect","jsxs","Form","jsx","MultiSelect","project","ArrowUpFromLine","cn","Save"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DictionaryDetailsForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, Save } from 'lucide-react';\nimport { type FC, useEffect } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetProjects, usePushDictionaries } from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryDetailsContent } from './dictionaryDetails.content';\nimport {\n getDictionaryDetailsSchema,\n DictionaryDetailsFormData,\n} from './DictionaryDetailsSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const DictionaryDetailsForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n}) => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { pushDictionaries } = usePushDictionaries();\n const { data: projects } = useGetProjects();\n\n const DictionaryDetailsSchema = getDictionaryDetailsSchema(\n String(project?._id)\n );\n const { form, isSubmitting } = useForm(DictionaryDetailsSchema, {\n defaultValues: dictionary,\n });\n const {\n titleInput,\n keyInput,\n descriptionInput,\n publishButton,\n saveButton,\n projectInput,\n } = useDictionary(dictionaryDetailsContent);\n\n useEffect(() => {\n form.reset(dictionary);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dictionary, form?.reset]);\n\n const isFormEdited = form.formState.isDirty;\n const isLocalDictionary =\n typeof (dictionary as DistantDictionary)?._id === 'undefined';\n\n const onSubmitSuccess = async (data: DictionaryDetailsFormData) => {\n await pushDictionaries([\n {\n ...dictionary,\n ...data,\n },\n ]);\n };\n\n return (\n <Form\n className=\"flex size-full flex-1 flex-col gap-8\"\n {...form}\n schema={DictionaryDetailsSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.EditableFieldInput\n name=\"title\"\n label={titleInput.label.value}\n placeholder={titleInput.placeholder.value}\n description={titleInput.description.value}\n disabled={isSubmitting}\n />\n <Form.EditableFieldInput\n name=\"key\"\n label={keyInput.label.value}\n placeholder={keyInput.label.value}\n description={keyInput.description.value}\n disabled={isSubmitting}\n required\n />\n </div>\n\n <Form.EditableFieldTextArea\n name=\"description\"\n label={descriptionInput.label.value}\n placeholder={descriptionInput.placeholder.value}\n description={descriptionInput.description.value}\n disabled={isSubmitting}\n />\n\n <Form.MultiSelect\n name=\"projectIds\"\n label={projectInput.label.value}\n description={projectInput.description.value}\n >\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <MultiSelect.List>\n {projects?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project._id)}\n value={String(project._id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={isSubmitting || !isFormEdited}\n Icon={ArrowUpFromLine}\n isFullWidth={false}\n color=\"text\"\n isLoading={isSubmitting}\n className=\"ml-auto\"\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={isSubmitting}\n isFullWidth={false}\n className={cn('ml-auto', isFormEdited ? '' : 'invisible')}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["useAuth","usePushDictionaries","useGetProjects","getDictionaryDetailsSchema","useForm","useDictionary","dict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EC,OAAO,OAAOC,SAAQ,GAAG;AAAA,kBAExB,UAAAA,SAAQ;AAAA,gBAAA;AAAA,gBAHJ,OAAOA,SAAQ,GAAG;AAAA,cAAA,CAK1B,GACH,EACF,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,QAEC,oBACCF,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc,MAAM;AAAA,YAC3B,UAAU,gBAAgB,CAAC;AAAA,YAC3B,MAAMI,YAAA;AAAA,YACN,aAAa;AAAA,YACb,OAAM;AAAA,YACN,WAAW;AAAA,YACX,WAAU;AAAA,YAET,UAAc,cAAA;AAAA,UAAA;AAAA,QAAA,IAGjBH,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU;AAAA,YACV,aAAa;AAAA,YACb,WAAWK,SAAAA,GAAG,WAAW,eAAe,KAAK,WAAW;AAAA,YACxD,MAAMC,YAAA;AAAA,YACN,OAAM;AAAA,YACN,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;;"}
|
|
@@ -9,12 +9,7 @@ import { usePushDictionaries, useGetProjects } from "../../../hooks/intlayerAPIH
|
|
|
9
9
|
import "@intlayer/dictionaries-entry";
|
|
10
10
|
import "deepmerge";
|
|
11
11
|
import { cn } from "../../../utils/cn.mjs";
|
|
12
|
-
import "../../../libs/intlayer-api/
|
|
13
|
-
import "../../../libs/intlayer-api/dictionary.mjs";
|
|
14
|
-
import "../../../libs/intlayer-api/organization.mjs";
|
|
15
|
-
import "../../../libs/intlayer-api/project.mjs";
|
|
16
|
-
import "../../../libs/intlayer-api/stripe.mjs";
|
|
17
|
-
import "../../../libs/intlayer-api/user.mjs";
|
|
12
|
+
import "../../../libs/intlayer-api/index.mjs";
|
|
18
13
|
import "../../Button/Button.mjs";
|
|
19
14
|
import { useForm } from "../../Form/FormBase.mjs";
|
|
20
15
|
import "../../Form/FormField.mjs";
|
package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryDetailsForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, Save } from 'lucide-react';\nimport { type FC, useEffect } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetProjects, usePushDictionaries } from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryDetailsContent } from './dictionaryDetails.content';\nimport {\n getDictionaryDetailsSchema,\n DictionaryDetailsFormData,\n} from './DictionaryDetailsSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const DictionaryDetailsForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n}) => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { pushDictionaries } = usePushDictionaries();\n const { data: projects } = useGetProjects();\n\n const DictionaryDetailsSchema = getDictionaryDetailsSchema(\n String(project?._id)\n );\n const { form, isSubmitting } = useForm(DictionaryDetailsSchema, {\n defaultValues: dictionary,\n });\n const {\n titleInput,\n keyInput,\n descriptionInput,\n publishButton,\n saveButton,\n projectInput,\n } = useDictionary(dictionaryDetailsContent);\n\n useEffect(() => {\n form.reset(dictionary);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dictionary, form?.reset]);\n\n const isFormEdited = form.formState.isDirty;\n const isLocalDictionary =\n typeof (dictionary as DistantDictionary)?._id === 'undefined';\n\n const onSubmitSuccess = async (data: DictionaryDetailsFormData) => {\n await pushDictionaries([\n {\n ...dictionary,\n ...data,\n },\n ]);\n };\n\n return (\n <Form\n className=\"flex size-full flex-1 flex-col gap-8\"\n {...form}\n schema={DictionaryDetailsSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.EditableFieldInput\n name=\"title\"\n label={titleInput.label.value}\n placeholder={titleInput.placeholder.value}\n description={titleInput.description.value}\n disabled={isSubmitting}\n />\n <Form.EditableFieldInput\n name=\"key\"\n label={keyInput.label.value}\n placeholder={keyInput.label.value}\n description={keyInput.description.value}\n disabled={isSubmitting}\n required\n />\n </div>\n\n <Form.EditableFieldTextArea\n name=\"description\"\n label={descriptionInput.label.value}\n placeholder={descriptionInput.placeholder.value}\n description={descriptionInput.description.value}\n disabled={isSubmitting}\n />\n\n <Form.MultiSelect\n name=\"projectIds\"\n label={projectInput.label.value}\n description={projectInput.description.value}\n >\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <MultiSelect.List>\n {projects?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project._id)}\n value={String(project._id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={isSubmitting || !isFormEdited}\n Icon={ArrowUpFromLine}\n isFullWidth={false}\n color=\"text\"\n isLoading={isSubmitting}\n className=\"ml-auto\"\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={isSubmitting}\n isFullWidth={false}\n className={cn('ml-auto', isFormEdited ? '' : 'invisible')}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["jsxs","jsx","project"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DictionaryDetailsForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, Save } from 'lucide-react';\nimport { type FC, useEffect } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetProjects, usePushDictionaries } from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryDetailsContent } from './dictionaryDetails.content';\nimport {\n getDictionaryDetailsSchema,\n DictionaryDetailsFormData,\n} from './DictionaryDetailsSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const DictionaryDetailsForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n}) => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { pushDictionaries } = usePushDictionaries();\n const { data: projects } = useGetProjects();\n\n const DictionaryDetailsSchema = getDictionaryDetailsSchema(\n String(project?._id)\n );\n const { form, isSubmitting } = useForm(DictionaryDetailsSchema, {\n defaultValues: dictionary,\n });\n const {\n titleInput,\n keyInput,\n descriptionInput,\n publishButton,\n saveButton,\n projectInput,\n } = useDictionary(dictionaryDetailsContent);\n\n useEffect(() => {\n form.reset(dictionary);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dictionary, form?.reset]);\n\n const isFormEdited = form.formState.isDirty;\n const isLocalDictionary =\n typeof (dictionary as DistantDictionary)?._id === 'undefined';\n\n const onSubmitSuccess = async (data: DictionaryDetailsFormData) => {\n await pushDictionaries([\n {\n ...dictionary,\n ...data,\n },\n ]);\n };\n\n return (\n <Form\n className=\"flex size-full flex-1 flex-col gap-8\"\n {...form}\n schema={DictionaryDetailsSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.EditableFieldInput\n name=\"title\"\n label={titleInput.label.value}\n placeholder={titleInput.placeholder.value}\n description={titleInput.description.value}\n disabled={isSubmitting}\n />\n <Form.EditableFieldInput\n name=\"key\"\n label={keyInput.label.value}\n placeholder={keyInput.label.value}\n description={keyInput.description.value}\n disabled={isSubmitting}\n required\n />\n </div>\n\n <Form.EditableFieldTextArea\n name=\"description\"\n label={descriptionInput.label.value}\n placeholder={descriptionInput.placeholder.value}\n description={descriptionInput.description.value}\n disabled={isSubmitting}\n />\n\n <Form.MultiSelect\n name=\"projectIds\"\n label={projectInput.label.value}\n description={projectInput.description.value}\n >\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <MultiSelect.List>\n {projects?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project._id)}\n value={String(project._id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={isSubmitting || !isFormEdited}\n Icon={ArrowUpFromLine}\n isFullWidth={false}\n color=\"text\"\n isLoading={isSubmitting}\n className=\"ml-auto\"\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={isSubmitting}\n isFullWidth={false}\n className={cn('ml-auto', isFormEdited ? '' : 'invisible')}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )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,OAAO,cAAc,MAAM;AAAA,YAC3B,UAAU,gBAAgB,CAAC;AAAA,YAC3B,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAM;AAAA,YACN,WAAW;AAAA,YACX,WAAU;AAAA,YAET,UAAc,cAAA;AAAA,UAAA;AAAA,QAAA,IAGjBA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU;AAAA,YACV,aAAa;AAAA,YACb,WAAW,GAAG,WAAW,eAAe,KAAK,WAAW;AAAA,YACxD,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -16,12 +16,7 @@ require("../EditableField/EditableFieldInput.cjs");
|
|
|
16
16
|
require("../EditableField/EditableFieldTextArea.cjs");
|
|
17
17
|
require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
18
18
|
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
19
|
-
require("../../libs/intlayer-api/
|
|
20
|
-
require("../../libs/intlayer-api/dictionary.cjs");
|
|
21
|
-
require("../../libs/intlayer-api/organization.cjs");
|
|
22
|
-
require("../../libs/intlayer-api/project.cjs");
|
|
23
|
-
require("../../libs/intlayer-api/stripe.cjs");
|
|
24
|
-
require("../../libs/intlayer-api/user.cjs");
|
|
19
|
+
require("../../libs/intlayer-api/index.cjs");
|
|
25
20
|
require("@intlayer/config/client");
|
|
26
21
|
require("../Toaster/Toast.cjs");
|
|
27
22
|
require("@intlayer/dictionaries-entry");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryFieldEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent, dictionaryRecord, setDictionariesRecord } =\n useEditedContentStore((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }));\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n (s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n })\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => onClickDictionaryList?.()}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView dictionary={dictionary} dictionaryKey={key} />\n </Container>\n )}\n <SaveForm dictionary={dictionary} />\n </div>\n </div>\n </Container>\n </div>\n );\n};\n"],"names":["useEditedContentStore","useDictionary","dictionaryFieldEditorContent","useEditionPanelStore","useEffect","jsxs","jsx","Button","ArrowLeft","Container","H2","DictionaryDetailsForm","KeyPathBreadcrumb","NavigationViewNode","EditorView","SaveForm"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DictionaryFieldEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent, dictionaryRecord, setDictionariesRecord } =\n useEditedContentStore((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }));\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n (s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n })\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => onClickDictionaryList?.()}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView dictionary={dictionary} dictionaryKey={key} />\n </Container>\n )}\n <SaveForm dictionary={dictionary} />\n </div>\n </div>\n </Container>\n </div>\n );\n};\n"],"names":["useEditedContentStore","useDictionary","dictionaryFieldEditorContent","useEditionPanelStore","useEffect","jsxs","jsx","Button","ArrowLeft","Container","H2","DictionaryDetailsForm","KeyPathBreadcrumb","NavigationViewNode","EditorView","SaveForm"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,SAAS,mBAAmB,IAAA,IAAQ;AAC5C,QAAM,EAAE,eAAe,kBAAkB,0BACvCA,kDAAAA,sBAAsB,CAAC,OAAO;AAAA,IAC5B,eAAe,EAAE;AAAA,IACjB,kBAAkB,EAAE;AAAA,IACpB,uBAAuB,EAAE;AAAA,EACzB,EAAA;AACJ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Field/EditableFieldInput.mjs";
|
|
|
14
14
|
import "../EditableField/EditableFieldTextArea.mjs";
|
|
15
15
|
import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
16
16
|
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
17
|
-
import "../../libs/intlayer-api/
|
|
18
|
-
import "../../libs/intlayer-api/dictionary.mjs";
|
|
19
|
-
import "../../libs/intlayer-api/organization.mjs";
|
|
20
|
-
import "../../libs/intlayer-api/project.mjs";
|
|
21
|
-
import "../../libs/intlayer-api/stripe.mjs";
|
|
22
|
-
import "../../libs/intlayer-api/user.mjs";
|
|
17
|
+
import "../../libs/intlayer-api/index.mjs";
|
|
23
18
|
import "@intlayer/config/client";
|
|
24
19
|
import "../Toaster/Toast.mjs";
|
|
25
20
|
import "@intlayer/dictionaries-entry";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryFieldEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent, dictionaryRecord, setDictionariesRecord } =\n useEditedContentStore((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }));\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n (s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n })\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => onClickDictionaryList?.()}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView dictionary={dictionary} dictionaryKey={key} />\n </Container>\n )}\n <SaveForm dictionary={dictionary} />\n </div>\n </div>\n </Container>\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DictionaryFieldEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent, dictionaryRecord, setDictionariesRecord } =\n useEditedContentStore((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }));\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n (s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n })\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => onClickDictionaryList?.()}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView dictionary={dictionary} dictionaryKey={key} />\n </Container>\n )}\n <SaveForm dictionary={dictionary} />\n </div>\n </div>\n </Container>\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,SAAS,mBAAmB,IAAA,IAAQ;AAC5C,QAAM,EAAE,eAAe,kBAAkB,0BACvC,sBAAsB,CAAC,OAAO;AAAA,IAC5B,eAAe,EAAE;AAAA,IACjB,kBAAkB,EAAE;AAAA,IACpB,uBAAuB,EAAE;AAAA,EACzB,EAAA;AACJ,QAAM,EAAE,wBAAwB,cAAc,iBAAiB,IAC7D,cAAc,4BAA4B;AAEtC,QAAA,EAAE,gBAAgB,yBAAA,IAA6B;AAAA,IACnD,CAAC,OAAO;AAAA,MACN,gBAAgB,EAAE;AAAA,MAClB,0BAA0B,EAAE;AAAA,IAAA;AAAA,EAC9B;AAGF,QAAM,iBAAiB,gBAAgB;AAEvC,QAAM,UAAU,cAAc,GAAG,GAAG,WAAW;AAE/C,YAAU,MAAM;AACV,QAAA,iBAAiB,GAAG,EAAG;AAEL,0BAAA;AAAA,MACpB,CAAC,GAAG,GAAG;AAAA,IAAA,CACR;AAAA,KACA,CAAC,YAAY,KAAK,uBAAuB,gBAAgB,CAAC;AAG3D,SAAAA,kCAAA,KAAC,OAAI,EAAA,WAAU,yCACb,UAAA;AAAA,IAACA,kCAAAA,KAAA,OAAA,EAAI,WAAU,2BACb,UAAA;AAAA,MAAAC,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAAS,MAAM,wBAAwB;AAAA,UACvC,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,OAAM;AAAA,UACN,IAAG;AAAA,UACH,MAAM;AAAA,UACN,OAAO,uBAAuB,MAAM;AAAA,QAAA;AAAA,MACtC;AAAA,MACAA,kCAAA;AAAA,QAAC;AAA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,gBAAA;AAAA,cAC1D;AAAA,cAEFA,sCAAC,YAAS,YAAwB;AAAA,YAAA,GACpC;AAAA,UAAA,GACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -17,12 +17,7 @@ require("clsx");
|
|
|
17
17
|
require("tailwind-merge");
|
|
18
18
|
require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
19
19
|
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
20
|
-
require("../../../libs/intlayer-api/
|
|
21
|
-
require("../../../libs/intlayer-api/dictionary.cjs");
|
|
22
|
-
require("../../../libs/intlayer-api/organization.cjs");
|
|
23
|
-
require("../../../libs/intlayer-api/project.cjs");
|
|
24
|
-
require("../../../libs/intlayer-api/stripe.cjs");
|
|
25
|
-
require("../../../libs/intlayer-api/user.cjs");
|
|
20
|
+
require("../../../libs/intlayer-api/index.cjs");
|
|
26
21
|
require("@intlayer/config/client");
|
|
27
22
|
require("../../Toaster/Toast.cjs");
|
|
28
23
|
require("@intlayer/dictionaries-entry");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorView.cjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { X } from 'lucide-react';\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n (s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n })\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector } =\n useDictionary(editorViewContent);\n\n const { editedContent, renameEditedContent, addEditedContent } =\n useEditedContentStore((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n }));\n\n const section = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : getDictionaryValueByKeyPath(dictionary.content, keyPath);\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n className=\"ml-auto\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["useEditionPanelStore","useDictionary","editorViewContent","useEditedContentStore","getDictionaryValueByKeyPath","getIsEditableSection","sentenceToCamelCase","jsxs","Fragment","jsx","TextEditor","Label","EditableFieldInput","camelCaseToSentence","NodeTypeSelector","Button","X"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EditorView.cjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { X } from 'lucide-react';\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n (s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n })\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector } =\n useDictionary(editorViewContent);\n\n const { editedContent, renameEditedContent, addEditedContent } =\n useEditedContentStore((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n }));\n\n const section = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : getDictionaryValueByKeyPath(dictionary.content, keyPath);\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n className=\"ml-auto\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["useEditionPanelStore","useDictionary","editorViewContent","useEditedContentStore","getDictionaryValueByKeyPath","getIsEditableSection","sentenceToCamelCase","jsxs","Fragment","jsx","TextEditor","Label","EditableFieldInput","camelCaseToSentence","NodeTypeSelector","Button","X"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,gBAAgB,yBAAA,IAA6BA,iDAAA;AAAA,IACnD,CAAC,OAAO;AAAA,MACN,0BAA0B,EAAE;AAAA,MAC5B,gBAAgB,EAAE;AAAA,IAAA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