@novely/solid-renderer 0.22.0 → 0.22.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.
package/dist/index.jsx CHANGED
@@ -4292,6 +4292,23 @@ var createRootSetter = (getContext) => {
4292
4292
  }
4293
4293
  };
4294
4294
  };
4295
+ var vibrationPossible = /* @__PURE__ */ (() => {
4296
+ let can = false;
4297
+ const onPointerDown = () => {
4298
+ can = true;
4299
+ document.removeEventListener("pointerdown", onPointerDown);
4300
+ };
4301
+ document.addEventListener("pointerdown", onPointerDown);
4302
+ return () => can;
4303
+ })();
4304
+ var vibrate = (pattern) => {
4305
+ if (vibrationPossible() && "vibrate" in navigator) {
4306
+ try {
4307
+ navigator.vibrate(pattern);
4308
+ } catch {
4309
+ }
4310
+ }
4311
+ };
4295
4312
  var toMedia = (media) => {
4296
4313
  if (media === "portrait" || media === "landscape") {
4297
4314
  return `(orientation: ${media})`;
@@ -4490,6 +4507,7 @@ var handleInputAction = ($contextState, options, context, label, onInput, setup,
4490
4507
  });
4491
4508
  input.dispatchEvent(new InputEvent("input", { bubbles: true }));
4492
4509
  };
4510
+ var handleVibrateAction = vibrate;
4493
4511
 
4494
4512
  // src/emitter.ts
4495
4513
  var createEmitter = () => {
@@ -4579,23 +4597,6 @@ var simple = (fn) => {
4579
4597
  return result;
4580
4598
  };
4581
4599
  };
4582
- var vibrationPossible = (() => {
4583
- let can = false;
4584
- const onPointerDown = () => {
4585
- can = true;
4586
- document.removeEventListener("pointerdown", onPointerDown);
4587
- };
4588
- document.addEventListener("pointerdown", onPointerDown);
4589
- return () => can;
4590
- })();
4591
- var vibrate = (pattern) => {
4592
- if (vibrationPossible() && "vibrate" in navigator) {
4593
- try {
4594
- navigator.vibrate(pattern);
4595
- } catch {
4596
- }
4597
- }
4598
- };
4599
4600
  var getDocumentStyles = () => {
4600
4601
  let css = "";
4601
4602
  for (const styleSheet of Array.from(document.styleSheets)) {
@@ -6136,7 +6137,7 @@ var createSolidRenderer = ({
6136
6137
  handleClearCustomAction($contextState, fn);
6137
6138
  },
6138
6139
  vibrate(pattern) {
6139
- vibrate(pattern);
6140
+ handleVibrateAction(pattern);
6140
6141
  },
6141
6142
  text(content, resolve) {
6142
6143
  handleTextAction($contextState, content, resolve);
package/dist/utils.d.ts CHANGED
@@ -13,7 +13,5 @@ declare const canvasDrawImages: (canvas: HTMLCanvasElement | undefined, ctx: Can
13
13
  declare const url: <T extends string>(str: T) => `url(${T})`;
14
14
  declare const onKey: (cb: (event: KeyboardEvent) => void, ...keys: string[]) => (e: KeyboardEvent) => void;
15
15
  declare const simple: <T extends unknown[], R>(fn: (...args: T) => R) => (...args: T) => R;
16
- declare const vibrationPossible: () => boolean;
17
- declare const vibrate: (pattern: VibratePattern) => void;
18
16
  declare const getDocumentStyles: () => string;
19
- export { isCSSImage, canvasDrawImages, url, createImage, capitalize, onKey, findLast, simple, vibrationPossible, vibrate, getDocumentStyles, };
17
+ export { isCSSImage, canvasDrawImages, url, createImage, capitalize, onKey, findLast, simple, getDocumentStyles, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novely/solid-renderer",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@novely/core": "*",
23
- "@novely/renderer-toolkit": "workspace:^",
23
+ "@novely/renderer-toolkit": "*",
24
24
  "@novely/typewriter": "*",
25
25
  "retrieved": "^0.1.0",
26
26
  "solid-js": "1.8.5"