@intlayer/design-system 9.0.0-canary.11 → 9.0.0-canary.13
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 +35 -3
- package/dist/esm/api/hooks/organization.mjs.map +1 -1
- package/dist/esm/api/hooks/project.mjs +13 -1
- package/dist/esm/api/hooks/project.mjs.map +1 -1
- package/dist/esm/api/index.mjs +2 -2
- package/dist/esm/api/useAuth/useOAuth2.mjs +1 -1
- package/dist/esm/api/useAuth/useSession.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/routes.mjs +5 -1
- package/dist/esm/routes.mjs.map +1 -1
- package/dist/esm/structured-data/buildSoftwareApplicationJsonLd.mjs +23 -4
- package/dist/esm/structured-data/buildSoftwareApplicationJsonLd.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/hooks/project.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 +2 -2
- package/dist/types/components/Button/Button.d.ts +5 -5
- package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +1 -1
- package/dist/types/components/Container/index.d.ts +5 -5
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.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 +3 -3
- 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 +2 -2
- package/dist/types/components/Toaster/Toast.d.ts +1 -1
- package/dist/types/routes.d.ts +5 -1
- package/dist/types/routes.d.ts.map +1 -1
- package/dist/types/structured-data/buildSoftwareApplicationJsonLd.d.ts +24 -8
- package/dist/types/structured-data/buildSoftwareApplicationJsonLd.d.ts.map +1 -1
- package/package.json +55 -55
|
@@ -28,12 +28,32 @@ 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();
|
|
41
|
+
const queryClient = useQueryClient();
|
|
33
42
|
return useMutation({
|
|
34
43
|
mutationKey: ["organizations"],
|
|
35
44
|
mutationFn: (args) => organizationAPI.updateOrganizationMembers(args),
|
|
36
|
-
meta: { invalidateQueries: [
|
|
45
|
+
meta: { invalidateQueries: [
|
|
46
|
+
["organizations"],
|
|
47
|
+
["users"],
|
|
48
|
+
["session"]
|
|
49
|
+
] },
|
|
50
|
+
onSuccess: (data) => {
|
|
51
|
+
const session = queryClient.getQueryData(["session"]);
|
|
52
|
+
queryClient.setQueryData(["session"], {
|
|
53
|
+
...session ?? {},
|
|
54
|
+
organization: data.data
|
|
55
|
+
});
|
|
56
|
+
}
|
|
37
57
|
});
|
|
38
58
|
};
|
|
39
59
|
const useUpdateOrganizationMembersById = () => {
|
|
@@ -46,10 +66,22 @@ const useUpdateOrganizationMembersById = () => {
|
|
|
46
66
|
};
|
|
47
67
|
const useAddOrganizationMember = () => {
|
|
48
68
|
const organizationAPI = useOrganizationAPI();
|
|
69
|
+
const queryClient = useQueryClient();
|
|
49
70
|
return useMutation({
|
|
50
71
|
mutationKey: ["organizations"],
|
|
51
72
|
mutationFn: (args) => organizationAPI.addOrganizationMember(args),
|
|
52
|
-
meta: { invalidateQueries: [
|
|
73
|
+
meta: { invalidateQueries: [
|
|
74
|
+
["organizations"],
|
|
75
|
+
["users"],
|
|
76
|
+
["session"]
|
|
77
|
+
] },
|
|
78
|
+
onSuccess: (data) => {
|
|
79
|
+
const session = queryClient.getQueryData(["session"]);
|
|
80
|
+
queryClient.setQueryData(["session"], {
|
|
81
|
+
...session ?? {},
|
|
82
|
+
organization: data.data
|
|
83
|
+
});
|
|
84
|
+
}
|
|
53
85
|
});
|
|
54
86
|
};
|
|
55
87
|
const useDeleteOrganization = () => {
|
|
@@ -119,5 +151,5 @@ const useUnselectOrganization = () => {
|
|
|
119
151
|
};
|
|
120
152
|
|
|
121
153
|
//#endregion
|
|
122
|
-
export { useAddOrganization, useAddOrganizationMember, useDeleteOrganization, useDeleteOrganizationById, useGetOrganizations, useSelectOrganization, useUnselectOrganization, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById };
|
|
154
|
+
export { useAddOrganization, useAddOrganizationMember, useDeleteOrganization, useDeleteOrganizationById, useGetOrganizations, useSelectOrganization, useUnselectOrganization, useUpdateOrganization, useUpdateOrganizationMailerConfig, useUpdateOrganizationMembers, useUpdateOrganizationMembersById };
|
|
123
155
|
//# 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 const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: UpdateOrganizationMembersBody) =>\n organizationAPI.updateOrganizationMembers(args),\n meta: {\n invalidateQueries: [['organizations'], ['users'], ['session']],\n },\n onSuccess: (data) => {\n // Patch the session cache immediately so member lists derived from\n // `session.organization` update without waiting for a refetch\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n organization: data.data,\n });\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 const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: AddOrganizationMemberBody) =>\n organizationAPI.addOrganizationMember(args),\n meta: {\n invalidateQueries: [['organizations'], ['users'], ['session']],\n },\n onSuccess: (data) => {\n // Patch the session cache immediately so member lists derived from\n // `session.organization` update without waiting for a refetch\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n organization: data.data,\n });\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;CACzC,MAAM,kBAAkB,oBAAoB;AAE5C,QAAO,YAAY;EACjB,aAAa,CAAC,gBAAgB;EAC9B,aAAa,SACX,gBAAgB,mBAAmB,KAAK;EAC3C,CAAC;;AAGJ,MAAa,0CAA0C;CACrD,MAAM,kBAAkB,oBAAoB;AAE5C,QAAO,YAAY;EACjB,aAAa,CAAC,gBAAgB;EAC9B,aAAa,SACX,gBAAgB,+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,EACF;EACD,iBAAiB;GACf,MAAM,UAAU,YAAY,aAAa,CAAC,UAAU,CAAC;AAErD,eAAY,aAAa,CAAC,UAAU,EAAE;IACpC,GAAI,WAAW,EAAE;IACjB,cAAc;IACd,SAAS;IACV,CAAC;;EAEL,CAAC"}
|
|
@@ -67,10 +67,22 @@ const usePushProjectConfiguration = () => {
|
|
|
67
67
|
};
|
|
68
68
|
const useUpdateProjectMembers = () => {
|
|
69
69
|
const projectAPI = useProjectAPI();
|
|
70
|
+
const queryClient = useQueryClient();
|
|
70
71
|
return useMutation({
|
|
71
72
|
mutationKey: ["projects"],
|
|
72
73
|
mutationFn: (args) => projectAPI.updateProjectMembers(args),
|
|
73
|
-
meta: { invalidateQueries: [
|
|
74
|
+
meta: { invalidateQueries: [
|
|
75
|
+
["projects"],
|
|
76
|
+
["users"],
|
|
77
|
+
["session"]
|
|
78
|
+
] },
|
|
79
|
+
onSuccess: (data) => {
|
|
80
|
+
const session = queryClient.getQueryData(["session"]);
|
|
81
|
+
queryClient.setQueryData(["session"], {
|
|
82
|
+
...session ?? {},
|
|
83
|
+
project: data.data
|
|
84
|
+
});
|
|
85
|
+
}
|
|
74
86
|
});
|
|
75
87
|
};
|
|
76
88
|
const useDeleteProject = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.mjs","names":[],"sources":["../../../../src/api/hooks/project.ts"],"sourcesContent":["'use client';\n\nimport type {\n AddNewAccessKeyBody,\n AddProjectBody,\n DeleteAccessKeyBody,\n GetProjectsParams,\n PushProjectConfigurationBody,\n RefreshAccessKeyBody,\n SelectProjectParam,\n UpdateMemberAccessBody,\n UpdateProjectBody,\n UpdateProjectMembersBody,\n} from '@intlayer/backend';\nimport {\n type UseQueryOptions,\n useMutation,\n useQueryClient,\n} from '@tanstack/react-query';\nimport { useProjectAPI } from '../useIntlayerAPI';\nimport { useAppQuery } from './utils';\n\nexport const useGetProjects = (\n filters?: GetProjectsParams,\n options?: Partial<UseQueryOptions>\n) => {\n const projectAPI = useProjectAPI();\n\n return useAppQuery({\n queryKey: ['projects', filters],\n queryFn: ({ signal }) => projectAPI.getProjects(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n requireOrganization: true,\n ...options,\n });\n};\n\nexport const useGetProjectInsights = (options?: Partial<UseQueryOptions>) => {\n const projectAPI = useProjectAPI();\n\n return useAppQuery({\n queryKey: ['project', 'insights'],\n queryFn: ({ signal }) => projectAPI.getProjectInsights({ signal }),\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useAddProject = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: AddProjectBody) => projectAPI.addProject(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useUpdateProject = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: UpdateProjectBody) => projectAPI.updateProject(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n project: data.data,\n });\n },\n });\n};\n\nexport const usePushProjectConfiguration = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['project', 'push-configuration'],\n mutationFn: (args: PushProjectConfigurationBody) =>\n projectAPI.pushProjectConfiguration(args),\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n project: data.data,\n });\n },\n });\n};\n\nexport const useUpdateProjectMembers = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: UpdateProjectMembersBody) =>\n projectAPI.updateProjectMembers(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useDeleteProject = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: () => projectAPI.deleteProject(),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useDeleteProjectById = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (projectId: string) =>\n projectAPI.deleteProjectByIdAdmin(projectId),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useSelectProject = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-projects'],\n mutationFn: (args: SelectProjectParam) => projectAPI.selectProject(args),\n meta: {\n invalidateQueries: [\n ['session'],\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 project: data.data,\n });\n },\n });\n};\n\nexport const useUnselectProject = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-projects'],\n mutationFn: () => projectAPI.unselectProject(),\n meta: {\n resetQueries: [\n ['session'],\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 project: null,\n });\n },\n });\n};\n\nexport const useGetCIConfig = (options?: Partial<UseQueryOptions>) => {\n const projectAPI = useProjectAPI();\n\n return useAppQuery({\n queryKey: ['ci-config'],\n queryFn: ({ signal }) => projectAPI.getCIConfig({ signal }),\n requireProject: true,\n ...options,\n });\n};\n\nexport const usePushCIConfig = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['ci-config'],\n mutationFn: () => projectAPI.pushCIConfig(),\n meta: {\n invalidateQueries: [['ci-config']],\n },\n });\n};\n\nexport const useTriggerBuild = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects', 'build'],\n mutationFn: () => projectAPI.triggerBuild(),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useTriggerWebhook = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects', 'webhook'],\n mutationFn: (webhookIndex: number) =>\n projectAPI.triggerWebhook(webhookIndex),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useAddNewAccessKey = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['session', 'access-keys'],\n mutationFn: (args: AddNewAccessKeyBody) => projectAPI.addNewAccessKey(args),\n meta: {\n invalidateQueries: [['session']],\n },\n });\n};\n\nexport const useDeleteAccessKey = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['session', 'access-keys'],\n mutationFn: (args: DeleteAccessKeyBody) => projectAPI.deleteAccessKey(args),\n meta: {\n invalidateQueries: [['session']],\n },\n });\n};\n\nexport const useRefreshAccessKey = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['session', 'access-keys'],\n mutationFn: (args: RefreshAccessKeyBody) =>\n projectAPI.refreshAccessKey(args),\n meta: {\n invalidateQueries: [['session']],\n },\n });\n};\n\nexport const useUpdateMemberAccess = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects', 'member-access'],\n mutationFn: ({\n userId,\n ...body\n }: UpdateMemberAccessBody & { userId: string }) =>\n projectAPI.updateMemberAccess(userId, body),\n meta: {\n invalidateQueries: [['projects'], ['session']],\n },\n });\n};\n"],"mappings":";;;;;;;AAsBA,MAAa,kBACX,SACA,YACG;CACH,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,UAAU,CAAC,YAAY,QAAQ;EAC/B,UAAU,EAAE,aAAa,WAAW,YAAY,SAAS,EAAE,QAAQ,CAAC;EAEpE,aAAa;EACb,qBAAqB;EACrB,GAAG;EACJ,CAAC;;AAGJ,MAAa,yBAAy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KAAK;EAC3E,MAAM,EACJ,mBAAmB,CAAC,CAAC,UAAU,CAAC,EACjC;EACF,CAAC;;AAGJ,MAAa,4BAA4B;CACvC,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,aAAa,CAAC,WAAW,cAAc;EACvC,aAAa,SACX,WAAW,iBAAiB,KAAK;EACnC,MAAM,EACJ,mBAAmB,CAAC,CAAC,UAAU,CAAC,EACjC;EACF,CAAC;;AAGJ,MAAa,8BAA8B;CACzC,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,aAAa,CAAC,YAAY,gBAAgB;EAC1C,aAAa,EACX,QACA,GAAG,WAEH,WAAW,mBAAmB,QAAQ,KAAK;EAC7C,MAAM,EACJ,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,EAC/C;EACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"project.mjs","names":[],"sources":["../../../../src/api/hooks/project.ts"],"sourcesContent":["'use client';\n\nimport type {\n AddNewAccessKeyBody,\n AddProjectBody,\n DeleteAccessKeyBody,\n GetProjectsParams,\n PushProjectConfigurationBody,\n RefreshAccessKeyBody,\n SelectProjectParam,\n UpdateMemberAccessBody,\n UpdateProjectBody,\n UpdateProjectMembersBody,\n} from '@intlayer/backend';\nimport {\n type UseQueryOptions,\n useMutation,\n useQueryClient,\n} from '@tanstack/react-query';\nimport { useProjectAPI } from '../useIntlayerAPI';\nimport { useAppQuery } from './utils';\n\nexport const useGetProjects = (\n filters?: GetProjectsParams,\n options?: Partial<UseQueryOptions>\n) => {\n const projectAPI = useProjectAPI();\n\n return useAppQuery({\n queryKey: ['projects', filters],\n queryFn: ({ signal }) => projectAPI.getProjects(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n requireOrganization: true,\n ...options,\n });\n};\n\nexport const useGetProjectInsights = (options?: Partial<UseQueryOptions>) => {\n const projectAPI = useProjectAPI();\n\n return useAppQuery({\n queryKey: ['project', 'insights'],\n queryFn: ({ signal }) => projectAPI.getProjectInsights({ signal }),\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useAddProject = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: AddProjectBody) => projectAPI.addProject(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useUpdateProject = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: UpdateProjectBody) => projectAPI.updateProject(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n project: data.data,\n });\n },\n });\n};\n\nexport const usePushProjectConfiguration = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['project', 'push-configuration'],\n mutationFn: (args: PushProjectConfigurationBody) =>\n projectAPI.pushProjectConfiguration(args),\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n project: data.data,\n });\n },\n });\n};\n\nexport const useUpdateProjectMembers = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: UpdateProjectMembersBody) =>\n projectAPI.updateProjectMembers(args),\n meta: {\n invalidateQueries: [['projects'], ['users'], ['session']],\n },\n onSuccess: (data) => {\n // Patch the session cache immediately so member lists derived from\n // `session.project` update without waiting for a refetch\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n project: data.data,\n });\n },\n });\n};\n\nexport const useDeleteProject = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: () => projectAPI.deleteProject(),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useDeleteProjectById = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (projectId: string) =>\n projectAPI.deleteProjectByIdAdmin(projectId),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useSelectProject = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-projects'],\n mutationFn: (args: SelectProjectParam) => projectAPI.selectProject(args),\n meta: {\n invalidateQueries: [\n ['session'],\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 project: data.data,\n });\n },\n });\n};\n\nexport const useUnselectProject = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-projects'],\n mutationFn: () => projectAPI.unselectProject(),\n meta: {\n resetQueries: [\n ['session'],\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 project: null,\n });\n },\n });\n};\n\nexport const useGetCIConfig = (options?: Partial<UseQueryOptions>) => {\n const projectAPI = useProjectAPI();\n\n return useAppQuery({\n queryKey: ['ci-config'],\n queryFn: ({ signal }) => projectAPI.getCIConfig({ signal }),\n requireProject: true,\n ...options,\n });\n};\n\nexport const usePushCIConfig = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['ci-config'],\n mutationFn: () => projectAPI.pushCIConfig(),\n meta: {\n invalidateQueries: [['ci-config']],\n },\n });\n};\n\nexport const useTriggerBuild = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects', 'build'],\n mutationFn: () => projectAPI.triggerBuild(),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useTriggerWebhook = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects', 'webhook'],\n mutationFn: (webhookIndex: number) =>\n projectAPI.triggerWebhook(webhookIndex),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useAddNewAccessKey = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['session', 'access-keys'],\n mutationFn: (args: AddNewAccessKeyBody) => projectAPI.addNewAccessKey(args),\n meta: {\n invalidateQueries: [['session']],\n },\n });\n};\n\nexport const useDeleteAccessKey = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['session', 'access-keys'],\n mutationFn: (args: DeleteAccessKeyBody) => projectAPI.deleteAccessKey(args),\n meta: {\n invalidateQueries: [['session']],\n },\n });\n};\n\nexport const useRefreshAccessKey = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['session', 'access-keys'],\n mutationFn: (args: RefreshAccessKeyBody) =>\n projectAPI.refreshAccessKey(args),\n meta: {\n invalidateQueries: [['session']],\n },\n });\n};\n\nexport const useUpdateMemberAccess = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects', 'member-access'],\n mutationFn: ({\n userId,\n ...body\n }: UpdateMemberAccessBody & { userId: string }) =>\n projectAPI.updateMemberAccess(userId, body),\n meta: {\n invalidateQueries: [['projects'], ['session']],\n },\n });\n};\n"],"mappings":";;;;;;;AAsBA,MAAa,kBACX,SACA,YACG;CACH,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,UAAU,CAAC,YAAY,QAAQ;EAC/B,UAAU,EAAE,aAAa,WAAW,YAAY,SAAS,EAAE,QAAQ,CAAC;EAEpE,aAAa;EACb,qBAAqB;EACrB,GAAG;EACJ,CAAC;;AAGJ,MAAa,yBAAyB,YAAuC;CAC3E,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,UAAU,CAAC,WAAW,WAAW;EACjC,UAAU,EAAE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J,MAAa,2BAA2B;CACtC,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,aAAa,CAAC,WAAW,cAAc;EACvC,aAAa,SAA8B,WAAW,gBAAgB,KAAK;EAC3E,MAAM,EACJ,mBAAmB,CAAC,CAAC,UAAU,CAAC,EACjC;EACF,CAAC;;AAGJ,MAAa,4BAA4B;CACvC,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,aAAa,CAAC,WAAW,cAAc;EACvC,aAAa,SACX,WAAW,iBAAiB,KAAK;EACnC,MAAM,EACJ,mBAAmB,CAAC,CAAC,UAAU,CAAC,EACjC;EACF,CAAC;;AAGJ,MAAa,8BAA8B;CACzC,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,aAAa,CAAC,YAAY,gBAAgB;EAC1C,aAAa,EACX,QACA,GAAG,WAEH,WAAW,mBAAmB,QAAQ,KAAK;EAC7C,MAAM,EACJ,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,EAC/C;EACF,CAAC"}
|
package/dist/esm/api/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { useAddEnvironment, useDeleteEnvironment, useMigrateEnvironment, useRese
|
|
|
15
15
|
import { useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGithubToken } from "./hooks/github.mjs";
|
|
16
16
|
import { useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects } from "./hooks/gitlab.mjs";
|
|
17
17
|
import { useGetNewsletterStatus, useSubscribeToNewsletter, useUnsubscribeFromNewsletter } from "./hooks/newsletter.mjs";
|
|
18
|
-
import { useAddOrganization, useAddOrganizationMember, useDeleteOrganization, useDeleteOrganizationById, useGetOrganizations, useSelectOrganization, useUnselectOrganization, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById } from "./hooks/organization.mjs";
|
|
18
|
+
import { useAddOrganization, useAddOrganizationMember, useDeleteOrganization, useDeleteOrganizationById, useGetOrganizations, useSelectOrganization, useUnselectOrganization, useUpdateOrganization, useUpdateOrganizationMailerConfig, useUpdateOrganizationMembers, useUpdateOrganizationMembersById } from "./hooks/organization.mjs";
|
|
19
19
|
import { useAddNewAccessKey, useAddProject, useDeleteAccessKey, useDeleteProject, useDeleteProjectById, useGetCIConfig, useGetProjectInsights, useGetProjects, usePushCIConfig, usePushProjectConfiguration, useRefreshAccessKey, useSelectProject, useTriggerBuild, useTriggerWebhook, useUnselectProject, useUpdateMemberAccess, useUpdateProject, useUpdateProjectMembers } from "./hooks/project.mjs";
|
|
20
20
|
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";
|
|
21
21
|
import { useSearchDoc } from "./hooks/search.mjs";
|
|
@@ -25,4 +25,4 @@ import { useAddTag, useDeleteTag, useGetTags, useUpdateTag } from "./hooks/tag.m
|
|
|
25
25
|
import { useFillAllTranslations, usePauseTranslationJob, useResumeTranslationJob, useStopTranslationJob } from "./hooks/translate.mjs";
|
|
26
26
|
import { useCreateUser, useDeleteUser, useGetUserById, useGetUsers, useUpdateUser, useUploadUserAvatar } from "./hooks/user.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
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
|
-
import { editor } from "@intlayer/config/built";
|
|
5
4
|
import { getOAuthAPI } from "@intlayer/api";
|
|
6
5
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
6
|
+
import { editor } from "@intlayer/config/built";
|
|
7
7
|
import { defu } from "defu";
|
|
8
8
|
|
|
9
9
|
//#region src/api/useAuth/useOAuth2.ts
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { getAuthAPI } from "../../libs/auth.mjs";
|
|
4
4
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
5
|
-
import { editor } from "@intlayer/config/built";
|
|
6
5
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
6
|
+
import { editor } from "@intlayer/config/built";
|
|
7
7
|
|
|
8
8
|
//#region src/api/useAuth/useSession.ts
|
|
9
9
|
const useSession = (sessionProp, intlayerConfiguration) => {
|
|
@@ -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,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,KAAK,IAAI,UAAU,YAAY,SAAS,EACxC,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,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,KAAK,IAAI,UAAU,YAAY,SAAS,EACxC,SAGuB,CAAC;IAE5B;EAAC;EAAU;EAAU;EAAe,CACrC;CAGD,MAAM,eAAe,kBAAkB;AACrC,gBAAc,MAAM;AACpB,WAAS,KAAK,MAAM,SAAS;AAC7B,WAAS,KAAK,MAAM,aAAa;AACjC,SAAO,oBAAoB,aAAa,OAAO;AAC/C,SAAO,oBAAoB,WAAW,aAAa;AACnD,SAAO,oBAAoB,aAAa,OAA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EZ,MAAM,oBAAoB,aACvB,UAA4C;EAC3C,MAAM,KAAK,aAAa;AACxB,MAAI,CAAC,GAAI;EAET,MAAM,EAAE,MAAM,UAAU,GAAG,uBAAuB;AAMlD,MAAI,EAJF,mBAAmB,UACf,QAAQ,MAAM,WAAW,8BACzB,MAAM,UAAU,QAAQ,6BAEX;AAEnB,QAAM,gBAAgB;AACtB,QAAM,iBAAiB;AAEvB,MAAI,QAAQ,UAAU;AACpB,YAAS,SAAS;AAClB;;AAOF,WAJe,KAAK,IAClB,KAAK,IAAI,qBAAqB,SAAS,SAAS,EAChD,YAAY,SAEC,CAAC;IAElB;EAAC;EAAgB;EAAU;EAAU;EAAM,CAC5C;AAED,QACE,qBAAC,OAAD;EACE,WAAW,GACT,2CACA,UAAU,mBAAmB,UAAU,eAAe,eACtD,SACE,kHACF,YAAY,UAAU,SAAS,MAC/B,YAAY,UAAU,SAAS,MAC/B,CAAC,SAAS,UACX;EACD,OAAO;GACL,OAAO,GAAG,MAAM;GAChB,YAAY,aAAa,SAAS;GACnC;EACD,KAAK;EACL,iBAAe;EACf,iBAAe;EACf,iBAAe;EACf,cAAW;EACX,MAAK;EACL,UAAU;YApBZ,CAuBE,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"}
|
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 };
|
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";
|
|
@@ -101,6 +102,7 @@ const Website_Doc_Search_Path = "/doc/search";
|
|
|
101
102
|
const Website_Doc_Chat_Path = "/doc/chat";
|
|
102
103
|
const Website_Doc_IntlayerVisualEditor_Path = "/doc/concept/editor";
|
|
103
104
|
const Website_Doc_IntlayerCMS_Path = "/doc/concept/cms";
|
|
105
|
+
const Website_Doc_SelfHosting_Path = "/doc/self-hosting";
|
|
104
106
|
const Website_ReleasesV6_Path = "/doc/releases/v6";
|
|
105
107
|
const Website_ReleasesV7_Path = "/doc/releases/v7";
|
|
106
108
|
const Website_ReleasesV8_Path = "/doc/releases/v8";
|
|
@@ -165,6 +167,7 @@ const Website_Doc_Search = `https://${Website_Domain}${Website_Doc_Search_Path}`
|
|
|
165
167
|
const Website_Doc_Chat = `https://${Website_Domain}${Website_Doc_Chat_Path}`;
|
|
166
168
|
const Website_Doc_IntlayerVisualEditor = `https://${Website_Domain}${Website_Doc_IntlayerVisualEditor_Path}`;
|
|
167
169
|
const Website_Doc_IntlayerCMS = `https://${Website_Domain}${Website_Doc_IntlayerCMS_Path}`;
|
|
170
|
+
const Website_Doc_SelfHosting = `https://${Website_Domain}${Website_Doc_SelfHosting_Path}`;
|
|
168
171
|
const Website_ReleasesV6 = `https://${Website_Domain}${Website_ReleasesV6_Path}`;
|
|
169
172
|
const Website_ReleasesV7 = `https://${Website_Domain}${Website_ReleasesV7_Path}`;
|
|
170
173
|
const Website_ReleasesV8 = `https://${Website_Domain}${Website_ReleasesV8_Path}`;
|
|
@@ -261,6 +264,7 @@ const Showcase_Submit_Path = "/submit";
|
|
|
261
264
|
const Showcase_Root = `https://${Showcase_Domain}`;
|
|
262
265
|
const Showcase_Submit = `https://${Showcase_Domain}${Showcase_Submit_Path}`;
|
|
263
266
|
const External_Github = "https://github.com/aymericzip/intlayer";
|
|
267
|
+
const External_DockerHub_SelfHost = "https://hub.docker.com/r/aymericzip/intlayer-selfhost";
|
|
264
268
|
const External_Github_i18n_benchmark = "https://github.com/intlayer-org/benchmark-i18n";
|
|
265
269
|
const External_Discord = "https://discord.gg/7uxamYVeCk";
|
|
266
270
|
const External_LinkedIn = "https://www.linkedin.com/company/intlayerorg/";
|
|
@@ -278,5 +282,5 @@ const External_ExampleIntlayerWithReactNative = "https://github.com/aymericzip/i
|
|
|
278
282
|
const External_ExampleIntlayerWithExpress = "https://github.com/aymericzip/intlayer/tree/main/examples/express-app";
|
|
279
283
|
|
|
280
284
|
//#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 };
|
|
285
|
+
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_DockerHub_SelfHost, 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_SelfHosting, Website_Doc_SelfHosting_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
286
|
//# sourceMappingURL=routes.mjs.map
|