@intlayer/design-system 5.1.8 → 5.2.1
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 +9 -9
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.d.ts.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +2 -2
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +2 -2
- package/dist/components/Auth/useAuth/index.cjs.map +1 -1
- package/dist/components/Auth/useAuth/index.d.ts.map +1 -1
- package/dist/components/Auth/useAuth/index.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.cjs +3 -3
- package/dist/components/Auth/useAuth/useCSRF.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.d.ts.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.mjs +3 -3
- package/dist/components/Auth/useAuth/useCSRF.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.cjs +3 -3
- package/dist/components/Auth/useAuth/useOAuth2.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.d.ts.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.mjs +3 -3
- package/dist/components/Auth/useAuth/useOAuth2.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useSession.cjs +3 -3
- package/dist/components/Auth/useAuth/useSession.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useSession.d.ts.map +1 -1
- package/dist/components/Auth/useAuth/useSession.mjs +3 -3
- package/dist/components/Auth/useAuth/useSession.mjs.map +1 -1
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs +2 -2
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +1 -0
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +1 -0
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/getIsEditableSection.d.ts.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.cjs +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.mjs +1 -1
- package/dist/components/Form/FormBase.d.ts.map +1 -1
- package/dist/components/Form/FormField.d.ts.map +1 -1
- package/dist/components/Form/elements/EditableFieldInputElement.d.ts.map +1 -1
- package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts.map +1 -1
- package/dist/components/Form/elements/FormElement.d.ts.map +1 -1
- package/dist/components/Form/elements/MultiselectElement.d.ts.map +1 -1
- package/dist/components/Form/elements/SelectElement.d.ts.map +1 -1
- package/dist/components/Form/elements/SwitchSelectorElement.d.ts.map +1 -1
- package/dist/components/IDE/CodeContext.cjs +1 -1
- package/dist/components/IDE/CodeContext.mjs +1 -1
- package/dist/components/IDE/createFileTree.d.ts.map +1 -1
- package/dist/components/Link/Link.cjs +2 -2
- package/dist/components/Link/Link.cjs.map +1 -1
- package/dist/components/Link/Link.d.ts.map +1 -1
- package/dist/components/Link/Link.mjs +2 -2
- package/dist/components/Link/Link.mjs.map +1 -1
- package/dist/components/Loader/spinner.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +1 -1
- package/dist/components/MaxWidthSmoother/index.d.ts.map +1 -1
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.mjs +1 -1
- package/dist/components/Navbar/Burger.d.ts.map +1 -1
- package/dist/components/Navbar/DesktopNavbar.d.ts.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs +1 -1
- package/dist/components/Navbar/MobileNavbar.d.ts.map +1 -1
- package/dist/components/Navbar/MobileNavbar.mjs +1 -1
- package/dist/components/Navbar/index.cjs +1 -1
- package/dist/components/Navbar/index.d.ts.map +1 -1
- package/dist/components/Navbar/index.mjs +1 -1
- package/dist/components/SwitchSelector/index.cjs +1 -1
- package/dist/components/SwitchSelector/index.d.ts.map +1 -1
- package/dist/components/SwitchSelector/index.mjs +1 -1
- package/dist/components/TabSelector/TabSelector.cjs +1 -1
- package/dist/components/TabSelector/TabSelector.d.ts.map +1 -1
- package/dist/components/TabSelector/TabSelector.mjs +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.d.ts.map +1 -1
- package/dist/components/Toaster/useToast.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsyncWrapper.d.ts.map +1 -1
- package/dist/hooks/useDevice.d.ts.map +1 -1
- package/dist/hooks/useGetAllDictionaries.d.ts +1 -1
- package/dist/hooks/useGetAllDictionaries.d.ts.map +1 -1
- package/dist/hooks/useGetElementOrWindow.d.ts.map +1 -1
- package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
- package/dist/hooks/useItemSelector.d.ts.map +1 -1
- package/dist/hooks/usePersistedStore.d.ts.map +1 -1
- package/dist/hooks/useScrollBlockage/index.d.ts.map +1 -1
- package/dist/hooks/useScrollDetection.d.ts.map +1 -1
- package/dist/index-BCuMWKyy.js.map +1 -1
- package/dist/index-BYzBot7l.cjs.map +1 -1
- package/dist/{index-a_-DkvMQ.cjs → index-DSM_b0c2.cjs} +29 -29
- package/dist/index-DSM_b0c2.cjs.map +1 -0
- package/dist/{index-DixKT3Hi.js → index-Dpe_-poI.js} +31 -31
- package/dist/index-Dpe_-poI.js.map +1 -0
- package/dist/tailwind.css +2 -2
- package/dist/utils/camelCase.d.ts.map +1 -1
- package/dist/utils/capitalize.d.ts.map +1 -1
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/isElementAtTopAndNotCovered.d.ts.map +1 -1
- package/dist/utils/object.d.ts.map +1 -1
- package/dist/zod-BV4nCGJE.js.map +1 -1
- package/dist/zod-DSrtTSD_.cjs.map +1 -1
- package/package.json +19 -19
- package/dist/index-DixKT3Hi.js.map +0 -1
- package/dist/index-a_-DkvMQ.cjs.map +0 -1
package/dist/.vite/manifest.json
CHANGED
|
@@ -79,12 +79,12 @@
|
|
|
79
79
|
"src/components/DictionaryEditor/NodeWrapper/StringWrapper.tsx"
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
|
-
"_index-
|
|
83
|
-
"file": "index-
|
|
82
|
+
"_index-DSM_b0c2.cjs": {
|
|
83
|
+
"file": "index-DSM_b0c2.cjs",
|
|
84
84
|
"name": "index"
|
|
85
85
|
},
|
|
86
|
-
"_index-
|
|
87
|
-
"file": "index-
|
|
86
|
+
"_index-Dpe_-poI.js": {
|
|
87
|
+
"file": "index-Dpe_-poI.js",
|
|
88
88
|
"name": "index"
|
|
89
89
|
},
|
|
90
90
|
"_zod-BV4nCGJE.js": {
|
|
@@ -267,7 +267,7 @@
|
|
|
267
267
|
"src": "src/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.tsx",
|
|
268
268
|
"isEntry": true,
|
|
269
269
|
"imports": [
|
|
270
|
-
"_index-
|
|
270
|
+
"_index-DSM_b0c2.cjs",
|
|
271
271
|
"src/components/Button/Button.tsx",
|
|
272
272
|
"src/components/Auth/useUser/index.ts",
|
|
273
273
|
"src/components/Auth/ExternalsLoginButtons/assets/GithubLogo.tsx",
|
|
@@ -659,7 +659,7 @@
|
|
|
659
659
|
"src/components/Input/Input.tsx",
|
|
660
660
|
"src/components/Input/Checkbox.tsx",
|
|
661
661
|
"src/components/TextArea/AutocompleteTextArea.tsx",
|
|
662
|
-
"_index-
|
|
662
|
+
"_index-DSM_b0c2.cjs",
|
|
663
663
|
"src/components/Auth/useUser/index.ts",
|
|
664
664
|
"src/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.ts",
|
|
665
665
|
"src/components/Form/FormField.tsx",
|
|
@@ -873,7 +873,7 @@
|
|
|
873
873
|
"isEntry": true,
|
|
874
874
|
"imports": [
|
|
875
875
|
"src/hooks/intlayerAPIHooks.ts",
|
|
876
|
-
"_index-
|
|
876
|
+
"_index-DSM_b0c2.cjs",
|
|
877
877
|
"src/components/Button/Button.tsx",
|
|
878
878
|
"src/hooks/useScrollBlockage/useScrollBlockageStore.ts",
|
|
879
879
|
"src/hooks/useAsync/useAsyncStateStore.tsx",
|
|
@@ -930,7 +930,7 @@
|
|
|
930
930
|
"src/hooks/useScrollBlockage/useScrollBlockageStore.ts",
|
|
931
931
|
"src/hooks/useAsync/useAsyncStateStore.tsx",
|
|
932
932
|
"src/hooks/intlayerAPIHooks.ts",
|
|
933
|
-
"_index-
|
|
933
|
+
"_index-DSM_b0c2.cjs",
|
|
934
934
|
"src/components/Button/Button.tsx",
|
|
935
935
|
"src/components/Auth/useAuth/index.tsx",
|
|
936
936
|
"src/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.ts",
|
|
@@ -1074,7 +1074,7 @@
|
|
|
1074
1074
|
"src/hooks/useAsync/useAsyncStateStore.tsx",
|
|
1075
1075
|
"src/hooks/intlayerAPIHooks.ts",
|
|
1076
1076
|
"src/utils/cn.ts",
|
|
1077
|
-
"_index-
|
|
1077
|
+
"_index-DSM_b0c2.cjs",
|
|
1078
1078
|
"src/components/Button/Button.tsx",
|
|
1079
1079
|
"src/components/Auth/useAuth/index.tsx",
|
|
1080
1080
|
"src/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.ts",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessValidation.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/AuthenticationBarrier/accessValidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,GAAG,CAAC;AAEpD,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"accessValidation.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/AuthenticationBarrier/accessValidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,GAAG,CAAC;AAEpD,eAAO,MAAM,gBAAgB,GAC3B,YAAY,0BAA0B,CAAC,YAAY,CAAC,EACpD,SAAS,OAAO,GAAG,IAAI,EACvB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,KAAK,IAAI,EACvD,kBAAkB,MAAM,SAoBzB,CAAC"}
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const ReactExports = require("react");
|
|
6
6
|
const reactIntlayer = require("react-intlayer");
|
|
7
|
-
const index = require("../../../index-
|
|
8
|
-
require("@intlayer/config/
|
|
7
|
+
const index = require("../../../index-DSM_b0c2.cjs");
|
|
8
|
+
require("@intlayer/config/built");
|
|
9
9
|
const components_Button_Button = require("../../Button/Button.cjs");
|
|
10
10
|
const components_Auth_useUser_index = require("../useUser/index.cjs");
|
|
11
11
|
const components_Auth_ExternalsLoginButtons_assets_GithubLogo = require("./assets/GithubLogo.cjs");
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect } from "react";
|
|
4
4
|
import { useDictionary } from "react-intlayer";
|
|
5
|
-
import { i as intlayerAPI } from "../../../index-
|
|
6
|
-
import "@intlayer/config/
|
|
5
|
+
import { i as intlayerAPI } from "../../../index-Dpe_-poI.js";
|
|
6
|
+
import "@intlayer/config/built";
|
|
7
7
|
import { Button } from "../../Button/Button.mjs";
|
|
8
8
|
import { useUser } from "../useUser/index.mjs";
|
|
9
9
|
import { GithubLogo } from "./assets/GithubLogo.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/Auth/useAuth/index.tsx"],"sourcesContent":["'use client';\n\nimport type {\n OAuth2Token,\n OrganizationAPI,\n ProjectAPI,\n UserAPI,\n} from '@intlayer/backend';\nimport {
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/Auth/useAuth/index.tsx"],"sourcesContent":["'use client';\n\nimport type {\n OAuth2Token,\n OrganizationAPI,\n ProjectAPI,\n UserAPI,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport { useCSRF } from './useCSRF';\nimport { useOAuth2 } from './useOAuth2';\nimport { useSession } from './useSession';\n\nexport type Session = {\n user: UserAPI | null;\n organization: OrganizationAPI | null;\n project: ProjectAPI | null;\n isOrganizationAdmin: boolean;\n isProjectAdmin: boolean;\n};\n\ntype SessionContextProps = {\n session: Session | null | undefined;\n setSession: (session: Session | null) => void;\n fetchSession: () => Promise<Session | null | undefined>;\n revalidateSession: () => Promise<Session | null | undefined>;\n csrfToken: string | null | undefined;\n csrfTokenFetched: boolean;\n isAuthenticated: boolean;\n oAuth2AccessToken: OAuth2Token | null | undefined;\n isProjectAdmin: boolean | null | undefined;\n isOrganizationAdmin: boolean | null | undefined;\n};\n\nexport const useAuth = ({\n session: sessionProp,\n intlayerConfiguration,\n}: {\n session?: Session | null;\n intlayerConfiguration?: IntlayerConfig;\n} = {}): SessionContextProps => {\n const { csrfToken, csrfTokenFetched } = useCSRF(intlayerConfiguration);\n const { session, fetchSession, revalidateSession, setSession } = useSession(\n sessionProp,\n intlayerConfiguration\n );\n const { oAuth2AccessToken } = useOAuth2(intlayerConfiguration);\n\n return {\n session,\n fetchSession,\n setSession,\n revalidateSession,\n csrfToken,\n csrfTokenFetched,\n oAuth2AccessToken,\n isAuthenticated: Boolean(session || oAuth2AccessToken),\n isProjectAdmin: session?.isProjectAdmin,\n isOrganizationAdmin: session?.isOrganizationAdmin,\n };\n};\n"],"names":["useCSRF","useSession","useOAuth2"],"mappings":";;;;;;AAkCO,MAAM,UAAU,CAAC;AAAA,EACtB,SAAS;AAAA,EACT;AACF,IAGI,OAA4B;AAC9B,QAAM,EAAE,WAAW,qBAAqBA,gCAAAA,QAAQ,qBAAqB;AACrE,QAAM,EAAE,SAAS,cAAc,mBAAmB,WAAe,IAAAC,mCAAA;AAAA,IAC/D;AAAA,IACA;AAAA,EACF;AACA,QAAM,EAAE,kBAAA,IAAsBC,kCAAA,UAAU,qBAAqB;AAEtD,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB,QAAQ,WAAW,iBAAiB;AAAA,IACrD,gBAAgB,SAAS;AAAA,IACzB,qBAAqB,SAAS;AAAA,EAChC;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/useAuth/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,OAAO,EACR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/useAuth/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,OAAO,EACR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAK9D,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACrB,YAAY,EAAE,eAAe,GAAG,IAAI,CAAC;IACrC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IAC3B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,YAAY,EAAE,MAAM,OAAO,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IACxD,iBAAiB,EAAE,MAAM,OAAO,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IAC7D,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IAClD,cAAc,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,mBAAmB,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,mDAGrB;IACD,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,qBAAqB,CAAC,EAAE,cAAc,CAAC;CACnC,KAAG,mBAoBR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../src/components/Auth/useAuth/index.tsx"],"sourcesContent":["'use client';\n\nimport type {\n OAuth2Token,\n OrganizationAPI,\n ProjectAPI,\n UserAPI,\n} from '@intlayer/backend';\nimport {
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../src/components/Auth/useAuth/index.tsx"],"sourcesContent":["'use client';\n\nimport type {\n OAuth2Token,\n OrganizationAPI,\n ProjectAPI,\n UserAPI,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport { useCSRF } from './useCSRF';\nimport { useOAuth2 } from './useOAuth2';\nimport { useSession } from './useSession';\n\nexport type Session = {\n user: UserAPI | null;\n organization: OrganizationAPI | null;\n project: ProjectAPI | null;\n isOrganizationAdmin: boolean;\n isProjectAdmin: boolean;\n};\n\ntype SessionContextProps = {\n session: Session | null | undefined;\n setSession: (session: Session | null) => void;\n fetchSession: () => Promise<Session | null | undefined>;\n revalidateSession: () => Promise<Session | null | undefined>;\n csrfToken: string | null | undefined;\n csrfTokenFetched: boolean;\n isAuthenticated: boolean;\n oAuth2AccessToken: OAuth2Token | null | undefined;\n isProjectAdmin: boolean | null | undefined;\n isOrganizationAdmin: boolean | null | undefined;\n};\n\nexport const useAuth = ({\n session: sessionProp,\n intlayerConfiguration,\n}: {\n session?: Session | null;\n intlayerConfiguration?: IntlayerConfig;\n} = {}): SessionContextProps => {\n const { csrfToken, csrfTokenFetched } = useCSRF(intlayerConfiguration);\n const { session, fetchSession, revalidateSession, setSession } = useSession(\n sessionProp,\n intlayerConfiguration\n );\n const { oAuth2AccessToken } = useOAuth2(intlayerConfiguration);\n\n return {\n session,\n fetchSession,\n setSession,\n revalidateSession,\n csrfToken,\n csrfTokenFetched,\n oAuth2AccessToken,\n isAuthenticated: Boolean(session || oAuth2AccessToken),\n isProjectAdmin: session?.isProjectAdmin,\n isOrganizationAdmin: session?.isOrganizationAdmin,\n };\n};\n"],"names":[],"mappings":";;;;AAkCO,MAAM,UAAU,CAAC;AAAA,EACtB,SAAS;AAAA,EACT;AACF,IAGI,OAA4B;AAC9B,QAAM,EAAE,WAAW,qBAAqB,QAAQ,qBAAqB;AACrE,QAAM,EAAE,SAAS,cAAc,mBAAmB,WAAe,IAAA;AAAA,IAC/D;AAAA,IACA;AAAA,EACF;AACA,QAAM,EAAE,kBAAA,IAAsB,UAAU,qBAAqB;AAEtD,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB,QAAQ,WAAW,iBAAiB;AAAA,IACrD,gBAAgB,SAAS;AAAA,IACzB,qBAAqB,SAAS;AAAA,EAChC;AACF;"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const api = require("@intlayer/api");
|
|
5
|
-
const
|
|
5
|
+
const configuration = require("@intlayer/config/built");
|
|
6
6
|
const editorReact = require("@intlayer/editor-react");
|
|
7
7
|
const hooks_useAsync_useAsync = require("../../../hooks/useAsync/useAsync.cjs");
|
|
8
8
|
const useCSRF = (intlayerConfiguration) => {
|
|
9
|
-
const
|
|
10
|
-
const config = intlayerConfiguration ??
|
|
9
|
+
const contextConfiguration = editorReact.useConfiguration();
|
|
10
|
+
const config = intlayerConfiguration ?? contextConfiguration ?? configuration;
|
|
11
11
|
const intlayerAPI = api.getIntlayerAPI(void 0, config);
|
|
12
12
|
const { data, isFetched: csrfTokenFetched } = hooks_useAsync_useAsync.useAsync(
|
|
13
13
|
"getCSRFToken",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCSRF.cjs","sources":["../../../../src/components/Auth/useAuth/useCSRF.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport {
|
|
1
|
+
{"version":3,"file":"useCSRF.cjs","sources":["../../../../src/components/Auth/useAuth/useCSRF.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport defaultConfiguration from '@intlayer/config/built';\n\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useAsync } from '../../../hooks/useAsync/useAsync';\n\nexport const useCSRF = (intlayerConfiguration?: IntlayerConfig) => {\n const contextConfiguration = useConfiguration();\n const config =\n intlayerConfiguration ?? contextConfiguration ?? defaultConfiguration;\n const intlayerAPI = getIntlayerAPI(undefined, config);\n\n const { data, isFetched: csrfTokenFetched } = useAsync(\n 'getCSRFToken',\n intlayerAPI.auth.getCSRFToken,\n {\n cache: true,\n autoFetch: true,\n }\n );\n\n const csrfToken = data?.data?.csrf_token;\n\n return {\n csrfToken,\n csrfTokenFetched,\n };\n};\n"],"names":["useConfiguration","defaultConfiguration","getIntlayerAPI","useAsync"],"mappings":";;;;;;;AASa,MAAA,UAAU,CAAC,0BAA2C;AACjE,QAAM,uBAAuBA,YAAAA,iBAAiB;AACxC,QAAA,SACJ,yBAAyB,wBAAwBC;AAC7C,QAAA,cAAcC,IAAAA,eAAe,QAAW,MAAM;AAEpD,QAAM,EAAE,MAAM,WAAW,iBAAqB,IAAAC,wBAAA;AAAA,IAC5C;AAAA,IACA,YAAY,KAAK;AAAA,IACjB;AAAA,MACE,OAAO;AAAA,MACP,WAAW;AAAA,IAAA;AAAA,EAEf;AAEM,QAAA,YAAY,MAAM,MAAM;AAEvB,SAAA;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCSRF.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/useAuth/useCSRF.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"useCSRF.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/useAuth/useCSRF.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAM9D,eAAO,MAAM,OAAO,GAAI,wBAAwB,cAAc;;;CAqB7D,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { getIntlayerAPI } from "@intlayer/api";
|
|
3
|
-
import
|
|
3
|
+
import configuration from "@intlayer/config/built";
|
|
4
4
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
5
5
|
import { useAsync } from "../../../hooks/useAsync/useAsync.mjs";
|
|
6
6
|
const useCSRF = (intlayerConfiguration) => {
|
|
7
|
-
const
|
|
8
|
-
const config = intlayerConfiguration ??
|
|
7
|
+
const contextConfiguration = useConfiguration();
|
|
8
|
+
const config = intlayerConfiguration ?? contextConfiguration ?? configuration;
|
|
9
9
|
const intlayerAPI = getIntlayerAPI(void 0, config);
|
|
10
10
|
const { data, isFetched: csrfTokenFetched } = useAsync(
|
|
11
11
|
"getCSRFToken",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCSRF.mjs","sources":["../../../../src/components/Auth/useAuth/useCSRF.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport {
|
|
1
|
+
{"version":3,"file":"useCSRF.mjs","sources":["../../../../src/components/Auth/useAuth/useCSRF.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport defaultConfiguration from '@intlayer/config/built';\n\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useAsync } from '../../../hooks/useAsync/useAsync';\n\nexport const useCSRF = (intlayerConfiguration?: IntlayerConfig) => {\n const contextConfiguration = useConfiguration();\n const config =\n intlayerConfiguration ?? contextConfiguration ?? defaultConfiguration;\n const intlayerAPI = getIntlayerAPI(undefined, config);\n\n const { data, isFetched: csrfTokenFetched } = useAsync(\n 'getCSRFToken',\n intlayerAPI.auth.getCSRFToken,\n {\n cache: true,\n autoFetch: true,\n }\n );\n\n const csrfToken = data?.data?.csrf_token;\n\n return {\n csrfToken,\n csrfTokenFetched,\n };\n};\n"],"names":["defaultConfiguration"],"mappings":";;;;;AASa,MAAA,UAAU,CAAC,0BAA2C;AACjE,QAAM,uBAAuB,iBAAiB;AACxC,QAAA,SACJ,yBAAyB,wBAAwBA;AAC7C,QAAA,cAAc,eAAe,QAAW,MAAM;AAEpD,QAAM,EAAE,MAAM,WAAW,iBAAqB,IAAA;AAAA,IAC5C;AAAA,IACA,YAAY,KAAK;AAAA,IACjB;AAAA,MACE,OAAO;AAAA,MACP,WAAW;AAAA,IAAA;AAAA,EAEf;AAEM,QAAA,YAAY,MAAM,MAAM;AAEvB,SAAA;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const api = require("@intlayer/api");
|
|
5
|
-
const
|
|
5
|
+
const configuration = require("@intlayer/config/built");
|
|
6
6
|
const editorReact = require("@intlayer/editor-react");
|
|
7
7
|
const hooks_useAsync_useAsync = require("../../../hooks/useAsync/useAsync.cjs");
|
|
8
8
|
const useOAuth2 = (intlayerConfiguration) => {
|
|
9
|
-
const configuration = editorReact.useConfiguration();
|
|
10
|
-
const config = intlayerConfiguration ?? configuration ??
|
|
9
|
+
const configuration$1 = editorReact.useConfiguration();
|
|
10
|
+
const config = intlayerConfiguration ?? configuration$1 ?? configuration;
|
|
11
11
|
const intlayerAPI = api.getIntlayerAPI(void 0, config);
|
|
12
12
|
const { data } = hooks_useAsync_useAsync.useAsync(
|
|
13
13
|
"getOAuth2AccessToken",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOAuth2.cjs","sources":["../../../../src/components/Auth/useAuth/useOAuth2.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport {
|
|
1
|
+
{"version":3,"file":"useOAuth2.cjs","sources":["../../../../src/components/Auth/useAuth/useOAuth2.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport defaultConfiguration from '@intlayer/config/built';\n\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useAsync } from '../../../hooks/useAsync/useAsync';\n\nexport const useOAuth2 = (intlayerConfiguration?: IntlayerConfig) => {\n const configuration = useConfiguration();\n const config = intlayerConfiguration ?? configuration ?? defaultConfiguration;\n const intlayerAPI = getIntlayerAPI(undefined, config);\n\n const { data } = useAsync(\n 'getOAuth2AccessToken',\n () => intlayerAPI.auth.getOAuth2AccessToken(),\n {\n cache: true,\n autoFetch: true,\n enable: !!(config.editor.clientId && config.editor.clientSecret),\n }\n );\n\n const oAuth2AccessToken = data?.data;\n\n return {\n oAuth2AccessToken,\n };\n};\n"],"names":["configuration","useConfiguration","defaultConfiguration","getIntlayerAPI","useAsync"],"mappings":";;;;;;;AASa,MAAA,YAAY,CAAC,0BAA2C;AACnE,QAAMA,kBAAgBC,YAAAA,iBAAiB;AACjC,QAAA,SAAS,yBAAyBD,mBAAiBE;AACnD,QAAA,cAAcC,IAAAA,eAAe,QAAW,MAAM;AAE9C,QAAA,EAAE,SAASC,wBAAA;AAAA,IACf;AAAA,IACA,MAAM,YAAY,KAAK,qBAAqB;AAAA,IAC5C;AAAA,MACE,OAAO;AAAA,MACP,WAAW;AAAA,MACX,QAAQ,CAAC,EAAE,OAAO,OAAO,YAAY,OAAO,OAAO;AAAA,IAAA;AAAA,EAEvD;AAEA,QAAM,oBAAoB,MAAM;AAEzB,SAAA;AAAA,IACL;AAAA,EACF;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOAuth2.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/useAuth/useOAuth2.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"useOAuth2.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/useAuth/useOAuth2.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAM9D,eAAO,MAAM,SAAS,GAAI,wBAAwB,cAAc;;CAoB/D,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { getIntlayerAPI } from "@intlayer/api";
|
|
3
|
-
import
|
|
3
|
+
import configuration from "@intlayer/config/built";
|
|
4
4
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
5
5
|
import { useAsync } from "../../../hooks/useAsync/useAsync.mjs";
|
|
6
6
|
const useOAuth2 = (intlayerConfiguration) => {
|
|
7
|
-
const configuration = useConfiguration();
|
|
8
|
-
const config = intlayerConfiguration ?? configuration ??
|
|
7
|
+
const configuration$1 = useConfiguration();
|
|
8
|
+
const config = intlayerConfiguration ?? configuration$1 ?? configuration;
|
|
9
9
|
const intlayerAPI = getIntlayerAPI(void 0, config);
|
|
10
10
|
const { data } = useAsync(
|
|
11
11
|
"getOAuth2AccessToken",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOAuth2.mjs","sources":["../../../../src/components/Auth/useAuth/useOAuth2.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport {
|
|
1
|
+
{"version":3,"file":"useOAuth2.mjs","sources":["../../../../src/components/Auth/useAuth/useOAuth2.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport defaultConfiguration from '@intlayer/config/built';\n\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useAsync } from '../../../hooks/useAsync/useAsync';\n\nexport const useOAuth2 = (intlayerConfiguration?: IntlayerConfig) => {\n const configuration = useConfiguration();\n const config = intlayerConfiguration ?? configuration ?? defaultConfiguration;\n const intlayerAPI = getIntlayerAPI(undefined, config);\n\n const { data } = useAsync(\n 'getOAuth2AccessToken',\n () => intlayerAPI.auth.getOAuth2AccessToken(),\n {\n cache: true,\n autoFetch: true,\n enable: !!(config.editor.clientId && config.editor.clientSecret),\n }\n );\n\n const oAuth2AccessToken = data?.data;\n\n return {\n oAuth2AccessToken,\n };\n};\n"],"names":["configuration","defaultConfiguration"],"mappings":";;;;;AASa,MAAA,YAAY,CAAC,0BAA2C;AACnE,QAAMA,kBAAgB,iBAAiB;AACjC,QAAA,SAAS,yBAAyBA,mBAAiBC;AACnD,QAAA,cAAc,eAAe,QAAW,MAAM;AAE9C,QAAA,EAAE,SAAS;AAAA,IACf;AAAA,IACA,MAAM,YAAY,KAAK,qBAAqB;AAAA,IAC5C;AAAA,MACE,OAAO;AAAA,MACP,WAAW;AAAA,MACX,QAAQ,CAAC,EAAE,OAAO,OAAO,YAAY,OAAO,OAAO;AAAA,IAAA;AAAA,EAEvD;AAEA,QAAM,oBAAoB,MAAM;AAEzB,SAAA;AAAA,IACL;AAAA,EACF;AACF;"}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const api = require("@intlayer/api");
|
|
5
|
-
const
|
|
5
|
+
const configuration = require("@intlayer/config/built");
|
|
6
6
|
const editorReact = require("@intlayer/editor-react");
|
|
7
7
|
const ReactExports = require("react");
|
|
8
8
|
const hooks_useAsync_useAsync = require("../../../hooks/useAsync/useAsync.cjs");
|
|
9
9
|
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
10
10
|
const useSession = (sessionProp, intlayerConfiguration) => {
|
|
11
|
-
const configuration = editorReact.useConfiguration();
|
|
12
|
-
const config = intlayerConfiguration ?? configuration ??
|
|
11
|
+
const configuration$1 = editorReact.useConfiguration();
|
|
12
|
+
const config = intlayerConfiguration ?? configuration$1 ?? configuration;
|
|
13
13
|
const intlayerAPI = api.getIntlayerAPI(void 0, config);
|
|
14
14
|
const {
|
|
15
15
|
getSession,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSession.cjs","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport {
|
|
1
|
+
{"version":3,"file":"useSession.cjs","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport defaultConfiguration from '@intlayer/config/built';\n\nimport { useConfiguration } from '@intlayer/editor-react';\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 configuration = useConfiguration();\n const config = intlayerConfiguration ?? configuration ?? defaultConfiguration;\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":["configuration","useConfiguration","defaultConfiguration","getIntlayerAPI","useAsync","useMemo"],"mappings":";;;;;;;;;AAWa,MAAA,aAAa,CACxB,aACA,0BACG;AACH,QAAMA,kBAAgBC,YAAAA,iBAAiB;AACjC,QAAA,SAAS,yBAAyBD,mBAAiBE;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,aAAA;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSession.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useSession.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAM9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,eAAO,MAAM,UAAU,GACrB,cAAc,OAAO,GAAG,IAAI,EAC5B,wBAAwB,cAAc;;;;;CAkEvC,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { getIntlayerAPI } from "@intlayer/api";
|
|
3
|
-
import
|
|
3
|
+
import configuration from "@intlayer/config/built";
|
|
4
4
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
5
5
|
import { useMemo } from "react";
|
|
6
6
|
import { useAsync } from "../../../hooks/useAsync/useAsync.mjs";
|
|
7
7
|
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
8
8
|
const useSession = (sessionProp, intlayerConfiguration) => {
|
|
9
|
-
const configuration = useConfiguration();
|
|
10
|
-
const config = intlayerConfiguration ?? configuration ??
|
|
9
|
+
const configuration$1 = useConfiguration();
|
|
10
|
+
const config = intlayerConfiguration ?? configuration$1 ?? configuration;
|
|
11
11
|
const intlayerAPI = getIntlayerAPI(void 0, config);
|
|
12
12
|
const {
|
|
13
13
|
getSession,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSession.mjs","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport {
|
|
1
|
+
{"version":3,"file":"useSession.mjs","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport { getIntlayerAPI } from '@intlayer/api';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport defaultConfiguration from '@intlayer/config/built';\n\nimport { useConfiguration } from '@intlayer/editor-react';\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 configuration = useConfiguration();\n const config = intlayerConfiguration ?? configuration ?? defaultConfiguration;\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":["configuration","defaultConfiguration"],"mappings":";;;;;;;AAWa,MAAA,aAAa,CACxB,aACA,0BACG;AACH,QAAMA,kBAAgB,iBAAiB;AACjC,QAAA,SAAS,yBAAyBA,mBAAiBC;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;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,eAAO,MAAM,aAAa;;;8EA6BzB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,cAAc,CAAC,GACrD,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAErC,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,eAAO,MAAM,aAAa;;;8EA6BzB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,cAAc,CAAC,GACrD,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAErC,eAAO,MAAM,KAAK,GAAI,yCAAyC,UAAU,4CAKxE,CAAC"}
|
|
@@ -11,8 +11,8 @@ require("../Input/Input.cjs");
|
|
|
11
11
|
require("../Input/Checkbox.cjs");
|
|
12
12
|
const components_TextArea_AutocompleteTextArea = require("../TextArea/AutocompleteTextArea.cjs");
|
|
13
13
|
require("react-intlayer");
|
|
14
|
-
require("../../index-
|
|
15
|
-
require("@intlayer/config/
|
|
14
|
+
require("../../index-DSM_b0c2.cjs");
|
|
15
|
+
require("@intlayer/config/built");
|
|
16
16
|
const components_Auth_useUser_index = require("../Auth/useUser/index.cjs");
|
|
17
17
|
require("../Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs");
|
|
18
18
|
require("@hookform/resolvers");
|
|
@@ -9,8 +9,8 @@ import "../Input/Input.mjs";
|
|
|
9
9
|
import "../Input/Checkbox.mjs";
|
|
10
10
|
import { AutoCompleteTextarea } from "../TextArea/AutocompleteTextArea.mjs";
|
|
11
11
|
import "react-intlayer";
|
|
12
|
-
import "../../index-
|
|
13
|
-
import "@intlayer/config/
|
|
12
|
+
import "../../index-Dpe_-poI.js";
|
|
13
|
+
import "@intlayer/config/built";
|
|
14
14
|
import { useUser } from "../Auth/useUser/index.mjs";
|
|
15
15
|
import "../Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs";
|
|
16
16
|
import "@hookform/resolvers";
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs
CHANGED
|
@@ -5,8 +5,8 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
5
5
|
const reactIntlayer = require("react-intlayer");
|
|
6
6
|
const hooks_intlayerAPIHooks = require("../../../hooks/intlayerAPIHooks.cjs");
|
|
7
7
|
require("react");
|
|
8
|
-
require("../../../index-
|
|
9
|
-
require("@intlayer/config/
|
|
8
|
+
require("../../../index-DSM_b0c2.cjs");
|
|
9
|
+
require("@intlayer/config/built");
|
|
10
10
|
require("../../Button/Button.cjs");
|
|
11
11
|
require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
12
12
|
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useDictionary } from "react-intlayer";
|
|
4
4
|
import { useAddDictionary, useGetProjects } from "../../../hooks/intlayerAPIHooks.mjs";
|
|
5
5
|
import "react";
|
|
6
|
-
import "../../../index-
|
|
7
|
-
import "@intlayer/config/
|
|
6
|
+
import "../../../index-Dpe_-poI.js";
|
|
7
|
+
import "@intlayer/config/built";
|
|
8
8
|
import "../../Button/Button.mjs";
|
|
9
9
|
import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
10
10
|
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryFormSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"useDictionaryFormSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,mBAAmB,GAAI,WAAW,MAAM;;;;;;;;;EAyBpD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CACtC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CACvC,CAAC"}
|
|
@@ -10,8 +10,8 @@ require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
|
10
10
|
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
11
11
|
const hooks_intlayerAPIHooks = require("../../../hooks/intlayerAPIHooks.cjs");
|
|
12
12
|
require("deepmerge");
|
|
13
|
-
require("../../../index-
|
|
14
|
-
require("@intlayer/config/
|
|
13
|
+
require("../../../index-DSM_b0c2.cjs");
|
|
14
|
+
require("@intlayer/config/built");
|
|
15
15
|
require("../../Button/Button.cjs");
|
|
16
16
|
const components_Auth_useAuth_index = require("../../Auth/useAuth/index.cjs");
|
|
17
17
|
require("../../Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs");
|
|
@@ -8,8 +8,8 @@ import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
|
8
8
|
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
9
9
|
import { useGetProjects, useGetTags, useAuditContentDeclarationMetadata } from "../../../hooks/intlayerAPIHooks.mjs";
|
|
10
10
|
import "deepmerge";
|
|
11
|
-
import "../../../index-
|
|
12
|
-
import "@intlayer/config/
|
|
11
|
+
import "../../../index-Dpe_-poI.js";
|
|
12
|
+
import "@intlayer/config/built";
|
|
13
13
|
import "../../Button/Button.mjs";
|
|
14
14
|
import { useAuth } from "../../Auth/useAuth/index.mjs";
|
|
15
15
|
import "../../Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs";
|
package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryDetailsSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"useDictionaryDetailsSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,0BAA0B,GAAI,WAAW,MAAM;;;;;;;;;;;;;;;;;;EAkE3D,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAC9C,CAAC"}
|
|
@@ -13,6 +13,7 @@ require("fuse.js");
|
|
|
13
13
|
require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
14
14
|
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
15
15
|
require("@intlayer/api");
|
|
16
|
+
require("@intlayer/config/built");
|
|
16
17
|
require("../Toaster/Toast.cjs");
|
|
17
18
|
require("deepmerge");
|
|
18
19
|
require("../Container/index.cjs");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryFieldEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useConfiguration,\n useDictionariesRecordActions,\n useFocusDictionaryActions,\n} from '@intlayer/editor-react';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../Button';\nimport { LocaleSwitcherContentProvider } from '../LocaleSwitcherContentDropDown';\nimport { SwitchSelector } from '../SwitchSelector';\nimport { ContentEditor } from './ContentEditor';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { JSONEditor } from './JSONEditor';\nimport { SaveForm } from './SaveForm/SaveForm';\nimport { StructureEditor } from './StructureEditor';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n isDarkMode?: boolean;\n mode: ('local' | 'remote')[];\n};\n\nenum EditorViewType {\n DetailsEditor,\n ContentEditor,\n StructureEditor,\n JSONEditor,\n}\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n isDarkMode,\n mode,\n}) => {\n const config = useConfiguration();\n const [editorView, setEditorView] = useState<EditorViewType>(\n EditorViewType.ContentEditor\n );\n const { returnToDictionaryList } = useDictionary(\n dictionaryFieldEditorContent\n );\n const { setFocusedContent } = useFocusDictionaryActions();\n const { setLocaleDictionaries } = useDictionariesRecordActions();\n\n useEffect(() => {\n // Focus the dictionary if not focused\n setFocusedContent((prev) => ({\n ...(prev ?? {}),\n dictionaryKey: dictionary.key,\n }));\n setLocaleDictionaries((prev) => ({\n ...prev,\n [dictionary.key]: dictionary,\n }));\n }, []);\n\n return (\n <LocaleSwitcherContentProvider\n availableLocales={config?.internationalization.locales ?? []}\n >\n <div className=\"flex size-full flex-col gap-6 px-2\">\n <Button\n onClick={onClickDictionaryList}\n variant=\"hoverable\"\n className=\"z-10 ml-5 mr-auto\"\n color=\"text\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n >\n {returnToDictionaryList.text}\n </Button>\n\n <SwitchSelector\n defaultValue={editorView}\n onChange={(value) => setEditorView(value)}\n color=\"text\"\n size=\"sm\"\n className=\"m-auto w-full max-w-xl\"\n choices={[\n {\n content: 'Details',\n value: EditorViewType.DetailsEditor,\n },\n {\n content: 'Structure',\n value: EditorViewType.StructureEditor,\n },\n {\n content: 'Content',\n value: EditorViewType.ContentEditor,\n },\n {\n content: 'JSON',\n value: EditorViewType.JSONEditor,\n },\n ].filter(\n ({ value }) =>\n !(\n !mode.includes('remote') &&\n value === EditorViewType.DetailsEditor\n )\n )}\n />\n\n {editorView === EditorViewType.DetailsEditor && (\n <DictionaryDetailsForm dictionary={dictionary} />\n )}\n {editorView === EditorViewType.StructureEditor && (\n <StructureEditor dictionary={dictionary} />\n )}\n {editorView === EditorViewType.ContentEditor && (\n <ContentEditor dictionary={dictionary} isDarkMode={isDarkMode} />\n )}\n {editorView === EditorViewType.JSONEditor && (\n <JSONEditor dictionary={dictionary} isDarkMode={isDarkMode} />\n )}\n\n <SaveForm dictionary={dictionary} mode={mode} />\n </div>\n </LocaleSwitcherContentProvider>\n );\n};\n"],"names":["useConfiguration","useState","useDictionary","dictionaryFieldEditorContent","useFocusDictionaryActions","useDictionariesRecordActions","useEffect","jsx","LocaleSwitcherContentProvider","jsxs","Button","ArrowLeft","SwitchSelector","DictionaryDetailsForm","StructureEditor","ContentEditor","JSONEditor","SaveForm"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DictionaryFieldEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useConfiguration,\n useDictionariesRecordActions,\n useFocusDictionaryActions,\n} from '@intlayer/editor-react';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../Button';\nimport { LocaleSwitcherContentProvider } from '../LocaleSwitcherContentDropDown';\nimport { SwitchSelector } from '../SwitchSelector';\nimport { ContentEditor } from './ContentEditor';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { JSONEditor } from './JSONEditor';\nimport { SaveForm } from './SaveForm/SaveForm';\nimport { StructureEditor } from './StructureEditor';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n isDarkMode?: boolean;\n mode: ('local' | 'remote')[];\n};\n\nenum EditorViewType {\n DetailsEditor,\n ContentEditor,\n StructureEditor,\n JSONEditor,\n}\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n isDarkMode,\n mode,\n}) => {\n const config = useConfiguration();\n const [editorView, setEditorView] = useState<EditorViewType>(\n EditorViewType.ContentEditor\n );\n const { returnToDictionaryList } = useDictionary(\n dictionaryFieldEditorContent\n );\n const { setFocusedContent } = useFocusDictionaryActions();\n const { setLocaleDictionaries } = useDictionariesRecordActions();\n\n useEffect(() => {\n // Focus the dictionary if not focused\n setFocusedContent((prev) => ({\n ...(prev ?? {}),\n dictionaryKey: dictionary.key,\n }));\n setLocaleDictionaries((prev) => ({\n ...prev,\n [dictionary.key]: dictionary,\n }));\n }, []);\n\n return (\n <LocaleSwitcherContentProvider\n availableLocales={config?.internationalization.locales ?? []}\n >\n <div className=\"flex size-full flex-col gap-6 px-2\">\n <Button\n onClick={onClickDictionaryList}\n variant=\"hoverable\"\n className=\"z-10 ml-5 mr-auto\"\n color=\"text\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n >\n {returnToDictionaryList.text}\n </Button>\n\n <SwitchSelector\n defaultValue={editorView}\n onChange={(value) => setEditorView(value)}\n color=\"text\"\n size=\"sm\"\n className=\"m-auto w-full max-w-xl\"\n choices={[\n {\n content: 'Details',\n value: EditorViewType.DetailsEditor,\n },\n {\n content: 'Structure',\n value: EditorViewType.StructureEditor,\n },\n {\n content: 'Content',\n value: EditorViewType.ContentEditor,\n },\n {\n content: 'JSON',\n value: EditorViewType.JSONEditor,\n },\n ].filter(\n ({ value }) =>\n !(\n !mode.includes('remote') &&\n value === EditorViewType.DetailsEditor\n )\n )}\n />\n\n {editorView === EditorViewType.DetailsEditor && (\n <DictionaryDetailsForm dictionary={dictionary} />\n )}\n {editorView === EditorViewType.StructureEditor && (\n <StructureEditor dictionary={dictionary} />\n )}\n {editorView === EditorViewType.ContentEditor && (\n <ContentEditor dictionary={dictionary} isDarkMode={isDarkMode} />\n )}\n {editorView === EditorViewType.JSONEditor && (\n <JSONEditor dictionary={dictionary} isDarkMode={isDarkMode} />\n )}\n\n <SaveForm dictionary={dictionary} mode={mode} />\n </div>\n </LocaleSwitcherContentProvider>\n );\n};\n"],"names":["useConfiguration","useState","useDictionary","dictionaryFieldEditorContent","useFocusDictionaryActions","useDictionariesRecordActions","useEffect","jsx","LocaleSwitcherContentProvider","jsxs","Button","ArrowLeft","SwitchSelector","DictionaryDetailsForm","StructureEditor","ContentEditor","JSONEditor","SaveForm"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,SAASA,YAAAA,iBAAiB;AAC1B,QAAA,CAAC,YAAY,aAAa,IAAIC,aAAA;AAAA,IAClC;AAAA;AAAA,EACF;AACM,QAAA,EAAE,2BAA2BC,cAAA;AAAA,IACjCC,+DAAAA;AAAAA,EACF;AACM,QAAA,EAAE,kBAAkB,IAAIC,sCAA0B;AAClD,QAAA,EAAE,sBAAsB,IAAIC,yCAA6B;AAE/DC,eAAAA,UAAU,MAAM;AAEd,sBAAkB,CAAC,UAAU;AAAA,MAC3B,GAAI,QAAQ,CAAC;AAAA,MACb,eAAe,WAAW;AAAA,IAAA,EAC1B;AACF,0BAAsB,CAAC,UAAU;AAAA,MAC/B,GAAG;AAAA,MACH,CAAC,WAAW,GAAG,GAAG;AAAA,IAAA,EAClB;AAAA,EACJ,GAAG,EAAE;AAGH,SAAAC,2BAAA;AAAA,IAACC,sEAAA;AAAA,IAAA;AAAA,MACC,kBAAkB,QAAQ,qBAAqB,WAAW,CAAC;AAAA,MAE3D,UAAAC,2BAAA,KAAC,OAAI,EAAA,WAAU,sCACb,UAAA;AAAA,QAAAF,2BAAA;AAAA,UAACG,yBAAA;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT,SAAQ;AAAA,YACR,WAAU;AAAA,YACV,OAAM;AAAA,YACN,MAAMC,YAAA;AAAA,YACN,OAAO,uBAAuB,MAAM;AAAA,YAEnC,UAAuB,uBAAA;AAAA,UAAA;AAAA,QAC1B;AAAA,QAEAJ,2BAAA;AAAA,UAACK,gCAAA;AAAA,UAAA;AAAA,YACC,cAAc;AAAA,YACd,UAAU,CAAC,UAAU,cAAc,KAAK;AAAA,YACxC,OAAM;AAAA,YACN,MAAK;AAAA,YACL,WAAU;AAAA,YACV,SAAS;AAAA,cACP;AAAA,gBACE,SAAS;AAAA,gBACT,OAAO;AAAA;AAAA,cACT;AAAA,cACA;AAAA,gBACE,SAAS;AAAA,gBACT,OAAO;AAAA;AAAA,cACT;AAAA,cACA;AAAA,gBACE,SAAS;AAAA,gBACT,OAAO;AAAA;AAAA,cACT;AAAA,cACA;AAAA,gBACE,SAAS;AAAA,gBACT,OAAO;AAAA;AAAA,cAAA;AAAA,YACT,EACA;AAAA,cACA,CAAC,EAAE,MACD,MAAA,EACE,CAAC,KAAK,SAAS,QAAQ,KACvB,UAAU;AAAA,YAAA;AAAA,UAEhB;AAAA,QACF;AAAA,QAEC,eAAe,KACbL,2BAAAA,IAAAM,yEAAAA,uBAAA,EAAsB,WAAwB,CAAA;AAAA,QAEhD,eAAe,KACbN,2BAAAA,IAAAO,iDAAAA,iBAAA,EAAgB,WAAwB,CAAA;AAAA,QAE1C,eAAe,KACbP,2BAAA,IAAAQ,+CAAA,eAAA,EAAc,YAAwB,YAAwB;AAAA,QAEhE,eAAe,KACbR,2BAAA,IAAAS,4CAAA,YAAA,EAAW,YAAwB,YAAwB;AAAA,QAG9DT,2BAAAA,IAACU,mDAAS,UAAA,EAAA,YAAwB,KAAY,CAAA;AAAA,MAAA,EAChD,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
|
|
@@ -11,6 +11,7 @@ import "fuse.js";
|
|
|
11
11
|
import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
12
12
|
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
13
13
|
import "@intlayer/api";
|
|
14
|
+
import "@intlayer/config/built";
|
|
14
15
|
import "../Toaster/Toast.mjs";
|
|
15
16
|
import "deepmerge";
|
|
16
17
|
import "../Container/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryFieldEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useConfiguration,\n useDictionariesRecordActions,\n useFocusDictionaryActions,\n} from '@intlayer/editor-react';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../Button';\nimport { LocaleSwitcherContentProvider } from '../LocaleSwitcherContentDropDown';\nimport { SwitchSelector } from '../SwitchSelector';\nimport { ContentEditor } from './ContentEditor';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { JSONEditor } from './JSONEditor';\nimport { SaveForm } from './SaveForm/SaveForm';\nimport { StructureEditor } from './StructureEditor';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n isDarkMode?: boolean;\n mode: ('local' | 'remote')[];\n};\n\nenum EditorViewType {\n DetailsEditor,\n ContentEditor,\n StructureEditor,\n JSONEditor,\n}\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n isDarkMode,\n mode,\n}) => {\n const config = useConfiguration();\n const [editorView, setEditorView] = useState<EditorViewType>(\n EditorViewType.ContentEditor\n );\n const { returnToDictionaryList } = useDictionary(\n dictionaryFieldEditorContent\n );\n const { setFocusedContent } = useFocusDictionaryActions();\n const { setLocaleDictionaries } = useDictionariesRecordActions();\n\n useEffect(() => {\n // Focus the dictionary if not focused\n setFocusedContent((prev) => ({\n ...(prev ?? {}),\n dictionaryKey: dictionary.key,\n }));\n setLocaleDictionaries((prev) => ({\n ...prev,\n [dictionary.key]: dictionary,\n }));\n }, []);\n\n return (\n <LocaleSwitcherContentProvider\n availableLocales={config?.internationalization.locales ?? []}\n >\n <div className=\"flex size-full flex-col gap-6 px-2\">\n <Button\n onClick={onClickDictionaryList}\n variant=\"hoverable\"\n className=\"z-10 ml-5 mr-auto\"\n color=\"text\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n >\n {returnToDictionaryList.text}\n </Button>\n\n <SwitchSelector\n defaultValue={editorView}\n onChange={(value) => setEditorView(value)}\n color=\"text\"\n size=\"sm\"\n className=\"m-auto w-full max-w-xl\"\n choices={[\n {\n content: 'Details',\n value: EditorViewType.DetailsEditor,\n },\n {\n content: 'Structure',\n value: EditorViewType.StructureEditor,\n },\n {\n content: 'Content',\n value: EditorViewType.ContentEditor,\n },\n {\n content: 'JSON',\n value: EditorViewType.JSONEditor,\n },\n ].filter(\n ({ value }) =>\n !(\n !mode.includes('remote') &&\n value === EditorViewType.DetailsEditor\n )\n )}\n />\n\n {editorView === EditorViewType.DetailsEditor && (\n <DictionaryDetailsForm dictionary={dictionary} />\n )}\n {editorView === EditorViewType.StructureEditor && (\n <StructureEditor dictionary={dictionary} />\n )}\n {editorView === EditorViewType.ContentEditor && (\n <ContentEditor dictionary={dictionary} isDarkMode={isDarkMode} />\n )}\n {editorView === EditorViewType.JSONEditor && (\n <JSONEditor dictionary={dictionary} isDarkMode={isDarkMode} />\n )}\n\n <SaveForm dictionary={dictionary} mode={mode} />\n </div>\n </LocaleSwitcherContentProvider>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DictionaryFieldEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useConfiguration,\n useDictionariesRecordActions,\n useFocusDictionaryActions,\n} from '@intlayer/editor-react';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../Button';\nimport { LocaleSwitcherContentProvider } from '../LocaleSwitcherContentDropDown';\nimport { SwitchSelector } from '../SwitchSelector';\nimport { ContentEditor } from './ContentEditor';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { JSONEditor } from './JSONEditor';\nimport { SaveForm } from './SaveForm/SaveForm';\nimport { StructureEditor } from './StructureEditor';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n isDarkMode?: boolean;\n mode: ('local' | 'remote')[];\n};\n\nenum EditorViewType {\n DetailsEditor,\n ContentEditor,\n StructureEditor,\n JSONEditor,\n}\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n isDarkMode,\n mode,\n}) => {\n const config = useConfiguration();\n const [editorView, setEditorView] = useState<EditorViewType>(\n EditorViewType.ContentEditor\n );\n const { returnToDictionaryList } = useDictionary(\n dictionaryFieldEditorContent\n );\n const { setFocusedContent } = useFocusDictionaryActions();\n const { setLocaleDictionaries } = useDictionariesRecordActions();\n\n useEffect(() => {\n // Focus the dictionary if not focused\n setFocusedContent((prev) => ({\n ...(prev ?? {}),\n dictionaryKey: dictionary.key,\n }));\n setLocaleDictionaries((prev) => ({\n ...prev,\n [dictionary.key]: dictionary,\n }));\n }, []);\n\n return (\n <LocaleSwitcherContentProvider\n availableLocales={config?.internationalization.locales ?? []}\n >\n <div className=\"flex size-full flex-col gap-6 px-2\">\n <Button\n onClick={onClickDictionaryList}\n variant=\"hoverable\"\n className=\"z-10 ml-5 mr-auto\"\n color=\"text\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n >\n {returnToDictionaryList.text}\n </Button>\n\n <SwitchSelector\n defaultValue={editorView}\n onChange={(value) => setEditorView(value)}\n color=\"text\"\n size=\"sm\"\n className=\"m-auto w-full max-w-xl\"\n choices={[\n {\n content: 'Details',\n value: EditorViewType.DetailsEditor,\n },\n {\n content: 'Structure',\n value: EditorViewType.StructureEditor,\n },\n {\n content: 'Content',\n value: EditorViewType.ContentEditor,\n },\n {\n content: 'JSON',\n value: EditorViewType.JSONEditor,\n },\n ].filter(\n ({ value }) =>\n !(\n !mode.includes('remote') &&\n value === EditorViewType.DetailsEditor\n )\n )}\n />\n\n {editorView === EditorViewType.DetailsEditor && (\n <DictionaryDetailsForm dictionary={dictionary} />\n )}\n {editorView === EditorViewType.StructureEditor && (\n <StructureEditor dictionary={dictionary} />\n )}\n {editorView === EditorViewType.ContentEditor && (\n <ContentEditor dictionary={dictionary} isDarkMode={isDarkMode} />\n )}\n {editorView === EditorViewType.JSONEditor && (\n <JSONEditor dictionary={dictionary} isDarkMode={isDarkMode} />\n )}\n\n <SaveForm dictionary={dictionary} mode={mode} />\n </div>\n </LocaleSwitcherContentProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,SAAS,iBAAiB;AAC1B,QAAA,CAAC,YAAY,aAAa,IAAI;AAAA,IAClC;AAAA;AAAA,EACF;AACM,QAAA,EAAE,2BAA2B;AAAA,IACjC;AAAA,EACF;AACM,QAAA,EAAE,kBAAkB,IAAI,0BAA0B;AAClD,QAAA,EAAE,sBAAsB,IAAI,6BAA6B;AAE/D,YAAU,MAAM;AAEd,sBAAkB,CAAC,UAAU;AAAA,MAC3B,GAAI,QAAQ,CAAC;AAAA,MACb,eAAe,WAAW;AAAA,IAAA,EAC1B;AACF,0BAAsB,CAAC,UAAU;AAAA,MAC/B,GAAG;AAAA,MACH,CAAC,WAAW,GAAG,GAAG;AAAA,IAAA,EAClB;AAAA,EACJ,GAAG,EAAE;AAGH,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,kBAAkB,QAAQ,qBAAqB,WAAW,CAAC;AAAA,MAE3D,UAAA,qBAAC,OAAI,EAAA,WAAU,sCACb,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT,SAAQ;AAAA,YACR,WAAU;AAAA,YACV,OAAM;AAAA,YACN,MAAM;AAAA,YACN,OAAO,uBAAuB,MAAM;AAAA,YAEnC,UAAuB,uBAAA;AAAA,UAAA;AAAA,QAC1B;AAAA,QAEA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,cAAc;AAAA,YACd,UAAU,CAAC,UAAU,cAAc,KAAK;AAAA,YACxC,OAAM;AAAA,YACN,MAAK;AAAA,YACL,WAAU;AAAA,YACV,SAAS;AAAA,cACP;AAAA,gBACE,SAAS;AAAA,gBACT,OAAO;AAAA;AAAA,cACT;AAAA,cACA;AAAA,gBACE,SAAS;AAAA,gBACT,OAAO;AAAA;AAAA,cACT;AAAA,cACA;AAAA,gBACE,SAAS;AAAA,gBACT,OAAO;AAAA;AAAA,cACT;AAAA,cACA;AAAA,gBACE,SAAS;AAAA,gBACT,OAAO;AAAA;AAAA,cAAA;AAAA,YACT,EACA;AAAA,cACA,CAAC,EAAE,MACD,MAAA,EACE,CAAC,KAAK,SAAS,QAAQ,KACvB,UAAU;AAAA,YAAA;AAAA,UAEhB;AAAA,QACF;AAAA,QAEC,eAAe,KACb,oBAAA,uBAAA,EAAsB,WAAwB,CAAA;AAAA,QAEhD,eAAe,KACb,oBAAA,iBAAA,EAAgB,WAAwB,CAAA;AAAA,QAE1C,eAAe,KACb,oBAAA,eAAA,EAAc,YAAwB,YAAwB;AAAA,QAEhE,eAAe,KACb,oBAAA,YAAA,EAAW,YAAwB,YAAwB;AAAA,QAG9D,oBAAC,UAAS,EAAA,YAAwB,KAAY,CAAA;AAAA,MAAA,EAChD,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const
|
|
4
|
+
const configuration = require("@intlayer/config/built");
|
|
5
5
|
const core = require("@intlayer/core");
|
|
6
6
|
const editorReact = require("@intlayer/editor-react");
|
|
7
7
|
const lucideReact = require("lucide-react");
|
|
@@ -18,7 +18,7 @@ const NavigationViewNode = ({
|
|
|
18
18
|
keyPath,
|
|
19
19
|
dictionaryKey
|
|
20
20
|
}) => {
|
|
21
|
-
const { locales } =
|
|
21
|
+
const { locales } = configuration?.internationalization;
|
|
22
22
|
const section = core.getContentNodeByKeyPath(sectionProp, keyPath);
|
|
23
23
|
const { addEditedContent } = editorReact.useEditedContentActions();
|
|
24
24
|
const { setFocusedContentKeyPath, focusedContent } = editorReact.useFocusDictionary();
|