@netless/fastboard-ui 0.3.22-beta.0 → 0.3.22-beta.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/dist/index.mjs CHANGED
@@ -14938,19 +14938,19 @@ function create_if_block_32(ctx) {
14938
14938
  props: {
14939
14939
  app: (
14940
14940
  /*app*/
14941
- ctx[0]
14941
+ ctx[1]
14942
14942
  ),
14943
14943
  theme: (
14944
14944
  /*theme*/
14945
- ctx[1]
14945
+ ctx[2]
14946
14946
  ),
14947
14947
  language: (
14948
14948
  /*language*/
14949
- ctx[2]
14949
+ ctx[3]
14950
14950
  ),
14951
14951
  config: (
14952
14952
  /*config*/
14953
- ctx[3].toolbar || {}
14953
+ ctx[0].toolbar || {}
14954
14954
  )
14955
14955
  }
14956
14956
  });
@@ -14965,21 +14965,21 @@ function create_if_block_32(ctx) {
14965
14965
  p(ctx2, dirty) {
14966
14966
  const toolbar_changes = {};
14967
14967
  if (dirty & /*app*/
14968
- 1)
14968
+ 2)
14969
14969
  toolbar_changes.app = /*app*/
14970
- ctx2[0];
14970
+ ctx2[1];
14971
14971
  if (dirty & /*theme*/
14972
- 2)
14972
+ 4)
14973
14973
  toolbar_changes.theme = /*theme*/
14974
- ctx2[1];
14974
+ ctx2[2];
14975
14975
  if (dirty & /*language*/
14976
- 4)
14976
+ 8)
14977
14977
  toolbar_changes.language = /*language*/
14978
- ctx2[2];
14978
+ ctx2[3];
14979
14979
  if (dirty & /*config*/
14980
- 8)
14980
+ 1)
14981
14981
  toolbar_changes.config = /*config*/
14982
- ctx2[3].toolbar || {};
14982
+ ctx2[0].toolbar || {};
14983
14983
  toolbar.$set(toolbar_changes);
14984
14984
  },
14985
14985
  i(local) {
@@ -15004,15 +15004,15 @@ function create_if_block_23(ctx) {
15004
15004
  props: {
15005
15005
  app: (
15006
15006
  /*app*/
15007
- ctx[0]
15007
+ ctx[1]
15008
15008
  ),
15009
15009
  theme: (
15010
15010
  /*theme*/
15011
- ctx[1]
15011
+ ctx[2]
15012
15012
  ),
15013
15013
  language: (
15014
15014
  /*language*/
15015
- ctx[2]
15015
+ ctx[3]
15016
15016
  )
15017
15017
  }
15018
15018
  });
@@ -15027,17 +15027,17 @@ function create_if_block_23(ctx) {
15027
15027
  p(ctx2, dirty) {
15028
15028
  const redoundo_changes = {};
15029
15029
  if (dirty & /*app*/
15030
- 1)
15030
+ 2)
15031
15031
  redoundo_changes.app = /*app*/
15032
- ctx2[0];
15032
+ ctx2[1];
15033
15033
  if (dirty & /*theme*/
15034
- 2)
15034
+ 4)
15035
15035
  redoundo_changes.theme = /*theme*/
15036
- ctx2[1];
15036
+ ctx2[2];
15037
15037
  if (dirty & /*language*/
15038
- 4)
15038
+ 8)
15039
15039
  redoundo_changes.language = /*language*/
15040
- ctx2[2];
15040
+ ctx2[3];
15041
15041
  redoundo.$set(redoundo_changes);
15042
15042
  },
15043
15043
  i(local) {
@@ -15062,15 +15062,15 @@ function create_if_block_14(ctx) {
15062
15062
  props: {
15063
15063
  app: (
15064
15064
  /*app*/
15065
- ctx[0]
15065
+ ctx[1]
15066
15066
  ),
15067
15067
  theme: (
15068
15068
  /*theme*/
15069
- ctx[1]
15069
+ ctx[2]
15070
15070
  ),
15071
15071
  language: (
15072
15072
  /*language*/
15073
- ctx[2]
15073
+ ctx[3]
15074
15074
  )
15075
15075
  }
15076
15076
  });
