@netless/fastboard-ui 0.3.0-canary.2 → 0.3.0-canary.5

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
@@ -193,6 +193,9 @@ function get_current_component() {
193
193
  throw new Error("Function called outside component initialization");
194
194
  return current_component;
195
195
  }
196
+ function onMount(fn) {
197
+ get_current_component().$$.on_mount.push(fn);
198
+ }
196
199
  function createEventDispatcher() {
197
200
  const component = get_current_component();
198
201
  return (type, detail) => {
@@ -3506,6 +3509,13 @@ var tippy = function(node, props) {
3506
3509
  }
3507
3510
  };
3508
3511
  };
3512
+ function tippy_hide_all() {
3513
+ document.querySelectorAll("[data-tippy-root]").forEach((el) => {
3514
+ const instance59 = el._tippy;
3515
+ if (instance59)
3516
+ instance59.hide();
3517
+ });
3518
+ }
3509
3519
  var tippy_menu = {
3510
3520
  delay: 0,
3511
3521
  placement: "right-start",
@@ -8515,10 +8525,6 @@ function instance54($$self, $$props, $$invalidate) {
8515
8525
  $:
8516
8526
  $$subscribe_status($$invalidate(15, status = app == null ? void 0 : app.appsStatus));
8517
8527
  }
8518
- if ($$self.$$.dirty[0] & 536870944 | $$self.$$.dirty[1] & 1) {
8519
- $:
8520
- max_scroll = scrollable ? $scroll_height + (32 + 8) * 2 - computed_height : 0;
8521
- }
8522
8528
  if ($$self.$$.dirty[0] & 192) {
8523
8529
  $:
8524
8530
  if (applianceShapes.includes(appliance)) {
@@ -8527,6 +8533,10 @@ function instance54($$self, $$props, $$invalidate) {
8527
8533
  $$invalidate(9, last_shape = shape);
8528
8534
  }
8529
8535
  }
8536
+ if ($$self.$$.dirty[0] & 536870944 | $$self.$$.dirty[1] & 1) {
8537
+ $:
8538
+ max_scroll = scrollable ? $scroll_height + (32 + 8) * 2 - computed_height : 0;
8539
+ }
8530
8540
  };
8531
8541
  return [
8532
8542
  app,
@@ -9801,6 +9811,8 @@ function create_fragment57(ctx) {
9801
9811
  let div1_class_value;
9802
9812
  let div2_class_value;
9803
9813
  let current;
9814
+ let mounted;
9815
+ let dispose;
9804
9816
  playercontrol = new PlayerControl_default({
9805
9817
  props: {
9806
9818
  player: ctx[0],
@@ -9828,6 +9840,10 @@ function create_fragment57(ctx) {
9828
9840
  append(div2, div1);
9829
9841
  mount_component(playercontrol, div1, null);
9830
9842
  current = true;
9843
+ if (!mounted) {
9844
+ dispose = listen(div0, "touchstart", tippy_hide_all, true);
9845
+ mounted = true;
9846
+ }
9831
9847
  },
9832
9848
  p(ctx2, [dirty]) {
9833
9849
  const playercontrol_changes = {};
@@ -9857,6 +9873,8 @@ function create_fragment57(ctx) {
9857
9873
  detach(div2);
9858
9874
  ctx[5](null);
9859
9875
  destroy_component(playercontrol);
9876
+ mounted = false;
9877
+ dispose();
9860
9878
  }
9861
9879
  };
9862
9880
  }
@@ -9865,7 +9883,7 @@ function instance57($$self, $$props, $$invalidate) {
9865
9883
  let { player = null } = $$props;
9866
9884
  let { theme = "light" } = $$props;
9867
9885
  let { language = "en" } = $$props;
9868
- let { ref = void 0 } = $$props;
9886
+ let { containerRef = void 0 } = $$props;
9869
9887
  let container;
9870
9888
  function div0_binding($$value) {
9871
9889
  binding_callbacks[$$value ? "unshift" : "push"](() => {
@@ -9880,8 +9898,8 @@ function instance57($$self, $$props, $$invalidate) {
9880
9898
  $$invalidate(1, theme = $$props2.theme);
9881
9899
  if ("language" in $$props2)
9882
9900
  $$invalidate(2, language = $$props2.language);
9883
- if ("ref" in $$props2)
9884
- $$invalidate(4, ref = $$props2.ref);
9901
+ if ("containerRef" in $$props2)
9902
+ $$invalidate(4, containerRef = $$props2.containerRef);
9885
9903
  };
9886
9904
  $$self.$$.update = () => {
9887
9905
  if ($$self.$$.dirty & 9) {
@@ -9891,16 +9909,21 @@ function instance57($$self, $$props, $$invalidate) {
9891
9909
  }
9892
9910
  if ($$self.$$.dirty & 24) {
9893
9911
  $:
9894
- if (ref)
9895
- ref(container || null);
9912
+ if (containerRef)
9913
+ containerRef(container || null);
9896
9914
  }
9897
9915
  };
9898
- return [player, theme, language, container, ref, div0_binding];
9916
+ return [player, theme, language, container, containerRef, div0_binding];
9899
9917
  }
9900
9918
  var ReplayFastboard = class extends SvelteComponent {
9901
9919
  constructor(options) {
9902
9920
  super();
9903
- init(this, options, instance57, create_fragment57, safe_not_equal, { player: 0, theme: 1, language: 2, ref: 4 });
9921
+ init(this, options, instance57, create_fragment57, safe_not_equal, {
9922
+ player: 0,
9923
+ theme: 1,
9924
+ language: 2,
9925
+ containerRef: 4
9926
+ });
9904
9927
  }
9905
9928
  };
9906
9929
  var ReplayFastboard_default = ReplayFastboard;
@@ -9926,6 +9949,8 @@ function create_fragment58(ctx) {
9926
9949
  let div3_class_value;
9927
9950
  let div4_class_value;
9928
9951
  let current;
9952
+ let mounted;
9953
+ let dispose;
9929
9954
  toolbar = new Toolbar_default({
9930
9955
  props: {
9931
9956
  app: ctx[0],
@@ -9992,6 +10017,10 @@ function create_fragment58(ctx) {
9992
10017
  append(div4, div3);
9993
10018
  mount_component(pagecontrol, div3, null);
9994
10019
  current = true;
10020
+ if (!mounted) {
10021
+ dispose = listen(div0, "touchstart", tippy_hide_all, true);
10022
+ mounted = true;
10023
+ }
9995
10024
  },
9996
10025
  p(ctx2, [dirty]) {
9997
10026
  const toolbar_changes = {};
@@ -10054,6 +10083,8 @@ function create_fragment58(ctx) {
10054
10083
  destroy_component(redoundo);
10055
10084
  destroy_component(zoomcontrol);
10056
10085
  destroy_component(pagecontrol);
10086
+ mounted = false;
10087
+ dispose();
10057
10088
  }
10058
10089
  };
10059
10090
  }
@@ -10062,8 +10093,17 @@ function instance58($$self, $$props, $$invalidate) {
10062
10093
  let { app = null } = $$props;
10063
10094
  let { theme = "light" } = $$props;
10064
10095
  let { language = "en" } = $$props;
10065
- let { ref = void 0 } = $$props;
10096
+ let { containerRef = void 0 } = $$props;
10066
10097
  let container;
10098
+ onMount(() => {
10099
+ if (containerRef) {
10100
+ containerRef(container);
10101
+ return () => {
10102
+ if (containerRef)
10103
+ containerRef(null);
10104
+ };
10105
+ }
10106
+ });
10067
10107
  function div0_binding($$value) {
10068
10108
  binding_callbacks[$$value ? "unshift" : "push"](() => {
10069
10109
  container = $$value;
@@ -10077,8 +10117,8 @@ function instance58($$self, $$props, $$invalidate) {
10077
10117
  $$invalidate(1, theme = $$props2.theme);
10078
10118
  if ("language" in $$props2)
10079
10119
  $$invalidate(2, language = $$props2.language);
10080
- if ("ref" in $$props2)
10081
- $$invalidate(4, ref = $$props2.ref);
10120
+ if ("containerRef" in $$props2)
10121
+ $$invalidate(4, containerRef = $$props2.containerRef);
10082
10122
  };
10083
10123
  $$self.$$.update = () => {
10084
10124
  if ($$self.$$.dirty & 9) {
@@ -10086,18 +10126,18 @@ function instance58($$self, $$props, $$invalidate) {
10086
10126
  if (app && container)
10087
10127
  app.bindContainer(container);
10088
10128
  }
10089
- if ($$self.$$.dirty & 24) {
10090
- $:
10091
- if (ref)
10092
- ref(container || null);
10093
- }
10094
10129
  };
10095
- return [app, theme, language, container, ref, div0_binding];
10130
+ return [app, theme, language, container, containerRef, div0_binding];
10096
10131
  }
10097
10132
  var Fastboard = class extends SvelteComponent {
10098
10133
  constructor(options) {
10099
10134
  super();
10100
- init(this, options, instance58, create_fragment58, safe_not_equal, { app: 0, theme: 1, language: 2, ref: 4 });
10135
+ init(this, options, instance58, create_fragment58, safe_not_equal, {
10136
+ app: 0,
10137
+ theme: 1,
10138
+ language: 2,
10139
+ containerRef: 4
10140
+ });
10101
10141
  }
10102
10142
  };
10103
10143
  var Fastboard_default = Fastboard;