brilliantsole 0.0.29 → 0.0.30

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.
Files changed (105) hide show
  1. package/build/brilliantsole.cjs +5630 -494
  2. package/build/brilliantsole.cjs.map +1 -1
  3. package/build/brilliantsole.js +21293 -3088
  4. package/build/brilliantsole.js.map +1 -1
  5. package/build/brilliantsole.ls.js +23153 -6240
  6. package/build/brilliantsole.ls.js.map +1 -1
  7. package/build/brilliantsole.min.js +1 -1
  8. package/build/brilliantsole.min.js.map +1 -1
  9. package/build/brilliantsole.module.d.ts +1158 -74
  10. package/build/brilliantsole.module.js +21259 -3089
  11. package/build/brilliantsole.module.js.map +1 -1
  12. package/build/brilliantsole.module.min.d.ts +1158 -74
  13. package/build/brilliantsole.module.min.js +1 -1
  14. package/build/brilliantsole.module.min.js.map +1 -1
  15. package/build/brilliantsole.node.module.d.ts +869 -70
  16. package/build/brilliantsole.node.module.js +5608 -495
  17. package/build/brilliantsole.node.module.js.map +1 -1
  18. package/build/dts/BS.d.ts +20 -1
  19. package/build/dts/Device.d.ts +135 -13
  20. package/build/dts/DeviceManager.d.ts +3 -3
  21. package/build/dts/DisplayManager.d.ts +320 -0
  22. package/build/dts/FileTransferManager.d.ts +10 -4
  23. package/build/dts/connection/BaseConnectionManager.d.ts +2 -2
  24. package/build/dts/connection/bluetooth/BluetoothUUID.d.ts +12 -0
  25. package/build/dts/devicePair/DevicePair.d.ts +5 -5
  26. package/build/dts/sensor/SensorConfigurationManager.d.ts +2 -1
  27. package/build/dts/server/BaseClient.d.ts +4 -4
  28. package/build/dts/server/udp/UDPUtils.d.ts +1 -1
  29. package/build/dts/utils/ArrayBufferUtils.d.ts +1 -0
  30. package/build/dts/utils/BitmapUtils.d.ts +17 -0
  31. package/build/dts/utils/ColorUtils.d.ts +5 -0
  32. package/build/dts/utils/DisplayBitmapUtils.d.ts +47 -0
  33. package/build/dts/utils/DisplayCanvasHelper.d.ts +270 -0
  34. package/build/dts/utils/DisplayContextCommand.d.ts +300 -0
  35. package/build/dts/utils/DisplayContextState.d.ts +51 -0
  36. package/build/dts/utils/DisplayContextStateHelper.d.ts +9 -0
  37. package/build/dts/utils/DisplayManagerInterface.d.ts +173 -0
  38. package/build/dts/utils/DisplaySpriteSheetUtils.d.ts +72 -0
  39. package/build/dts/utils/DisplayUtils.d.ts +70 -0
  40. package/build/dts/utils/MathUtils.d.ts +16 -0
  41. package/build/dts/utils/PathUtils.d.ts +4 -0
  42. package/build/dts/utils/RangeHelper.d.ts +7 -0
  43. package/build/dts/utils/SpriteSheetUtils.d.ts +20 -0
  44. package/build/index.d.ts +1156 -72
  45. package/build/index.node.d.ts +867 -68
  46. package/examples/3d-generic/index.html +5 -0
  47. package/examples/3d-generic/script.js +1 -0
  48. package/examples/basic/index.html +335 -0
  49. package/examples/basic/script.js +1303 -3
  50. package/examples/camera/utils.js +1 -1
  51. package/examples/display-3d/index.html +195 -0
  52. package/examples/display-3d/script.js +1235 -0
  53. package/examples/display-canvas/aframe.js +42950 -0
  54. package/examples/display-canvas/index.html +245 -0
  55. package/examples/display-canvas/script.js +2312 -0
  56. package/examples/display-image/index.html +189 -0
  57. package/examples/display-image/script.js +1093 -0
  58. package/examples/display-spritesheet/index.html +960 -0
  59. package/examples/display-spritesheet/script.js +4243 -0
  60. package/examples/display-text/index.html +195 -0
  61. package/examples/display-text/script.js +1418 -0
  62. package/examples/display-wireframe/index.html +204 -0
  63. package/examples/display-wireframe/script.js +1167 -0
  64. package/examples/glasses-gestures/index.html +6 -1
  65. package/examples/glasses-gestures/script.js +10 -8
  66. package/examples/microphone/index.html +3 -1
  67. package/examples/punch/index.html +4 -1
  68. package/examples/server/script.js +0 -1
  69. package/package.json +10 -2
  70. package/src/BS.ts +92 -1
  71. package/src/CameraManager.ts +6 -2
  72. package/src/Device.ts +544 -13
  73. package/src/DisplayManager.ts +2989 -0
  74. package/src/FileTransferManager.ts +79 -26
  75. package/src/InformationManager.ts +8 -7
  76. package/src/MicrophoneManager.ts +10 -3
  77. package/src/TfliteManager.ts +4 -2
  78. package/src/WifiManager.ts +4 -1
  79. package/src/connection/BaseConnectionManager.ts +2 -0
  80. package/src/connection/bluetooth/bluetoothUUIDs.ts +36 -1
  81. package/src/devicePair/DevicePairPressureSensorDataManager.ts +1 -1
  82. package/src/scanner/NobleScanner.ts +1 -1
  83. package/src/sensor/SensorConfigurationManager.ts +16 -8
  84. package/src/server/udp/UDPServer.ts +4 -4
  85. package/src/server/udp/UDPUtils.ts +1 -1
  86. package/src/server/websocket/WebSocketClient.ts +50 -1
  87. package/src/utils/ArrayBufferUtils.ts +23 -5
  88. package/src/utils/AudioUtils.ts +1 -1
  89. package/src/utils/ColorUtils.ts +66 -0
  90. package/src/utils/DisplayBitmapUtils.ts +695 -0
  91. package/src/utils/DisplayCanvasHelper.ts +4222 -0
  92. package/src/utils/DisplayContextCommand.ts +1566 -0
  93. package/src/utils/DisplayContextState.ts +138 -0
  94. package/src/utils/DisplayContextStateHelper.ts +48 -0
  95. package/src/utils/DisplayManagerInterface.ts +1356 -0
  96. package/src/utils/DisplaySpriteSheetUtils.ts +782 -0
  97. package/src/utils/DisplayUtils.ts +529 -0
  98. package/src/utils/EventDispatcher.ts +59 -14
  99. package/src/utils/MathUtils.ts +88 -2
  100. package/src/utils/ObjectUtils.ts +6 -1
  101. package/src/utils/PathUtils.ts +192 -0
  102. package/src/utils/RangeHelper.ts +15 -3
  103. package/src/utils/Timer.ts +1 -1
  104. package/src/utils/environment.ts +15 -6
  105. package/examples/microphone/gender.js +0 -54