@@ -15085,17 +15085,17 @@ function create_if_block_14(ctx) {
15085
15085
  p(ctx2, dirty) {
15086
15086
  const zoomcontrol_changes = {};
15087
15087
  if (dirty & /*app*/
15088
- 1)
15088
+ 2)
15089
15089
  zoomcontrol_changes.app = /*app*/
15090
- ctx2[0];
15090
+ ctx2[1];
15091
15091
  if (dirty & /*theme*/
15092
- 2)
15092
+ 4)
15093
15093
  zoomcontrol_changes.theme = /*theme*/
15094
- ctx2[1];
15094
+ ctx2[2];
15095
15095
  if (dirty & /*language*/
15096
- 4)
15096
+ 8)
15097
15097
  zoomcontrol_changes.language = /*language*/
15098
- ctx2[2];
15098
+ ctx2[3];
15099
15099
  zoomcontrol.$set(zoomcontrol_changes);
15100
15100
  },
15101
15101
  i(local) {
@@ -15120,15 +15120,15 @@ function create_if_block18(ctx) {
15120
15120
  props: {
15121
15121
  app: (
15122
15122
  /*app*/
15123
- ctx[0]
15123
+ ctx[1]
15124
15124
  ),
15125
15125
  theme: (
15126
15126
  /*theme*/
15127
- ctx[1]
15127
+ ctx[2]
15128
15128
  ),
15129
15129
  language: (
15130
15130
  /*language*/
15131
- ctx[2]
15131
+ ctx[3]
15132
15132
  )
15133
15133
  }
15134
15134
  });
@@ -15143,17 +15143,17 @@ function create_if_block18(ctx) {
15143
15143
  p(ctx2, dirty) {
15144
15144
  const pagecontrol_changes = {};
15145
15145
  if (dirty & /*app*/
15146
- 1)
15146
+ 2)
15147
15147
  pagecontrol_changes.app = /*app*/
15148
- ctx2[0];
15148
+ ctx2[1];
15149
15149
  if (dirty & /*theme*/
15150
- 2)
15150
+ 4)
15151
15151
  pagecontrol_changes.theme = /*theme*/
15152
- ctx2[1];
15152
+ ctx2[2];
15153
15153
  if (dirty & /*language*/
15154
- 4)
15154
+ 8)
15155
15155
  pagecontrol_changes.language = /*language*/
15156
- ctx2[2];
15156
+ ctx2[3];
15157
15157
  pagecontrol.$set(pagecontrol_changes);
15158
15158
  },
