@blocklet/discuss-kit-ux 2.3.84 → 2.3.85

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.
@@ -10,3 +10,4 @@ export declare const isValidUser: (user: {
10
10
  did?: string;
11
11
  fullName?: string;
12
12
  } | null | undefined) => boolean | "" | undefined;
13
+ export declare function blockletExists(dids: string[] | string): boolean;
@@ -0,0 +1,14 @@
1
+ export declare const api: import('axios').AxiosInstance;
2
+ interface TranslateItem {
3
+ sid: string;
4
+ text: string;
5
+ }
6
+ export declare const translatePost: ({ id, sourceItems, targetLanguage, targetLanguageName, contentVersion, useCache, }: {
7
+ id: string;
8
+ sourceItems: TranslateItem[];
9
+ targetLanguage: string;
10
+ targetLanguageName?: string | undefined;
11
+ contentVersion: string;
12
+ useCache?: boolean | undefined;
13
+ }) => Promise<any>;
14
+ export {};
@@ -0,0 +1,4 @@
1
+ interface Props {
2
+ }
3
+ export declare const AutoTranslateHeaderAddon: (props: Props) => import("react/jsx-runtime").JSX.Element | null;
4
+ export {};
@@ -0,0 +1 @@
1
+ export declare const useEditorStoreAdapter: () => void;
@@ -0,0 +1,6 @@
1
+ export * from './translate';
2
+ export * from './auto-translate-button';
3
+ export * from './post-auto-translate-plugin';
4
+ export * from './store';
5
+ export * from './editor-store-adaptor';
6
+ export { isInlineTranslationAvailable } from './utils';
@@ -0,0 +1,13 @@
1
+ declare const SUPPORTED_LANGUAGES: {
2
+ name: string;
3
+ nativeName: string;
4
+ iso639_1: string;
5
+ iso639_3: string;
6
+ }[];
7
+ export declare function getLanguageByIso6393(iso639_3: string): {
8
+ name: string;
9
+ nativeName: string;
10
+ iso639_1: string;
11
+ iso639_3: string;
12
+ } | undefined;
13
+ export { SUPPORTED_LANGUAGES };
@@ -0,0 +1,13 @@
1
+ interface Props {
2
+ postId: string;
3
+ updatedAt: Date | string;
4
+ }
5
+ export declare function PostAutoTranslatePlugin({ postId, updatedAt }: Props): import("react/jsx-runtime").JSX.Element | null;
6
+ interface InitialState {
7
+ postId: string;
8
+ updatedAt: Date | string;
9
+ }
10
+ export declare const PostAutoTranslationContainer: import('unstated-next').Container<{
11
+ plugin: import("react/jsx-runtime").JSX.Element;
12
+ }, InitialState>;
13
+ export {};
@@ -0,0 +1,21 @@
1
+ interface State {
2
+ autoTranslate: boolean;
3
+ }
4
+ interface Action {
5
+ enableAutoTranslate: () => void;
6
+ disableAutoTranslate: () => void;
7
+ toggleAutoTranslate: (value?: boolean) => void;
8
+ }
9
+ export declare const useAutoTranslateStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<State & Action>, "persist"> & {
10
+ persist: {
11
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<State & Action, State & Action>>) => void;
12
+ clearStorage: () => void;
13
+ rehydrate: () => void | Promise<void>;
14
+ hasHydrated: () => boolean;
15
+ onHydrate: (fn: (state: State & Action) => void) => () => void;
16
+ onFinishHydration: (fn: (state: State & Action) => void) => () => void;
17
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<State & Action, State & Action>>;
18
+ };
19
+ }>;
20
+ export declare const useTargetLanguage: () => string;
21
+ export {};
@@ -0,0 +1,16 @@
1
+ import { TypographyProps } from '@mui/material';
2
+ export declare const useTranslate: ({ text, enabled }: {
3
+ text: string;
4
+ enabled: boolean;
5
+ }) => {
6
+ translation: any;
7
+ key: string;
8
+ loading: boolean;
9
+ };
10
+ type Props<C extends React.ElementType> = {
11
+ text: string;
12
+ } & TypographyProps<C, {
13
+ component?: C;
14
+ }>;
15
+ export declare function Translate<C extends React.ElementType>({ text, children, sx, ...rest }: Props<C>): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare function hashText(text?: string): string;
2
+ export declare const isInlineTranslationAvailable: boolean;
3
+ export declare function detectLanguage(src: string): {
4
+ name: string;
5
+ nativeName: string;
6
+ iso639_1: string;
7
+ iso639_3: string;
8
+ } | null;
9
+ export declare function detectLanguageIso6391(src: string): string | null;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function withAiAvailabilityCheck<P extends object>(Component: React.ComponentType<P>): (props: P) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,10 @@
1
+ export interface Language {
2
+ name: string;
3
+ code: string;
4
+ }
5
+ export declare const useLocaleContext: () => {
6
+ locale: string;
7
+ t: (key: string, data: any) => string;
8
+ languages: Language[];
9
+ getLanguageName: (code: string) => string;
10
+ };
@@ -10,6 +10,7 @@ export interface SessionContextUser {
10
10
  }[];
