umaki 0.2.2 → 0.2.3

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/README.md CHANGED
@@ -592,3 +592,24 @@ import { waitForAllMediaLoaded } from 'umaki'
592
592
  console.log(allMediaLoaded) // true または false
593
593
  })()
594
594
  ```
595
+
596
+ ## Using for framework and tools
597
+
598
+ フレームワークまたは各種ツール特有の使い方を以下に記載します。
599
+
600
+ ### Astro or Vite
601
+
602
+ AstroにてSSRする箇所で利用する場合は`vite.ssr.noExternal`に`umaki`を追加してください。
603
+
604
+ ``` ts
605
+ // astro.config.ts
606
+ export default defineConfig(({ mode }) => {
607
+ return {
608
+ vite: {
609
+ ssr: {
610
+ noExternal: ['umaki']
611
+ }
612
+ }
613
+ }
614
+ })
615
+ ```
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../to/toBoolean.cjs.js"),o=async(a,r)=>{if(r&&a.paused){if(s.toBoolean(a.dataset.playing))return;const t=a.play();if(t===void 0)return;try{await t,a.currentTime=0,a.dataset.playing="true"}catch{}}if(!r&&!a.paused){if(!s.toBoolean(a.dataset.playing))return;a.pause(),a.dataset.playing="false"}};exports.videoPlayControl=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../to/toBoolean.cjs.js"),s=async(a,t)=>{if(t&&a.paused){if(i.toBoolean(a.dataset.playing))return;const r=a.play();if(r===void 0)return;try{await r,a.currentTime=0,a.dataset.playing="true"}catch{}}if(!t){if(!i.toBoolean(a.dataset.playing))return;a.pause(),a.dataset.playing="false"}};exports.videoPlayControl=s;
@@ -1,16 +1,16 @@
1
- import { toBoolean as i } from "../to/toBoolean.es.js";
1
+ import { toBoolean as s } from "../to/toBoolean.es.js";
2
2
  const p = async (a, r) => {
3
3
  if (r && a.paused) {
4
- if (i(a.dataset.playing)) return;
5
- const s = a.play();
6
- if (s === void 0) return;
4
+ if (s(a.dataset.playing)) return;
5
+ const i = a.play();
6
+ if (i === void 0) return;
7
7
  try {
8
- await s, a.currentTime = 0, a.dataset.playing = "true";
8
+ await i, a.currentTime = 0, a.dataset.playing = "true";
9
9
  } catch {
10
10
  }
11
11
  }
12
- if (!r && !a.paused) {
13
- if (!i(a.dataset.playing)) return;
12
+ if (!r) {
13
+ if (!s(a.dataset.playing)) return;
14
14
  a.pause(), a.dataset.playing = "false";
15
15
  }
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umaki",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "A utility that is often used in web production.",
5
5
  "author": "TsubasaHiga",
6
6
  "homepage": "https://github.com/TsubasaHiga/umaki",