@callimacus/thamyr-react-native 4.3.5 → 4.4.0

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/CHANGELOG.core.md CHANGED
@@ -3,6 +3,31 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.4.0](https://github.com/callimacus/thamyr-sdk/compare/thamyr-core-v4.3.5...thamyr-core-v4.4.0) (2026-09-29)
7
+
8
+
9
+ ### Features
10
+
11
+ * **callimacus:** export additional action types from hooks for better type safety ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
12
+ * **ContentAPI:** implement getDocumentByGroupId method to retrieve documents based on language and group ID ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
13
+ * **hooks.ts:** enhance useProducts, useAnalytics, and useSitemap hooks with TypeScript interfaces and detailed documentation ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
14
+ * **react:** add eslint-config-xo-react for better React linting ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
15
+ * **react:** implement Callimacus store and hooks for state management ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
16
+ * **service.ts:** add polling transport option to socket connection for improved connectivity in restricted environments ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
17
+ * **service.ts:** add referrer to auth object for enhanced tracking and analytics ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
18
+ * **thamyr:** parity with the v2 wire, rounds without a message, acknowledged suggestions, receptors and block keys ([#784](https://github.com/callimacus/thamyr-sdk/issues/784)) ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * **AnalyticsAPI.ts, Thamyr.ts:** remove array type from content parameter in trackEvent method for consistency and simplification ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
24
+ * **core/package.json:** update @solomei-ai/intent to version 1.9.2 for latest features and fixes ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
25
+ * **package.json:** remove redundant comma in scripts section to ensure JSON validity ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
26
+ * **package.json:** update @types/react to version 19.2.10 for improved type definitions chore(package.json): bump react and react-dom to version 19.2.4 for latest features and fixes ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
27
+ * **react:** ensure consistent export style across components ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
28
+ * **react:** remove obsolete global type declarations ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
29
+ * remove legacy-peer-deps from .npmrc and update registry configuration for scoped package ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
30
+
6
31
  ## [4.3.5](https://github.com/callimacus/thamyr-sdk/compare/thamyr-core-v4.3.4...thamyr-core-v4.3.5) (2026-09-29)
7
32
 
8
33
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.4.0](https://github.com/callimacus/thamyr-sdk/compare/thamyr-react-native-v4.3.5...thamyr-react-native-v4.4.0) (2026-09-29)
4
+
5
+
6
+ ### Features
7
+
8
+ * **callimacus:** export additional action types from hooks for better type safety ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
9
+ * **ContentAPI:** implement getDocumentByGroupId method to retrieve documents based on language and group ID ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
10
+ * **hooks.ts:** enhance useProducts, useAnalytics, and useSitemap hooks with TypeScript interfaces and detailed documentation ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
11
+ * **react:** add eslint-config-xo-react for better React linting ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
12
+ * **react:** implement Callimacus store and hooks for state management ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
13
+ * **service.ts:** add polling transport option to socket connection for improved connectivity in restricted environments ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
14
+ * **service.ts:** add referrer to auth object for enhanced tracking and analytics ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
15
+ * **thamyr:** parity with the v2 wire, rounds without a message, acknowledged suggestions, receptors and block keys ([#784](https://github.com/callimacus/thamyr-sdk/issues/784)) ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **AnalyticsAPI.ts, Thamyr.ts:** remove array type from content parameter in trackEvent method for consistency and simplification ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
21
+ * **core/package.json:** update @solomei-ai/intent to version 1.9.2 for latest features and fixes ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
22
+ * **package.json:** remove redundant comma in scripts section to ensure JSON validity ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
23
+ * **package.json:** update @types/react to version 19.2.10 for improved type definitions chore(package.json): bump react and react-dom to version 19.2.4 for latest features and fixes ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
24
+ * **react:** ensure consistent export style across components ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
25
+ * **react:** remove obsolete global type declarations ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
26
+ * remove legacy-peer-deps from .npmrc and update registry configuration for scoped package ([fe22166](https://github.com/callimacus/thamyr-sdk/commit/fe221665c994723d546f972c9379cdf4b4eecbc8))
27
+
28
+
29
+ ### Dependencies
30
+
31
+ * The following workspace dependencies were updated
32
+ * dependencies
33
+ * @callimacus/thamyr-react bumped from ^4.3.5 to ^4.4.0
34
+
3
35
  ## [4.3.5](https://github.com/callimacus/thamyr-sdk/compare/thamyr-react-native-v4.3.4...thamyr-react-native-v4.3.5) (2026-09-29)
4
36
 
5
37
 
package/dist/esm/index.js CHANGED
@@ -5,5 +5,5 @@
5
5
  * See LICENSE.md for the full terms.
6
6
  *
7
7
  */
8
- import{useInitThamyr as e}from"@callimacus/thamyr-react";export{CallimacusEvent,ChapterStatus,ClientEvents,GalleryMode,SLInputEventType,ServerEvents,ThamyrHttpError,ThamyrResponseType,UserInteractionType,callimacusService,extractTtsAudio,isSetProduct,logger,thamyrApi,transformImageUrl,useApi,useCallimacusStore,useCart,useConnection,useOnConnectionChange,useOnError,useOnResponse,useSitemap,useSkesis,useThamyr}from"@callimacus/thamyr-react";import{useState as r,useRef as t,useCallback as n,useEffect as o}from"react";function i(r){e(r)}async function s(e){return new Promise((r,t)=>{const n=new XMLHttpRequest;n.responseType="arraybuffer","arraybuffer"===n.responseType?(n.addEventListener("load",()=>{const o=n.response;o instanceof ArrayBuffer?0!==o.byteLength?r(new Uint8Array(o)):t(new Error(`The recording at ${e} is empty`)):t(new Error(`Reading the recording at ${e} produced ${typeof o}, expected an ArrayBuffer`))}),n.addEventListener("error",()=>{t(new Error(`Failed to read the recording at ${e}`))}),n.open("GET",e,!0),n.send(null)):t(new Error('This runtime does not support XMLHttpRequest responseType "arraybuffer", so the recording cannot be read. Pass a custom adapter that returns bytes.'))})}const a=-45,c=1800,u=3e4;function d(e){if(!Number.isFinite(e))return 0;const r=(e- -60)/60;return Math.min(1,Math.max(0,r))}function l({silenceThreshold:e=a,silenceDuration:i=c,maxDuration:l=u,onRecordingComplete:p,adapter:y}){const[m,f]=r("idle"),[g,h]=r([]),[w,v]=r(void 0),[E,T]=r(void 0),M=t(y);M.current=y;const R=t(void 0),A=t([]),S=t(0),b=t(void 0),C=t(!1),I=t(p);I.current=p;const L=n(()=>{void 0!==b.current&&(clearTimeout(b.current),b.current=void 0)},[]),x=n(()=>{A.current=[],S.current=0,h([])},[]),H=n(()=>{if(C.current)return;C.current=!0,L(),f("processing");(async()=>{const e=R.current;R.current=void 0;try{if(!e)throw new Error("No active recording to stop");const r=await e.stop();T(r.uri),I.current(await s(r.uri))}catch(e){v(e instanceof Error?e.message:"Failed to finish recording")}finally{C.current=!1,f("idle")}})()},[L]),P=n(r=>{if(C.current)return;const t=[...A.current,d(r)];t.length>32&&t.splice(0,t.length-32),A.current=t,h(t),r<e?0===S.current?S.current=Date.now():Date.now()-S.current>i&&H():S.current=0},[e,i,H]),U=n(async()=>{v(void 0),C.current=!1,x();const e=M.current;R.current=e;try{await e.start({onMetering:P}),f("recording"),b.current=setTimeout(()=>{H()},l)}catch(r){R.current=void 0,v(r instanceof Error?r.message:"Microphone access denied"),f("idle"),await e.cancel()}},[P,l,x,H]),D=n(()=>{f("idle"),v(void 0),x()},[x]);return o(()=>()=>{L();const e=R.current;R.current=void 0,e?.cancel()},[L]),{state:m,audioLevels:g,startRecording:U,stopRecording:H,reset:D,error:w,lastRecordingUri:E}}function p(e){let r,t;function n(){void 0!==t&&(clearInterval(t),t=void 0)}return{async start({onMetering:n}){if(!(await e.requestRecordingPermissionsAsync()).granted)throw new Error("Microphone permission denied");await e.setAudioModeAsync({allowsRecording:!0,playsInSilentMode:!0});const o=new e.AudioModule.AudioRecorder({...e.RecordingPresets.HIGH_QUALITY,isMeteringEnabled:!0});await o.prepareToRecordAsync(),o.record(),r=o,t=setInterval(()=>{const e=o.getStatus();"number"==typeof e.metering&&n?.(e.metering)},100)},async stop(){if(!r)throw new Error("No active recording to stop");n();const e=r;r=void 0,await e.stop();const{uri:t}=e;if(null===t||""===t)throw new Error("Recording finished without producing a file");return{uri:t,durationMillis:e.getStatus().durationMillis}},async cancel(){if(n(),!r)return;const e=r;r=void 0;try{await e.stop()}catch{}}}}export{p as createExpoAudioAdapter,s as readRecording,i as useInitThamyr,l as useVoiceRecorder};
8
+ import{useInitThamyr as e}from"@callimacus/thamyr-react";export{ADD_TO_CART_RESULT_BLOCK,CallimacusEvent,ChapterStatus,ClientEvents,GalleryMode,LANDING_VALUE_MAX_LENGTH,SLInputEventType,ServerEvents,ThamyrHttpError,ThamyrResponseType,UserInteractionType,addToCartResultOf,applyBlockPatch,blockKeyOf,callimacusService,extractTtsAudio,interactionRound,isSetProduct,landingRound,logger,receptorsOf,thamyrApi,transformImageUrl,useApi,useCallimacusStore,useCart,useConnection,useOnConnectionChange,useOnError,useOnResponse,useSitemap,useSkesis,useSuggestions,useThamyr}from"@callimacus/thamyr-react";import{useState as r,useRef as t,useCallback as n,useEffect as o}from"react";function i(r){e(r)}async function s(e){return new Promise((r,t)=>{const n=new XMLHttpRequest;n.responseType="arraybuffer","arraybuffer"===n.responseType?(n.addEventListener("load",()=>{const o=n.response;o instanceof ArrayBuffer?0!==o.byteLength?r(new Uint8Array(o)):t(new Error(`The recording at ${e} is empty`)):t(new Error(`Reading the recording at ${e} produced ${typeof o}, expected an ArrayBuffer`))}),n.addEventListener("error",()=>{t(new Error(`Failed to read the recording at ${e}`))}),n.open("GET",e,!0),n.send(null)):t(new Error('This runtime does not support XMLHttpRequest responseType "arraybuffer", so the recording cannot be read. Pass a custom adapter that returns bytes.'))})}const a=-45,c=1800,u=3e4;function d(e){if(!Number.isFinite(e))return 0;const r=(e- -60)/60;return Math.min(1,Math.max(0,r))}function l({silenceThreshold:e=a,silenceDuration:i=c,maxDuration:l=u,onRecordingComplete:p,adapter:y}){const[f,g]=r("idle"),[m,h]=r([]),[w,v]=r(void 0),[T,E]=r(void 0),R=t(y);R.current=y;const A=t(void 0),M=t([]),L=t(0),S=t(void 0),C=t(!1),b=t(p);b.current=p;const I=n(()=>{void 0!==S.current&&(clearTimeout(S.current),S.current=void 0)},[]),O=n(()=>{M.current=[],L.current=0,h([])},[]),_=n(()=>{if(C.current)return;C.current=!0,I(),g("processing");(async()=>{const e=A.current;A.current=void 0;try{if(!e)throw new Error("No active recording to stop");const r=await e.stop();E(r.uri),b.current(await s(r.uri))}catch(e){v(e instanceof Error?e.message:"Failed to finish recording")}finally{C.current=!1,g("idle")}})()},[I]),D=n(r=>{if(C.current)return;const t=[...M.current,d(r)];t.length>32&&t.splice(0,t.length-32),M.current=t,h(t),r<e?0===L.current?L.current=Date.now():Date.now()-L.current>i&&_():L.current=0},[e,i,_]),U=n(async()=>{v(void 0),C.current=!1,O();const e=R.current;A.current=e;try{await e.start({onMetering:D}),g("recording"),S.current=setTimeout(()=>{_()},l)}catch(r){A.current=void 0,v(r instanceof Error?r.message:"Microphone access denied"),g("idle"),await e.cancel()}},[D,l,O,_]),x=n(()=>{g("idle"),v(void 0),O()},[O]);return o(()=>()=>{I();const e=A.current;A.current=void 0,e?.cancel()},[I]),{state:f,audioLevels:m,startRecording:U,stopRecording:_,reset:x,error:w,lastRecordingUri:T}}function p(e){let r,t;function n(){void 0!==t&&(clearInterval(t),t=void 0)}return{async start({onMetering:n}){if(!(await e.requestRecordingPermissionsAsync()).granted)throw new Error("Microphone permission denied");await e.setAudioModeAsync({allowsRecording:!0,playsInSilentMode:!0});const o=new e.AudioModule.AudioRecorder({...e.RecordingPresets.HIGH_QUALITY,isMeteringEnabled:!0});await o.prepareToRecordAsync(),o.record(),r=o,t=setInterval(()=>{const e=o.getStatus();"number"==typeof e.metering&&n?.(e.metering)},100)},async stop(){if(!r)throw new Error("No active recording to stop");n();const e=r;r=void 0,await e.stop();const{uri:t}=e;if(null===t||""===t)throw new Error("Recording finished without producing a file");return{uri:t,durationMillis:e.getStatus().durationMillis}},async cancel(){if(n(),!r)return;const e=r;r=void 0;try{await e.stop()}catch{}}}}export{p as createExpoAudioAdapter,s as readRecording,i as useInitThamyr,l as useVoiceRecorder};
9
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/callimacus/index.ts","../../../src/voice/read-recording.ts","../../../src/voice/use-voice-recorder.ts","../../../src/voice/adapters/expo-audio.ts"],"sourcesContent":[null,null,null,null],"names":["useInitThamyr","config","useInitThamyrWeb","async","readRecording","uri","Promise","resolve","reject","request","XMLHttpRequest","responseType","addEventListener","response","ArrayBuffer","byteLength","Uint8Array","Error","open","send","defaultOptions","normalizeMetering","db","Number","isFinite","level","Math","min","max","useVoiceRecorder","silenceThreshold","silenceDuration","maxDuration","onRecordingComplete","adapter","state","setState","useState","audioLevels","setAudioLevels","error","setError","undefined","lastRecordingUri","setLastRecordingUri","adapterRef","useRef","current","activeAdapterRef","levelsRef","silenceStartRef","maxDurationTimerRef","stoppingRef","onCompleteRef","clearMaxDurationTimer","useCallback","clearTimeout","resetWaveform","stopRecording","active","result","stop","error_","message","finish","handleMetering","next","length","splice","Date","now","startRecording","start","onMetering","setTimeout","cancel","reset","useEffect","createExpoAudioAdapter","expoAudio","recorder","meterTimer","stopMeterTimer","clearInterval","requestRecordingPermissionsAsync","granted","setAudioModeAsync","allowsRecording","playsInSilentMode","AudioModule","AudioRecorder","RecordingPresets","HIGH_QUALITY","isMeteringEnabled","prepareToRecordAsync","record","setInterval","status","getStatus","metering","durationMillis"],"mappings":";;;;;;;wgBAqBM,SAAUA,EAAcC,G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CAAE,MAEF,CACD,EAEF"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/callimacus/index.ts","../../../src/voice/read-recording.ts","../../../src/voice/use-voice-recorder.ts","../../../src/voice/adapters/expo-audio.ts"],"sourcesContent":[null,null,null,null],"names":["useInitThamyr","config","useInitThamyrWeb","async","readRecording","uri","Promise","resolve","reject","request","XMLHttpRequest","responseType","addEventListener","response","ArrayBuffer","byteLength","Uint8Array","Error","open","send","defaultOptions","normalizeMetering","db","Number","isFinite","level","Math","min","max","useVoiceRecorder","silenceThreshold","silenceDuration","maxDuration","onRecordingComplete","adapter","state","setState","useState","audioLevels","setAudioLevels","error","setError","undefined","lastRecordingUri","setLastRecordingUri","adapterRef","useRef","current","activeAdapterRef","levelsRef","silenceStartRef","maxDurationTimerRef","stoppingRef","onCompleteRef","clearMaxDurationTimer","useCallback","clearTimeout","resetWaveform","stopRecording","active","result","stop","error_","message","finish","handleMetering","next","length","splice","Date","now","startRecording","start","onMetering","setTimeout","cancel","reset","useEffect","createExpoAudioAdapter","expoAudio","recorder","meterTimer","stopMeterTimer","clearInterval","requestRecordingPermissionsAsync","granted","setAudioModeAsync","allowsRecording","playsInSilentMode","AudioModule","AudioRecorder","RecordingPresets","HIGH_QUALITY","isMeteringEnabled","prepareToRecordAsync","record","setInterval","status","getStatus","metering","durationMillis"],"mappings":";;;;;;;gqBAqBM,SAAUA,EAAcC,GAE7BC,EAAiBD,EAClB,CCCOE,eAAeC,EAAcC,GACnC,OAAO,IAAIC,QAAoB,CAACC,EAASC,KACxC,MAAMC,EAAU,IAAIC,eAEpBD,EAAQE,aAAe,cACM,gBAAzBF,EAAQE,cAQZF,EAAQG,iBAAiB,OAAQ,KAIhC,MAAMC,EAAoBJ,EAAQI,SAC5BA,aAAoBC,YAKE,IAAxBD,EAASE,WAKbR,EAAQ,IAAIS,WAAWH,IAJtBL,EAAO,IAAIS,MAAM,oBAAoBZ,eALrCG,EAAO,IAAIS,MAAM,4BAA4BZ,qBAAuBQ,iC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E,CCtJM,SAAUmC,EAAuBC,GACtC,IAAIC,EACAC,EAEJ,SAASC,SACWxC,IAAfuC,IAIJE,cAAcF,GACdA,OAAavC,EACd,CAEA,MAAO,CACN,WAAM8B,EAAMC,WAACA,IAKZ,WADyBM,EAAUK,oCACnBC,QACf,MAAM,IAAIpE,MAAM,sCAGX8D,EAAUO,kBAAkB,CAACC,iBAAiB,EAAMC,mBAAmB,IAE7E,MAAMtB,EAAO,IAAIa,EAAUU,YAAYC,cAAc,IACjDX,EAAUY,iBAAiBC,aAC9BC,mBAAmB,UAEd3B,EAAK4B,uBACX5B,EAAK6B,SACLf,EAAWd,EAEXe,EAAae,YAAY,KACxB,MAAMC,EAAS/B,EAAKgC,YACW,iBAApBD,EAAOE,UACjB1B,IAAawB,EAAOE,WAhGE,IAmGzB,EAEA,UAAMtC,GACL,IAAKmB,EACJ,MAAM,IAAI/D,MAAM,+BAGjBiE,IACA,MAAMnC,EAAUiC,EAChBA,OAAWtC,QAELK,EAAQc,OACd,MAAMxD,IAACA,GAAO0C,EACd,GAAY,OAAR1C,GAAwB,KAARA,EACnB,MAAM,IAAIY,MAAM,+CAGjB,MAAO,CAACZ,MAAK+F,eAAgBrD,EAAQmD,YAAYE,eAClD,EAEA,YAAMzB,GAEL,GADAO,KACKF,EACJ,OAGD,MAAMjC,EAAUiC,EAChBA,OAAWtC,EACX,UACOK,EAAQc,MACf,CAAE,MAEF,CACD,EAEF"}
@@ -5,7 +5,7 @@
5
5
  * See LICENSE.md for the full terms.
6
6
  *
7
7
  */
8
- export { Block, BoundingBox, CallimacusEvent, CartActions, Chapter, ChapterStatus, ClientEvents, ClientInfo, ConnectionStatus, ConnectionStatusCallback, ErrorCallback, ErrorMessage, Gallery, GalleryMode, Image, ImageEdits, ImageFormatEdit, ImageResizeEdit, InteractionContext, InteractionPayloadMap, LocalizedEPArtwork, LocalizedEPChapter, LogLevel, LoggerConfig, ProductMatch, SLDocument, SLDocumentSection, SLInputEvent, SLInputEventType, ServerEvents, ServerResponseCallback, SitemapActions, SkesisActions, Story, ThamyrHttpError, ThamyrResponse, ThamyrResponseType, Topic, TtsAudio, UiElement, UiSnapshot, UserInteraction, UserInteractionType, Video, WhisperPayload, callimacusService, extractTtsAudio, isSetProduct, logger, thamyrApi, transformImageUrl, useApi, useCallimacusStore, useCart, useConnection, useOnConnectionChange, useOnError, useOnResponse, useSitemap, useSkesis, useThamyr } from '@callimacus/thamyr-react';
8
+ export { ADD_TO_CART_RESULT_BLOCK, AddToCartResult, Block, BlockPatch, BoundingBox, CallimacusEvent, CartActions, Chapter, ChapterStatus, ClientEvents, ClientInfo, ConnectionStatus, ConnectionStatusCallback, ErrorCallback, ErrorMessage, Gallery, GalleryMode, Image, ImageEdits, ImageFormatEdit, ImageResizeEdit, InteractionContext, InteractionId, InteractionOptions, InteractionPayload, InteractionPayloadMap, LANDING_VALUE_MAX_LENGTH, LocalizedEPArtwork, LocalizedEPChapter, LogLevel, LoggerConfig, ProductMatch, RiveManifest, RoundOptions, SLDocument, SLDocumentSection, SLInputEvent, SLInputEventType, ServerEvents, ServerResponseCallback, SitemapActions, SkesisActions, Story, SuggestPayload, Suggestions, SuggestionsOptions, SuggestionsState, ThamyrHttpError, ThamyrInteractionMap, ThamyrResponse, ThamyrResponseType, Topic, TtsAudio, UiElement, UiSnapshot, UserInteraction, UserInteractionType, Video, WhisperPayload, addToCartResultOf, applyBlockPatch, blockKeyOf, callimacusService, extractTtsAudio, interactionRound, isSetProduct, landingRound, logger, receptorsOf, thamyrApi, transformImageUrl, useApi, useCallimacusStore, useCart, useConnection, useOnConnectionChange, useOnError, useOnResponse, useSitemap, useSkesis, useSuggestions, useThamyr } from '@callimacus/thamyr-react';
9
9
 
10
10
  /**
11
11
  Configuration for initializing the Thamyr SDK via `useInitThamyr` on React Native.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@callimacus/thamyr-react-native",
3
- "version": "4.3.5",
3
+ "version": "4.4.0",
4
4
  "private": false,
5
5
  "description": "React Native package for Thamyr",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -40,7 +40,7 @@
40
40
  "lint": "eslint src"
41
41
  },
42
42
  "dependencies": {
43
- "@callimacus/thamyr-react": "^4.3.5"
43
+ "@callimacus/thamyr-react": "^4.4.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": ">=18",