@baishuyun/ui-mobile 0.8.0 → 0.9.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/AMap/{AMap-BwIa29WQ.js → AMap-B1GiEoPE.js} +2 -2
- package/dist/AMap/index.js +4 -4
- package/dist/ActionSheet/{ActionSheet-8cPpwho3.js → ActionSheet-DVck9uyS.js} +3 -3
- package/dist/ActionSheet/index.js +6 -6
- package/dist/Calendar/{Calendar-B9IuDHRd.js → Calendar-B1TwDL1q.js} +2 -2
- package/dist/Calendar/index.js +4 -4
- package/dist/ConfigProvider/{ConfigProvider-CCXPxdJt.js → ConfigProvider-xyGx046s.js} +114 -2
- package/dist/ConfigProvider/index.js +4 -4
- package/dist/ConfigProvider/{useLocale-D12uIZ9q.js → useLocale-Bf81I-9U.js} +56 -0
- package/dist/Editor/Editor-DUsPQevQ.js +2051 -0
- package/dist/Editor/index.js +8 -0
- package/dist/Gantt/{Gantt-fRNTYViS.js → Gantt-CbHw9RMw.js} +3 -3
- package/dist/Gantt/index.js +8 -8
- package/dist/Icon/{Icon-OUPXAIEn.js → Icon-D3xi1oyo.js} +1 -1
- package/dist/Icon/index.js +2 -2
- package/dist/Overlay/index.js +2 -2
- package/dist/Popup/{Popup-C1uwPnxj.js → Popup-BIIDAUmB.js} +2 -2
- package/dist/Popup/index.js +4 -4
- package/dist/components/Editor/Editor.d.ts +6 -0
- package/dist/components/Editor/EditorCore.d.ts +3 -0
- package/dist/components/Editor/EditorHtml.d.ts +3 -0
- package/dist/components/Editor/Thinking.d.ts +22 -0
- package/dist/components/Editor/constants.d.ts +57 -0
- package/dist/components/Editor/index.d.ts +3 -0
- package/dist/components/Editor/interface.d.ts +59 -0
- package/dist/components/Editor/nodes/ExtendedTextNode.d.ts +9 -0
- package/dist/components/Editor/nodes/ImageNode.d.ts +48 -0
- package/dist/components/Editor/plugins/HeadingPlugin.d.ts +2 -0
- package/dist/components/Editor/plugins/LinkColorPlugin.d.ts +2 -0
- package/dist/components/Editor/plugins/PasteStripImagePlugin.d.ts +2 -0
- package/dist/components/Editor/sheets.d.ts +43 -0
- package/dist/components/Editor/toolbar/Toolbar.d.ts +10 -0
- package/dist/components/Editor/toolbar/ToolbarColorGlyph.d.ts +8 -0
- package/dist/components/Editor/toolbar/useTextFormats.d.ts +16 -0
- package/dist/components/Editor/utils/applyAiPolish.d.ts +5 -0
- package/dist/components/Editor/utils/fillRootFromHtml.d.ts +2 -0
- package/dist/components/Editor/utils/isAcceptedImageType.d.ts +5 -0
- package/dist/components/Editor/utils/isEmptyEditorHtml.d.ts +1 -0
- package/dist/components/Editor/utils/readEditorAiSnapshot.d.ts +8 -0
- package/dist/components/Editor/utils/sanitizeEditorHtml.d.ts +1 -0
- package/dist/components/Editor/utils/stripInlineStyleProperty.d.ts +1 -0
- package/dist/components/Editor/utils/toPortableEditorHtml.d.ts +1 -0
- package/dist/components/Editor/utils/unwrapTypesetFence.d.ts +6 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.js +13 -12
- package/dist/locale/lang/en-US.json.d.ts +56 -0
- package/dist/locale/lang/zh-CN.json.d.ts +56 -0
- package/dist/locale/lang/zh-TW.json.d.ts +56 -0
- package/dist/style.css +1 -1
- package/dist/vendors/{version-DdP63VFD.js → version-CslTV1sb.js} +1 -1
- package/dist/vite-env.d.ts +5 -0
- package/package.json +12 -3
- /package/dist/Calendar/{cssVars-E8Cq0tta.js → cssVars-DNOooryc.js} +0 -0
- /package/dist/Overlay/{Overlay-YzAfhILA.js → Overlay-CqQWOqO4.js} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "../vendors/version-CslTV1sb.js";
|
|
2
|
+
import "../Popup/Popup-BIIDAUmB.js";
|
|
3
|
+
import "../ActionSheet/ActionSheet-DVck9uyS.js";
|
|
4
|
+
import "../Icon/Icon-D3xi1oyo.js";
|
|
5
|
+
import { n as e, t } from "./Editor-DUsPQevQ.js";
|
|
6
|
+
import "../Overlay/Overlay-CqQWOqO4.js";
|
|
7
|
+
import "../ConfigProvider/useLocale-Bf81I-9U.js";
|
|
8
|
+
export { e as EditorHtml, t as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "../ActionSheet/ActionSheet-
|
|
2
|
-
import { a as t, i as n, t as r } from "../ConfigProvider/useLocale-
|
|
3
|
-
import { i, t as a } from "../Calendar/cssVars-
|
|
1
|
+
import { t as e } from "../ActionSheet/ActionSheet-DVck9uyS.js";
|
|
2
|
+
import { a as t, i as n, t as r } from "../ConfigProvider/useLocale-Bf81I-9U.js";
|
|
3
|
+
import { i, t as a } from "../Calendar/cssVars-DNOooryc.js";
|
|
4
4
|
import { createContext as o, memo as s, useCallback as c, useContext as l, useEffect as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
5
5
|
import { createPortal as h } from "react-dom";
|
|
6
6
|
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
package/dist/Gantt/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../vendors/version-
|
|
2
|
-
import "../Popup/Popup-
|
|
3
|
-
import "../ActionSheet/ActionSheet-
|
|
4
|
-
import { n as e, t } from "./Gantt-
|
|
5
|
-
import "../Icon/Icon-
|
|
6
|
-
import "../Overlay/Overlay-
|
|
7
|
-
import "../ConfigProvider/useLocale-
|
|
8
|
-
import "../Calendar/cssVars-
|
|
1
|
+
import "../vendors/version-CslTV1sb.js";
|
|
2
|
+
import "../Popup/Popup-BIIDAUmB.js";
|
|
3
|
+
import "../ActionSheet/ActionSheet-DVck9uyS.js";
|
|
4
|
+
import { n as e, t } from "./Gantt-CbHw9RMw.js";
|
|
5
|
+
import "../Icon/Icon-D3xi1oyo.js";
|
|
6
|
+
import "../Overlay/Overlay-CqQWOqO4.js";
|
|
7
|
+
import "../ConfigProvider/useLocale-Bf81I-9U.js";
|
|
8
|
+
import "../Calendar/cssVars-DNOooryc.js";
|
|
9
9
|
export { e as ALL_ZOOM_LEVELS, t as default };
|
|
@@ -7,7 +7,7 @@ var t = { "bsy-icon": "_bsy-icon_gwzb9_1" }, n = /* @__PURE__ */ new Set();
|
|
|
7
7
|
if (!e || n.has(e) || (n.add(e), [...document.scripts].some((t) => t.getAttribute("src") === e))) return;
|
|
8
8
|
let t = document.createElement("script");
|
|
9
9
|
t.setAttribute("src", e), document.body.appendChild(t);
|
|
10
|
-
})("https://at.alicdn.com/t/c/
|
|
10
|
+
})("https://at.alicdn.com/t/c/font_4786625_bgf4g3m46wv.js");
|
|
11
11
|
var r = ({ name: n, size: r = 16, color: i, className: a }) => /* @__PURE__ */ e("svg", {
|
|
12
12
|
className: [t["bsy-icon"], a].filter(Boolean).join(" "),
|
|
13
13
|
style: {
|
package/dist/Icon/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../vendors/version-
|
|
2
|
-
import { t as e } from "./Icon-
|
|
1
|
+
import "../vendors/version-CslTV1sb.js";
|
|
2
|
+
import { t as e } from "./Icon-D3xi1oyo.js";
|
|
3
3
|
export { e as default };
|
package/dist/Overlay/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../vendors/version-
|
|
2
|
-
import { a as e, i as t, n, o as r, r as i, t as a } from "./Overlay-
|
|
1
|
+
import "../vendors/version-CslTV1sb.js";
|
|
2
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "./Overlay-CqQWOqO4.js";
|
|
3
3
|
export { a as OVERLAY_Z_BASE, n as OVERLAY_Z_STEP, i as OverlayProvider, t as getNextImperativeOverlayZIndex, e as imperativeOverlayStyle, r as useOverlayZIndex };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as e, r as t } from "../Overlay/Overlay-
|
|
2
|
-
import { t as n } from "../ConfigProvider/useLocale-
|
|
1
|
+
import { o as e, r as t } from "../Overlay/Overlay-CqQWOqO4.js";
|
|
2
|
+
import { t as n } from "../ConfigProvider/useLocale-Bf81I-9U.js";
|
|
3
3
|
import { useEffect as r, useLayoutEffect as i, useRef as a, useState as o } from "react";
|
|
4
4
|
import { createPortal as s } from "react-dom";
|
|
5
5
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
package/dist/Popup/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../vendors/version-
|
|
2
|
-
import { t as e } from "./Popup-
|
|
3
|
-
import "../Overlay/Overlay-
|
|
4
|
-
import "../ConfigProvider/useLocale-
|
|
1
|
+
import "../vendors/version-CslTV1sb.js";
|
|
2
|
+
import { t as e } from "./Popup-BIIDAUmB.js";
|
|
3
|
+
import "../Overlay/Overlay-CqQWOqO4.js";
|
|
4
|
+
import "../ConfigProvider/useLocale-Bf81I-9U.js";
|
|
5
5
|
export { e as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EditorAiStatus } from './interface';
|
|
2
|
+
type ThinkingModel = {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
thinking: boolean;
|
|
5
|
+
open: boolean;
|
|
6
|
+
label: string;
|
|
7
|
+
reasoning: string;
|
|
8
|
+
toggle: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const useThinking: (source: {
|
|
11
|
+
status: EditorAiStatus;
|
|
12
|
+
reasoning?: string;
|
|
13
|
+
}, hasAnswer: boolean, scrollViewportRef: {
|
|
14
|
+
readonly current: HTMLDivElement | null;
|
|
15
|
+
}) => ThinkingModel;
|
|
16
|
+
export declare const ThinkingHead: ({ model }: {
|
|
17
|
+
model: ThinkingModel;
|
|
18
|
+
}) => import("react").JSX.Element;
|
|
19
|
+
export declare const ThinkingBody: ({ model }: {
|
|
20
|
+
model: ThinkingModel;
|
|
21
|
+
}) => import("react").JSX.Element | null;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { EditorAiPreset, EditorToolbarGroup } from './interface';
|
|
2
|
+
export declare const FONT_SIZES: readonly [{
|
|
3
|
+
readonly label: "12";
|
|
4
|
+
readonly value: "12px";
|
|
5
|
+
}, {
|
|
6
|
+
readonly label: "14";
|
|
7
|
+
readonly value: "14px";
|
|
8
|
+
}, {
|
|
9
|
+
readonly label: "16";
|
|
10
|
+
readonly value: "16px";
|
|
11
|
+
}, {
|
|
12
|
+
readonly label: "18";
|
|
13
|
+
readonly value: "18px";
|
|
14
|
+
}, {
|
|
15
|
+
readonly label: "20";
|
|
16
|
+
readonly value: "20px";
|
|
17
|
+
}, {
|
|
18
|
+
readonly label: "22";
|
|
19
|
+
readonly value: "22px";
|
|
20
|
+
}, {
|
|
21
|
+
readonly label: "24";
|
|
22
|
+
readonly value: "24px";
|
|
23
|
+
}, {
|
|
24
|
+
readonly label: "28";
|
|
25
|
+
readonly value: "28px";
|
|
26
|
+
}, {
|
|
27
|
+
readonly label: "32";
|
|
28
|
+
readonly value: "32px";
|
|
29
|
+
}, {
|
|
30
|
+
readonly label: "36";
|
|
31
|
+
readonly value: "36px";
|
|
32
|
+
}, {
|
|
33
|
+
readonly label: "64";
|
|
34
|
+
readonly value: "64px";
|
|
35
|
+
}, {
|
|
36
|
+
readonly label: "128";
|
|
37
|
+
readonly value: "128px";
|
|
38
|
+
}];
|
|
39
|
+
export declare const DEFAULT_FONT_COLOR = "#000";
|
|
40
|
+
export declare const DEFAULT_BACKGROUND_COLOR = "transparent";
|
|
41
|
+
export declare const EDITOR_COLOR_PRESETS: readonly ["#005eef", "#3642e9", "#7f43c8", "#114bb8", "#1379d9", "#10a9c4", "#119d85", "#ffc502", "#ff9921", "#f06648", "#f168b6", "#d9e8ff", "#dee0ff", "#efe2ff", "#d5e4ff", "#daedff", "#ddfaff", "#d7fff8", "#fff4d0", "#ffecd7", "#ffe3dd", "#ffdef1", "#262626", "#3c3c3d", "#454545", "#515152", "#5d5c5e", "#6c6c6e", "#878789", "#b0afb1", "#d0d0d1", "#e6e6e7", "#f5f5f6"];
|
|
42
|
+
export declare const EDITOR_AI_PRESETS: EditorAiPreset[];
|
|
43
|
+
export declare const EDITOR_AI_PRESET_I18N: {
|
|
44
|
+
readonly quick: "editor.aiPresetQuick";
|
|
45
|
+
readonly formal: "editor.aiPresetFormal";
|
|
46
|
+
readonly colloquial: "editor.aiPresetColloquial";
|
|
47
|
+
readonly lively: "editor.aiPresetLively";
|
|
48
|
+
readonly literary: "editor.aiPresetLiterary";
|
|
49
|
+
readonly retro: "editor.aiPresetRetro";
|
|
50
|
+
};
|
|
51
|
+
export declare const DEFAULT_TOOLBAR_CONFIG: EditorToolbarGroup[];
|
|
52
|
+
export declare const IMAGE_MAX_BYTES: number;
|
|
53
|
+
export declare const EDITOR_IMAGE_FILE_TYPES: readonly ["jpg", "jpeg", "png", "gif", "bmp", "tif"];
|
|
54
|
+
export declare const EDITOR_IMAGE_ACCEPT: string;
|
|
55
|
+
export declare const EDITOR_SHEET_HEIGHT = 300;
|
|
56
|
+
export declare const EDITOR_CONTENT_HEIGHT = 200;
|
|
57
|
+
export declare const EDITOR_AI_SHEET_HEIGHT = "calc(100dvh - 104px)";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { default } from './Editor';
|
|
2
|
+
export { EditorHtml } from './EditorHtml';
|
|
3
|
+
export type { EditorAi, EditorAiMode, EditorAiPreset, EditorAiStatus, EditorProps, EditorToolbarConfigButton, EditorToolbarGroup, EditorToolbarProps, EditorUpload, EditorUploadContext, EditorUploadResult, } from './interface';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { EditorState } from 'lexical';
|
|
2
|
+
export type EditorAiPreset = 'quick' | 'formal' | 'colloquial' | 'lively' | 'literary' | 'retro';
|
|
3
|
+
export type EditorAiMode = 'typeset' | 'polish';
|
|
4
|
+
export type EditorAiStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
5
|
+
export type EditorAi = {
|
|
6
|
+
typeset?: (input: {
|
|
7
|
+
text: string;
|
|
8
|
+
html: string;
|
|
9
|
+
}) => void;
|
|
10
|
+
polish?: (input: {
|
|
11
|
+
text: string;
|
|
12
|
+
preset: EditorAiPreset;
|
|
13
|
+
}) => void;
|
|
14
|
+
stop?: () => void;
|
|
15
|
+
text?: string;
|
|
16
|
+
reasoning?: string;
|
|
17
|
+
status?: EditorAiStatus;
|
|
18
|
+
errorMessage?: string;
|
|
19
|
+
};
|
|
20
|
+
export type EditorUploadContext = {
|
|
21
|
+
onProgress?: (percent: number) => void;
|
|
22
|
+
signal?: AbortSignal;
|
|
23
|
+
};
|
|
24
|
+
export type EditorUploadResult = {
|
|
25
|
+
url: string;
|
|
26
|
+
attachment?: {
|
|
27
|
+
_id: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type EditorUpload = {
|
|
31
|
+
customRequest?: (file: File, ctx: EditorUploadContext) => Promise<string | EditorUploadResult>;
|
|
32
|
+
};
|
|
33
|
+
export type EditorToolbarButtonName = 'ai' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'align' | 'heading' | 'fontSize' | 'fontColor' | 'fill' | 'outdent' | 'indent' | 'number' | 'bullet' | 'picture' | 'link';
|
|
34
|
+
export type EditorToolbarConfigButton = EditorToolbarButtonName | {
|
|
35
|
+
name: EditorToolbarButtonName;
|
|
36
|
+
props?: {
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export type EditorToolbarGroup = {
|
|
41
|
+
key: string;
|
|
42
|
+
buttons: EditorToolbarConfigButton[];
|
|
43
|
+
};
|
|
44
|
+
export type EditorToolbarProps = {
|
|
45
|
+
config?: EditorToolbarGroup[];
|
|
46
|
+
};
|
|
47
|
+
export type EditorProps = {
|
|
48
|
+
onChange: (payload: {
|
|
49
|
+
text: string;
|
|
50
|
+
html: string | null;
|
|
51
|
+
attachments: unknown[];
|
|
52
|
+
}, editorState: EditorState) => void;
|
|
53
|
+
value?: string | null;
|
|
54
|
+
open?: boolean;
|
|
55
|
+
onOpenChange?: (open: boolean) => void;
|
|
56
|
+
toolbar?: EditorToolbarProps;
|
|
57
|
+
upload?: EditorUpload;
|
|
58
|
+
ai?: EditorAi;
|
|
59
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DOMConversionMap, TextNode, SerializedTextNode } from 'lexical';
|
|
2
|
+
export declare class ExtendedTextNode extends TextNode {
|
|
3
|
+
static getType(): string;
|
|
4
|
+
static clone(node: ExtendedTextNode): ExtendedTextNode;
|
|
5
|
+
static importDOM(): DOMConversionMap | null;
|
|
6
|
+
static importJSON(serializedNode: SerializedTextNode): TextNode;
|
|
7
|
+
isSimpleText(): boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const $createExtendedTextNode: (text?: string) => ExtendedTextNode;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DecoratorNode, DOMConversionOutput, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export declare const ImageUploadProgressContext: import('react').Context<Record<string, number | undefined>>;
|
|
4
|
+
export interface ImagePayload {
|
|
5
|
+
src: string;
|
|
6
|
+
altText?: string;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
dataId?: string;
|
|
10
|
+
key?: NodeKey;
|
|
11
|
+
}
|
|
12
|
+
export type SerializedImageNode = Spread<{
|
|
13
|
+
src: string;
|
|
14
|
+
altText?: string;
|
|
15
|
+
width?: number;
|
|
16
|
+
height?: number;
|
|
17
|
+
dataId?: string;
|
|
18
|
+
}, SerializedLexicalNode>;
|
|
19
|
+
export declare class ImageNode extends DecoratorNode<ReactNode> {
|
|
20
|
+
__src: string;
|
|
21
|
+
__altText: string;
|
|
22
|
+
__width?: number;
|
|
23
|
+
__height?: number;
|
|
24
|
+
__dataId?: string;
|
|
25
|
+
static getType(): string;
|
|
26
|
+
static clone(node: ImageNode): ImageNode;
|
|
27
|
+
constructor(src: string, altText?: string, width?: number, height?: number, key?: NodeKey, dataId?: string);
|
|
28
|
+
createDOM(): HTMLElement;
|
|
29
|
+
updateDOM(): false;
|
|
30
|
+
exportDOM(): {
|
|
31
|
+
element: HTMLImageElement;
|
|
32
|
+
};
|
|
33
|
+
getSrc(): string;
|
|
34
|
+
setSrc(src: string): void;
|
|
35
|
+
setDataId(dataId: string): void;
|
|
36
|
+
static importDOM(): {
|
|
37
|
+
img: () => {
|
|
38
|
+
conversion: (domNode: Node) => null | DOMConversionOutput;
|
|
39
|
+
priority: 0;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
static importJSON(serializedNode: SerializedImageNode): ImageNode;
|
|
43
|
+
exportJSON(): SerializedImageNode;
|
|
44
|
+
isInline(): boolean;
|
|
45
|
+
decorate(): ReactNode;
|
|
46
|
+
}
|
|
47
|
+
export declare const $isImageNode: (node: LexicalNode | null | undefined) => node is ImageNode;
|
|
48
|
+
export declare const $createImageNode: ({ src, altText, width, height, dataId, key, }: ImagePayload) => ImageNode;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { EditorAi, EditorAiMode, EditorAiPreset } from './interface';
|
|
2
|
+
import { EditorSheetKind } from './toolbar/Toolbar';
|
|
3
|
+
type OptionSheetsProps = {
|
|
4
|
+
sheet: EditorSheetKind | 'aiPreset' | null;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onTypeset: () => void;
|
|
7
|
+
onPolishMenu: () => void;
|
|
8
|
+
onPickPreset: (preset: EditorAiPreset) => void;
|
|
9
|
+
onPicture: (key: 'upload' | 'url') => void;
|
|
10
|
+
canTypeset: boolean;
|
|
11
|
+
canPolish: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const OptionSheets: ({ sheet, onClose, onTypeset, onPolishMenu, onPickPreset, onPicture, canTypeset, canPolish, }: OptionSheetsProps) => import("react").JSX.Element;
|
|
14
|
+
export type LinkDraft = {
|
|
15
|
+
url: string;
|
|
16
|
+
text: string;
|
|
17
|
+
newBlank: boolean;
|
|
18
|
+
};
|
|
19
|
+
type LinkPopupProps = {
|
|
20
|
+
open: boolean;
|
|
21
|
+
seed: LinkDraft | null;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
onConfirm: (draft: LinkDraft) => void;
|
|
24
|
+
};
|
|
25
|
+
export declare const LinkPopup: ({ open, seed, onClose, onConfirm }: LinkPopupProps) => import("react").JSX.Element;
|
|
26
|
+
type ImageUrlPopupProps = {
|
|
27
|
+
open: boolean;
|
|
28
|
+
onClose: () => void;
|
|
29
|
+
onConfirm: (src: string) => void;
|
|
30
|
+
};
|
|
31
|
+
export declare const ImageUrlPopup: ({ open, onClose, onConfirm }: ImageUrlPopupProps) => import("react").JSX.Element;
|
|
32
|
+
type AiResultPopupProps = {
|
|
33
|
+
open: boolean;
|
|
34
|
+
mode: EditorAiMode | null;
|
|
35
|
+
originalHtml: string;
|
|
36
|
+
ai: EditorAi | undefined;
|
|
37
|
+
polishPreset: EditorAiPreset;
|
|
38
|
+
onClose: () => void;
|
|
39
|
+
onApply: () => void;
|
|
40
|
+
onPickPreset: (preset: EditorAiPreset) => void;
|
|
41
|
+
};
|
|
42
|
+
export declare const AiResultPopup: ({ open, mode, originalHtml, ai, polishPreset, onClose, onApply, onPickPreset, }: AiResultPopupProps) => import("react").JSX.Element;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EditorToolbarGroup } from '../interface';
|
|
2
|
+
export type EditorSheetKind = 'align' | 'heading' | 'fontSize' | 'fontColor' | 'fill' | 'ai' | 'picture';
|
|
3
|
+
type ToolbarProps = {
|
|
4
|
+
config: EditorToolbarGroup[];
|
|
5
|
+
openSheet: EditorSheetKind | 'aiPreset' | null;
|
|
6
|
+
onOpenSheet: (kind: EditorSheetKind) => void;
|
|
7
|
+
onOpenLink: () => void;
|
|
8
|
+
};
|
|
9
|
+
declare const Toolbar: ({ config, openSheet, onOpenSheet, onOpenLink }: ToolbarProps) => import("react").JSX.Element;
|
|
10
|
+
export default Toolbar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type ToolbarColorGlyphVariant = 'fontColor' | 'fill';
|
|
2
|
+
type ToolbarColorGlyphProps = {
|
|
3
|
+
variant: ToolbarColorGlyphVariant;
|
|
4
|
+
barColor: string;
|
|
5
|
+
size: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const ToolbarColorGlyph: ({ variant, barColor, size }: ToolbarColorGlyphProps) => import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type EditorAlign = 'left' | 'center' | 'right';
|
|
2
|
+
type TextFormatsState = {
|
|
3
|
+
bold: boolean;
|
|
4
|
+
italic: boolean;
|
|
5
|
+
underline: boolean;
|
|
6
|
+
strikethrough: boolean;
|
|
7
|
+
fontColor: string;
|
|
8
|
+
backgroundColor: string;
|
|
9
|
+
align: EditorAlign;
|
|
10
|
+
listType: 'bullet' | 'number' | false;
|
|
11
|
+
canOutdent: boolean;
|
|
12
|
+
headingTag: 'h1' | 'h2' | 'h3' | false;
|
|
13
|
+
hasEditorText: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare const useTextFormatsState: () => TextFormatsState;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LexicalEditor } from 'lexical';
|
|
2
|
+
export declare const POLISH_BLOCK_MARKER = "<!--bsy-block-->";
|
|
3
|
+
export declare const collectPolishHtmlBlocks: (html: string) => string[];
|
|
4
|
+
export declare const applyAiPolishToHtml: (html: string, proposed: string) => string;
|
|
5
|
+
export declare const applyAiPolish: (editor: LexicalEditor, proposed: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isEmptyEditorHtml: (html: string, text: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sanitizeEditorHtml: (html: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const stripInlineStyleProperty: (style: string, property: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const toPortableEditorHtml: (html: string) => string;
|
|
@@ -15,3 +15,5 @@ export { OverlayProvider, useOverlayZIndex, OVERLAY_Z_BASE, OVERLAY_Z_STEP, getN
|
|
|
15
15
|
export type { OverlayProviderProps } from './Overlay';
|
|
16
16
|
export { default as Icon } from './Icon';
|
|
17
17
|
export type { IconProps } from './Icon';
|
|
18
|
+
export { default as Editor, EditorHtml } from './Editor';
|
|
19
|
+
export type { EditorAi, EditorAiMode, EditorAiPreset, EditorAiStatus, EditorProps, EditorToolbarConfigButton, EditorToolbarGroup, EditorToolbarProps, EditorUpload, EditorUploadContext, EditorUploadResult, } from './Editor';
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import "./vendors/version-
|
|
2
|
-
import { t as e } from "./Popup/Popup-
|
|
3
|
-
import { t } from "./ActionSheet/ActionSheet-
|
|
4
|
-
import { n, t as r } from "./Gantt/Gantt-
|
|
5
|
-
import { t as i } from "./Calendar/Calendar-
|
|
6
|
-
import { t as a } from "./Icon/Icon-
|
|
7
|
-
import { n as o, t as s } from "./AMap/AMap-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import "./
|
|
11
|
-
import
|
|
12
|
-
|
|
1
|
+
import "./vendors/version-CslTV1sb.js";
|
|
2
|
+
import { t as e } from "./Popup/Popup-BIIDAUmB.js";
|
|
3
|
+
import { t } from "./ActionSheet/ActionSheet-DVck9uyS.js";
|
|
4
|
+
import { n, t as r } from "./Gantt/Gantt-CbHw9RMw.js";
|
|
5
|
+
import { t as i } from "./Calendar/Calendar-B1TwDL1q.js";
|
|
6
|
+
import { t as a } from "./Icon/Icon-D3xi1oyo.js";
|
|
7
|
+
import { n as o, t as s } from "./AMap/AMap-B1GiEoPE.js";
|
|
8
|
+
import { n as c, t as l } from "./Editor/Editor-DUsPQevQ.js";
|
|
9
|
+
import { a as u, i as d, n as f, o as p, r as m, t as h } from "./Overlay/Overlay-CqQWOqO4.js";
|
|
10
|
+
import { t as g } from "./ConfigProvider/useLocale-Bf81I-9U.js";
|
|
11
|
+
import "./Calendar/cssVars-DNOooryc.js";
|
|
12
|
+
import { t as _ } from "./ConfigProvider/ConfigProvider-xyGx046s.js";
|
|
13
|
+
export { n as ALL_ZOOM_LEVELS, s as AMap, t as ActionSheet, i as Calendar, _ as ConfigProvider, l as Editor, c as EditorHtml, r as Gantt, a as Icon, h as OVERLAY_Z_BASE, f as OVERLAY_Z_STEP, m as OverlayProvider, e as Popup, d as getNextImperativeOverlayZIndex, u as imperativeOverlayStyle, o as useAMap, g as useLocale, p as useOverlayZIndex };
|
|
@@ -94,6 +94,62 @@ declare const _default: {
|
|
|
94
94
|
"ariaLabel": "Locate",
|
|
95
95
|
"failed": "Location failed. Check that location access is enabled"
|
|
96
96
|
}
|
|
97
|
+
},
|
|
98
|
+
"editor": {
|
|
99
|
+
"title": "Rich text",
|
|
100
|
+
"bold": "Bold",
|
|
101
|
+
"italic": "Italic",
|
|
102
|
+
"underline": "Underline",
|
|
103
|
+
"strikethrough": "Strikethrough",
|
|
104
|
+
"outdent": "Decrease indent",
|
|
105
|
+
"indent": "Increase indent",
|
|
106
|
+
"bulletList": "Bulleted list",
|
|
107
|
+
"numberList": "Numbered list",
|
|
108
|
+
"alignment": "Alignment",
|
|
109
|
+
"leftAlign": "Left align",
|
|
110
|
+
"centerAlign": "Center align",
|
|
111
|
+
"rightAlign": "Right align",
|
|
112
|
+
"heading": "Heading",
|
|
113
|
+
"paragraph": "Paragraph",
|
|
114
|
+
"heading1": "H1",
|
|
115
|
+
"heading2": "H2",
|
|
116
|
+
"heading3": "H3",
|
|
117
|
+
"fontSize": "Font size",
|
|
118
|
+
"fontColor": "Font color",
|
|
119
|
+
"fill": "Fill",
|
|
120
|
+
"fillNone": "No fill",
|
|
121
|
+
"picture": "Image",
|
|
122
|
+
"uploadImage": "Upload image",
|
|
123
|
+
"imageUrl": "Image URL",
|
|
124
|
+
"enterImageUrl": "Enter image URL",
|
|
125
|
+
"imageUrlNote": "Note: Enter an image URL to insert the image",
|
|
126
|
+
"imageUrlPlaceholder": "Please enter image URL",
|
|
127
|
+
"imageUrlRequired": "Please enter image URL",
|
|
128
|
+
"imageUrlInvalid": "Please enter a valid image URL",
|
|
129
|
+
"link": "Link",
|
|
130
|
+
"linkUrl": "URL",
|
|
131
|
+
"linkText": "Display text",
|
|
132
|
+
"linkAliasTip": "Links can use @form alias for in-app form navigation",
|
|
133
|
+
"linkTip": "http:// links or @form alias",
|
|
134
|
+
"linkNewBlank": "Open in new page",
|
|
135
|
+
"cancel": "Cancel",
|
|
136
|
+
"ok": "OK",
|
|
137
|
+
"ai": "AI",
|
|
138
|
+
"aiTypeset": "Smart typeset",
|
|
139
|
+
"aiPolish": "Smart polish",
|
|
140
|
+
"aiOriginal": "Before",
|
|
141
|
+
"aiOptimized": "Optimized",
|
|
142
|
+
"aiAbandon": "Discard",
|
|
143
|
+
"aiApply": "Apply",
|
|
144
|
+
"aiError": "Generation failed",
|
|
145
|
+
"aiThinking": "Thinking",
|
|
146
|
+
"aiThoughtSeconds": "Thought ({{seconds}}s)",
|
|
147
|
+
"aiPresetQuick": "Quick polish",
|
|
148
|
+
"aiPresetFormal": "More formal",
|
|
149
|
+
"aiPresetColloquial": "More colloquial",
|
|
150
|
+
"aiPresetLively": "More lively",
|
|
151
|
+
"aiPresetLiterary": "More literary",
|
|
152
|
+
"aiPresetRetro": "More retro"
|
|
97
153
|
}
|
|
98
154
|
}
|
|
99
155
|
;
|
|
@@ -94,6 +94,62 @@ declare const _default: {
|
|
|
94
94
|
"ariaLabel": "定位",
|
|
95
95
|
"failed": "定位失败,请检查是否开启定位权限"
|
|
96
96
|
}
|
|
97
|
+
},
|
|
98
|
+
"editor": {
|
|
99
|
+
"title": "富文本",
|
|
100
|
+
"bold": "加粗",
|
|
101
|
+
"italic": "倾斜",
|
|
102
|
+
"underline": "下划线",
|
|
103
|
+
"strikethrough": "删除线",
|
|
104
|
+
"outdent": "减少缩进",
|
|
105
|
+
"indent": "增加缩进",
|
|
106
|
+
"bulletList": "无序列表",
|
|
107
|
+
"numberList": "有序列表",
|
|
108
|
+
"alignment": "对齐方式",
|
|
109
|
+
"leftAlign": "左对齐",
|
|
110
|
+
"centerAlign": "居中对齐",
|
|
111
|
+
"rightAlign": "右对齐",
|
|
112
|
+
"heading": "标题",
|
|
113
|
+
"paragraph": "正文",
|
|
114
|
+
"heading1": "H1",
|
|
115
|
+
"heading2": "H2",
|
|
116
|
+
"heading3": "H3",
|
|
117
|
+
"fontSize": "字号",
|
|
118
|
+
"fontColor": "颜色",
|
|
119
|
+
"fill": "填充",
|
|
120
|
+
"fillNone": "无填充",
|
|
121
|
+
"picture": "图片",
|
|
122
|
+
"uploadImage": "上传图片",
|
|
123
|
+
"imageUrl": "图片URL",
|
|
124
|
+
"enterImageUrl": "输入图片URL",
|
|
125
|
+
"imageUrlNote": "注:输入图片URL即可插入图片",
|
|
126
|
+
"imageUrlPlaceholder": "请输入图片URL",
|
|
127
|
+
"imageUrlRequired": "请输入图片URL",
|
|
128
|
+
"imageUrlInvalid": "请输入有效的图片URL",
|
|
129
|
+
"link": "链接",
|
|
130
|
+
"linkUrl": "链接地址",
|
|
131
|
+
"linkText": "显示文本",
|
|
132
|
+
"linkAliasTip": "链接可用@表单别名,用于应用内表单跳转",
|
|
133
|
+
"linkTip": "支持http://链接或者@表单别名",
|
|
134
|
+
"linkNewBlank": "在新页面打开",
|
|
135
|
+
"cancel": "取消",
|
|
136
|
+
"ok": "确定",
|
|
137
|
+
"ai": "AI",
|
|
138
|
+
"aiTypeset": "智能排版",
|
|
139
|
+
"aiPolish": "智能润色",
|
|
140
|
+
"aiOriginal": "优化前",
|
|
141
|
+
"aiOptimized": "优化后",
|
|
142
|
+
"aiAbandon": "放弃",
|
|
143
|
+
"aiApply": "应用",
|
|
144
|
+
"aiError": "生成失败",
|
|
145
|
+
"aiThinking": "正在思考",
|
|
146
|
+
"aiThoughtSeconds": "已思考(用时 {{seconds}} 秒)",
|
|
147
|
+
"aiPresetQuick": "快速润色",
|
|
148
|
+
"aiPresetFormal": "更正式",
|
|
149
|
+
"aiPresetColloquial": "更口语",
|
|
150
|
+
"aiPresetLively": "更生动",
|
|
151
|
+
"aiPresetLiterary": "更书面",
|
|
152
|
+
"aiPresetRetro": "更复古"
|
|
97
153
|
}
|
|
98
154
|
}
|
|
99
155
|
;
|