@baishuyun/ui-base 6.17.0 → 6.19.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.
Files changed (47) hide show
  1. package/dist/Amap/index.js +1 -1
  2. package/dist/Calendar/{Calendar-BlsUX2vX.js → Calendar-DEr4d6DN.js} +2 -2
  3. package/dist/Calendar/index.js +4 -4
  4. package/dist/Card/index.js +1 -1
  5. package/dist/CheckBox/index.js +1 -1
  6. package/dist/ColorPicker/index.js +1 -1
  7. package/dist/ConfigProvider/index.js +1 -1
  8. package/dist/DatePicker/{DatePicker-BRwPZeui.js → DatePicker-Bzvz3bI6.js} +1 -1
  9. package/dist/DatePicker/{DatePickerPanel-UwjSXS-U.js → DatePickerPanel-CaAOuWM_.js} +1 -1
  10. package/dist/DatePicker/index.js +2 -2
  11. package/dist/DropDown/index.js +1 -1
  12. package/dist/Editor/index.js +1217 -1121
  13. package/dist/Gantt/index.js +1 -1
  14. package/dist/Icon/index.js +1 -1
  15. package/dist/InputTag/index.js +1 -1
  16. package/dist/Loading/index.js +1 -1
  17. package/dist/Modal/index.js +1 -1
  18. package/dist/NotFoundContent/index.js +1 -1
  19. package/dist/Overlay/index.js +1 -1
  20. package/dist/Radio/index.js +1 -1
  21. package/dist/ScrollBar/index.js +1 -1
  22. package/dist/Segmented/{Segmented-DpmwFerw.js → Segmented-BkTy5v9V.js} +7 -3
  23. package/dist/Segmented/index.js +2 -2
  24. package/dist/Select/index.js +1 -1
  25. package/dist/Table/index.js +1 -1
  26. package/dist/Tabs/index.js +1 -1
  27. package/dist/Tooltip/index.js +1 -1
  28. package/dist/Tree/index.js +1 -1
  29. package/dist/components/Editor/Preview/EditorPreview.d.ts +0 -3
  30. package/dist/components/Editor/Preview/PolishModal.d.ts +0 -1
  31. package/dist/components/Editor/Preview/Thinking.d.ts +2 -5
  32. package/dist/components/Editor/Preview/TypesetModal.d.ts +0 -1
  33. package/dist/components/Editor/Preview/useAiPreviewHtml.d.ts +8 -0
  34. package/dist/components/Editor/Preview/useAutoScroll.d.ts +9 -0
  35. package/dist/components/Editor/commands/ImageCommands.d.ts +1 -0
  36. package/dist/components/Editor/constants/ai.d.ts +0 -2
  37. package/dist/components/Editor/context/EditorContainerContext.d.ts +3 -2
  38. package/dist/components/Editor/interface.d.ts +4 -4
  39. package/dist/components/Editor/nodes/ImageComponent.d.ts +1 -0
  40. package/dist/components/Editor/nodes/ImageNode.d.ts +5 -2
  41. package/dist/components/Editor/utils/applyAiPolish.d.ts +0 -1
  42. package/dist/components/Editor/utils/prepareTypesetProposed.d.ts +1 -2
  43. package/dist/index.js +4 -4
  44. package/dist/vendors/{version-CfjNx5v2.js → version-Dt7Pnhic.js} +1 -1
  45. package/package.json +3 -2
  46. package/dist/components/Editor/utils/extractCodePlaceholders.d.ts +0 -6
  47. package/dist/components/Editor/utils/stitchCodePlaceholders.d.ts +0 -6
@@ -1,4 +1,4 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
3
  import { t as e } from "../Icon/Icon-DrdQOEJE.js";
4
4
  import "../vendors/LocaleContext-DXQoOKM2.js";
