@netless/fastboard-ui 0.3.11 → 0.3.12-alpha.0

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.js CHANGED
@@ -7033,32 +7033,16 @@ var scrollHeight = function(node, height2) {
7033
7033
  };
7034
7034
  };
7035
7035
 
7036
- // src/actions/scroll.ts
7037
- var scrollTop = function(node, value) {
7038
- const listener = (top) => {
7039
- node.scrollTo({ top, behavior: "smooth" });
7040
- };
7041
- let timer = 0;
7042
- function on_scroll() {
7043
- clearTimeout(timer);
7044
- timer = window.setTimeout(() => value.set(node.scrollTop), 200);
7045
- }
7046
- node.addEventListener("scroll", on_scroll);
7047
- let unsubscribe = value.subscribe(listener);
7048
- return {
7049
- update(new_value) {
7050
- unsubscribe();
7051
- unsubscribe = (value = new_value).subscribe(listener);
7052
- },
7053
- destroy() {
7054
- clearTimeout(timer);
7055
- node.removeEventListener("scroll", on_scroll);
7056
- unsubscribe();
7057
- }
7058
- };
7059
- };
7060
-
7061
7036
  // src/components/Toolbar/components/constants.ts
7037
+ var default_items = [
7038
+ "clicker",
7039
+ "selector",
7040
+ "pencil",
7041
+ "text",
7042
+ "shapes",
7043
+ "eraser",
7044
+ "clear"
7045
+ ];
7062
7046
  var colors = {
7063
7047
  "#E02020": [224, 32, 32],
7064
7048
  "#F7B500": [247, 181, 0],
@@ -7128,6 +7112,31 @@ var i18n4 = {
7128
7112
  };
7129
7113
  var colorKeys = Object.keys(colors);
7130
7114
 
7115
+ // src/actions/scroll.ts
7116
+ var scrollTop = function(node, value) {
7117
+ const listener = (top) => {
7118
+ node.scrollTo({ top, behavior: "smooth" });
7119
+ };
7120
+ let timer = 0;
7121
+ function on_scroll() {
7122
+ clearTimeout(timer);
7123
+ timer = window.setTimeout(() => value.set(node.scrollTop), 200);
7124
+ }
7125
+ node.addEventListener("scroll", on_scroll);
7126
+ let unsubscribe = value.subscribe(listener);
7127
+ return {
7128
+ update(new_value) {
7129
+ unsubscribe();
7130
+ unsubscribe = (value = new_value).subscribe(listener);
7131
+ },
7132
+ destroy() {
7133
+ clearTimeout(timer);
7134
+ node.removeEventListener("scroll", on_scroll);
7135
+ unsubscribe();
7136
+ }
7137
+ };
7138
+ };
7139
+
7131
7140
  // src/behaviors/icons/visual-studio-code.svg
7132
7141
  var visual_studio_code_default = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1.01em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 254" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"><defs><linearGradient id="IconifyId-17f872155be-cc766e-5439" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0%" stop-color="%23FFF"/><stop offset="100%" stop-color="%23FFF" stop-opacity="0"/></linearGradient><path id="IconifyId-17f872155be-cc766e-5440" d="M180.828 252.605a15.872 15.872 0 0 0 12.65-.486l52.501-25.262a15.94 15.94 0 0 0 9.025-14.364V41.197a15.939 15.939 0 0 0-9.025-14.363l-52.5-25.263a15.877 15.877 0 0 0-18.115 3.084L74.857 96.35l-43.78-33.232a10.614 10.614 0 0 0-13.56.603L3.476 76.494c-4.63 4.211-4.635 11.495-.012 15.713l37.967 34.638l-37.967 34.637c-4.623 4.219-4.618 11.502.012 15.714l14.041 12.772a10.614 10.614 0 0 0 13.56.604l43.78-33.233l100.507 91.695a15.853 15.853 0 0 0 5.464 3.571Zm10.464-183.649l-76.262 57.889l76.262 57.888V68.956Z"/></defs><mask id="IconifyId-17f872155be-cc766e-5441" fill="%23fff"><use href="%23IconifyId-17f872155be-cc766e-5440"/></mask><path fill="%230065A9" d="M246.135 26.873L193.593 1.575a15.885 15.885 0 0 0-18.123 3.08L3.466 161.482c-4.626 4.219-4.62 11.502.012 15.714l14.05 12.772a10.625 10.625 0 0 0 13.569.604L238.229 33.436c6.949-5.271 16.93-.315 16.93 8.407v-.61a15.938 15.938 0 0 0-9.024-14.36Z" mask="url(%23IconifyId-17f872155be-cc766e-5441)"/><path fill="%23007ACC" d="m246.135 226.816l-52.542 25.298a15.887 15.887 0 0 1-18.123-3.08L3.466 92.207c-4.626-4.218-4.62-11.502.012-15.713l14.05-12.773a10.625 10.625 0 0 1 13.569-.603l207.132 157.135c6.949 5.271 16.93.315 16.93-8.408v.611a15.939 15.939 0 0 1-9.024 14.36Z" mask="url(%23IconifyId-17f872155be-cc766e-5441)"/><path fill="%231F9CF0" d="M193.428 252.134a15.892 15.892 0 0 1-18.125-3.083c5.881 5.88 15.938 1.715 15.938-6.603V11.273c0-8.318-10.057-12.483-15.938-6.602a15.892 15.892 0 0 1 18.125-3.084l52.533 25.263a15.937 15.937 0 0 1 9.03 14.363V212.51c0 6.125-3.51 11.709-9.03 14.363l-52.533 25.262Z" mask="url(%23IconifyId-17f872155be-cc766e-5441)"/><path fill="url(%23IconifyId-17f872155be-cc766e-5439)" fill-opacity=".25" d="M180.828 252.605a15.874 15.874 0 0 0 12.65-.486l52.5-25.263a15.938 15.938 0 0 0 9.026-14.363V41.197a15.939 15.939 0 0 0-9.025-14.363L193.477 1.57a15.877 15.877 0 0 0-18.114 3.084L74.857 96.35l-43.78-33.232a10.614 10.614 0 0 0-13.56.603L3.476 76.494c-4.63 4.211-4.635 11.495-.012 15.713l37.967 34.638l-37.967 34.637c-4.623 4.219-4.618 11.502.012 15.714l14.041 12.772a10.614 10.614 0 0 0 13.56.604l43.78-33.233l100.506 91.695a15.857 15.857 0 0 0 5.465 3.571Zm10.464-183.65l-76.262 57.89l76.262 57.888V68.956Z" mask="url(%23IconifyId-17f872155be-cc766e-5441)"/></svg>';
7133
7142
 
@@ -12765,7 +12774,7 @@ function instance67($$self, $$props, $$invalidate) {
12765
12774
  let { computed_height = 0 } = $$props;
12766
12775
  let { scrollable = false } = $$props;
12767
12776
  let { placement = "left" } = $$props;
12768
- let { items = ["clicker", "selector", "pencil", "text", "shapes", "eraser", "clear"] } = $$props;
12777
+ let { items = default_items } = $$props;
12769
12778
  let { hide_apps = false } = $$props;
12770
12779
  let pencil_panel;
12771
12780
  let text_panel;
@@ -13355,7 +13364,7 @@ function instance68($$self, $$props, $$invalidate) {
13355
13364
  }
13356
13365
  if ($$self.$$.dirty & /*config*/
13357
13366
  8192) {
13358
- $$invalidate(5, items = config.items);
13367
+ $$invalidate(5, items = config.items || default_items);
13359
13368
  }
13360
13369
  if ($$self.$$.dirty & /*config*/
13361
13370
  8192) {
@@ -14770,7 +14779,7 @@ function create_if_block_32(ctx) {
14770
14779
  ),
14771
14780
  config: (
14772
14781
  /*config*/
14773
- ctx[3].toolbar
14782
+ ctx[3].toolbar || {}
14774
14783
  )
14775
14784
  }
14776
14785
  });
@@ -14799,7 +14808,7 @@ function create_if_block_32(ctx) {
14799
14808
  if (dirty & /*config*/
14800
14809
  8)
14801
14810
  toolbar_changes.config = /*config*/
14802
- ctx2[3].toolbar;
14811
+ ctx2[3].toolbar || {};
14803
14812
  toolbar.$set(toolbar_changes);
14804
14813
  },
14805
14814
  i(local) {