@glasshome/widget-sdk 1.27.0 → 1.27.1

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.
@@ -5566,5 +5566,149 @@
5566
5566
  "useWidgetViewer",
5567
5567
  "widgetFields",
5568
5568
  "z"
5569
+ ],
5570
+ "1.27.1": [
5571
+ "Badge",
5572
+ "Button",
5573
+ "ButtonGroup",
5574
+ "Carousel",
5575
+ "CarouselContent",
5576
+ "CarouselDots",
5577
+ "CarouselItem",
5578
+ "CarouselNext",
5579
+ "CarouselPrevious",
5580
+ "ColorDisc",
5581
+ "ColorSlider",
5582
+ "ColorWheel",
5583
+ "CountPill",
5584
+ "Icon",
5585
+ "Input",
5586
+ "Label",
5587
+ "PanelEntityRow",
5588
+ "PanelFacts",
5589
+ "PanelRow",
5590
+ "PanelRows",
5591
+ "PanelSection",
5592
+ "Progress",
5593
+ "ResponsiveDialog",
5594
+ "ResponsiveDialogBody",
5595
+ "ResponsiveDialogClose",
5596
+ "ResponsiveDialogContent",
5597
+ "ResponsiveDialogDescription",
5598
+ "ResponsiveDialogFooter",
5599
+ "ResponsiveDialogHeader",
5600
+ "ResponsiveDialogTitle",
5601
+ "SDK_VERSION",
5602
+ "SchemaForm",
5603
+ "SectionIcon",
5604
+ "SectionTitle",
5605
+ "Select",
5606
+ "SelectContent",
5607
+ "SelectItem",
5608
+ "SelectTrigger",
5609
+ "SelectValue",
5610
+ "Slider",
5611
+ "SwatchPicker",
5612
+ "Switch",
5613
+ "Tabs",
5614
+ "TabsContent",
5615
+ "TabsList",
5616
+ "TabsTrigger",
5617
+ "TemperatureBar",
5618
+ "Toggle",
5619
+ "ToggleGroup",
5620
+ "ToggleGroupItem",
5621
+ "ToneSchema",
5622
+ "Widget",
5623
+ "WidgetAction",
5624
+ "WidgetBackdrop",
5625
+ "WidgetChip",
5626
+ "WidgetChoice",
5627
+ "WidgetContent",
5628
+ "WidgetControls",
5629
+ "WidgetCtx",
5630
+ "WidgetDebugTab",
5631
+ "WidgetDebugView",
5632
+ "WidgetDialog",
5633
+ "WidgetGlyph",
5634
+ "WidgetHead",
5635
+ "WidgetHero",
5636
+ "WidgetIcon",
5637
+ "WidgetLayer",
5638
+ "WidgetManifestSchema",
5639
+ "WidgetSizeCtx",
5640
+ "WidgetSliderFill",
5641
+ "WidgetStatus",
5642
+ "WidgetStepper",
5643
+ "WidgetTitle",
5644
+ "WidgetValue",
5645
+ "buildDebugData",
5646
+ "byDomain",
5647
+ "calculateLightGroup",
5648
+ "calculateSensorGroup",
5649
+ "copyText",
5650
+ "countActiveEntities",
5651
+ "defineConfig",
5652
+ "defineWidget",
5653
+ "deprecations",
5654
+ "field",
5655
+ "formatDeprecation",
5656
+ "formatSchemaError",
5657
+ "getEntityAttribute",
5658
+ "getForecasts",
5659
+ "getStream",
5660
+ "getWebRtcClientConfig",
5661
+ "hassMediaUrl",
5662
+ "imagePreset",
5663
+ "imageSrc",
5664
+ "imageUrl",
5665
+ "injectTokens",
5666
+ "isDark",
5667
+ "isEntityActive",
5668
+ "isPanelControllable",
5669
+ "mediaUrl",
5670
+ "monotoneCubicPath",
5671
+ "parseColor",
5672
+ "presetValue",
5673
+ "sendWebRtcCandidate",
5674
+ "startWebRtcSession",
5675
+ "state",
5676
+ "svgColors",
5677
+ "trackEntityHistory",
5678
+ "untrackEntityHistory",
5679
+ "useArea",
5680
+ "useCalendarEvents",
5681
+ "useCamera",
5682
+ "useConfirm",
5683
+ "useConnection",
5684
+ "useCopyText",
5685
+ "useCurrency",
5686
+ "useDaylight",
5687
+ "useEntities",
5688
+ "useEntity",
5689
+ "useEntityHistory",
5690
+ "useEntityStatistics",
5691
+ "useForecast",
5692
+ "useHassConfig",
5693
+ "useIntersectionPause",
5694
+ "useLocale",
5695
+ "useMaterial",
5696
+ "useReducedMotion",
5697
+ "useService",
5698
+ "useStore",
5699
+ "useTemperatureUnit",
5700
+ "useToggle",
5701
+ "useTurnOff",
5702
+ "useTurnOn",
5703
+ "useUnitSystem",
5704
+ "useWidgetContext",
5705
+ "useWidgetDashboard",
5706
+ "useWidgetDialog",
5707
+ "useWidgetDimensions",
5708
+ "useWidgetEntityGroup",
5709
+ "useWidgetGestures",
5710
+ "useWidgetViewer",
5711
+ "widgetFields",
5712
+ "z"
5569
5713
  ]
