@intlayer/design-system 9.0.0-canary.1 → 9.0.0-canary.3
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/utils.mjs +1 -1
- package/dist/esm/api/index.mjs +2 -2
- package/dist/esm/api/useAuth/useOAuth2.mjs +2 -2
- package/dist/esm/api/useAuth/useSession.mjs +1 -1
- package/dist/esm/components/Breadcrumb/index.mjs +1 -1
- package/dist/esm/components/CollapsibleTable/CollapsibleTable.mjs +1 -1
- package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/DictionaryEditor.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/BooleanWrapper.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/FileWrapper.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/NumberWrapper.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs +2 -2
- package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +2 -2
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +6 -6
- package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/JSONEditor.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +2 -2
- package/dist/esm/components/DictionaryFieldEditor/StructureEditor.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +1 -1
- package/dist/esm/components/Form/elements/OTPElement.mjs +1 -1
- package/dist/esm/components/Input/OTPInput.mjs +1 -1
- package/dist/esm/components/LanguageBackground/LanguageBackground.mjs +3 -8
- package/dist/esm/components/LanguageBackground/LanguageBackground.mjs.map +1 -1
- package/dist/esm/components/Link/Link.mjs +1 -1
- package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -1
- package/dist/esm/components/MarkDownRender/MarkDownRender.mjs +1 -1
- package/dist/esm/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
- package/dist/esm/components/MarkdownEditor/generative/AISelector.mjs +1 -1
- package/dist/esm/components/Modal/Modal.mjs +3 -3
- package/dist/esm/components/Navbar/MobileNavbar.mjs +1 -1
- package/dist/esm/components/Pagination/Pagination.mjs +2 -2
- package/dist/esm/components/Pattern/GridDistortionPattern.mjs +275 -0
- package/dist/esm/components/Pattern/GridDistortionPattern.mjs.map +1 -0
- package/dist/esm/components/Pattern/index.mjs +2 -1
- package/dist/esm/components/RightDrawer/RightDrawer.mjs +3 -3
- package/dist/esm/components/Tab/Tab.mjs +1 -1
- package/dist/esm/components/Toaster/Toast.mjs +2 -2
- package/dist/esm/components/index.mjs +5 -4
- package/dist/esm/hooks/index.mjs +8 -8
- package/dist/esm/hooks/useIsMounted.mjs +4 -2
- package/dist/esm/hooks/useIsMounted.mjs.map +1 -1
- package/dist/esm/providers/ReactQueryProvider.mjs +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 +2 -2
- package/dist/types/components/Container/index.d.ts +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts +2 -2
- package/dist/types/components/Input/Checkbox.d.ts +1 -1
- package/dist/types/components/Input/Radio.d.ts +1 -1
- package/dist/types/components/LanguageBackground/LanguageBackground.d.ts.map +1 -1
- package/dist/types/components/Link/Link.d.ts +2 -2
- package/dist/types/components/Pagination/Pagination.d.ts +2 -2
- package/dist/types/components/Pattern/GridDistortionPattern.d.ts +15 -0
- package/dist/types/components/Pattern/GridDistortionPattern.d.ts.map +1 -0
- package/dist/types/components/Pattern/index.d.ts +2 -1
- package/dist/types/components/SwitchSelector/SwitchSelector.d.ts +2 -2
- package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts +1 -1
- package/dist/types/components/Tab/Tab.d.ts +1 -1
- package/dist/types/components/TabSelector/TabSelector.d.ts +1 -1
- package/dist/types/components/Tag/index.d.ts +1 -1
- package/dist/types/components/Toaster/Toast.d.ts +1 -1
- package/dist/types/components/index.d.ts +2 -1
- package/package.json +15 -15
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useAuth } from "../useAuth/useAuth.mjs";
|
|
4
|
-
import { useQuery } from "@tanstack/react-query";
|
|
5
4
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
5
|
+
import { useQuery } from "@tanstack/react-query";
|
|
6
6
|
|
|
7
7
|
//#region src/api/hooks/utils.ts
|
|
8
8
|
const useAuthEnable = ({ requireUser, requireProject, requireOrganization }) => {
|
package/dist/esm/api/index.mjs
CHANGED
|
@@ -2,11 +2,10 @@ import { useOAuth2 } from "./useAuth/useOAuth2.mjs";
|
|
|
2
2
|
import { useSession } from "./useAuth/useSession.mjs";
|
|
3
3
|
import { useAuth } from "./useAuth/useAuth.mjs";
|
|
4
4
|
import { useAiAPI, useAssetAPI, useAuditAPI, useBitbucketAPI, useDictionaryAPI, useEditorAPI, useEnvironmentAPI, useGithubAPI, useGitlabAPI, useIntlayerAuth, useIntlayerOAuth, useIntlayerOAuthOptions, useNewsletterAPI, useOAuthAPI, useOrganizationAPI, useProjectAPI, useReviewerAPI, useSearchAPI, useShowcaseProjectAPI, useStripeAPI, useTagAPI, useTranslateAPI, useUserAPI } from "./useIntlayerAPI.mjs";
|
|
5
|
-
import { useAddPasskey, useAskResetPassword, useChangePassword, useDeletePasskey, useDeleteSSOProvider, useDisableTwoFactor, useEnableTwoFactor, useGetUserByAccount, useGetVerifyEmailStatus, useLinkSocial, useListAccounts, useListPasskeys, useListSSOProviders, useLogin, useLogout, useRegister, useRegisterSSO, useResetPassword, useSignInMagicLink, useSignInPasskey, useSignInSSO, useUnlinkAccount, useVerifyBackupCode, useVerifyEmail, useVerifyTotp } from "./hooks/auth.mjs";
|
|
6
|
-
import { useUser } from "./useUser/index.mjs";
|
|
7
5
|
import { useAskDocQuestion, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditTag, useAutocomplete, useChat, useCustomQuery, useGetAIStats, useTranslateJSONDeclaration } from "./hooks/ai.mjs";
|
|
8
6
|
import { useDeleteAsset, useGetAssetById, useGetAssets, useUpdateAsset, useUploadAsset } from "./hooks/asset.mjs";
|
|
9
7
|
import { useAuditScan, useGetRecursiveAuditStatus, useStartRecursiveAudit } from "./hooks/audit.mjs";
|
|
8
|
+
import { useAddPasskey, useAskResetPassword, useChangePassword, useDeletePasskey, useDeleteSSOProvider, useDisableTwoFactor, useEnableTwoFactor, useGetUserByAccount, useGetVerifyEmailStatus, useLinkSocial, useListAccounts, useListPasskeys, useListSSOProviders, useLogin, useLogout, useRegister, useRegisterSSO, useResetPassword, useSignInMagicLink, useSignInPasskey, useSignInSSO, useUnlinkAccount, useVerifyBackupCode, useVerifyEmail, useVerifyTotp } from "./hooks/auth.mjs";
|
|
10
9
|
import { useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos } from "./hooks/bitbucket.mjs";
|
|
11
10
|
import { useAddDictionary, useDeleteDictionary, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useInfiniteGetDictionaries, usePushDictionaries, useUpdateDictionary } from "./hooks/dictionary.mjs";
|
|
12
11
|
import { useGetDiscussions, useGetDiscussionsData } from "./hooks/discussions.mjs";
|
|
@@ -24,5 +23,6 @@ import { useAcceptAffiliateInvitation, useCancelSubscription, useCreatePortalSes
|
|
|
24
23
|
import { useAddTag, useDeleteTag, useGetTags, useUpdateTag } from "./hooks/tag.mjs";
|
|
25
24
|
import { useFillAllTranslations, usePauseTranslationJob, useResumeTranslationJob, useStopTranslationJob } from "./hooks/translate.mjs";
|
|
26
25
|
import { useCreateUser, useDeleteUser, useGetUserById, useGetUsers, useUpdateUser, useUploadUserAvatar } from "./hooks/user.mjs";
|
|
26
|
+
import { useUser } from "./useUser/index.mjs";
|
|
27
27
|
|
|
28
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 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { editor } from "@intlayer/config/built";
|
|
4
|
-
import { useQuery } from "@tanstack/react-query";
|
|
5
3
|
import { getOAuthAPI } from "@intlayer/api";
|
|
6
4
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
5
|
+
import { editor } from "@intlayer/config/built";
|
|
6
|
+
import { useQuery } from "@tanstack/react-query";
|
|
7
7
|
import { defu } from "defu";
|
|
8
8
|
|
|
9
9
|
//#region src/api/useAuth/useOAuth2.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { getAuthAPI } from "../../libs/auth.mjs";
|
|
4
|
+
import { useConfiguration } from "@intlayer/editor-react";
|
|
4
5
|
import { editor } from "@intlayer/config/built";
|
|
5
6
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
|
-
import { useConfiguration } from "@intlayer/editor-react";
|
|
7
7
|
|
|
8
8
|
//#region src/api/useAuth/useSession.ts
|
|
9
9
|
const useSession = (sessionProp, intlayerConfiguration) => {
|
|
@@ -4,8 +4,8 @@ import { cn } from "../../utils/cn.mjs";
|
|
|
4
4
|
import { Button } from "../Button/Button.mjs";
|
|
5
5
|
import { Link } from "../Link/Link.mjs";
|
|
6
6
|
import { Fragment, createElement } from "react";
|
|
7
|
-
import { cva } from "class-variance-authority";
|
|
8
7
|
import { ChevronRightIcon } from "lucide-react";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { getIntlayer } from "intlayer";
|
|
11
11
|
import { useIntlayer } from "react-intlayer";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { cn } from "../../utils/cn.mjs";
|
|
4
4
|
import { MaxHeightSmoother } from "../MaxHeightSmoother/index.mjs";
|
|
5
5
|
import { useState } from "react";
|
|
6
|
-
import { cva } from "class-variance-authority";
|
|
7
6
|
import { ChevronRight } from "lucide-react";
|
|
7
|
+
import { cva } from "class-variance-authority";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
|
|
10
10
|
//#region src/components/CollapsibleTable/CollapsibleTable.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { Button } from "../Button/Button.mjs";
|
|
4
3
|
import { useUser } from "../../api/useUser/index.mjs";
|
|
4
|
+
import { Button } from "../Button/Button.mjs";
|
|
5
5
|
import { AutoCompleteTextarea } from "../TextArea/AutocompleteTextArea.mjs";
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
7
|
import { Check, X } from "lucide-react";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { NodeWrapper } from "./NodeWrapper/index.mjs";
|
|
4
|
+
import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
4
5
|
import { createElement } from "react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
7
7
|
|
|
8
8
|
//#region src/components/DictionaryEditor/DictionaryEditor.tsx
|
|
9
9
|
const DictionaryEditor = ({ dictionary, ...props }) => {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../utils/cn.mjs";
|
|
4
4
|
import { SwitchSelector } from "../../SwitchSelector/SwitchSelector.mjs";
|
|
5
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
6
5
|
import { useEditorLocale } from "@intlayer/editor-react";
|
|
6
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
7
7
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
8
8
|
|
|
9
9
|
//#region src/components/DictionaryEditor/NodeWrapper/BooleanWrapper.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StringWrapper } from "./StringWrapper.mjs";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { useEditedContent } from "@intlayer/editor-react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
5
5
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../../utils/cn.mjs";
|
|
2
2
|
import { EditableFieldInput } from "../../EditableField/EditableFieldInput.mjs";
|
|
3
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
3
|
import { useEditorLocale } from "@intlayer/editor-react";
|
|
4
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
5
5
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
6
6
|
|
|
7
7
|
//#region src/components/DictionaryEditor/NodeWrapper/NumberWrapper.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../../utils/cn.mjs";
|
|
2
2
|
import { EditableFieldTextArea } from "../../EditableField/EditableFieldTextArea.mjs";
|
|
3
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
3
|
import { useEditorLocale } from "@intlayer/editor-react";
|
|
4
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
5
5
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
6
6
|
|
|
7
7
|
//#region src/components/DictionaryEditor/NodeWrapper/StringWrapper.tsx
|
|
@@ -13,9 +13,9 @@ import { NestedObjectWrapper } from "./NestedObjectWrapper.mjs";
|
|
|
13
13
|
import { NumberWrapper } from "./NumberWrapper.mjs";
|
|
14
14
|
import { PluralWrapper } from "./PluralWrapper.mjs";
|
|
15
15
|
import { TranslationWrapper } from "./TranslationWrapper.mjs";
|
|
16
|
+
import { useEditorLocale } from "@intlayer/editor-react";
|
|
16
17
|
import { memo, useMemo } from "react";
|
|
17
18
|
import { jsx } from "react/jsx-runtime";
|
|
18
|
-
import { useEditorLocale } from "@intlayer/editor-react";
|
|
19
19
|
import { getContentNodeByKeyPath, getNodeType } from "@intlayer/core/dictionaryManipulator";
|
|
20
20
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
21
21
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { Container } from "../Container/index.mjs";
|
|
4
3
|
import { useGetDictionaries } from "../../api/hooks/dictionary.mjs";
|
|
4
|
+
import { Container } from "../Container/index.mjs";
|
|
5
5
|
import { LocaleSwitcherContent } from "../LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs";
|
|
6
6
|
import { Pagination } from "../Pagination/Pagination.mjs";
|
|
7
7
|
import { TextEditorContainer } from "./ContentEditorView/TextEditor.mjs";
|
|
8
8
|
import { getIsEditableSection } from "./getIsEditableSection.mjs";
|
|
9
9
|
import { KeyPathBreadcrumb } from "./KeyPathBreadcrumb.mjs";
|
|
10
10
|
import { NavigationViewNode } from "./NavigationView/NavigationViewNode.mjs";
|
|
11
|
+
import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
11
12
|
import { useCallback, useDeferredValue, useEffect, useMemo, useState, useTransition } from "react";
|
|
12
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
import { useIntlayer } from "react-intlayer";
|
|
14
|
-
import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
15
15
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
16
16
|
|
|
17
17
|
//#region src/components/DictionaryFieldEditor/ContentEditor.tsx
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { useAuditContentDeclarationField } from "../../../api/hooks/ai.mjs";
|
|
3
4
|
import { Loader } from "../../Loader/index.mjs";
|
|
4
5
|
import { Button } from "../../Button/Button.mjs";
|
|
5
6
|
import { Accordion } from "../../Accordion/Accordion.mjs";
|
|
@@ -7,18 +8,17 @@ import { Container } from "../../Container/index.mjs";
|
|
|
7
8
|
import { ContentEditorInput as ContentEditorInput$1 } from "../../ContentEditor/ContentEditorInput.mjs";
|
|
8
9
|
import { ContentEditorTextArea as ContentEditorTextArea$1 } from "../../ContentEditor/ContentEditorTextArea.mjs";
|
|
9
10
|
import { SwitchSelector } from "../../SwitchSelector/SwitchSelector.mjs";
|
|
10
|
-
import { useAuditContentDeclarationField } from "../../../api/hooks/ai.mjs";
|
|
11
11
|
import { useLocaleSwitcherContent } from "../../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";
|
|
12
12
|
import { renameKey } from "./object.mjs";
|
|
13
13
|
import { Label } from "../../Label/index.mjs";
|
|
14
14
|
import { EnumKeyInput } from "../EnumKeyInput.mjs";
|
|
15
15
|
import { SafeHtmlRenderer } from "./SafeHtmlRenderer.mjs";
|
|
16
|
+
import { useConfiguration, useEditedContent } from "@intlayer/editor-react";
|
|
16
17
|
import { Fragment, Suspense, lazy, memo, useState } from "react";
|
|
17
18
|
import { Plus, Trash, WandSparkles } from "lucide-react";
|
|
18
19
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
20
|
import { useIntlayer, useLocale } from "react-intlayer";
|
|
20
21
|
import { getLocaleName } from "@intlayer/core/localization";
|
|
21
|
-
import { useConfiguration, useEditedContent } from "@intlayer/editor-react";
|
|
22
22
|
import { getEmptyNode, getNodeType } from "@intlayer/core/dictionaryManipulator";
|
|
23
23
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
24
24
|
import { camelCaseToSentence } from "@intlayer/config/client";
|
package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { Button } from "../../Button/Button.mjs";
|
|
4
3
|
import { useSession } from "../../../api/useAuth/useSession.mjs";
|
|
5
4
|
import { useAddDictionary } from "../../../api/hooks/dictionary.mjs";
|
|
6
5
|
import { useGetProjects } from "../../../api/hooks/project.mjs";
|
|
6
|
+
import { Button } from "../../Button/Button.mjs";
|
|
7
7
|
import { MultiSelect } from "../../Select/Multiselect.mjs";
|
|
8
8
|
import { Select } from "../../Select/Select.mjs";
|
|
9
9
|
import { InputElement } from "../../Form/elements/InputElement.mjs";
|
package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../utils/cn.mjs";
|
|
4
|
-
import { Loader } from "../../Loader/index.mjs";
|
|
5
|
-
import { Button } from "../../Button/Button.mjs";
|
|
6
|
-
import { Container } from "../../Container/index.mjs";
|
|
7
|
-
import { Checkbox } from "../../Input/Checkbox.mjs";
|
|
8
|
-
import { Input } from "../../Input/Input.mjs";
|
|
9
4
|
import { useSession } from "../../../api/useAuth/useSession.mjs";
|
|
10
5
|
import { useAuditContentDeclarationMetadata } from "../../../api/hooks/ai.mjs";
|
|
11
6
|
import { useGetDictionaries } from "../../../api/hooks/dictionary.mjs";
|
|
12
7
|
import { useGetProjects } from "../../../api/hooks/project.mjs";
|
|
13
8
|
import { useGetTags } from "../../../api/hooks/tag.mjs";
|
|
9
|
+
import { Loader } from "../../Loader/index.mjs";
|
|
10
|
+
import { Button } from "../../Button/Button.mjs";
|
|
11
|
+
import { Container } from "../../Container/index.mjs";
|
|
12
|
+
import { Checkbox } from "../../Input/Checkbox.mjs";
|
|
13
|
+
import { Input } from "../../Input/Input.mjs";
|
|
14
14
|
import { MultiSelect } from "../../Select/Multiselect.mjs";
|
|
15
15
|
import { Select } from "../../Select/Select.mjs";
|
|
16
16
|
import { Pagination } from "../../Pagination/Pagination.mjs";
|
|
@@ -28,11 +28,11 @@ import { useForm as useForm$1 } from "../../Form/FormBase.mjs";
|
|
|
28
28
|
import { Form } from "../../Form/Form.mjs";
|
|
29
29
|
import { MonacoCode } from "../../IDE/MonacoCode.mjs";
|
|
30
30
|
import { useDictionaryDetailsSchema } from "./useDictionaryDetailsSchema.mjs";
|
|
31
|
+
import { useEditedContent } from "@intlayer/editor-react";
|
|
31
32
|
import { useEffect, useMemo, useState } from "react";
|
|
32
33
|
import { WandSparkles } from "lucide-react";
|
|
33
34
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
34
35
|
import { useIntlayer } from "react-intlayer";
|
|
35
|
-
import { useEditedContent } from "@intlayer/editor-react";
|
|
36
36
|
import { useWatch } from "react-hook-form";
|
|
37
37
|
import { AnimatePresence, motion } from "framer-motion";
|
|
38
38
|
|
|
@@ -10,11 +10,11 @@ import { DictionaryDetailsForm } from "./DictionaryDetails/DictionaryDetailsForm
|
|
|
10
10
|
import { JSONEditor } from "./JSONEditor.mjs";
|
|
11
11
|
import { SaveForm } from "./SaveForm/SaveForm.mjs";
|
|
12
12
|
import { StructureEditor } from "./StructureEditor.mjs";
|
|
13
|
+
import { useConfiguration, useDictionariesRecordActions, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
13
14
|
import { useEffect, useState } from "react";
|
|
14
15
|
import { ArrowLeft } from "lucide-react";
|
|
15
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
17
|
import { useIntlayer } from "react-intlayer";
|
|
17
|
-
import { useConfiguration, useDictionariesRecordActions, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
18
18
|
|
|
19
19
|
//#region src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx
|
|
20
20
|
const DictionaryFieldEditor = ({ dictionary, onClickDictionaryList, isDarkMode, mode, onDelete, onSave, showReturnButton = true, rightContent }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MonacoCode } from "../IDE/MonacoCode.mjs";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
2
|
import { useEditedContent } from "@intlayer/editor-react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/DictionaryFieldEditor/JSONEditor.tsx
|
|
6
6
|
const JSONEditor = ({ dictionary, isDarkMode }) => {
|
|
@@ -2,11 +2,11 @@ import { Button } from "../../Button/Button.mjs";
|
|
|
2
2
|
import { Accordion } from "../../Accordion/Accordion.mjs";
|
|
3
3
|
import { useLocaleSwitcherContent } from "../../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";
|
|
4
4
|
import { getIsEditableSection } from "../getIsEditableSection.mjs";
|
|
5
|
+
import { useEditedContentActions, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
5
6
|
import { useState } from "react";
|
|
6
7
|
import { ChevronRight, Plus } from "lucide-react";
|
|
7
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { useIntlayer } from "react-intlayer";
|
|
9
|
-
import { useEditedContentActions, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
10
10
|
import { getContentNodeByKeyPath, getEmptyNode, getNodeType } from "@intlayer/core/dictionaryManipulator";
|
|
11
11
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
12
12
|
import { isSameKeyPath } from "@intlayer/core/utils";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../utils/cn.mjs";
|
|
4
|
-
import { Button } from "../../Button/Button.mjs";
|
|
5
4
|
import { useSession } from "../../../api/useAuth/useSession.mjs";
|
|
6
5
|
import { useAuth } from "../../../api/useAuth/useAuth.mjs";
|
|
7
6
|
import { useDeleteDictionary, usePushDictionaries } from "../../../api/hooks/dictionary.mjs";
|
|
8
7
|
import { useWriteDictionary } from "../../../api/hooks/editor.mjs";
|
|
8
|
+
import { Button } from "../../Button/Button.mjs";
|
|
9
9
|
import { Modal } from "../../Modal/Modal.mjs";
|
|
10
|
+
import { useDictionariesRecordActions, useEditedContent } from "@intlayer/editor-react";
|
|
10
11
|
import { useState } from "react";
|
|
11
12
|
import { ArrowUpFromLine, Download, RotateCcw, Save, Trash } from "lucide-react";
|
|
12
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
import { useIntlayer } from "react-intlayer";
|
|
14
|
-
import { useDictionariesRecordActions, useEditedContent } from "@intlayer/editor-react";
|
|
15
15
|
|
|
16
16
|
//#region src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx
|
|
17
17
|
const SaveForm = ({ dictionary, mode, className, onDelete, onSave, ...props }) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { NodeView } from "./StructureView/StructureView.mjs";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
import { useEditedContent } from "@intlayer/editor-react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/components/DictionaryFieldEditor/StructureEditor.tsx
|
|
8
8
|
const StructureEditor = ({ dictionary }) => {
|
|
@@ -4,10 +4,10 @@ import { Button } from "../../Button/Button.mjs";
|
|
|
4
4
|
import { Container } from "../../Container/index.mjs";
|
|
5
5
|
import { EditableFieldInput } from "../../EditableField/EditableFieldInput.mjs";
|
|
6
6
|
import { NodeTypeSelector } from "../NodeTypeSelector.mjs";
|
|
7
|
+
import { useConfiguration, useEditedContentActions, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
7
8
|
import { Plus, Trash } from "lucide-react";
|
|
8
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
import { useIntlayer } from "react-intlayer";
|
|
10
|
-
import { useConfiguration, useEditedContentActions, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
11
11
|
import { getDefaultNode, getNodeChildren, getNodeType } from "@intlayer/core/dictionaryManipulator";
|
|
12
12
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
13
13
|
import { isSameKeyPath } from "@intlayer/core/utils";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { InputIndicator, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "../../Input/OTPInput.mjs";
|
|
4
3
|
import { useItemSelector } from "../../../hooks/useItemSelector.mjs";
|
|
4
|
+
import { InputIndicator, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "../../Input/OTPInput.mjs";
|
|
5
5
|
import { FormField, useFormField } from "../FormField.mjs";
|
|
6
6
|
import { FormItemLayout } from "../layout/FormItemLayout.mjs";
|
|
7
7
|
import { useEffect, useRef } from "react";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { cn } from "../../utils/cn.mjs";
|
|
4
4
|
import { Button } from "../Button/Button.mjs";
|
|
5
5
|
import { createContext, useContext, useEffect, useRef, useState } from "react";
|
|
6
|
-
import { cva } from "class-variance-authority";
|
|
7
6
|
import { MinusIcon } from "lucide-react";
|
|
7
|
+
import { cva } from "class-variance-authority";
|
|
8
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
|
|
10
10
|
//#region src/components/Input/OTPInput.tsx
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { useIsMounted } from "../../hooks/useIsMounted.mjs";
|
|
4
|
+
import { Suspense, lazy } from "react";
|
|
4
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
|
|
6
7
|
//#region src/components/LanguageBackground/LanguageBackground.tsx
|
|
7
8
|
const LazyLanguageSection = lazy(() => import("./LanguageSection.mjs").then((m) => ({ default: m.LanguageSection })));
|
|
8
9
|
const LanguageBackground = ({ children }) => {
|
|
9
|
-
const [mounted, setMounted] = useState(false);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
startTransition(() => {
|
|
12
|
-
setMounted(true);
|
|
13
|
-
});
|
|
14
|
-
}, []);
|
|
15
10
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [children, /* @__PURE__ */ jsx("div", {
|
|
16
11
|
className: "absolute top-0 left-0 -z-1 flex size-full items-center justify-center",
|
|
17
|
-
children:
|
|
12
|
+
children: useIsMounted() && /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(LazyLanguageSection, { className: "mt-[30%]" }) })
|
|
18
13
|
})] });
|
|
19
14
|
};
|
|
20
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageBackground.mjs","names":[],"sources":["../../../../src/components/LanguageBackground/LanguageBackground.tsx"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"LanguageBackground.mjs","names":[],"sources":["../../../../src/components/LanguageBackground/LanguageBackground.tsx"],"sourcesContent":["'use client';\n\nimport { useIsMounted } from '@hooks/useIsMounted';\nimport { type FC, lazy, type PropsWithChildren, Suspense } from 'react';\n\nconst LazyLanguageSection = lazy(() =>\n import('./LanguageSection').then((m) => ({ default: m.LanguageSection }))\n);\n\nexport const LanguageBackground: FC<PropsWithChildren> = ({ children }) => {\n const isMounted = useIsMounted();\n\n return (\n <>\n {children}\n <div className=\"absolute top-0 left-0 -z-1 flex size-full items-center justify-center\">\n {isMounted && (\n <Suspense>\n <LazyLanguageSection className=\"mt-[30%]\" />\n </Suspense>\n )}\n </div>\n </>\n );\n};\n"],"mappings":";;;;;;;AAKA,MAAM,sBAAsB,WAC1B,OAAO,yBAAqB,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAC1E;AAED,MAAa,sBAA6C,EAAE,eAAe;AAGzE,QACE,8CACG,UACD,oBAAC,OAAD;EAAK,WAAU;YALD,cAMF,IACR,oBAAC,UAAD,YACE,oBAAC,qBAAD,EAAqB,WAAU,YAAa,GACnC;EAET,EACL"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../utils/cn.mjs";
|
|
2
2
|
import { isValidElement } from "react";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
3
|
import { ExternalLink, MoveRight } from "lucide-react";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { getLocalizedUrl } from "@intlayer/core/localization";
|
|
7
7
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { usePersistedStore } from "../../hooks/usePersistedStore.mjs";
|
|
3
4
|
import { Button } from "../Button/Button.mjs";
|
|
4
5
|
import { Container } from "../Container/index.mjs";
|
|
5
6
|
import { DropDown } from "../DropDown/index.mjs";
|
|
6
7
|
import { Input } from "../Input/Input.mjs";
|
|
7
8
|
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";
|
|
@@ -50,7 +50,7 @@ const StrongRenderer = (props) => /* @__PURE__ */ jsx("strong", {
|
|
|
50
50
|
const MemoizedCodeBlock = memo(({ className, children, isDarkMode, lang, ...rest }) => {
|
|
51
51
|
const content = String(children ?? "").replace(/\n$/, "");
|
|
52
52
|
if (!!!className) return /* @__PURE__ */ jsx("code", {
|
|
53
|
-
className: "rounded-md border border-neutral/30 bg-card/60 box-decoration-clone px-1.5 py-0.5 font-mono",
|
|
53
|
+
className: "scale-80 rounded-md border border-neutral/30 bg-card/60 box-decoration-clone px-1.5 py-0.5 font-mono",
|
|
54
54
|
children: content.replace(/&(?:amp;)?#(\d+);/g, (_, code) => String.fromCharCode(parseInt(code, 10)))
|
|
55
55
|
});
|
|
56
56
|
const language = className?.replace(/lang(?:uage)?-/, "") || "plaintext";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkDownRender.mjs","names":[],"sources":["../../../../src/components/MarkDownRender/MarkDownRender.tsx"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { cn } from '@utils/cn';\nimport type { ComponentProps, ComponentPropsWithoutRef, FC } from 'react';\nimport { memo } from 'react';\nimport {\n type MarkdownRenderer as MarkdownRendererIntlayer,\n type ParsedMarkdown,\n renderMarkdown,\n} from 'react-intlayer/markdown';\n\nexport type { ParsedMarkdown };\n\nimport type { BundledLanguage } from 'shiki/bundle/web';\nimport { H1, H2, H3, H4, H5, H6 } from '../Headers';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\nimport { Tab } from '../Tab';\nimport { TabProvider } from '../Tab/TabContext';\nimport { Hr, SmartTable, Td, Th, Tr } from '../Table';\nimport { MarkDownIframe } from './MarkDownIframe';\n\n// Extracted, stable component renderers\nconst H1Renderer = (props: ComponentProps<'h1'>) => (\n <H1 isClickable className=\"mb-16 mb-8 text-text\" {...props} />\n);\nconst H2Renderer = (props: ComponentProps<'h2'>) => (\n <H2 isClickable className=\"mt-16 text-text\" {...props} />\n);\nconst H3Renderer = (props: ComponentProps<'h3'>) => (\n <H3 isClickable className=\"mt-5 text-text\" {...props} />\n);\nconst H4Renderer = (props: ComponentProps<'h4'>) => (\n <H4 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst H5Renderer = (props: ComponentProps<'h5'>) => (\n <H5 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst H6Renderer = (props: ComponentProps<'h6'>) => (\n <H6 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst StrongRenderer = (props: ComponentProps<'strong'>) => (\n <strong className=\"text-text\" {...props} />\n);\n\nconst MemoizedCodeBlock = memo(\n ({\n className,\n children,\n isDarkMode,\n lang, // Destructure html lang prop to prevent passing invalid BCP-47 language tag to Code component\n ...rest\n }: ComponentProps<'code'> & { isDarkMode?: boolean }) => {\n const content = String(children ?? '').replace(/\\n$/, '');\n const isBlock = !!className;\n\n if (!isBlock) {\n const decodedContent = content.replace(\n /&(?:amp;)?#(\\d+);/g,\n (_, code: string) => String.fromCharCode(parseInt(code, 10))\n );\n return (\n <code className=\"rounded-md border border-neutral/30 bg-card/60 box-decoration-clone px-1.5 py-0.5 font-mono\">\n {decodedContent}\n </code>\n );\n }\n\n const language = (className?.replace(/lang(?:uage)?-/, '') ||\n 'plaintext') as BundledLanguage;\n\n return (\n <Code {...rest} language={language} showHeader isDarkMode={isDarkMode}>\n {content}\n </Code>\n );\n },\n (prevProps, nextProps) =>\n prevProps.children === nextProps.children &&\n prevProps.className === nextProps.className &&\n prevProps.isDarkMode === nextProps.isDarkMode\n);\n\nconst createCodeRenderer = (isDarkMode?: boolean) => {\n return function CodeWrapper(props: ComponentProps<'code'>) {\n return <MemoizedCodeBlock {...props} isDarkMode={isDarkMode} />;\n };\n};\n\nconst BlockquoteRenderer = ({\n className,\n ...props\n}: ComponentProps<'blockquote'>) => (\n <blockquote\n className={cn(\n 'mt-5 gap-3 border-card border-l-4 pl-5 text-neutral [&_strong]:text-neutral',\n className\n )}\n {...props}\n />\n);\n\nconst UlRenderer = ({ className, ...props }: ComponentProps<'ul'>) => (\n <ul\n className={cn(\n 'mt-5 flex list-disc flex-col gap-3 pl-5 marker:text-neutral/80',\n className\n )}\n {...props}\n />\n);\n\nconst OlRenderer = ({ className, ...props }: ComponentProps<'ol'>) => (\n <ol\n className={cn(\n 'mt-5 flex list-decimal flex-col gap-3 pl-5 marker:text-neutral/80',\n className\n )}\n {...props}\n />\n);\n\nconst ImgRenderer = ({\n className,\n alt,\n src,\n ...props\n}: ComponentProps<'img'>) => (\n <img\n {...props}\n alt={alt ?? ''}\n loading=\"lazy\"\n className={cn('max-h-[80vh] max-w-full rounded-md', className)}\n src={\n src?.includes('github.com')\n ? src\n ?.replace('github.com', 'raw.githubusercontent.com')\n .replace('/blob/', '/') // GitHub raw URLs do not use /blob/\n : src\n }\n />\n);\n\nconst createLinkRenderer = (locale?: LocalesValues) => {\n return (props: ComponentProps<'a'>) => (\n <Link\n isExternalLink={props.href?.startsWith('http')}\n underlined\n locale={locale}\n label=\"\"\n color=\"text\"\n {...(props as any)}\n />\n );\n};\n\nconst PreRenderer = (props: ComponentProps<'pre'>) => <>{props.children}</>;\nconst TableRenderer = (props: ComponentProps<typeof SmartTable>) => (\n <SmartTable isRollable displayModal {...props} />\n);\n\nconst TabsRenderer = (props: ComponentProps<typeof Tab>) => (\n <Tab\n {...props}\n className=\"rounded-xl border border-card\"\n headerClassName=\"sticky rounded-xl top-24 z-5 bg-background/70 backdrop-blur overflow-x-auto\"\n />\n);\nconst ColumnsRenderer = ({\n className,\n ...props\n}: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex gap-4 max-md:flex-col', className)} {...props} />\n);\nconst ColumnRenderer = ({\n className,\n ...props\n}: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex-1', className)} {...props} />\n);\n\nconst Iframe = (props: ComponentProps<'iframe'>) => (\n <MarkDownIframe {...props} />\n);\n\n// Static configuration object for static renderers\nconst staticMarkdownComponents = {\n h1: H1Renderer,\n h2: H2Renderer,\n h3: H3Renderer,\n h4: H4Renderer,\n h5: H5Renderer,\n h6: H6Renderer,\n strong: StrongRenderer,\n blockquote: BlockquoteRenderer,\n ul: UlRenderer,\n ol: OlRenderer,\n img: ImgRenderer,\n pre: PreRenderer,\n table: TableRenderer,\n th: Th,\n tr: Tr,\n td: Td,\n hr: Hr,\n Tabs: TabsRenderer,\n Tab: Tab.Item,\n Columns: ColumnsRenderer,\n Column: ColumnRenderer,\n iframe: Iframe,\n};\n\n// Factory function to create components with dynamic props\nconst createMarkdownComponents = (\n isDarkMode?: boolean,\n locale?: LocalesValues\n) => ({\n ...staticMarkdownComponents,\n code: createCodeRenderer(isDarkMode),\n a: createLinkRenderer(locale),\n});\n\n// Export static renderers for backward compatibility\nexport const baseMarkdownComponents = staticMarkdownComponents;\n\ntype MarkdownRendererProps = {\n children: string | ParsedMarkdown;\n isDarkMode?: boolean;\n locale?: LocalesValues;\n forceBlock?: boolean;\n preserveFrontmatter?: boolean;\n tagfilter?: boolean;\n components?: ComponentProps<typeof MarkdownRendererIntlayer>['components'];\n wrapper?: ComponentProps<typeof MarkdownRendererIntlayer>['wrapper'];\n};\n\nexport const getIntlayerMarkdownOptions = (_isDarkMode?: boolean) => ({\n components: baseMarkdownComponents,\n});\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode = false,\n locale,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n components: componentsProp,\n wrapper,\n}) => {\n const markdownComponents = createMarkdownComponents(isDarkMode, locale);\n\n const markdownContent = renderMarkdown(children, {\n components: {\n ...markdownComponents,\n ...componentsProp,\n },\n wrapper,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n });\n\n return (\n <CodeProvider>\n <TabProvider>{markdownContent}</TabProvider>\n </CodeProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAuBA,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAuB,GAAI;CAAS;AAEhE,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAkB,GAAI;CAAS;AAE3D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ACH,MAAM,mBAAmB,WAAW;CACpC,GAAG,mBAAmB,OAAO;CAC9B;AAGD,MAAa,yBAAyB;AAatC,MAAa,8BAA8B,iBAA2B,EACpE,YAAY,wBACb;AAED,MAAa,oBAA+C,EAC1D,UACA,aAAa,OACb,QACA,YACA,qBACA,WACA,YAAY,gBACZ,cACI;AAcJ,QACE,oBAAC,cAAD,YACE,oBAAC,aAAD,YAboB,eAAe,UAAU;EAC/C,YAAY;GACV,GAJuB,yBAAyB,YAAY,OAIvC;GACrB,GAAG;GACJ;EACD;EACA;EACA;EACA;EACD,CAIgC,EAAe,GAC/B"}
|
|
1
|
+
{"version":3,"file":"MarkDownRender.mjs","names":[],"sources":["../../../../src/components/MarkDownRender/MarkDownRender.tsx"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { cn } from '@utils/cn';\nimport type { ComponentProps, ComponentPropsWithoutRef, FC } from 'react';\nimport { memo } from 'react';\nimport {\n type MarkdownRenderer as MarkdownRendererIntlayer,\n type ParsedMarkdown,\n renderMarkdown,\n} from 'react-intlayer/markdown';\n\nexport type { ParsedMarkdown };\n\nimport type { BundledLanguage } from 'shiki/bundle/web';\nimport { H1, H2, H3, H4, H5, H6 } from '../Headers';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\nimport { Tab } from '../Tab';\nimport { TabProvider } from '../Tab/TabContext';\nimport { Hr, SmartTable, Td, Th, Tr } from '../Table';\nimport { MarkDownIframe } from './MarkDownIframe';\n\n// Extracted, stable component renderers\nconst H1Renderer = (props: ComponentProps<'h1'>) => (\n <H1 isClickable className=\"mb-16 mb-8 text-text\" {...props} />\n);\nconst H2Renderer = (props: ComponentProps<'h2'>) => (\n <H2 isClickable className=\"mt-16 text-text\" {...props} />\n);\nconst H3Renderer = (props: ComponentProps<'h3'>) => (\n <H3 isClickable className=\"mt-5 text-text\" {...props} />\n);\nconst H4Renderer = (props: ComponentProps<'h4'>) => (\n <H4 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst H5Renderer = (props: ComponentProps<'h5'>) => (\n <H5 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst H6Renderer = (props: ComponentProps<'h6'>) => (\n <H6 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst StrongRenderer = (props: ComponentProps<'strong'>) => (\n <strong className=\"text-text\" {...props} />\n);\n\nconst MemoizedCodeBlock = memo(\n ({\n className,\n children,\n isDarkMode,\n lang, // Destructure html lang prop to prevent passing invalid BCP-47 language tag to Code component\n ...rest\n }: ComponentProps<'code'> & { isDarkMode?: boolean }) => {\n const content = String(children ?? '').replace(/\\n$/, '');\n const isBlock = !!className;\n\n if (!isBlock) {\n const decodedContent = content.replace(\n /&(?:amp;)?#(\\d+);/g,\n (_, code: string) => String.fromCharCode(parseInt(code, 10))\n );\n return (\n <code className=\"scale-80 rounded-md border border-neutral/30 bg-card/60 box-decoration-clone px-1.5 py-0.5 font-mono\">\n {decodedContent}\n </code>\n );\n }\n\n const language = (className?.replace(/lang(?:uage)?-/, '') ||\n 'plaintext') as BundledLanguage;\n\n return (\n <Code {...rest} language={language} showHeader isDarkMode={isDarkMode}>\n {content}\n </Code>\n );\n },\n (prevProps, nextProps) =>\n prevProps.children === nextProps.children &&\n prevProps.className === nextProps.className &&\n prevProps.isDarkMode === nextProps.isDarkMode\n);\n\nconst createCodeRenderer = (isDarkMode?: boolean) => {\n return function CodeWrapper(props: ComponentProps<'code'>) {\n return <MemoizedCodeBlock {...props} isDarkMode={isDarkMode} />;\n };\n};\n\nconst BlockquoteRenderer = ({\n className,\n ...props\n}: ComponentProps<'blockquote'>) => (\n <blockquote\n className={cn(\n 'mt-5 gap-3 border-card border-l-4 pl-5 text-neutral [&_strong]:text-neutral',\n className\n )}\n {...props}\n />\n);\n\nconst UlRenderer = ({ className, ...props }: ComponentProps<'ul'>) => (\n <ul\n className={cn(\n 'mt-5 flex list-disc flex-col gap-3 pl-5 marker:text-neutral/80',\n className\n )}\n {...props}\n />\n);\n\nconst OlRenderer = ({ className, ...props }: ComponentProps<'ol'>) => (\n <ol\n className={cn(\n 'mt-5 flex list-decimal flex-col gap-3 pl-5 marker:text-neutral/80',\n className\n )}\n {...props}\n />\n);\n\nconst ImgRenderer = ({\n className,\n alt,\n src,\n ...props\n}: ComponentProps<'img'>) => (\n <img\n {...props}\n alt={alt ?? ''}\n loading=\"lazy\"\n className={cn('max-h-[80vh] max-w-full rounded-md', className)}\n src={\n src?.includes('github.com')\n ? src\n ?.replace('github.com', 'raw.githubusercontent.com')\n .replace('/blob/', '/') // GitHub raw URLs do not use /blob/\n : src\n }\n />\n);\n\nconst createLinkRenderer = (locale?: LocalesValues) => {\n return (props: ComponentProps<'a'>) => (\n <Link\n isExternalLink={props.href?.startsWith('http')}\n underlined\n locale={locale}\n label=\"\"\n color=\"text\"\n {...(props as any)}\n />\n );\n};\n\nconst PreRenderer = (props: ComponentProps<'pre'>) => <>{props.children}</>;\nconst TableRenderer = (props: ComponentProps<typeof SmartTable>) => (\n <SmartTable isRollable displayModal {...props} />\n);\n\nconst TabsRenderer = (props: ComponentProps<typeof Tab>) => (\n <Tab\n {...props}\n className=\"rounded-xl border border-card\"\n headerClassName=\"sticky rounded-xl top-24 z-5 bg-background/70 backdrop-blur overflow-x-auto\"\n />\n);\nconst ColumnsRenderer = ({\n className,\n ...props\n}: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex gap-4 max-md:flex-col', className)} {...props} />\n);\nconst ColumnRenderer = ({\n className,\n ...props\n}: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex-1', className)} {...props} />\n);\n\nconst Iframe = (props: ComponentProps<'iframe'>) => (\n <MarkDownIframe {...props} />\n);\n\n// Static configuration object for static renderers\nconst staticMarkdownComponents = {\n h1: H1Renderer,\n h2: H2Renderer,\n h3: H3Renderer,\n h4: H4Renderer,\n h5: H5Renderer,\n h6: H6Renderer,\n strong: StrongRenderer,\n blockquote: BlockquoteRenderer,\n ul: UlRenderer,\n ol: OlRenderer,\n img: ImgRenderer,\n pre: PreRenderer,\n table: TableRenderer,\n th: Th,\n tr: Tr,\n td: Td,\n hr: Hr,\n Tabs: TabsRenderer,\n Tab: Tab.Item,\n Columns: ColumnsRenderer,\n Column: ColumnRenderer,\n iframe: Iframe,\n};\n\n// Factory function to create components with dynamic props\nconst createMarkdownComponents = (\n isDarkMode?: boolean,\n locale?: LocalesValues\n) => ({\n ...staticMarkdownComponents,\n code: createCodeRenderer(isDarkMode),\n a: createLinkRenderer(locale),\n});\n\n// Export static renderers for backward compatibility\nexport const baseMarkdownComponents = staticMarkdownComponents;\n\ntype MarkdownRendererProps = {\n children: string | ParsedMarkdown;\n isDarkMode?: boolean;\n locale?: LocalesValues;\n forceBlock?: boolean;\n preserveFrontmatter?: boolean;\n tagfilter?: boolean;\n components?: ComponentProps<typeof MarkdownRendererIntlayer>['components'];\n wrapper?: ComponentProps<typeof MarkdownRendererIntlayer>['wrapper'];\n};\n\nexport const getIntlayerMarkdownOptions = (_isDarkMode?: boolean) => ({\n components: baseMarkdownComponents,\n});\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode = false,\n locale,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n components: componentsProp,\n wrapper,\n}) => {\n const markdownComponents = createMarkdownComponents(isDarkMode, locale);\n\n const markdownContent = renderMarkdown(children, {\n components: {\n ...markdownComponents,\n ...componentsProp,\n },\n wrapper,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n });\n\n return (\n <CodeProvider>\n <TabProvider>{markdownContent}</TabProvider>\n </CodeProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAuBA,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAuB,GAAI;CAAS;AAEhE,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAkB,GAAI;CAAS;AAE3D,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI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BAAmB,OAAO;CAC9B;AAGD,MAAa,yBAAyB;AAatC,MAAa,8BAA8B,iBAA2B,EACpE,YAAY,wBACb;AAED,MAAa,oBAA+C,EAC1D,UACA,aAAa,OACb,QACA,YACA,qBACA,WACA,YAAY,gBACZ,cACI;AAcJ,QACE,oBAAC,cAAD,YACE,oBAAC,aAAD,YAboB,eAAe,UAAU;EAC/C,YAAY;GACV,GAJuB,yBAAyB,YAAY,OAIvC;GACrB,GAAG;GACJ;EACD;EACA;EACA;EACA;EACD,CAIgC,EAAe,GAC/B"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { toast } from "../../Toaster/useToast.mjs";
|
|
4
3
|
import { Loader } from "../../Loader/index.mjs";
|
|
5
4
|
import { Button } from "../../Button/Button.mjs";
|
|
6
5
|
import { Command, CommandRoot } from "../../Command/index.mjs";
|
|
7
6
|
import { MarkdownRenderer as MarkdownRenderer$1 } from "../../MarkDownRender/MarkDownRender.mjs";
|
|
8
7
|
import { useEditor } from "../novel/components/index.mjs";
|
|
9
8
|
import { addAIHighlight } from "../novel/extensions/ai-highlight.mjs";
|
|
9
|
+
import { toast } from "../../Toaster/useToast.mjs";
|
|
10
10
|
import { AICompletionCommands } from "./AICompletionCommands.mjs";
|
|
11
11
|
import { AISelectorCommands } from "./AISelectorCommands.mjs";
|
|
12
12
|
import { useAICompletion } from "./useAICompletion.mjs";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../utils/cn.mjs";
|
|
4
|
-
import { Button } from "../Button/Button.mjs";
|
|
5
|
-
import { Container } from "../Container/index.mjs";
|
|
6
4
|
import { useGetElementOrWindow } from "../../hooks/useGetElementOrWindow.mjs";
|
|
7
5
|
import { useScrollBlockage } from "../../hooks/useScrollBlockage/index.mjs";
|
|
6
|
+
import { Button } from "../Button/Button.mjs";
|
|
7
|
+
import { Container } from "../Container/index.mjs";
|
|
8
8
|
import { H3 } from "../Headers/index.mjs";
|
|
9
9
|
import { useEffect } from "react";
|
|
10
|
-
import { cva } from "class-variance-authority";
|
|
11
10
|
import { X } from "lucide-react";
|
|
11
|
+
import { cva } from "class-variance-authority";
|
|
12
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { motion } from "framer-motion";
|
|
14
14
|
import { createPortal } from "react-dom";
|
|
@@ -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";
|
|
5
4
|
import { useScrollBlockage } from "../../hooks/useScrollBlockage/index.mjs";
|
|
6
5
|
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,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../utils/cn.mjs";
|
|
4
|
-
import { Button } from "../Button/Button.mjs";
|
|
5
4
|
import { useItemSelector } from "../../hooks/useItemSelector.mjs";
|
|
5
|
+
import { Button } from "../Button/Button.mjs";
|
|
6
6
|
import { useEffect, useRef } from "react";
|
|
7
|
-
import { cva } from "class-variance-authority";
|
|
8
7
|
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { useIntlayer } from "react-intlayer";
|
|
11
11
|
|