@textbus/platform-browser 4.2.1 → 4.2.2

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.
@@ -43,7 +43,7 @@ export declare class BrowserModule implements Module {
43
43
  * @param textbus
44
44
  */
45
45
  readDocumentByComponentLiteral(data: ComponentLiteral, rootComponent: ComponentConstructor, textbus: Textbus): Component;
46
- setup(textbus: Textbus): () => void;
46
+ setup(textbus: Textbus): Promise<() => void>;
47
47
  onAfterStartup(textbus: Textbus): void;
48
48
  onDestroy(textbus: Textbus): void;
49
49
  private static createLayout;
@@ -150,6 +150,16 @@ function __metadata(metadataKey, metadataValue) {
150
150
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
151
151
  }
152
152
 
153
+ function __awaiter(thisArg, _arguments, P, generator) {
154
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
155
+ return new (P || (P = Promise))(function (resolve, reject) {
156
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
157
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
158
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
159
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
160
+ });
161
+ }
162
+
153
163
  typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
154
164
  var e = new Error(message);
155
165
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
@@ -2247,15 +2257,18 @@ class BrowserModule {
2247
2257
  return registry.createComponentByFactory(data, rootComponent);
2248
2258
  }
2249
2259
  setup(textbus) {
2250
- this.textbus = textbus;
2251
- const host = this.config.renderTo();
2252
- if (!(host instanceof HTMLElement)) {
2253
- throw browserErrorFn('view container is not a HTMLElement');
2254
- }
2255
- host.append(this.workbench);
2256
- return () => {
2257
- this.workbench.remove();
2258
- };
2260
+ return __awaiter(this, void 0, void 0, function* () {
2261
+ this.textbus = textbus;
2262
+ const host = this.config.renderTo();
2263
+ if (!(host instanceof HTMLElement)) {
2264
+ throw browserErrorFn('view container is not a HTMLElement');
2265
+ }
2266
+ host.append(this.workbench);
2267
+ yield textbus.get(Input).onReady;
2268
+ return () => {
2269
+ this.workbench.remove();
2270
+ };
2271
+ });
2259
2272
  }
2260
2273
  onAfterStartup(textbus) {
2261
2274
  if (this.config.autoFocus) {
package/bundles/index.js CHANGED
@@ -152,6 +152,16 @@ function __metadata(metadataKey, metadataValue) {
152
152
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
153
153
  }
154
154
 
155
+ function __awaiter(thisArg, _arguments, P, generator) {
156
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
157
+ return new (P || (P = Promise))(function (resolve, reject) {
158
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
159
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
160
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
161
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
162
+ });
163
+ }
164
+
155
165
  typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
156
166
  var e = new Error(message);
157
167
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
@@ -2249,15 +2259,18 @@ class BrowserModule {
2249
2259
  return registry.createComponentByFactory(data, rootComponent);
2250
2260
  }
2251
2261
  setup(textbus) {
2252
- this.textbus = textbus;
2253
- const host = this.config.renderTo();
2254
- if (!(host instanceof HTMLElement)) {
2255
- throw browserErrorFn('view container is not a HTMLElement');
2256
- }
2257
- host.append(this.workbench);
2258
- return () => {
2259
- this.workbench.remove();
2260
- };
2262
+ return __awaiter(this, void 0, void 0, function* () {
2263
+ this.textbus = textbus;
2264
+ const host = this.config.renderTo();
2265
+ if (!(host instanceof HTMLElement)) {
2266
+ throw browserErrorFn('view container is not a HTMLElement');
2267
+ }
2268
+ host.append(this.workbench);
2269
+ yield textbus.get(Input).onReady;
2270
+ return () => {
2271
+ this.workbench.remove();
2272
+ };
2273
+ });
2261
2274
  }
2262
2275
  onAfterStartup(textbus) {
2263
2276
  if (this.config.autoFocus) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/platform-browser",
3
- "version": "4.2.1",
3
+ "version": "4.2.2",
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",