@getuserfeedback/react-native 3.0.48 → 3.0.49

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,5 +1,11 @@
1
- import type { WidgetFrameAppearance } from "@getuserfeedback/protocol/host";
1
+ import type { WidgetFrameAppearance, WidgetFrameResolvedBorder } from "@getuserfeedback/protocol/host";
2
+ export type ProviderWidgetFrameBorderStyle = {
3
+ borderColor: string;
4
+ borderStyle: "dashed" | "dotted" | "solid";
5
+ borderWidth: number;
6
+ };
2
7
  export type ProviderWidgetFrameAppearanceProjection = {
8
+ borderStyle?: ProviderWidgetFrameBorderStyle;
3
9
  shadowPolicy: "clear" | "legacy";
4
10
  topLeftRadius: number;
5
11
  topRightRadius: number;
@@ -8,4 +14,5 @@ export declare function safeParseProviderWidgetCanonicalTopRadii(value: string):
8
14
  topLeft: number;
9
15
  topRight: number;
10
16
  } | undefined;
17
+ export declare function toProviderWidgetFrameBorderStyle(border?: WidgetFrameResolvedBorder): ProviderWidgetFrameBorderStyle;
11
18
  export declare function toProviderWidgetFrameAppearance(appearance?: WidgetFrameAppearance): ProviderWidgetFrameAppearanceProjection;
@@ -1,5 +1,10 @@
1
1
  const LEGACY_WIDGET_SHEET_RADIUS = 24;
2
2
  const CANONICAL_PX_PATTERN = /^(?:0|[1-9]\d*)(?:\.\d+)?px$/;
