@netless/fastboard-ui 0.3.0-canary.3 → 0.3.0-canary.6

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.
@@ -3548,6 +3548,13 @@ var tippy = function(node, props) {
3548
3548
  }
3549
3549
  };
3550
3550
  };
3551
+ function tippy_hide_all() {
3552
+ document.querySelectorAll("[data-tippy-root]").forEach((el) => {
3553
+ const instance59 = el._tippy;
3554
+ if (instance59)
3555
+ instance59.hide();
3556
+ });
3557
+ }
3551
3558
  var tippy_menu = {
3552
3559
  delay: 0,
3553
3560
  placement: "right-start",
@@ -8706,10 +8713,6 @@ function instance54($$self, $$props, $$invalidate) {
8706
8713
  $:
8707
8714
  $$subscribe_status($$invalidate(15, status = app == null ? void 0 : app.appsStatus));
8708
8715
  }
8709
- if ($$self.$$.dirty[0] & 536870944 | $$self.$$.dirty[1] & 1) {
8710
- $:
8711
- max_scroll = scrollable ? $scroll_height + (32 + 8) * 2 - computed_height : 0;
8712
- }
8713
8716
  if ($$self.$$.dirty[0] & 192) {
8714
8717
  $:
8715
8718
  if (applianceShapes.includes(appliance)) {
@@ -8718,6 +8721,10 @@ function instance54($$self, $$props, $$invalidate) {
8718
8721
  $$invalidate(9, last_shape = shape);
8719
8722
  }
8720
8723
  }
8724
+ if ($$self.$$.dirty[0] & 536870944 | $$self.$$.dirty[1] & 1) {
8725
+ $:
8726
+ max_scroll = scrollable ? $scroll_height + (32 + 8) * 2 - computed_height : 0;
8727
+ }
8721
8728
  };
8722
8729
  return [
8723
8730
  app,
@@ -10020,6 +10027,7 @@ import {
10020
10027
  element as element13,
10021
10028
  init as init57,
10022
10029
  insert as insert56,
10030
+ listen as listen7,
10023
10031
  mount_component as mount_component9,
10024
10032
  safe_not_equal as safe_not_equal57,
10025
10033
  space as space10,
@@ -10027,6 +10035,7 @@ import {
10027
10035
  transition_in as transition_in11,
10028
10036
  transition_out as transition_out11
10029
10037
  } from "svelte/internal";
10038
+ import { onMount } from "svelte";
10030
10039
  function create_fragment57(ctx) {
10031
10040
  let div2;
10032
10041
  let div0;
@@ -10037,6 +10046,8 @@ function create_fragment57(ctx) {
10037
10046
  let div1_class_value;
10038
10047
  let div2_class_value;
10039
10048
  let current;
10049
+ let mounted;
10050
+ let dispose;
10040
10051
  playercontrol = new PlayerControl_default({
10041
10052
  props: {
10042
10053
  player: ctx[0],
@@ -10064,6 +10075,10 @@ function create_fragment57(ctx) {
10064
10075
  append56(div2, div1);
10065
10076
  mount_component9(playercontrol, div1, null);
10066
10077
  current = true;
10078
+ if (!mounted) {
10079
+ dispose = listen7(div0, "touchstart", tippy_hide_all, true);
10080
+ mounted = true;
10081
+ }
10067
10082
  },
10068
10083
  p(ctx2, [dirty]) {
10069
10084
  const playercontrol_changes = {};
@@ -10093,6 +10108,8 @@ function create_fragment57(ctx) {
10093
10108
  detach56(div2);
10094
10109
  ctx[5](null);
10095
10110
  destroy_component9(playercontrol);
10111
+ mounted = false;
10112
+ dispose();
10096
10113
  }
10097
10114
  };
10098
10115
  }
@@ -10103,6 +10120,15 @@ function instance57($$self, $$props, $$invalidate) {
10103
10120
  let { language = "en" } = $$props;
10104
10121
  let { containerRef = void 0 } = $$props;
10105
10122
  let container;
10123
+ onMount(() => {
10124
+ if (containerRef) {
10125
+ containerRef(container);
10126
+ return () => {
10127
+ if (containerRef)
10128
+ containerRef(null);
10129
+ };
10130
+ }
10131
+ });
10106
10132
  function div0_binding($$value) {
10107
10133
  binding_callbacks3[$$value ? "unshift" : "push"](() => {
10108
10134
  container = $$value;
@@ -10122,13 +10148,13 @@ function instance57($$self, $$props, $$invalidate) {
10122
10148
  $$self.$$.update = () => {
10123
10149
  if ($$self.$$.dirty & 9) {
10124
10150
  $:
10125
- if (player && container)
10126
- player.bindContainer(container);
10127
- }
10128
- if ($$self.$$.dirty & 24) {
10129
- $:
10130
- if (containerRef)
10131
- containerRef(container || null);
10151
+ try {
10152
+ if (player && container)
10153
+ player.bindContainer(container);
10154
+ } catch (err) {
10155
+ console.error("[fastboard] An error occurred while binding container");
10156
+ console.error(err);
10157
+ }
10132
10158
  }
10133
10159
  };
10134
10160
  return [player, theme, language, container, containerRef, div0_binding];
@@ -10158,6 +10184,7 @@ import {
10158
10184
  element as element14,
10159
10185
  init as init58,
10160
10186
  insert as insert57,
10187
+ listen as listen8,
10161
10188
  mount_component as mount_component10,
10162
10189
  safe_not_equal as safe_not_equal58,
10163
10190
  space as space11,
@@ -10165,6 +10192,7 @@ import {
10165
10192
  transition_in as transition_in12,
10166
10193
  transition_out as transition_out12
10167
10194
  } from "svelte/internal";
10195
+ import { onMount as onMount2 } from "svelte";
10168
10196
  function create_fragment58(ctx) {
10169
10197
  let div4;
10170
10198
  let div0;
@@ -10185,6 +10213,8 @@ function create_fragment58(ctx) {
10185
10213
  let div3_class_value;
10186
10214
  let div4_class_value;
10187
10215
  let current;
10216
+ let mounted;
10217
+ let dispose;
10188
10218
  toolbar = new Toolbar_default({
10189
10219
  props: {
10190
10220
  app: ctx[0],
@@ -10251,6 +10281,10 @@ function create_fragment58(ctx) {
10251
10281
  append57(div4, div3);
10252
10282
  mount_component10(pagecontrol, div3, null);
10253
10283
  current = true;
10284
+ if (!mounted) {
10285
+ dispose = listen8(div0, "touchstart", tippy_hide_all, true);
10286
+ mounted = true;
10287
+ }
10254
10288
  },
10255
10289
  p(ctx2, [dirty]) {
10256
10290
  const toolbar_changes = {};
@@ -10313,6 +10347,8 @@ function create_fragment58(ctx) {
10313
10347
  destroy_component10(redoundo);
10314
10348
  destroy_component10(zoomcontrol);
10315
10349
  destroy_component10(pagecontrol);
10350
+ mounted = false;
10351
+ dispose();
10316
10352
  }
10317
10353
  };
10318
10354
  }
@@ -10323,6 +10359,15 @@ function instance58($$self, $$props, $$invalidate) {
10323
10359
  let { language = "en" } = $$props;
10324
10360
  let { containerRef = void 0 } = $$props;
10325
10361
  let container;
10362
+ onMount2(() => {
10363
+ if (containerRef) {
10364
+ containerRef(container);
10365
+ return () => {
10366
+ if (containerRef)
10367
+ containerRef(null);
10368
+ };
10369
+ }
10370
+ });
10326
10371
  function div0_binding($$value) {
10327
10372
  binding_callbacks4[$$value ? "unshift" : "push"](() => {
10328
10373
  container = $$value;
@@ -10342,13 +10387,13 @@ function instance58($$self, $$props, $$invalidate) {
10342
10387
  $$self.$$.update = () => {
10343
10388
  if ($$self.$$.dirty & 9) {
10344
10389
  $:
10345
- if (app && container)
10346
- app.bindContainer(container);
10347
- }
10348
- if ($$self.$$.dirty & 24) {
10349
- $:
10350
- if (containerRef)
10351
- containerRef(container || null);
10390
+ try {
10391
+ if (app && container)
10392
+ app.bindContainer(container);
10393
+ } catch (err) {
10394
+ console.error("[fastboard] An error occurred while binding container");
10395
+ console.error(err);
10396
+ }
10352
10397
  }
10353
10398
  };
10354
10399
  return [app, theme, language, container, containerRef, div0_binding];