@getuserfeedback/protocol 3.0.5 → 3.0.6
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/host/index.d.ts +1 -0
- package/dist/host/index.d.ts.map +1 -1
- package/dist/host/index.js +1 -0
- package/dist/host/widget-layout-size-update.d.ts +15 -0
- package/dist/host/widget-layout-size-update.d.ts.map +1 -0
- package/dist/host/widget-layout-size-update.js +10 -0
- package/package.json +1 -1
- package/src/host/index.ts +1 -0
- package/src/host/widget-layout-size-update.test.ts +25 -0
- package/src/host/widget-layout-size-update.ts +29 -0
package/dist/host/index.d.ts
CHANGED
|
@@ -11,4 +11,5 @@ export * from "./lazy-handle-client.js";
|
|
|
11
11
|
export { createCommandRequestId } from "./request-id.js";
|
|
12
12
|
export * from "./sdk-types.js";
|
|
13
13
|
export { createUniqueId } from "./unique-id.js";
|
|
14
|
+
export * from "./widget-layout-size-update.js";
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/host/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/host/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/host/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,cAAc,gCAAgC,CAAC"}
|
package/dist/host/index.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type WidgetLayoutSize = {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
};
|
|
5
|
+
export type WidgetLayoutSizeTransition = {
|
|
6
|
+
kind: "instant";
|
|
7
|
+
durationMs: 0;
|
|
8
|
+
};
|
|
9
|
+
export type WidgetLayoutSizeUpdate = {
|
|
10
|
+
size: WidgetLayoutSize;
|
|
11
|
+
transition: WidgetLayoutSizeTransition;
|
|
12
|
+
};
|
|
13
|
+
export declare const INSTANT_WIDGET_LAYOUT_SIZE_TRANSITION: WidgetLayoutSizeTransition;
|
|
14
|
+
export declare function toInstantWidgetLayoutSizeUpdate(size: WidgetLayoutSize): WidgetLayoutSizeUpdate;
|
|
15
|
+
//# sourceMappingURL=widget-layout-size-update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-layout-size-update.d.ts","sourceRoot":"","sources":["../../src/host/widget-layout-size-update.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACxC,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,CAAC,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,EAAE,0BAA0B,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,qCAAqC,EAAE,0BAIlD,CAAC;AAEH,wBAAgB,+BAA+B,CAC9C,IAAI,EAAE,gBAAgB,GACpB,sBAAsB,CAKxB"}
|
package/package.json
CHANGED
package/src/host/index.ts
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import {
|
|
3
|
+
INSTANT_WIDGET_LAYOUT_SIZE_TRANSITION,
|
|
4
|
+
toInstantWidgetLayoutSizeUpdate,
|
|
5
|
+
} from "./widget-layout-size-update.js";
|
|
6
|
+
|
|
7
|
+
describe("widget layout size update", () => {
|
|
8
|
+
test("wraps a host size in the current instant transition contract", () => {
|
|
9
|
+
expect(
|
|
10
|
+
toInstantWidgetLayoutSizeUpdate({ width: 320, height: 240 }),
|
|
11
|
+
).toEqual({
|
|
12
|
+
size: { width: 320, height: 240 },
|
|
13
|
+
transition: {
|
|
14
|
+
kind: "instant",
|
|
15
|
+
durationMs: 0,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test("shares the zero-duration transition constant", () => {
|
|
21
|
+
expect(
|
|
22
|
+
toInstantWidgetLayoutSizeUpdate({ width: 1, height: 1 }).transition,
|
|
23
|
+
).toBe(INSTANT_WIDGET_LAYOUT_SIZE_TRANSITION);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type WidgetLayoutSize = {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export type WidgetLayoutSizeTransition = {
|
|
7
|
+
kind: "instant";
|
|
8
|
+
durationMs: 0;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type WidgetLayoutSizeUpdate = {
|
|
12
|
+
size: WidgetLayoutSize;
|
|
13
|
+
transition: WidgetLayoutSizeTransition;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const INSTANT_WIDGET_LAYOUT_SIZE_TRANSITION: WidgetLayoutSizeTransition =
|
|
17
|
+
{
|
|
18
|
+
kind: "instant",
|
|
19
|
+
durationMs: 0,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function toInstantWidgetLayoutSizeUpdate(
|
|
23
|
+
size: WidgetLayoutSize,
|
|
24
|
+
): WidgetLayoutSizeUpdate {
|
|
25
|
+
return {
|
|
26
|
+
size: { ...size },
|
|
27
|
+
transition: INSTANT_WIDGET_LAYOUT_SIZE_TRANSITION,
|
|
28
|
+
};
|
|
29
|
+
}
|