@textbus/platform-browser 3.4.8 → 3.4.9
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.
@@ -34,7 +34,7 @@ export interface ComponentLoader {
|
|
34
34
|
/** 识别组件的匹配方法 */
|
35
35
|
match(element: HTMLElement): boolean;
|
36
36
|
/** 读取组件内容的方法 */
|
37
|
-
read(element: HTMLElement, injector: Injector, slotParser: SlotParser): ComponentInstance | Slot;
|
37
|
+
read(element: HTMLElement, injector: Injector, slotParser: SlotParser): ComponentInstance | Slot | void;
|
38
38
|
}
|
39
39
|
export interface FormatLoaderReadResult<T extends FormatValue> {
|
40
40
|
formatter: Formatter<T>;
|
@@ -90,7 +90,7 @@ export declare class Parser {
|
|
90
90
|
* @param html
|
91
91
|
* @param rootComponentLoader
|
92
92
|
*/
|
93
|
-
parseDoc(html: string, rootComponentLoader: ComponentLoader): Slot<any> | ComponentInstance<import("@textbus/core").ComponentExtends, any, unknown>;
|
93
|
+
parseDoc(html: string, rootComponentLoader: ComponentLoader): void | Slot<any> | ComponentInstance<import("@textbus/core").ComponentExtends, any, unknown>;
|
94
94
|
/**
|
95
95
|
* 将一段 HTML 解析到指定插槽
|
96
96
|
* @param html
|
package/bundles/index.esm.js
CHANGED
@@ -1269,6 +1269,9 @@ let Parser = Parser_1 = class Parser {
|
|
1269
1269
|
const result = t.read(el, this.injector, (childSlot, slotRootElement, slotContentHostElement = slotRootElement) => {
|
1270
1270
|
return this.readSlot(childSlot, slotRootElement, slotContentHostElement);
|
1271
1271
|
});
|
1272
|
+
if (!result) {
|
1273
|
+
return;
|
1274
|
+
}
|
1272
1275
|
if (result instanceof Slot) {
|
1273
1276
|
result.toDelta().forEach(i => slot.insert(i.insert, i.formats));
|
1274
1277
|
return;
|
package/bundles/index.js
CHANGED
@@ -1271,6 +1271,9 @@ exports.Parser = Parser_1 = class Parser {
|
|
1271
1271
|
const result = t.read(el, this.injector, (childSlot, slotRootElement, slotContentHostElement = slotRootElement) => {
|
1272
1272
|
return this.readSlot(childSlot, slotRootElement, slotContentHostElement);
|
1273
1273
|
});
|
1274
|
+
if (!result) {
|
1275
|
+
return;
|
1276
|
+
}
|
1274
1277
|
if (result instanceof core.Slot) {
|
1275
1278
|
result.toDelta().forEach(i => slot.insert(i.insert, i.formats));
|
1276
1279
|
return;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@textbus/platform-browser",
|
3
|
-
"version": "3.4.
|
3
|
+
"version": "3.4.9",
|
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",
|
@@ -48,5 +48,5 @@
|
|
48
48
|
"bugs": {
|
49
49
|
"url": "https://github.com/textbus/textbus.git/issues"
|
50
50
|
},
|
51
|
-
"gitHead": "
|
51
|
+
"gitHead": "fe0b65d7da3ddadb9a6d311572c3e497154dcc86"
|
52
52
|
}
|