@wakastellar/ui 3.3.3 → 3.5.0
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/badge-BbwO7QeZ.js +1 -0
- package/dist/badge-BfiocODp.mjs +23 -0
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +1 -1
- package/dist/chunk-14q5BKub.js +1 -0
- package/dist/{chunk-BH6uBOac.mjs → chunk-Cr9pTUWm.mjs} +5 -5
- package/dist/cn-DEtaFQsA.js +1 -0
- package/dist/cn-DUn6aSIQ.mjs +24 -0
- package/dist/doc.cjs.js +2 -2
- package/dist/doc.es.js +19 -19
- package/dist/editor.cjs.js +48 -0
- package/dist/editor.d.ts +1 -0
- package/dist/editor.es.js +6551 -0
- package/dist/{exceljs.min-DG9M8IZ1.mjs → exceljs.min-DL1XYDll.mjs} +1 -1
- package/dist/{exceljs.min-BuefmDRS.js → exceljs.min-qeIfSCbF.js} +1 -1
- package/dist/export.cjs.js +1 -1
- package/dist/export.es.js +1 -1
- package/dist/index.cjs.js +150 -150
- package/dist/index.es.js +26782 -27591
- package/dist/input-BfaSAGVw.js +1 -0
- package/dist/input-DVr_Qkl8.mjs +14 -0
- package/dist/rich-text.cjs.js +1 -1
- package/dist/rich-text.es.js +1 -1
- package/dist/security-CyBpuklN.mjs +122 -0
- package/dist/security-bFWwDrlg.js +1 -0
- package/dist/separator-NrkltulH.js +1 -0
- package/dist/separator-ibN2mycs.mjs +51 -0
- package/dist/src/components/editor/blocks/index.d.ts +51 -0
- package/dist/src/components/editor/blocks/waka-acceptance-criteria-block.d.ts +60 -0
- package/dist/src/components/editor/blocks/waka-ai-assist-block.d.ts +58 -0
- package/dist/src/components/editor/blocks/waka-api-endpoint-block.d.ts +63 -0
- package/dist/src/components/editor/blocks/waka-code-playground-block.d.ts +61 -0
- package/dist/src/components/editor/blocks/waka-comment-thread-block.d.ts +85 -0
- package/dist/src/components/editor/blocks/waka-diagram-block.d.ts +52 -0
- package/dist/src/components/editor/blocks/waka-embed-block.d.ts +58 -0
- package/dist/src/components/editor/blocks/waka-slash-menu-block.d.ts +67 -0
- package/dist/src/components/editor/blocks/waka-user-story-block.d.ts +79 -0
- package/dist/src/components/editor/blocks/waka-version-diff-block.d.ts +73 -0
- package/dist/src/components/editor/index.d.ts +66 -0
- package/dist/src/components/editor/waka-ai-writer.d.ts +80 -0
- package/dist/src/components/editor/waka-collaborative-editor.d.ts +93 -0
- package/dist/src/components/editor/waka-diff-viewer.d.ts +71 -0
- package/dist/src/components/editor/waka-dnd-editor.d.ts +64 -0
- package/dist/src/components/editor/waka-document-editor.d.ts +92 -0
- package/dist/src/components/editor/waka-editor-elements.d.ts +79 -0
- package/dist/src/components/editor/waka-editor-leaves.d.ts +39 -0
- package/dist/src/components/editor/waka-editor-plugins.d.ts +41 -0
- package/dist/src/components/editor/waka-editor-toolbar.d.ts +20 -0
- package/dist/src/components/editor/waka-editor.d.ts +59 -0
- package/dist/src/components/editor/waka-floating-toolbar.d.ts +47 -0
- package/dist/src/components/editor/waka-markdown-editor.d.ts +60 -0
- package/dist/src/components/editor/waka-mention-editor.d.ts +125 -0
- package/dist/src/components/editor/waka-slash-menu.d.ts +70 -0
- package/dist/src/components/editor/waka-spec-editor.d.ts +88 -0
- package/dist/src/components/index.d.ts +1 -15
- package/dist/src/editor.d.ts +26 -0
- package/dist/textarea-CdQWggYG.js +1 -0
- package/dist/textarea-DJDXJ3nd.mjs +23 -0
- package/dist/types-C2St0wOW.js +1 -0
- package/dist/{types-B6GVaSIP.mjs → types-JnqoLyuv.mjs} +214 -211
- package/dist/{useDataTableImport-BPvfo--2.mjs → useDataTableImport-BWUFesPi.mjs} +3 -3
- package/dist/{useDataTableImport-Cm_pCKnO.js → useDataTableImport-T7ddpN5k.js} +3 -3
- package/dist/waka-doc-renderer-CTxC7Trf.js +3 -0
- package/dist/{waka-doc-renderer-BkIvas3z.mjs → waka-doc-renderer-Cw-Xnyen.mjs} +264 -281
- package/dist/waka-editor-plugins-DR6tpsUC.mjs +135 -0
- package/dist/waka-editor-plugins-sGSh9hn2.js +1 -0
- package/dist/waka-rich-text-editor-BlIdtknG.js +1 -0
- package/dist/waka-rich-text-editor-D1uA3zbB.js +1 -0
- package/dist/waka-rich-text-editor-DgSWiXMW.mjs +342 -0
- package/dist/waka-rich-text-editor-DndVJuDw.mjs +2 -0
- package/package.json +87 -2
- package/src/blocks/footer/index.tsx +1 -6
- package/src/blocks/login/index.tsx +1 -7
- package/src/blocks/profile/index.tsx +3 -5
- package/src/components/editor/blocks/index.ts +182 -0
- package/src/components/editor/blocks/waka-acceptance-criteria-block.tsx +326 -0
- package/src/components/editor/blocks/waka-ai-assist-block.tsx +284 -0
- package/src/components/editor/blocks/waka-api-endpoint-block.tsx +382 -0
- package/src/components/editor/blocks/waka-code-playground-block.tsx +331 -0
- package/src/components/editor/blocks/waka-comment-thread-block.tsx +448 -0
- package/src/components/editor/blocks/waka-diagram-block.tsx +293 -0
- package/src/components/editor/blocks/waka-embed-block.tsx +416 -0
- package/src/components/editor/blocks/waka-slash-menu-block.tsx +432 -0
- package/src/components/editor/blocks/waka-user-story-block.tsx +295 -0
- package/src/components/editor/blocks/waka-version-diff-block.tsx +426 -0
- package/src/components/editor/index.ts +279 -0
- package/src/components/editor/waka-ai-writer.tsx +434 -0
- package/src/components/editor/waka-collaborative-editor.tsx +426 -0
- package/src/components/editor/waka-diff-viewer.tsx +352 -0
- package/src/components/editor/waka-dnd-editor.tsx +284 -0
- package/src/components/editor/waka-document-editor.tsx +502 -0
- package/src/components/editor/waka-editor-elements.tsx +312 -0
- package/src/components/editor/waka-editor-leaves.tsx +101 -0
- package/src/components/editor/waka-editor-plugins.ts +207 -0
- package/src/components/editor/waka-editor-toolbar.tsx +358 -0
- package/src/components/editor/waka-editor.tsx +431 -0
- package/src/components/editor/waka-floating-toolbar.tsx +268 -0
- package/src/components/editor/waka-markdown-editor.tsx +395 -0
- package/src/components/editor/waka-mention-editor.tsx +459 -0
- package/src/components/editor/waka-slash-menu.tsx +392 -0
- package/src/components/editor/waka-spec-editor.tsx +657 -0
- package/src/components/index.ts +1 -18
- package/dist/chunk-BDDJmn7V.js +0 -1
- package/dist/cn-DnPbmOCy.js +0 -1
- package/dist/cn-DpLcAzrf.mjs +0 -22
- package/dist/separator-BDReXBvI.mjs +0 -59
- package/dist/separator-BKjNl9sI.js +0 -1
- package/dist/src/components/waka-actor-badge/index.d.ts +0 -8
- package/dist/src/components/waka-actors-list/index.d.ts +0 -18
- package/dist/src/components/waka-ai-assistant-button/index.d.ts +0 -8
- package/dist/src/components/waka-document-flyover/index.d.ts +0 -10
- package/dist/src/components/waka-document-preview-popup/index.d.ts +0 -26
- package/dist/src/components/waka-hour-balance-badge/index.d.ts +0 -8
- package/dist/src/components/waka-hour-consumption-table/index.d.ts +0 -15
- package/dist/src/components/waka-hour-pack-dialog/index.d.ts +0 -8
- package/dist/src/components/waka-project-stats-header/index.d.ts +0 -15
- package/dist/src/components/waka-step-comment-bubble/index.d.ts +0 -13
- package/dist/src/components/waka-step-comment-panel/index.d.ts +0 -20
- package/dist/src/components/waka-step-permission-matrix/index.d.ts +0 -12
- package/dist/src/components/waka-time-entry-dialog/index.d.ts +0 -16
- package/dist/src/components/waka-time-tracking-flyover/index.d.ts +0 -11
- package/dist/types-BH9cQRqZ.js +0 -1
- package/dist/waka-doc-renderer-BZ2-SqyT.js +0 -3
- package/dist/waka-rich-text-editor-BJGlQgpq.js +0 -1
- package/dist/waka-rich-text-editor-BJzzxeP1.mjs +0 -361
- package/dist/waka-rich-text-editor-wnXLwvUo.js +0 -1
- package/src/components/waka-actor-badge/index.tsx +0 -34
- package/src/components/waka-actors-list/index.tsx +0 -125
- package/src/components/waka-ai-assistant-button/index.tsx +0 -31
- package/src/components/waka-document-flyover/index.tsx +0 -36
- package/src/components/waka-document-preview-popup/index.tsx +0 -103
- package/src/components/waka-hour-balance-badge/index.tsx +0 -43
- package/src/components/waka-hour-consumption-table/index.tsx +0 -72
- package/src/components/waka-hour-pack-dialog/index.tsx +0 -72
- package/src/components/waka-project-stats-header/index.tsx +0 -69
- package/src/components/waka-step-comment-bubble/index.tsx +0 -71
- package/src/components/waka-step-comment-panel/index.tsx +0 -106
- package/src/components/waka-step-permission-matrix/index.tsx +0 -65
- package/src/components/waka-time-entry-dialog/index.tsx +0 -131
- package/src/components/waka-time-tracking-flyover/index.tsx +0 -41
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type SlateNode = any;
|
|
3
|
+
/** TOC entry extracted from headings */
|
|
4
|
+
export interface TocEntry {
|
|
5
|
+
id: string;
|
|
6
|
+
text: string;
|
|
7
|
+
level: number;
|
|
8
|
+
depth: number;
|
|
9
|
+
}
|
|
10
|
+
export interface WakaDocumentEditorProps {
|
|
11
|
+
/** Initial Slate content */
|
|
12
|
+
value?: SlateNode[];
|
|
13
|
+
/** Change callback */
|
|
14
|
+
onChange?: (value: SlateNode[]) => void;
|
|
15
|
+
/** Read-only mode */
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
/** Placeholder */
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/** CSS class for the root layout */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** CSS class for the editor area */
|
|
22
|
+
editorClassName?: string;
|
|
23
|
+
/** Minimum height in px */
|
|
24
|
+
minHeight?: number;
|
|
25
|
+
/** Label */
|
|
26
|
+
label?: string;
|
|
27
|
+
/** Description */
|
|
28
|
+
description?: string;
|
|
29
|
+
/** Error message */
|
|
30
|
+
error?: string;
|
|
31
|
+
/** Document title (displayed in the header) */
|
|
32
|
+
title?: string;
|
|
33
|
+
/** Callback when title changes */
|
|
34
|
+
onTitleChange?: (title: string) => void;
|
|
35
|
+
/** Show TOC sidebar */
|
|
36
|
+
showTOC?: boolean;
|
|
37
|
+
/** Enable @mentions */
|
|
38
|
+
enableMentions?: boolean;
|
|
39
|
+
/** Mention search function. Returns matching users for a query string. */
|
|
40
|
+
onMentionSearch?: (query: string) => Promise<Array<{
|
|
41
|
+
key: string;
|
|
42
|
+
label: string;
|
|
43
|
+
avatar?: string;
|
|
44
|
+
}>>;
|
|
45
|
+
/** Enable slash commands */
|
|
46
|
+
enableSlashCommands?: boolean;
|
|
47
|
+
/** Enable AI features */
|
|
48
|
+
enableAI?: boolean;
|
|
49
|
+
/** AI endpoint for AI features */
|
|
50
|
+
aiEndpoint?: string;
|
|
51
|
+
/** System prompt for AI */
|
|
52
|
+
aiSystemPrompt?: string;
|
|
53
|
+
/** Enable DnD block reordering */
|
|
54
|
+
enableDnD?: boolean;
|
|
55
|
+
/** Enable markdown paste support */
|
|
56
|
+
enableMarkdown?: boolean;
|
|
57
|
+
/** Extra Plate plugins */
|
|
58
|
+
extraPlugins?: any[];
|
|
59
|
+
/** Ref to the editor instance */
|
|
60
|
+
editorRef?: React.MutableRefObject<any>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* WakaDocumentEditor -- Google-Docs-style full document editor.
|
|
64
|
+
*
|
|
65
|
+
* Features:
|
|
66
|
+
* - Fixed toolbar with formatting controls
|
|
67
|
+
* - Optional TOC sidebar (auto-extracted from headings)
|
|
68
|
+
* - @mentions with async user search
|
|
69
|
+
* - Slash commands (/) for quick block insertion
|
|
70
|
+
* - Drag-and-drop block reordering
|
|
71
|
+
* - AI integration (optional)
|
|
72
|
+
* - Markdown paste support
|
|
73
|
+
*
|
|
74
|
+
* Perfect for writing specifications, proposals, documentation,
|
|
75
|
+
* or any long-form content within WakaStart apps.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```tsx
|
|
79
|
+
* <WakaDocumentEditor
|
|
80
|
+
* title="Architecture Specification"
|
|
81
|
+
* onTitleChange={setTitle}
|
|
82
|
+
* showTOC
|
|
83
|
+
* enableMentions
|
|
84
|
+
* enableSlashCommands
|
|
85
|
+
* enableDnD
|
|
86
|
+
* value={content}
|
|
87
|
+
* onChange={setContent}
|
|
88
|
+
* />
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare const WakaDocumentEditor: React.ForwardRefExoticComponent<WakaDocumentEditorProps & React.RefAttributes<HTMLDivElement>>;
|
|
92
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface PlateElementProps {
|
|
3
|
+
attributes?: Record<string, unknown>;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
element?: Record<string, unknown>;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function TableElement({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare namespace TableElement {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function TableRowElement({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare namespace TableRowElement {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function TableCellElement({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare namespace TableCellElement {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function TableCellHeaderElement({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare namespace TableCellHeaderElement {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function ColumnGroupElement({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare namespace ColumnGroupElement {
|
|
26
|
+
var displayName: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function ColumnElement({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare namespace ColumnElement {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function CalloutElement({ children, attributes, element, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare namespace CalloutElement {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
export declare function H1Element({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare namespace H1Element {
|
|
38
|
+
var displayName: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function H2Element({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare namespace H2Element {
|
|
42
|
+
var displayName: string;
|
|
43
|
+
}
|
|
44
|
+
export declare function H3Element({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare namespace H3Element {
|
|
46
|
+
var displayName: string;
|
|
47
|
+
}
|
|
48
|
+
export declare function H4Element({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export declare namespace H4Element {
|
|
50
|
+
var displayName: string;
|
|
51
|
+
}
|
|
52
|
+
export declare function H5Element({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export declare namespace H5Element {
|
|
54
|
+
var displayName: string;
|
|
55
|
+
}
|
|
56
|
+
export declare function H6Element({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export declare namespace H6Element {
|
|
58
|
+
var displayName: string;
|
|
59
|
+
}
|
|
60
|
+
export declare function BlockquoteElement({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export declare namespace BlockquoteElement {
|
|
62
|
+
var displayName: string;
|
|
63
|
+
}
|
|
64
|
+
export declare function ParagraphElement({ children, attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
export declare namespace ParagraphElement {
|
|
66
|
+
var displayName: string;
|
|
67
|
+
}
|
|
68
|
+
export declare function LinkElement({ children, attributes, element, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
export declare namespace LinkElement {
|
|
70
|
+
var displayName: string;
|
|
71
|
+
}
|
|
72
|
+
export declare function MentionElement({ children, attributes, element, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
73
|
+
export declare namespace MentionElement {
|
|
74
|
+
var displayName: string;
|
|
75
|
+
}
|
|
76
|
+
export declare function SeparatorElement({ attributes, className }: PlateElementProps): import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
export declare namespace SeparatorElement {
|
|
78
|
+
var displayName: string;
|
|
79
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface PlateLeafProps {
|
|
3
|
+
attributes?: Record<string, unknown>;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
leaf?: Record<string, unknown>;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function BoldLeaf({ children, attributes, className }: PlateLeafProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare namespace BoldLeaf {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function ItalicLeaf({ children, attributes, className }: PlateLeafProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare namespace ItalicLeaf {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function UnderlineLeaf({ children, attributes, className }: PlateLeafProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare namespace UnderlineLeaf {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function StrikethroughLeaf({ children, attributes, className }: PlateLeafProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare namespace StrikethroughLeaf {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function CodeLeaf({ children, attributes, className }: PlateLeafProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare namespace CodeLeaf {
|
|
26
|
+
var displayName: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function HighlightLeaf({ children, attributes, className }: PlateLeafProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare namespace HighlightLeaf {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function SuperscriptLeaf({ children, attributes, className }: PlateLeafProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare namespace SuperscriptLeaf {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
export declare function SubscriptLeaf({ children, attributes, className }: PlateLeafProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare namespace SubscriptLeaf {
|
|
38
|
+
var displayName: string;
|
|
39
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { PlatePlugin } from 'platejs/react';
|
|
2
|
+
/**
|
|
3
|
+
* Dynamically loads the core formatting plugins (marks + block elements).
|
|
4
|
+
* These are always included in the editor.
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadCorePlugins(): Promise<PlatePlugin[]>;
|
|
7
|
+
/** Loads the link plugin */
|
|
8
|
+
export declare function loadLinkPlugin(): Promise<PlatePlugin[]>;
|
|
9
|
+
/** Loads media plugins (image, video, embed) */
|
|
10
|
+
export declare function loadMediaPlugins(): Promise<PlatePlugin[]>;
|
|
11
|
+
/** Loads mention plugins */
|
|
12
|
+
export declare function loadMentionPlugins(): Promise<PlatePlugin[]>;
|
|
13
|
+
/** Loads DnD (drag and drop) plugin */
|
|
14
|
+
export declare function loadDndPlugin(): Promise<PlatePlugin[]>;
|
|
15
|
+
/** Loads TOC (table of contents) plugin */
|
|
16
|
+
export declare function loadTocPlugin(): Promise<PlatePlugin[]>;
|
|
17
|
+
/** Loads indent plugin */
|
|
18
|
+
export declare function loadIndentPlugin(): Promise<PlatePlugin[]>;
|
|
19
|
+
/** Loads markdown serialization plugin */
|
|
20
|
+
export declare function loadMarkdownPlugin(): Promise<PlatePlugin[]>;
|
|
21
|
+
/** Loads selection plugin */
|
|
22
|
+
export declare function loadSelectionPlugin(): Promise<PlatePlugin[]>;
|
|
23
|
+
/** Loads AI plugins (AI menu + AI chat) */
|
|
24
|
+
export declare function loadAIPlugins(options?: {
|
|
25
|
+
endpoint?: string;
|
|
26
|
+
systemPrompt?: string;
|
|
27
|
+
headers?: Record<string, string>;
|
|
28
|
+
}): Promise<PlatePlugin[]>;
|
|
29
|
+
/** Loads emoji plugin */
|
|
30
|
+
export declare function loadEmojiPlugin(): Promise<PlatePlugin[]>;
|
|
31
|
+
/** Loads floating toolbar plugin */
|
|
32
|
+
export declare function loadFloatingPlugin(): Promise<PlatePlugin[]>;
|
|
33
|
+
/** Loads diff plugin for document comparison */
|
|
34
|
+
export declare function loadDiffPlugin(): Promise<PlatePlugin[]>;
|
|
35
|
+
/** Loads combobox/slash-command plugins */
|
|
36
|
+
export declare function loadComboboxPlugins(): Promise<PlatePlugin[]>;
|
|
37
|
+
export type WakaEditorPreset = "minimal" | "standard" | "full";
|
|
38
|
+
/**
|
|
39
|
+
* Returns the list of optional plugin loaders based on a named preset.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getPresetLoaders(preset: WakaEditorPreset): (typeof loadLinkPlugin)[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ToolbarAction = "bold" | "italic" | "underline" | "strikethrough" | "code" | "highlight" | "h1" | "h2" | "h3" | "blockquote" | "callout" | "table" | "columns" | "link" | "image" | "separator" | "ai";
|
|
2
|
+
/** A group of toolbar buttons rendered together with separators between groups */
|
|
3
|
+
export type ToolbarGroup = ToolbarAction[];
|
|
4
|
+
export interface WakaEditorToolbarProps {
|
|
5
|
+
/** Button groups to render */
|
|
6
|
+
groups?: ToolbarGroup[];
|
|
7
|
+
/** The Plate editor instance (typed as unknown to avoid tight coupling) */
|
|
8
|
+
editor: unknown;
|
|
9
|
+
/** Extra CSS class names */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Whether to show AI button */
|
|
12
|
+
enableAI?: boolean;
|
|
13
|
+
/** Callback when AI button is clicked */
|
|
14
|
+
onAIClick?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const DEFAULT_TOOLBAR_GROUPS: ToolbarGroup[];
|
|
17
|
+
export declare function WakaEditorToolbar({ groups, editor, className, enableAI, onAIClick, }: WakaEditorToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare namespace WakaEditorToolbar {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ToolbarGroup } from './waka-editor-toolbar';
|
|
2
|
+
import { WakaEditorPreset } from './waka-editor-plugins';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
/**
|
|
5
|
+
* Slate/Plate node type. Using a generic type to avoid tight coupling
|
|
6
|
+
* with Plate internals while remaining compatible.
|
|
7
|
+
*/
|
|
8
|
+
export type SlateNode = any;
|
|
9
|
+
export interface WakaEditorProps {
|
|
10
|
+
/** Initial content as Slate value */
|
|
11
|
+
value?: SlateNode[];
|
|
12
|
+
/** Change callback with updated Slate value */
|
|
13
|
+
onChange?: (value: SlateNode[]) => void;
|
|
14
|
+
/** Read-only mode */
|
|
15
|
+
readOnly?: boolean;
|
|
16
|
+
/** Placeholder text */
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
/** Extra CSS class names on the root container */
|
|
19
|
+
className?: string;
|
|
20
|
+
/** Extra CSS class names on the editable area */
|
|
21
|
+
editorClassName?: string;
|
|
22
|
+
/** Minimum height of the editable area in px */
|
|
23
|
+
minHeight?: number;
|
|
24
|
+
/** Label displayed above the editor */
|
|
25
|
+
label?: string;
|
|
26
|
+
/** Description displayed below the label */
|
|
27
|
+
description?: string;
|
|
28
|
+
/** Error message */
|
|
29
|
+
error?: string;
|
|
30
|
+
/** Named preset: "minimal" | "standard" | "full" (default: "standard") */
|
|
31
|
+
preset?: WakaEditorPreset;
|
|
32
|
+
/** Show AI assistant button in toolbar */
|
|
33
|
+
enableAI?: boolean;
|
|
34
|
+
/** Enable Yjs collaboration (not yet implemented) */
|
|
35
|
+
enableCollaboration?: boolean;
|
|
36
|
+
/** Enable inline comments (not yet implemented) */
|
|
37
|
+
enableComments?: boolean;
|
|
38
|
+
/** Enable markdown import/export */
|
|
39
|
+
enableMarkdown?: boolean;
|
|
40
|
+
/** Enable image and video embeds */
|
|
41
|
+
enableMedia?: boolean;
|
|
42
|
+
/** Enable @mentions */
|
|
43
|
+
enableMentions?: boolean;
|
|
44
|
+
/** Enable drag-and-drop reordering */
|
|
45
|
+
enableDnD?: boolean;
|
|
46
|
+
/** Enable table of contents generation */
|
|
47
|
+
enableTOC?: boolean;
|
|
48
|
+
/** Custom toolbar groups (overrides preset defaults) */
|
|
49
|
+
toolbarGroups?: ToolbarGroup[];
|
|
50
|
+
/** Hide the toolbar entirely */
|
|
51
|
+
hideToolbar?: boolean;
|
|
52
|
+
/** Callback when AI button is clicked */
|
|
53
|
+
onAIClick?: () => void;
|
|
54
|
+
/** Extra Plate plugins to add on top of the preset */
|
|
55
|
+
extraPlugins?: any[];
|
|
56
|
+
/** Ref to the internal Plate editor instance */
|
|
57
|
+
editorRef?: React.MutableRefObject<any>;
|
|
58
|
+
}
|
|
59
|
+
export declare const WakaEditor: React.ForwardRefExoticComponent<WakaEditorProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/** A button definition for the floating toolbar */
|
|
4
|
+
export interface FloatingToolbarButton {
|
|
5
|
+
key: string;
|
|
6
|
+
icon: LucideIcon;
|
|
7
|
+
label: string;
|
|
8
|
+
shortcut?: string;
|
|
9
|
+
/** Execute the action on the editor */
|
|
10
|
+
action: (editor: any) => void;
|
|
11
|
+
/** Check if this mark/block is active */
|
|
12
|
+
isActive?: (editor: any) => boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface WakaFloatingToolbarProps {
|
|
15
|
+
/** The Plate editor instance */
|
|
16
|
+
editor: unknown;
|
|
17
|
+
/** Additional buttons to display */
|
|
18
|
+
buttons?: FloatingToolbarButton[];
|
|
19
|
+
/** Whether to show the AI "Ask AI" button */
|
|
20
|
+
enableAI?: boolean;
|
|
21
|
+
/** Callback when AI button is clicked */
|
|
22
|
+
onAIClick?: () => void;
|
|
23
|
+
/** CSS class */
|
|
24
|
+
className?: string;
|
|
25
|
+
/** Whether to show in read-only mode */
|
|
26
|
+
showWhenReadOnly?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** Default floating toolbar buttons */
|
|
29
|
+
export declare const DEFAULT_FLOATING_BUTTONS: FloatingToolbarButton[];
|
|
30
|
+
/**
|
|
31
|
+
* WakaFloatingToolbar -- Floating contextual toolbar that appears on text selection.
|
|
32
|
+
*
|
|
33
|
+
* This component should be placed **inside** a `<Plate>` context. It uses
|
|
34
|
+
* `@platejs/floating`'s `useFloatingToolbar` hook internally when available,
|
|
35
|
+
* or falls back to a static inline toolbar.
|
|
36
|
+
*
|
|
37
|
+
* For the floating behavior to work, the app must install `@platejs/floating`.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* <Plate editor={editor}>
|
|
42
|
+
* <WakaFloatingToolbar editor={editor} enableAI onAIClick={handleAI} />
|
|
43
|
+
* <PlateContent />
|
|
44
|
+
* </Plate>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare const WakaFloatingToolbar: React.ForwardRefExoticComponent<WakaFloatingToolbarProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type SlateNode = any;
|
|
3
|
+
export type MarkdownEditorMode = "rich" | "markdown" | "split";
|
|
4
|
+
export interface WakaMarkdownEditorProps {
|
|
5
|
+
/** Markdown string content */
|
|
6
|
+
markdownValue?: string;
|
|
7
|
+
/** Callback when markdown content changes */
|
|
8
|
+
onMarkdownChange?: (markdown: string) => void;
|
|
9
|
+
/** Slate value (for rich text mode) */
|
|
10
|
+
slateValue?: SlateNode[];
|
|
11
|
+
/** Callback when slate value changes */
|
|
12
|
+
onSlateChange?: (value: SlateNode[]) => void;
|
|
13
|
+
/** Initial view mode */
|
|
14
|
+
defaultMode?: MarkdownEditorMode;
|
|
15
|
+
/** Read-only mode */
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
/** Placeholder */
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/** CSS class */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Editor area CSS class */
|
|
22
|
+
editorClassName?: string;
|
|
23
|
+
/** Minimum height in px */
|
|
24
|
+
minHeight?: number;
|
|
25
|
+
/** Label */
|
|
26
|
+
label?: string;
|
|
27
|
+
/** Description */
|
|
28
|
+
description?: string;
|
|
29
|
+
/** Error */
|
|
30
|
+
error?: string;
|
|
31
|
+
/** Extra Plate plugins */
|
|
32
|
+
extraPlugins?: any[];
|
|
33
|
+
/** Ref to editor instance */
|
|
34
|
+
editorRef?: React.MutableRefObject<any>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* WakaMarkdownEditor -- Dual-mode rich text / Markdown editor.
|
|
38
|
+
*
|
|
39
|
+
* Transparently syncs content between Plate (rich text) and raw Markdown.
|
|
40
|
+
* Supports three view modes:
|
|
41
|
+
* - `rich`: WYSIWYG Plate editor (default)
|
|
42
|
+
* - `markdown`: Raw Markdown textarea with monospace font
|
|
43
|
+
* - `split`: Side-by-side Plate + Markdown preview
|
|
44
|
+
*
|
|
45
|
+
* Uses `@platejs/markdown` for serialization/deserialization.
|
|
46
|
+
*
|
|
47
|
+
* Perfect for developer documentation, README editors,
|
|
48
|
+
* or any context where users need to switch between rich text and Markdown.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* <WakaMarkdownEditor
|
|
53
|
+
* markdownValue={md}
|
|
54
|
+
* onMarkdownChange={setMd}
|
|
55
|
+
* defaultMode="split"
|
|
56
|
+
* />
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare const WakaMarkdownEditor: React.ForwardRefExoticComponent<WakaMarkdownEditorProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type SlateNode = any;
|
|
3
|
+
/** A mentionable user entity */
|
|
4
|
+
export interface MentionableUser {
|
|
5
|
+
/** Unique ID (e.g., keycloak-id or user wid) */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Display name */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Email address */
|
|
10
|
+
email?: string;
|
|
11
|
+
/** Avatar URL */
|
|
12
|
+
avatar?: string;
|
|
13
|
+
/** Role or title (shown in the suggestion list) */
|
|
14
|
+
role?: string;
|
|
15
|
+
/** Admin level (for display badge) */
|
|
16
|
+
adminLevel?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Describes a mention that was inserted into the document */
|
|
19
|
+
export interface InsertedMention {
|
|
20
|
+
/** The user that was mentioned */
|
|
21
|
+
user: MentionableUser;
|
|
22
|
+
/** The Slate path where the mention was inserted */
|
|
23
|
+
path?: number[];
|
|
24
|
+
}
|
|
25
|
+
export interface WakaMentionEditorProps {
|
|
26
|
+
/** Initial Slate content */
|
|
27
|
+
value?: SlateNode[];
|
|
28
|
+
/** Change callback */
|
|
29
|
+
onChange?: (value: SlateNode[]) => void;
|
|
30
|
+
/** Read-only mode */
|
|
31
|
+
readOnly?: boolean;
|
|
32
|
+
/** Placeholder */
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
/** CSS class */
|
|
35
|
+
className?: string;
|
|
36
|
+
/** Editor CSS class */
|
|
37
|
+
editorClassName?: string;
|
|
38
|
+
/** Minimum height in px */
|
|
39
|
+
minHeight?: number;
|
|
40
|
+
/** Label */
|
|
41
|
+
label?: string;
|
|
42
|
+
/** Description */
|
|
43
|
+
description?: string;
|
|
44
|
+
/** Error */
|
|
45
|
+
error?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Async search function that resolves mentionable users.
|
|
48
|
+
* Called when the user types after "@".
|
|
49
|
+
* Should return matching users from the WakaStart API.
|
|
50
|
+
*/
|
|
51
|
+
onSearch: (query: string) => Promise<MentionableUser[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Callback when a mention is inserted.
|
|
54
|
+
* Can be used to trigger notifications.
|
|
55
|
+
*/
|
|
56
|
+
onMentionInserted?: (mention: InsertedMention) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Trigger character for mentions. Default: "@"
|
|
59
|
+
*/
|
|
60
|
+
trigger?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Debounce delay for the search function in ms.
|
|
63
|
+
* Default: 300
|
|
64
|
+
*/
|
|
65
|
+
searchDebounceMs?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Maximum number of search results to show.
|
|
68
|
+
* Default: 8
|
|
69
|
+
*/
|
|
70
|
+
maxResults?: number;
|
|
71
|
+
/** Extra Plate plugins */
|
|
72
|
+
extraPlugins?: any[];
|
|
73
|
+
/** Ref to editor instance */
|
|
74
|
+
editorRef?: React.MutableRefObject<any>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* WakaMentionEditor -- Rich text editor with @mention support.
|
|
78
|
+
*
|
|
79
|
+
* Integrates `@platejs/mention` to provide user mention functionality.
|
|
80
|
+
* When the user types "@", a dropdown with matching users appears.
|
|
81
|
+
* The search function is async, allowing API-backed user resolution
|
|
82
|
+
* scoped to the current tenant (Partner > Network > Customer).
|
|
83
|
+
*
|
|
84
|
+
* When a mention is inserted, the `onMentionInserted` callback fires,
|
|
85
|
+
* allowing the app to trigger notifications via ws-back-wakastart.
|
|
86
|
+
*
|
|
87
|
+
* The mention element renders as an inline pill with the user's
|
|
88
|
+
* avatar and name, styled with design system tokens.
|
|
89
|
+
*
|
|
90
|
+
* Useful for:
|
|
91
|
+
* - Spec review comments with @author mentions
|
|
92
|
+
* - Task assignment in WakaStart projects
|
|
93
|
+
* - Chat/collaboration features
|
|
94
|
+
* - Audit notes with @reviewer references
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```tsx
|
|
98
|
+
* <WakaMentionEditor
|
|
99
|
+
* value={content}
|
|
100
|
+
* onChange={setContent}
|
|
101
|
+
* onSearch={async (q) => {
|
|
102
|
+
* const users = await usersApi.search(q);
|
|
103
|
+
* return users.map(u => ({ id: u.wid, name: u.fullName, email: u.email }));
|
|
104
|
+
* }}
|
|
105
|
+
* onMentionInserted={(m) => {
|
|
106
|
+
* notificationsApi.send(m.user.id, "You were mentioned in a document");
|
|
107
|
+
* }}
|
|
108
|
+
* />
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export declare const WakaMentionEditor: React.ForwardRefExoticComponent<WakaMentionEditorProps & React.RefAttributes<HTMLDivElement>>;
|
|
112
|
+
/**
|
|
113
|
+
* Standalone mention suggestion list component.
|
|
114
|
+
* Can be used outside of WakaMentionEditor for custom integrations.
|
|
115
|
+
*/
|
|
116
|
+
export declare function MentionSuggestions({ suggestions, searching, className, onSelect, }: {
|
|
117
|
+
suggestions: MentionableUser[];
|
|
118
|
+
searching?: boolean;
|
|
119
|
+
className?: string;
|
|
120
|
+
onSelect?: (user: MentionableUser) => void;
|
|
121
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
122
|
+
export declare namespace MentionSuggestions {
|
|
123
|
+
var displayName: string;
|
|
124
|
+
}
|
|
125
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
/** A single slash command entry */
|
|
3
|
+
export interface SlashCommand {
|
|
4
|
+
/** Unique key used for filtering */
|
|
5
|
+
key: string;
|
|
6
|
+
/** Display label */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Optional description shown below the label */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Lucide icon component */
|
|
11
|
+
icon: LucideIcon;
|
|
12
|
+
/** Group name (commands are visually grouped) */
|
|
13
|
+
group: string;
|
|
14
|
+
/** Search keywords for filtering */
|
|
15
|
+
keywords?: string[];
|
|
16
|
+
/**
|
|
17
|
+
* Action to execute when the command is selected.
|
|
18
|
+
* Receives the Plate editor instance.
|
|
19
|
+
*/
|
|
20
|
+
action: (editor: any) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface WakaSlashMenuProps {
|
|
23
|
+
/** Commands to display in the menu */
|
|
24
|
+
commands?: SlashCommand[];
|
|
25
|
+
/** CSS class for the menu container */
|
|
26
|
+
className?: string;
|
|
27
|
+
/** Callback when a command is selected. Receives the command key. */
|
|
28
|
+
onSelect?: (key: string) => void;
|
|
29
|
+
}
|
|
30
|
+
/** Default slash commands for WakaStart editors */
|
|
31
|
+
export declare const DEFAULT_SLASH_COMMANDS: SlashCommand[];
|
|
32
|
+
/**
|
|
33
|
+
* WakaSlashMenu -- Configurable slash command palette.
|
|
34
|
+
*
|
|
35
|
+
* This component is designed to be used **inside** a Plate editor context
|
|
36
|
+
* as the combobox renderer for the `@platejs/combobox` SlashPlugin,
|
|
37
|
+
* or standalone as a command registry.
|
|
38
|
+
*
|
|
39
|
+
* When used standalone, provide `onSelect` to receive the selected command key.
|
|
40
|
+
* The consuming app is responsible for connecting it to the editor.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <WakaSlashMenu
|
|
45
|
+
* commands={[...DEFAULT_SLASH_COMMANDS, myCustomCommand]}
|
|
46
|
+
* onSelect={(key) => console.log("Selected:", key)}
|
|
47
|
+
* />
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function WakaSlashMenu({ commands, className, onSelect, }: WakaSlashMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare namespace WakaSlashMenu {
|
|
52
|
+
var displayName: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Creates slash command plugin configuration for Plate.
|
|
56
|
+
* Call this function and spread the result into your plugins array.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* import { createSlashCommandPlugins } from "@wakastellar/ui/editor"
|
|
61
|
+
*
|
|
62
|
+
* const editor = usePlateEditor({
|
|
63
|
+
* plugins: [
|
|
64
|
+
* ...otherPlugins,
|
|
65
|
+
* ...await createSlashCommandPlugins(),
|
|
66
|
+
* ],
|
|
67
|
+
* })
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare function createSlashCommandPlugins(commands?: SlashCommand[]): Promise<any[]>;
|