15159
15159
  i(local) {
@@ -15188,19 +15188,19 @@ function create_fragment71(ctx) {
15188
15188
  let dispose;
15189
15189
  let if_block0 = (
15190
15190
  /*config*/
15191
- ((_a = ctx[3].toolbar) == null ? void 0 : _a.enable) !== false && create_if_block_32(ctx)
15191
+ ((_a = ctx[0].toolbar) == null ? void 0 : _a.enable) !== false && create_if_block_32(ctx)
15192
15192
  );
15193
15193
  let if_block1 = (
15194
15194
  /*config*/
15195
- ((_b = ctx[3].redo_undo) == null ? void 0 : _b.enable) !== false && create_if_block_23(ctx)
15195
+ ((_b = ctx[0].redo_undo) == null ? void 0 : _b.enable) !== false && create_if_block_23(ctx)
15196
15196
  );
15197
15197
  let if_block2 = (
15198
15198
  /*config*/
15199
- ((_c = ctx[3].zoom_control) == null ? void 0 : _c.enable) !== false && create_if_block_14(ctx)
15199
+ ((_c = ctx[0].zoom_control) == null ? void 0 : _c.enable) !== false && create_if_block_14(ctx)
15200
15200
  );
15201
15201
  let if_block3 = (
15202
15202
  /*config*/
15203
- ((_d = ctx[3].page_control) == null ? void 0 : _d.enable) !== false && create_if_block18(ctx)
15203
+ ((_d = ctx[0].page_control) == null ? void 0 : _d.enable) !== false && create_if_block18(ctx)
15204
15204
  );
15205
15205
  return {
15206
15206
  c() {
@@ -15224,7 +15224,7 @@ function create_fragment71(ctx) {
15224
15224
  if_block3.c();
15225
15225
  attr(div0, "class", name9 + "-view");
15226
15226
  attr(div1, "class", div1_class_value = name9 + "-" + /*config*/
15227
- (((_a2 = ctx[3].toolbar) == null ? void 0 : _a2.placement) || "left"));
15227
+ (((_a2 = ctx[0].toolbar) == null ? void 0 : _a2.placement) || "left"));
15228
15228
  toggle_class(div1, "hidden", !/*toolbar_has_items*/
15229
15229
  ctx[6] || !/*layout*/
15230
15230
  (ctx[5] === "visible" || /*layout*/
@@ -15245,12 +15245,12 @@ function create_fragment71(ctx) {
15245
15245
  );
15246
15246
  attr(div4, "class", name9 + "-root");
15247
15247
  toggle_class(div4, "loading", !/*app*/
15248
- ctx[0]);
15248
+ ctx[1]);
15249
15249
  },
15250
15250
  m(target, anchor) {
15251
15251
  insert(target, div4, anchor);
15252
15252
  append(div4, div0);
15253
- ctx[16](div0);
15253
+ ctx[19](div0);
15254
15254
  append(div4, t0);
15255
15255
  append(div4, div1);
15256
15256
  if (if_block0)
@@ -15282,12 +15282,12 @@ function create_fragment71(ctx) {
15282
15282
  var _a2, _b2, _c2, _d2, _e;
15283
15283
  if (
15284
15284
  /*config*/
15285
- ((_a2 = ctx2[3].toolbar) == null ? void 0 : _a2.enable) !== false
15285
+ ((_a2 = ctx2[0].toolbar) == null ? void 0 : _a2.enable) !== false
15286
15286
  ) {
15287
15287
  if (if_block0) {
15288
15288
  if_block0.p(ctx2, dirty);
15289
15289
  if (dirty & /*config*/
15290
- 8) {
15290
+ 1) {
15291
15291
  transition_in(if_block0, 1);
15292
15292
  }
15293
15293
  } else {
@@ -15304,12 +15304,12 @@ function create_fragment71(ctx) {
15304
15304
  check_outros();
15305
15305
  }
15306
15306
  if (!current || dirty & /*config*/
15307
- 8 && div1_class_value !== (div1_class_value = name9 + "-" + /*config*/
15308
- (((_b2 = ctx2[3].toolbar) == null ? void 0 : _b2.placement) || "left"))) {
15307
+ 1 && div1_class_value !== (div1_class_value = name9 + "-" + /*config*/
15308
+ (((_b2 = ctx2[0].toolbar) == null ? void 0 : _b2.placement) || "left"))) {
15309
15309
  attr(div1, "class", div1_class_value);
15310
15310
  }
15311
15311
  if (!current || dirty & /*config, toolbar_has_items, layout*/
15312
- 104) {
15312
+ 97) {
15313
15313
  toggle_class(div1, "hidden", !/*toolbar_has_items*/
15314
15314
  ctx2[6] || !/*layout*/
15315
15315
  (ctx2[5] === "visible" || /*layout*/
@@ -15317,12 +15317,12 @@ function create_fragment71(ctx) {
15317
15317
  }
15318
15318
  if (
15319
15319
  /*config*/
15320
- ((_c2 = ctx2[3].redo_undo) == null ? void 0 : _c2.enable) !== false
15320
+ ((_c2 = ctx2[0].redo_undo) == null ? void 0 : _c2.enable) !== false
15321
15321
  ) {
15322
15322
  if (if_block1) {
15323
15323
  if_block1.p(ctx2, dirty);
15324
15324
  if (dirty & /*config*/
15325
- 8) {
15325
+ 1) {
15326
15326
  transition_in(if_block1, 1);
15327
15327
  }
15328
15328
  } else {
@@ -15340,12 +15340,12 @@ function create_fragment71(ctx) {
15340
15340
  }
15341
15341
  if (
15342
15342
  /*config*/
15343
- ((_d2 = ctx2[3].zoom_control) == null ? void 0 : _d2.enable) !== false
15343
+ ((_d2 = ctx2[0].zoom_control) == null ? void 0 : _d2.enable) !== false
15344
15344
  ) {
15345
15345
  if (if_block2) {
15346
15346
  if_block2.p(ctx2, dirty);
15347
15347
  if (dirty & /*config*/
15348
- 8) {
15348
+ 1) {
15349
15349
  transition_in(if_block2, 1);
15350
15350
  }
15351
15351
  } else {
@@ -15372,12 +15372,12 @@ function create_fragment71(ctx) {
15372
15372
  }
15373
15373
  if (
15374
15374
  /*config*/
15375
- ((_e = ctx2[3].page_control) == null ? void 0 : _e.enable) !== false
15375
+ ((_e = ctx2[0].page_control) == null ? void 0 : _e.enable) !== false
15376
15376
  ) {
15377
15377
  if (if_block3) {
15378
15378
  if_block3.p(ctx2, dirty);
15379
15379
  if (dirty & /*config*/
15380
- 8) {
15380
+ 1) {
15381
15381
  transition_in(if_block3, 1);
15382
15382
  }
15383
15383
  } else {
@@ -15403,9 +15403,9 @@ function create_fragment71(ctx) {
15403
15403
  );
15404
15404
  }
15405
15405
  if (!current || dirty & /*app*/
15406
- 1) {
15406
+ 2) {
15407
15407
  toggle_class(div4, "loading", !/*app*/
15408
- ctx2[0]);
15408
+ ctx2[1]);
15409
15409
  }
15410
15410
  },
15411
15411
  i(local) {
@@ -15427,7 +15427,7 @@ function create_fragment71(ctx) {
15427
15427
  d(detaching) {
15428
15428
  if (detaching)
15429
15429
  detach(div4);
15430
- ctx[16](null);
15430
+ ctx[19](null);
15431
15431
  if (if_block0)
15432
15432
  if_block0.d();
15433
15433
  if (if_block1)
@@ -15443,13 +15443,15 @@ function create_fragment71(ctx) {
15443
15443
  }
15444
15444
  var name9 = "fastboard";
15445
15445
  function instance71($$self, $$props, $$invalidate) {
15446
+ let manager;
15447
+ let room;
15446
15448
  let writable2;
15447
15449
  let boxState;
15448
15450
  let focusedApp;
15449
15451
  let toolbar_has_items;
15450
- let $focusedApp, $$unsubscribe_focusedApp = noop, $$subscribe_focusedApp = () => ($$unsubscribe_focusedApp(), $$unsubscribe_focusedApp = subscribe(focusedApp, ($$value) => $$invalidate(13, $focusedApp = $$value)), focusedApp);
15451
- let $boxState, $$unsubscribe_boxState = noop, $$subscribe_boxState = () => ($$unsubscribe_boxState(), $$unsubscribe_boxState = subscribe(boxState, ($$value) => $$invalidate(14, $boxState = $$value)), boxState);
15452
- let $writable, $$unsubscribe_writable = noop, $$subscribe_writable = () => ($$unsubscribe_writable(), $$unsubscribe_writable = subscribe(writable2, ($$value) => $$invalidate(15, $writable = $$value)), writable2);
15452
+ let $focusedApp, $$unsubscribe_focusedApp = noop, $$subscribe_focusedApp = () => ($$unsubscribe_focusedApp(), $$unsubscribe_focusedApp = subscribe(focusedApp, ($$value) => $$invalidate(16, $focusedApp = $$value)), focusedApp);
15453
+ let $boxState, $$unsubscribe_boxState = noop, $$subscribe_boxState = () => ($$unsubscribe_boxState(), $$unsubscribe_boxState = subscribe(boxState, ($$value) => $$invalidate(17, $boxState = $$value)), boxState);
15454
+ let $writable, $$unsubscribe_writable = noop, $$subscribe_writable = () => ($$unsubscribe_writable(), $$unsubscribe_writable = subscribe(writable2, ($$value) => $$invalidate(18, $writable = $$value)), writable2);
15453
15455
  $$self.$$.on_destroy.push(() => $$unsubscribe_focusedApp());
15454
15456
  $$self.$$.on_destroy.push(() => $$unsubscribe_boxState());
15455
15457
  $$self.$$.on_destroy.push(() => $$unsubscribe_writable());
@@ -15458,6 +15460,7 @@ function instance71($$self, $$props, $$invalidate) {
15458
15460
  let { language = "en" } = $$props;
15459
15461
  let { containerRef = void 0 } = $$props;
15460
15462
  let { config = {} } = $$props;
15463
+ let { colors: colors2 = void 0 } = $$props;
15461
15464
  const AppsShowToolbar = ["DocsViewer", "Slide"];
15462
15465
  let container;
15463
15466
  let layout = "hidden";
@@ -15484,31 +15487,58 @@ function instance71($$self, $$props, $$invalidate) {
15484
15487
  }
15485
15488
  $$self.$$set = ($$props2) => {
15486
15489
  if ("app" in $$props2)
15487
- $$invalidate(0, app = $$props2.app);
15490
+ $$invalidate(1, app = $$props2.app);
15488
15491
  if ("theme" in $$props2)
15489
- $$invalidate(1, theme = $$props2.theme);
15492
+ $$invalidate(2, theme = $$props2.theme);
15490
15493
  if ("language" in $$props2)
15491
- $$invalidate(2, language = $$props2.language);
15494
+ $$invalidate(3, language = $$props2.language);
15492
15495
  if ("containerRef" in $$props2)
15493
- $$invalidate(11, containerRef = $$props2.containerRef);
15496
+ $$invalidate(12, containerRef = $$props2.containerRef);
15494
15497
  if ("config" in $$props2)
15495
- $$invalidate(3, config = $$props2.config);
15498
+ $$invalidate(0, config = $$props2.config);
15499
+ if ("colors" in $$props2)
15500
+ $$invalidate(11, colors2 = $$props2.colors);
15496
15501
  };
15497
15502
  $$self.$$.update = () => {
15498
15503
  if ($$self.$$.dirty & /*app*/
15499
- 1) {
15504
+ 2) {
15505
+ $$invalidate(15, manager = app == null ? void 0 : app.manager);
15506
+ }
15507
+ if ($$self.$$.dirty & /*app*/
15508
+ 2) {
15509
+ $$invalidate(14, room = app == null ? void 0 : app.manager.room);
15510
+ }
15511
+ if ($$self.$$.dirty & /*manager, room, config, colors*/
15512
+ 51201) {
15513
+ if (manager && room) {
15514
+ const floatBarOptions = room.floatBarOptions;
15515
+ if (floatBarOptions.colors) {
15516
+ $$invalidate(11, colors2 = floatBarOptions.colors);
15517
+ }
15518
+ if (config == null ? void 0 : config.toolbar) {
15519
+ const _colors = config.toolbar.colors;
15520
+ if (!_colors && colors2) {
15521
+ $$invalidate(0, config = __spreadProps(__spreadValues({}, config), {
15522
+ toolbar: __spreadProps(__spreadValues({}, config.toolbar), { colors: colors2 })
15523
+ }));
15524
+ }
15525
+ }
15526
+ }
15527
+ }
15528
+ if ($$self.$$.dirty & /*app*/
15529
+ 2) {
15500
15530
  $$subscribe_writable($$invalidate(9, writable2 = app == null ? void 0 : app.writable));
15501
15531
  }
15502
15532
  if ($$self.$$.dirty & /*app*/
15503
- 1) {
15533
+ 2) {
15504
15534
  $$subscribe_boxState($$invalidate(8, boxState = app == null ? void 0 : app.boxState));
15505
15535
  }
15506
15536
  if ($$self.$$.dirty & /*app*/
15507
- 1) {
15537
+ 2) {
15508
15538
  $$subscribe_focusedApp($$invalidate(7, focusedApp = app == null ? void 0 : app.focusedApp));
15509
15539
  }
15510
15540
  if ($$self.$$.dirty & /*$writable, $boxState, $focusedApp*/
15511
- 57344) {
15541
+ 458752) {
15512
15542
  if (!$writable) {
15513
15543
  $$invalidate(5, layout = "hidden");
15514
15544
  } else if ($boxState === "maximized") {
@@ -15522,15 +15552,15 @@ function instance71($$self, $$props, $$invalidate) {
15522
15552
  }
15523
15553
  }
15524
15554
  if ($$self.$$.dirty & /*config*/
15525
- 8) {
15555
+ 1) {
15526
15556
  $$invalidate(6, toolbar_has_items = !config.toolbar || !config.toolbar.items || !config.toolbar.apps || config.toolbar.items.length > 0 || config.toolbar.apps.enable !== false);
15527
15557
  }
15528
15558
  if ($$self.$$.dirty & /*app, container*/
15529
- 17) {
15559
+ 18) {
15530
15560
  try {
15531
15561
  if (app && container) {
15532
15562
  app.bindContainer(container);
15533
- $$invalidate(12, mounted = true);
15563
+ $$invalidate(13, mounted = true);
15534
15564
  }
15535
15565
  } catch (err) {
15536
15566
  console.error("[fastboard] An error occurred while binding container");
@@ -15538,17 +15568,17 @@ function instance71($$self, $$props, $$invalidate) {
15538
15568
  }
15539
15569
  }
15540
15570
  if ($$self.$$.dirty & /*app, theme, mounted*/
15541
- 4099) {
15571
+ 8198) {
15542
15572
  if (app && theme && mounted) {
15543
15573
  app.manager.setPrefersColorScheme(theme);
15544
15574
  }
15545
15575
  }
15546
15576
  };
15547
15577
  return [
15578
+ config,
15548
15579
  app,
15549
15580
  theme,
15550
15581
  language,
15551
- config,
15552
15582
  container,
15553
15583
  layout,
15554
15584
  toolbar_has_items,
@@ -15556,8 +15586,11 @@ function instance71($$self, $$props, $$invalidate) {
15556
15586
  boxState,
15557
15587
  writable2,
15558
15588
  focus_me,
15589
+ colors2,
15559
15590
  containerRef,
15560
15591
  mounted,
15592
+ room,
15593
+ manager,
15561
15594
  $focusedApp,
15562
15595
  $boxState,
15563
15596
  $writable,
@@ -15568,11 +15601,12 @@ var Fastboard = class extends SvelteComponent {
15568
15601
  constructor(options) {
15569
15602
  super();
15570
15603
  init(this, options, instance71, create_fragment71, not_equal, {
15571
- app: 0,
15572
- theme: 1,
15573
- language: 2,
15574
- containerRef: 11,
15575
- config: 3
15604
+ app: 1,
15605
+ theme: 2,
15606
+ language: 3,
15607
+ containerRef: 12,
15608
+ config: 0,
15609
+ colors: 11
15576
15610
  });
15577
15611
  }
15578
15612
  };