@textbus/platform-browser 3.1.17 → 3.1.18

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 'reflect-metadata';
2
2
  import { InjectionToken, Injectable, Inject, Injector, Optional } from '@tanbo/di';
3
- import { VTextNode, VElement, Controller, Selection, RootComponentRef, Renderer, Scheduler, Slot, ContentType, Event, invokeListener, Keyboard, Commander, makeError, Starter, NativeRenderer, NativeSelectionBridge, OutputRenderer, Registry, History } from '@textbus/core';
3
+ import { VTextNode, VElement, Controller, Selection, RootComponentRef, Renderer, Scheduler, Slot, ContentType, Event, invokeListener, Keyboard, Commander, makeError, Starter, NativeRenderer, NativeSelectionBridge, OutputRenderer, History, Registry } from '@textbus/core';
4
4
  import { Subject, filter, fromEvent, Subscription, distinctUntilChanged, merge, map, Observable } from '@tanbo/stream';
5
5
 
6
6
  function createElement(tagName, options = {}) {
@@ -2259,10 +2259,11 @@ let NativeInput = class NativeInput extends Input {
2259
2259
  }
2260
2260
  break;
2261
2261
  }
2262
- case 'insertFromComposition': {
2263
- compositionEnd(ev.data || '');
2264
- break;
2265
- }
2262
+ //
2263
+ // case 'insertFromComposition': {
2264
+ // compositionEnd(ev.data || '')
2265
+ // break
2266
+ // }
2266
2267
  }
2267
2268
  }));
2268
2269
  }
@@ -2647,6 +2648,14 @@ class Viewer extends Starter {
2647
2648
  const rootComponentRef = this.get(RootComponentRef);
2648
2649
  return rootComponentRef.component.toJSON();
2649
2650
  }
2651
+ /**
2652
+ * 清空内容
2653
+ */
2654
+ clear() {
2655
+ this.replaceContent('');
2656
+ const history = this.get(History);
2657
+ history.clear();
2658
+ }
2650
2659
  /**
2651
2660
  * 销毁编辑器
2652
2661
  */
package/bundles/index.js CHANGED
@@ -2261,10 +2261,11 @@ exports.NativeInput = class NativeInput extends Input {
2261
2261
  }
2262
2262
  break;
2263
2263
  }
2264
- case 'insertFromComposition': {
2265
- compositionEnd(ev.data || '');
2266
- break;
2267
- }
2264
+ //
2265
+ // case 'insertFromComposition': {
2266
+ // compositionEnd(ev.data || '')
2267
+ // break
2268
+ // }
2268
2269
  }
2269
2270
  }));
2270
2271
  }
@@ -2649,6 +2650,14 @@ class Viewer extends core.Starter {
2649
2650
  const rootComponentRef = this.get(core.RootComponentRef);
2650
2651
  return rootComponentRef.component.toJSON();
2651
2652
  }
2653
+ /**
2654
+ * 清空内容
2655
+ */
2656
+ clear() {
2657
+ this.replaceContent('');
2658
+ const history = this.get(core.History);
2659
+ history.clear();
2660
+ }
2652
2661
  /**
2653
2662
  * 销毁编辑器
2654
2663
  */
@@ -69,6 +69,10 @@ export declare class Viewer extends Starter {
69
69
  * 获取 JSON 格式的内容
70
70
  */
71
71
  getJSON(): ComponentLiteral;
72
+ /**
73
+ * 清空内容
74
+ */
75
+ clear(): void;
72
76
  /**
73
77
  * 销毁编辑器
74
78
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/platform-browser",
3
- "version": "3.1.17",
3
+ "version": "3.1.18",
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",
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "@tanbo/di": "^1.1.4",
29
29
  "@tanbo/stream": "^1.1.9",
30
- "@textbus/core": "^3.1.17",
30
+ "@textbus/core": "^3.1.18",
31
31
  "reflect-metadata": "^0.1.13"
32
32
  },
33
33
  "devDependencies": {
@@ -48,5 +48,5 @@
48
48
  "bugs": {
49
49
  "url": "https://github.com/textbus/textbus.git/issues"
50
50
  },
51
- "gitHead": "30df4bdca5b13b6765d4e208ebb2e491ed3529f7"
51
+ "gitHead": "b7f5adca5b1e8268bdcfa9f0358d399c8ebfcd30"
52
52
  }