@thi.ng/imgui 2.2.13 → 2.2.15

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/hash.js CHANGED
@@ -1,48 +1,20 @@
1
1
  import { hash } from "@thi.ng/vectors/hash";
2
2
  const BUF = new Array(1024);
3
- /**
4
- * Encodes given string into array of its char codes. If `buf` is not
5
- * given, writes results into a shared, pre-defined array (use only for
6
- * ephemeral purposes).
7
- *
8
- * @param txt -
9
- * @param buf -
10
- */
11
- export const encodeString = (txt, buf = BUF) => {
12
- const n = (buf.length = txt.length);
13
- for (let i = 0; i < n; i++) {
14
- buf[i] = txt.charCodeAt(i);
15
- }
16
- return buf;
3
+ const encodeString = (txt, buf = BUF) => {
4
+ const n = buf.length = txt.length;
5
+ for (let i = 0; i < n; i++) {
6
+ buf[i] = txt.charCodeAt(i);
7
+ }
8
+ return buf;
9
+ };
10
+ const hashString = (txt) => hash(encodeString(txt));
11
+ const mixHash = (key, txt) => key ^ hashString(txt);
12
+ const labelHash = (key, label, disabled) => mixHash(key + ~~disabled, label);
13
+ const valHash = (key, val, disabled) => mixHash(key + ~~disabled, String(val));
14
+ export {
15
+ encodeString,
16
+ hashString,
17
+ labelHash,
18
+ mixHash,
19
+ valHash
17
20
  };
18
- /**
19
- * Returns Murmur3 hashcode for given string.
20
- *
21
- * @param txt -
22
- */
23
- export const hashString = (txt) => hash(encodeString(txt));
24
- /**
25
- * Mixes existing hash with that of given string.
26
- *
27
- * @param key -
28
- * @param txt -
29
- */
30
- export const mixHash = (key, txt) => key ^ hashString(txt);
31
- /**
32
- * Hash helper for labels. Mixes existing hash with given label and
33
- * GUI's disabled flag.
34
- *
35
- * @param key -
36
- * @param label -
37
- * @param disabled -
38
- */
39
- export const labelHash = (key, label, disabled) => mixHash(key + ~~disabled, label);
40
- /**
41
- * Hash helper for numeric value labels. Mixes existing hash with given
42
- * value and GUI's disabled flag.
43
- *
44
- * @param key -
45
- * @param val -
46
- * @param disabled -
47
- */
48
- export const valHash = (key, val, disabled) => mixHash(key + ~~disabled, String(val));
package/layout.js CHANGED
@@ -1,2 +1,5 @@
1
1
  import { isLayout } from "@thi.ng/layout/checks";
2
- export const layoutBox = (layout, spans) => (isLayout(layout) ? layout.next(spans) : layout);
2
+ const layoutBox = (layout, spans) => isLayout(layout) ? layout.next(spans) : layout;
3
+ export {
4
+ layoutBox
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/imgui",
3
- "version": "2.2.13",
3
+ "version": "2.2.15",
4
4
  "description": "Immediate mode GUI with flexible state handling & data only shape output",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -24,7 +24,9 @@
24
24
  "author": "Karsten Schmidt (https://thi.ng)",
25
25
  "license": "Apache-2.0",
26
26
  "scripts": {
27
- "build": "yarn clean && tsc --declaration",
27
+ "build": "yarn build:esbuild && yarn build:decl",
28
+ "build:decl": "tsc --declaration --emitDeclarationOnly",
29
+ "build:esbuild": "esbuild --format=esm --platform=neutral --target=es2022 --tsconfig=tsconfig.json --outdir=. src/**/*.ts",
28
30
  "clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc behaviors components",
29
31
  "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
32
  "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
@@ -33,19 +35,20 @@
33
35
  "test": "bun test"
34
36
  },
35
37
  "dependencies": {
36
- "@thi.ng/api": "^8.9.11",
37
- "@thi.ng/checks": "^3.4.11",
38
- "@thi.ng/geom": "^6.0.7",
39
- "@thi.ng/geom-api": "^3.4.49",
40
- "@thi.ng/geom-isec": "^2.1.91",
41
- "@thi.ng/geom-tessellate": "^2.1.92",
42
- "@thi.ng/layout": "^3.0.6",
43
- "@thi.ng/math": "^5.7.6",
44
- "@thi.ng/transducers": "^8.8.14",
45
- "@thi.ng/vectors": "^7.8.8"
38
+ "@thi.ng/api": "^8.9.12",
39
+ "@thi.ng/checks": "^3.4.12",
40
+ "@thi.ng/geom": "^6.0.9",
41
+ "@thi.ng/geom-api": "^3.4.51",
42
+ "@thi.ng/geom-isec": "^2.1.93",
43
+ "@thi.ng/geom-tessellate": "^2.1.94",
44
+ "@thi.ng/layout": "^3.0.7",
45
+ "@thi.ng/math": "^5.7.7",
46
+ "@thi.ng/transducers": "^8.8.15",
47
+ "@thi.ng/vectors": "^7.8.10"
46
48
  },
47
49
  "devDependencies": {
48
50
  "@microsoft/api-extractor": "^7.38.3",
51
+ "esbuild": "^0.19.8",
49
52
  "rimraf": "^5.0.5",
50
53
  "tools": "^0.0.1",
51
54
  "typedoc": "^0.25.4",
@@ -156,5 +159,5 @@
156
159
  ],
157
160
  "year": 2019
158
161
  },
159
- "gitHead": "25f2ac8ff795a432a930119661b364d4d93b59a0\n"
162
+ "gitHead": "22e36fa838e5431d40165384918b395603bbd92f\n"
160
163
  }