@stacksjs/mobile 0.74.51 → 0.74.53

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.d.ts CHANGED
@@ -255,7 +255,7 @@ export declare interface LocationApi {
255
255
  readRecording: () => Promise<Location[]>
256
256
  }
257
257
  export declare interface ShareApi {
258
- share: (options: ShareOptions) => Promise<void>
258
+ share: (options: ShareOptions) => Promise<boolean>
259
259
  isAvailable: () => boolean
260
260
  }
261
261
  export declare interface LifecycleApi {
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import*as p from"craft-native/mobile";var{biometrics:f,camera:l,device:u,haptics:A,lifecycle:v,location:d,notifications:m,permissions:w,secureStorage:y,share:h,appReview:k,deepLinks:a,keepAwake:x,network:L,pushNotifications:b,health:g,liveActivities:R,watchConnectivity:C}=p,N=f,E=l,S=u,o=A,H=v,M=d,P=m,B=w,D=y,j=h,T=k;function c(t){if(typeof t==="string")return t.trim()||null;if(!t||typeof t!=="object")return null;let e=t.url;return typeof e==="string"&&e.trim()?e:null}var K={async getInitialURL(){return c(await a.getInitialURL?.())},onLink(t){return a.onLink?.((e)=>{let i=c(e);if(i)t(i)})??(()=>{})}},U=x,W=L,F=b,I=g,O=R,q=C;function s(){if(typeof window>"u")return;return window}function n(){let t=s()?.craft;if(!t||typeof t!=="object")return null;if(!("platform"in t)||t.platform!=="ios"&&t.platform!=="android")return null;let e="capabilities"in t?t.capabilities:void 0,i=e&&typeof e==="object"&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).filter(([,r])=>typeof r==="boolean")):{};return{platform:t.platform,capabilities:i}}function z(){return n()!==null}function G(t){let e=s();if(!e)return()=>{};if(n()){let r=!1;return queueMicrotask(()=>{if(!r)t(new Event("craftReady"))}),()=>{r=!0}}let i=(r)=>{if(!n())return;e.removeEventListener("craftReady",i),t(r)};return e.addEventListener("craftReady",i),()=>e.removeEventListener("craftReady",i)}async function J(t){await o.impact("light");try{let e=await t();return await o.notification("success"),e}catch(e){throw await o.notification("error"),e}}var Q={get nativeBridge(){return n()},biometrics:N,camera:E,device:S,haptics:o,lifecycle:H,location:M,notifications:P,permissions:B,secureStorage:D,share:j,appReview:T,deepLinks:K,keepAwake:U,network:W,pushNotifications:F,health:I,liveActivities:O,watchConnectivity:q,isNativeMobile:z,onReady:G,withFeedback:J};export{T as appReview,N as biometrics,E as camera,K as deepLinks,S as device,n as getNativeMobileBridge,o as haptics,I as health,z as isNativeMobile,U as keepAwake,H as lifecycle,O as liveActivities,M as location,Q as mobile,W as network,c as normalizeDeepLinkURL,P as notifications,G as onMobileReady,B as permissions,F as pushNotifications,D as secureStorage,j as share,q as watchConnectivity,J as withNativeFeedback};
1
+ import{appReview as p,biometrics as f,camera as l,deepLinks as a,device as u,haptics as A,health as v,keepAwake as d,lifecycle as m,liveActivities as w,location as y,network as h,notifications as k,permissions as x,pushNotifications as L,secureStorage as b,share as g,watchConnectivity as R}from"craft-native/mobile";var C=f,N=l,E=u,o=A,S=m,H=y,M=k,P=x,B=b,D=g,j=p;function c(t){if(typeof t==="string")return t.trim()||null;if(!t||typeof t!=="object")return null;let e=t.url;return typeof e==="string"&&e.trim()?e:null}var T={async getInitialURL(){return c(await a.getInitialURL?.())},onLink(t){return a.onLink?.((e)=>{let i=c(e);if(i)t(i)})??(()=>{})}},K=d,U=h,W=L,F=v,I=w,O=R;function s(){if(typeof window>"u")return;return window}function n(){let t=s()?.craft;if(!t||typeof t!=="object")return null;if(!("platform"in t)||t.platform!=="ios"&&t.platform!=="android")return null;let e="capabilities"in t?t.capabilities:void 0,i=e&&typeof e==="object"&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).filter(([,r])=>typeof r==="boolean")):{};return{platform:t.platform,capabilities:i}}function q(){return n()!==null}function z(t){let e=s();if(!e)return()=>{};if(n()){let r=!1;return queueMicrotask(()=>{if(!r)t(new Event("craftReady"))}),()=>{r=!0}}let i=(r)=>{if(!n())return;e.removeEventListener("craftReady",i),t(r)};return e.addEventListener("craftReady",i),()=>e.removeEventListener("craftReady",i)}async function G(t){await o.impact("light");try{let e=await t();return await o.notification("success"),e}catch(e){throw await o.notification("error"),e}}var Q={get nativeBridge(){return n()},biometrics:C,camera:N,device:E,haptics:o,lifecycle:S,location:H,notifications:M,permissions:P,secureStorage:B,share:D,appReview:j,deepLinks:T,keepAwake:K,network:U,pushNotifications:W,health:F,liveActivities:I,watchConnectivity:O,isNativeMobile:q,onReady:z,withFeedback:G};export{j as appReview,C as biometrics,N as camera,T as deepLinks,E as device,n as getNativeMobileBridge,o as haptics,F as health,q as isNativeMobile,K as keepAwake,S as lifecycle,I as liveActivities,H as location,Q as mobile,U as network,c as normalizeDeepLinkURL,M as notifications,z as onMobileReady,P as permissions,W as pushNotifications,B as secureStorage,D as share,O as watchConnectivity,G as withNativeFeedback};
package/dist/types.d.ts CHANGED
@@ -204,7 +204,7 @@ export declare interface LocationApi {
204
204
  readRecording: () => Promise<Location[]>
205
205
  }
206
206
  export declare interface ShareApi {
207
- share: (options: ShareOptions) => Promise<void>
207
+ share: (options: ShareOptions) => Promise<boolean>
208
208
  isAvailable: () => boolean
209
209
  }
210
210
  export declare interface LifecycleApi {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/mobile",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.74.51",
5
+ "version": "0.74.53",
6
6
  "description": "Craft-powered native mobile runtime for Stacks and STX applications",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -32,10 +32,10 @@
32
32
  "test": "bun test"
33
33
  },
34
34
  "dependencies": {
35
- "craft-native": ">=0.0.72"
35
+ "craft-native": ">=0.0.92"
36
36
  },
37
37
  "devDependencies": {
38
- "@stacksjs/build": "0.74.51",
38
+ "@stacksjs/build": "0.74.53",
39
39
  "better-dx": "^0.2.24"
40
40
  }
41
41
  }