@ixfx/ui 0.56.0 → 0.56.2

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/LICENSE CHANGED
@@ -1,6 +1,31 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021-2025 Clint Heyer
3
+ Copyright (c) 2021-2026 Clint Heyer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ Package: bezier-js
26
+ https://github.com/Pomax/bezierjs
27
+
28
+ Copyright (c) 2023 Pomax
4
29
 
5
30
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
31
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.d.ts CHANGED
@@ -6,7 +6,6 @@ import { Interval, Pathed, RecursivePartial } from "@ixfx/core";
6
6
  import { HslScalar } from "@ixfx/visual/colour";
7
7
 
8
8
  //#region src/rx/browser-resize.d.ts
9
-
10
9
  /**
11
10
  * Observe when element resizes. Specify `interval` to debounce, uses 100ms by default.
12
11
  *
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as __exportAll } from "./chunk-CzXV76rE.js";
1
+ import { t as __exportAll } from "./chunk-BN_g-Awi.js";
2
2
  import * as RxFrom from "@ixfx/rx/from";
3
3
  import { eventTrigger, observable } from "@ixfx/rx/from";
4
4
  import { debounce } from "@ixfx/rx/ops";
@@ -405,8 +405,8 @@ function domForm(formElOrQuery, options = {}) {
405
405
  * @returns
406
406
  */
407
407
  function fromDomQuery(query) {
408
- const elements$1 = [...document.querySelectorAll(query)];
409
- return Rx.From.object(elements$1);
408
+ const elements = [...document.querySelectorAll(query)];
409
+ return Rx.From.object(elements);
410
410
  }
411
411
  /**
412
412
  * Updates an element's `textContent` when the source value changes.
@@ -542,64 +542,64 @@ const bindElement = (source, elOrQuery, ...binds) => {
542
542
  let b = [];
543
543
  if (binds.length === 0) b.push({ elField: `textContent` });
544
544
  else b = [...binds];
545
- return bind(source, ...b.map((bind$1) => {
546
- if (`element` in bind$1) return bind$1;
545
+ return bind(source, ...b.map((bind) => {
546
+ if (`element` in bind) return bind;
547
547
  return {
548
- ...bind$1,
548
+ ...bind,
549
549
  element: el
550
550
  };
551
551
  }));
552
552
  };
553
- const resolveBindUpdater = (bind$1, element) => {
554
- const b = resolveBindUpdaterBase(bind$1);
553
+ const resolveBindUpdater = (bind, element) => {
554
+ const b = resolveBindUpdaterBase(bind);
555
555
  return (value) => {
556
556
  b(value, element);
557
557
  };
558
558
  };
559
- const resolveBindUpdaterBase = (bind$1) => {
560
- if (bind$1.elField !== void 0 || bind$1.cssVariable === void 0 && bind$1.attribName === void 0 && bind$1.cssProperty === void 0 && bind$1.textContent === void 0 && bind$1.htmlContent === void 0) {
561
- const field = bind$1.elField ?? `textContent`;
559
+ const resolveBindUpdaterBase = (bind) => {
560
+ if (bind.elField !== void 0 || bind.cssVariable === void 0 && bind.attribName === void 0 && bind.cssProperty === void 0 && bind.textContent === void 0 && bind.htmlContent === void 0) {
561
+ const field = bind.elField ?? `textContent`;
562
562
  return (v, element) => {
563
563
  element[field] = v;
564
564
  };
565
565
  }
566
- if (bind$1.attribName !== void 0) {
567
- const attrib = bind$1.attribName;
566
+ if (bind.attribName !== void 0) {
567
+ const attrib = bind.attribName;
568
568
  return (v, element) => {
569
569
  element.setAttribute(attrib, v);
570
570
  };
571
571
  }
572
- if (bind$1.textContent) return (v, element) => {
572
+ if (bind.textContent) return (v, element) => {
573
573
  element.textContent = v;
574
574
  };
575
- if (bind$1.htmlContent) return (v, element) => {
575
+ if (bind.htmlContent) return (v, element) => {
576
576
  element.innerHTML = v;
577
577
  };
578
- if (bind$1.cssVariable !== void 0) {
579
- let css = bind$1.cssVariable;
578
+ if (bind.cssVariable !== void 0) {
579
+ let css = bind.cssVariable;
580
580
  if (!css.startsWith(`--`)) css = `--` + css;
581
581
  return (v, element) => {
582
582
  element.style.setProperty(css, v);
583
583
  };
584
584
  }
585
- if (bind$1.cssProperty !== void 0) return (v, element) => {
586
- element.style[bind$1.cssProperty] = v;
585
+ if (bind.cssProperty !== void 0) return (v, element) => {
586
+ element.style[bind.cssProperty] = v;
587
587
  };
588
588
  return (_, _element) => {
589
589
  /** no-op */