3
+ const CLEARED_WIDGET_FRAME_BORDER_STYLE = {
4
+ borderColor: "transparent",
5
+ borderStyle: "solid",
6
+ borderWidth: 0,
7
+ };
3
8
  const safeParseCanonicalPx = (value) => {
4
9
  if (!CANONICAL_PX_PATTERN.test(value)) {
5
10
  return undefined;
@@ -22,6 +27,22 @@ export function safeParseProviderWidgetCanonicalTopRadii(value) {
22
27
  ? undefined
23
28
  : { topLeft, topRight };
24
29
  }
30
+ export function toProviderWidgetFrameBorderStyle(border) {
31
+ if (border === undefined ||
32
+ border.widthPx === 0 ||
33
+ border.style === "none" ||
34
+ border.style === "hidden") {
35
+ return Object.assign({}, CLEARED_WIDGET_FRAME_BORDER_STYLE);
36
+ }
37
+ const { alpha, blue, green, red } = border.color;
38
+ return {
39
+ borderColor: `rgba(${red}, ${green}, ${blue}, ${alpha})`,
40
+ borderStyle: border.style === "dashed" || border.style === "dotted"
41
+ ? border.style
42
+ : "solid",
43
+ borderWidth: border.widthPx,
44
+ };
45
+ }
25
46
  export function toProviderWidgetFrameAppearance(appearance) {
26
47
  var _a, _b;
27
48
  if (appearance === undefined) {
@@ -33,6 +54,7 @@ export function toProviderWidgetFrameAppearance(appearance) {
33
54
  }
34
55
  if (appearance.kind === "none") {
35
56
  return {
57
+ borderStyle: toProviderWidgetFrameBorderStyle(),
36
58
  shadowPolicy: "clear",
37
59
  topLeftRadius: 0,
38
60
  topRightRadius: 0,
@@ -40,6 +62,7 @@ export function toProviderWidgetFrameAppearance(appearance) {
40
62
  }
41
63
  const radius = safeParseProviderWidgetCanonicalTopRadii(appearance.borderRadius);
42
64
  return {
65
+ borderStyle: toProviderWidgetFrameBorderStyle(appearance.resolvedBorder),
43
66
  shadowPolicy: "clear",
44
67
  topLeftRadius: (_a = radius === null || radius === void 0 ? void 0 : radius.topLeft) !== null && _a !== void 0 ? _a : 0,
45
68
  topRightRadius: (_b = radius === null || radius === void 0 ? void 0 : radius.topRight) !== null && _b !== void 0 ? _b : 0,
@@ -30,6 +30,7 @@ export declare function toProviderWidgetSheetSurfaceStyles(input: {
30
30
  sheetHostLayoutUpdate: WidgetLayoutComparableSizeUpdate | undefined;
31
31
  }): {
32
32
  contentStyle: unknown;
33
+ frameStyle: unknown;
33
34
  sheetStyle: unknown;
34
35
  };
35
36
  export declare function ProviderWidgetHostOverlay({ children, frameAppearance, isVisible, nativeView, onRequestDismiss, sheetHostLayoutUpdate, }: {
@@ -51,6 +51,13 @@ const WIDGET_SHEET_CONTENT_BASE_STYLE = {
51
51
  flex: 1,
52
52
  overflow: "hidden",
53
53
  };
54
+ const WIDGET_SHEET_FRAME_OVERLAY_STYLE = {
55
+ bottom: 0,
56
+ left: 0,
57
+ position: "absolute",
58
+ right: 0,
59
+ top: 0,
60
+ };
54
61
  const WIDGET_SHEET_DRAG_HANDLE_TOUCH_STYLE = {
55
62
  alignItems: "center",
56
63
  elevation: 19,
@@ -210,13 +217,15 @@ export function toProviderWidgetSheetSurfaceStyles(input) {
210
217
  borderTopLeftRadius: appearance.topLeftRadius,
211
218
  borderTopRightRadius: appearance.topRightRadius,
212
219
  };
213
- const frameStyle = appearance.shadowPolicy === "legacy"
220
+ const shadowStyle = appearance.shadowPolicy === "legacy"
214
221
  ? WIDGET_SHEET_LEGACY_FRAME_STYLE
215
222
  : WIDGET_SHEET_CLEARED_FRAME_STYLE;
216
223
  return {
217
224
  contentStyle: Object.assign(Object.assign({}, WIDGET_SHEET_CONTENT_BASE_STYLE), radiusStyle),
225
+ frameStyle: input.isVisible && sheetHostViewport !== undefined
226
+ ? Object.assign(Object.assign(Object.assign({}, WIDGET_SHEET_FRAME_OVERLAY_STYLE), radiusStyle), appearance.borderStyle) : HIDDEN_WIDGET_HOST_STYLE,
218
227
  sheetStyle: input.isVisible && sheetHostViewport !== undefined
219
- ? Object.assign(Object.assign(Object.assign(Object.assign({}, WIDGET_SHEET_LAYOUT_STYLE), radiusStyle), frameStyle), { height: sheetHostViewport.height }) : HIDDEN_WIDGET_HOST_STYLE,
228
+ ? Object.assign(Object.assign(Object.assign(Object.assign({}, WIDGET_SHEET_LAYOUT_STYLE), radiusStyle), shadowStyle), { height: sheetHostViewport.height }) : HIDDEN_WIDGET_HOST_STYLE,
220
229
  };
221
230
  }
222
231
  function useProviderWidgetSheetPresentation(input) {
@@ -386,5 +395,9 @@ export function ProviderWidgetHostOverlay({ children, frameAppearance, isVisible
386
395
  style: WIDGET_SHEET_DRAG_HANDLE_INDICATOR_STYLE,
387
396
  testID: "gx-widget-host-drag-handle-indicator",
388
397
  }))
389
- : null)));
398
+ : null), createElement(nativeView, {
399
+ pointerEvents: "none",
400
+ style: surfaceStyles.frameStyle,
401
+ testID: "gx-widget-host-sheet-frame",
402
+ })));
390
403
  }
package/dist/version.js CHANGED
@@ -3,4 +3,4 @@ const reactNativeSdkVersion = typeof __GX_REACT_NATIVE_SDK_VERSION__ === "string
3
3
  : "";
4
4
  // Build scripts patch this fallback to the package version for published artifacts.
5
5
  // Source-linked workspace usage keeps the local fallback.
6
- export const REACT_NATIVE_SDK_VERSION = reactNativeSdkVersion.length > 0 ? reactNativeSdkVersion : "3.0.48";
6
+ export const REACT_NATIVE_SDK_VERSION = reactNativeSdkVersion.length > 0 ? reactNativeSdkVersion : "3.0.49";
@@ -1,4 +1,4 @@
1
- import { VIEW_HOST_BOOTSTRAP_GLOBAL_KEY, VIEW_HOST_BOOTSTRAP_PROTOCOL_VERSION, VIEW_HOST_BOOTSTRAP_READY_EVENT_NAME, VIEW_HOST_BOOTSTRAP_REQUIRED_FRAGMENT, } from "@getuserfeedback/protocol/internal/view-host-bootstrap";
1
+ import { VIEW_HOST_BOOTSTRAP_CAPABILITIES, VIEW_HOST_BOOTSTRAP_GLOBAL_KEY, VIEW_HOST_BOOTSTRAP_PROTOCOL_VERSION, VIEW_HOST_BOOTSTRAP_READY_EVENT_NAME, VIEW_HOST_BOOTSTRAP_REQUIRED_FRAGMENT, } from "@getuserfeedback/protocol/internal/view-host-bootstrap";
2
2
  import { parseWebViewConnectionBridgeMessage, } from "./webview-connection-bridge-message.js";
3
3
  import { buildWebViewConnectionBridgeScript, } from "./webview-connection-bridge-script.js";
4
4
  import { buildWebViewConnectionHostMessageScript, serializeForJavaScript, } from "./webview-connection-host-message-script.js";
@@ -21,6 +21,9 @@ const buildViewHostBootstrapScript = () => {
21
21
  const bridgeGlobalKey = serializeForJavaScript(VIEW_WEBVIEW_BRIDGE_GLOBAL_KEY);
22
22
  const bootstrapGlobalKey = serializeForJavaScript(VIEW_HOST_BOOTSTRAP_GLOBAL_KEY);
23
23
  const bootstrapProtocolVersion = serializeForJavaScript(VIEW_HOST_BOOTSTRAP_PROTOCOL_VERSION);
24
+ const bootstrapCapabilities = serializeForJavaScript([
25
+ VIEW_HOST_BOOTSTRAP_CAPABILITIES.RESOLVED_FRAME_BORDER,
26
+ ]);
24
27
  const bootstrapReadyEventName = serializeForJavaScript(VIEW_HOST_BOOTSTRAP_READY_EVENT_NAME);
25
28
  const inactiveConnectionMessage = serializeForJavaScript(VIEW_WEBVIEW_BRIDGE_CONFIG.inactiveConnectionMessage);
26
29
  return `
@@ -28,6 +31,7 @@ const buildViewHostBootstrapScript = () => {
28
31
  var bridge = window[${bridgeGlobalKey}];
29
32
  window[${bootstrapGlobalKey}] = {
30
33
  protocolVersion: ${bootstrapProtocolVersion},
34
+ capabilities: ${bootstrapCapabilities},
31
35
  createViewHostConnection: function (options) {
32
36
  var config = options.config;
33
37
  var transport = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getuserfeedback/react-native",
3
- "version": "3.0.48",
3
+ "version": "3.0.49",
4
4
  "description": "getuserfeedback React Native SDK",
5
5
  "keywords": [
6
6
  "getuserfeedback",
@@ -44,8 +44,8 @@
44
44
  "lint": "biome check ."
45
45
  },
46
46
  "dependencies": {
47
- "@getuserfeedback/protocol": "^3.12.3",
48
- "@getuserfeedback/sdk": "^0.10.13",
47
+ "@getuserfeedback/protocol": "^3.13.0",
48
+ "@getuserfeedback/sdk": "^0.10.14",
49
49
  "robot3": "^1.2.0"
50
50
  },
51
51
  "peerDependencies": {