@grame/faust-web-component 0.3.7 → 0.3.8

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/README.md CHANGED
@@ -76,9 +76,13 @@ effect = dm.freeverb_demo;
76
76
 
77
77
  to get a polyphonic clarinet instrument with 16 voices and a global reverb effect.
78
78
 
79
+ ### HTML example page
80
+
81
+ The HTML [index.html](./index.html) example page can be copied and tested in `dist` folder.
82
+
79
83
  ## NPM package
80
84
 
81
- A [npm package](https://www.npmjs.com/package/@grame/faust-web-component) can be used with the CDN link: https://cdn.jsdelivr.net/npm/@grame/faust-web-component@0.3.5/dist/faust-web-component.js (possibly update the version number).
85
+ A [npm package](https://www.npmjs.com/package/@grame/faust-web-component) can be used with the CDN link: https://cdn.jsdelivr.net/npm/@grame/faust-web-component@0.3.8/dist/faust-web-component.js (possibly update the version number).
82
86
 
83
87
  Here is an HTML example using this model:
84
88
 
@@ -97,7 +101,7 @@ process = vgroup("Oscillator", os.osc(freq1) * vol, os.osc(freq2) * vol);
97
101
  -->
98
102
  </faust-editor>
99
103
 
100
- <script src="https://cdn.jsdelivr.net/npm/@grame/faust-web-component@0.3.5/dist/faust-web-component.js"></script>
104
+ <script src="https://cdn.jsdelivr.net/npm/@grame/faust-web-component@0.3.8/dist/faust-web-component.js"></script>
101
105
  ```
102
106
 
103
107
  ## Demo
@@ -3402,18 +3402,19 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
3402
3402
  margin-top: auto;
3403
3403
  }
3404
3404
  .faust-ui-component.faust-ui-component-radio > .faust-ui-component-radio-group {
3405
- flex: 0 0 auto;
3405
+ flex: 0 1 auto;
3406
3406
  margin-bottom: auto;
3407
3407
  border-width: 1px;
3408
3408
  border-radius: 4px;
3409
3409
  padding: 2px 4px;
3410
3410
  width: calc(100% - 8px);
3411
+ overflow: auto;
3411
3412
  }
3412
3413
  .faust-ui-component.faust-ui-component-radio > .faust-ui-component-radio-group > div {
3413
3414
  text-overflow: ellipsis;
3414
3415
  white-space: nowrap;
3415
3416
  overflow: hidden;
3416
- }`, "", { "version": 3, "sources": ["webpack://./src/components/Radio.scss"], "names": [], "mappings": "AAAA;EACI,mBAAA;AACJ;AAAI;EACI,cAAA;EACA,gBAAA;AAER;AAAI;EACI,cAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;EACA,gBAAA;EACA,uBAAA;AAER;AADQ;EACI,uBAAA;EACA,mBAAA;EACA,gBAAA;AAGZ", "sourcesContent": [".faust-ui-component.faust-ui-component-radio {\n align-items: center;\n & > .faust-ui-component-label {\n flex: 0 0 auto;\n margin-top: auto;\n }\n & > .faust-ui-component-radio-group {\n flex: 0 0 auto;\n margin-bottom: auto;\n border-width: 1px;\n border-radius: 4px;\n padding: 2px 4px;\n width: calc(100% - 8px);\n & > div {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n }\n }\n}"], "sourceRoot": "" }]);
3417
+ }`, "", { "version": 3, "sources": ["webpack://./src/components/Radio.scss"], "names": [], "mappings": "AAAA;EACI,mBAAA;AACJ;AAAI;EACI,cAAA;EACA,gBAAA;AAER;AAAI;EACI,cAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;EACA,gBAAA;EACA,uBAAA;EACA,cAAA;AAER;AADQ;EACI,uBAAA;EACA,mBAAA;EACA,gBAAA;AAGZ", "sourcesContent": [".faust-ui-component.faust-ui-component-radio {\n align-items: center;\n & > .faust-ui-component-label {\n flex: 0 0 auto;\n margin-top: auto;\n }\n & > .faust-ui-component-radio-group {\n flex: 0 1 auto;\n margin-bottom: auto;\n border-width: 1px;\n border-radius: 4px;\n padding: 2px 4px;\n width: calc(100% - 8px);\n overflow: auto;\n & > div {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n }\n }\n}"], "sourceRoot": "" }]);
3417
3418
  const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___;
3418
3419
  }
3419
3420
  ),
@@ -3793,7 +3794,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
3793
3794
  constructor(options) {
3794
3795
  this.componentMap = {};
3795
3796
  this.paramChangeByUI = (path, value) => {
3796
- if (!this.hostWindow) return;
3797
+ if (!this.hostWindow)
3798
+ return;
3797
3799
  this.hostWindow.postMessage({ path, value, type: "param" }, "*");
3798
3800
  };
3799
3801
  const { root, ui: uiIn, listenWindowResize, listenWindowMessage } = options;
@@ -3809,7 +3811,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
3809
3811
  const { data, source } = e;
3810
3812
  this.hostWindow = source;
3811
3813
  const { type } = data;
3812
- if (!type) return;
3814
+ if (!type)
3815
+ return;
3813
3816
  if (type === "ui") {
3814
3817
  this.ui = data.ui;
3815
3818
  } else if (type === "param") {
@@ -3849,14 +3852,17 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
3849
3852
  * This method should be called by components to register itself to map.
3850
3853
  */
3851
3854
  register(path, item) {
3852
- if (this.componentMap[path]) this.componentMap[path].push(item);
3853
- else this.componentMap[path] = [item];
3855
+ if (this.componentMap[path])
3856
+ this.componentMap[path].push(item);
3857
+ else
3858
+ this.componentMap[path] = [item];
3854
3859
  }
3855
3860
  /**
3856
3861
  * Notify the component to change its value.
3857
3862
  */
3858
3863
  paramChangeByDSP(path, value) {
3859
- if (this.componentMap[path]) this.componentMap[path].forEach((item) => item.setState({ value }));
3864
+ if (this.componentMap[path])
3865
+ this.componentMap[path].forEach((item) => item.setState({ value }));
3860
3866
  }
3861
3867
  /**
3862
3868
  * Calculate UI layout in grid then calculate grid size.
@@ -3880,7 +3886,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
3880
3886
  * Force recalculate grid size and resize UI
3881
3887
  */
3882
3888
  resize() {
3883
- if (!this.faustUIRoot) return;
3889
+ if (!this.faustUIRoot)
3890
+ return;
3884
3891
  this.calcGrid();
3885
3892
  this.faustUIRoot.setState({ style: { grid: this.grid } });
3886
3893
  }
@@ -3888,12 +3895,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
3888
3895
  filter(ui) {
3889
3896
  const callback = (items, item) => {
3890
3897
  var _a2;
3891
- if (item.type === "soundfile") return items;
3898
+ if (item.type === "soundfile")
3899
+ return items;
3892
3900
  if (item.type === "hgroup" || item.type === "vgroup" || item.type === "tgroup") {
3893
3901
  items.push(__spreadProps(__spreadValues({}, item), { items: item.items.reduce(callback, []) }));
3894
3902
  return items;
3895
3903
  }
3896
- if ((_a2 = item.meta) == null ? void 0 : _a2.find((m) => m.hidden && m.hidden === "1")) return items;
3904
+ if ((_a2 = item.meta) == null ? void 0 : _a2.find((m) => m.hidden && m.hidden === "1"))
3905
+ return items;
3897
3906
  items.push(item);
3898
3907
  return items;
3899
3908
  };
@@ -3989,8 +3998,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
3989
3998
  if (stateKey in this.state && this.state[stateKey] !== stateValue) {
3990
3999
  this.state[stateKey] = stateValue;
3991
4000
  shouldUpdate = true;
3992
- } else return;
3993
- if (shouldUpdate) this.emit(stateKey, this.state[stateKey]);
4001
+ } else
4002
+ return;
4003
+ if (shouldUpdate)
4004
+ this.emit(stateKey, this.state[stateKey]);
3994
4005
  }
3995
4006
  }
3996
4007
  /**
@@ -3998,8 +4009,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
3998
4009
  * schedule what you need to do in next render tick in `raf` callback
3999
4010
  */
4000
4011
  schedule(func) {
4001
- if (this.tasks.indexOf(func) === -1) this.tasks.push(func);
4002
- if (this.$raf) return;
4012
+ if (this.tasks.indexOf(func) === -1)
4013
+ this.tasks.push(func);
4014
+ if (this.$raf)
4015
+ return;
4003
4016
  this.$raf = window.requestAnimationFrame(this.raf);
4004
4017
  }
4005
4018
  }
@@ -4050,7 +4063,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4050
4063
  }
4051
4064
  return a2;
4052
4065
  };
4053
- const _AbstractItem = class _AbstractItem2 extends _AbstractComponent__WEBPACK_IMPORTED_MODULE_0__["default"] {
4066
+ const _AbstractItem = class extends _AbstractComponent__WEBPACK_IMPORTED_MODULE_0__["default"] {
4054
4067
  /**
4055
4068
  * Initiate default state with incoming state.
4056
4069
  */
@@ -4138,14 +4151,16 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4138
4151
  const prevValue = this.state.value;
4139
4152
  this.handleMouseOrTouchDown({ pointerId, x: fromX, y: fromY, originalEvent: e });
4140
4153
  const handlePointerMove = (e2) => {
4141
- if (e2.pointerId !== pointerId) return;
4154
+ if (e2.pointerId !== pointerId)
4155
+ return;
4142
4156
  e2.preventDefault();
4143
4157
  const x = e2.clientX - rect.left;
4144
4158
  const y2 = e2.clientY - rect.top;
4145
4159
  this.handleMouseOrTouchMove({ pointerId, prevValue, x, y: y2, fromX, fromY, movementX: e2.movementX, movementY: e2.movementY, originalEvent: e2 });
4146
4160
  };
4147
4161
  const handlePointerUp = (e2) => {
4148
- if (e2.pointerId !== pointerId) return;
4162
+ if (e2.pointerId !== pointerId)
4163
+ return;
4149
4164
  e2.preventDefault();
4150
4165
  const x = e2.clientX - rect.left;
4151
4166
  const y2 = e2.clientY - rect.top;
@@ -4165,16 +4180,19 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4165
4180
  this.handleFocusIn = (e) => this.setState({ focus: true });
4166
4181
  this.handleFocusOut = (e) => this.setState({ focus: false });
4167
4182
  this.state.style = __spreadValues(__spreadValues({}, this.defaultProps.style), props.style);
4168
- if (this.state.emitter) this.state.emitter.register(this.state.address, this);
4183
+ if (this.state.emitter)
4184
+ this.state.emitter.register(this.state.address, this);
4169
4185
  }
4170
4186
  /**
4171
4187
  * Get a nearest valid number
4172
4188
  */
4173
4189
  toValidNumber(value) {
4174
4190
  const { min, max, step } = this.state;
4175
- if (typeof min !== "number" || typeof max !== "number") return value;
4191
+ if (typeof min !== "number" || typeof max !== "number")
4192
+ return value;
4176
4193
  const v = Math.min(max, Math.max(min, value));
4177
- if (!step) return v;
4194
+ if (!step)
4195
+ return v;
4178
4196
  return min + Math.floor((v - min) / step) * step;
4179
4197
  }
4180
4198
  /**
@@ -4183,14 +4201,16 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4183
4201
  setValue(valueIn) {
4184
4202
  const value = this.toValidNumber(valueIn);
4185
4203
  const changed = this.setState({ value });
4186
- if (changed) this.change(value);
4204
+ if (changed)
4205
+ this.change(value);
4187
4206
  return changed;
4188
4207
  }
4189
4208
  /**
4190
4209
  * Send value to DSP
4191
4210
  */
4192
4211
  change(valueIn) {
4193
- if (this.state.emitter) this.state.emitter.paramChangeByUI(this.state.address, typeof valueIn === "number" ? valueIn : this.state.value);
4212
+ if (this.state.emitter)
4213
+ this.state.emitter.paramChangeByUI(this.state.address, typeof valueIn === "number" ? valueIn : this.state.value);
4194
4214
  }
4195
4215
  /**
4196
4216
  * set internal state and fire events for UI parts subscribed
@@ -4212,8 +4232,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4212
4232
  } else if (stateKey in this.state && this.state[stateKey] !== stateValue) {
4213
4233
  this.state[stateKey] = stateValue;
4214
4234
  shouldUpdate = true;
4215
- } else return false;
4216
- if (shouldUpdate) this.emit(stateKey, this.state[stateKey]);
4235
+ } else
4236
+ return false;
4237
+ if (shouldUpdate)
4238
+ this.emit(stateKey, this.state[stateKey]);
4217
4239
  }
4218
4240
  return shouldUpdate;
4219
4241
  }
@@ -4226,7 +4248,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4226
4248
  this.container.className = ["faust-ui-component", "faust-ui-component-" + this.className].join(" ");
4227
4249
  this.container.tabIndex = 1;
4228
4250
  this.container.id = this.state.address;
4229
- if (this.state.tooltip) this.container.title = this.state.tooltip;
4251
+ if (this.state.tooltip)
4252
+ this.container.title = this.state.tooltip;
4230
4253
  this.label = document.createElement("div");
4231
4254
  this.label.className = "faust-ui-component-label";
4232
4255
  this.labelCanvas = document.createElement("canvas");
@@ -4247,7 +4270,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4247
4270
  const canvas = this.labelCanvas;
4248
4271
  const ratio = window.devicePixelRatio || 1;
4249
4272
  let { width, height } = this.label.getBoundingClientRect();
4250
- if (!width || !height) return this;
4273
+ if (!width || !height)
4274
+ return this;
4251
4275
  width = Math.floor(width);
4252
4276
  height = Math.floor(height);
4253
4277
  const scaledWidth = Math.floor(width * ratio);
@@ -4287,8 +4311,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4287
4311
  const { type, max, min, step, enums } = this.state;
4288
4312
  const maxSteps = type === "enum" ? enums.length : type === "int" ? max - min : (max - min) / step;
4289
4313
  if (step) {
4290
- if (type === "enum") return enums.length;
4291
- if (type === "int") return Math.min(Math.floor((max - min) / (Math.round(step) || 1)), maxSteps);
4314
+ if (type === "enum")
4315
+ return enums.length;
4316
+ if (type === "int")
4317
+ return Math.min(Math.floor((max - min) / (Math.round(step) || 1)), maxSteps);
4292
4318
  return Math.floor((max - min) / step);
4293
4319
  }
4294
4320
  return maxSteps;
@@ -4298,11 +4324,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4298
4324
  */
4299
4325
  get distance() {
4300
4326
  const { type, max, min, value, enums, scale } = this.state;
4301
- return _AbstractItem2.getDistance({ type, max, min, value, enums, scale });
4327
+ return _AbstractItem.getDistance({ type, max, min, value, enums, scale });
4302
4328
  }
4303
4329
  static getDistance(state) {
4304
4330
  const { type, max, min, value, enums, scale } = state;
4305
- if (type === "enum") return value / (enums.length - 1);
4331
+ if (type === "enum")
4332
+ return value / (enums.length - 1);
4306
4333
  const v = scale === "exp" ? (0, _utils__WEBPACK_IMPORTED_MODULE_1__.normLog)(value, min, max) : scale === "log" ? (0, _utils__WEBPACK_IMPORTED_MODULE_1__.normExp)(value, min, max) : value;
4307
4334
  return (0, _utils__WEBPACK_IMPORTED_MODULE_1__.normalize)(v, min, max);
4308
4335
  }
@@ -4315,7 +4342,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4315
4342
  return full / stepsCount;
4316
4343
  }
4317
4344
  };
4318
- _AbstractItem.defaultProps = {
4345
+ let AbstractItem = _AbstractItem;
4346
+ AbstractItem.defaultProps = {
4319
4347
  value: 0,
4320
4348
  active: true,
4321
4349
  focus: false,
@@ -4330,7 +4358,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4330
4358
  step: 0.01,
4331
4359
  style: { width: 45, height: 15, left: 0, top: 0, labelcolor: "rgba(226, 222, 255, 0.5)" }
4332
4360
  };
4333
- let AbstractItem = _AbstractItem;
4334
4361
  }
4335
4362
  ),
4336
4363
  /***/
@@ -4566,7 +4593,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4566
4593
  this.children = [];
4567
4594
  const { style, type, items, emitter, isRoot } = this.state;
4568
4595
  const { grid, left, top: top2, width, height } = style;
4569
- if (!this.state.isRoot) this.label.style.height = `${grid * 0.3}px`;
4596
+ if (!this.state.isRoot)
4597
+ this.label.style.height = `${grid * 0.3}px`;
4570
4598
  this.container.style.left = `${left * grid}px`;
4571
4599
  this.container.style.top = `${top2 * grid}px`;
4572
4600
  this.container.style.width = `${width * grid}px`;
@@ -4575,11 +4603,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4575
4603
  items.forEach((item) => {
4576
4604
  if (item.type.endsWith("group")) {
4577
4605
  const component = Group.getComponent(item, emitter, grid);
4578
- if (component) this.children.push(component);
4606
+ if (component)
4607
+ this.children.push(component);
4579
4608
  } else {
4580
4609
  const ioItem = item;
4581
4610
  const itemComponent = Group.getComponent(ioItem, this.state.emitter, grid);
4582
- if (itemComponent) this.children.push(itemComponent);
4611
+ if (itemComponent)
4612
+ this.children.push(itemComponent);
4583
4613
  }
4584
4614
  });
4585
4615
  if (type === "tgroup") {
@@ -4599,7 +4629,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4599
4629
  const groups = [];
4600
4630
  for (let j = 0; j < this.container.children.length; j++) {
4601
4631
  const element = this.container.children[j];
4602
- if (j > 1) groups.push(element);
4632
+ if (j > 1)
4633
+ groups.push(element);
4603
4634
  }
4604
4635
  for (let j = 0; j < groups.length; j++) {
4605
4636
  const element = groups[j];
@@ -4608,8 +4639,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4608
4639
  for (let j = 0; j < this.tabs.children.length; j++) {
4609
4640
  const e = this.tabs.children[j];
4610
4641
  if (i2 !== j) {
4611
- if (e.classList.contains("active")) e.classList.remove("active");
4612
- } else e.classList.add("active");
4642
+ if (e.classList.contains("active"))
4643
+ e.classList.remove("active");
4644
+ } else
4645
+ e.classList.add("active");
4613
4646
  }
4614
4647
  });
4615
4648
  this.tabs.appendChild(tab);
@@ -4619,7 +4652,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4619
4652
  }
4620
4653
  static parseMeta(metaIn) {
4621
4654
  const metaObject = {};
4622
- if (!metaIn) return { metaObject };
4655
+ if (!metaIn)
4656
+ return { metaObject };
4623
4657
  metaIn.forEach((m) => Object.assign(metaObject, m));
4624
4658
  if (metaObject.style) {
4625
4659
  const enumsRegex = /\{(?:(?:'|_|-)(.+?)(?:'|_|-):([-+]?[0-9]*\.?[0-9]+?);)+(?:(?:'|_|-)(.+?)(?:'|_|-):([-+]?[0-9]*\.?[0-9]+?))\}/;
@@ -4681,19 +4715,32 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4681
4715
  step: "step" in item ? +item.step : 1,
4682
4716
  value: "init" in item ? +item.init || 0 : 0
4683
4717
  };
4684
- if (type === "button") return new _Button__WEBPACK_IMPORTED_MODULE_5__["default"](props);
4685
- if (type === "checkbox") return new _Checkbox__WEBPACK_IMPORTED_MODULE_6__["default"](props);
4686
- if (type === "nentry") return new _Nentry__WEBPACK_IMPORTED_MODULE_3__["default"](props);
4687
- if (type === "soundfile") return new _Soundfile__WEBPACK_IMPORTED_MODULE_4__["default"](props);
4688
- if (type === "knob") return new _Knob__WEBPACK_IMPORTED_MODULE_7__["default"](props);
4689
- if (type === "menu") return new _Menu__WEBPACK_IMPORTED_MODULE_8__["default"](props);
4690
- if (type === "radio") return new _Radio__WEBPACK_IMPORTED_MODULE_9__["default"](props);
4691
- if (type === "hslider") return new _HSlider__WEBPACK_IMPORTED_MODULE_1__["default"](props);
4692
- if (type === "vslider") return new _VSlider__WEBPACK_IMPORTED_MODULE_2__["default"](props);
4693
- if (type === "hbargraph") return new _HBargraph__WEBPACK_IMPORTED_MODULE_12__["default"](props);
4694
- if (type === "vbargraph") return new _VBargraph__WEBPACK_IMPORTED_MODULE_13__["default"](props);
4695
- if (type === "numerical") return new _Numerical__WEBPACK_IMPORTED_MODULE_11__["default"](props);
4696
- if (type === "led") return new _Led__WEBPACK_IMPORTED_MODULE_10__["default"](props);
4718
+ if (type === "button")
4719
+ return new _Button__WEBPACK_IMPORTED_MODULE_5__["default"](props);
4720
+ if (type === "checkbox")
4721
+ return new _Checkbox__WEBPACK_IMPORTED_MODULE_6__["default"](props);
4722
+ if (type === "nentry")
4723
+ return new _Nentry__WEBPACK_IMPORTED_MODULE_3__["default"](props);
4724
+ if (type === "soundfile")
4725
+ return new _Soundfile__WEBPACK_IMPORTED_MODULE_4__["default"](props);
4726
+ if (type === "knob")
4727
+ return new _Knob__WEBPACK_IMPORTED_MODULE_7__["default"](props);
4728
+ if (type === "menu")
4729
+ return new _Menu__WEBPACK_IMPORTED_MODULE_8__["default"](props);
4730
+ if (type === "radio")
4731
+ return new _Radio__WEBPACK_IMPORTED_MODULE_9__["default"](props);
4732
+ if (type === "hslider")
4733
+ return new _HSlider__WEBPACK_IMPORTED_MODULE_1__["default"](props);
4734
+ if (type === "vslider")
4735
+ return new _VSlider__WEBPACK_IMPORTED_MODULE_2__["default"](props);
4736
+ if (type === "hbargraph")
4737
+ return new _HBargraph__WEBPACK_IMPORTED_MODULE_12__["default"](props);
4738
+ if (type === "vbargraph")
4739
+ return new _VBargraph__WEBPACK_IMPORTED_MODULE_13__["default"](props);
4740
+ if (type === "numerical")
4741
+ return new _Numerical__WEBPACK_IMPORTED_MODULE_11__["default"](props);
4742
+ if (type === "led")
4743
+ return new _Led__WEBPACK_IMPORTED_MODULE_10__["default"](props);
4697
4744
  return null;
4698
4745
  }
4699
4746
  setState(newState) {
@@ -4712,8 +4759,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4712
4759
  } else if (stateKey in this.state && this.state[stateKey] !== stateValue) {
4713
4760
  this.state[stateKey] = stateValue;
4714
4761
  shouldUpdate = true;
4715
- } else return;
4716
- if (shouldUpdate) this.emit(stateKey, this.state[stateKey]);
4762
+ } else
4763
+ return;
4764
+ if (shouldUpdate)
4765
+ this.emit(stateKey, this.state[stateKey]);
4717
4766
  }
4718
4767
  }
4719
4768
  componentWillMount() {
@@ -4731,14 +4780,16 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4731
4780
  return this;
4732
4781
  }
4733
4782
  paintLabel() {
4734
- if (this.state.isRoot) return this;
4783
+ if (this.state.isRoot)
4784
+ return this;
4735
4785
  const label = this.state.label;
4736
4786
  const color = this.state.style.labelcolor;
4737
4787
  const ctx = this.labelCtx;
4738
4788
  const canvas = this.labelCanvas;
4739
4789
  const ratio = window.devicePixelRatio || 1;
4740
4790
  let { width, height } = this.label.getBoundingClientRect();
4741
- if (!width || !height) return this;
4791
+ if (!width || !height)
4792
+ return this;
4742
4793
  width = Math.floor(width);
4743
4794
  height = Math.floor(height);
4744
4795
  const scaledWidth = Math.floor(width * ratio);
@@ -4759,7 +4810,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4759
4810
  this.label.appendChild(this.labelCanvas);
4760
4811
  this.container.appendChild(this.label);
4761
4812
  }
4762
- if (this.tabs.children.length) this.container.appendChild(this.tabs);
4813
+ if (this.tabs.children.length)
4814
+ this.container.appendChild(this.tabs);
4763
4815
  this.children.forEach((item) => {
4764
4816
  item.mount();
4765
4817
  this.container.appendChild(item.container);
@@ -4770,7 +4822,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4770
4822
  var _a2;
4771
4823
  const handleResize = () => {
4772
4824
  const { grid, left, top: top2, width, height } = this.state.style;
4773
- if (!this.state.isRoot) this.label.style.height = `${grid * 0.3}px`;
4825
+ if (!this.state.isRoot)
4826
+ this.label.style.height = `${grid * 0.3}px`;
4774
4827
  this.container.style.width = `${width * grid}px`;
4775
4828
  this.container.style.height = `${height * grid}px`;
4776
4829
  this.container.style.left = `${left * grid}px`;
@@ -4801,7 +4854,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4801
4854
  };
4802
4855
  this.on("label", () => this.schedule(labelChange));
4803
4856
  this.paintLabel();
4804
- if ((_a2 = this.tabs) == null ? void 0 : _a2.children.length) this.tabs.children[0].click();
4857
+ if ((_a2 = this.tabs) == null ? void 0 : _a2.children.length)
4858
+ this.tabs.children[0].click();
4805
4859
  this.children.forEach((item) => item.componentDidMount());
4806
4860
  return this;
4807
4861
  }
@@ -4869,7 +4923,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4869
4923
  const paintValue = this.paintValue;
4870
4924
  if (paintValue > this.maxValue) {
4871
4925
  this.maxValue = paintValue;
4872
- if (this.maxTimer) window.clearTimeout(this.maxTimer);
4926
+ if (this.maxTimer)
4927
+ window.clearTimeout(this.maxTimer);
4873
4928
  this.maxTimer = window.setTimeout(() => {
4874
4929
  this.maxValue = this.paintValue;
4875
4930
  this.maxTimer = void 0;
@@ -4889,15 +4944,23 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4889
4944
  const hotStop = (-3 - min) / (max - min);
4890
4945
  const overloadStop = Math.max(0, -min / (max - min));
4891
4946
  const gradient = ctx.createLinearGradient(left, 0, drawWidth, 0);
4892
- if (coldStop <= 1 && coldStop >= 0) gradient.addColorStop(coldStop, coldcolor);
4893
- else if (coldStop > 1) gradient.addColorStop(1, coldcolor);
4894
- if (warmStop <= 1 && warmStop >= 0) gradient.addColorStop(warmStop, warmcolor);
4895
- if (hotStop <= 1 && hotStop >= 0) gradient.addColorStop(hotStop, hotcolor);
4896
- if (overloadStop <= 1 && overloadStop >= 0) gradient.addColorStop(overloadStop, overloadcolor);
4897
- else if (overloadStop < 0) gradient.addColorStop(0, coldcolor);
4947
+ if (coldStop <= 1 && coldStop >= 0)
4948
+ gradient.addColorStop(coldStop, coldcolor);
4949
+ else if (coldStop > 1)
4950
+ gradient.addColorStop(1, coldcolor);
4951
+ if (warmStop <= 1 && warmStop >= 0)
4952
+ gradient.addColorStop(warmStop, warmcolor);
4953
+ if (hotStop <= 1 && hotStop >= 0)
4954
+ gradient.addColorStop(hotStop, hotcolor);
4955
+ if (overloadStop <= 1 && overloadStop >= 0)
4956
+ gradient.addColorStop(overloadStop, overloadcolor);
4957
+ else if (overloadStop < 0)
4958
+ gradient.addColorStop(0, coldcolor);
4898
4959
  ctx.fillStyle = barbgcolor;
4899
- if (paintValue < 0) ctx.fillRect(left, top2, drawWidth * overloadStop, drawHeight);
4900
- if (paintValue < max) ctx.fillRect(left + drawWidth * overloadStop + 1, top2, drawWidth * (1 - overloadStop) - 1, drawHeight);
4960
+ if (paintValue < 0)
4961
+ ctx.fillRect(left, top2, drawWidth * overloadStop, drawHeight);
4962
+ if (paintValue < max)
4963
+ ctx.fillRect(left + drawWidth * overloadStop + 1, top2, drawWidth * (1 - overloadStop) - 1, drawHeight);
4901
4964
  ctx.fillStyle = gradient;
4902
4965
  if (paintValue > min) {
4903
4966
  const distance = Math.max(0, _AbstractItem__WEBPACK_IMPORTED_MODULE_0__["default"].getDistance({ type, max, min, enums, scale, value: Math.min(0, paintValue) }));
@@ -5054,7 +5117,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5054
5117
  const value = parseFloat(e.currentTarget.value);
5055
5118
  if (isFinite(value)) {
5056
5119
  const changed = this.setValue(+value);
5057
- if (changed) return;
5120
+ if (changed)
5121
+ return;
5058
5122
  }
5059
5123
  this.input.value = this.inputNumber.value + (this.state.unit || "");
5060
5124
  };
@@ -5109,7 +5173,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5109
5173
  };
5110
5174
  this.handleMouseOrTouchMove = (e) => {
5111
5175
  const newValue = this.getValueFromDelta(e);
5112
- if (newValue !== this.state.value) this.setValue(newValue);
5176
+ if (newValue !== this.state.value)
5177
+ this.setValue(newValue);
5113
5178
  };
5114
5179
  }
5115
5180
  static get defaultProps() {
@@ -5201,8 +5266,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5201
5266
  const v = scale === "exp" ? (0, _utils__WEBPACK_IMPORTED_MODULE_1__.normExp)(denormalized, min, max) : scale === "log" ? (0, _utils__WEBPACK_IMPORTED_MODULE_1__.normLog)(denormalized, min, max) : denormalized;
5202
5267
  let steps = Math.round((0, _utils__WEBPACK_IMPORTED_MODULE_1__.normalize)(v, min, max) * range / stepRange);
5203
5268
  steps = Math.min(stepsCount, Math.max(0, steps));
5204
- if (type === "enum") return steps;
5205
- if (type === "int") return Math.round(steps * step + min);
5269
+ if (type === "enum")
5270
+ return steps;
5271
+ if (type === "int")
5272
+ return Math.round(steps * step + min);
5206
5273
  return steps * step + min;
5207
5274
  }
5208
5275
  }
@@ -5282,19 +5349,29 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5282
5349
  const hotStop = (-3 - min) / (max - min);
5283
5350
  const overloadStop = -min / (max - min);
5284
5351
  const gradient = tempCtx.createLinearGradient(0, 0, tempCanvas.width, 0);
5285
- if (coldStop <= 1 && coldStop >= 0) gradient.addColorStop(coldStop, coldcolor);
5286
- else if (coldStop > 1) gradient.addColorStop(1, coldcolor);
5287
- if (warmStop <= 1 && warmStop >= 0) gradient.addColorStop(warmStop, warmcolor);
5288
- if (hotStop <= 1 && hotStop >= 0) gradient.addColorStop(hotStop, hotcolor);
5289
- if (overloadStop <= 1 && overloadStop >= 0) gradient.addColorStop(overloadStop, overloadcolor);
5290
- else if (overloadStop < 0) gradient.addColorStop(0, coldcolor);
5352
+ if (coldStop <= 1 && coldStop >= 0)
5353
+ gradient.addColorStop(coldStop, coldcolor);
5354
+ else if (coldStop > 1)
5355
+ gradient.addColorStop(1, coldcolor);
5356
+ if (warmStop <= 1 && warmStop >= 0)
5357
+ gradient.addColorStop(warmStop, warmcolor);
5358
+ if (hotStop <= 1 && hotStop >= 0)
5359
+ gradient.addColorStop(hotStop, hotcolor);
5360
+ if (overloadStop <= 1 && overloadStop >= 0)
5361
+ gradient.addColorStop(overloadStop, overloadcolor);
5362
+ else if (overloadStop < 0)
5363
+ gradient.addColorStop(0, coldcolor);
5291
5364
  tempCtx.fillStyle = gradient;
5292
5365
  tempCtx.fillRect(0, 0, tempCanvas.width, 10);
5293
5366
  const d = tempCtx.getImageData(Math.min(tempCanvas.width - 1, distance * tempCanvas.width), 0, 1, 1).data;
5294
- if (distance) ctx.fillStyle = `rgb(${d[0]}, ${d[1]}, ${d[2]})`;
5295
- else ctx.fillStyle = ledbgcolor;
5296
- if (shape === "circle") ctx.arc(width / 2, height / 2, width / 2 - left, 0, 2 * Math.PI);
5297
- else ctx.rect(left, top2, drawWidth, drawHeight);
5367
+ if (distance)
5368
+ ctx.fillStyle = `rgb(${d[0]}, ${d[1]}, ${d[2]})`;
5369
+ else
5370
+ ctx.fillStyle = ledbgcolor;
5371
+ if (shape === "circle")
5372
+ ctx.arc(width / 2, height / 2, width / 2 - left, 0, 2 * Math.PI);
5373
+ else
5374
+ ctx.rect(left, top2, drawWidth, drawHeight);
5298
5375
  ctx.fill();
5299
5376
  };
5300
5377
  }
@@ -5442,7 +5519,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5442
5519
  const option = document.createElement("option");
5443
5520
  option.value = enums[key].toString();
5444
5521
  option.text = key;
5445
- if (i2 === 0) option.selected = true;
5522
+ if (i2 === 0)
5523
+ option.selected = true;
5446
5524
  this.select.appendChild(option);
5447
5525
  i2++;
5448
5526
  }
@@ -5457,7 +5535,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5457
5535
  const valueChange = () => {
5458
5536
  for (let i2 = this.select.children.length - 1; i2 >= 0; i2--) {
5459
5537
  const option = this.select.children[i2];
5460
- if (+option.value === this.state.value) this.select.selectedIndex = i2;
5538
+ if (+option.value === this.state.value)
5539
+ this.select.selectedIndex = i2;
5461
5540
  }
5462
5541
  };
5463
5542
  this.on("value", () => this.schedule(valueChange));
@@ -5729,9 +5808,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5729
5808
  input.value = enums[key].toString();
5730
5809
  input.name = address;
5731
5810
  input.type = "radio";
5732
- if (i2 === 0) input.checked = true;
5811
+ if (i2 === 0)
5812
+ input.checked = true;
5733
5813
  input.addEventListener("change", () => {
5734
- if (input.checked) this.setValue(enums[key]);
5814
+ if (input.checked)
5815
+ this.setValue(enums[key]);
5735
5816
  });
5736
5817
  div.appendChild(input);
5737
5818
  div.append(key);
@@ -5779,7 +5860,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5779
5860
  const valueChange = () => {
5780
5861
  for (let i2 = this.group.children.length - 1; i2 >= 0; i2--) {
5781
5862
  const input = this.group.children[i2].querySelector("input");
5782
- if (+input.value === this.state.value) input.checked = true;
5863
+ if (+input.value === this.state.value)
5864
+ input.checked = true;
5783
5865
  }
5784
5866
  };
5785
5867
  this.on("value", () => this.schedule(valueChange));
@@ -5976,7 +6058,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5976
6058
  const paintValue = this.paintValue;
5977
6059
  if (paintValue > this.maxValue) {
5978
6060
  this.maxValue = paintValue;
5979
- if (this.maxTimer) window.clearTimeout(this.maxTimer);
6061
+ if (this.maxTimer)
6062
+ window.clearTimeout(this.maxTimer);
5980
6063
  this.maxTimer = window.setTimeout(() => {
5981
6064
  this.maxValue = this.paintValue;
5982
6065
  this.maxTimer = void 0;
@@ -5996,15 +6079,23 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5996
6079
  const hotStop = (-3 - min) / (max - min);
5997
6080
  const overloadStop = Math.max(0, -min / (max - min));
5998
6081
  const gradient = ctx.createLinearGradient(0, drawHeight, 0, top2);
5999
- if (coldStop <= 1 && coldStop >= 0) gradient.addColorStop(coldStop, coldcolor);
6000
- else if (coldStop > 1) gradient.addColorStop(1, coldcolor);
6001
- if (warmStop <= 1 && warmStop >= 0) gradient.addColorStop(warmStop, warmcolor);
6002
- if (hotStop <= 1 && hotStop >= 0) gradient.addColorStop(hotStop, hotcolor);
6003
- if (overloadStop <= 1 && overloadStop >= 0) gradient.addColorStop(overloadStop, overloadcolor);
6004
- else if (overloadStop < 0) gradient.addColorStop(0, coldcolor);
6082
+ if (coldStop <= 1 && coldStop >= 0)
6083
+ gradient.addColorStop(coldStop, coldcolor);
6084
+ else if (coldStop > 1)
6085
+ gradient.addColorStop(1, coldcolor);
6086
+ if (warmStop <= 1 && warmStop >= 0)
6087
+ gradient.addColorStop(warmStop, warmcolor);
6088
+ if (hotStop <= 1 && hotStop >= 0)
6089
+ gradient.addColorStop(hotStop, hotcolor);
6090
+ if (overloadStop <= 1 && overloadStop >= 0)
6091
+ gradient.addColorStop(overloadStop, overloadcolor);
6092
+ else if (overloadStop < 0)
6093
+ gradient.addColorStop(0, coldcolor);
6005
6094
  ctx.fillStyle = barbgcolor;
6006
- if (paintValue < 0) ctx.fillRect(left, top2 + (1 - overloadStop) * drawHeight, drawWidth, drawHeight * overloadStop);
6007
- if (paintValue < max) ctx.fillRect(left, top2, drawWidth, (1 - overloadStop) * drawHeight - 1);
6095
+ if (paintValue < 0)
6096
+ ctx.fillRect(left, top2 + (1 - overloadStop) * drawHeight, drawWidth, drawHeight * overloadStop);
6097
+ if (paintValue < max)
6098
+ ctx.fillRect(left, top2, drawWidth, (1 - overloadStop) * drawHeight - 1);
6008
6099
  ctx.fillStyle = gradient;
6009
6100
  if (paintValue > min) {
6010
6101
  const distance = Math.max(0, _AbstractItem__WEBPACK_IMPORTED_MODULE_0__["default"].getDistance({ type, max, min, enums, scale, value: Math.min(0, paintValue) }));
@@ -6148,7 +6239,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6148
6239
  const value = parseFloat(e.currentTarget.value);
6149
6240
  if (isFinite(value)) {
6150
6241
  const changed = this.setValue(+value);
6151
- if (changed) return;
6242
+ if (changed)
6243
+ return;
6152
6244
  }
6153
6245
  this.input.value = this.inputNumber.value + (this.state.unit || "");
6154
6246
  };
@@ -6190,13 +6282,16 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6190
6282
  };
6191
6283
  this.handleMouseOrTouchDown = (e) => {
6192
6284
  const { value } = this.state;
6193
- if (e.x < this.interactionRect[0] || e.x > this.interactionRect[0] + this.interactionRect[2] || e.y < this.interactionRect[1] || e.y > this.interactionRect[1] + this.interactionRect[3]) return;
6285
+ if (e.x < this.interactionRect[0] || e.x > this.interactionRect[0] + this.interactionRect[2] || e.y < this.interactionRect[1] || e.y > this.interactionRect[1] + this.interactionRect[3])
6286
+ return;
6194
6287
  const newValue = this.getValueFromPos(e);
6195
- if (newValue !== value) this.setValue(this.getValueFromPos(e));
6288
+ if (newValue !== value)
6289
+ this.setValue(this.getValueFromPos(e));
6196
6290
  };
6197
6291
  this.handleMouseOrTouchMove = (e) => {
6198
6292
  const newValue = this.getValueFromPos(e);
6199
- if (newValue !== this.state.value) this.setValue(newValue);
6293
+ if (newValue !== this.state.value)
6294
+ this.setValue(newValue);
6200
6295
  };
6201
6296
  }
6202
6297
  static get defaultProps() {
@@ -6286,8 +6381,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6286
6381
  const { type, max, min, step, enums } = this.state;
6287
6382
  const maxSteps = type === "enum" ? enums.length : type === "int" ? max - min : (max - min) / step;
6288
6383
  if (step) {
6289
- if (type === "enum") return enums.length;
6290
- if (type === "int") return Math.min(Math.floor((max - min) / (Math.round(step) || 0)), maxSteps);
6384
+ if (type === "enum")
6385
+ return enums.length;
6386
+ if (type === "int")
6387
+ return Math.min(Math.floor((max - min) / (Math.round(step) || 0)), maxSteps);
6291
6388
  return Math.floor((max - min) / step);
6292
6389
  }
6293
6390
  return maxSteps;
@@ -6308,8 +6405,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6308
6405
  const v = scale === "exp" ? (0, _utils__WEBPACK_IMPORTED_MODULE_1__.normExp)(denormalized, min, max) : scale === "log" ? (0, _utils__WEBPACK_IMPORTED_MODULE_1__.normLog)(denormalized, min, max) : denormalized;
6309
6406
  let steps = Math.round((0, _utils__WEBPACK_IMPORTED_MODULE_1__.normalize)(v, min, max) * range / stepRange);
6310
6407
  steps = Math.min(stepsCount, Math.max(0, steps));
6311
- if (type === "enum") return steps;
6312
- if (type === "int") return Math.round(steps * step + min);
6408
+ if (type === "enum")
6409
+ return steps;
6410
+ if (type === "int")
6411
+ return Math.round(steps * step + min);
6313
6412
  return steps * step + min;
6314
6413
  }
6315
6414
  }
@@ -6412,8 +6511,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6412
6511
  const iNormExp = normLog;
6413
6512
  const roundedRect = (ctx, x, y2, width, height, radius) => {
6414
6513
  const radii = [0, 0, 0, 0];
6415
- if (typeof radius === "number") radii.fill(radius);
6416
- else radius.forEach((v, i2) => radii[i2] = v);
6514
+ if (typeof radius === "number")
6515
+ radii.fill(radius);
6516
+ else
6517
+ radius.forEach((v, i2) => radii[i2] = v);
6417
6518
  ctx.beginPath();
6418
6519
  ctx.moveTo(x + radii[0], y2);
6419
6520
  ctx.lineTo(x + width - radii[1], y2);
@@ -6429,8 +6530,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6429
6530
  };
6430
6531
  const fillRoundedRect = (ctx, x, y2, width, height, radius) => {
6431
6532
  const radii = [0, 0, 0, 0];
6432
- if (typeof radius === "number") radii.fill(radius);
6433
- else radius.forEach((v, i2) => radii[i2] = v);
6533
+ if (typeof radius === "number")
6534
+ radii.fill(radius);
6535
+ else
6536
+ radius.forEach((v, i2) => radii[i2] = v);
6434
6537
  ctx.beginPath();
6435
6538
  ctx.moveTo(x + radii[0], y2);
6436
6539
  ctx.lineTo(x + width - radii[1], y2);
@@ -6459,12 +6562,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6459
6562
  "default": () => __WEBPACK_DEFAULT_EXPORT__
6460
6563
  /* harmony export */
6461
6564
  });
6462
- var _FaustUI__WEBPACK_IMPORTED_MODULE_0__2 = __webpack_require__2(
6565
+ var _FaustUI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2(
6463
6566
  /*! ./FaustUI */
6464
6567
  "./src/FaustUI.ts"
6465
6568
  );
6466
6569
  const instantiate = () => {
6467
- const faustUI = new _FaustUI__WEBPACK_IMPORTED_MODULE_0__2["default"]({
6570
+ const faustUI = new _FaustUI__WEBPACK_IMPORTED_MODULE_0__["default"]({
6468
6571
  root: document.getElementById("root"),
6469
6572
  listenWindowResize: true,
6470
6573
  listenWindowMessage: true
@@ -6475,10 +6578,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6475
6578
  host = source;
6476
6579
  });
6477
6580
  window.addEventListener("keydown", (e) => {
6478
- if (host) host.postMessage({ type: "keydown", key: e.key }, "*");
6581
+ if (host)
6582
+ host.postMessage({ type: "keydown", key: e.key }, "*");
6479
6583
  });
6480
6584
  window.addEventListener("keyup", (e) => {
6481
- if (host) host.postMessage({ type: "keyup", key: e.key }, "*");
6585
+ if (host)
6586
+ host.postMessage({ type: "keyup", key: e.key }, "*");
6482
6587
  });
6483
6588
  window.faustUI = faustUI;
6484
6589
  };
@@ -6501,7 +6606,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6501
6606
  )
6502
6607
  /* harmony export */
6503
6608
  });
6504
- const _AbstractGroup = class _AbstractGroup2 {
6609
+ const _AbstractGroup = class {
6505
6610
  constructor(group, isRoot) {
6506
6611
  this.isRoot = !!isRoot;
6507
6612
  Object.assign(this, group);
@@ -6509,8 +6614,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6509
6614
  const sizing = hasHSizingDesc && hasVSizingDesc ? "both" : hasHSizingDesc ? "horizontal" : hasVSizingDesc ? "vertical" : "none";
6510
6615
  this.layout = {
6511
6616
  type: group.type,
6512
- width: _AbstractGroup2.padding * 2,
6513
- height: _AbstractGroup2.padding * 2 + (this.isRoot ? 0 : _AbstractGroup2.labelHeight),
6617
+ width: _AbstractGroup.padding * 2,
6618
+ height: _AbstractGroup.padding * 2 + (this.isRoot ? 0 : _AbstractGroup.labelHeight),
6514
6619
  sizing
6515
6620
  };
6516
6621
  }
@@ -6519,7 +6624,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6519
6624
  */
6520
6625
  get hasHSizingDesc() {
6521
6626
  return !!this.items.find((item) => {
6522
- if (item instanceof _AbstractGroup2) return item.hasHSizingDesc;
6627
+ if (item instanceof _AbstractGroup)
6628
+ return item.hasHSizingDesc;
6523
6629
  return item.layout.sizing === "horizontal" || item.layout.sizing === "both";
6524
6630
  });
6525
6631
  }
@@ -6528,7 +6634,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6528
6634
  */
6529
6635
  get hasVSizingDesc() {
6530
6636
  return !!this.items.find((item) => {
6531
- if (item instanceof _AbstractGroup2) return item.hasVSizingDesc;
6637
+ if (item instanceof _AbstractGroup)
6638
+ return item.hasVSizingDesc;
6532
6639
  return item.layout.sizing === "vertical" || item.layout.sizing === "both";
6533
6640
  });
6534
6641
  }
@@ -6542,10 +6649,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6542
6649
  return this;
6543
6650
  }
6544
6651
  };
6545
- _AbstractGroup.padding = 0.2;
6546
- _AbstractGroup.labelHeight = 0.25;
6547
- _AbstractGroup.spaceBetween = 0.1;
6548
6652
  let AbstractGroup = _AbstractGroup;
6653
+ AbstractGroup.padding = 0.2;
6654
+ AbstractGroup.labelHeight = 0.25;
6655
+ AbstractGroup.spaceBetween = 0.1;
6549
6656
  }
6550
6657
  ),
6551
6658
  /***/
@@ -6762,13 +6869,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6762
6869
  this.layout.height = Math.max(this.layout.height, item.layout.height + 2 * _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"].padding + (this.isRoot ? 0 : _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"].labelHeight));
6763
6870
  });
6764
6871
  this.layout.width += _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"].spaceBetween * (this.items.length - 1);
6765
- if (this.layout.width < 1) this.layout.width += 1;
6872
+ if (this.layout.width < 1)
6873
+ this.layout.width += 1;
6766
6874
  return this;
6767
6875
  }
6768
6876
  expand(dX) {
6769
6877
  let hExpandItems = 0;
6770
6878
  this.items.forEach((item) => {
6771
- if (item.layout.sizing === "both" || item.layout.sizing === "horizontal") hExpandItems++;
6879
+ if (item.layout.sizing === "both" || item.layout.sizing === "horizontal")
6880
+ hExpandItems++;
6772
6881
  });
6773
6882
  this.items.forEach((item) => {
6774
6883
  let dX$ = 0;
@@ -6960,26 +7069,31 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6960
7069
  if ((_a2 = item.meta) == null ? void 0 : _a2.find((meta2) => {
6961
7070
  var _a22;
6962
7071
  return (_a22 = meta2.style) == null ? void 0 : _a22.startsWith("led");
6963
- })) return "led";
7072
+ }))
7073
+ return "led";
6964
7074
  if ((_b = item.meta) == null ? void 0 : _b.find((meta2) => {
6965
7075
  var _a22;
6966
7076
  return (_a22 = meta2.style) == null ? void 0 : _a22.startsWith("numerical");
6967
- })) return "numerical";
7077
+ }))
7078
+ return "numerical";
6968
7079
  return item.type;
6969
7080
  }
6970
7081
  if (item.type === "hslider" || item.type === "nentry" || item.type === "vslider") {
6971
7082
  if ((_c = item.meta) == null ? void 0 : _c.find((meta2) => {
6972
7083
  var _a22;
6973
7084
  return (_a22 = meta2.style) == null ? void 0 : _a22.startsWith("knob");
6974
- })) return "knob";
7085
+ }))
7086
+ return "knob";
6975
7087
  if ((_d = item.meta) == null ? void 0 : _d.find((meta2) => {
6976
7088
  var _a22;
6977
7089
  return (_a22 = meta2.style) == null ? void 0 : _a22.startsWith("menu");
6978
- })) return "menu";
7090
+ }))
7091
+ return "menu";
6979
7092
  if ((_e = item.meta) == null ? void 0 : _e.find((meta2) => {
6980
7093
  var _a22;
6981
7094
  return (_a22 = meta2.style) == null ? void 0 : _a22.startsWith("radio");
6982
- })) return "radio";
7095
+ }))
7096
+ return "radio";
6983
7097
  }
6984
7098
  return item.type;
6985
7099
  }
@@ -7010,7 +7124,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
7010
7124
  }
7011
7125
  static getItems(items) {
7012
7126
  return items.map((item) => {
7013
- if ("items" in item) item.items = this.getItems(item.items);
7127
+ if ("items" in item)
7128
+ item.items = this.getItems(item.items);
7014
7129
  return this.getItem(item);
7015
7130
  });
7016
7131
  }
@@ -7243,17 +7358,18 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
7243
7358
  /*! ./AbstractGroup */
7244
7359
  "./src/layout/AbstractGroup.ts"
7245
7360
  );
7246
- const _TGroup = class _TGroup2 extends _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"] {
7361
+ const _TGroup = class extends _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"] {
7247
7362
  adjust() {
7248
7363
  this.items.forEach((item) => {
7249
7364
  item.adjust();
7250
7365
  this.layout.width = Math.max(this.layout.width, item.layout.width + 2 * _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"].padding);
7251
- this.layout.height = Math.max(this.layout.height, item.layout.height + 2 * _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"].padding + _TGroup2.labelHeight);
7366
+ this.layout.height = Math.max(this.layout.height, item.layout.height + 2 * _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"].padding + _TGroup.labelHeight);
7252
7367
  });
7253
7368
  const tabsCount = this.items.length;
7254
- this.layout.width = Math.max(this.layout.width, tabsCount * _TGroup2.tabLayout.width);
7255
- this.layout.height += _TGroup2.tabLayout.height;
7256
- if (this.layout.width < 1) this.layout.width += 1;
7369
+ this.layout.width = Math.max(this.layout.width, tabsCount * _TGroup.tabLayout.width);
7370
+ this.layout.height += _TGroup.tabLayout.height;
7371
+ if (this.layout.width < 1)
7372
+ this.layout.width += 1;
7257
7373
  return this;
7258
7374
  }
7259
7375
  expand() {
@@ -7261,8 +7377,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
7261
7377
  this.items.forEach((item) => {
7262
7378
  let dY$ = 0;
7263
7379
  let dX$ = 0;
7264
- if (item.layout.sizing === "both" || item.layout.sizing === "horizontal") dX$ = this.layout.width - 2 * _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"].padding - item.layout.width;
7265
- if (item.layout.sizing === "both" || item.layout.sizing === "vertical") dY$ = this.layout.height - 2 * _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"].padding - (this.isRoot ? 0 : _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"].labelHeight) - (tabsCount ? _TGroup2.tabLayout.height : 0) - item.layout.height;
7380
+ if (item.layout.sizing === "both" || item.layout.sizing === "horizontal")
7381
+ dX$ = this.layout.width - 2 * _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"].padding - item.layout.width;
7382
+ if (item.layout.sizing === "both" || item.layout.sizing === "vertical")
7383
+ dY$ = this.layout.height - 2 * _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"].padding - (this.isRoot ? 0 : _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"].labelHeight) - (tabsCount ? _TGroup.tabLayout.height : 0) - item.layout.height;
7266
7384
  item.expand(dX$, dY$);
7267
7385
  });
7268
7386
  return this;
@@ -7270,7 +7388,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
7270
7388
  offset() {
7271
7389
  const { labelHeight, padding } = _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"];
7272
7390
  const $left = padding;
7273
- const $top = padding + (this.isRoot ? 0 : labelHeight) + _TGroup2.tabLayout.height;
7391
+ const $top = padding + (this.isRoot ? 0 : labelHeight) + _TGroup.tabLayout.height;
7274
7392
  this.items.forEach((item) => {
7275
7393
  item.layout.offsetLeft = $left;
7276
7394
  item.layout.offsetTop = $top;
@@ -7281,11 +7399,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
7281
7399
  return this;
7282
7400
  }
7283
7401
  };
7284
- _TGroup.tabLayout = {
7402
+ let TGroup = _TGroup;
7403
+ TGroup.tabLayout = {
7285
7404
  width: 2,
7286
7405
  height: 1
7287
7406
  };
7288
- let TGroup = _TGroup;
7289
7407
  }
7290
7408
  ),
7291
7409
  /***/
@@ -7349,13 +7467,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
7349
7467
  this.layout.height += item.layout.height;
7350
7468
  });
7351
7469
  this.layout.height += _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"].spaceBetween * (this.items.length - 1);
7352
- if (this.layout.width < 1) this.layout.width += 1;
7470
+ if (this.layout.width < 1)
7471
+ this.layout.width += 1;
7353
7472
  return this;
7354
7473
  }
7355
7474
  expand(dX, dY) {
7356
7475
  let vExpandItems = 0;
7357
7476
  this.items.forEach((item) => {
7358
- if (item.layout.sizing === "both" || item.layout.sizing === "vertical") vExpandItems++;
7477
+ if (item.layout.sizing === "both" || item.layout.sizing === "vertical")
7478
+ vExpandItems++;
7359
7479
  });
7360
7480
  this.items.forEach((item) => {
7361
7481
  let dX$ = 0;
@@ -8631,38 +8751,40 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
8631
8751
  __webpack_require__.nc = void 0;
8632
8752
  })();
8633
8753
  var __webpack_exports__ = {};
8634
- /*!**********************!*\
8635
- !*** ./src/index.ts ***!
8636
- \**********************/
8637
- __webpack_require__.r(__webpack_exports__);
8638
- __webpack_require__.d(__webpack_exports__, {
8639
- /* harmony export */
8640
- FaustUI: () => (
8641
- /* reexport safe */
8642
- _FaustUI__WEBPACK_IMPORTED_MODULE_0__["default"]
8643
- ),
8644
- /* harmony export */
8645
- instantiate: () => (
8646
- /* reexport safe */
8647
- _instantiate__WEBPACK_IMPORTED_MODULE_1__["default"]
8648
- )
8649
- /* harmony export */
8650
- });
8651
- var _FaustUI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
8652
- /*! ./FaustUI */
8653
- "./src/FaustUI.ts"
8654
- );
8655
- var _instantiate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
8656
- /*! ./instantiate */
8657
- "./src/instantiate.ts"
8658
- );
8754
+ (() => {
8755
+ /*!**********************!*\
8756
+ !*** ./src/index.ts ***!
8757
+ \**********************/
8758
+ __webpack_require__.r(__webpack_exports__);
8759
+ __webpack_require__.d(__webpack_exports__, {
8760
+ /* harmony export */
8761
+ FaustUI: () => (
8762
+ /* reexport safe */
8763
+ _FaustUI__WEBPACK_IMPORTED_MODULE_0__["default"]
8764
+ ),
8765
+ /* harmony export */
8766
+ instantiate: () => (
8767
+ /* reexport safe */
8768
+ _instantiate__WEBPACK_IMPORTED_MODULE_1__["default"]
8769
+ )
8770
+ /* harmony export */
8771
+ });
8772
+ var _FaustUI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
8773
+ /*! ./FaustUI */
8774
+ "./src/FaustUI.ts"
8775
+ );
8776
+ var _instantiate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
8777
+ /*! ./instantiate */
8778
+ "./src/instantiate.ts"
8779
+ );
8780
+ })();
8659
8781
  return __webpack_exports__;
8660
8782
  })()
8661
8783
  );
8662
8784
  });
8663
8785
  })(dist$1);
8664
8786
  var distExports = dist$1.exports;
8665
- const faustCSS = '/*!*******************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Base.scss ***!\n \\*******************************************************************************************************************/\n.faust-ui-component {\n display: flex;\n position: absolute;\n flex-direction: column;\n overflow: hidden;\n}\n.faust-ui-component:focus {\n outline: none;\n}\n.faust-ui-component > .faust-ui-component-label {\n position: relative;\n margin-top: 4px;\n width: 100%;\n user-select: none;\n}\n.faust-ui-component > .faust-ui-component-label > canvas {\n position: relative;\n display: block;\n max-width: 100%;\n max-height: 100%;\n}\n.faust-ui-component input {\n box-shadow: none;\n}\n/*!**********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/VSlider.scss ***!\n \\**********************************************************************************************************************/\n.faust-ui-component.faust-ui-component-vslider {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-vslider > .faust-ui-component-label {\n flex: 0 0 auto;\n}\n.faust-ui-component.faust-ui-component-vslider > .faust-ui-component-vslider-flexdiv {\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n height: auto;\n}\n.faust-ui-component.faust-ui-component-vslider > .faust-ui-component-vslider-flexdiv > .faust-ui-component-vslider-canvasdiv {\n position: relative;\n display: block;\n flex: 1 1 auto;\n width: 100%;\n}\n.faust-ui-component.faust-ui-component-vslider > .faust-ui-component-vslider-flexdiv > .faust-ui-component-vslider-canvasdiv > canvas {\n position: absolute;\n display: block;\n height: 100%;\n width: 100%;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-vslider > .faust-ui-component-vslider-flexdiv input {\n position: relative;\n display: block;\n flex: 0 1 auto;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.25);\n margin: 5px auto auto auto;\n border-width: 0px;\n border-radius: 4px;\n height: 5%;\n max-width: calc(100% - 8px);\n padding: 2px 4px;\n -moz-appearance: textfield;\n}\n.faust-ui-component.faust-ui-component-vslider > .faust-ui-component-vslider-flexdiv input::-webkit-inner-spin-button, .faust-ui-component.faust-ui-component-vslider > .faust-ui-component-vslider-flexdiv input::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n/*!**********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/HSlider.scss ***!\n \\**********************************************************************************************************************/\n.faust-ui-component.faust-ui-component-hslider > .faust-ui-component-label {\n flex: 0 0 auto;\n}\n.faust-ui-component.faust-ui-component-hslider > .faust-ui-component-hslider-flexdiv {\n position: relative;\n display: flex;\n flex-direction: row-reverse;\n flex: 1 1 auto;\n width: 100%;\n height: auto;\n}\n.faust-ui-component.faust-ui-component-hslider > .faust-ui-component-hslider-flexdiv > .faust-ui-component-hslider-canvasdiv {\n position: relative;\n display: block;\n flex: 1 1 auto;\n height: 100%;\n margin: auto;\n}\n.faust-ui-component.faust-ui-component-hslider > .faust-ui-component-hslider-flexdiv > .faust-ui-component-hslider-canvasdiv > canvas {\n position: absolute;\n display: block;\n height: 100%;\n width: 100%;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-hslider > .faust-ui-component-hslider-flexdiv > input {\n position: relative;\n display: block;\n flex: 0 1 auto;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.25);\n margin: auto 5px auto auto;\n border-width: 0px;\n border-radius: 4px;\n width: calc(20% - 13px);\n padding: 2px 4px;\n -moz-appearance: textfield;\n}\n.faust-ui-component.faust-ui-component-hslider > .faust-ui-component-hslider-flexdiv > input::-webkit-inner-spin-button, .faust-ui-component.faust-ui-component-hslider > .faust-ui-component-hslider-flexdiv > input::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n/*!*********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Nentry.scss ***!\n \\*********************************************************************************************************************/\n.faust-ui-component.faust-ui-component-nentry {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-nentry input {\n margin: 0px;\n text-align: center;\n border-width: 1px;\n border-radius: 4px;\n padding: 2px 4px;\n width: calc(100% - 8px);\n}\n.faust-ui-component.faust-ui-component-nentry input::-webkit-inner-spin-button, .faust-ui-component.faust-ui-component-nentry input::-webkit-outer-spin-button {\n opacity: 1;\n}\n/*!************************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Soundfile.scss ***!\n \\************************************************************************************************************************/\n.faust-ui-component.faust-ui-component-soundfile > div {\n display: flex;\n position: relative;\n cursor: pointer;\n border-width: 1px;\n text-align: center;\n border-radius: 4px;\n flex: 1 0 auto;\n border-style: solid;\n}\n.faust-ui-component.faust-ui-component-soundfile > div > span {\n user-select: none;\n margin: auto;\n}\n/*!*********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Button.scss ***!\n \\*********************************************************************************************************************/\n.faust-ui-component.faust-ui-component-button > div {\n display: flex;\n position: relative;\n cursor: pointer;\n border-width: 1px;\n text-align: center;\n border-radius: 4px;\n flex: 1 0 auto;\n border-style: solid;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-button > div > span {\n user-select: none;\n margin: auto;\n}\n/*!***********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Checkbox.scss ***!\n \\***********************************************************************************************************************/\n.faust-ui-component.faust-ui-component-checkbox > div {\n display: flex;\n position: relative;\n cursor: pointer;\n border-width: 1px;\n text-align: center;\n border-radius: 1px;\n flex: 1 0 auto;\n border-style: solid;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-checkbox > div > span {\n margin: auto;\n user-select: none;\n}\n/*!*******************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Knob.scss ***!\n \\*******************************************************************************************************************/\n.faust-ui-component.faust-ui-component-knob {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-knob > canvas {\n position: relative;\n display: block;\n flex: 1 1 auto;\n min-height: 50%;\n width: 100%;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-knob > input {\n position: relative;\n display: block;\n flex: 0 1 auto;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.25);\n margin: 0px;\n border-width: 0px;\n border-radius: 4px;\n max-width: calc(100% - 8px);\n padding: 2px 4px;\n -moz-appearance: textfield;\n}\n.faust-ui-component.faust-ui-component-knob > input::-webkit-inner-spin-button, .faust-ui-component.faust-ui-component-knob > input::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n/*!*******************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Menu.scss ***!\n \\*******************************************************************************************************************/\n.faust-ui-component.faust-ui-component-menu {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-menu > select {\n margin: 0px;\n text-align: center;\n border-width: 1px;\n border-radius: 4px;\n padding: 2px 4px;\n width: calc(100% - 8px);\n}\n/*!********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Radio.scss ***!\n \\********************************************************************************************************************/\n.faust-ui-component.faust-ui-component-radio {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-radio > .faust-ui-component-label {\n flex: 0 0 auto;\n margin-top: auto;\n}\n.faust-ui-component.faust-ui-component-radio > .faust-ui-component-radio-group {\n flex: 0 0 auto;\n margin-bottom: auto;\n border-width: 1px;\n border-radius: 4px;\n padding: 2px 4px;\n width: calc(100% - 8px);\n}\n.faust-ui-component.faust-ui-component-radio > .faust-ui-component-radio-group > div {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n/*!******************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Led.scss ***!\n \\******************************************************************************************************************/\n.faust-ui-component.faust-ui-component-led {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-led > .faust-ui-component-label {\n flex: 0 0 auto;\n}\n.faust-ui-component.faust-ui-component-led > .faust-ui-component-led-canvasdiv {\n position: relative;\n display: block;\n flex: 1 1 auto;\n width: 100%;\n}\n.faust-ui-component.faust-ui-component-led > .faust-ui-component-led-canvasdiv > canvas {\n position: absolute;\n display: block;\n height: 100%;\n width: 100%;\n touch-action: none;\n}\n/*!************************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Numerical.scss ***!\n \\************************************************************************************************************************/\n.faust-ui-component.faust-ui-component-numerical {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-numerical > input {\n position: relative;\n display: block;\n flex: 0 1 auto;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.25);\n margin: auto;\n border-width: 0px;\n border-radius: 4px;\n width: calc(100% - 8px);\n padding: 2px 4px;\n}\n/*!************************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/VBargraph.scss ***!\n \\************************************************************************************************************************/\n.faust-ui-component.faust-ui-component-vbargraph {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-vbargraph > .faust-ui-component-label {\n flex: 0 0 auto;\n}\n.faust-ui-component.faust-ui-component-vbargraph > .faust-ui-component-vbargraph-flexdiv {\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n height: inherit;\n}\n.faust-ui-component.faust-ui-component-vbargraph > .faust-ui-component-vbargraph-flexdiv > .faust-ui-component-vbargraph-canvasdiv {\n position: relative;\n display: block;\n flex: 1 1 auto;\n width: 100%;\n}\n.faust-ui-component.faust-ui-component-vbargraph > .faust-ui-component-vbargraph-flexdiv > .faust-ui-component-vbargraph-canvasdiv > canvas {\n position: absolute;\n display: block;\n height: 100%;\n width: 100%;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-vbargraph > .faust-ui-component-vbargraph-flexdiv > input {\n position: relative;\n display: block;\n flex: 0 1 auto;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.25);\n margin: 5px auto auto auto;\n border-width: 0px;\n border-radius: 4px;\n height: 5%;\n width: calc(100% - 8px);\n padding: 2px 4px;\n}\n/*!************************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/HBargraph.scss ***!\n \\************************************************************************************************************************/\n.faust-ui-component.faust-ui-component-hbargraph > .faust-ui-component-label {\n flex: 0 0 auto;\n}\n.faust-ui-component.faust-ui-component-hbargraph > .faust-ui-component-hbargraph-flexdiv {\n position: relative;\n display: flex;\n flex-direction: row-reverse;\n flex: 1 1 auto;\n width: 100%;\n height: auto;\n}\n.faust-ui-component.faust-ui-component-hbargraph > .faust-ui-component-hbargraph-flexdiv > .faust-ui-component-hbargraph-canvasdiv {\n position: relative;\n display: block;\n flex: 1 1 auto;\n height: 100%;\n margin: auto;\n}\n.faust-ui-component.faust-ui-component-hbargraph > .faust-ui-component-hbargraph-flexdiv > .faust-ui-component-hbargraph-canvasdiv > canvas {\n position: absolute;\n display: block;\n height: 100%;\n width: 100%;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-hbargraph > .faust-ui-component-hbargraph-flexdiv > input {\n position: relative;\n display: block;\n flex: 0 1 auto;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.25);\n margin: auto 5px auto auto;\n border-width: 0px;\n border-radius: 4px;\n width: calc(20% - 13px);\n padding: 2px 4px;\n}\n/*!********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Group.scss ***!\n \\********************************************************************************************************************/\n.faust-ui-group {\n position: absolute;\n display: block;\n background-color: rgba(80, 80, 80, 0.75);\n border-radius: 4px;\n border: 1px rgba(255, 255, 255, 0.25) solid;\n}\n.faust-ui-group > .faust-ui-group-label {\n position: relative;\n margin: 4px;\n width: calc(100% - 8px);\n user-select: none;\n}\n.faust-ui-group > .faust-ui-group-label > canvas {\n position: relative;\n display: block;\n max-width: 100%;\n max-height: 100%;\n}\n.faust-ui-group .faust-ui-tgroup-tabs {\n position: absolute;\n display: inline-block;\n white-space: nowrap;\n left: 0px;\n}\n.faust-ui-group .faust-ui-tgroup-tabs .faust-ui-tgroup-tab {\n position: relative;\n display: inline-block;\n border-radius: 5px;\n cursor: pointer;\n text-overflow: ellipsis;\n white-space: nowrap;\n user-select: none;\n margin: 10px;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.5);\n}\n.faust-ui-group .faust-ui-tgroup-tabs .faust-ui-tgroup-tab:hover {\n background-color: rgb(255, 255, 255);\n}\n.faust-ui-group .faust-ui-tgroup-tabs .faust-ui-tgroup-tab.active {\n background-color: rgb(40, 40, 40);\n color: white;\n}\n/*!*********************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/index.scss ***!\n \\*********************************************************************************************************/\n.faust-ui-root {\n margin: 0px auto;\n flex: 1 0 auto;\n position: relative !important;\n background-color: transparent !important;\n border: none !important;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n}\n\n/*# sourceMappingURL=index.css.map*/';
8787
+ const faustCSS = '/*!*******************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Base.scss ***!\n \\*******************************************************************************************************************/\n.faust-ui-component {\n display: flex;\n position: absolute;\n flex-direction: column;\n overflow: hidden;\n}\n.faust-ui-component:focus {\n outline: none;\n}\n.faust-ui-component > .faust-ui-component-label {\n position: relative;\n margin-top: 4px;\n width: 100%;\n user-select: none;\n}\n.faust-ui-component > .faust-ui-component-label > canvas {\n position: relative;\n display: block;\n max-width: 100%;\n max-height: 100%;\n}\n.faust-ui-component input {\n box-shadow: none;\n}\n/*!**********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/VSlider.scss ***!\n \\**********************************************************************************************************************/\n.faust-ui-component.faust-ui-component-vslider {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-vslider > .faust-ui-component-label {\n flex: 0 0 auto;\n}\n.faust-ui-component.faust-ui-component-vslider > .faust-ui-component-vslider-flexdiv {\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n height: auto;\n}\n.faust-ui-component.faust-ui-component-vslider > .faust-ui-component-vslider-flexdiv > .faust-ui-component-vslider-canvasdiv {\n position: relative;\n display: block;\n flex: 1 1 auto;\n width: 100%;\n}\n.faust-ui-component.faust-ui-component-vslider > .faust-ui-component-vslider-flexdiv > .faust-ui-component-vslider-canvasdiv > canvas {\n position: absolute;\n display: block;\n height: 100%;\n width: 100%;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-vslider > .faust-ui-component-vslider-flexdiv input {\n position: relative;\n display: block;\n flex: 0 1 auto;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.25);\n margin: 5px auto auto auto;\n border-width: 0px;\n border-radius: 4px;\n height: 5%;\n max-width: calc(100% - 8px);\n padding: 2px 4px;\n -moz-appearance: textfield;\n}\n.faust-ui-component.faust-ui-component-vslider > .faust-ui-component-vslider-flexdiv input::-webkit-inner-spin-button, .faust-ui-component.faust-ui-component-vslider > .faust-ui-component-vslider-flexdiv input::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n/*!**********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/HSlider.scss ***!\n \\**********************************************************************************************************************/\n.faust-ui-component.faust-ui-component-hslider > .faust-ui-component-label {\n flex: 0 0 auto;\n}\n.faust-ui-component.faust-ui-component-hslider > .faust-ui-component-hslider-flexdiv {\n position: relative;\n display: flex;\n flex-direction: row-reverse;\n flex: 1 1 auto;\n width: 100%;\n height: auto;\n}\n.faust-ui-component.faust-ui-component-hslider > .faust-ui-component-hslider-flexdiv > .faust-ui-component-hslider-canvasdiv {\n position: relative;\n display: block;\n flex: 1 1 auto;\n height: 100%;\n margin: auto;\n}\n.faust-ui-component.faust-ui-component-hslider > .faust-ui-component-hslider-flexdiv > .faust-ui-component-hslider-canvasdiv > canvas {\n position: absolute;\n display: block;\n height: 100%;\n width: 100%;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-hslider > .faust-ui-component-hslider-flexdiv > input {\n position: relative;\n display: block;\n flex: 0 1 auto;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.25);\n margin: auto 5px auto auto;\n border-width: 0px;\n border-radius: 4px;\n width: calc(20% - 13px);\n padding: 2px 4px;\n -moz-appearance: textfield;\n}\n.faust-ui-component.faust-ui-component-hslider > .faust-ui-component-hslider-flexdiv > input::-webkit-inner-spin-button, .faust-ui-component.faust-ui-component-hslider > .faust-ui-component-hslider-flexdiv > input::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n/*!*********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Nentry.scss ***!\n \\*********************************************************************************************************************/\n.faust-ui-component.faust-ui-component-nentry {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-nentry input {\n margin: 0px;\n text-align: center;\n border-width: 1px;\n border-radius: 4px;\n padding: 2px 4px;\n width: calc(100% - 8px);\n}\n.faust-ui-component.faust-ui-component-nentry input::-webkit-inner-spin-button, .faust-ui-component.faust-ui-component-nentry input::-webkit-outer-spin-button {\n opacity: 1;\n}\n/*!************************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Soundfile.scss ***!\n \\************************************************************************************************************************/\n.faust-ui-component.faust-ui-component-soundfile > div {\n display: flex;\n position: relative;\n cursor: pointer;\n border-width: 1px;\n text-align: center;\n border-radius: 4px;\n flex: 1 0 auto;\n border-style: solid;\n}\n.faust-ui-component.faust-ui-component-soundfile > div > span {\n user-select: none;\n margin: auto;\n}\n/*!*********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Button.scss ***!\n \\*********************************************************************************************************************/\n.faust-ui-component.faust-ui-component-button > div {\n display: flex;\n position: relative;\n cursor: pointer;\n border-width: 1px;\n text-align: center;\n border-radius: 4px;\n flex: 1 0 auto;\n border-style: solid;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-button > div > span {\n user-select: none;\n margin: auto;\n}\n/*!***********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Checkbox.scss ***!\n \\***********************************************************************************************************************/\n.faust-ui-component.faust-ui-component-checkbox > div {\n display: flex;\n position: relative;\n cursor: pointer;\n border-width: 1px;\n text-align: center;\n border-radius: 1px;\n flex: 1 0 auto;\n border-style: solid;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-checkbox > div > span {\n margin: auto;\n user-select: none;\n}\n/*!*******************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Knob.scss ***!\n \\*******************************************************************************************************************/\n.faust-ui-component.faust-ui-component-knob {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-knob > canvas {\n position: relative;\n display: block;\n flex: 1 1 auto;\n min-height: 50%;\n width: 100%;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-knob > input {\n position: relative;\n display: block;\n flex: 0 1 auto;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.25);\n margin: 0px;\n border-width: 0px;\n border-radius: 4px;\n max-width: calc(100% - 8px);\n padding: 2px 4px;\n -moz-appearance: textfield;\n}\n.faust-ui-component.faust-ui-component-knob > input::-webkit-inner-spin-button, .faust-ui-component.faust-ui-component-knob > input::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n/*!*******************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Menu.scss ***!\n \\*******************************************************************************************************************/\n.faust-ui-component.faust-ui-component-menu {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-menu > select {\n margin: 0px;\n text-align: center;\n border-width: 1px;\n border-radius: 4px;\n padding: 2px 4px;\n width: calc(100% - 8px);\n}\n/*!********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Radio.scss ***!\n \\********************************************************************************************************************/\n.faust-ui-component.faust-ui-component-radio {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-radio > .faust-ui-component-label {\n flex: 0 0 auto;\n margin-top: auto;\n}\n.faust-ui-component.faust-ui-component-radio > .faust-ui-component-radio-group {\n flex: 0 1 auto;\n margin-bottom: auto;\n border-width: 1px;\n border-radius: 4px;\n padding: 2px 4px;\n width: calc(100% - 8px);\n overflow: auto;\n}\n.faust-ui-component.faust-ui-component-radio > .faust-ui-component-radio-group > div {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n/*!******************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Led.scss ***!\n \\******************************************************************************************************************/\n.faust-ui-component.faust-ui-component-led {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-led > .faust-ui-component-label {\n flex: 0 0 auto;\n}\n.faust-ui-component.faust-ui-component-led > .faust-ui-component-led-canvasdiv {\n position: relative;\n display: block;\n flex: 1 1 auto;\n width: 100%;\n}\n.faust-ui-component.faust-ui-component-led > .faust-ui-component-led-canvasdiv > canvas {\n position: absolute;\n display: block;\n height: 100%;\n width: 100%;\n touch-action: none;\n}\n/*!************************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Numerical.scss ***!\n \\************************************************************************************************************************/\n.faust-ui-component.faust-ui-component-numerical {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-numerical > input {\n position: relative;\n display: block;\n flex: 0 1 auto;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.25);\n margin: auto;\n border-width: 0px;\n border-radius: 4px;\n width: calc(100% - 8px);\n padding: 2px 4px;\n}\n/*!************************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/VBargraph.scss ***!\n \\************************************************************************************************************************/\n.faust-ui-component.faust-ui-component-vbargraph {\n align-items: center;\n}\n.faust-ui-component.faust-ui-component-vbargraph > .faust-ui-component-label {\n flex: 0 0 auto;\n}\n.faust-ui-component.faust-ui-component-vbargraph > .faust-ui-component-vbargraph-flexdiv {\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n height: inherit;\n}\n.faust-ui-component.faust-ui-component-vbargraph > .faust-ui-component-vbargraph-flexdiv > .faust-ui-component-vbargraph-canvasdiv {\n position: relative;\n display: block;\n flex: 1 1 auto;\n width: 100%;\n}\n.faust-ui-component.faust-ui-component-vbargraph > .faust-ui-component-vbargraph-flexdiv > .faust-ui-component-vbargraph-canvasdiv > canvas {\n position: absolute;\n display: block;\n height: 100%;\n width: 100%;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-vbargraph > .faust-ui-component-vbargraph-flexdiv > input {\n position: relative;\n display: block;\n flex: 0 1 auto;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.25);\n margin: 5px auto auto auto;\n border-width: 0px;\n border-radius: 4px;\n height: 5%;\n width: calc(100% - 8px);\n padding: 2px 4px;\n}\n/*!************************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/HBargraph.scss ***!\n \\************************************************************************************************************************/\n.faust-ui-component.faust-ui-component-hbargraph > .faust-ui-component-label {\n flex: 0 0 auto;\n}\n.faust-ui-component.faust-ui-component-hbargraph > .faust-ui-component-hbargraph-flexdiv {\n position: relative;\n display: flex;\n flex-direction: row-reverse;\n flex: 1 1 auto;\n width: 100%;\n height: auto;\n}\n.faust-ui-component.faust-ui-component-hbargraph > .faust-ui-component-hbargraph-flexdiv > .faust-ui-component-hbargraph-canvasdiv {\n position: relative;\n display: block;\n flex: 1 1 auto;\n height: 100%;\n margin: auto;\n}\n.faust-ui-component.faust-ui-component-hbargraph > .faust-ui-component-hbargraph-flexdiv > .faust-ui-component-hbargraph-canvasdiv > canvas {\n position: absolute;\n display: block;\n height: 100%;\n width: 100%;\n touch-action: none;\n}\n.faust-ui-component.faust-ui-component-hbargraph > .faust-ui-component-hbargraph-flexdiv > input {\n position: relative;\n display: block;\n flex: 0 1 auto;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.25);\n margin: auto 5px auto auto;\n border-width: 0px;\n border-radius: 4px;\n width: calc(20% - 13px);\n padding: 2px 4px;\n}\n/*!********************************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Group.scss ***!\n \\********************************************************************************************************************/\n.faust-ui-group {\n position: absolute;\n display: block;\n background-color: rgba(80, 80, 80, 0.75);\n border-radius: 4px;\n border: 1px rgba(255, 255, 255, 0.25) solid;\n}\n.faust-ui-group > .faust-ui-group-label {\n position: relative;\n margin: 4px;\n width: calc(100% - 8px);\n user-select: none;\n}\n.faust-ui-group > .faust-ui-group-label > canvas {\n position: relative;\n display: block;\n max-width: 100%;\n max-height: 100%;\n}\n.faust-ui-group .faust-ui-tgroup-tabs {\n position: absolute;\n display: inline-block;\n white-space: nowrap;\n left: 0px;\n}\n.faust-ui-group .faust-ui-tgroup-tabs .faust-ui-tgroup-tab {\n position: relative;\n display: inline-block;\n border-radius: 5px;\n cursor: pointer;\n text-overflow: ellipsis;\n white-space: nowrap;\n user-select: none;\n margin: 10px;\n text-align: center;\n background-color: rgba(255, 255, 255, 0.5);\n}\n.faust-ui-group .faust-ui-tgroup-tabs .faust-ui-tgroup-tab:hover {\n background-color: rgb(255, 255, 255);\n}\n.faust-ui-group .faust-ui-tgroup-tabs .faust-ui-tgroup-tab.active {\n background-color: rgb(40, 40, 40);\n color: white;\n}\n/*!*********************************************************************************************************!*\\\n !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/index.scss ***!\n \\*********************************************************************************************************/\n.faust-ui-root {\n margin: 0px auto;\n flex: 1 0 auto;\n position: relative !important;\n background-color: transparent !important;\n border: none !important;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n}\n\n/*# sourceMappingURL=index.css.map*/';
8666
8788
  var global = typeof window !== "undefined" ? window : null;
8667
8789
  var ssr = global === null;
8668
8790
  var document$1 = !ssr ? global.document : void 0;
@@ -23504,8 +23626,10 @@ const dependencies = {
23504
23626
  return;
23505
23627
  this.pendingContextChange = change;
23506
23628
  applyDOMChangeInner(view, change, EditorSelection.single(this.toEditorPos(e.selectionStart), this.toEditorPos(e.selectionEnd)));
23507
- if (this.pendingContextChange)
23629
+ if (this.pendingContextChange) {
23508
23630
  this.revertPending(view.state);
23631
+ this.setSelection(view.state);
23632
+ }
23509
23633
  };
23510
23634
  this.handlers.characterboundsupdate = (e) => {
23511
23635
  let rects = [], prev = null;
@@ -23583,12 +23707,13 @@ const dependencies = {
23583
23707
  return !abort;
23584
23708
  }
23585
23709
  update(update) {
23710
+ let reverted = this.pendingContextChange;
23586
23711
  if (!this.applyEdits(update) || !this.rangeIsValid(update.state)) {
23587
23712
  this.pendingContextChange = null;
23588
23713
  this.resetRange(update.state);
23589
23714
  this.editContext.updateText(0, this.editContext.text.length, update.state.doc.sliceString(this.from, this.to));
23590
23715
  this.setSelection(update.state);
23591
- } else if (update.docChanged || update.selectionSet) {
23716
+ } else if (update.docChanged || update.selectionSet || reverted) {
23592
23717
  this.setSelection(update.state);
23593
23718
  }
23594
23719
  if (update.geometryChanged || update.docChanged || update.selectionSet)
@@ -23610,7 +23735,7 @@ const dependencies = {
23610
23735
  revertPending(state) {
23611
23736
  let pending = this.pendingContextChange;
23612
23737
  this.pendingContextChange = null;
23613
- this.editContext.updateText(this.toContextPos(pending.from), this.toContextPos(pending.to + pending.insert.length), state.doc.sliceString(pending.from, pending.to));
23738
+ this.editContext.updateText(this.toContextPos(pending.from), this.toContextPos(pending.from + pending.insert.length), state.doc.sliceString(pending.from, pending.to));
23614
23739
  }
23615
23740
  setSelection(state) {
23616
23741
  let { main } = state.selection;
package/index.html CHANGED
@@ -1,68 +1,36 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vite + TS</title>
8
- <script type="module" src="/src/main.ts"></script>
9
- <style>
10
- #content {
11
- width: 50%;
12
- margin: auto;
13
- }
14
- </style>
15
- </head>
16
- <body>
17
- <div id="content">
18
- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
19
- <faust-editor>
20
- import("stdfaust.lib");
21
- process = no.noise;
22
- </faust-editor>
23
- <p>Nostrum, id deserunt inventore ut veritatis iusto autem soluta officia debitis omnis, dolor sint cum, illo quam dignissimos fuga quod optio nesciunt.</p>
24
- <!-- Need to comment below example due to occurrence of `<`. -->
25
- <faust-editor>
26
- <!--
27
- import("stdfaust.lib");
28
- ctFreq = 500;
29
- q = 5;
30
- gain = 1;
31
- process = no.noise : _ <: fi.resonlp(ctFreq,q,gain),fi.resonlp(ctFreq,q,gain);
32
- -->
33
- </faust-editor>
34
- <p>Ex velit voluptates, laudantium laboriosam est quis veniam temporibus tempore minima aspernatur, modi labore molestiae provident adipisci voluptatem dolorem voluptatibus asperiores possimus.</p>
35
- <faust-editor>
36
- <!--
3
+
4
+ <body>
5
+ <center>
6
+ <H1>Here's an embedded editor!</H1>
7
+ </center>
8
+
9
+ <faust-editor>
10
+ <!--
37
11
  import("stdfaust.lib");
38
12
  ctFreq = hslider("cutoffFrequency",500,50,10000,0.01);
39
13
  q = hslider("q",5,1,30,0.1);
40
14
  gain = hslider("gain",1,0,1,0.01);
41
15
  process = no.noise : fi.resonlp(ctFreq,q,gain);
42
16
  -->
43
- </faust-editor>
44
- <p>Nam tempora officiis sunt nisi cupiditate expedita magnam atque. Unde, itaque.</p>
45
- <faust-editor>
46
- <!--
47
- import("stdfaust.lib");
48
- process =
49
- dm.cubicnl_demo : // distortion
50
- dm.wah4_demo <: // wah pedal
51
- dm.phaser2_demo : // stereo phaser
52
- dm.compressor_demo : // stereo compressor
53
- dm.zita_light; // stereo reverb
54
- -->
55
- </faust-editor>
56
- <p>Minus, ducimus consequuntur? Corrupti animi aut magni nihil, dolor eos tenetur, autem deserunt et iure culpa, suscipit minus quia velit laudantium asperiores.</p>
57
- <faust-widget>
58
- <!--
17
+ </faust-editor>
18
+ <center>
19
+ <H1>Here's a simple DSP widget!</H1>
20
+
21
+ <faust-widget>
22
+ <!--
59
23
  import("stdfaust.lib");
60
- ctFreq = hslider("cutoffFrequency",500,50,10000,0.01);
61
- q = hslider("q",5,1,30,0.1);
62
- gain = hslider("gain",1,0,1,0.01);
63
- process = no.noise : fi.resonlp(ctFreq,q,gain);
24
+ ctFreq = hslider("[0]cutoffFrequency",500,50,10000,0.01) : si.smoo;
25
+ q = hslider("[1]q",5,1,30,0.1) : si.smoo;
26
+ gain = hslider("[2]gain",1,0,1,0.01) : si.smoo;
27
+ t = button("[3]gate") : si.smoo;
28
+ process = no.noise : fi.resonlp(ctFreq,q,gain)*t <: dm.zita_light;
64
29
  -->
65
- </faust-widget>
66
- </div>
67
- </body>
68
- </html>
30
+ </faust-widget>
31
+ </center>
32
+ <script src="faust-web-component.js"></script>
33
+
34
+ </body>
35
+
36
+ </html>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@grame/faust-web-component",
3
3
  "description": "Web component embedding the Faust Compiler",
4
- "version": "0.3.7",
4
+ "version": "0.3.8",
5
5
  "module": "dist/faust-web-component.js",
6
6
  "files": [
7
7
  "src/",
@@ -42,8 +42,8 @@
42
42
  "@codemirror/legacy-modes": "^6.3.3",
43
43
  "@fortawesome/fontawesome-svg-core": "^6.4.2",
44
44
  "@fortawesome/free-solid-svg-icons": "^6.4.2",
45
- "@grame/faustwasm": "^0.5.2",
46
- "@shren/faust-ui": "^1.1.12",
45
+ "@grame/faustwasm": "^0.5.4",
46
+ "@shren/faust-ui": "^1.1.13",
47
47
  "codemirror": "^6.0.1",
48
48
  "split.js": "^1.6.5"
49
49
  }