@webority/mobile-chat 0.145.3 → 0.146.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WEB_STRONG=void 0,exports.defaultOpenTarget=defaultOpenTarget,exports.focusForAccessibility=focusForAccessibility,exports.messageSignature=messageSignature,exports.openExternalUrl=openExternalUrl;var _mobileCore=require("@webority/mobile-core"),_reactNative=require("react-native");function focusForAccessibility(e){if(null==e)return;if("web"===_reactNative.Platform.OS)return void("object"==typeof e&&"focus"in e&&"function"==typeof e.focus&&e.focus());const t=(0,_reactNative.findNodeHandle)(e);null!=t&&_reactNative.AccessibilityInfo.setAccessibilityFocus(t)}function messageSignature(e){let t=0;for(const r of e.parts)"Text"===r.kind&&(t+=r.text.length);return`${e.id}|${e.parts.length}|${t}`}const ABSOLUTE_WEB_URL=/^https?:\/\//i;function openExternalUrl(e){_reactNative.Linking.openURL(e).catch(e=>{throw _mobileCore.Logger.error("[chat] link did not open",e),e})}function defaultOpenTarget(e){ABSOLUTE_WEB_URL.test(e)&&openExternalUrl(e)}const WEB_STRONG=exports.WEB_STRONG="web"===_reactNative.Platform.OS?{role:"strong"}:{};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WEB_STRONG=void 0,exports.defaultOpenTarget=defaultOpenTarget,exports.focusForAccessibility=focusForAccessibility,exports.messageSignature=messageSignature,exports.openExternalUrl=openExternalUrl;var _mobileCore=require("@webority/mobile-core"),_reactNative=require("react-native");function focusForAccessibility(e){null!=e&&("web"!==_reactNative.Platform.OS?_reactNative.AccessibilityInfo.sendAccessibilityEvent(e,"focus"):"focus"in e&&"function"==typeof e.focus&&e.focus())}function messageSignature(e){let t=0;for(const r of e.parts)"Text"===r.kind&&(t+=r.text.length);return`${e.id}|${e.parts.length}|${t}`}const ABSOLUTE_WEB_URL=/^https?:\/\//i;function openExternalUrl(e){_reactNative.Linking.openURL(e).catch(e=>{throw _mobileCore.Logger.error("[chat] link did not open",e),e})}function defaultOpenTarget(e){ABSOLUTE_WEB_URL.test(e)&&openExternalUrl(e)}const WEB_STRONG=exports.WEB_STRONG="web"===_reactNative.Platform.OS?{role:"strong"}:{};
@@ -1 +1 @@
1
- "use strict";import{Logger}from"@webority/mobile-core";import{AccessibilityInfo,findNodeHandle,Linking,Platform}from"react-native";export function focusForAccessibility(t){if(null==t)return;if("web"===Platform.OS)return void("object"==typeof t&&"focus"in t&&"function"==typeof t.focus&&t.focus());const o=findNodeHandle(t);null!=o&&AccessibilityInfo.setAccessibilityFocus(o)}export function messageSignature(t){let o=0;for(const e of t.parts)"Text"===e.kind&&(o+=e.text.length);return`${t.id}|${t.parts.length}|${o}`}const ABSOLUTE_WEB_URL=/^https?:\/\//i;export function openExternalUrl(t){Linking.openURL(t).catch(t=>{throw Logger.error("[chat] link did not open",t),t})}export function defaultOpenTarget(t){ABSOLUTE_WEB_URL.test(t)&&openExternalUrl(t)}export const WEB_STRONG="web"===Platform.OS?{role:"strong"}:{};
1
+ "use strict";import{Logger}from"@webority/mobile-core";import{AccessibilityInfo,Linking,Platform}from"react-native";export function focusForAccessibility(t){null!=t&&("web"!==Platform.OS?AccessibilityInfo.sendAccessibilityEvent(t,"focus"):"focus"in t&&"function"==typeof t.focus&&t.focus())}export function messageSignature(t){let o=0;for(const e of t.parts)"Text"===e.kind&&(o+=e.text.length);return`${t.id}|${t.parts.length}|${o}`}const ABSOLUTE_WEB_URL=/^https?:\/\//i;export function openExternalUrl(t){Linking.openURL(t).catch(t=>{throw Logger.error("[chat] link did not open",t),t})}export function defaultOpenTarget(t){ABSOLUTE_WEB_URL.test(t)&&openExternalUrl(t)}export const WEB_STRONG="web"===Platform.OS?{role:"strong"}:{};
@@ -10,7 +10,7 @@ export interface ChatComposerProps {
10
10
  keyboardAware?: boolean | undefined;
11
11
  safeArea?: boolean | undefined;
12
12
  testID?: string;
13
- focusRef?: React.MutableRefObject<(() => void) | null> | undefined;
13
+ focusRef?: React.RefObject<(() => void) | null> | undefined;
14
14
  /** The resolved look: its input ring and send reveal draw the box and the send button. */
15
15
  look?: ChatLook;
16
16
  /** Icon name for the send button; the look's input.sendIcon. */
@@ -13,7 +13,7 @@ export interface ChatDictationButtonProps {
13
13
  onText: (text: string) => void;
14
14
  onNotice: (notice: DictationNotice | null) => void;
15
15
  testID?: string;
16
- stopRef?: React.MutableRefObject<(() => void) | null>;
16
+ stopRef?: React.RefObject<(() => void) | null>;
17
17
  }
18
18
  export declare function ChatDictationButton({ chat, labels, disabled, onText, onNotice, testID, stopRef, }: ChatDictationButtonProps): React.ReactElement | null;
19
19
  //# sourceMappingURL=ChatDictationButton.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import type { ChatLiveMessage } from "@webority/chat-core";
2
- import { findNodeHandle } from "react-native";
3
- /** Moves screen-reader focus to a view. findNodeHandle throws on react-native-web, so the browser focuses the element itself. */
4
- export declare function focusForAccessibility(node: Parameters<typeof findNodeHandle>[0]): void;
2
+ import { type HostInstance } from "react-native";
3
+ /** Moves screen-reader focus to a view. react-native-web has no accessibility events, so the browser focuses the element itself. */
4
+ export declare function focusForAccessibility(node: HostInstance | null | undefined): void;
5
5
  export declare function messageSignature(message: ChatLiveMessage): string;
6
6
  export declare function openExternalUrl(url: string): void;
7
7
  export declare function defaultOpenTarget(target: string): void;
@@ -10,7 +10,7 @@ export interface ChatComposerProps {
10
10
  keyboardAware?: boolean | undefined;
11
11
  safeArea?: boolean | undefined;
12
12
  testID?: string;
13
- focusRef?: React.MutableRefObject<(() => void) | null> | undefined;
13
+ focusRef?: React.RefObject<(() => void) | null> | undefined;
14
14
  /** The resolved look: its input ring and send reveal draw the box and the send button. */
15
15
  look?: ChatLook;
16
16
  /** Icon name for the send button; the look's input.sendIcon. */
@@ -13,7 +13,7 @@ export interface ChatDictationButtonProps {
13
13
  onText: (text: string) => void;
14
14
  onNotice: (notice: DictationNotice | null) => void;
15
15
  testID?: string;
16
- stopRef?: React.MutableRefObject<(() => void) | null>;
16
+ stopRef?: React.RefObject<(() => void) | null>;
17
17
  }
18
18
  export declare function ChatDictationButton({ chat, labels, disabled, onText, onNotice, testID, stopRef, }: ChatDictationButtonProps): React.ReactElement | null;
19
19
  //# sourceMappingURL=ChatDictationButton.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import type { ChatLiveMessage } from "@webority/chat-core";
2
- import { findNodeHandle } from "react-native";
3
- /** Moves screen-reader focus to a view. findNodeHandle throws on react-native-web, so the browser focuses the element itself. */
4
- export declare function focusForAccessibility(node: Parameters<typeof findNodeHandle>[0]): void;
2
+ import { type HostInstance } from "react-native";
3
+ /** Moves screen-reader focus to a view. react-native-web has no accessibility events, so the browser focuses the element itself. */
4
+ export declare function focusForAccessibility(node: HostInstance | null | undefined): void;
5
5
  export declare function messageSignature(message: ChatLiveMessage): string;
6
6
  export declare function openExternalUrl(url: string): void;
7
7
  export declare function defaultOpenTarget(target: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/mobile-chat",
3
- "version": "0.145.3",
3
+ "version": "0.146.0",
4
4
  "description": "Webority Chat for React Native apps: the chat screen, sheet and embedded shells, thread, composer, one renderer per message part kind and the useChat hook, built on @webority/chat-core and @webority/mobile-ui.",
5
5
  "keywords": [
6
6
  "react-native",
@@ -42,10 +42,10 @@
42
42
  "!**/*.map"
43
43
  ],
44
44
  "peerDependencies": {
45
- "@webority/chat-core": "0.145.3",
46
- "@webority/markdown-core": "^0.161.0",
47
- "@webority/mobile-core": "^0.161.0",
48
- "@webority/mobile-ui": "^0.161.0",
45
+ "@webority/chat-core": "0.146.0",
46
+ "@webority/markdown-core": "^0.163.0",
47
+ "@webority/mobile-core": "^0.163.0",
48
+ "@webority/mobile-ui": "^0.163.0",
49
49
  "expo-audio": ">=58.0.0",
50
50
  "expo-file-system": ">=58.0.0",
51
51
  "react": "^19.3.0",
@@ -98,11 +98,11 @@
98
98
  "@testing-library/react-native": "12.9.0",
99
99
  "@types/jest": "29.5.14",
100
100
  "@types/react": "19.3.0",
101
- "@webority/canvas-kit": "0.161.0",
102
- "@webority/chat-core": "0.145.3",
103
- "@webority/markdown-core": "0.161.0",
104
- "@webority/mobile-core": "0.161.0",
105
- "@webority/mobile-ui": "0.161.0",
101
+ "@webority/canvas-kit": "0.163.0",
102
+ "@webority/chat-core": "0.146.0",
103
+ "@webority/markdown-core": "0.163.0",
104
+ "@webority/mobile-core": "0.163.0",
105
+ "@webority/mobile-ui": "0.163.0",
106
106
  "babel-jest": "29.7.0",
107
107
  "expo": "58.0.23",
108
108
  "expo-application": "58.1.2",