@@ -13,6 +13,11 @@
13
13
  #results {
14
14
  font-family: monospace;
15
15
  white-space: pre;
16
+ font-size: xx-large;
17
+ }
18
+
19
+ #gesture {
20
+ font-size: 100px;
16
21
  }
17
22
  </style>
18
23
  </head>
@@ -21,7 +26,7 @@
21
26
  <a href="../../">home</a>
22
27
  </nav>
23
28
 
24
- <h1 id="title"></h1>
29
+ <h1 id="title">Glasses Gestures | Brilliant Sole JavaScript SDK</h1>
25
30
 
26
31
  <button id="toggleConnection">connect</button>
27
32
  <h1 id="gesture"></h1>
@@ -8,17 +8,19 @@ await classifier.init();
8
8
  window.classifier = classifier;
9
9
 
10
10
  let project = classifier.getProjectInfo();
11
- document.querySelector("#title").textContent =
12
- project.owner +
13
- " / " +
14
- project.name +
15
- " (version " +
16
- project.deploy_version +
17
- ")";
11
+ if (false) {
12
+ document.querySelector("#title").textContent =
13
+ project.owner +
14
+ " / " +
15
+ project.name +
16
+ " (version " +
17
+ project.deploy_version +
18
+ ")";
19
+ }
18
20
 
19
21
  const gestureTitle = document.getElementById("gesture");
20
22
 
21
- let threshold = 0.5;
23
+ let threshold = 0.6;
22
24
  /** @param {number[]} features */
