@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.
@@ -6317,32 +6317,16 @@ var scrollHeight = function(node, height2) {
6317
6317
  };
6318
6318
  };
6319
6319
 
6320
- // src/actions/scroll.ts
6321
- var scrollTop = function(node, value) {
6322
- const listener = (top) => {
6323
- node.scrollTo({ top, behavior: "smooth" });
6324
- };
6325
- let timer = 0;
6326
- function on_scroll() {
6327
- clearTimeout(timer);
6328
- timer = window.setTimeout(() => value.set(node.scrollTop), 200);
6329
- }
6330
- node.addEventListener("scroll", on_scroll);
6331
- let unsubscribe = value.subscribe(listener);
6332
- return {
6333
- update(new_value) {
6334
- unsubscribe();
6335
- unsubscribe = (value = new_value).subscribe(listener);
6336
- },
6337
- destroy() {
6338
- clearTimeout(timer);
6339
- node.removeEventListener("scroll", on_scroll);
6340
- unsubscribe();
6341
- }
6342
- };
6343
- };
6344
-
6345
6320
  // src/components/Toolbar/components/constants.ts
6321
+ var default_items = [
6322
+ "clicker",
6323
+ "selector",
6324
+ "pencil",
6325
+ "text",
6326
+ "shapes",
6327
+ "eraser",
6328
+ "clear"
6329
+ ];
6346
6330
  var colors = {
6347
6331
  "#E02020": [224, 32, 32],
6348
6332
  "#F7B500": [247, 181, 0],
@@ -6412,6 +6396,31 @@ var i18n4 = {
6412
6396
  };
6413
6397
  var colorKeys = Object.keys(colors);
6414
6398
 
6399
+ // src/actions/scroll.ts
6400
+ var scrollTop = function(node, value) {
6401
+ const listener = (top) => {
6402
+ node.scrollTo({ top, behavior: "smooth" });
6403
+ };
6404
+ let timer = 0;
6405
+ function on_scroll() {
6406
+ clearTimeout(timer);
6407
+ timer = window.setTimeout(() => value.set(node.scrollTop), 200);
6408
+ }
6409
+ node.addEventListener("scroll", on_scroll);
6410
+ let unsubscribe = value.subscribe(listener);
6411
+ return {
6412
+ update(new_value) {
6413
+ unsubscribe();
6414
+ unsubscribe = (value = new_value).subscribe(listener);
6415
+ },
6416
+ destroy() {
6417
+ clearTimeout(timer);
6418
+ node.removeEventListener("scroll", on_scroll);
6419
+ unsubscribe();
6420
+ }
6421
+ };
6422
+ };
6423
+
6415
6424
  // src/behaviors/icons/visual-studio-code.svg
6416
6425
  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>';
6417
6426
 
@@ -12021,7 +12030,7 @@ function instance67($$self, $$props, $$invalidate) {
12021
12030
  let { computed_height = 0 } = $$props;
12022
12031
  let { scrollable = false } = $$props;
12023
12032
  let { placement = "left" } = $$props;
12024
- let { items = ["clicker", "selector", "pencil", "text", "shapes", "eraser", "clear"] } = $$props;
12033
+ let { items = default_items } = $$props;
12025
12034
  let { hide_apps = false } = $$props;
12026
12035
  let pencil_panel;
12027
12036
  let text_panel;
@@ -12611,7 +12620,7 @@ function instance68($$self, $$props, $$invalidate) {
12611
12620
  }
12612
12621
  if ($$self.$$.dirty & /*config*/
12613
12622
  8192) {
12614
- $$invalidate(5, items = config.items);
12623
+ $$invalidate(5, items = config.items || default_items);
12615
12624
  }
12616
12625
  if ($$self.$$.dirty & /*config*/
12617
12626
  8192) {
@@ -14020,7 +14029,7 @@ function create_if_block_32(ctx) {
14020
14029
  ),
14021
14030
  config: (
14022
14031
  /*config*/
14023
- ctx[3].toolbar
14032
+ ctx[3].toolbar || {}
14024
14033
  )
14025
14034
  }
14026
14035
  });
@@ -14049,7 +14058,7 @@ function create_if_block_32(ctx) {
14049
14058
  if (dirty & /*config*/
14050
14059
  8)
14051
14060
  toolbar_changes.config = /*config*/
14052
- ctx2[3].toolbar;
14061
+ ctx2[3].toolbar || {};
14053
14062
  toolbar.$set(toolbar_changes);
14054
14063
  },
14055
14064
  i(local) {