11
11
  permissions: string[];
12
12
  role: string;
13
+ locale: string;
13
14
  }
14
15
  interface Session {
15
16
  initialized: boolean;
@@ -22,6 +22,7 @@ interface CommentsProviderProps {
22
22
  renderDonation?: (post: Post) => React.ReactNode;
23
23
  renderActions?: (post: Post) => React.ReactNode;
24
24
  renderEditorPlugins?: (post: Post) => React.ReactNode;
25
+ enableAutoTranslate?: boolean;
25
26
  renderInnerFooter?: (post: Post) => React.ReactElement;
26
27
  }
27
28
  interface State {
@@ -66,9 +67,10 @@ interface CommentsContextValue {
66
67
  renderDonation?: (post: Post) => React.ReactNode;
67
68
  renderActions?: (post: Post) => React.ReactNode;
68
69
  renderEditorPlugins?: (post: Post) => React.ReactNode;
70
+ enableAutoTranslate?: boolean;
69
71
  renderInnerFooter?: (post: Post) => React.ReactElement;
70
72
  }
71
73
  export declare const CommentsContext: React.Context<CommentsContextValue>;
72
74
  export declare const useCommentsContext: () => CommentsContextValue;
73
- export declare function CommentsProvider({ target, api, flatView, children, order, autoLoadComments, autoCollapse, allowCopyLink, showProfileCard, interactive, containerRef, renderComments, renderDonation, renderActions, renderEditorPlugins, renderInnerFooter, }: CommentsProviderProps): import("react/jsx-runtime").JSX.Element;
75
+ export declare function CommentsProvider({ target, api, flatView, children, order, autoLoadComments, autoCollapse, allowCopyLink, showProfileCard, interactive, containerRef, renderComments, renderDonation, renderActions, renderEditorPlugins, enableAutoTranslate, renderInnerFooter, }: CommentsProviderProps): import("react/jsx-runtime").JSX.Element;
74
76
  export {};
@@ -10,5 +10,6 @@ export interface CommentProps {
10
10
  renderDonation?: (post: Post) => React.ReactNode;
11
11
  renderActions?: (post: Post) => React.ReactNode;
12
12
  renderEditorPlugins?: (post: Post) => React.ReactNode;
13
+ enableAutoTranslate?: boolean;
13
14
  }
14
- export default function Comment({ onDelete, onRate, onUnrate, onReply, onTogglePin, onContentUpdate, onLoadMoreReplies, renderDonation, renderActions, renderEditorPlugins, ...rest }: PostProps & CommentProps): import("react/jsx-runtime").JSX.Element;
15
+ export default function Comment({ onDelete, onRate, onUnrate, onReply, onTogglePin, onContentUpdate, onLoadMoreReplies, renderDonation, renderActions, renderEditorPlugins, enableAutoTranslate, ...rest }: PostProps & CommentProps): import("react/jsx-runtime").JSX.Element;
@@ -14,6 +14,7 @@ export interface PostProps {
14
14
  className?: string;
15
15
  resolveAuthorInfoAppend?: (post: Post) => React.ReactNode;
16
16
  editorPlugins?: React.ReactNode;
17
+ enableAutoTranslate?: boolean;
17
18
  }
18
19
  interface PostContext {
19
20
  isAdmin: boolean;
@@ -21,5 +22,5 @@ interface PostContext {
21
22
  interactive: boolean;
22
23
  post: Post;
23
24
  }
24
- export default function PostComponent({ post, render, renderExtraContent, customMenu, interactive, onContentUpdate, allowCopyLink, autoCollapse, showProfileCard, resolveAuthorInfoAppend, editorPlugins, ...rest }: PostProps): import("react/jsx-runtime").JSX.Element;
25
+ export default function PostComponent({ post, render, renderExtraContent, customMenu, interactive, onContentUpdate, allowCopyLink, autoCollapse, showProfileCard, resolveAuthorInfoAppend, editorPlugins, enableAutoTranslate, ...rest }: PostProps): import("react/jsx-runtime").JSX.Element;
25
26
  export {};
@@ -0,0 +1,3 @@
1
+ export declare const AIGNE_RUNTIME_DID = "z2qaBP9SahqU2L2YA3ip7NecwKACMByTFuiJ2";
2
+ export declare const AIGNE_STUDIO_DID = "z8iZpog7mcgcgBZzTiXJCWESvmnRrQmnd3XBB";
3
+ export declare const DISCUSS_KIT_DID = "z8ia1WEiBZ7hxURf6LwH21Wpg99vophFwSJdu";
@@ -4,7 +4,7 @@ import { OnContentChangePlugin } from "@blocklet/editor/lib/ext/OnContentChangeP
4
4
  import { CtrlsShortcutPlugin } from "@blocklet/editor/lib/ext/ShortcutPlugin";
5
5
  import { SafeAreaPlugin } from "@blocklet/editor/lib/ext/SafeAreaPlugin";
6
6
  import { lazyRetry } from "@arcblock/ux/lib/Util";
7
- import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-h097ecr7.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-CIb6-P8d.mjs";
8
8
  const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,