23
25
  function classify(features) {
24
26
  try {
@@ -7,7 +7,6 @@
7
7
  <script type="module" src="./script.js"></script>
8
8
  <script type="module" src="./whisper.js"></script>
9
9
  <script type="module" src="./whisper-realtime.js"></script>
10
- <script type="module" src="./gender.js"></script>
11
10
  </head>
12
11
  <style>
13
12
  #zoomview-container,
@@ -18,6 +17,9 @@
18
17
  .highlighted {
19
18
  color: green;
20
19
  }
20
+ #modelResults {
21
+ font-size: 72px;
22
+ }
21
23
  </style>
22
24
  <body>
23
25
  <nav>
@@ -62,13 +62,15 @@
62
62
  id="camera"
63
63
  look-controls="enabled: false;"
64
64
  wasd-controls="enabled: false"
65
- position="0 0.2 0.65"
65
+ position="0 0.20 0.6"
66
66
  rotation="-20 0 0"
67
67
  ></a-camera>
68
68
  <a-sky></a-sky>
69
69
 
70
70
  <a-entity position="0 -0.55 0">
71
71
  <a-sphere
72
+ segments-height="5"
73
+ segments-width="6"
72
74
  id="punchingBag2"
73
75
  class="punchingBag 2"
74
76
  data-section="2"
@@ -128,6 +130,7 @@
128
130
  color="#777"
129
131
  position="0 0 0"
130
132
  static-body
133
+ visible="false"
131
134
  ></a-sphere>
132
135
  </a-entity>
133
136
  </a-scene>
@@ -5,7 +5,6 @@ console.log({ BS });
5
5
 
6
6
  const client = new BS.WebSocketClient();
7
7
  console.log({ client });
8
-
9
8
  window.client = client;
10
9
 
11
10
  // SEARCH PARAMS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brilliantsole",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "JavaScript SDK for BrilliantSole Smart Insoles",
5
5
  "main": "./build/brilliantsole.module.js",
6
6
  "module": "./build/brilliantsole.module.js",
@@ -40,16 +40,20 @@
40
40
  "devDependencies": {
41
41
  "@babel/core": "^7.24.6",
42
42
  "@babel/plugin-proposal-class-properties": "^7.18.6",
43
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
43
44
  "@babel/plugin-proposal-numeric-separator": "^7.18.6",
44
45
  "@babel/plugin-proposal-optional-chaining": "^7.21.0",
45
46
  "@babel/plugin-proposal-private-methods": "^7.18.6",
46
- "@babel/preset-env": "^7.24.6",
47
+ "@babel/plugin-transform-optional-chaining": "^7.27.1",
48
+ "@babel/preset-env": "^7.27.2",
49
+ "@babel/preset-typescript": "^7.27.1",
47
50
  "@rollup/plugin-babel": "^6.0.4",
48
51
  "@rollup/plugin-commonjs": "^25.0.8",
49
52
  "@rollup/plugin-node-resolve": "^15.2.3",
50
53
  "@rollup/plugin-replace": "^5.0.5",
51
54
  "@rollup/plugin-terser": "^0.4.4",
52
55
  "@rollup/plugin-typescript": "^11.1.6",
56
+ "@types/opentype.js": "^1.3.8",
53
57
  "@types/web-bluetooth": "^0.0.20",
54
58
  "@types/ws": "^8.5.10",
55
59
  "axios": "^1.7.7",
@@ -57,8 +61,11 @@
57
61
  "cors": "^2.8.5",
58
62
  "express": "^4.18.3",
59
63
  "ip": "^2.0.1",
64
+ "lz4js": "^0.2.0",
60
65
  "magic-string": "^0.30.5",
61
66
  "nocache": "^4.0.0",
67
+ "opentype.js": "^1.3.4",
68
+ "rgbquant": "^1.1.2",
62
69
  "rollup": "^4.18.0",
63
70
  "rollup-plugin-babel": "^4.4.0",
64
71
  "rollup-plugin-cleanup": "^3.2.1",
@@ -73,6 +80,7 @@
73
80
  "rollup-plugin-uglify": "^6.0.4",
74
81
  "tslib": "^2.6.3",
75
82
  "typescript": "^5.5.3",
83
+ "woff2-encoder": "^2.0.0",
76
84
  "ws": "^8.16.0"
77
85
  },
78
86
  "dependencies": {
package/src/BS.ts CHANGED
@@ -101,6 +101,94 @@ export {
101
101
  MicrophoneConfigurationValues,
102
102
  } from "./MicrophoneManager.ts";
103
103
 
104
+ export {
105
+ DisplayBrightness,
106
+ DisplayBrightnesses,
107
+ DisplaySize,
108
+ DisplayBitmapColorPair,
109
+ DisplayPixelDepths,
110
+ DefaultNumberOfDisplayColors,
111
+ MinSpriteSheetNameLength,
112
+ MaxSpriteSheetNameLength,
113
+ DisplayBitmap,
114
+ DisplaySpriteColorPair,
115
+ DisplayWireframeEdge,
116
+ DisplayWireframe,
117
+ DisplayBezierCurveType,
118
+ DisplayBezierCurveTypes,
119
+ } from "./DisplayManager.ts";
120
+
121
+ export { wait } from "./utils/Timer.ts";
122
+
123
+ export {
124
+ DisplaySegmentCap,
125
+ DisplaySegmentCaps,
126
+ DisplayAlignment,
127
+ DisplayAlignments,
128
+ DisplayDirection,
129
+ DisplayDirections,
130
+ } from "./utils/DisplayContextState.ts";
131
+
132
+ export {
133
+ maxDisplayScale,
134
+ DisplayColorRGB,
135
+ pixelDepthToNumberOfColors,
136
+ displayCurveTypeToNumberOfControlPoints,
137
+ mergeWireframes,
138
+ intersectWireframes,
139
+ } from "./utils/DisplayUtils.ts";
140
+
141
+ export {
142
+ DisplayContextCommand,
143
+ DisplayContextCommandType,
144
+ DisplayContextCommandTypes,
145
+ DisplaySpriteContextCommandType,
146
+ DisplaySpriteContextCommandTypes,
147
+ } from "./utils/DisplayContextCommand.ts";
148
+
149
+ export {
150
+ DisplaySprite,
151
+ DisplaySpriteSheet,
152
+ DisplaySpriteSheetPalette,
153
+ DisplaySpritePaletteSwap,
154
+ parseFont,
155
+ getFontUnicodeRange,
156
+ stringToSprites,
157
+ fontToSpriteSheet,
158
+ DisplaySpriteSubLine,
159
+ DisplaySpriteLine,
160
+ DisplaySpriteLines,
161
+ } from "./utils/DisplaySpriteSheetUtils.ts";
162
+
163
+ /** BROWSER_START */
164
+ export {
165
+ default as DisplayCanvasHelper,
166
+ DisplayCanvasHelperEvent,
167
+ DisplayCanvasHelperEventMap,
168
+ DisplayCanvasHelperEventListenerMap,
169
+ } from "./utils/DisplayCanvasHelper.ts";
170
+ /** BROWSER_END */
171
+
172
+ /** BROWSER_START */
173
+ export { Font, Glyph } from "opentype.js";
174
+ /** BROWSER_END */
175
+
176
+ /** BROWSER_START */
177
+ export {
178
+ resizeAndQuantizeImage,
179
+ quantizeImage,
180
+ imageToSprite,
181
+ imageToSpriteSheet,
182
+ canvasToSprite,
183
+ canvasToSpriteSheet,
184
+ resizeImage,
185
+ imageToBitmaps,
186
+ canvasToBitmaps,
187
+ } from "./utils/DisplayBitmapUtils.ts";
188
+ /** BROWSER_END */
189
+
190
+ export { rgbToHex, hexToRGB } from "./utils/ColorUtils.ts";
191
+
104
192
  export {
105
193
  default as DevicePair,
106
194
  DevicePairEvent,
@@ -132,5 +220,8 @@ export { default as UDPServer } from "./server/udp/UDPServer.ts";
132
220
  /** BROWSER_START */
133
221
  export { default as WebSocketClient } from "./server/websocket/WebSocketClient.ts";
134
222
  /** BROWSER_END */
223
+ /** LS_START */
224
+ export { default as WebSocketClient } from "./server/websocket/WebSocketClient.ts";
225
+ /** LS_END */
135
226
 
136
- export { default as RangeHelper } from "./utils/RangeHelper.ts";
227
+ export { default as RangeHelper, Range } from "./utils/RangeHelper.ts";
@@ -4,7 +4,10 @@ import { isInNode } from "./utils/environment.ts";
4
4
  import EventDispatcher from "./utils/EventDispatcher.ts";
5
5
  import autoBind from "auto-bind";
6
6
  import { parseMessage } from "./utils/ParseUtils.ts";
7
- import { concatenateArrayBuffers } from "./utils/ArrayBufferUtils.ts";
7
+ import {
8
+ concatenateArrayBuffers,
9
+ UInt8ByteBuffer,
10
+ } from "./utils/ArrayBufferUtils.ts";
8
11
 
9
12
  const _console = createConsole("CameraManager", { log: false });
10
13
 
@@ -161,11 +164,12 @@ class CameraManager {
161
164
  const promise = this.waitForEvent("cameraStatus");
162
165
  _console.log(`setting command "${command}"`);
163
166
  const commandEnum = CameraCommands.indexOf(command);
167
+
164
168
  this.sendMessage(
165
169
  [
166
170
  {
167
171
  type: "cameraCommand",
168
- data: Uint8Array.from([commandEnum]).buffer,
172
+ data: UInt8ByteBuffer(commandEnum),
169
173
  },
170
174
  ],
171
175
  sendImmediately