@netless/fastboard-ui 1.0.0-canary.7 → 1.0.0-canary.8

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.css CHANGED
@@ -886,4 +886,3 @@
886
886
  .netless-whiteboard:focus-visible {
887
887
  outline: none;
888
888
  }
889
- /*# sourceMappingURL=index.css.map */
package/dist/index.js CHANGED
@@ -1,14 +1,8 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var Tippy = require('tippy.js');
6
4
 
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var Tippy__default = /*#__PURE__*/_interopDefaultLegacy(Tippy);
10
-
11
- // ../../node_modules/.pnpm/svelte@3.49.0/node_modules/svelte/internal/index.mjs
5
+ // ../../node_modules/.pnpm/svelte@3.53.0/node_modules/svelte/internal/index.mjs
12
6
  function noop() {
13
7
  }
14
8
  function assign(tar, src) {
@@ -114,7 +108,9 @@ function insert(target, node, anchor) {
114
108
  target.insertBefore(node, anchor || null);
115
109
  }
116
110
  function detach(node) {
117
- node.parentNode.removeChild(node);
111
+ if (node.parentNode) {
112
+ node.parentNode.removeChild(node);
113
+ }
118
114
  }
119
115
  function destroy_each(iterations, detaching) {
120
116
  for (let i = 0; i < iterations.length; i += 1) {
@@ -176,6 +172,9 @@ function custom_event(type, detail, { bubbles = false, cancelable = false } = {}
176
172
  e.initCustomEvent(type, bubbles, cancelable, detail);
177
173
  return e;
178
174
  }
175
+ function construct_svelte_component(component, props) {
176
+ return new component(props);
177
+ }
179
178
  var current_component;
180
179
  function set_current_component(component) {
181
180
  current_component = component;
@@ -419,13 +418,13 @@ function create_component(block) {
419
418
  block && block.c();
420
419
  }
421
420
  function mount_component(component, target, anchor, customElement) {
422
- const { fragment, on_mount, on_destroy, after_update } = component.$$;
421
+ const { fragment, after_update } = component.$$;
423
422
  fragment && fragment.m(target, anchor);
424
423
  if (!customElement) {
425
424
  add_render_callback(() => {
426
- const new_on_destroy = on_mount.map(run).filter(is_function);
427
- if (on_destroy) {
428
- on_destroy.push(...new_on_destroy);
425
+ const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
426
+ if (component.$$.on_destroy) {
427
+ component.$$.on_destroy.push(...new_on_destroy);
429
428
  } else {
430
429
  run_all(new_on_destroy);
431
430
  }
@@ -456,7 +455,7 @@ function init(component, options, instance62, create_fragment62, not_equal2, pro
456
455
  set_current_component(component);
457
456
  const $$ = component.$$ = {
458
457
  fragment: null,
459
- ctx: null,
458
+ ctx: [],
460
459
  props,
461
460
  update: noop,
462
461
  not_equal: not_equal2,
@@ -509,6 +508,9 @@ var SvelteComponent = class {
509
508
  this.$destroy = noop;
510
509
  }
511
510
  $on(type, callback) {
511
+ if (!is_function(callback)) {
512
+ return noop;
513
+ }
512
514
  const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
513
515
  callbacks.push(callback);
514
516
  return () => {
@@ -3535,7 +3537,7 @@ var Icons = {
3535
3537
  };
3536
3538
  var Icons_default = Icons;
3537
3539
  if (is_client) {
3538
- Tippy__default["default"].setDefaultProps({
3540
+ Tippy.setDefaultProps({
3539
3541
  delay: [1e3, 400],
3540
3542
  duration: 300,
3541
3543
  offset: [0, 11],
@@ -3569,7 +3571,7 @@ if (is_client) {
3569
3571
  });
3570
3572
  }
3571
3573
  var tippy = function(node, props) {
3572
- const instance62 = Tippy__default["default"](node, props);
3574
+ const instance62 = Tippy(node, props);
3573
3575
  return {
3574
3576
  update(props2) {
3575
3577
  instance62.setProps(props2);
@@ -3644,7 +3646,7 @@ function create_else_block_1(ctx) {
3644
3646
  if (!current || dirty & 16) {
3645
3647
  button.disabled = ctx2[4];
3646
3648
  }
3647
- if (dirty & 15) {
3649
+ if (!current || dirty & 15) {
3648
3650
  toggle_class(button, "is-active", ctx2[3]);
3649
3651
  }
3650
3652
  },
@@ -3792,7 +3794,7 @@ function create_else_block2(ctx) {
3792
3794
  placement: ctx2[6],
3793
3795
  className: ctx2[0]
3794
3796
  });
3795
- if (dirty & 15) {
3797
+ if (!current || dirty & 15) {
3796
3798
  toggle_class(button, "is-active", ctx2[3]);
3797
3799
  }
3798
3800
  },
@@ -3902,7 +3904,7 @@ function create_if_block_1(ctx) {
3902
3904
  theme: ctx2[2],
3903
3905
  className: "fastboard-panel"
3904
3906
  });
3905
- if (dirty & 15) {
3907
+ if (!current || dirty & 15) {
3906
3908
  toggle_class(button, "is-active", ctx2[3]);
3907
3909
  }
3908
3910
  if (!current || dirty & 2 && span0_class_value !== (span0_class_value = ctx2[1] + "-triangle")) {
@@ -5502,7 +5504,7 @@ function instance50($$self, $$props, $$invalidate) {
5502
5504
  $$invalidate(4, type = disabled ? "disable" : "normal");
5503
5505
  }
5504
5506
  if ($$self.$$.dirty & 16384) {
5505
- $$subscribe_camera($$invalidate(8, camera = app?.baseCamera));
5507
+ $$subscribe_camera($$invalidate(8, camera = app?.camera));
5506
5508
  }
5507
5509
  if ($$self.$$.dirty & 8) {
5508
5510
  $$invalidate(16, scale = $camera?.scale ?? 1);
@@ -5551,7 +5553,7 @@ var ZoomControl = class extends SvelteComponent {
5551
5553
  };
5552
5554
  var ZoomControl_default = ZoomControl;
5553
5555
 
5554
- // ../../node_modules/.pnpm/svelte@3.49.0/node_modules/svelte/store/index.mjs
5556
+ // ../../node_modules/.pnpm/svelte@3.53.0/node_modules/svelte/store/index.mjs
5555
5557
  var subscriber_queue = [];
5556
5558
  function writable(value, start = noop) {
5557
5559
  let stop;
@@ -6070,7 +6072,7 @@ function create_each_block(key_1, ctx) {
6070
6072
  span = element("span");
6071
6073
  t = space();
6072
6074
  attr(span, "class", "fastboard-toolbar-color-item");
6073
- set_style(span, "background-color", ctx[7], false);
6075
+ set_style(span, "background-color", ctx[7]);
6074
6076
  attr(button, "class", button_class_value = "fastboard-toolbar-btn fastboard-toolbar-color-btn " + ctx[0]);
6075
6077
  attr(button, "data-color-key", ctx[7]);
6076
6078
  button.disabled = ctx[1];
@@ -6321,7 +6323,7 @@ function create_each_block2(key_1, ctx) {
6321
6323
  span = element("span");
6322
6324
  t = space();
6323
6325
  attr(span, "class", "fastboard-toolbar-color-item");
6324
- set_style(span, "background-color", ctx[7], false);
6326
+ set_style(span, "background-color", ctx[7]);
6325
6327
  attr(button, "class", button_class_value = "fastboard-toolbar-btn fastboard-toolbar-color-btn " + ctx[0]);
6326
6328
  attr(button, "data-color-key", ctx[7]);
6327
6329
  button.disabled = ctx[1];
@@ -6468,7 +6470,7 @@ function create_else_block5(ctx) {
6468
6470
  return { props: { theme: ctx2[0] } };
6469
6471
  }
6470
6472
  if (switch_value) {
6471
- switch_instance = new switch_value(switch_props(ctx));
6473
+ switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
6472
6474
  }
6473
6475
  return {
6474
6476
  c() {
@@ -6477,9 +6479,8 @@ function create_else_block5(ctx) {
6477
6479
  switch_instance_anchor = empty();
6478
6480
  },
6479
6481
  m(target, anchor) {
6480
- if (switch_instance) {
6482
+ if (switch_instance)
6481
6483
  mount_component(switch_instance, target, anchor);
6482
- }
6483
6484
  insert(target, switch_instance_anchor, anchor);
6484
6485
  current = true;
6485
6486
  },
@@ -6497,7 +6498,7 @@ function create_else_block5(ctx) {
6497
6498
  check_outros();
6498
6499
  }
6499
6500
  if (switch_value) {
6500
- switch_instance = new switch_value(switch_props(ctx2));
6501
+ switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
6501
6502
  create_component(switch_instance.$$.fragment);
6502
6503
  transition_in(switch_instance.$$.fragment, 1);
6503
6504
  mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
@@ -6539,7 +6540,7 @@ function create_if_block5(ctx) {
6539
6540
  };
6540
6541
  }
6541
6542
  if (switch_value) {
6542
- switch_instance = new switch_value(switch_props(ctx));
6543
+ switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
6543
6544
  }
6544
6545
  return {
6545
6546
  c() {
@@ -6548,9 +6549,8 @@ function create_if_block5(ctx) {
6548
6549
  switch_instance_anchor = empty();
6549
6550
  },
6550
6551
  m(target, anchor) {
6551
- if (switch_instance) {
6552
+ if (switch_instance)
6552
6553
  mount_component(switch_instance, target, anchor);
6553
- }
6554
6554
  insert(target, switch_instance_anchor, anchor);
6555
6555
  current = true;
6556
6556
  },
@@ -6568,7 +6568,7 @@ function create_if_block5(ctx) {
6568
6568
  check_outros();
6569
6569
  }
6570
6570
  if (switch_value) {
6571
- switch_instance = new switch_value(switch_props(ctx2));
6571
+ switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
6572
6572
  create_component(switch_instance.$$.fragment);
6573
6573
  transition_in(switch_instance.$$.fragment, 1);
6574
6574
  mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
@@ -6677,7 +6677,7 @@ function create_each_block3(key_1, ctx) {
6677
6677
  content: tooltip(ctx[6][ctx[12]], ctx[2][ctx[12]]),
6678
6678
  placement: "top"
6679
6679
  });
6680
- if (dirty & 25) {
6680
+ if (!current || dirty & 25) {
6681
6681
  toggle_class(button, "is-active", ctx[13]);
6682
6682
  }
6683
6683
  },
@@ -7508,7 +7508,7 @@ function create_else_block_6(ctx) {
7508
7508
  return { props: { theme: ctx2[1] } };
7509
7509
  }
7510
7510
  if (switch_value) {
7511
- switch_instance = new switch_value(switch_props(ctx));
7511
+ switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
7512
7512
  }
7513
7513
  return {
7514
7514
  c() {
@@ -7517,9 +7517,8 @@ function create_else_block_6(ctx) {
7517
7517
  switch_instance_anchor = empty();
7518
7518
  },
7519
7519
  m(target, anchor) {
7520
- if (switch_instance) {
7520
+ if (switch_instance)
7521
7521
  mount_component(switch_instance, target, anchor);
7522
- }
7523
7522
  insert(target, switch_instance_anchor, anchor);
7524
7523
  current = true;
7525
7524
  },
@@ -7537,7 +7536,7 @@ function create_else_block_6(ctx) {
7537
7536
  check_outros();
7538
7537
  }
7539
7538
  if (switch_value) {
7540
- switch_instance = new switch_value(switch_props(ctx2));
7539
+ switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
7541
7540
  create_component(switch_instance.$$.fragment);
7542
7541
  transition_in(switch_instance.$$.fragment, 1);
7543
7542
  mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
@@ -7579,7 +7578,7 @@ function create_if_block_12(ctx) {
7579
7578
  };
7580
7579
  }
7581
7580
  if (switch_value) {
7582
- switch_instance = new switch_value(switch_props(ctx));
7581
+ switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
7583
7582
  }
7584
7583
  return {
7585
7584
  c() {
@@ -7588,9 +7587,8 @@ function create_if_block_12(ctx) {
7588
7587
  switch_instance_anchor = empty();
7589
7588
  },
7590
7589
  m(target, anchor) {
7591
- if (switch_instance) {
7590
+ if (switch_instance)
7592
7591
  mount_component(switch_instance, target, anchor);
7593
- }
7594
7592
  insert(target, switch_instance_anchor, anchor);
7595
7593
  current = true;
7596
7594
  },
@@ -7608,7 +7606,7 @@ function create_if_block_12(ctx) {
7608
7606
  check_outros();
7609
7607
  }
7610
7608
  if (switch_value) {
7611
- switch_instance = new switch_value(switch_props(ctx2));
7609
+ switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
7612
7610
  create_component(switch_instance.$$.fragment);
7613
7611
  transition_in(switch_instance.$$.fragment, 1);
7614
7612
  mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
@@ -7890,7 +7888,7 @@ function create_else_block_5(ctx) {
7890
7888
  return { props: { theme: ctx2[1] } };
7891
7889
  }
7892
7890
  if (switch_value) {
7893
- switch_instance = new switch_value(switch_props(ctx));
7891
+ switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
7894
7892
  }
7895
7893
  return {
7896
7894
  c() {
@@ -7899,9 +7897,8 @@ function create_else_block_5(ctx) {
7899
7897
  switch_instance_anchor = empty();
7900
7898
  },
7901
7899
  m(target, anchor) {
7902
- if (switch_instance) {
7900
+ if (switch_instance)
7903
7901
  mount_component(switch_instance, target, anchor);
7904
- }
7905
7902
  insert(target, switch_instance_anchor, anchor);
7906
7903
  current = true;
7907
7904
  },
@@ -7919,7 +7916,7 @@ function create_else_block_5(ctx) {
7919
7916
  check_outros();
7920
7917
  }
7921
7918
  if (switch_value) {
7922
- switch_instance = new switch_value(switch_props(ctx2));
7919
+ switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
7923
7920
  create_component(switch_instance.$$.fragment);
7924
7921
  transition_in(switch_instance.$$.fragment, 1);
7925
7922
  mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
@@ -7961,7 +7958,7 @@ function create_if_block_11(ctx) {
7961
7958
  };
7962
7959
  }
7963
7960
  if (switch_value) {
7964
- switch_instance = new switch_value(switch_props(ctx));
7961
+ switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
7965
7962
  }
7966
7963
  return {
7967
7964
  c() {
@@ -7970,9 +7967,8 @@ function create_if_block_11(ctx) {
7970
7967
  switch_instance_anchor = empty();
7971
7968
  },
7972
7969
  m(target, anchor) {
7973
- if (switch_instance) {
7970
+ if (switch_instance)
7974
7971
  mount_component(switch_instance, target, anchor);
7975
- }
7976
7972
  insert(target, switch_instance_anchor, anchor);
7977
7973
  current = true;
7978
7974
  },
@@ -7990,7 +7986,7 @@ function create_if_block_11(ctx) {
7990
7986
  check_outros();
7991
7987
  }
7992
7988
  if (switch_value) {
7993
- switch_instance = new switch_value(switch_props(ctx2));
7989
+ switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
7994
7990
  create_component(switch_instance.$$.fragment);
7995
7991
  transition_in(switch_instance.$$.fragment, 1);
7996
7992
  mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
@@ -9646,7 +9642,7 @@ function create_fragment57(ctx) {
9646
9642
  }
9647
9643
  if (scrollHeight_action && is_function(scrollHeight_action.update) && dirty[0] & 16)
9648
9644
  scrollHeight_action.update.call(null, ctx2[4]);
9649
- if (dirty[0] & 32) {
9645
+ if (!current || dirty[0] & 32) {
9650
9646
  toggle_class(div0, "scrollable", ctx2[5]);
9651
9647
  }
9652
9648
  if (ctx2[5]) {
@@ -10202,12 +10198,7 @@ function create_fragment58(ctx) {
10202
10198
  path = svg_element("path");
10203
10199
  if_block.c();
10204
10200
  attr(div0, "class", div0_class_value = name6 + "-contents " + ctx[1]);
10205
- set_style(
10206
- div0,
10207
- "height",
10208
- ctx[6] ? ctx[7] + "px" : "auto",
10209
- false
10210
- );
10201
+ set_style(div0, "height", ctx[6] ? ctx[7] + "px" : "auto");
10211
10202
  attr(input, "type", "checkbox");
10212
10203
  attr(path, "d", "M0 41H12C14.2091 41 16 39.2091 16 37V5C16 2.79086 14.2091 1 12 1H0");
10213
10204
  attr(path, "stroke", "#000");
@@ -10265,12 +10256,7 @@ function create_fragment58(ctx) {
10265
10256
  attr(div0, "class", div0_class_value);
10266
10257
  }
10267
10258
  if (dirty & 192) {
10268
- set_style(
10269
- div0,
10270
- "height",
10271
- ctx2[6] ? ctx2[7] + "px" : "auto",
10272
- false
10273
- );
10259
+ set_style(div0, "height", ctx2[6] ? ctx2[7] + "px" : "auto");
10274
10260
  }
10275
10261
  if (dirty & 8) {
10276
10262
  input.checked = ctx2[3];
@@ -10291,7 +10277,7 @@ function create_fragment58(ctx) {
10291
10277
  if (!current || dirty & 2 && div1_class_value !== (div1_class_value = name6 + " " + ctx2[1])) {
10292
10278
  attr(div1, "class", div1_class_value);
10293
10279
  }
10294
- if (dirty & 10) {
10280
+ if (!current || dirty & 10) {
10295
10281
  toggle_class(div1, "collapsed", ctx2[3]);
10296
10282
  }
10297
10283
  },
@@ -11401,7 +11387,7 @@ function create_fragment60(ctx) {
11401
11387
  });
11402
11388
  check_outros();
11403
11389
  }
11404
- if (dirty & 1) {
11390
+ if (!current || dirty & 1) {
11405
11391
  toggle_class(div2, "loading", !ctx2[0]);
11406
11392
  }
11407
11393
  },
@@ -11787,7 +11773,7 @@ function create_fragment61(ctx) {
11787
11773
  });
11788
11774
  check_outros();
11789
11775
  }
11790
- if (dirty & 32) {
11776
+ if (!current || dirty & 32) {
11791
11777
  toggle_class(div1, "hidden", !(ctx2[5] === "visible" || ctx2[5] === "toolbar-only"));
11792
11778
  }
11793
11779
  if (ctx2[3].redo_undo?.enable !== false) {
@@ -11828,7 +11814,7 @@ function create_fragment61(ctx) {
11828
11814
  });
11829
11815
  check_outros();
11830
11816
  }
11831
- if (dirty & 32) {
11817
+ if (!current || dirty & 32) {
11832
11818
  toggle_class(div2, "hidden", ctx2[5] !== "visible");
11833
11819
  }
11834
11820
  if (ctx2[3].page_control?.enable !== false) {
@@ -11850,10 +11836,10 @@ function create_fragment61(ctx) {
11850
11836
  });
11851
11837
  check_outros();
11852
11838
  }
11853
- if (dirty & 32) {
11839
+ if (!current || dirty & 32) {
11854
11840
  toggle_class(div3, "hidden", ctx2[5] !== "visible");
11855
11841
  }
11856
- if (dirty & 1) {
11842
+ if (!current || dirty & 1) {
11857
11843
  toggle_class(div4, "loading", !ctx2[0]);
11858
11844
  }
11859
11845
  },
@@ -12093,4 +12079,3 @@ exports.ZoomControl = ZoomControl_default;
12093
12079
  exports.createReplayUI = createReplayUI;
12094
12080
  exports.createUI = createUI;
12095
12081
  exports.stockedApps = stockedApps;
12096
- //# sourceMappingURL=index.js.map