@pinnacle0/web-ui 0.6.31 → 0.6.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinnacle0/web-ui",
3
- "version": "0.6.31",
3
+ "version": "0.6.33",
4
4
  "author": "Pinnacle",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
@@ -46,8 +46,8 @@
46
46
  "react": "19.2.0",
47
47
  "react-dom": "19.2.0",
48
48
  "react-router-dom": "5.3.0",
49
- "@pinnacle0/webpack-util": "0.8.18",
50
- "@pinnacle0/devtool-util": "1.3.6"
49
+ "@pinnacle0/devtool-util": "1.3.6",
50
+ "@pinnacle0/webpack-util": "0.8.18"
51
51
  },
52
52
  "exports": {
53
53
  "./core/*": {
@@ -1,13 +1,17 @@
1
1
  /**
2
2
  * Orientation detection utility for mobile and desktop devices.
3
3
  *
4
+ * For Android,
4
5
  * Uses the ScreenOrientation API for checking the orientation of the screen.
5
6
  * For Deprecated browsers, it uses the window.orientation API.
6
7
  *
8
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation
9
+ *
7
10
  * For iOS 26.0+ PWA, it does not dispatch any event when the orientation changes,
8
- * so we need to use media queries to check the orientation of the screen.
11
+ * For iOS,
12
+ * Use media queries to check the orientation of the screen for iOS.
9
13
  *
10
- * @see https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation
14
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/orientation
11
15
  * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries
12
16
  */
13
17
  export type OrientationType = "portrait" | "landscape";
@@ -1,27 +1,24 @@
1
1
  /**
2
2
  * Orientation detection utility for mobile and desktop devices.
3
3
  *
4
+ * For Android,
4
5
  * Uses the ScreenOrientation API for checking the orientation of the screen.
5
6
  * For Deprecated browsers, it uses the window.orientation API.
6
7
  *
8
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation
9
+ *
7
10
  * For iOS 26.0+ PWA, it does not dispatch any event when the orientation changes,
8
- * so we need to use media queries to check the orientation of the screen.
11
+ * For iOS,
12
+ * Use media queries to check the orientation of the screen for iOS.
9
13
  *
10
- * @see https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation
14
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/orientation
11
15
  * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries
12
16
  */
13
17
  import { BrowserUtil } from "../BrowserUtil";
14
18
  const supportScreenOrientationAPI = typeof window.screen.orientation !== "undefined";
15
- // TODO: Need to check if iOS 26.0+ PWA bug is fixed in the future.
16
- //
17
- // Cannot use userAgent to check because it freeze at iOS 26.
18
- // ref: https://www.kochava.com/blog/ios-26-apple-freezes-os-version/
19
- // "notation" is a new option in Intl.PluralRules.prototype.resolvedOptions() in iOS 26.
20
- // https://webkit.org/blog/17333/webkit-features-in-safari-26-0/#web-api
21
- const isIOS26PWA = BrowserUtil.os() === "ios" && "notation" in new Intl.PluralRules().resolvedOptions() && "standalone" in window.navigator && window.navigator.standalone;
22
19
  function subscribe(subscriber) {
23
20
  const handler = () => subscriber(current());
24
- if (isIOS26PWA) {
21
+ if (BrowserUtil.os() === "ios") {
25
22
  window.matchMedia("(orientation: portrait)").addEventListener("change", handler);
26
23
  return () => window.matchMedia("(orientation: portrait)").removeEventListener("change", handler);
27
24
  }
@@ -36,7 +33,7 @@ function subscribe(subscriber) {
36
33
  }
37
34
  function current() {
38
35
  try {
39
- if (isIOS26PWA) {
36
+ if (BrowserUtil.os() === "ios") {
40
37
  return window.matchMedia("(orientation: portrait)").matches ? "portrait" : "landscape";
41
38
  }
42
39
  else if (supportScreenOrientationAPI) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/util/OrientationUtil/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GA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