bridgerte 0.9.0 → 0.9.1
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/README.md +241 -132
- package/dist/bridge.d.ts +13 -5
- package/dist/core.d.ts +12 -4
- package/dist/dom.cjs +1 -1
- package/dist/dom.d.ts +52 -4
- package/dist/dom.js +4 -3
- package/dist/dom.js.map +1 -1
- package/dist/{index-C7IVE5Bd.js → index-BQAzp56J.js} +1778 -1915
- package/dist/index-BQAzp56J.js.map +1 -0
- package/dist/index-Bui5UnkQ.cjs +3 -0
- package/dist/index-Bui5UnkQ.cjs.map +1 -0
- package/dist/index-CeYJbOQi.js +137 -0
- package/dist/index-CeYJbOQi.js.map +1 -0
- package/dist/index-DAlyGWXO.cjs +2 -0
- package/dist/index-DAlyGWXO.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +101 -5
- package/dist/index.js +15 -14
- package/dist/index.js.map +1 -1
- package/dist/native-spec.d.ts +30 -4
- package/dist/style.css +1 -1
- package/dist/webview.cjs +1 -1
- package/dist/webview.d.ts +43 -5
- package/dist/webview.js +1 -1
- package/package.json +8 -8
- package/dist/index-BDgKCpty.cjs +0 -3
- package/dist/index-BDgKCpty.cjs.map +0 -1
- package/dist/index-C7IVE5Bd.js.map +0 -1
package/dist/bridge.d.ts
CHANGED
|
@@ -756,7 +756,6 @@ export type RichTextEditorIcons = Partial<Record<string, string>>;
|
|
|
756
756
|
export type RichTextEditorOptions = {
|
|
757
757
|
value?: Partial<EditorContent>;
|
|
758
758
|
readonly?: boolean;
|
|
759
|
-
platform?: 'pc' | 'h5' | 'webview';
|
|
760
759
|
uploadAdapter?: UploadAdapter;
|
|
761
760
|
/**
|
|
762
761
|
* 媒体节点没有显式 displayWidthPercent 时的默认展示比例。
|
|
@@ -764,14 +763,23 @@ export type RichTextEditorOptions = {
|
|
|
764
763
|
* 默认值是 50;业务可以按产品形态改成 20 或 100,内置 UI 仍只提供固定预设。
|
|
765
764
|
*/
|
|
766
765
|
mediaDefaultWidthPercent?: MediaDisplayWidthPercent;
|
|
766
|
+
/**
|
|
767
|
+
* @deprecated createRichTextEditor 永远只创建编辑器内容实例。
|
|
768
|
+
* toolbar/tabbar 请使用 createRichTextToolbar 或原生侧单独渲染;该字段保留为兼容 no-op。
|
|
769
|
+
*/
|
|
767
770
|
toolbarMode?: 'top' | 'bottom' | 'none' | 'native';
|
|
768
771
|
/**
|
|
769
|
-
* DOM 内置
|
|
772
|
+
* DOM 内置 hoverbar、slash command 等菜单运行时使用的菜单 schema。
|
|
770
773
|
*
|
|
771
|
-
* 自定义菜单必须先进入 schema
|
|
774
|
+
* 自定义菜单必须先进入 schema,再由独立 toolbar 的 `toolbarConfig`、`hoverbarConfig`
|
|
775
|
+
* 或 slash command 配置引用;
|
|
772
776
|
* 这里不接收 SVG,图标展示仍通过 `icons` 按稳定 icon key 覆盖。
|
|
773
777
|
*/
|
|
774
778
|
menuSchema?: MenuItem[];
|
|
779
|
+
/**
|
|
780
|
+
* @deprecated editor 不再自动创建 toolbar/tabbar,该字段在 createRichTextEditor 中是 no-op。
|
|
781
|
+
* 请把 toolbarConfig 传给 createRichTextToolbar(container, { editor, toolbarConfig })。
|
|
782
|
+
*/
|
|
775
783
|
toolbarConfig?: ToolbarConfig;
|
|
776
784
|
/**
|
|
777
785
|
* DOM 内置 hoverbar 的显示结构配置。
|
|
@@ -796,7 +804,7 @@ export type RichTextEditorOptions = {
|
|
|
796
804
|
slashCommandConfig?: ToolbarConfig;
|
|
797
805
|
icons?: RichTextEditorIcons;
|
|
798
806
|
/**
|
|
799
|
-
* DOM 内置 toolbar/tabbar
|
|
807
|
+
* DOM 内置 hoverbar、slash command 以及独立 toolbar/tabbar 的菜单 label 覆盖。
|
|
800
808
|
*
|
|
801
809
|
* key 使用 `MenuItem.id`,只影响按钮文本、tooltip 和 aria-label,不改变命令语义。
|
|
802
810
|
*/
|
|
@@ -912,7 +920,7 @@ export type BridgeEventTiming = {
|
|
|
912
920
|
*
|
|
913
921
|
* 只保留可序列化且跨端稳定的字段,避免把函数或宿主对象塞进 bridge。
|
|
914
922
|
*/
|
|
915
|
-
export type EditorInitOptions = Pick<RichTextEditorOptions, 'readonly' | '
|
|
923
|
+
export type EditorInitOptions = Pick<RichTextEditorOptions, 'readonly' | 'placeholder' | 'maxLength' | 'codeBlockLanguagePanel'> & {
|
|
916
924
|
value?: Partial<EditorContent>;
|
|
917
925
|
};
|
|
918
926
|
/**
|
package/dist/core.d.ts
CHANGED
|
@@ -756,7 +756,6 @@ export type RichTextEditorIcons = Partial<Record<string, string>>;
|
|
|
756
756
|
export type RichTextEditorOptions = {
|
|
757
757
|
value?: Partial<EditorContent>;
|
|
758
758
|
readonly?: boolean;
|
|
759
|
-
platform?: 'pc' | 'h5' | 'webview';
|
|
760
759
|
uploadAdapter?: UploadAdapter;
|
|
761
760
|
/**
|
|
762
761
|
* 媒体节点没有显式 displayWidthPercent 时的默认展示比例。
|
|
@@ -764,14 +763,23 @@ export type RichTextEditorOptions = {
|
|
|
764
763
|
* 默认值是 50;业务可以按产品形态改成 20 或 100,内置 UI 仍只提供固定预设。
|
|
765
764
|
*/
|
|
766
765
|
mediaDefaultWidthPercent?: MediaDisplayWidthPercent;
|
|
766
|
+
/**
|
|
767
|
+
* @deprecated createRichTextEditor 永远只创建编辑器内容实例。
|
|
768
|
+
* toolbar/tabbar 请使用 createRichTextToolbar 或原生侧单独渲染;该字段保留为兼容 no-op。
|
|
769
|
+
*/
|
|
767
770
|
toolbarMode?: 'top' | 'bottom' | 'none' | 'native';
|
|
768
771
|
/**
|
|
769
|
-
* DOM 内置
|
|
772
|
+
* DOM 内置 hoverbar、slash command 等菜单运行时使用的菜单 schema。
|
|
770
773
|
*
|
|
771
|
-
* 自定义菜单必须先进入 schema
|
|
774
|
+
* 自定义菜单必须先进入 schema,再由独立 toolbar 的 `toolbarConfig`、`hoverbarConfig`
|
|
775
|
+
* 或 slash command 配置引用;
|
|
772
776
|
* 这里不接收 SVG,图标展示仍通过 `icons` 按稳定 icon key 覆盖。
|
|
773
777
|
*/
|
|
774
778
|
menuSchema?: MenuItem[];
|
|
779
|
+
/**
|
|
780
|
+
* @deprecated editor 不再自动创建 toolbar/tabbar,该字段在 createRichTextEditor 中是 no-op。
|
|
781
|
+
* 请把 toolbarConfig 传给 createRichTextToolbar(container, { editor, toolbarConfig })。
|
|
782
|
+
*/
|
|
775
783
|
toolbarConfig?: ToolbarConfig;
|
|
776
784
|
/**
|
|
777
785
|
* DOM 内置 hoverbar 的显示结构配置。
|
|
@@ -796,7 +804,7 @@ export type RichTextEditorOptions = {
|
|
|
796
804
|
slashCommandConfig?: ToolbarConfig;
|
|
797
805
|
icons?: RichTextEditorIcons;
|
|
798
806
|
/**
|
|
799
|
-
* DOM 内置 toolbar/tabbar
|
|
807
|
+
* DOM 内置 hoverbar、slash command 以及独立 toolbar/tabbar 的菜单 label 覆盖。
|
|
800
808
|
*
|
|
801
809
|
* key 使用 `MenuItem.id`,只影响按钮文本、tooltip 和 aria-label,不改变命令语义。
|
|
802
810
|
*/
|
package/dist/dom.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-Bui5UnkQ.cjs"),t=require("./index-DAlyGWXO.cjs");exports.createFloatingLayer=e.createFloatingLayer;exports.createRichTextEditor=e.createRichTextEditor;exports.createWebViewBridgeRuntime=e.createWebViewBridgeRuntime;exports.createRichTextToolbar=t.createRichTextToolbar;
|
|
2
2
|
//# sourceMappingURL=dom.cjs.map
|
package/dist/dom.d.ts
CHANGED
|
@@ -756,7 +756,6 @@ export type RichTextEditorIcons = Partial<Record<string, string>>;
|
|
|
756
756
|
export type RichTextEditorOptions = {
|
|
757
757
|
value?: Partial<EditorContent>;
|
|
758
758
|
readonly?: boolean;
|
|
759
|
-
platform?: 'pc' | 'h5' | 'webview';
|
|
760
759
|
uploadAdapter?: UploadAdapter;
|
|
761
760
|
/**
|
|
762
761
|
* 媒体节点没有显式 displayWidthPercent 时的默认展示比例。
|
|
@@ -764,14 +763,23 @@ export type RichTextEditorOptions = {
|
|
|
764
763
|
* 默认值是 50;业务可以按产品形态改成 20 或 100,内置 UI 仍只提供固定预设。
|
|
765
764
|
*/
|
|
766
765
|
mediaDefaultWidthPercent?: MediaDisplayWidthPercent;
|
|
766
|
+
/**
|
|
767
|
+
* @deprecated createRichTextEditor 永远只创建编辑器内容实例。
|
|
768
|
+
* toolbar/tabbar 请使用 createRichTextToolbar 或原生侧单独渲染;该字段保留为兼容 no-op。
|
|
769
|
+
*/
|
|
767
770
|
toolbarMode?: 'top' | 'bottom' | 'none' | 'native';
|
|
768
771
|
/**
|
|
769
|
-
* DOM 内置
|
|
772
|
+
* DOM 内置 hoverbar、slash command 等菜单运行时使用的菜单 schema。
|
|
770
773
|
*
|
|
771
|
-
* 自定义菜单必须先进入 schema
|
|
774
|
+
* 自定义菜单必须先进入 schema,再由独立 toolbar 的 `toolbarConfig`、`hoverbarConfig`
|
|
775
|
+
* 或 slash command 配置引用;
|
|
772
776
|
* 这里不接收 SVG,图标展示仍通过 `icons` 按稳定 icon key 覆盖。
|
|
773
777
|
*/
|
|
774
778
|
menuSchema?: MenuItem[];
|
|
779
|
+
/**
|
|
780
|
+
* @deprecated editor 不再自动创建 toolbar/tabbar,该字段在 createRichTextEditor 中是 no-op。
|
|
781
|
+
* 请把 toolbarConfig 传给 createRichTextToolbar(container, { editor, toolbarConfig })。
|
|
782
|
+
*/
|
|
775
783
|
toolbarConfig?: ToolbarConfig;
|
|
776
784
|
/**
|
|
777
785
|
* DOM 内置 hoverbar 的显示结构配置。
|
|
@@ -796,7 +804,7 @@ export type RichTextEditorOptions = {
|
|
|
796
804
|
slashCommandConfig?: ToolbarConfig;
|
|
797
805
|
icons?: RichTextEditorIcons;
|
|
798
806
|
/**
|
|
799
|
-
* DOM 内置 toolbar/tabbar
|
|
807
|
+
* DOM 内置 hoverbar、slash command 以及独立 toolbar/tabbar 的菜单 label 覆盖。
|
|
800
808
|
*
|
|
801
809
|
* key 使用 `MenuItem.id`,只影响按钮文本、tooltip 和 aria-label,不改变命令语义。
|
|
802
810
|
*/
|
|
@@ -897,7 +905,17 @@ export declare const BRIDGERTE_CONTENT_VERSION = "0.1.0";
|
|
|
897
905
|
export declare const BRIDGERTE_TABLE_INSERT_MAX_ROWS = 20;
|
|
898
906
|
export declare const BRIDGERTE_TABLE_INSERT_MAX_COLS = 20;
|
|
899
907
|
|
|
908
|
+
/**
|
|
909
|
+
* toolbar icon 覆盖表。
|
|
910
|
+
*
|
|
911
|
+
* key 对应 MenuItem.icon 稳定 key,value 是 DOM 侧渲染用 SVG 字符串。
|
|
912
|
+
*/
|
|
900
913
|
export type RichTextToolbarIcons = RichTextEditorIcons;
|
|
914
|
+
/**
|
|
915
|
+
* toolbar 横向拖动状态。
|
|
916
|
+
*
|
|
917
|
+
* PC/H5 都用同一套 pointer 数据,hasDragged 用于区分拖动滚动和真实点击。
|
|
918
|
+
*/
|
|
901
919
|
export type ToolbarDragState = {
|
|
902
920
|
startClientX: number;
|
|
903
921
|
startScrollLeft: number;
|
|
@@ -905,7 +923,17 @@ export type ToolbarDragState = {
|
|
|
905
923
|
hasDragged: boolean;
|
|
906
924
|
startButton?: HTMLButtonElement;
|
|
907
925
|
};
|
|
926
|
+
/**
|
|
927
|
+
* toolbar 挂载方向。
|
|
928
|
+
*
|
|
929
|
+
* createRichTextToolbar 独立实例只负责自身布局,具体位置由宿主挂载容器决定。
|
|
930
|
+
*/
|
|
908
931
|
export type RichTextToolbarPlacement = 'top' | 'bottom';
|
|
932
|
+
/**
|
|
933
|
+
* 独立 toolbar 创建参数。
|
|
934
|
+
*
|
|
935
|
+
* editor 提供命令和状态,schema/config 决定展示结构,icons/menuLabels 只覆盖显示层。
|
|
936
|
+
*/
|
|
909
937
|
export type RichTextToolbarOptions = {
|
|
910
938
|
editor: EditorAPI;
|
|
911
939
|
menuSchema?: MenuItem[];
|
|
@@ -915,6 +943,11 @@ export type RichTextToolbarOptions = {
|
|
|
915
943
|
menuLabels?: MenuLabelOverrides;
|
|
916
944
|
payloadPanelConfig?: PayloadPanelConfig;
|
|
917
945
|
};
|
|
946
|
+
/**
|
|
947
|
+
* toolbar 实例 API。
|
|
948
|
+
*
|
|
949
|
+
* update 手动刷新命令状态,destroy 释放 DOM listener 和命令状态订阅。
|
|
950
|
+
*/
|
|
918
951
|
export type RichTextToolbarAPI = {
|
|
919
952
|
update(): void;
|
|
920
953
|
destroy(): void;
|
|
@@ -927,13 +960,28 @@ export type RichTextToolbarAPI = {
|
|
|
927
960
|
*/
|
|
928
961
|
export declare function createRichTextToolbar(container: HTMLElement, options: RichTextToolbarOptions): RichTextToolbarAPI;
|
|
929
962
|
|
|
963
|
+
/**
|
|
964
|
+
* 浮层相对锚点的放置方向。
|
|
965
|
+
*
|
|
966
|
+
* 语义对齐 floating-ui placement,方便 DOM 默认层和业务自绘使用同一套位置配置。
|
|
967
|
+
*/
|
|
930
968
|
export type RichTextFloatingPlacement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
969
|
+
/**
|
|
970
|
+
* 通用浮层创建选项。
|
|
971
|
+
*
|
|
972
|
+
* root 由实现层持有;这里仅描述定位策略、偏移和边界 padding。
|
|
973
|
+
*/
|
|
931
974
|
export type RichTextFloatingLayerOptions = {
|
|
932
975
|
placement?: RichTextFloatingPlacement;
|
|
933
976
|
offset?: number;
|
|
934
977
|
shiftPadding?: number;
|
|
935
978
|
strategy?: 'absolute' | 'fixed';
|
|
936
979
|
};
|
|
980
|
+
/**
|
|
981
|
+
* 通用浮层实例。
|
|
982
|
+
*
|
|
983
|
+
* update 会重新计算位置,destroy 释放 floating-ui autoUpdate 和 DOM 引用。
|
|
984
|
+
*/
|
|
937
985
|
export type RichTextFloatingLayer = {
|
|
938
986
|
update(): Promise<void>;
|
|
939
987
|
setOpen(open: boolean): void;
|
package/dist/dom.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { c as r, a as t, b as c
|
|
1
|
+
import { c as r, a as t, b as c } from "./index-BQAzp56J.js";
|
|
2
|
+
import { c as i } from "./index-CeYJbOQi.js";
|
|
2
3
|
export {
|
|
3
4
|
r as createFloatingLayer,
|
|
4
5
|
t as createRichTextEditor,
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
i as createRichTextToolbar,
|
|
7
|
+
c as createWebViewBridgeRuntime
|
|
7
8
|
};
|
|
8
9
|
//# sourceMappingURL=dom.js.map
|
package/dist/dom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dom.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|