@websolutespa/bom-llm 0.0.36 → 0.0.37

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.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @websolutespa/bom-llm
2
2
 
3
+ ## 0.0.37
4
+
5
+ ### Patch Changes
6
+
7
+ - Modified: CanvasOffscreen, disableSpeechSynthesis
8
+
3
9
  ## 0.0.36
4
10
 
5
11
  ### Patch Changes
package/dist/umd/index.js CHANGED
@@ -22586,6 +22586,7 @@ ${Object.entries(vars).map(_ref2 => {
22586
22586
  }, 2000);
22587
22587
  },
22588
22588
  initIntersection: element => {
22589
+ // console.log('initIntersection', element);
22589
22590
  const handleIntersection = () => {
22590
22591
  // console.log('handleIntersection', element);
22591
22592
  if (!element) {
@@ -22799,19 +22800,18 @@ ${Object.entries(vars).map(_ref2 => {
22799
22800
  return;
22800
22801
  }
22801
22802
  const state = get();
22802
- const disableSpeechSynthesis = app.contents.synthesisMode ? app.contents.synthesisMode === 'none' : app.contents.disableSpeechSynthesis;
22803
22803
  const textToSpeechApiKey = app.contents.textToSpeechApiKey;
22804
22804
  const textToSpeechVoiceId = app.contents.textToSpeechVoiceId;
22805
- const synthesisMode = app.contents.synthesisMode || 'default';
22806
- const recognitionMode = app.contents.recognitionMode || 'default';
22807
- const speechEnabled = state.speakEnabled && !disableSpeechSynthesis;
22805
+ const synthesisMode = app.contents.synthesisMode || (app.contents.disableSpeechSynthesis ? 'none' : 'default');
22806
+ const recognitionMode = app.contents.recognitionMode || (app.contents.disableSpeechRecognition ? 'none' : 'default');
22807
+ const speechEnabled = state.speakEnabled;
22808
22808
  speech.lang = locale;
22809
22809
  speech.enabled = speechEnabled;
22810
22810
  speech.textToSpeechApiKey = textToSpeechApiKey;
22811
22811
  speech.textToSpeechVoiceId = textToSpeechVoiceId;
22812
22812
  speech.synthesisMode = synthesisMode;
22813
22813
  speech.recognitionMode = recognitionMode;
22814
- // console.log('useLlm.init', { textToSpeechApiKey, textToSpeechVoiceId, synthesisMode, recognitionMode, disableSpeechSynthesis, speechEnabled });
22814
+ // console.log('useLlm.init', { textToSpeechApiKey, textToSpeechVoiceId, synthesisMode, recognitionMode, speechEnabled });
22815
22815
  speech.on('result', async transcript => {
22816
22816
  const state = get();
22817
22817
  state.actions.setPrompt(transcript);
@@ -22954,18 +22954,16 @@ ${Object.entries(vars).map(_ref2 => {
22954
22954
  prompt
22955
22955
  })),
22956
22956
  hasSpeechSynthesisSupport: () => {
22957
- const state = get();
22958
- const disableSpeechSynthesis = state.app && (state.app.contents.synthesisMode ? state.app.contents.synthesisMode === 'none' : state.app.contents.disableSpeechSynthesis);
22959
- return speech.hasTextToSpeechSupport && !disableSpeechSynthesis;
22957
+ get();
22958
+ return speech.hasTextToSpeechSupport;
22960
22959
  },
22961
22960
  hasSpeechRecognitionSupport: () => {
22962
- const state = get();
22963
- const disableSpeechRecognition = state.app && (state.app.contents.recognitionMode ? state.app.contents.recognitionMode === 'none' : state.app.contents.disableSpeechRecognition);
22964
- return speech.hasSpeechToTextSupport && !disableSpeechRecognition;
22961
+ get();
22962
+ return speech.hasSpeechToTextSupport;
22965
22963
  },
22966
22964
  toggleSpeak: () => {
22967
22965
  set(state => {
22968
- const speakEnabled = !state.speakEnabled && !state.app?.contents.disableSpeechSynthesis;
22966
+ const speakEnabled = !state.speakEnabled;
22969
22967
  speech.setEnabled(speakEnabled);
22970
22968
  return {
22971
22969
  speakEnabled
@@ -23776,6 +23774,7 @@ void main(void) {
23776
23774
  canvasRef,
23777
23775
  shaderRef,
23778
23776
  attach: canvas => {
23777
+ // console.log('CanvasOffscreenContextProvider.attach', canvas, shaderRef.current);
23779
23778
  if (shaderRef.current) {
23780
23779
  shaderRef.current.attach(canvas);
23781
23780
  }
@@ -33696,10 +33695,10 @@ void main(void) {
33696
33695
  initView();
33697
33696
  }, [init, locale, initView]);
33698
33697
  reactExports.useEffect(() => {
33699
- if (innerRef.current) {
33698
+ if (mounted && ready && innerRef.current) {
33700
33699
  initIntersection(innerRef.current);
33701
33700
  }
33702
- }, [mounted, initIntersection, innerRef]);
33701
+ }, [mounted, ready, initIntersection, innerRef]);
33703
33702
  reactExports.useEffect(() => {
33704
33703
  if (!embedded) {
33705
33704
  document.documentElement.style.overflow = opened ? 'hidden' : 'auto';