@intlayer/design-system 9.0.0-canary.10 → 9.0.0-canary.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/api/hooks/organization.mjs +9 -1
- package/dist/esm/api/hooks/organization.mjs.map +1 -1
- package/dist/esm/api/hooks/utils.mjs +1 -1
- package/dist/esm/api/index.mjs +2 -2
- package/dist/esm/api/useAuth/useOAuth2.mjs +2 -2
- package/dist/esm/api/useAuth/useSession.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/DictionaryEditor.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/BooleanWrapper.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/FileWrapper.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/NumberWrapper.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/JSONEditor.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/StructureEditor.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +1 -1
- package/dist/esm/components/Form/elements/OTPElement.mjs +1 -1
- package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -1
- package/dist/esm/components/Modal/Modal.mjs +2 -2
- package/dist/esm/components/Navbar/MobileNavbar.mjs +1 -1
- package/dist/esm/components/Pagination/Pagination.mjs +1 -1
- package/dist/esm/components/RightDrawer/RightDrawer.mjs +3 -3
- package/dist/esm/components/Tab/Tab.mjs +1 -1
- package/dist/esm/components/WithResizer/index.mjs +1 -1
- package/dist/esm/components/WithResizer/index.mjs.map +1 -1
- package/dist/esm/hooks/index.mjs +8 -8
- package/dist/esm/providers/ReactQueryProvider.mjs +1 -1
- package/dist/esm/routes.mjs +2 -1
- package/dist/esm/routes.mjs.map +1 -1
- package/dist/types/api/hooks/organization.d.ts +2 -1
- package/dist/types/api/hooks/organization.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +2 -2
- package/dist/types/api/useIntlayerAPI.d.ts +1 -1
- package/dist/types/components/Badge/index.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +2 -2
- package/dist/types/components/Container/index.d.ts +1 -1
- package/dist/types/components/Input/Checkbox.d.ts +1 -1
- package/dist/types/components/Input/Radio.d.ts +1 -1
- package/dist/types/components/Link/Link.d.ts +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts +2 -2
- package/dist/types/components/SwitchSelector/SwitchSelector.d.ts +2 -2
- package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts +1 -1
- package/dist/types/components/Tab/Tab.d.ts +1 -1
- package/dist/types/components/TabSelector/TabSelector.d.ts +1 -1
- package/dist/types/components/Tag/index.d.ts +1 -1
- package/dist/types/components/Toaster/Toast.d.ts +1 -1
- package/dist/types/routes.d.ts +2 -1
- package/dist/types/routes.d.ts.map +1 -1
- package/package.json +22 -22
|
@@ -28,6 +28,14 @@ const useUpdateOrganization = () => {
|
|
|
28
28
|
mutationFn: (args) => organizationAPI.updateOrganization(args)
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
|
+
const useUpdateOrganizationMailerConfig = () => {
|
|
32
|
+
const organizationAPI = useOrganizationAPI();
|
|
33
|
+
return useMutation({
|
|
34
|
+
mutationKey: ["organizations"],
|
|
35
|
+
mutationFn: (args) => organizationAPI.updateOrganizationMailerConfig(args),
|
|
36
|
+
meta: { invalidateQueries: [["organizations"], ["session"]] }
|
|
37
|
+
});
|
|
38
|
+
};
|
|
31
39
|
const useUpdateOrganizationMembers = () => {
|
|
32
40
|
const organizationAPI = useOrganizationAPI();
|
|
33
41
|
return useMutation({
|
|
@@ -119,5 +127,5 @@ const useUnselectOrganization = () => {
|
|
|
119
127
|
};
|
|
120
128
|
|
|
121
129
|
//#endregion
|
|
122
|
-
export { useAddOrganization, useAddOrganizationMember, useDeleteOrganization, useDeleteOrganizationById, useGetOrganizations, useSelectOrganization, useUnselectOrganization, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById };
|
|
130
|
+
export { useAddOrganization, useAddOrganizationMember, useDeleteOrganization, useDeleteOrganizationById, useGetOrganizations, useSelectOrganization, useUnselectOrganization, useUpdateOrganization, useUpdateOrganizationMailerConfig, useUpdateOrganizationMembers, useUpdateOrganizationMembersById };
|
|
123
131
|
//# sourceMappingURL=organization.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.mjs","names":[],"sources":["../../../../src/api/hooks/organization.ts"],"sourcesContent":["'use client';\n\nimport type {\n AddOrganizationBody,\n AddOrganizationMemberBody,\n GetOrganizationsParams,\n SelectOrganizationParam,\n UpdateOrganizationBody,\n UpdateOrganizationMembersBody,\n} from '@intlayer/backend';\nimport { useMutation, useQueryClient } from '@tanstack/react-query';\nimport { useOrganizationAPI } from '../useIntlayerAPI';\nimport { useAppQuery } from './utils';\n\nexport const useGetOrganizations = (filters?: GetOrganizationsParams) => {\n const organizationAPI = useOrganizationAPI();\n\n return useAppQuery({\n queryKey: ['organizations', filters],\n queryFn: ({ signal }) =>\n organizationAPI.getOrganizations(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n });\n};\n\nexport const useAddOrganization = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: AddOrganizationBody) =>\n organizationAPI.addOrganization(args),\n meta: {\n invalidateQueries: [['organizations']],\n },\n });\n};\n\nexport const useUpdateOrganization = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: UpdateOrganizationBody) =>\n organizationAPI.updateOrganization(args),\n });\n};\n\nexport const useUpdateOrganizationMembers = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: UpdateOrganizationMembersBody) =>\n organizationAPI.updateOrganizationMembers(args),\n meta: {\n invalidateQueries: [['organizations'], ['users']],\n },\n });\n};\n\nexport const useUpdateOrganizationMembersById = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: ({\n organizationId,\n ...body\n }: {\n organizationId: string;\n membersIds: string[];\n adminsIds?: string[];\n }) => organizationAPI.updateOrganizationMembersById(organizationId, body),\n meta: {\n invalidateQueries: [['organizations'], ['users']],\n },\n });\n};\n\nexport const useAddOrganizationMember = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: AddOrganizationMemberBody) =>\n organizationAPI.addOrganizationMember(args),\n meta: {\n invalidateQueries: [['organizations']],\n },\n });\n};\n\nexport const useDeleteOrganization = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: () => organizationAPI.deleteOrganization(),\n meta: {\n invalidateQueries: [['organizations'], ['session']],\n },\n });\n};\n\nexport const useDeleteOrganizationById = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (organizationId: string) =>\n organizationAPI.deleteOrganizationByIdAdmin(organizationId),\n meta: {\n invalidateQueries: [['organizations']],\n },\n });\n};\n\nexport const useSelectOrganization = () => {\n const organizationAPI = useOrganizationAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-organizations'],\n mutationFn: (args: SelectOrganizationParam) =>\n organizationAPI.selectOrganization(args),\n meta: {\n invalidateQueries: [\n ['session'],\n ['organizations'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n organization: data.data,\n });\n },\n });\n};\n\nexport const useUnselectOrganization = () => {\n const organizationAPI = useOrganizationAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-organizations'],\n mutationFn: () => organizationAPI.unselectOrganization(),\n meta: {\n resetQueries: [\n ['session'],\n ['organizations'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: () => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n organization: null,\n project: null,\n });\n },\n });\n};\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"organization.mjs","names":[],"sources":["../../../../src/api/hooks/organization.ts"],"sourcesContent":["'use client';\n\nimport type {\n AddOrganizationBody,\n AddOrganizationMemberBody,\n GetOrganizationsParams,\n SelectOrganizationParam,\n UpdateOrganizationBody,\n UpdateOrganizationMailerConfigBody,\n UpdateOrganizationMembersBody,\n} from '@intlayer/backend';\nimport { useMutation, useQueryClient } from '@tanstack/react-query';\nimport { useOrganizationAPI } from '../useIntlayerAPI';\nimport { useAppQuery } from './utils';\n\nexport const useGetOrganizations = (filters?: GetOrganizationsParams) => {\n const organizationAPI = useOrganizationAPI();\n\n return useAppQuery({\n queryKey: ['organizations', filters],\n queryFn: ({ signal }) =>\n organizationAPI.getOrganizations(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n });\n};\n\nexport const useAddOrganization = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: AddOrganizationBody) =>\n organizationAPI.addOrganization(args),\n meta: {\n invalidateQueries: [['organizations']],\n },\n });\n};\n\nexport const useUpdateOrganization = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: UpdateOrganizationBody) =>\n organizationAPI.updateOrganization(args),\n });\n};\n\nexport const useUpdateOrganizationMailerConfig = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: UpdateOrganizationMailerConfigBody) =>\n organizationAPI.updateOrganizationMailerConfig(args),\n meta: {\n invalidateQueries: [['organizations'], ['session']],\n },\n });\n};\n\nexport const useUpdateOrganizationMembers = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: UpdateOrganizationMembersBody) =>\n organizationAPI.updateOrganizationMembers(args),\n meta: {\n invalidateQueries: [['organizations'], ['users']],\n },\n });\n};\n\nexport const useUpdateOrganizationMembersById = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: ({\n organizationId,\n ...body\n }: {\n organizationId: string;\n membersIds: string[];\n adminsIds?: string[];\n }) => organizationAPI.updateOrganizationMembersById(organizationId, body),\n meta: {\n invalidateQueries: [['organizations'], ['users']],\n },\n });\n};\n\nexport const useAddOrganizationMember = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: AddOrganizationMemberBody) =>\n organizationAPI.addOrganizationMember(args),\n meta: {\n invalidateQueries: [['organizations']],\n },\n });\n};\n\nexport const useDeleteOrganization = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: () => organizationAPI.deleteOrganization(),\n meta: {\n invalidateQueries: [['organizations'], ['session']],\n },\n });\n};\n\nexport const useDeleteOrganizationById = () => {\n const organizationAPI = useOrganizationAPI();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (organizationId: string) =>\n organizationAPI.deleteOrganizationByIdAdmin(organizationId),\n meta: {\n invalidateQueries: [['organizations']],\n },\n });\n};\n\nexport const useSelectOrganization = () => {\n const organizationAPI = useOrganizationAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-organizations'],\n mutationFn: (args: SelectOrganizationParam) =>\n organizationAPI.selectOrganization(args),\n meta: {\n invalidateQueries: [\n ['session'],\n ['organizations'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n organization: data.data,\n });\n },\n });\n};\n\nexport const useUnselectOrganization = () => {\n const organizationAPI = useOrganizationAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-organizations'],\n mutationFn: () => organizationAPI.unselectOrganization(),\n meta: {\n resetQueries: [\n ['session'],\n ['organizations'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: () => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n organization: null,\n project: null,\n });\n },\n });\n};\n"],"mappings":";;;;;;;AAeA,MAAa,uBAAuB,YAAqC;CACvE,MAAM,kBAAkB,oBAAoB;AAE5C,QAAO,YAAY;EACjB,UAAU,CAAC,iBAAiB,QAAQ;EACpC,UAAU,EAAE,aACV,gBAAgB,iBAAiB,SAAS,EAAE,QAAQ,CAAC;EAEvD,aAAa;EACd,CAAC;;AAGJ,MAAa,2BAA2B;CACtC,MAAM,kBAAkB,oBAAoB;AAE5C,QAAO,YAAY;EACjB,aAAa,CAAC,gBAAgB;EAC9B,aAAa,SACX,gBAAgB,gBAAgB,KAAK;EACvC,MAAM,EACJ,mBAAmB,CAAC,CAAC,gBAAgB,CAAC,EACvC;EACF,CAAC;;AAGJ,MAAa,8BAA8B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|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useAuth } from "../useAuth/useAuth.mjs";
|
|
4
|
-
import { useConfiguration } from "@intlayer/editor-react";
|
|
5
4
|
import { useQuery } from "@tanstack/react-query";
|
|
5
|
+
import { useConfiguration } from "@intlayer/editor-react";
|
|
6
6
|
|
|
7
7
|
//#region src/api/hooks/utils.ts
|
|
8
8
|
const useAuthEnable = ({ requireUser, requireProject, requireOrganization }) => {
|
package/dist/esm/api/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { useAddEnvironment, useDeleteEnvironment, useMigrateEnvironment, useRese
|
|
|
14
14
|
import { useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGithubToken } from "./hooks/github.mjs";
|
|
15
15
|
import { useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects } from "./hooks/gitlab.mjs";
|
|
16
16
|
import { useGetNewsletterStatus, useSubscribeToNewsletter, useUnsubscribeFromNewsletter } from "./hooks/newsletter.mjs";
|
|
17
|
-
import { useAddOrganization, useAddOrganizationMember, useDeleteOrganization, useDeleteOrganizationById, useGetOrganizations, useSelectOrganization, useUnselectOrganization, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById } from "./hooks/organization.mjs";
|
|
17
|
+
import { useAddOrganization, useAddOrganizationMember, useDeleteOrganization, useDeleteOrganizationById, useGetOrganizations, useSelectOrganization, useUnselectOrganization, useUpdateOrganization, useUpdateOrganizationMailerConfig, useUpdateOrganizationMembers, useUpdateOrganizationMembersById } from "./hooks/organization.mjs";
|
|
18
18
|
import { useAddNewAccessKey, useAddProject, useDeleteAccessKey, useDeleteProject, useDeleteProjectById, useGetCIConfig, useGetProjectInsights, useGetProjects, usePushCIConfig, usePushProjectConfiguration, useRefreshAccessKey, useSelectProject, useTriggerBuild, useTriggerWebhook, useUnselectProject, useUpdateMemberAccess, useUpdateProject, useUpdateProjectMembers } from "./hooks/project.mjs";
|
|
19
19
|
import { useContactReviewer, useCreateMission, useDeleteReviewerProfile, useEstimateMission, useGetAdminReviewers, useGetChatHistory, useGetMissionById, useGetMyMissions, useGetMyReviewerProfile, useGetReviewerById, useGetReviewerMarketplace, useGetReviewerPriceDistribution, useGetReviewerReviews, useRegisterAsReviewer, useSendReviewerMessage, useSubmitReview, useUpdateMissionStatus, useUpdateReviewerProfile, useUploadReviewerCoverPicture, useUploadReviewerMainPicture, useValidateReviewerProfile } from "./hooks/reviewer.mjs";
|
|
20
20
|
import { useSearchDoc } from "./hooks/search.mjs";
|
|
@@ -25,4 +25,4 @@ import { useFillAllTranslations, usePauseTranslationJob, useResumeTranslationJob
|
|
|
25
25
|
import { useCreateUser, useDeleteUser, useGetUserById, useGetUsers, useUpdateUser, useUploadUserAvatar } from "./hooks/user.mjs";
|
|
26
26
|
import { useUser } from "./useUser/index.mjs";
|
|
27
27
|
|
|
28
|
-
export { useAcceptAffiliateInvitation, useAddDictionary, useAddEnvironment, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddPasskey, useAddProject, useAddTag, useAiAPI, useAskDocQuestion, useAskResetPassword, useAssetAPI, useAuditAPI, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditScan, useAuditTag, useAuth, useAutocomplete, useBitbucketAPI, useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos, useCancelSubscription, useChangePassword, useChat, useContactReviewer, useCreateMission, useCreatePortalSession, useCreatePromoCode, useCreateUser, useCustomQuery, useDeleteAccessKey, useDeleteAsset, useDeleteDictionary, useDeleteEnvironment, useDeleteOrganization, useDeleteOrganizationById, useDeletePasskey, useDeleteProject, useDeleteProjectById, useDeletePromoCode, useDeleteReviewerProfile, useDeleteSSOProvider, useDeleteShowcaseProject, useDeleteTag, useDeleteUser, useDictionaryAPI, useDisableTwoFactor, useEditorAPI, useEnableTwoFactor, useEnvironmentAPI, useEstimateMission, useFillAllTranslations, useGetAIStats, useGetAdminReviewers, useGetAffiliate, useGetAffiliateAccountSession, useGetAffiliateById, useGetAffiliateInvitation, useGetAffiliateInvitations, useGetAffiliateOnboardingLink, useGetAffiliatePromoCode, useGetAffiliateStats, useGetAffiliates, useGetAssetById, useGetAssets, useGetCIConfig, useGetChatHistory, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetDiscussions, useGetDiscussionsData, useGetEditorDictionaries, useGetInvoices, useGetMissionById, useGetMyMissions, useGetMyReviewerProfile, useGetNewsletterStatus, useGetOrganizations, useGetOtherShowcaseProjects, useGetPaymentMethod, useGetPricing, useGetProjectInsights, useGetProjects, useGetPromoCodeById, useGetPromoCodes, useGetRecursiveAuditStatus, useGetReviewerById, useGetReviewerMarketplace, useGetReviewerPriceDistribution, useGetReviewerReviews, useGetShowcaseProjectById, useGetShowcaseProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUserById, useGetUsers, useGetVerifyEmailStatus, useGithubAPI, useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGithubToken, useGitlabAPI, useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects, useGrantAffiliateAccess, useInfiniteGetDictionaries, useIntlayerAuth, useIntlayerOAuth, useIntlayerOAuthOptions, useLinkSocial, useListAccounts, useListPasskeys, useListSSOProviders, useLogin, useLogout, useMigrateEnvironment, useNewsletterAPI, useOAuth2, useOAuthAPI, useOrganizationAPI, usePauseTranslationJob, useProjectAPI, usePushCIConfig, usePushDictionaries, usePushProjectConfiguration, useRefreshAccessKey, useRegister, useRegisterAsReviewer, useRegisterSSO, useResetPassword, useResetToProductionEnvironment, useResumeTranslationJob, useReviewerAPI, useSearchAPI, useSearchDoc, useSelectEnvironment, useSelectOrganization, useSelectProject, useSendAffiliateInvitation, useSendReviewerMessage, useSession, useShowcaseProjectAPI, useSignInMagicLink, useSignInPasskey, useSignInSSO, useStartRecursiveAudit, useStopTranslationJob, useStripeAPI, useSubmitReview, useSubmitShowcaseProject, useSubscribeToNewsletter, useTagAPI, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useTranslateAPI, useTranslateJSONDeclaration, useTriggerBuild, useTriggerWebhook, useUnlinkAccount, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateAffiliateStatus, useUpdateAsset, useUpdateDictionary, useUpdateEnvironment, useUpdateMemberAccess, useUpdateMissionStatus, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById, useUpdateProject, useUpdateProjectMembers, useUpdatePromoCode, useUpdateReviewerProfile, useUpdateShowcaseProject, useUpdateTag, useUpdateUser, useUploadAsset, useUploadReviewerCoverPicture, useUploadReviewerMainPicture, useUploadUserAvatar, useUser, useUserAPI, useValidateReviewerProfile, useVerifyBackupCode, useVerifyEmail, useVerifyTotp, useWriteDictionary };
|
|
28
|
+
export { useAcceptAffiliateInvitation, useAddDictionary, useAddEnvironment, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddPasskey, useAddProject, useAddTag, useAiAPI, useAskDocQuestion, useAskResetPassword, useAssetAPI, useAuditAPI, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditScan, useAuditTag, useAuth, useAutocomplete, useBitbucketAPI, useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos, useCancelSubscription, useChangePassword, useChat, useContactReviewer, useCreateMission, useCreatePortalSession, useCreatePromoCode, useCreateUser, useCustomQuery, useDeleteAccessKey, useDeleteAsset, useDeleteDictionary, useDeleteEnvironment, useDeleteOrganization, useDeleteOrganizationById, useDeletePasskey, useDeleteProject, useDeleteProjectById, useDeletePromoCode, useDeleteReviewerProfile, useDeleteSSOProvider, useDeleteShowcaseProject, useDeleteTag, useDeleteUser, useDictionaryAPI, useDisableTwoFactor, useEditorAPI, useEnableTwoFactor, useEnvironmentAPI, useEstimateMission, useFillAllTranslations, useGetAIStats, useGetAdminReviewers, useGetAffiliate, useGetAffiliateAccountSession, useGetAffiliateById, useGetAffiliateInvitation, useGetAffiliateInvitations, useGetAffiliateOnboardingLink, useGetAffiliatePromoCode, useGetAffiliateStats, useGetAffiliates, useGetAssetById, useGetAssets, useGetCIConfig, useGetChatHistory, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetDiscussions, useGetDiscussionsData, useGetEditorDictionaries, useGetInvoices, useGetMissionById, useGetMyMissions, useGetMyReviewerProfile, useGetNewsletterStatus, useGetOrganizations, useGetOtherShowcaseProjects, useGetPaymentMethod, useGetPricing, useGetProjectInsights, useGetProjects, useGetPromoCodeById, useGetPromoCodes, useGetRecursiveAuditStatus, useGetReviewerById, useGetReviewerMarketplace, useGetReviewerPriceDistribution, useGetReviewerReviews, useGetShowcaseProjectById, useGetShowcaseProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUserById, useGetUsers, useGetVerifyEmailStatus, useGithubAPI, useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGithubToken, useGitlabAPI, useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects, useGrantAffiliateAccess, useInfiniteGetDictionaries, useIntlayerAuth, useIntlayerOAuth, useIntlayerOAuthOptions, useLinkSocial, useListAccounts, useListPasskeys, useListSSOProviders, useLogin, useLogout, useMigrateEnvironment, useNewsletterAPI, useOAuth2, useOAuthAPI, useOrganizationAPI, usePauseTranslationJob, useProjectAPI, usePushCIConfig, usePushDictionaries, usePushProjectConfiguration, useRefreshAccessKey, useRegister, useRegisterAsReviewer, useRegisterSSO, useResetPassword, useResetToProductionEnvironment, useResumeTranslationJob, useReviewerAPI, useSearchAPI, useSearchDoc, useSelectEnvironment, useSelectOrganization, useSelectProject, useSendAffiliateInvitation, useSendReviewerMessage, useSession, useShowcaseProjectAPI, useSignInMagicLink, useSignInPasskey, useSignInSSO, useStartRecursiveAudit, useStopTranslationJob, useStripeAPI, useSubmitReview, useSubmitShowcaseProject, useSubscribeToNewsletter, useTagAPI, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useTranslateAPI, useTranslateJSONDeclaration, useTriggerBuild, useTriggerWebhook, useUnlinkAccount, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateAffiliateStatus, useUpdateAsset, useUpdateDictionary, useUpdateEnvironment, useUpdateMemberAccess, useUpdateMissionStatus, useUpdateOrganization, useUpdateOrganizationMailerConfig, useUpdateOrganizationMembers, useUpdateOrganizationMembersById, useUpdateProject, useUpdateProjectMembers, useUpdatePromoCode, useUpdateReviewerProfile, useUpdateShowcaseProject, useUpdateTag, useUpdateUser, useUploadAsset, useUploadReviewerCoverPicture, useUploadReviewerMainPicture, useUploadUserAvatar, useUser, useUserAPI, useValidateReviewerProfile, useVerifyBackupCode, useVerifyEmail, useVerifyTotp, useWriteDictionary };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { getOAuthAPI } from "@intlayer/api";
|
|
4
|
-
import { useConfiguration } from "@intlayer/editor-react";
|
|
5
3
|
import { editor } from "@intlayer/config/built";
|
|
6
4
|
import { useQuery } from "@tanstack/react-query";
|
|
5
|
+
import { getOAuthAPI } from "@intlayer/api";
|
|
6
|
+
import { useConfiguration } from "@intlayer/editor-react";
|
|
7
7
|
import { defu } from "defu";
|
|
8
8
|
|
|
9
9
|
//#region src/api/useAuth/useOAuth2.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { getAuthAPI } from "../../libs/auth.mjs";
|
|
4
|
-
import { useConfiguration } from "@intlayer/editor-react";
|
|
5
4
|
import { editor } from "@intlayer/config/built";
|
|
6
5
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
|
+
import { useConfiguration } from "@intlayer/editor-react";
|
|
7
7
|
|
|
8
8
|
//#region src/api/useAuth/useSession.ts
|
|
9
9
|
const useSession = (sessionProp, intlayerConfiguration) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { NodeWrapper } from "./NodeWrapper/index.mjs";
|
|
4
|
-
import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
5
4
|
import { createElement } from "react";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
7
7
|
|
|
8
8
|
//#region src/components/DictionaryEditor/DictionaryEditor.tsx
|
|
9
9
|
const DictionaryEditor = ({ dictionary, ...props }) => {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../utils/cn.mjs";
|
|
4
4
|
import { SwitchSelector } from "../../SwitchSelector/SwitchSelector.mjs";
|
|
5
|
-
import { useEditorLocale } from "@intlayer/editor-react";
|
|
6
5
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
6
|
+
import { useEditorLocale } from "@intlayer/editor-react";
|
|
7
7
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
8
8
|
|
|
9
9
|
//#region src/components/DictionaryEditor/NodeWrapper/BooleanWrapper.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StringWrapper } from "./StringWrapper.mjs";
|
|
2
|
-
import { useEditedContent } from "@intlayer/editor-react";
|
|
3
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEditedContent } from "@intlayer/editor-react";
|
|
4
4
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
5
5
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../../utils/cn.mjs";
|
|
2
2
|
import { EditableFieldInput } from "../../EditableField/EditableFieldInput.mjs";
|
|
3
|
-
import { useEditorLocale } from "@intlayer/editor-react";
|
|
4
3
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useEditorLocale } from "@intlayer/editor-react";
|
|
5
5
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
6
6
|
|
|
7
7
|
//#region src/components/DictionaryEditor/NodeWrapper/NumberWrapper.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../../utils/cn.mjs";
|
|
2
2
|
import { EditableFieldTextArea } from "../../EditableField/EditableFieldTextArea.mjs";
|
|
3
|
-
import { useEditorLocale } from "@intlayer/editor-react";
|
|
4
3
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useEditorLocale } from "@intlayer/editor-react";
|
|
5
5
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
6
6
|
|
|
7
7
|
//#region src/components/DictionaryEditor/NodeWrapper/StringWrapper.tsx
|
|
@@ -13,9 +13,9 @@ import { NestedObjectWrapper } from "./NestedObjectWrapper.mjs";
|
|
|
13
13
|
import { NumberWrapper } from "./NumberWrapper.mjs";
|
|
14
14
|
import { PluralWrapper } from "./PluralWrapper.mjs";
|
|
15
15
|
import { TranslationWrapper } from "./TranslationWrapper.mjs";
|
|
16
|
-
import { useEditorLocale } from "@intlayer/editor-react";
|
|
17
16
|
import { memo, useMemo } from "react";
|
|
18
17
|
import { jsx } from "react/jsx-runtime";
|
|
18
|
+
import { useEditorLocale } from "@intlayer/editor-react";
|
|
19
19
|
import { getContentNodeByKeyPath, getNodeType } from "@intlayer/core/dictionaryManipulator";
|
|
20
20
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
21
21
|
|
|
@@ -8,9 +8,9 @@ import { TextEditorContainer } from "./ContentEditorView/TextEditor.mjs";
|
|
|
8
8
|
import { getIsEditableSection } from "./getIsEditableSection.mjs";
|
|
9
9
|
import { KeyPathBreadcrumb } from "./KeyPathBreadcrumb.mjs";
|
|
10
10
|
import { NavigationViewNode } from "./NavigationView/NavigationViewNode.mjs";
|
|
11
|
-
import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
12
11
|
import { useCallback, useDeferredValue, useEffect, useMemo, useState, useTransition } from "react";
|
|
13
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
14
14
|
import { useIntlayer } from "react-intlayer";
|
|
15
15
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
16
16
|
|
|
@@ -13,10 +13,10 @@ import { renameKey } from "./object.mjs";
|
|
|
13
13
|
import { Label } from "../../Label/index.mjs";
|
|
14
14
|
import { EnumKeyInput } from "../EnumKeyInput.mjs";
|
|
15
15
|
import { SafeHtmlRenderer } from "./SafeHtmlRenderer.mjs";
|
|
16
|
-
import { useConfiguration, useEditedContent } from "@intlayer/editor-react";
|
|
17
16
|
import { Fragment, Suspense, lazy, memo, useState } from "react";
|
|
18
17
|
import { Plus, Trash, WandSparkles } from "lucide-react";
|
|
19
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
import { useConfiguration, useEditedContent } from "@intlayer/editor-react";
|
|
20
20
|
import { useIntlayer, useLocale } from "react-intlayer";
|
|
21
21
|
import { getLocaleName } from "@intlayer/core/localization";
|
|
22
22
|
import { getEmptyNode, getNodeType } from "@intlayer/core/dictionaryManipulator";
|
package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs
CHANGED
|
@@ -27,10 +27,10 @@ import { SelectElement } from "../../Form/elements/SelectElement.mjs";
|
|
|
27
27
|
import { useForm as useForm$1 } from "../../Form/FormBase.mjs";
|
|
28
28
|
import { Form } from "../../Form/Form.mjs";
|
|
29
29
|
import { useDictionaryDetailsSchema } from "./useDictionaryDetailsSchema.mjs";
|
|
30
|
-
import { useEditedContent } from "@intlayer/editor-react";
|
|
31
30
|
import { useEffect, useMemo, useState } from "react";
|
|
32
31
|
import { WandSparkles } from "lucide-react";
|
|
33
32
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
import { useEditedContent } from "@intlayer/editor-react";
|
|
34
34
|
import { useIntlayer } from "react-intlayer";
|
|
35
35
|
import { useWatch } from "react-hook-form";
|
|
36
36
|
import { AnimatePresence, motion } from "framer-motion";
|
|
@@ -10,10 +10,10 @@ import { DictionaryDetailsForm } from "./DictionaryDetails/DictionaryDetailsForm
|
|
|
10
10
|
import { JSONEditor } from "./JSONEditor.mjs";
|
|
11
11
|
import { SaveForm } from "./SaveForm/SaveForm.mjs";
|
|
12
12
|
import { StructureEditor } from "./StructureEditor.mjs";
|
|
13
|
-
import { useConfiguration, useDictionariesRecordActions, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
14
13
|
import { useEffect, useState } from "react";
|
|
15
14
|
import { ArrowLeft } from "lucide-react";
|
|
16
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { useConfiguration, useDictionariesRecordActions, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
17
17
|
import { useIntlayer } from "react-intlayer";
|
|
18
18
|
|
|
19
19
|
//#region src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MonacoCode } from "../IDE/MonacoCode.mjs";
|
|
2
|
-
import { useEditedContent } from "@intlayer/editor-react";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEditedContent } from "@intlayer/editor-react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/DictionaryFieldEditor/JSONEditor.tsx
|
|
6
6
|
const JSONEditor = ({ dictionary, isDarkMode }) => {
|
|
@@ -2,10 +2,10 @@ import { Button } from "../../Button/Button.mjs";
|
|
|
2
2
|
import { Accordion } from "../../Accordion/Accordion.mjs";
|
|
3
3
|
import { useLocaleSwitcherContent } from "../../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";
|
|
4
4
|
import { getIsEditableSection } from "../getIsEditableSection.mjs";
|
|
5
|
-
import { useEditedContentActions, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
6
5
|
import { useState } from "react";
|
|
7
6
|
import { ChevronRight, Plus } from "lucide-react";
|
|
8
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useEditedContentActions, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
9
9
|
import { useIntlayer } from "react-intlayer";
|
|
10
10
|
import { getContentNodeByKeyPath, getEmptyNode, getNodeType } from "@intlayer/core/dictionaryManipulator";
|
|
11
11
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
@@ -7,10 +7,10 @@ import { useDeleteDictionary, usePushDictionaries } from "../../../api/hooks/dic
|
|
|
7
7
|
import { useWriteDictionary } from "../../../api/hooks/editor.mjs";
|
|
8
8
|
import { Button } from "../../Button/Button.mjs";
|
|
9
9
|
import { Modal } from "../../Modal/Modal.mjs";
|
|
10
|
-
import { useDictionariesRecordActions, useEditedContent } from "@intlayer/editor-react";
|
|
11
10
|
import { useState } from "react";
|
|
12
11
|
import { ArrowUpFromLine, Download, RotateCcw, Save, Trash } from "lucide-react";
|
|
13
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useDictionariesRecordActions, useEditedContent } from "@intlayer/editor-react";
|
|
14
14
|
import { useIntlayer } from "react-intlayer";
|
|
15
15
|
|
|
16
16
|
//#region src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { NodeView } from "./StructureView/StructureView.mjs";
|
|
4
|
-
import { useEditedContent } from "@intlayer/editor-react";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useEditedContent } from "@intlayer/editor-react";
|
|
6
6
|
|
|
7
7
|
//#region src/components/DictionaryFieldEditor/StructureEditor.tsx
|
|
8
8
|
const StructureEditor = ({ dictionary }) => {
|
|
@@ -4,9 +4,9 @@ import { Button } from "../../Button/Button.mjs";
|
|
|
4
4
|
import { Container } from "../../Container/index.mjs";
|
|
5
5
|
import { EditableFieldInput } from "../../EditableField/EditableFieldInput.mjs";
|
|
6
6
|
import { NodeTypeSelector } from "../NodeTypeSelector.mjs";
|
|
7
|
-
import { useConfiguration, useEditedContentActions, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
8
7
|
import { Plus, Trash } from "lucide-react";
|
|
9
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { useConfiguration, useEditedContentActions, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
10
10
|
import { useIntlayer } from "react-intlayer";
|
|
11
11
|
import { getDefaultNode, getNodeChildren, getNodeType } from "@intlayer/core/dictionaryManipulator";
|
|
12
12
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useItemSelector } from "../../../hooks/useItemSelector.mjs";
|
|
4
3
|
import { InputIndicator, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "../../Input/OTPInput.mjs";
|
|
4
|
+
import { useItemSelector } from "../../../hooks/useItemSelector.mjs";
|
|
5
5
|
import { FormField, useFormField } from "../FormField.mjs";
|
|
6
6
|
import { FormItemLayout } from "../layout/FormItemLayout.mjs";
|
|
7
7
|
import { useEffect, useRef } from "react";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { usePersistedStore } from "../../hooks/usePersistedStore.mjs";
|
|
4
3
|
import { Button } from "../Button/Button.mjs";
|
|
5
4
|
import { Container } from "../Container/index.mjs";
|
|
6
5
|
import { DropDown } from "../DropDown/index.mjs";
|
|
7
6
|
import { Input } from "../Input/Input.mjs";
|
|
8
7
|
import { SwitchSelector } from "../SwitchSelector/SwitchSelector.mjs";
|
|
8
|
+
import { usePersistedStore } from "../../hooks/usePersistedStore.mjs";
|
|
9
9
|
import { useLocaleSwitcherContent } from "./LocaleSwitcherContentContext.mjs";
|
|
10
10
|
import { useMemo, useRef, useState } from "react";
|
|
11
11
|
import { Check, Globe, MoveVertical } from "lucide-react";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../utils/cn.mjs";
|
|
4
|
-
import { useGetElementOrWindow } from "../../hooks/useGetElementOrWindow.mjs";
|
|
5
|
-
import { useScrollBlockage } from "../../hooks/useScrollBlockage/index.mjs";
|
|
6
4
|
import { Button } from "../Button/Button.mjs";
|
|
7
5
|
import { Container } from "../Container/index.mjs";
|
|
6
|
+
import { useGetElementOrWindow } from "../../hooks/useGetElementOrWindow.mjs";
|
|
7
|
+
import { useScrollBlockage } from "../../hooks/useScrollBlockage/index.mjs";
|
|
8
8
|
import { H3 } from "../Headers/index.mjs";
|
|
9
9
|
import { useEffect } from "react";
|
|
10
10
|
import { cva } from "class-variance-authority";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../utils/cn.mjs";
|
|
4
|
+
import { MaxHeightSmoother } from "../MaxHeightSmoother/index.mjs";
|
|
4
5
|
import { useScrollBlockage } from "../../hooks/useScrollBlockage/index.mjs";
|
|
5
6
|
import { useScrollDetection } from "../../hooks/useScrollDetection.mjs";
|
|
6
|
-
import { MaxHeightSmoother } from "../MaxHeightSmoother/index.mjs";
|
|
7
7
|
import { Burger } from "./Burger.mjs";
|
|
8
8
|
import { useRef, useState } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../utils/cn.mjs";
|
|
4
|
-
import { useItemSelector } from "../../hooks/useItemSelector.mjs";
|
|
5
4
|
import { Button } from "../Button/Button.mjs";
|
|
5
|
+
import { useItemSelector } from "../../hooks/useItemSelector.mjs";
|
|
6
6
|
import { useEffect, useRef } from "react";
|
|
7
7
|
import { cva } from "class-variance-authority";
|
|
8
8
|
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useGetElementOrWindow } from "../../hooks/useGetElementOrWindow.mjs";
|
|
4
|
-
import { useDevice } from "../../hooks/useDevice.mjs";
|
|
5
|
-
import { useScrollBlockage } from "../../hooks/useScrollBlockage/index.mjs";
|
|
6
3
|
import { Button } from "../Button/Button.mjs";
|
|
7
4
|
import { Container } from "../Container/index.mjs";
|
|
5
|
+
import { useDevice } from "../../hooks/useDevice.mjs";
|
|
8
6
|
import { KeyboardShortcut } from "../KeyboardShortcut/KeyboardShortcut.mjs";
|
|
9
7
|
import { Popover } from "../Popover/dynamic.mjs";
|
|
8
|
+
import { useGetElementOrWindow } from "../../hooks/useGetElementOrWindow.mjs";
|
|
9
|
+
import { useScrollBlockage } from "../../hooks/useScrollBlockage/index.mjs";
|
|
10
10
|
import { MaxWidthSmoother } from "../MaxWidthSmoother/index.mjs";
|
|
11
11
|
import { isElementAtTopAndNotCovered } from "./isElementAtTopAndNotCovered.mjs";
|
|
12
12
|
import { useRightDrawer } from "./useRightDrawer.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../utils/cn.mjs";
|
|
4
|
-
import { useHorizontalSwipe } from "../../hooks/useHorizontalSwipe.mjs";
|
|
5
4
|
import { TabSelector } from "../TabSelector/TabSelector.mjs";
|
|
5
|
+
import { useHorizontalSwipe } from "../../hooks/useHorizontalSwipe.mjs";
|
|
6
6
|
import { useTabContext } from "./TabContext.mjs";
|
|
7
7
|
import { Children, createContext, isValidElement, useState } from "react";
|
|
8
8
|
import { cva } from "class-variance-authority";
|
|
@@ -214,7 +214,7 @@ const WithResizer = ({ initialWidth, maxWidth, minWidth = 0, handlePosition = "r
|
|
|
214
214
|
width
|
|
215
215
|
]);
|
|
216
216
|
return /* @__PURE__ */ jsxs("div", {
|
|
217
|
-
className: cn("relative size-full max-w-[80%] shrink-0", style && (handlePosition === "right" ? "border-r-
|
|
217
|
+
className: cn("relative size-full max-w-[80%] shrink-0", style && (handlePosition === "right" ? "border-r-2" : "border-l-2"), style && "border-neutral-200 transition active:border-neutral-400 dark:border-neutral-950 dark:active:border-neutral-600", minWidth && `min-w-[${minWidth}px]`, maxWidth && `max-w-[${maxWidth}px]`, !style && className),
|
|
218
218
|
style: {
|
|
219
219
|
width: `${width}px`,
|
|
220
220
|
transition: isResizing ? "none" : "width 200ms ease-in-out"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/WithResizer/index.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport React, {\n type FC,\n type PropsWithChildren,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nconst HANDLE_DOUBLE_CLICK_ZONE_PX = 16;\n\n/**\n * Props for the WithResizer component.\n *\n * Defines the configuration for a resizable container with drag-based width adjustment.\n *\n * @example\n * ```tsx\n * // Basic resizable container\n * <WithResizer initialWidth={300} minWidth={200} maxWidth={600}>\n * <div className=\"p-4\">Resizable content</div>\n * </WithResizer>\n *\n * // Sidebar with resizing\n * <WithResizer\n * initialWidth={250}\n * minWidth={180}\n * maxWidth={400}\n * >\n * <nav className=\"h-full p-4\">\n * <SidebarContent />\n * </nav>\n * </WithResizer>\n *\n * // Panel with unlimited growth\n * <WithResizer initialWidth={400} minWidth={300}>\n * <div className=\"h-full overflow-auto\">\n * <PanelContent />\n * </div>\n * </WithResizer>\n * ```\n */\ntype WithResizerProps = {\n /** Initial width of the resizable container in pixels */\n initialWidth: number;\n /** Maximum allowed width in pixels (optional, no limit if not specified) */\n maxWidth?: number;\n /** Minimum allowed width in pixels */\n minWidth?: number;\n /** Position of the resize handle (default: 'right') */\n handlePosition?: 'left' | 'right';\n /** Apply base styles */\n style?: boolean;\n /** Additional className */\n className?: string;\n /** Controlled open/close — true expands to defaultOpenWidth (or last used), false collapses to 0 */\n isOpen?: boolean;\n /** Width to restore when isOpen becomes true and current width is 0 */\n defaultOpenWidth?: number;\n};\n\n/**\n * WithResizer Component\n *\n * A flexible container component that allows users to dynamically resize its width\n * through mouse or touch drag interactions. Perfect for creating adjustable panels,\n * sidebars, and split-pane layouts.\n *\n * ## Features\n * - **Mouse & Touch Support**: Works with both mouse drag and touch interactions\n * - **Constraint Enforcement**: Respects minimum and maximum width boundaries\n * - **Visual Feedback**: Clear resize handle with hover and active states\n * - **Smooth Interactions**: Passive event listeners for optimal performance\n * - **Accessibility**: ARIA slider role with proper value announcements\n * - **Responsive Design**: Adapts to different screen sizes and containers\n *\n * ## Technical Implementation\n * - **Event Handling**: Uses `useCallback` for optimal performance\n * - **Boundary Calculation**: Real-time width calculation based on mouse/touch position\n * - **State Management**: Tracks resizing state for visual feedback\n * - **Memory Management**: Proper cleanup of global event listeners\n * - **Touch Events**: Full support for mobile touch interactions\n *\n * ## Visual Design\n * - **Resize Handle**: Rounded handle positioned on the right border\n * - **Border Indicator**: Visual border showing resizable edge\n * - **State Feedback**: Different colors for normal, hover, and active states\n * - **Dark Mode**: Full support with appropriate color scheme\n * - **Smooth Transitions**: CSS transitions for visual polish\n *\n * ## Use Cases\n * - **Application Sidebars**: Collapsible navigation and tool panels\n * - **Content Panels**: Adjustable content areas in complex layouts\n * - **Split Panes**: Dividing screen space between multiple content areas\n * - **Inspector Panels**: Debugging tools and property inspectors\n * - **File Explorers**: Tree views with adjustable column widths\n * - **Dashboard Widgets**: Customizable widget sizes for dashboards\n *\n * ## Accessibility Features\n * - **ARIA Slider**: Proper slider role for screen readers\n * - **Value Announcements**: Current, minimum, and maximum values announced\n * - **Keyboard Focus**: Focusable with tab navigation\n * - **Clear Affordances**: Visual indicators for interactive elements\n *\n * @example\n * ```tsx\n * // Application sidebar with resizing\n * const [sidebarWidth, setSidebarWidth] = useState(250);\n *\n * <div className=\"flex h-screen\">\n * <WithResizer\n * initialWidth={sidebarWidth}\n * minWidth={200}\n * maxWidth={400}\n * >\n * <aside className=\"h-full bg-gray-100 p-4\">\n * <nav>\n * <NavItems />\n * </nav>\n * </aside>\n * </WithResizer>\n *\n * <main className=\"flex-1 p-6\">\n * <MainContent />\n * </main>\n * </div>\n *\n * // Developer tools panel\n * <WithResizer\n * initialWidth={350}\n * minWidth={250}\n * maxWidth={600}\n * >\n * <div className=\"h-full flex flex-col\">\n * <div className=\"flex-1 overflow-auto p-4\">\n * <InspectorContent />\n * </div>\n * <div className=\"border-t p-2\">\n * <Controls />\n * </div>\n * </div>\n * </WithResizer>\n *\n * // Multi-column layout\n * <div className=\"flex h-full\">\n * <WithResizer initialWidth={300} minWidth={200} maxWidth={500}>\n * <FileExplorer />\n * </WithResizer>\n *\n * <WithResizer initialWidth={400} minWidth={300}>\n * <CodeEditor />\n * </WithResizer>\n *\n * <div className=\"flex-1 min-w-0\">\n * <OutputPanel />\n * </div>\n * </div>\n * ```\n *\n * ## Performance Considerations\n * - Uses passive event listeners to prevent scroll blocking\n * - Optimized with `useCallback` to prevent unnecessary re-renders\n * - Efficient boundary calculations using `getBoundingClientRect`\n * - Minimal DOM manipulation for smooth drag interactions\n *\n * ## Browser Support\n * - Modern browsers with support for touch events\n * - Graceful degradation for older browsers\n * - Mobile-first touch interaction handling\n */\nexport const WithResizer: FC<PropsWithChildren<WithResizerProps>> = ({\n initialWidth,\n maxWidth,\n minWidth = 0,\n handlePosition = 'right',\n children,\n style = true,\n className,\n isOpen,\n defaultOpenWidth,\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [width, setWidth] = useState(initialWidth);\n const [isResizing, setIsResizing] = useState(false);\n const lastExpandedWidthRef = useRef(initialWidth);\n\n const resizeState = useRef({\n startX: 0,\n startWidth: 0,\n factor: 1,\n });\n\n // Handler to resize the div\n const resize = useCallback(\n (mouseMoveEvent: MouseEvent | TouchEvent) => {\n if (resizeState.current.startWidth === 0) return;\n\n let clientX = 0;\n if (mouseMoveEvent instanceof MouseEvent) {\n clientX = mouseMoveEvent.clientX;\n } else if (\n typeof TouchEvent !== 'undefined' &&\n mouseMoveEvent instanceof TouchEvent\n ) {\n clientX = mouseMoveEvent.touches[0].clientX;\n }\n\n const { startX, startWidth, factor } = resizeState.current;\n const delta = (clientX - startX) / factor;\n // Invert delta for left handle (moving left decreases width, moving right increases width)\n const adjustedDelta = handlePosition === 'left' ? -delta : delta;\n const newWidth = startWidth + adjustedDelta;\n\n const constrainedWidth = Math.max(\n Math.min(newWidth, maxWidth ?? Infinity),\n minWidth\n );\n\n setWidth(constrainedWidth);\n },\n [maxWidth, minWidth, handlePosition]\n );\n\n // Handler to stop resizing\n const stopResizing = useCallback(() => {\n setIsResizing(false);\n document.body.style.cursor = '';\n document.body.style.userSelect = '';\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n }, [resize]);\n\n // Handler to start resizing\n const startResizing = useCallback(\n (\n mouseDownEvent:\n | React.MouseEvent<HTMLDivElement>\n | React.TouchEvent<HTMLDivElement>\n ) => {\n if (isOpen === false) return;\n mouseDownEvent.preventDefault();\n const container = containerRef.current;\n\n if (!container) return;\n\n const { width: rectWidth } = container.getBoundingClientRect();\n const offsetWidth = container.offsetWidth;\n const factor = offsetWidth > 0 ? rectWidth / offsetWidth : 1;\n\n let clientX = 0;\n if ('touches' in mouseDownEvent) {\n clientX = mouseDownEvent.touches[0].clientX;\n } else {\n clientX = mouseDownEvent.clientX;\n }\n\n resizeState.current = {\n startX: clientX,\n startWidth: offsetWidth,\n factor,\n };\n\n setIsResizing(true);\n document.body.style.cursor = 'ew-resize';\n document.body.style.userSelect = 'none';\n\n window.addEventListener('mousemove', resize, { passive: true });\n window.addEventListener('mouseup', stopResizing);\n window.addEventListener('touchmove', resize, { passive: true });\n window.addEventListener('touchend', stopResizing);\n },\n [isOpen, resize, stopResizing]\n );\n\n useEffect(() => {\n return () => {\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n };\n }, [resize, stopResizing]);\n\n useEffect(() => {\n if (width > minWidth) {\n lastExpandedWidthRef.current = width;\n }\n }, [width, minWidth]);\n\n useEffect(() => {\n if (isOpen === undefined) return;\n if (!isOpen) {\n setWidth(0);\n } else {\n const target =\n lastExpandedWidthRef.current > 0\n ? lastExpandedWidthRef.current\n : (defaultOpenWidth ?? initialWidth);\n setWidth(Math.max(target, minWidth));\n }\n }, [isOpen]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleDoubleClick = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const el = containerRef.current;\n if (!el) return;\n\n const { left, right } = el.getBoundingClientRect();\n const inHandleZone =\n handlePosition === 'right'\n ? right - event.clientX <= HANDLE_DOUBLE_CLICK_ZONE_PX\n : event.clientX - left <= HANDLE_DOUBLE_CLICK_ZONE_PX;\n\n if (!inHandleZone) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n if (width > minWidth) {\n setWidth(minWidth);\n return;\n }\n\n const target = Math.min(\n Math.max(lastExpandedWidthRef.current, minWidth),\n maxWidth ?? Infinity\n );\n setWidth(target);\n },\n [handlePosition, maxWidth, minWidth, width]\n );\n\n return (\n <div\n className={cn(\n 'relative size-full max-w-[80%] shrink-0',\n style &&\n (handlePosition === 'right' ? 'border-r-[2px]' : 'border-l-[2px]'),\n style &&\n 'border-neutral-200 transition active:border-neutral-400 dark:border-neutral-950 dark:active:border-neutral-600',\n minWidth && `min-w-[${minWidth}px]`,\n maxWidth && `max-w-[${maxWidth}px]`,\n !style && className\n )}\n style={{\n width: `${width}px`,\n transition: isResizing ? 'none' : 'width 200ms ease-in-out',\n }}\n ref={containerRef}\n aria-valuemin={minWidth}\n aria-valuemax={maxWidth}\n aria-valuenow={width}\n aria-label=\"Resizable component\"\n role=\"slider\"\n tabIndex={0}\n >\n {/* biome-ignore lint/a11y/noStaticElementInteractions: This div stops event propagation to prevent content clicks from triggering resize */}\n <div\n role=\"presentation\"\n className=\"absolute top-0 left-0 size-full cursor-default overflow-hidden\"\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {children}\n </div>\n {/* biome-ignore lint/a11y/noStaticElementInteractions: Invisible handle strip — owns resize events so content stopPropagation doesn't block them */}\n <div\n role=\"presentation\"\n className={cn(\n 'absolute top-0 z-10 h-full w-3',\n isOpen !== false ? 'cursor-ew-resize' : 'cursor-default',\n handlePosition === 'right' ? 'right-0' : 'left-0'\n )}\n onMouseDown={startResizing}\n onTouchStart={startResizing}\n onDoubleClick={handleDoubleClick}\n />\n </div>\n );\n};\n"],"mappings":";;;;;;;AAYA,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiKpC,MAAa,eAAwD,EACnE,cACA,UACA,WAAW,GACX,iBAAiB,SACjB,UACA,QAAQ,MACR,WACA,QACA,uBACI;CACJ,MAAM,eAAe,OAAuB,KAAK;CACjD,MAAM,CAAC,OAAO,YAAY,SAAS,aAAa;CAChD,MAAM,CAAC,YAAY,iBAAiB,SAAS,MAAM;CACnD,MAAM,uBAAuB,OAAO,aAAa;CAEjD,MAAM,cAAc,OAAO;EACzB,QAAQ;EACR,YAAY;EACZ,QAAQ;EACT,CAAC;CAGF,MAAM,SAAS,aACZ,mBAA4C;AAC3C,MAAI,YAAY,QAAQ,eAAe,EAAG;EAE1C,IAAI,UAAU;AACd,M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,iBAAe;EACf,cAAW;EACX,MAAK;EACL,UAAU;YArBZ,CAwBE,oBAAC,OAAD;GACE,MAAK;GACL,WAAU;GACV,cAAc,MAAM,EAAE,iBAAiB;GACvC,eAAe,MAAM,EAAE,iBAAiB;GAEvC;GACG,GAEN,oBAAC,OAAD;GACE,MAAK;GACL,WAAW,GACT,kCACA,WAAW,QAAQ,qBAAqB,kBACxC,mBAAmB,UAAU,YAAY,SAC1C;GACD,aAAa;GACb,cAAc;GACd,eAAe;GACf,EACE"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/WithResizer/index.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport React, {\n type FC,\n type PropsWithChildren,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nconst HANDLE_DOUBLE_CLICK_ZONE_PX = 16;\n\n/**\n * Props for the WithResizer component.\n *\n * Defines the configuration for a resizable container with drag-based width adjustment.\n *\n * @example\n * ```tsx\n * // Basic resizable container\n * <WithResizer initialWidth={300} minWidth={200} maxWidth={600}>\n * <div className=\"p-4\">Resizable content</div>\n * </WithResizer>\n *\n * // Sidebar with resizing\n * <WithResizer\n * initialWidth={250}\n * minWidth={180}\n * maxWidth={400}\n * >\n * <nav className=\"h-full p-4\">\n * <SidebarContent />\n * </nav>\n * </WithResizer>\n *\n * // Panel with unlimited growth\n * <WithResizer initialWidth={400} minWidth={300}>\n * <div className=\"h-full overflow-auto\">\n * <PanelContent />\n * </div>\n * </WithResizer>\n * ```\n */\ntype WithResizerProps = {\n /** Initial width of the resizable container in pixels */\n initialWidth: number;\n /** Maximum allowed width in pixels (optional, no limit if not specified) */\n maxWidth?: number;\n /** Minimum allowed width in pixels */\n minWidth?: number;\n /** Position of the resize handle (default: 'right') */\n handlePosition?: 'left' | 'right';\n /** Apply base styles */\n style?: boolean;\n /** Additional className */\n className?: string;\n /** Controlled open/close — true expands to defaultOpenWidth (or last used), false collapses to 0 */\n isOpen?: boolean;\n /** Width to restore when isOpen becomes true and current width is 0 */\n defaultOpenWidth?: number;\n};\n\n/**\n * WithResizer Component\n *\n * A flexible container component that allows users to dynamically resize its width\n * through mouse or touch drag interactions. Perfect for creating adjustable panels,\n * sidebars, and split-pane layouts.\n *\n * ## Features\n * - **Mouse & Touch Support**: Works with both mouse drag and touch interactions\n * - **Constraint Enforcement**: Respects minimum and maximum width boundaries\n * - **Visual Feedback**: Clear resize handle with hover and active states\n * - **Smooth Interactions**: Passive event listeners for optimal performance\n * - **Accessibility**: ARIA slider role with proper value announcements\n * - **Responsive Design**: Adapts to different screen sizes and containers\n *\n * ## Technical Implementation\n * - **Event Handling**: Uses `useCallback` for optimal performance\n * - **Boundary Calculation**: Real-time width calculation based on mouse/touch position\n * - **State Management**: Tracks resizing state for visual feedback\n * - **Memory Management**: Proper cleanup of global event listeners\n * - **Touch Events**: Full support for mobile touch interactions\n *\n * ## Visual Design\n * - **Resize Handle**: Rounded handle positioned on the right border\n * - **Border Indicator**: Visual border showing resizable edge\n * - **State Feedback**: Different colors for normal, hover, and active states\n * - **Dark Mode**: Full support with appropriate color scheme\n * - **Smooth Transitions**: CSS transitions for visual polish\n *\n * ## Use Cases\n * - **Application Sidebars**: Collapsible navigation and tool panels\n * - **Content Panels**: Adjustable content areas in complex layouts\n * - **Split Panes**: Dividing screen space between multiple content areas\n * - **Inspector Panels**: Debugging tools and property inspectors\n * - **File Explorers**: Tree views with adjustable column widths\n * - **Dashboard Widgets**: Customizable widget sizes for dashboards\n *\n * ## Accessibility Features\n * - **ARIA Slider**: Proper slider role for screen readers\n * - **Value Announcements**: Current, minimum, and maximum values announced\n * - **Keyboard Focus**: Focusable with tab navigation\n * - **Clear Affordances**: Visual indicators for interactive elements\n *\n * @example\n * ```tsx\n * // Application sidebar with resizing\n * const [sidebarWidth, setSidebarWidth] = useState(250);\n *\n * <div className=\"flex h-screen\">\n * <WithResizer\n * initialWidth={sidebarWidth}\n * minWidth={200}\n * maxWidth={400}\n * >\n * <aside className=\"h-full bg-gray-100 p-4\">\n * <nav>\n * <NavItems />\n * </nav>\n * </aside>\n * </WithResizer>\n *\n * <main className=\"flex-1 p-6\">\n * <MainContent />\n * </main>\n * </div>\n *\n * // Developer tools panel\n * <WithResizer\n * initialWidth={350}\n * minWidth={250}\n * maxWidth={600}\n * >\n * <div className=\"h-full flex flex-col\">\n * <div className=\"flex-1 overflow-auto p-4\">\n * <InspectorContent />\n * </div>\n * <div className=\"border-t p-2\">\n * <Controls />\n * </div>\n * </div>\n * </WithResizer>\n *\n * // Multi-column layout\n * <div className=\"flex h-full\">\n * <WithResizer initialWidth={300} minWidth={200} maxWidth={500}>\n * <FileExplorer />\n * </WithResizer>\n *\n * <WithResizer initialWidth={400} minWidth={300}>\n * <CodeEditor />\n * </WithResizer>\n *\n * <div className=\"flex-1 min-w-0\">\n * <OutputPanel />\n * </div>\n * </div>\n * ```\n *\n * ## Performance Considerations\n * - Uses passive event listeners to prevent scroll blocking\n * - Optimized with `useCallback` to prevent unnecessary re-renders\n * - Efficient boundary calculations using `getBoundingClientRect`\n * - Minimal DOM manipulation for smooth drag interactions\n *\n * ## Browser Support\n * - Modern browsers with support for touch events\n * - Graceful degradation for older browsers\n * - Mobile-first touch interaction handling\n */\nexport const WithResizer: FC<PropsWithChildren<WithResizerProps>> = ({\n initialWidth,\n maxWidth,\n minWidth = 0,\n handlePosition = 'right',\n children,\n style = true,\n className,\n isOpen,\n defaultOpenWidth,\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [width, setWidth] = useState(initialWidth);\n const [isResizing, setIsResizing] = useState(false);\n const lastExpandedWidthRef = useRef(initialWidth);\n\n const resizeState = useRef({\n startX: 0,\n startWidth: 0,\n factor: 1,\n });\n\n // Handler to resize the div\n const resize = useCallback(\n (mouseMoveEvent: MouseEvent | TouchEvent) => {\n if (resizeState.current.startWidth === 0) return;\n\n let clientX = 0;\n if (mouseMoveEvent instanceof MouseEvent) {\n clientX = mouseMoveEvent.clientX;\n } else if (\n typeof TouchEvent !== 'undefined' &&\n mouseMoveEvent instanceof TouchEvent\n ) {\n clientX = mouseMoveEvent.touches[0].clientX;\n }\n\n const { startX, startWidth, factor } = resizeState.current;\n const delta = (clientX - startX) / factor;\n // Invert delta for left handle (moving left decreases width, moving right increases width)\n const adjustedDelta = handlePosition === 'left' ? -delta : delta;\n const newWidth = startWidth + adjustedDelta;\n\n const constrainedWidth = Math.max(\n Math.min(newWidth, maxWidth ?? Infinity),\n minWidth\n );\n\n setWidth(constrainedWidth);\n },\n [maxWidth, minWidth, handlePosition]\n );\n\n // Handler to stop resizing\n const stopResizing = useCallback(() => {\n setIsResizing(false);\n document.body.style.cursor = '';\n document.body.style.userSelect = '';\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n }, [resize]);\n\n // Handler to start resizing\n const startResizing = useCallback(\n (\n mouseDownEvent:\n | React.MouseEvent<HTMLDivElement>\n | React.TouchEvent<HTMLDivElement>\n ) => {\n if (isOpen === false) return;\n mouseDownEvent.preventDefault();\n const container = containerRef.current;\n\n if (!container) return;\n\n const { width: rectWidth } = container.getBoundingClientRect();\n const offsetWidth = container.offsetWidth;\n const factor = offsetWidth > 0 ? rectWidth / offsetWidth : 1;\n\n let clientX = 0;\n if ('touches' in mouseDownEvent) {\n clientX = mouseDownEvent.touches[0].clientX;\n } else {\n clientX = mouseDownEvent.clientX;\n }\n\n resizeState.current = {\n startX: clientX,\n startWidth: offsetWidth,\n factor,\n };\n\n setIsResizing(true);\n document.body.style.cursor = 'ew-resize';\n document.body.style.userSelect = 'none';\n\n window.addEventListener('mousemove', resize, { passive: true });\n window.addEventListener('mouseup', stopResizing);\n window.addEventListener('touchmove', resize, { passive: true });\n window.addEventListener('touchend', stopResizing);\n },\n [isOpen, resize, stopResizing]\n );\n\n useEffect(() => {\n return () => {\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n };\n }, [resize, stopResizing]);\n\n useEffect(() => {\n if (width > minWidth) {\n lastExpandedWidthRef.current = width;\n }\n }, [width, minWidth]);\n\n useEffect(() => {\n if (isOpen === undefined) return;\n if (!isOpen) {\n setWidth(0);\n } else {\n const target =\n lastExpandedWidthRef.current > 0\n ? lastExpandedWidthRef.current\n : (defaultOpenWidth ?? initialWidth);\n setWidth(Math.max(target, minWidth));\n }\n }, [isOpen]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleDoubleClick = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const el = containerRef.current;\n if (!el) return;\n\n const { left, right } = el.getBoundingClientRect();\n const inHandleZone =\n handlePosition === 'right'\n ? right - event.clientX <= HANDLE_DOUBLE_CLICK_ZONE_PX\n : event.clientX - left <= HANDLE_DOUBLE_CLICK_ZONE_PX;\n\n if (!inHandleZone) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n if (width > minWidth) {\n setWidth(minWidth);\n return;\n }\n\n const target = Math.min(\n Math.max(lastExpandedWidthRef.current, minWidth),\n maxWidth ?? Infinity\n );\n setWidth(target);\n },\n [handlePosition, maxWidth, minWidth, width]\n );\n\n return (\n <div\n className={cn(\n 'relative size-full max-w-[80%] shrink-0',\n style && (handlePosition === 'right' ? 'border-r-2' : 'border-l-2'),\n style &&\n 'border-neutral-200 transition active:border-neutral-400 dark:border-neutral-950 dark:active:border-neutral-600',\n minWidth && `min-w-[${minWidth}px]`,\n maxWidth && `max-w-[${maxWidth}px]`,\n !style && className\n )}\n style={{\n width: `${width}px`,\n transition: isResizing ? 'none' : 'width 200ms ease-in-out',\n }}\n ref={containerRef}\n aria-valuemin={minWidth}\n aria-valuemax={maxWidth}\n aria-valuenow={width}\n aria-label=\"Resizable component\"\n role=\"slider\"\n tabIndex={0}\n >\n {/* biome-ignore lint/a11y/noStaticElementInteractions: This div stops event propagation to prevent content clicks from triggering resize */}\n <div\n role=\"presentation\"\n className=\"absolute top-0 left-0 size-full cursor-default overflow-hidden\"\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {children}\n </div>\n {/* biome-ignore lint/a11y/noStaticElementInteractions: Invisible handle strip — owns resize events so content stopPropagation doesn't block them */}\n <div\n role=\"presentation\"\n className={cn(\n 'absolute top-0 z-10 h-full w-3',\n isOpen !== false ? 'cursor-ew-resize' : 'cursor-default',\n handlePosition === 'right' ? 'right-0' : 'left-0'\n )}\n onMouseDown={startResizing}\n onTouchStart={startResizing}\n onDoubleClick={handleDoubleClick}\n />\n </div>\n );\n};\n"],"mappings":";;;;;;;AAYA,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiKpC,MAAa,eAAwD,EACnE,cACA,UACA,WAAW,GACX,iBAAiB,SACjB,UACA,QAAQ,MACR,WACA,QACA,uBACI;CACJ,MAAM,eAAe,OAAuB,KAAK;CACjD,MAAM,CAAC,OAAO,YAAY,SAAS,aAAa;CAChD,MAAM,CAAC,YAAY,iBAAiB,SAAS,MAAM;CACnD,MAAM,uBAAuB,OAAO,aAAa;CAEjD,MAAM,cAAc,OAAO;EACzB,QAAQ;EACR,YAAY;EACZ,QAAQ;EACT,CAAC;CAGF,MAAM,SAAS,aACZ,mBAA4C;AAC3C,MAAI,YAAY,QAAQ,eAAe,EAAG;EAE1C,IAAI,UAAU;AACd,MAAI,0BAA0B,WAC5B,WAAU,eAAe;WAEzB,OAAO,eAAe,eACtB,0BAA0B,WAE1B,WAAU,eAAe,QAAQ,GAAG;EAGtC,MAAM,EAAE,QAAQ,YAAY,WAAW,YAAY;EACnD,MAAM,SAAS,UAAU,UAAU;EAGnC,MAAM,WAAW,cADK,mBAAmB,SAAS,CAAC,QAAQ;AAQ3D,WALyB,KAAK,IAC5B,K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AAU,YAAY,SAC1C;GACD,aAAa;GACb,cAAc;GACd,eAAe;GACf,EACE"}
|
package/dist/esm/hooks/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { useKeyboardDetector } from "./useKeyboardDetector.mjs";
|
|
2
|
-
import { useGetElementOrWindow } from "./useGetElementOrWindow.mjs";
|
|
3
|
-
import { useScrollY } from "./useScrollY.mjs";
|
|
4
|
-
import { usePersistedStore } from "./usePersistedStore.mjs";
|
|
5
|
-
import { useHorizontalSwipe } from "./useHorizontalSwipe.mjs";
|
|
6
|
-
import { useItemSelector } from "./useItemSelector.mjs";
|
|
7
1
|
import { calculateIsMobile, checkIsIOS, checkIsIphoneOrSafariDevice, checkIsMac, checkIsMobileScreen, checkIsMobileUserAgent, getBreakpointFromSize, useDevice } from "./useDevice.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
import { useItemSelector } from "./useItemSelector.mjs";
|
|
3
|
+
import { usePersistedStore } from "./usePersistedStore.mjs";
|
|
10
4
|
import { useGetElementById } from "./useGetElementById.mjs";
|
|
5
|
+
import { useGetElementOrWindow } from "./useGetElementOrWindow.mjs";
|
|
6
|
+
import { useHorizontalSwipe } from "./useHorizontalSwipe.mjs";
|
|
11
7
|
import { useIsDarkMode } from "./useIsDarkMode.mjs";
|
|
8
|
+
import { useIsMounted } from "./useIsMounted.mjs";
|
|
9
|
+
import { useKeyboardDetector } from "./useKeyboardDetector.mjs";
|
|
12
10
|
import { useScreenWidth } from "./useScreenWidth.mjs";
|
|
13
11
|
import { useScrollBlockage } from "./useScrollBlockage/index.mjs";
|
|
14
12
|
import { useScrollDetection } from "./useScrollDetection.mjs";
|
|
13
|
+
import { useScrollY } from "./useScrollY.mjs";
|
|
14
|
+
import { useSearch } from "./useSearch.mjs";
|
|
15
15
|
|
|
16
16
|
export { calculateIsMobile, checkIsIOS, checkIsIphoneOrSafariDevice, checkIsMac, checkIsMobileScreen, checkIsMobileUserAgent, getBreakpointFromSize, useDevice, useGetElementById, useGetElementOrWindow, useHorizontalSwipe, useIsDarkMode, useIsMounted, useItemSelector, useKeyboardDetector, usePersistedStore, useScreenWidth, useScrollBlockage, useScrollDetection, useScrollY, useSearch };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useToast } from "../components/Toaster/useToast.mjs";
|
|
4
|
-
import { MutationCache, QueryClient, QueryClientProvider, timeoutManager } from "@tanstack/react-query";
|
|
5
4
|
import { createAsyncStoragePersister } from "@tanstack/query-async-storage-persister";
|
|
5
|
+
import { MutationCache, QueryClient, QueryClientProvider, timeoutManager } from "@tanstack/react-query";
|
|
6
6
|
import { PersistQueryClientProvider } from "@tanstack/react-query-persist-client";
|
|
7
7
|
import { useRef } from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
package/dist/esm/routes.mjs
CHANGED
|
@@ -17,6 +17,7 @@ const App_Dashboard_Assets_Path = "/assets";
|
|
|
17
17
|
const App_Pricing_Path = "/pricing";
|
|
18
18
|
const App_Affiliation_Path = "/affiliation";
|
|
19
19
|
const App_Demo_Path = "/demo";
|
|
20
|
+
const App_Init_Path = "/init";
|
|
20
21
|
const App_ReviewerMarketplace_Path = "/find-reviewer";
|
|
21
22
|
const App_ReviewerMarketplace_Dashboard_Path = "/find-reviewer/dashboard";
|
|
22
23
|
const App_ReviewerMarketplace_Reviewer_Path = "/find-reviewer/$reviewerId";
|
|
@@ -278,5 +279,5 @@ const External_ExampleIntlayerWithReactNative = "https://github.com/aymericzip/i
|
|
|
278
279
|
const External_ExampleIntlayerWithExpress = "https://github.com/aymericzip/intlayer/tree/main/examples/express-app";
|
|
279
280
|
|
|
280
281
|
//#endregion
|
|
281
|
-
export { App_Admin, App_Admin_Affiliate, App_Admin_Affiliate_Path, App_Admin_Dashboard, App_Admin_Dashboard_Path, App_Admin_Discussions, App_Admin_Discussions_Path, App_Admin_Management, App_Admin_Management_Path, App_Admin_Organizations, App_Admin_Organizations_Path, App_Admin_Path, App_Admin_Projects, App_Admin_Projects_Path, App_Admin_PromoCodes, App_Admin_PromoCodes_Path, App_Admin_Reviewers, App_Admin_Reviewers_Path, App_Admin_Users, App_Admin_Users_Path, App_Affiliation, App_Affiliation_Path, App_Auth_AskResetPassword, App_Auth_AskResetPassword_Path, App_Auth_ChangePassword, App_Auth_ChangePassword_Path, App_Auth_Demo_Path, App_Auth_ResetPassword, App_Auth_ResetPassword_Path, App_Auth_SignIn, App_Auth_SignIn_Path, App_Auth_SignUp, App_Auth_SignUp_Path, App_Auth_TwoFactor, App_Auth_TwoFactor_Path, App_Dashboard, App_Dashboard_Assets_Path, App_Dashboard_Dictionaries, App_Dashboard_Dictionaries_Path, App_Dashboard_Editor, App_Dashboard_Editor_Path, App_Dashboard_IDE, App_Dashboard_IDE_Path, App_Dashboard_Organization, App_Dashboard_Organization_Path, App_Dashboard_Profile, App_Dashboard_Profile_Path, App_Dashboard_Projects, App_Dashboard_Projects_Path, App_Dashboard_Scanner, App_Dashboard_Scanner_Path, App_Dashboard_Tags, App_Dashboard_Tags_Path, App_Dashboard_Translate, App_Dashboard_Translate_Path, App_Demo, App_Demo_Path, App_Domain, App_Home_Path, App_NotFound_Path, App_Onboarding, App_Onboarding_Path, App_Pricing, App_Pricing_Path, App_ReviewerMarketplace, App_ReviewerMarketplace_Dashboard, App_ReviewerMarketplace_Dashboard_Mission_Path, App_ReviewerMarketplace_Dashboard_Path, App_ReviewerMarketplace_Path, App_ReviewerMarketplace_Reviewer_Path, Doc_Blog_Path, Doc_Blog_Root_Path, Doc_Blog_Search_Path, Doc_Blog_What_is_i18n_Path, Doc_CLI_Fill_Path, Doc_CLI_Review_Path, Doc_CLI_Translate_Path, Doc_Chat_Path, Doc_Contributors_Path, Doc_Environment_Adonis_Path, Doc_Environment_Angular_Path, Doc_Environment_Astro_Path, Doc_Environment_CRA_Path, Doc_Environment_Express_Path, Doc_Environment_Fastify_Path, Doc_Environment_Hono_Path, Doc_Environment_Lit_Path, Doc_Environment_Lynx_Path, Doc_Environment_NestJS_Path, Doc_Environment_NextJS_14_Path, Doc_Environment_NextJS_15_Path, Doc_Environment_NextJS_16_Path, Doc_Environment_NextJS_Path, Doc_Environment_Nodejs_Path, Doc_Environment_NuxtAndVue_Path, Doc_Environment_ReactNativeAndExpo_Path, Doc_Environment_Tanstack_Path, Doc_Environment_ViteAndPreact_Path, Doc_Environment_ViteAndReact_Path, Doc_Environment_ViteAndReact_ReactRouterV7_FSRoutes_Path, Doc_Environment_ViteAndReact_ReactRouterV7_Path, Doc_Environment_ViteAndSolid_Path, Doc_Environment_ViteAndSvelte_Path, Doc_Environment_ViteAndVue_Path, Doc_FrequentQuestions_Path, Doc_IntlayerCMS_Path, Doc_IntlayerVisualEditor_Path, Doc_Intlayer_with_Lynx_and_React_Path, Doc_MCP_Path, Doc_Path, Doc_PrivacyPolicy_Path, Doc_ReleasesV6_Path, Doc_ReleasesV7_Path, Doc_ReleasesV8_Path, Doc_Root_Path, Doc_Search_Path, Doc_ShowcaseSubmit_Path, Doc_Showcase_Path, Doc_TermsOfService_Path, Doc_Why_Path, External_AI_Landing_Page, External_Discord, External_ExampleIntlayerWithExpress, External_ExampleIntlayerWithNextjs, External_ExampleIntlayerWithReactJS, External_ExampleIntlayerWithReactNative, External_ExampleIntlayerWithViteAndPreact, External_ExampleIntlayerWithViteAndReact, External_ExampleIntlayerWithViteAndSolid, External_ExampleIntlayerWithViteAndSvelte, External_ExampleIntlayerWithViteAndVue, External_Examples, External_Github, External_Github_i18n_benchmark, External_LinkedIn, External_ShowcaseApp, Showcase_Domain, Showcase_Root, Showcase_Root_Path, Showcase_Submit, Showcase_Submit_Path, Website_Benchmark, Website_Benchmark_NextJS, Website_Benchmark_NextJS_Path, Website_Benchmark_Path, Website_Benchmark_Tanstack, Website_Benchmark_Tanstack_Path, Website_Blog, Website_Blog_Path, Website_Blog_Root, Website_Blog_Root_Path, Website_Blog_Search, Website_Blog_Search_Path, Website_Blog_What_is_i18n, Website_Blog_What_is_i18n_Path, Website_CMS, Website_CMS_Path, Website_Changelog, Website_Changelog_Path, Website_Contributors, Website_Contributors_Path, Website_Demo, Website_Demo_Path, Website_Doc, Website_Doc_CLI_Fill, Website_Doc_CLI_Fill_Path, Website_Doc_CLI_Review, Website_Doc_CLI_Review_Path, Website_Doc_CLI_Translate, Website_Doc_CLI_Translate_Path, Website_Doc_Chat, Website_Doc_Chat_Path, Website_Doc_Environment_Adonis, Website_Doc_Environment_Adonis_Path, Website_Doc_Environment_Angular, Website_Doc_Environment_Angular_Path, Website_Doc_Environment_Astro, Website_Doc_Environment_Astro_Path, Website_Doc_Environment_CRA, Website_Doc_Environment_CRA_Path, Website_Doc_Environment_Express, Website_Doc_Environment_Express_Path, Website_Doc_Environment_Fastify, Website_Doc_Environment_Fastify_Path, Website_Doc_Environment_Hono, Website_Doc_Environment_Hono_Path, Website_Doc_Environment_Lit, Website_Doc_Environment_Lit_Path, Website_Doc_Environment_Lynx, Website_Doc_Environment_Lynx_Path, Website_Doc_Environment_NestJS, Website_Doc_Environment_NestJS_Path, Website_Doc_Environment_NextJS, Website_Doc_Environment_NextJS_14, Website_Doc_Environment_NextJS_14_Path, Website_Doc_Environment_NextJS_15, Website_Doc_Environment_NextJS_15_Path, Website_Doc_Environment_NextJS_16, Website_Doc_Environment_NextJS_16_Path, Website_Doc_Environment_NextJS_Path, Website_Doc_Environment_Nodejs, Website_Doc_Environment_Nodejs_Path, Website_Doc_Environment_NuxtAndVue, Website_Doc_Environment_NuxtAndVue_Path, Website_Doc_Environment_ReactNativeAndExpo, Website_Doc_Environment_ReactNativeAndExpo_Path, Website_Doc_Environment_Tanstack, Website_Doc_Environment_Tanstack_Path, Website_Doc_Environment_ViteAndPreact, Website_Doc_Environment_ViteAndPreact_Path, Website_Doc_Environment_ViteAndReact, Website_Doc_Environment_ViteAndReact_Path, Website_Doc_Environment_ViteAndReact_ReactRouterV7, Website_Doc_Environment_ViteAndReact_ReactRouterV7_FSRoutes, Website_Doc_Environment_ViteAndReact_ReactRouterV7_FSRoutes_Path, Website_Doc_Environment_ViteAndReact_ReactRouterV7_Path, Website_Doc_Environment_ViteAndSolid, Website_Doc_Environment_ViteAndSolid_Path, Website_Doc_Environment_ViteAndSvelte, Website_Doc_Environment_ViteAndSvelte_Path, Website_Doc_Environment_ViteAndVue, Website_Doc_Environment_ViteAndVue_Path, Website_Doc_IntlayerCMS, Website_Doc_IntlayerCMS_Path, Website_Doc_IntlayerVisualEditor, Website_Doc_IntlayerVisualEditor_Path, Website_Doc_Intlayer_with_Lynx_and_React, Website_Doc_Intlayer_with_Lynx_and_React_Path, Website_Doc_MCP, Website_Doc_MCP_Path, Website_Doc_Path, Website_Doc_Root, Website_Doc_Root_Path, Website_Doc_Search, Website_Doc_Search_Path, Website_Doc_Why, Website_Doc_Why_Path, Website_Domain, Website_FrequentQuestions, Website_FrequentQuestions_Path, Website_Home, Website_Home_Path, Website_Markdown_Preview, Website_Markdown_Preview_Path, Website_NotFound, Website_NotFound_Path, Website_Playground, Website_Playground_Path, Website_PrivacyPolicy, Website_PrivacyPolicy_Path, Website_ReleasesV6, Website_ReleasesV6_Path, Website_ReleasesV7, Website_ReleasesV7_Path, Website_ReleasesV8, Website_ReleasesV8_Path, Website_Scanner, Website_Scanner_Path, Website_TMS, Website_TMS_Path, Website_TermsOfService, Website_TermsOfService_Path, Website_Translate, Website_Translate_Path, getAppAdminAffiliateRoute, getAppAdminOrganizationAbsoluteRoute, getAppAdminOrganizationRoute, getAppAdminProjectAbsoluteRoute, getAppAdminProjectRoute, getAppAdminPromoCodeRoute, getAppAdminReviewerRoute, getAppAdminUserAbsoluteRoute, getAppAdminUserRoute, getAppOnboardingFlowAbsoluteRoute, getAppOnboardingFlowRoute, getAppReviewerMissionRoute, getAppReviewerProfileRoute };
|
|
282
|
+
export { App_Admin, App_Admin_Affiliate, App_Admin_Affiliate_Path, App_Admin_Dashboard, App_Admin_Dashboard_Path, App_Admin_Discussions, App_Admin_Discussions_Path, App_Admin_Management, App_Admin_Management_Path, App_Admin_Organizations, App_Admin_Organizations_Path, App_Admin_Path, App_Admin_Projects, App_Admin_Projects_Path, App_Admin_PromoCodes, App_Admin_PromoCodes_Path, App_Admin_Reviewers, App_Admin_Reviewers_Path, App_Admin_Users, App_Admin_Users_Path, App_Affiliation, App_Affiliation_Path, App_Auth_AskResetPassword, App_Auth_AskResetPassword_Path, App_Auth_ChangePassword, App_Auth_ChangePassword_Path, App_Auth_Demo_Path, App_Auth_ResetPassword, App_Auth_ResetPassword_Path, App_Auth_SignIn, App_Auth_SignIn_Path, App_Auth_SignUp, App_Auth_SignUp_Path, App_Auth_TwoFactor, App_Auth_TwoFactor_Path, App_Dashboard, App_Dashboard_Assets_Path, App_Dashboard_Dictionaries, App_Dashboard_Dictionaries_Path, App_Dashboard_Editor, App_Dashboard_Editor_Path, App_Dashboard_IDE, App_Dashboard_IDE_Path, App_Dashboard_Organization, App_Dashboard_Organization_Path, App_Dashboard_Profile, App_Dashboard_Profile_Path, App_Dashboard_Projects, App_Dashboard_Projects_Path, App_Dashboard_Scanner, App_Dashboard_Scanner_Path, App_Dashboard_Tags, App_Dashboard_Tags_Path, App_Dashboard_Translate, App_Dashboard_Translate_Path, App_Demo, App_Demo_Path, App_Domain, App_Home_Path, App_Init_Path, App_NotFound_Path, App_Onboarding, App_Onboarding_Path, App_Pricing, App_Pricing_Path, App_ReviewerMarketplace, App_ReviewerMarketplace_Dashboard, App_ReviewerMarketplace_Dashboard_Mission_Path, App_ReviewerMarketplace_Dashboard_Path, App_ReviewerMarketplace_Path, App_ReviewerMarketplace_Reviewer_Path, Doc_Blog_Path, Doc_Blog_Root_Path, Doc_Blog_Search_Path, Doc_Blog_What_is_i18n_Path, Doc_CLI_Fill_Path, Doc_CLI_Review_Path, Doc_CLI_Translate_Path, Doc_Chat_Path, Doc_Contributors_Path, Doc_Environment_Adonis_Path, Doc_Environment_Angular_Path, Doc_Environment_Astro_Path, Doc_Environment_CRA_Path, Doc_Environment_Express_Path, Doc_Environment_Fastify_Path, Doc_Environment_Hono_Path, Doc_Environment_Lit_Path, Doc_Environment_Lynx_Path, Doc_Environment_NestJS_Path, Doc_Environment_NextJS_14_Path, Doc_Environment_NextJS_15_Path, Doc_Environment_NextJS_16_Path, Doc_Environment_NextJS_Path, Doc_Environment_Nodejs_Path, Doc_Environment_NuxtAndVue_Path, Doc_Environment_ReactNativeAndExpo_Path, Doc_Environment_Tanstack_Path, Doc_Environment_ViteAndPreact_Path, Doc_Environment_ViteAndReact_Path, Doc_Environment_ViteAndReact_ReactRouterV7_FSRoutes_Path, Doc_Environment_ViteAndReact_ReactRouterV7_Path, Doc_Environment_ViteAndSolid_Path, Doc_Environment_ViteAndSvelte_Path, Doc_Environment_ViteAndVue_Path, Doc_FrequentQuestions_Path, Doc_IntlayerCMS_Path, Doc_IntlayerVisualEditor_Path, Doc_Intlayer_with_Lynx_and_React_Path, Doc_MCP_Path, Doc_Path, Doc_PrivacyPolicy_Path, Doc_ReleasesV6_Path, Doc_ReleasesV7_Path, Doc_ReleasesV8_Path, Doc_Root_Path, Doc_Search_Path, Doc_ShowcaseSubmit_Path, Doc_Showcase_Path, Doc_TermsOfService_Path, Doc_Why_Path, External_AI_Landing_Page, External_Discord, External_ExampleIntlayerWithExpress, External_ExampleIntlayerWithNextjs, External_ExampleIntlayerWithReactJS, External_ExampleIntlayerWithReactNative, External_ExampleIntlayerWithViteAndPreact, External_ExampleIntlayerWithViteAndReact, External_ExampleIntlayerWithViteAndSolid, External_ExampleIntlayerWithViteAndSvelte, External_ExampleIntlayerWithViteAndVue, External_Examples, External_Github, External_Github_i18n_benchmark, External_LinkedIn, External_ShowcaseApp, Showcase_Domain, Showcase_Root, Showcase_Root_Path, Showcase_Submit, Showcase_Submit_Path, Website_Benchmark, Website_Benchmark_NextJS, Website_Benchmark_NextJS_Path, Website_Benchmark_Path, Website_Benchmark_Tanstack, Website_Benchmark_Tanstack_Path, Website_Blog, Website_Blog_Path, Website_Blog_Root, Website_Blog_Root_Path, Website_Blog_Search, Website_Blog_Search_Path, Website_Blog_What_is_i18n, Website_Blog_What_is_i18n_Path, Website_CMS, Website_CMS_Path, Website_Changelog, Website_Changelog_Path, Website_Contributors, Website_Contributors_Path, Website_Demo, Website_Demo_Path, Website_Doc, Website_Doc_CLI_Fill, Website_Doc_CLI_Fill_Path, Website_Doc_CLI_Review, Website_Doc_CLI_Review_Path, Website_Doc_CLI_Translate, Website_Doc_CLI_Translate_Path, Website_Doc_Chat, Website_Doc_Chat_Path, Website_Doc_Environment_Adonis, Website_Doc_Environment_Adonis_Path, Website_Doc_Environment_Angular, Website_Doc_Environment_Angular_Path, Website_Doc_Environment_Astro, Website_Doc_Environment_Astro_Path, Website_Doc_Environment_CRA, Website_Doc_Environment_CRA_Path, Website_Doc_Environment_Express, Website_Doc_Environment_Express_Path, Website_Doc_Environment_Fastify, Website_Doc_Environment_Fastify_Path, Website_Doc_Environment_Hono, Website_Doc_Environment_Hono_Path, Website_Doc_Environment_Lit, Website_Doc_Environment_Lit_Path, Website_Doc_Environment_Lynx, Website_Doc_Environment_Lynx_Path, Website_Doc_Environment_NestJS, Website_Doc_Environment_NestJS_Path, Website_Doc_Environment_NextJS, Website_Doc_Environment_NextJS_14, Website_Doc_Environment_NextJS_14_Path, Website_Doc_Environment_NextJS_15, Website_Doc_Environment_NextJS_15_Path, Website_Doc_Environment_NextJS_16, Website_Doc_Environment_NextJS_16_Path, Website_Doc_Environment_NextJS_Path, Website_Doc_Environment_Nodejs, Website_Doc_Environment_Nodejs_Path, Website_Doc_Environment_NuxtAndVue, Website_Doc_Environment_NuxtAndVue_Path, Website_Doc_Environment_ReactNativeAndExpo, Website_Doc_Environment_ReactNativeAndExpo_Path, Website_Doc_Environment_Tanstack, Website_Doc_Environment_Tanstack_Path, Website_Doc_Environment_ViteAndPreact, Website_Doc_Environment_ViteAndPreact_Path, Website_Doc_Environment_ViteAndReact, Website_Doc_Environment_ViteAndReact_Path, Website_Doc_Environment_ViteAndReact_ReactRouterV7, Website_Doc_Environment_ViteAndReact_ReactRouterV7_FSRoutes, Website_Doc_Environment_ViteAndReact_ReactRouterV7_FSRoutes_Path, Website_Doc_Environment_ViteAndReact_ReactRouterV7_Path, Website_Doc_Environment_ViteAndSolid, Website_Doc_Environment_ViteAndSolid_Path, Website_Doc_Environment_ViteAndSvelte, Website_Doc_Environment_ViteAndSvelte_Path, Website_Doc_Environment_ViteAndVue, Website_Doc_Environment_ViteAndVue_Path, Website_Doc_IntlayerCMS, Website_Doc_IntlayerCMS_Path, Website_Doc_IntlayerVisualEditor, Website_Doc_IntlayerVisualEditor_Path, Website_Doc_Intlayer_with_Lynx_and_React, Website_Doc_Intlayer_with_Lynx_and_React_Path, Website_Doc_MCP, Website_Doc_MCP_Path, Website_Doc_Path, Website_Doc_Root, Website_Doc_Root_Path, Website_Doc_Search, Website_Doc_Search_Path, Website_Doc_Why, Website_Doc_Why_Path, Website_Domain, Website_FrequentQuestions, Website_FrequentQuestions_Path, Website_Home, Website_Home_Path, Website_Markdown_Preview, Website_Markdown_Preview_Path, Website_NotFound, Website_NotFound_Path, Website_Playground, Website_Playground_Path, Website_PrivacyPolicy, Website_PrivacyPolicy_Path, Website_ReleasesV6, Website_ReleasesV6_Path, Website_ReleasesV7, Website_ReleasesV7_Path, Website_ReleasesV8, Website_ReleasesV8_Path, Website_Scanner, Website_Scanner_Path, Website_TMS, Website_TMS_Path, Website_TermsOfService, Website_TermsOfService_Path, Website_Translate, Website_Translate_Path, getAppAdminAffiliateRoute, getAppAdminOrganizationAbsoluteRoute, getAppAdminOrganizationRoute, getAppAdminProjectAbsoluteRoute, getAppAdminProjectRoute, getAppAdminPromoCodeRoute, getAppAdminReviewerRoute, getAppAdminUserAbsoluteRoute, getAppAdminUserRoute, getAppOnboardingFlowAbsoluteRoute, getAppOnboardingFlowRoute, getAppReviewerMissionRoute, getAppReviewerProfileRoute };
|
|
282
283
|
//# sourceMappingURL=routes.mjs.map
|