@textbus/platform-browser 4.0.4 → 4.1.0-alpha.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.
@@ -1,6 +1,6 @@
1
1
  import { Adapter } from '@textbus/core';
2
2
  import { Subject } from '@tanbo/stream';
3
- export declare abstract class DomAdapter<ViewComponent extends object = object, ViewElement extends object = object> extends Adapter<HTMLElement, Node, ViewComponent, ViewElement> {
3
+ export declare abstract class DomAdapter<ViewComponent extends object = object, ViewElement extends object = object> extends Adapter<Element, Node, ViewComponent, ViewElement> {
4
4
  onViewUpdated: Subject<void>;
5
5
  host: HTMLElement;
6
6
  }
@@ -11,16 +11,16 @@ export interface SlotParser {
11
11
  * @param slotContentHostElement 插槽的内容节点
12
12
  *
13
13
  * 注意:当不传入内容节点时,Textbus 会把根节点当成内容节点
14
- */ <T extends Slot>(childSlot: T, slotRootElement: HTMLElement, slotContentHostElement?: HTMLElement): T;
14
+ */ <T extends Slot>(childSlot: T, slotRootElement: Element, slotContentHostElement?: Element): T;
15
15
  }
16
16
  /**
17
17
  * 组件加载器
18
18
  */
19
19
  export interface ComponentLoader {
20
20
  /** 识别组件的匹配方法 */
21
- match(element: HTMLElement, returnableContentTypes: ContentType[]): boolean;
21
+ match(element: Element, returnableContentTypes: ContentType[]): boolean;
22
22
  /** 读取组件内容的方法 */
23
- read(element: HTMLElement, textbus: Textbus, slotParser: SlotParser): Component | Slot | void;
23
+ read(element: Element, textbus: Textbus, slotParser: SlotParser): Component | Slot | void;
24
24
  }
25
25
  export interface FormatLoaderReadResult<T = FormatValue> {
26
26
  formatter: Formatter<T>;
@@ -34,12 +34,12 @@ export interface FormatLoader<T = FormatValue> {
34
34
  * 匹配一个 DOM 节点是否是某个格式节点
35
35
  * @param element
36
36
  */
37
- match(element: HTMLElement): boolean;
37
+ match(element: Element): boolean;
38
38
  /**
39
39
  * 读取匹配到的节点,并返回读取后的信息
40
40
  * @param element
41
41
  */
42
- read(element: HTMLElement): FormatLoaderReadResult<T>;
42
+ read(element: Element): FormatLoaderReadResult<T>;
43
43
  }
44
44
  export interface AttributeLoaderReadResult<T = FormatValue> {
45
45
  attribute: Attribute<T>;
@@ -53,12 +53,12 @@ export interface AttributeLoader<T = FormatValue> {
53
53
  * 匹配一个 DOM 节点是否是某个属性节点
54
54
  * @param element
55
55
  */
56
- match(element: HTMLElement): boolean;
56
+ match(element: Element): boolean;
57
57
  /**
58
58
  * 读取匹配到的节点,并返回读取后的信息
59
59
  * @param element
60
60
  */
61
- read(element: HTMLElement): AttributeLoaderReadResult<T>;
61
+ read(element: Element): AttributeLoaderReadResult<T>;
62
62
  }
63
63
  /**
64
64
  * 用于解析 HTML,并把 HTML 内容转换为 Textbus 可以支持的组件或插槽数据
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/platform-browser",
3
- "version": "4.0.4",
3
+ "version": "4.1.0-alpha.0",
4
4
  "description": "Textbus is a rich text editor and framework that is highly customizable and extensible to achieve rich wysiwyg effects.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@tanbo/stream": "^1.2.5",
29
- "@textbus/core": "^4.0.4",
29
+ "@textbus/core": "^4.1.0-alpha.0",
30
30
  "@viewfly/core": "^1.0.4"
31
31
  },
32
32
  "devDependencies": {