wendang-react 0.6.3 → 0.6.5
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/NOTICE.md +1 -1
- package/README.md +133 -1
- package/dist/bindings/yjs.js +1 -5
- package/dist/chunks/AnchoredPanel-C7jMoPze.js +1 -0
- package/dist/chunks/DocumentExportMenu-CUMsgq3w.js +2 -0
- package/dist/chunks/Dropdown-D98tXfe0.js +3 -0
- package/dist/chunks/MindMapCanvas-C46Q5JBU.js +163 -0
- package/dist/chunks/MindMapViewer-C9zxZIW8.js +13 -0
- package/dist/chunks/SpreadsheetViewer-CoQ4VIgj.js +23 -0
- package/dist/chunks/code-highlight-BmaqTe1m.js +1 -30
- package/dist/chunks/code-highlight-engine-BFDzDPzy.js +1 -40
- package/dist/chunks/comment-hint-BhUxKjKK.js +14 -0
- package/dist/chunks/composition-state-Bl-U1R_2.js +1 -40
- package/dist/chunks/extensions-BefQ1tDm.js +14 -0
- package/dist/chunks/fuzzy-match-DYQR-4w2.js +1 -89
- package/dist/chunks/hooks-C53Dp0pr.js +1 -35
- package/dist/chunks/i18n-B0kCsIjc.js +2 -0
- package/dist/chunks/index-COeA2QcQ.js +15 -0
- package/dist/chunks/katex-WjrodtTU.js +1 -71
- package/dist/chunks/locale-DWpIJ_9X.js +1 -0
- package/dist/chunks/mind-map-controller-Ce76mETT.js +1 -0
- package/dist/chunks/mind-map-delete-CVsxdXfs.js +1 -31
- package/dist/chunks/mind-map-input-CEWRz_t6.js +1 -43
- package/dist/chunks/mind-topic-text-BHXkxexr.js +30 -0
- package/dist/chunks/popover-placement-D3xVYdkt.js +1 -47
- package/dist/chunks/worksheet-engine-c84sdD4N.js +1 -0
- package/dist/chunks/worksheet-preview-DsDVWxIM.js +1 -129
- package/dist/document/viewer.js +30 -289
- package/dist/document.js +120 -3811
- package/dist/export/json.js +1 -5
- package/dist/export/markdown.js +1 -2
- package/dist/export/mindmap.js +1 -2
- package/dist/export/pdf.js +1 -6
- package/dist/export/word.js +1 -2
- package/dist/export.js +1 -2
- package/dist/i18n.js +1 -0
- package/dist/index.js +1 -8
- package/dist/locales/en-US.js +1 -0
- package/dist/locales/es-ES.js +1 -0
- package/dist/locales/ja-JP.js +1 -0
- package/dist/locales/ko-KR.js +1 -0
- package/dist/locales/zh-CN.js +1 -0
- package/dist/locales/zh-TW.js +1 -0
- package/dist/mindmap/viewer.js +1 -6
- package/dist/mindmap.js +3 -123
- package/dist/shared.js +1 -52
- package/dist/spreadsheet/viewer.js +1 -5
- package/dist/spreadsheet/xlsx.js +1 -299
- package/dist/spreadsheet.js +2 -120
- package/dist/styles/callout.css +1 -34
- package/dist/styles/code-block.css +1 -58
- package/dist/styles/content-style.css +1 -619
- package/dist/styles/content-tokens.css +1 -29
- package/dist/styles/editor-interaction.css +1 -621
- package/dist/styles/file-video.css +1 -12
- package/dist/styles/image-preview.css +1 -103
- package/dist/styles/mind-map-block.css +1 -14
- package/dist/styles/mind-map-canvas.css +1 -80
- package/dist/styles/mind-map-comments.css +1 -93
- package/dist/styles/mind-map-details.css +1 -7
- package/dist/styles/mind-map-preview.css +1 -7
- package/dist/styles/mind-map-topic.css +1 -112
- package/dist/styles/page-picker.css +1 -47
- package/dist/styles/renderer.css +1 -45
- package/dist/styles/spreadsheet-editor.css +1 -3
- package/dist/styles/tokens.css +1 -142
- package/dist/styles/video-dialog.css +1 -41
- package/dist/styles/video-embed.css +1 -35
- package/dist/styles.css +1 -2655
- package/dist/types/editor/BlockAffordance.d.ts +5 -2
- package/dist/types/editor/CalloutView.d.ts +2 -1
- package/dist/types/editor/ImagePreview.d.ts +1 -1
- package/dist/types/editor/PagePicker.d.ts +1 -1
- package/dist/types/editor/extensions.d.ts +4 -1
- package/dist/types/engine/editor/block-commands.d.ts +1 -1
- package/dist/types/engine/editor/block-menu-hover.d.ts +16 -0
- package/dist/types/engine/editor/extensions/locale.d.ts +3 -0
- package/dist/types/engine/editor/nodes/image-nodeview.d.ts +1 -1
- package/dist/types/engine/editor/video-block-controls.d.ts +13 -0
- package/dist/types/engine/host.d.ts +60 -2
- package/dist/types/engine/renderer/attachments.d.ts +3 -3
- package/dist/types/engine/shared/video-feedback.d.ts +1 -1
- package/dist/types/engine/worksheets/worksheet-engine.d.ts +1 -0
- package/dist/types/engine/worksheets/worksheet-xlsx.d.ts +6 -1
- package/dist/types/host-types.d.ts +2 -60
- package/dist/types/host.d.ts +8 -1
- package/dist/types/i18n.d.ts +3 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/locales/en-US.d.ts +1 -0
- package/dist/types/locales/es-ES.d.ts +1 -0
- package/dist/types/locales/ja-JP.d.ts +1 -0
- package/dist/types/locales/ko-KR.d.ts +1 -0
- package/dist/types/locales/zh-CN.d.ts +1 -0
- package/dist/types/locales/zh-TW.d.ts +1 -0
- package/dist/types/renderer/media.d.ts +2 -1
- package/dist/types/spreadsheet/xlsx.d.ts +1 -1
- package/dist/types/wui/Dropdown.d.ts +2 -1
- package/dist/types/wui/index.d.ts +2 -1
- package/integrity.json +3140 -0
- package/package.json +15 -5
- package/verify-integrity.mjs +138 -0
- package/dist/chunks/AnchoredPanel-Cv4RURwF.js +0 -68
- package/dist/chunks/DocumentExportMenu-BrGipZ59.js +0 -75
- package/dist/chunks/MindMapCanvas-tkFBBs4g.js +0 -2090
- package/dist/chunks/MindMapViewer-DJrryb2Y.js +0 -180
- package/dist/chunks/SpreadsheetViewer-DxCxIUx_.js +0 -163
- package/dist/chunks/comment-hint-B9qcrqvn.js +0 -296
- package/dist/chunks/extensions-ByORRoRa.js +0 -4210
- package/dist/chunks/host-C-V688Rq.js +0 -197
- package/dist/chunks/index-DdfMnva8.js +0 -726
- package/dist/chunks/mind-map-controller-B6SxK3GZ.js +0 -479
- package/dist/chunks/mind-topic-text-DSyb95vL.js +0 -446
- package/dist/chunks/nodes-iKqTGr_N.js +0 -291
- package/dist/chunks/worksheet-engine-TJ54m0KC.js +0 -125
- package/third-party-notices/wendang-export@0.6.0-NOTICE.md.txt +0 -51
- package/third-party-notices/wendang-export@0.6.1-LICENSE.txt +0 -21
- package/third-party-notices/wendang-export@0.6.2-LICENSE.txt +0 -21
- package/third-party-notices/wendang-export@0.6.2-NOTICE.md.txt +0 -70
- /package/third-party-notices/{wendang-export@0.6.0-LICENSE.txt → wendang-export@0.6.4-LICENSE.txt} +0 -0
- /package/third-party-notices/{wendang-export@0.6.1-NOTICE.md.txt → wendang-export@0.6.4-NOTICE.md.txt} +0 -0
|
@@ -15,13 +15,14 @@ export interface BlockMenuProps {
|
|
|
15
15
|
onConvertToSubpage?: (node: ProseMirrorNode) => void;
|
|
16
16
|
onSaveAsTemplate?: (node: ProseMirrorNode) => void;
|
|
17
17
|
onNotice?: (message: string) => void;
|
|
18
|
+
onRegion?: (inside: boolean) => void;
|
|
18
19
|
panelOnly?: 'format' | 'insert-below';
|
|
19
20
|
}
|
|
20
21
|
export declare function blockAffordanceStyle(info: BlockHoverInfo, shell: HTMLElement | null, kind: 'plus' | 'chip'): {
|
|
21
22
|
left: number;
|
|
22
23
|
top: number;
|
|
23
24
|
};
|
|
24
|
-
export declare function BlockPlus({ style, expanded, onClick, onMouseEnter }: {
|
|
25
|
+
export declare function BlockPlus({ style, expanded, onClick, onMouseEnter, onMouseLeave }: {
|
|
25
26
|
info: BlockHoverInfo;
|
|
26
27
|
style: {
|
|
27
28
|
left: number;
|
|
@@ -30,8 +31,9 @@ export declare function BlockPlus({ style, expanded, onClick, onMouseEnter }: {
|
|
|
30
31
|
expanded: boolean;
|
|
31
32
|
onClick: () => void;
|
|
32
33
|
onMouseEnter?: () => void;
|
|
34
|
+
onMouseLeave?: () => void;
|
|
33
35
|
}): import("react").JSX.Element;
|
|
34
|
-
export declare function BlockChip({ editor, info, style, expanded, onOpen, onOpenFull, onMouseEnter, onHandleMouseDown }: {
|
|
36
|
+
export declare function BlockChip({ editor, info, style, expanded, onOpen, onOpenFull, onMouseEnter, onMouseLeave, onHandleMouseDown }: {
|
|
35
37
|
editor: Editor;
|
|
36
38
|
info: BlockHoverInfo;
|
|
37
39
|
style: {
|
|
@@ -42,6 +44,7 @@ export declare function BlockChip({ editor, info, style, expanded, onOpen, onOpe
|
|
|
42
44
|
onOpen: () => void;
|
|
43
45
|
onOpenFull: () => void;
|
|
44
46
|
onMouseEnter?: () => void;
|
|
47
|
+
onMouseLeave?: () => void;
|
|
45
48
|
onHandleMouseDown?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
46
49
|
}): import("react").JSX.Element;
|
|
47
50
|
export declare function BlockMenu(props: BlockMenuProps): import("react").JSX.Element;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { NodeViewRenderer } from '@tiptap/core';
|
|
2
|
-
|
|
2
|
+
import { type ContentContext } from '../host';
|
|
3
|
+
export declare const createCalloutNodeView: (contentContext?: () => ContentContext) => NodeViewRenderer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { previewItemsFrom, type PreviewItem } from '../engine/shared/preview-items';
|
|
2
2
|
export { previewItemsFrom };
|
|
3
|
-
export declare function ImagePreview({ src, label, items, index, onClose }: {
|
|
3
|
+
export declare function ImagePreview({ src, label: customLabel, items, index, onClose }: {
|
|
4
4
|
src: string;
|
|
5
5
|
label?: string;
|
|
6
6
|
items?: PreviewItem[];
|
|
@@ -8,15 +8,18 @@ import { type UploadPlaceholderOptions } from '../engine/editor/extensions/uploa
|
|
|
8
8
|
import { type TableInteractionOptions } from '../engine/editor/extensions/table-interaction';
|
|
9
9
|
import type { AttachmentFetcher } from '../host-types';
|
|
10
10
|
import type { ContentContext } from '../host';
|
|
11
|
+
import type { I18nScope } from 'wendang/i18n';
|
|
11
12
|
export declare const COLLAB_FIELD = "default";
|
|
12
13
|
export interface CoreExtensionOptions {
|
|
13
|
-
|
|
14
|
+
i18n?: I18nScope;
|
|
15
|
+
placeholder?: string | (() => string);
|
|
14
16
|
collabDoc?: Doc | null;
|
|
15
17
|
collabField?: string;
|
|
16
18
|
collabAwareness?: Awareness | null;
|
|
17
19
|
attachmentFetcher?: AttachmentFetcher;
|
|
18
20
|
attachmentScope?: string;
|
|
19
21
|
inlineComments?: InlineCommentHighlightOptions;
|
|
22
|
+
attachmentPortal?: () => HTMLElement | null | undefined;
|
|
20
23
|
slash?: SlashOptions;
|
|
21
24
|
blockHandle?: BlockHandleOptions;
|
|
22
25
|
uploadPlaceholder?: UploadPlaceholderOptions;
|
|
@@ -27,7 +27,7 @@ export declare const BLOCK_COMMAND_GROUPS: Array<{
|
|
|
27
27
|
id: BlockCommandGroup;
|
|
28
28
|
label: string;
|
|
29
29
|
}>;
|
|
30
|
-
export declare function filterBlockCommands(query: string): BlockCommand[];
|
|
30
|
+
export declare function filterBlockCommands(query: string, translate?: (source: string) => string): BlockCommand[];
|
|
31
31
|
export declare function groupOf(commands: BlockCommand[]): Array<{
|
|
32
32
|
id: BlockCommandGroup;
|
|
33
33
|
label: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type Region = 'trigger' | 'menu';
|
|
2
|
+
export declare function createBlockMenuHover(options: {
|
|
3
|
+
isOpen: () => boolean;
|
|
4
|
+
canOpen: () => boolean;
|
|
5
|
+
canClose: () => boolean;
|
|
6
|
+
open: () => void;
|
|
7
|
+
close: () => void;
|
|
8
|
+
openDelay?: number;
|
|
9
|
+
closeDelay?: number;
|
|
10
|
+
}): {
|
|
11
|
+
enter: (region: Region) => void;
|
|
12
|
+
leave: (region: Region) => void;
|
|
13
|
+
reset: () => void;
|
|
14
|
+
dispose: () => void;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type AttachmentFetcher } from '../../host';
|
|
2
2
|
import type { NodeViewRenderer } from '@tiptap/core';
|
|
3
|
-
export declare const createImageNodeView: (fetcher?: AttachmentFetcher, scope?: string) => NodeViewRenderer;
|
|
3
|
+
export declare const createImageNodeView: (fetcher?: AttachmentFetcher, scope?: string, portal?: () => HTMLElement | null | undefined) => NodeViewRenderer;
|
|
4
4
|
export declare const imageNodeView: NodeViewRenderer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
import { type VideoEmbedPolicy } from '../shared/video-embed';
|
|
3
|
+
export declare function createVideoBlockControls(options: {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
dom: HTMLElement;
|
|
6
|
+
getPos: () => number | undefined;
|
|
7
|
+
policy?: () => VideoEmbedPolicy | undefined;
|
|
8
|
+
portal?: () => HTMLElement | null | undefined;
|
|
9
|
+
reload: () => void;
|
|
10
|
+
}): {
|
|
11
|
+
update: () => void;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
};
|
|
@@ -1,2 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { CommentItem } from 'wendang/types';
|
|
2
|
+
import type { ContentExportHost } from 'wendang/shared';
|
|
3
|
+
export type AttachmentFetcher = (id: string) => Promise<Blob>;
|
|
4
|
+
export interface ReferenceCandidate {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ContentHost {
|
|
9
|
+
exports?: ContentExportHost;
|
|
10
|
+
scope?: string;
|
|
11
|
+
attachments?: {
|
|
12
|
+
fetch: AttachmentFetcher;
|
|
13
|
+
uploadImage?: (file: File) => Promise<{
|
|
14
|
+
id: string;
|
|
15
|
+
alt: string;
|
|
16
|
+
}>;
|
|
17
|
+
uploadFile?: (file: File) => Promise<{
|
|
18
|
+
id: string;
|
|
19
|
+
filename: string;
|
|
20
|
+
mimeType: string;
|
|
21
|
+
size: number;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
references?: {
|
|
25
|
+
search: (query: string, context: {
|
|
26
|
+
spaceId?: string;
|
|
27
|
+
excludeId?: string;
|
|
28
|
+
}) => Promise<ReferenceCandidate[]>;
|
|
29
|
+
resolve: (id: string, label: string) => {
|
|
30
|
+
href?: string;
|
|
31
|
+
external?: boolean;
|
|
32
|
+
} | null;
|
|
33
|
+
navigate?: (href: string) => void | Promise<unknown>;
|
|
34
|
+
};
|
|
35
|
+
location?: {
|
|
36
|
+
current: () => string;
|
|
37
|
+
subscribe: (listener: () => void) => () => void;
|
|
38
|
+
createLink?: (target: {
|
|
39
|
+
blockId: string;
|
|
40
|
+
topicId: string;
|
|
41
|
+
}) => string | null;
|
|
42
|
+
};
|
|
43
|
+
preferences?: {
|
|
44
|
+
get: (key: string) => string | null;
|
|
45
|
+
set: (key: string, value: string) => void;
|
|
46
|
+
};
|
|
47
|
+
comments?: {
|
|
48
|
+
list: (resourceId: string) => Promise<{
|
|
49
|
+
items: CommentItem[];
|
|
50
|
+
}>;
|
|
51
|
+
create: (resourceId: string, body: string, parentId?: string, target?: {
|
|
52
|
+
blockId: string;
|
|
53
|
+
topicId: string;
|
|
54
|
+
}) => Promise<unknown>;
|
|
55
|
+
update?: (commentId: string, body: string) => Promise<unknown>;
|
|
56
|
+
resolve: (commentId: string, resolved: boolean) => Promise<unknown>;
|
|
57
|
+
remove: (commentId: string) => Promise<unknown>;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export declare const unavailableAttachment: AttachmentFetcher;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type AttachmentFetcher } from '../host';
|
|
2
2
|
export type { AttachmentFetcher } from '../host';
|
|
3
3
|
export declare const defaultAttachmentFetcher: AttachmentFetcher;
|
|
4
|
-
export declare function primeAttachment(id: string, blob: Blob): void;
|
|
5
|
-
export declare function takePrimedAttachment(id: string): Blob | null;
|
|
4
|
+
export declare function primeAttachment(id: string, blob: Blob, scope?: string, fetcher?: AttachmentFetcher): void;
|
|
5
|
+
export declare function takePrimedAttachment(id: string, scope?: string, fetcher?: AttachmentFetcher): Blob | null;
|
|
6
6
|
export declare function attachmentObjectUrl(id: string, onReady: (url: string) => void, fetcher?: AttachmentFetcher, onError?: () => void, scope?: string): () => void;
|
|
7
|
-
export declare function clearAttachmentCache(scope?: string): void;
|
|
7
|
+
export declare function clearAttachmentCache(scope?: string, fetcher?: AttachmentFetcher): void;
|
|
8
8
|
export declare function revokeAll(): void;
|
|
9
9
|
export declare function revokeAttachment(id: string): void;
|
|
10
10
|
export declare function downloadAttachment(attachmentId: string, filename: string, fetcher?: AttachmentFetcher): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function videoProblem(value: string, attempted?: boolean): string;
|
|
1
|
+
export declare function videoProblem(value: string, attempted?: boolean, t?: (source: string, parameters?: import("wendang/i18n").MessageParameters) => string): string;
|
|
@@ -8,6 +8,7 @@ export declare function createWorksheetEngine(container: HTMLElement, initial: W
|
|
|
8
8
|
snapshot: () => WorkbookDocument;
|
|
9
9
|
setEditable: (editable: boolean) => import("@univerjs/preset-sheets-core").FWorkbook;
|
|
10
10
|
setTheme: (theme: "light" | "dark") => void;
|
|
11
|
+
setLocale(language: string): Promise<void>;
|
|
11
12
|
isEditing: () => boolean;
|
|
12
13
|
finishEditing(): Promise<void>;
|
|
13
14
|
settleCalculation(): Promise<void>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type WendangLocale, type WendangMessages } from 'wendang/i18n';
|
|
1
2
|
import { type WorkbookDocument } from '../shared/workbook';
|
|
2
3
|
export interface XlsxInspection {
|
|
3
4
|
sheets: Array<{
|
|
@@ -14,8 +15,12 @@ export interface XlsxImport {
|
|
|
14
15
|
warnings: string[];
|
|
15
16
|
inspection: XlsxInspection;
|
|
16
17
|
}
|
|
18
|
+
export interface XlsxLocaleOptions {
|
|
19
|
+
locale?: WendangLocale;
|
|
20
|
+
messages?: Partial<WendangMessages>;
|
|
21
|
+
}
|
|
17
22
|
export declare function importXlsx(file: {
|
|
18
23
|
size: number;
|
|
19
24
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
20
|
-
}): Promise<XlsxImport>;
|
|
25
|
+
}, options?: XlsxLocaleOptions): Promise<XlsxImport>;
|
|
21
26
|
export declare function exportXlsx(raw: WorkbookDocument): Promise<Uint8Array<ArrayBuffer>>;
|
|
@@ -1,60 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type AttachmentFetcher = (id: string) => Promise<Blob>;
|
|
4
|
-
export interface ReferenceCandidate {
|
|
5
|
-
id: string;
|
|
6
|
-
title: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ContentHost {
|
|
9
|
-
exports?: ContentExportHost;
|
|
10
|
-
scope?: string;
|
|
11
|
-
attachments?: {
|
|
12
|
-
fetch: AttachmentFetcher;
|
|
13
|
-
uploadImage?: (file: File) => Promise<{
|
|
14
|
-
id: string;
|
|
15
|
-
alt: string;
|
|
16
|
-
}>;
|
|
17
|
-
uploadFile?: (file: File) => Promise<{
|
|
18
|
-
id: string;
|
|
19
|
-
filename: string;
|
|
20
|
-
mimeType: string;
|
|
21
|
-
size: number;
|
|
22
|
-
}>;
|
|
23
|
-
};
|
|
24
|
-
references?: {
|
|
25
|
-
search: (query: string, context: {
|
|
26
|
-
spaceId?: string;
|
|
27
|
-
excludeId?: string;
|
|
28
|
-
}) => Promise<ReferenceCandidate[]>;
|
|
29
|
-
resolve: (id: string, label: string) => {
|
|
30
|
-
href?: string;
|
|
31
|
-
external?: boolean;
|
|
32
|
-
} | null;
|
|
33
|
-
navigate?: (href: string) => void | Promise<unknown>;
|
|
34
|
-
};
|
|
35
|
-
location?: {
|
|
36
|
-
current: () => string;
|
|
37
|
-
subscribe: (listener: () => void) => () => void;
|
|
38
|
-
createLink?: (target: {
|
|
39
|
-
blockId: string;
|
|
40
|
-
topicId: string;
|
|
41
|
-
}) => string | null;
|
|
42
|
-
};
|
|
43
|
-
preferences?: {
|
|
44
|
-
get: (key: string) => string | null;
|
|
45
|
-
set: (key: string, value: string) => void;
|
|
46
|
-
};
|
|
47
|
-
comments?: {
|
|
48
|
-
list: (resourceId: string) => Promise<{
|
|
49
|
-
items: CommentItem[];
|
|
50
|
-
}>;
|
|
51
|
-
create: (resourceId: string, body: string, parentId?: string, target?: {
|
|
52
|
-
blockId: string;
|
|
53
|
-
topicId: string;
|
|
54
|
-
}) => Promise<unknown>;
|
|
55
|
-
update?: (commentId: string, body: string) => Promise<unknown>;
|
|
56
|
-
resolve: (commentId: string, resolved: boolean) => Promise<unknown>;
|
|
57
|
-
remove: (commentId: string) => Promise<unknown>;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
export declare const unavailableAttachment: AttachmentFetcher;
|
|
1
|
+
export type { ContentHost, AttachmentFetcher, ReferenceCandidate } from './engine/host';
|
|
2
|
+
export { unavailableAttachment } from './engine/host';
|
package/dist/types/host.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { ContentHost } from './host-types';
|
|
3
3
|
import './styles.css';
|
|
4
|
+
import { type I18nScope, type WendangLocale, type WendangMessages } from 'wendang/i18n';
|
|
5
|
+
import type { VideoEmbedPolicy } from 'wendang/shared';
|
|
4
6
|
export interface ContentContext {
|
|
5
7
|
host: ContentHost;
|
|
6
8
|
theme: 'light' | 'dark';
|
|
7
9
|
accent: string;
|
|
8
10
|
portal: HTMLElement | null;
|
|
11
|
+
i18n: I18nScope;
|
|
12
|
+
video?: VideoEmbedPolicy;
|
|
9
13
|
}
|
|
10
14
|
export declare function useContentContext(): ContentContext;
|
|
11
15
|
export declare function useContentHost(): ContentHost;
|
|
@@ -20,5 +24,8 @@ export interface ContentProviderProps {
|
|
|
20
24
|
unstyled?: boolean;
|
|
21
25
|
children?: ReactNode;
|
|
22
26
|
className?: string;
|
|
27
|
+
locale?: WendangLocale;
|
|
28
|
+
messages?: Partial<WendangMessages>;
|
|
29
|
+
video?: VideoEmbedPolicy;
|
|
23
30
|
}
|
|
24
|
-
export declare function ContentProvider({ host, theme, accent, unstyled, children, className }: ContentProviderProps): import("react").JSX.Element;
|
|
31
|
+
export declare function ContentProvider({ host, theme, accent, unstyled, children, className, locale, messages, video }: ContentProviderProps): import("react").JSX.Element;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,3 +3,5 @@ export type { ContentProviderProps } from './host';
|
|
|
3
3
|
export type { ContentHost, AttachmentFetcher, ReferenceCandidate } from './host-types';
|
|
4
4
|
export { unavailableAttachment } from './host-types';
|
|
5
5
|
export type * from 'wendang/types';
|
|
6
|
+
export { useI18n } from './i18n';
|
|
7
|
+
export type { WendangLocale, WendangMessages } from 'wendang/i18n';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from 'wendang/locales/en-US';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from 'wendang/locales/es-ES';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from 'wendang/locales/ja-JP';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from 'wendang/locales/ko-KR';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from 'wendang/locales/zh-CN';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from 'wendang/locales/zh-TW';
|
|
@@ -28,6 +28,7 @@ export declare function FileView({ id, filename, mimeType, size, fetcher, allowE
|
|
|
28
28
|
fetcher?: AttachmentFetcher;
|
|
29
29
|
allowExport?: boolean;
|
|
30
30
|
}): import("react").JSX.Element;
|
|
31
|
-
export declare function VideoView({ attrs }: {
|
|
31
|
+
export declare function VideoView({ attrs, reloadKey }: {
|
|
32
32
|
attrs: Record<string, unknown>;
|
|
33
|
+
reloadKey?: number;
|
|
33
34
|
}): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { importXlsx, exportXlsx } from '../engine/worksheets/worksheet-xlsx';
|
|
2
|
-
export type { XlsxInspection, XlsxImport } from '../engine/worksheets/worksheet-xlsx';
|
|
2
|
+
export type { XlsxInspection, XlsxImport, XlsxLocaleOptions } from '../engine/worksheets/worksheet-xlsx';
|
|
@@ -10,9 +10,10 @@ export interface DropdownGroup {
|
|
|
10
10
|
title?: string;
|
|
11
11
|
items: DropdownItem[];
|
|
12
12
|
}
|
|
13
|
-
export declare function WDropdown({ label, groups, onSelect, buttonProps }: {
|
|
13
|
+
export declare function WDropdown({ label, groups, onSelect, buttonProps, onOpenChange }: {
|
|
14
14
|
label: ReactNode;
|
|
15
15
|
groups: DropdownGroup[];
|
|
16
16
|
onSelect: (value: string) => void;
|
|
17
17
|
buttonProps?: WButtonProps;
|
|
18
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
19
|
}): import("react").JSX.Element;
|
|
@@ -43,7 +43,7 @@ export interface WSelectOption {
|
|
|
43
43
|
label: string;
|
|
44
44
|
disabled?: boolean;
|
|
45
45
|
}
|
|
46
|
-
export declare function WSelect({ label, ariaLabel, value, onChange, options, disabled, size, searchable, width, className }: {
|
|
46
|
+
export declare function WSelect({ label, ariaLabel, value, onChange, options, disabled, size, searchable, width, className, prefix }: {
|
|
47
47
|
label?: string;
|
|
48
48
|
ariaLabel?: string;
|
|
49
49
|
value: string | number;
|
|
@@ -54,6 +54,7 @@ export declare function WSelect({ label, ariaLabel, value, onChange, options, di
|
|
|
54
54
|
searchable?: boolean;
|
|
55
55
|
width?: number | string;
|
|
56
56
|
className?: string;
|
|
57
|
+
prefix?: ReactNode;
|
|
57
58
|
}): import("react").JSX.Element;
|
|
58
59
|
export declare function WDialog({ title, children, onClose, fullscreen, hideFooter, footer, workspace, className, ariaLabel, escToClose }: {
|
|
59
60
|
title: ReactNode;
|