@@ -1,3 +1,3 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import { t as e } from "./Icon-DrdQOEJE.js";
3
3
  export { e as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
3
  import "../Icon/Icon-DrdQOEJE.js";
4
4
  import "../vendors/LocaleContext-DXQoOKM2.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import "../vendors/LocaleContext-DXQoOKM2.js";
3
3
  import "../vendors/useLocale-Be4e7Xfn.js";
4
4
  import { t as e } from "./Loading-Cherk9Ax.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import "../Icon/Icon-DrdQOEJE.js";
3
3
  import "../Overlay/OverlayContext-CVSFoyqN.js";
4
4
  import { t as e } from "./Modal-eZijJ7CB.js";
@@ -1,3 +1,3 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import { t as e } from "./NotFoundContent-DJUQ0_2D.js";
3
3
  export { e as NotFoundContent };
@@ -1,3 +1,3 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import { a as e, i as t, n, t as r } from "./OverlayContext-CVSFoyqN.js";
3
3
  export { r as OVERLAY_Z_BASE, n as OVERLAY_Z_STEP, t as OverlayProvider, e as useOverlayZIndex };
@@ -1,3 +1,3 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import { t as e } from "./Radio-D9jhW7K6.js";
3
3
  export { e as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import "./style-D26azwz6.js";
3
3
  import { t as e } from "./ScrollBar-IMTuAOF5.js";
4
4
  export { e as ScrollBar, e as default };
@@ -15,9 +15,13 @@ var d = {
15
15
  "bsy-segmented__item--inactive": "_bsy-segmented__item--inactive_1yc4d_48",
16
16
  "bsy-segmented__slider": "_bsy-segmented__slider_1yc4d_56"
17
17
  }, f = {
18
- type: "spring",
19
- stiffness: 350,
20
- damping: 35
18
+ duration: .32,
19
+ ease: [
20
+ .34,
21
+ 1.2,
22
+ .64,
23
+ 1
24
+ ]
21
25
  }, p = { duration: 0 }, m = "#fff", h = (h) => {
22
26
  let { options: g, block: _ = !1, disabled: v = !1, enableAnimation: y = !1, theme: b } = h, [x, S] = l(h), [C, w] = s({
23
27
  width: 0,
@@ -1,3 +1,3 @@
1
- import "../vendors/version-CfjNx5v2.js";
2
- import { t as e } from "./Segmented-DpmwFerw.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
+ import { t as e } from "./Segmented-BkTy5v9V.js";
3
3
  export { e as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
3
  import "../Icon/Icon-DrdQOEJE.js";
4
4
  import "../vendors/LocaleContext-DXQoOKM2.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
3
  import "../vendors/LocaleContext-DXQoOKM2.js";
4
4
  import "../vendors/useLocale-Be4e7Xfn.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import "../Icon/Icon-DrdQOEJE.js";
3
3
  import "../vendors/LocaleContext-DXQoOKM2.js";
4
4
  import "../Overlay/OverlayContext-CVSFoyqN.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import "../Overlay/OverlayContext-CVSFoyqN.js";
3
3
  import "../vendors/useLatchedPopupPortalRoot-CC6af8t-.js";
4
4
  import { n as e, t } from "./Tooltip-DBrt3t2r.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-CfjNx5v2.js";
1
+ import "../vendors/version-Dt7Pnhic.js";
2
2
  import "../Icon/Icon-DrdQOEJE.js";
3
3
  import { t as e } from "../vendors/Tree-D0Q1IZ2D.js";
4
4
  import "../CheckBox/CheckBox-CcHskTz_.js";
@@ -1,6 +1,3 @@
1
- import { EditorAiStatus } from '../interface';
2
- /** loading 时把 LCS 预览合到下一帧;ready/error 立刻算,避免应用按钮闪一下。 */
3
- export declare function usePolishProposedHtml(enabled: boolean, originalHtml: string, text: string, status: EditorAiStatus | undefined): string;
4
1
  type EditorPreviewProps = {
5
2
  maxLength?: number;
6
3
  onMaxLengthExceed?: () => void;
@@ -1,7 +1,6 @@
1
1
  import { EditorAiPreset, EditorAiStatus } from '../interface';
2
2
  type PolishModalProps = {
3
3
  status: EditorAiStatus;
4
- reasoning?: string;
5
4
  errorMessage?: string;
6
5
  originalHtml: string;
7
6
  proposedHtml: string;
@@ -6,14 +6,11 @@ type ThinkingModel = {
6
6
  label: string;
7
7
  reasoning: string;
8
8
  toggle: () => void;
9
- onViewportScroll: () => void;
10
9
  };
11
- export declare function useThinking(source: {
10
+ export declare const useThinking: (source: {
12
11
  status: EditorAiStatus;
13
12
  reasoning?: string;
14
- }, hasAnswer: boolean, scrollViewportRef?: {
15
- readonly current: HTMLElement | null;
16
- }): ThinkingModel;
13
+ }, hasAnswer: boolean) => ThinkingModel;
17
14
  export declare const ThinkingHead: React.FC<{
18
15
  model: ThinkingModel;
19
16
  }>;
@@ -1,7 +1,6 @@
1
1
  import { EditorAiStatus } from '../interface';
2
2
  type TypesetModalProps = {
3
3
  status: EditorAiStatus;
4
- reasoning?: string;
5
4
  errorMessage?: string;
6
5
  originalHtml: string;
7
6
  proposedHtml: string;
@@ -0,0 +1,8 @@
1
+ import { EditorAiStatus } from '../interface';
2
+ export declare const toPreviewHtml: (html: string, status?: EditorAiStatus) => string;
3
+ export declare const useAiPreviewHtml: ({ enabled, status, revision, compute, }: {
4
+ enabled: boolean;
5
+ status: EditorAiStatus | undefined;
6
+ revision: string;
7
+ compute: () => string;
8
+ }) => string;
@@ -0,0 +1,9 @@
1
+ export declare const useAutoScroll: ({ viewportRef, enabled, revision, }: {
2
+ viewportRef: {
3
+ readonly current: HTMLElement | null;
4
+ };
5
+ enabled: boolean;
6
+ revision: string;
7
+ }) => {
8
+ onScroll: () => void;
9
+ };
@@ -5,5 +5,6 @@ export interface InsertImagePayload {
5
5
  width?: number;
6
6
  height?: number;
7
7
  dataId?: string;
8
+ dataSrc?: string;
8
9
  }
9
10
  export declare const INSERT_INLINE_IMAGE_COMMAND: LexicalCommand<InsertImagePayload>;
@@ -1,6 +1,4 @@
1
1
  import { EditorAiPreset } from '../interface';
2
- export declare const EDITOR_AI_CODE_PLACEHOLDER: (index: number) => string;
3
- export declare const EDITOR_AI_CODE_PLACEHOLDER_RE: RegExp;
4
2
  export declare const EDITOR_AI_PRESETS: EditorAiPreset[];
5
3
  export declare const EDITOR_AI_PRESET_I18N: {
6
4
  readonly quick: "editor.aiPresetQuick";
@@ -22,13 +22,14 @@ interface EditorContainerContextType {
22
22
  }
23
23
  export type EditorAiStream = {
24
24
  text: string;
25
- reasoning?: string;
26
25
  status?: EditorAiStatus;
27
26
  errorMessage?: string;
28
27
  };
29
28
  declare const EditorContainerContext: import('react').Context<EditorContainerContextType | null>;
30
29
  declare const EditorAiStreamContext: import('react').Context<EditorAiStream>;
30
+ declare const EditorAiReasoningContext: import('react').Context<string | undefined>;
31
31
  export declare const useEditorContainer: () => EditorContainerContextType;
32
32
  export declare const useEditorAiStream: () => EditorAiStream;
33
- export { EditorAiStreamContext };
33
+ export declare const useEditorAiReasoning: () => string | undefined;
34
+ export { EditorAiStreamContext, EditorAiReasoningContext };
34
35
  export default EditorContainerContext;
@@ -177,10 +177,10 @@ export type EditorAiMode = 'typeset' | 'polish';
177
177
  export type EditorAiStatus = 'idle' | 'loading' | 'ready' | 'error';
178
178
 
179
179
  export type EditorAi = {
180
- /** 点「智能排版」;`html` 已抽掉代码块为占位注释 */
181
- typeset?: (input: { text: string; html: string }) => void;
182
- /** 点润色预设;弹窗内切换预设会再调一次。`text` 为按块分隔的可润色纯文本(不含代码块) */
183
- polish?: (input: { text: string; preset: EditorAiPreset }) => void;
180
+ /** 点「智能排版」;`html` 已抽掉代码块为占位注释;`prompt` 为组件内置系统提示 */
181
+ typeset?: (input: { text: string; html: string; prompt: string }) => void;
182
+ /** 点润色预设;弹窗内切换预设会再调一次。`text` 为按块分隔的可润色纯文本(不含代码块);`prompt` 为组件内置系统提示 */
183
+ polish?: (input: { text: string; preset: EditorAiPreset; prompt: string }) => void;
184
184
  /** 放弃或应用后中止请求 */
185
185
  stop?: () => void;
186
186
  /** 流式正文:排版为 HTML,润色为纯文本 */
@@ -6,6 +6,7 @@ interface ImageComponentProps {
6
6
  width?: number;
7
7
  height?: number;
8
8
  dataId?: string;
9
+ dataSrc?: string;
9
10
  nodeKey: NodeKey;
10
11
  }
11
12
  declare const ImageComponent: React.FC<ImageComponentProps>;
@@ -6,6 +6,7 @@ export interface ImagePayload {
6
6
  width?: number;
7
7
  height?: number;
8
8
  dataId?: string;
9
+ dataSrc?: string;
9
10
  key?: NodeKey;
10
11
  }
11
12
  export type SerializedImageNode = Spread<{
@@ -14,6 +15,7 @@ export type SerializedImageNode = Spread<{
14
15
  width?: number;
15
16
  height?: number;
16
17
  dataId?: string;
18
+ dataSrc?: string;
17
19
  }, SerializedLexicalNode>;
18
20
  export declare class ImageNode extends DecoratorNode<ReactNode> {
19
21
  __src: string;
@@ -21,9 +23,10 @@ export declare class ImageNode extends DecoratorNode<ReactNode> {
21
23
  __width?: number;
22
24
  __height?: number;
23
25
  __dataId?: string;
26
+ __dataSrc?: string;
24
27
  static getType(): string;
25
28
  static clone(node: ImageNode): ImageNode;
26
- constructor(src: string, altText?: string, width?: number, height?: number, key?: NodeKey, dataId?: string);
29
+ constructor(src: string, altText?: string, width?: number, height?: number, key?: NodeKey, dataId?: string, dataSrc?: string);
27
30
  createDOM(): HTMLElement;
28
31
  updateDOM(): false;
29
32
  exportDOM(): {
@@ -48,7 +51,7 @@ export declare class ImageNode extends DecoratorNode<ReactNode> {
48
51
  exportJSON(): SerializedImageNode;
49
52
  isInline(): boolean;
50
53
  }
51
- export declare function $createImageNode({ src, altText, width, height, dataId, key, }: ImagePayload): ImageNode;
54
+ export declare function $createImageNode({ src, altText, width, height, dataId, dataSrc, key, }: ImagePayload): ImageNode;
52
55
  export declare function $isImageNode(node: LexicalNode | null | undefined): node is ImageNode;
53
56
  declare function convertImageElement(domNode: Node): null | DOMConversionOutput;
54
57
  export {};
@@ -1,5 +1,4 @@
1
1
  import { LexicalEditor } from 'lexical';
2
- export declare const POLISH_BLOCK_MARKER = "<!--bsy-block-->";
3
2
  export declare function joinPolishBlocks(blocks: string[]): string;
4
3
  export declare function hasPolishContent(text: string): boolean;
5
4
  export declare function collectPolishHtmlBlocks(html: string): string[];
@@ -1,2 +1 @@
1
- export declare function stripTypesetBlockFill(html: string): string;
2
- export declare function prepareTypesetProposed(raw: string, blocks: string[]): string;
1
+ export declare const prepareTypesetProposed: (raw: string, blocks: string[]) => string;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./vendors/version-CfjNx5v2.js";
1
+ import "./vendors/version-Dt7Pnhic.js";
2
2
  import "./ScrollBar/style-D26azwz6.js";
3
3
  import { t as e } from "./Icon/Icon-DrdQOEJE.js";
4
4
  import "./vendors/LocaleContext-DXQoOKM2.js";
@@ -12,7 +12,7 @@ import { t as g } from "./ColorPicker/ColorPicker-B_wLqurt.js";
12
12
  import "./vendors/useFloatingOverlay-B66lOL8v.js";
13
13
  import "./vendors/useLocale-Be4e7Xfn.js";
14
14
  import "./vendors/useLatchedPopupPortalRoot-CC6af8t-.js";
15
- import { t as _ } from "./Segmented/Segmented-DpmwFerw.js";
15
+ import { t as _ } from "./Segmented/Segmented-BkTy5v9V.js";
16
16
  import { n as v, t as y } from "./Tooltip/Tooltip-DBrt3t2r.js";
17
17
  import { t as b } from "./Select/Select-VIy6OKEj.js";
18
18
  import "./Select/SelectInputSearch-MApQHnU9.js";
@@ -29,8 +29,8 @@ import { t as O } from "./DropDown/DropDown-B_szM67V.js";
29
29
  import { t as k } from "./Loading/Loading-Cherk9Ax.js";
30
30
  import "./NotFoundContent/index.js";
31
31
  import { t as A } from "./InputTag/InputTag-C_5nm0eo.js";
32
- import { t as j } from "./Calendar/Calendar-BlsUX2vX.js";
33
- import { t as M } from "./DatePicker/DatePicker-BRwPZeui.js";
32
+ import { t as j } from "./Calendar/Calendar-DEr4d6DN.js";
33
+ import { t as M } from "./DatePicker/DatePicker-Bzvz3bI6.js";
34
34
  import "./DatePicker/pickerLocale-Brf7_Tnd.js";
35
35
  import { c as N, d as P, f as F, i as I, l as L, m as R, n as z, o as B, p as V, r as H, s as U, t as W, u as G } from "./Table/Table-8ac6xLZv.js";
36
36
  import "overlayscrollbars/overlayscrollbars.css";
@@ -1,6 +1,6 @@
1
1
  //#region src/version.ts
2
2
  if (typeof window < "u") {
3
3
  let e = window.__BSY_UI__ ??= {};
4
- e["@baishuyun/ui-base"] = "6.17.0";
4
+ e["@baishuyun/ui-base"] = "6.19.0";
5
5
  }
6
6
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baishuyun/ui-base",
3
- "version": "6.17.0",
3
+ "version": "6.19.0",
4
4
  "type": "module",
5
5
  "description": "百数云低代码平台通用组件库",
6
6
  "author": "bsy-fe team",
@@ -94,7 +94,8 @@
94
94
  "tailwindcss": "^3.0.0",
95
95
  "vite": "^8.0.0",
96
96
  "vite-plugin-dts": "^4.5.3",
97
- "zustand": "4.5.6"
97
+ "zustand": "4.5.6",
98
+ "@baishuyun/shared": "0.0.0"
98
99
  },
99
100
  "project": {
100
101
  "iconfont": {
@@ -1,6 +0,0 @@
1
- export type ExtractedCodePlaceholders = {
2
- html: string;
3
- blocks: string[];
4
- };
5
- /** 把 `<pre>` 换成 `<!--bsy-code-N-->`,块按文档顺序抽出。 */
6
- export declare function extractCodePlaceholders(html: string): ExtractedCodePlaceholders;
@@ -1,6 +0,0 @@
1
- /** 包自定义元素再 parse,避免文首 `<!-- -->` 落在 Document 上而进不了 innerHTML。 */
2
- export declare function parseHtmlFragment(html: string): HTMLElement | null;
3
- /** 按占位把原 `<pre>` 缝回;缺失的占位把剩余块追加到末尾。 */
4
- export declare function stitchCodePlaceholders(html: string, blocks: string[]): string;
5
- export declare function stitchTypesetProposed(html: string, blocks: string[]): string;
6
- export declare function stripModelCodeBlocks(html: string): string;