5570
5714
  }
package/dist/index.js CHANGED
@@ -281,7 +281,8 @@ function Mn(e, t) {
281
281
  holdOnly: !1,
282
282
  holdTimer: null,
283
283
  graceTimer: null,
284
- element: null
284
+ element: null,
285
+ startValue: void 0
285
286
  }, [o, s] = k(null), c = null, l = null, u = null, [d, f] = k(null);
286
287
  function p(e) {
287
288
  e !== l && (u && u.disconnect(), u = new ResizeObserver((e) => {
@@ -312,14 +313,15 @@ function Mn(e, t) {
312
313
  once: !0
313
314
  });
314
315
  }, g = () => {
315
- a.isDown = !1, a.hasMoved = !1, a.sliding = !1, a.holdOnly = !1;
316
+ a.isDown = !1, a.hasMoved = !1, a.sliding = !1, a.holdOnly = !1, a.startValue = void 0;
316
317
  }, _ = (e) => {
317
318
  let n = i().slide;
318
319
  return n?.orientation === "horizontal" ? "horizontal" : n?.orientation === "vertical" ? "vertical" : e && (c || p(e), c) ? c.height > c.width ? "vertical" : "horizontal" : (t?.() ?? "horizontal") === "horizontal" ? "horizontal" : "vertical";
319
320
  }, v = (e) => {
321
+ if (e.pointerType === "touch" && !e.isPrimary) return;
320
322
  let t = i(), r = e.target instanceof Element ? e.target.closest(`${jn}, .glasshome-widget-controls`) : null, o = r !== null && r !== e.currentTarget;
321
323
  if (!(o ? !t.hold : !t.tap && !t.hold && !t.slide)) {
322
- if (a.isDown = !0, a.holdOnly = o, a.isTouch = e.pointerType === "touch", a.element = e.currentTarget, p(a.element), a.startX = e.clientX, a.startY = e.clientY, a.startTime = Date.now(), a.hasMoved = !1, a.sliding = !1, t.hold) {
324
+ if (a.isDown = !0, a.holdOnly = o, a.isTouch = e.pointerType === "touch", a.element = e.currentTarget, p(a.element), a.startX = e.clientX, a.startY = e.clientY, a.startTime = Date.now(), a.hasMoved = !1, a.sliding = !1, a.startValue = t.slide?.value, t.hold) {
323
325
  let r = t.hold.delay ?? qe, i = a.element.getBoundingClientRect(), o = e.clientX - i.left, c = e.clientY - i.top, l = Math.hypot(Math.max(o, i.width - o), Math.max(c, i.height - c));
324
326
  a.graceTimer = setTimeout(() => {
325
327
  a.graceTimer = null, s({
@@ -361,6 +363,8 @@ function Mn(e, t) {
361
363
  g();
362
364
  }, x = (e) => {
363
365
  m();
366
+ let t = i().slide;
367
+ a.sliding && t && a.startValue !== void 0 && t.onChange(a.startValue);
364
368
  try {
365
369
  e.currentTarget.releasePointerCapture(e.pointerId);
366
370
  } catch {}
@@ -3172,7 +3176,7 @@ function Oo(e) {
3172
3176
  //#region src/version.ts
3173
3177
  var ko = {
3174
3178
  name: "@glasshome/widget-sdk",
3175
- version: "1.27.0",
3179
+ version: "1.27.1",
3176
3180
  description: "SDK for building GlassHome dashboard widgets with SolidJS",
3177
3181
  keywords: [
3178
3182
  "dashboard",
@@ -3244,7 +3248,7 @@ var ko = {
3244
3248
  lint: "oxlint --type-aware . && oxfmt --check ."
3245
3249
  },
3246
3250
  dependencies: {
3247
- "@glasshome/widget-contract": "0.6.0",
3251
+ "@glasshome/widget-contract": "0.6.1",
3248
3252
  "@tailwindcss/vite": "^4.1.13",
3249
3253
  clsx: "^2.1.1",
3250
3254
  "happy-dom": "^20.0.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glasshome/widget-sdk",
3
- "version": "1.27.0",
3
+ "version": "1.27.1",
4
4
  "description": "SDK for building GlassHome dashboard widgets with SolidJS",
5
5
  "keywords": [
6
6
  "dashboard",
@@ -76,7 +76,7 @@
76
76
  "lint": "oxlint --type-aware . && oxfmt --check ."
77
77
  },
78
78
  "dependencies": {
79
- "@glasshome/widget-contract": "0.6.0",
79
+ "@glasshome/widget-contract": "0.6.1",
80
80
  "@tailwindcss/vite": "^4.1.13",
81
81
  "clsx": "^2.1.1",
82
82
  "happy-dom": "^20.0.0",