590
590
  };
591
591
  };
592
- const resolveTransform = (bind$1) => {
593
- if (!bind$1.transform && !bind$1.transformValue) return;
594
- if (bind$1.transformValue) {
595
- if (bind$1.sourceField === void 0) throw new Error(`Expects 'sourceField' to be set when 'transformValue' is set`);
592
+ const resolveTransform = (bind) => {
593
+ if (!bind.transform && !bind.transformValue) return;
594
+ if (bind.transformValue) {
595
+ if (bind.sourceField === void 0) throw new Error(`Expects 'sourceField' to be set when 'transformValue' is set`);
596
596
  return (value) => {
597
- const fieldValue = value[bind$1.sourceField];
598
- return bind$1.transformValue(fieldValue);
597
+ const fieldValue = value[bind.sourceField];
598
+ return bind.transformValue(fieldValue);
599
599
  };
600
- } else if (bind$1.transform) {
601
- if (bind$1.sourceField !== void 0) throw new Error(`If 'transform' is set, 'sourceField' is ignored`);
602
- return (value) => bind$1.transform(value);
600
+ } else if (bind.transform) {
601
+ if (bind.sourceField !== void 0) throw new Error(`If 'transform' is set, 'sourceField' is ignored`);
602
+ return (value) => bind.transform(value);
603
603
  }
604
604
  };
605
605
  /**
@@ -634,26 +634,26 @@ const resolveTransform = (bind$1) => {
634
634
  * @returns
635
635
  */
636
636
  const bind = (source, ...bindsUnresolvedElements) => {
637
- const binds = bindsUnresolvedElements.map((bind$1) => {
638
- if (bind$1.element && bind$1.element !== void 0) return bind$1;
639
- if (bind$1.query) return {
640
- ...bind$1,
641
- element: resolveEl(bind$1.query)
637
+ const binds = bindsUnresolvedElements.map((bind) => {
638
+ if (bind.element && bind.element !== void 0) return bind;
639
+ if (bind.query) return {
640
+ ...bind,
641
+ element: resolveEl(bind.query)
642
642
  };
643
- throw new Error(`Unable to resolve element. Missing 'element' or 'query' values on bind. ${JSON.stringify(bind$1)}`);
643
+ throw new Error(`Unable to resolve element. Missing 'element' or 'query' values on bind. ${JSON.stringify(bind)}`);
644
644
  });
645
- const bindsResolved = binds.map((bind$1) => ({
646
- update: resolveBindUpdater(bind$1, bind$1.element),
647
- transformer: resolveTransform(bind$1),
648
- sourceField: bind$1.sourceField
645
+ const bindsResolved = binds.map((bind) => ({
646
+ update: resolveBindUpdater(bind, bind.element),
647
+ transformer: resolveTransform(bind),
648
+ sourceField: bind.sourceField
649
649
  }));
650
650
  const update = (value) => {
651
- for (const bind$1 of bindsResolved) if (bind$1.transformer) bind$1.update(bind$1.transformer(value));
651
+ for (const bind of bindsResolved) if (bind.transformer) bind.update(bind.transformer(value));
652
652
  else {
653
- const v = bind$1.sourceField ? value[bind$1.sourceField] : value;
654
- if (typeof v === `object`) if (bind$1.sourceField) bind$1.update(JSON.stringify(v));
655
- else bind$1.update(JSON.stringify(v));
656
- else bind$1.update(v);
653
+ const v = bind.sourceField ? value[bind.sourceField] : value;
654
+ if (typeof v === `object`) if (bind.sourceField) bind.update(JSON.stringify(v));
655
+ else bind.update(JSON.stringify(v));
656
+ else bind.update(v);
657
657
  }
658
658
  };
659
659
  const unsub = source.on((message) => {
@@ -663,7 +663,7 @@ const bind = (source, ...bindsUnresolvedElements) => {
663
663
  if (Rx.hasLast(source)) update(source.last());
664
664
  return { remove: (removeElements) => {
665
665
  unsub();
666
- if (removeElements) for (const bind$1 of binds) bind$1.element.remove();
666
+ if (removeElements) for (const bind of binds) bind.element.remove();
667
667
  } };
668
668
  };
669
669
  /**
@@ -806,8 +806,8 @@ const elements = (source, options) => {
806
806
  });
807
807
  }
808
808
  const findBind = (path) => {
809
- const bind$1 = findBySomeKey(binds, stringSegmentsWholeToEnd(path));
810
- if (bind$1 !== void 0) return bind$1;
809
+ const bind = findBySomeKey(binds, stringSegmentsWholeToEnd(path));
810
+ if (bind !== void 0) return bind;
811
811
  if (!path.includes(`.`)) return binds.get(`_root`);
812
812
  };
813
813
  function* ancestorBinds(path) {
@@ -817,9 +817,9 @@ const elements = (source, options) => {
817
817
  const create = (path, value) => {
818
818
  const rootedPath = getRootedPath(path);
819
819
  console.log(`Rx.Dom.elements.create: ${path} rooted: ${rootedPath} value: ${JSON.stringify(value)}`);
820
- const bind$1 = findBind(getRootedPath(path));
820
+ const bind = findBind(getRootedPath(path));
821
821
  let tagName = defaultTag;
822
- if (bind$1?.tagName) tagName = bind$1.tagName;
822
+ if (bind?.tagName) tagName = bind.tagName;
823
823
  const el = document.createElement(tagName);
824
824
  el.setAttribute(`data-path`, path);
825
825
  update(path, el, value);
@@ -836,17 +836,17 @@ const elements = (source, options) => {
836
836
  };
837
837
  const update = (path, el, value) => {
838
838
  console.log(`Rx.dom.update path: ${path} value:`, value);
839
- const bind$1 = findBind(getRootedPath(path));
840
- if (bind$1 === void 0) {
839
+ const bind = findBind(getRootedPath(path));
840
+ if (bind === void 0) {
841
841
  if (typeof value === `object`) value = JSON.stringify(value);
842
842
  el.textContent = value;
843
843
  } else {
844
- if (bind$1.transform) value = bind$1.transform(value);
845
- bind$1.update(value, el);
844
+ if (bind.transform) value = bind.transform(value);
845
+ bind.update(value, el);
846
846
  }
847
847
  };
848
- const changes = (changes$1) => {
849
- const queue = new QueueMutable({}, changes$1);
848
+ const changes = (changes) => {
849
+ const queue = new QueueMutable({}, changes);
850
850
  let d = queue.dequeue();
851
851
  const seenPaths = /* @__PURE__ */ new Set();
852
852
  while (d !== void 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixfx/ui",
3
- "version": "0.56.0",
3
+ "version": "0.56.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -8,16 +8,38 @@
8
8
  "dist"
9
9
  ],
10
10
  "dependencies": {
11
- "@ixfx/core": "0.56.0",
12
- "@ixfx/collections": "0.56.0",
13
- "@ixfx/dom": "0.56.0",
14
- "@ixfx/visual": "0.56.0",
15
- "@ixfx/rx": "0.56.0"
11
+ "@ixfx/core": "0.56.2",
12
+ "@ixfx/dom": "0.56.2",
13
+ "@ixfx/collections": "0.56.2",
14
+ "@ixfx/visual": "0.56.2",
15
+ "@ixfx/rx": "0.56.2"
16
16
  },
17
17
  "exports": {
18
18
  ".": "./dist/index.js",
19
19
  "./package.json": "./package.json"
20
20
  },
21
- "scripts": {},
22
- "main": "dist/src/index.js"
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "description": "ixfx ui",
25
+ "keywords": [
26
+ "ixfx",
27
+ "interactivity",
28
+ "ui"
29
+ ],
30
+ "homepage": "https://ixfxfun.dev",
31
+ "bugs": {
32
+ "url": "https://github.com/clinth/ixfx/issues"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/clinth/ixfx.git",
37
+ "directory": "packages/ui"
38
+ },
39
+ "author": "Clint Heyer <clint@thestaticvoid.net>",
40
+ "engines": {
41
+ "node": ">=24.0.0"
42
+ },
43
+ "main": "./dist/index.js",
44
+ "scripts": {}
23
45
  }
File without changes