@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.mjs CHANGED
@@ -7027,32 +7027,16 @@ var scrollHeight = function(node, height2) {
7027
7027
  };
7028
7028
  };
7029
7029
 
7030
- // src/actions/scroll.ts
7031
- var scrollTop = function(node, value) {
7032
- const listener = (top) => {
7033
- node.scrollTo({ top, behavior: "smooth" });
7034
- };
7035
- let timer = 0;
7036
- function on_scroll() {
7037
- clearTimeout(timer);
7038
- timer = window.setTimeout(() => value.set(node.scrollTop), 200);
7039
- }
7040
- node.addEventListener("scroll", on_scroll);
7041
- let unsubscribe = value.subscribe(listener);
7042
- return {
7043
- update(new_value) {
7044
- unsubscribe();
7045
- unsubscribe = (value = new_value).subscribe(listener);
7046
- },
7047
- destroy() {
7048
- clearTimeout(timer);
7049
- node.removeEventListener("scroll", on_scroll);
7050
- unsubscribe();
7051
- }
7052
- };
7053
- };
7054
-
7055
7030
  // src/components/Toolbar/components/constants.ts
7031
+ var default_items = [
7032
+ "clicker",
7033
+ "selector",
7034
+ "pencil",
7035
+ "text",
7036
+ "shapes",
7037
+ "eraser",
7038
+ "clear"
7039
+ ];
7056
7040
  var colors = {
7057
7041
  "#E02020": [224, 32, 32],
7058
7042
  "#F7B500": [247, 181, 0],
@@ -7122,6 +7106,31 @@ var i18n4 = {
7122
7106
  };
7123
7107
  var colorKeys = Object.keys(colors);
7124
7108
 
7109
+ // src/actions/scroll.ts
7110
+ var scrollTop = function(node, value) {
7111
+ const listener = (top) => {
7112
+ node.scrollTo({ top, behavior: "smooth" });
7113
+ };
7114
+ let timer = 0;
7115
+ function on_scroll() {
7116
+ clearTimeout(timer);
7117
+ timer = window.setTimeout(() => value.set(node.scrollTop), 200);
7118
+ }
7119
+ node.addEventListener("scroll", on_scroll);
7120
+ let unsubscribe = value.subscribe(listener);
7121
+ return {
7122
+ update(new_value) {
7123
+ unsubscribe();
7124
+ unsubscribe = (value = new_value).subscribe(listener);
7125
+ },
7126
+ destroy() {
7127
+ clearTimeout(timer);
7128
+ node.removeEventListener("scroll", on_scroll);
7129
+ unsubscribe();
7130
+ }
7131
+ };
7132
+ };
7133
+
7125
7134
  // src/behaviors/icons/visual-studio-code.svg
7126
7135
  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>';
7127
7136
 
@@ -12759,7 +12768,7 @@ function instance67($$self, $$props, $$invalidate) {
12759
12768
  let { computed_height = 0 } = $$props;
12760
12769
  let { scrollable = false } = $$props;
12761
12770
  let { placement = "left" } = $$props;
12762
- let { items = ["clicker", "selector", "pencil", "text", "shapes", "eraser", "clear"] } = $$props;
12771
+ let { items = default_items } = $$props;
12763
12772
  let { hide_apps = false } = $$props;
12764
12773
  let pencil_panel;
12765
12774
  let text_panel;
@@ -13349,7 +13358,7 @@ function instance68($$self, $$props, $$invalidate) {
13349
13358
  }
13350
13359
  if ($$self.$$.dirty & /*config*/
13351
13360
  8192) {
13352
- $$invalidate(5, items = config.items);
13361
+ $$invalidate(5, items = config.items || default_items);
13353
13362
  }
13354
13363
  if ($$self.$$.dirty & /*config*/
13355
13364
  8192) {
@@ -14764,7 +14773,7 @@ function create_if_block_32(ctx) {
14764
14773
  ),
14765
14774
  config: (
14766
14775
  /*config*/
14767
- ctx[3].toolbar
14776
+ ctx[3].toolbar || {}
14768
14777
  )
14769
14778
  }
14770
14779
  });
@@ -14793,7 +14802,7 @@ function create_if_block_32(ctx) {
14793
14802
  if (dirty & /*config*/
14794
14803
  8)
14795
14804
  toolbar_changes.config = /*config*/
14796
- ctx2[3].toolbar;
14805
+ ctx2[3].toolbar || {};
14797
14806
  toolbar.$set(toolbar_changes);
14798
14807
  },
14799
14808
  i(local) {