Skip to content

Commit

Permalink
Adjusting iframe messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kriswest committed Sep 4, 2024
1 parent ed60bfc commit abcc577
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 65 deletions.
9 changes: 5 additions & 4 deletions schemas/api/iFrameHello.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,20 @@
"initialCSS": {
"title": "Initial CSS",
"type": "object",
"description": "A constrained set of CSS properties that should be set on the iframe before it is displayed.",
"description": "A constrained set of CSS properties that should be set on the iframe before it is displayed. Note `position` cannot be specified and should always be set to `fixed`.",
"properties": {
"height": {"type": "string", "title": "height", "description": "The initial height of the iframe"},
"width": {"type": "string", "title": "width", "description": "The initial width of the iframe"},
"position": {"type": "string", "title": "position", "description": "The initial position CSS to apply to the iframe"},
"zIndex": {"type": "string", "title": "zIndex", "description": "The initial zindex to apply to the iframe"},
"left": {"type": "string", "title": "left", "description": "The initial left property to apply to the iframe"},
"top": {"type": "string", "title": "top", "description": "The initial right property to apply to the iframe"},
"top": {"type": "string", "title": "top", "description": "The initial top property to apply to the iframe"},
"bottom": {"type": "string", "title": "left", "description": "The initial bottom property to apply to the iframe"},
"right": {"type": "string", "title": "top", "description": "The initial right property to apply to the iframe"},
"transition": {"type": "string", "title": "transition", "description": "The transition property to apply to the iframe"},
"maxHeight": {"type": "string", "title": "maxHeight", "description": "The maximum height to apply to the iframe"},
"maxWidth": {"type": "string", "title": "maxWidth", "description": "The maximum with to apply to the iframe"}
},
"required": ["height", "width", "position", "top", "left"]
"required": ["height", "width", "top", "left"]
}
},
"additionalProperties": false,
Expand Down
24 changes: 5 additions & 19 deletions schemas/api/iFrameRestyle.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,20 @@
"updatedCSS": {
"title": "Updated CSS",
"type": "object",
"description": "A constrained set of CSS properties that should be applied to the iframe.",
"description": "A constrained set of CSS properties that should be applied to the iframe. Note `position` cannot be set, and should always be `fixed`.",
"properties": {
"height": {"type": "string", "title": "height", "description": "The updated height of the iframe"},
"width": {"type": "string", "title": "width", "description": "The updated width of the iframe"},
"position": {"type": "string", "title": "position", "description": "The updated position CSS to apply to the iframe"},
"zIndex": {"type": "string", "title": "zIndex", "description": "The updated zindex to apply to the iframe"},
"left": {"type": "string", "title": "left", "description": "The updated left property to apply to the iframe"},
"top": {"type": "string", "title": "top", "description": "The updated right property to apply to the iframe"},
"left": {"type": "string", "title": "left", "description": "The initial left property to apply to the iframe"},
"top": {"type": "string", "title": "top", "description": "The initial top property to apply to the iframe"},
"bottom": {"type": "string", "title": "left", "description": "The initial bottom property to apply to the iframe"},
"right": {"type": "string", "title": "top", "description": "The initial right property to apply to the iframe"},
"transition": {"type": "string", "title": "transition", "description": "The updated transition property to apply to the iframe"},
"maxHeight": {"type": "string", "title": "maxHeight", "description": "The updated maximum height to apply to the iframe"},
"maxWidth": {"type": "string", "title": "maxWidth", "description": "The updated maximum with to apply to the iframe"}
},
"required": []
},
"resizeAnchor": {
"title": "Resizing",
"description": "Optional property to support resizing. When resizing anchor at the indicated location (without top or left set),\ne.g.\n\t- for top-left and a larger size: the bottom right corner should move down and out.\n\t- for top and smaller size: both the bottom corners should move in and up.",
"anyOf": [
{ "type": "string", "const": "top-left" },
{ "type": "string", "const": "top" },
{ "type": "string", "const": "top-right" },
{ "type": "string", "const": "right" },
{ "type": "string", "const": "bottom-right" },
{ "type": "string", "const": "bottom" },
{ "type": "string", "const": "bottom-left" },
{ "type": "string", "const": "left" },
{ "type": "string", "const": "center" }
]
}
},
"additionalProperties": false,
Expand Down
67 changes: 25 additions & 42 deletions src/api/BrowserTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2271,16 +2271,20 @@ export interface IframeHelloPayload {
implementationDetails: string;
/**
* A constrained set of CSS properties that should be set on the iframe before it is
* displayed.
* displayed. Note `position` cannot be specified and should always be set to `fixed`.
*/
initialCSS: InitialCSS;
}

/**
* A constrained set of CSS properties that should be set on the iframe before it is
* displayed.
* displayed. Note `position` cannot be specified and should always be set to `fixed`.
*/
export interface InitialCSS {
/**
* The initial bottom property to apply to the iframe
*/
bottom?: string;
/**
* The initial height of the iframe
*/
Expand All @@ -2298,11 +2302,11 @@ export interface InitialCSS {
*/
maxWidth?: string;
/**
* The initial position CSS to apply to the iframe
* The initial right property to apply to the iframe
*/
position: string;
right?: string;
/**
* The initial right property to apply to the iframe
* The initial top property to apply to the iframe
*/
top: string;
/**
Expand Down Expand Up @@ -2444,38 +2448,27 @@ export interface IframeRestyle {
*/
export interface IframeRestylePayload {
/**
* Optional property to support resizing. When resizing anchor at the indicated location
* (without top or left set),
* e.g.
* - for top-left and a larger size: the bottom right corner should move down and out.
* - for top and smaller size: both the bottom corners should move in and up.
*/
resizeAnchor?: Resizing;
/**
* A constrained set of CSS properties that should be applied to the iframe.
* A constrained set of CSS properties that should be applied to the iframe. Note `position`
* cannot be set, and should always be `fixed`.
*/
updatedCSS: UpdatedCSS;
}

/**
* Optional property to support resizing. When resizing anchor at the indicated location
* (without top or left set),
* e.g.
* - for top-left and a larger size: the bottom right corner should move down and out.
* - for top and smaller size: both the bottom corners should move in and up.
*/
export type Resizing = "top-left" | "top" | "top-right" | "right" | "bottom-right" | "bottom" | "bottom-left" | "left" | "center";

/**
* A constrained set of CSS properties that should be applied to the iframe.
* A constrained set of CSS properties that should be applied to the iframe. Note `position`
* cannot be set, and should always be `fixed`.
*/
export interface UpdatedCSS {
/**
* The initial bottom property to apply to the iframe
*/
bottom?: string;
/**
* The updated height of the iframe
*/
height?: string;
/**
* The updated left property to apply to the iframe
* The initial left property to apply to the iframe
*/
left?: string;
/**
Expand All @@ -2487,11 +2480,11 @@ export interface UpdatedCSS {
*/
maxWidth?: string;
/**
* The updated position CSS to apply to the iframe
* The initial right property to apply to the iframe
*/
position?: string;
right?: string;
/**
* The updated right property to apply to the iframe
* The initial top property to apply to the iframe
*/
top?: string;
/**
Expand Down Expand Up @@ -5143,11 +5136,12 @@ const typeMap: any = {
{ json: "initialCSS", js: "initialCSS", typ: r("InitialCSS") },
], false),
"InitialCSS": o([
{ json: "bottom", js: "bottom", typ: u(undefined, "") },
{ json: "height", js: "height", typ: "" },
{ json: "left", js: "left", typ: "" },
{ json: "maxHeight", js: "maxHeight", typ: u(undefined, "") },
{ json: "maxWidth", js: "maxWidth", typ: u(undefined, "") },
{ json: "position", js: "position", typ: "" },
{ json: "right", js: "right", typ: u(undefined, "") },
{ json: "top", js: "top", typ: "" },
{ json: "transition", js: "transition", typ: u(undefined, "") },
{ json: "width", js: "width", typ: "" },
Expand Down Expand Up @@ -5179,15 +5173,15 @@ const typeMap: any = {
{ json: "type", js: "type", typ: r("IframeRestyleType") },
], false),
"IframeRestylePayload": o([
{ json: "resizeAnchor", js: "resizeAnchor", typ: u(undefined, r("Resizing")) },
{ json: "updatedCSS", js: "updatedCSS", typ: r("UpdatedCSS") },
], false),
"UpdatedCSS": o([
{ json: "bottom", js: "bottom", typ: u(undefined, "") },
{ json: "height", js: "height", typ: u(undefined, "") },
{ json: "left", js: "left", typ: u(undefined, "") },
{ json: "maxHeight", js: "maxHeight", typ: u(undefined, "") },
{ json: "maxWidth", js: "maxWidth", typ: u(undefined, "") },
{ json: "position", js: "position", typ: u(undefined, "") },
{ json: "right", js: "right", typ: u(undefined, "") },
{ json: "top", js: "top", typ: u(undefined, "") },
{ json: "transition", js: "transition", typ: u(undefined, "") },
{ json: "width", js: "width", typ: u(undefined, "") },
Expand Down Expand Up @@ -5760,17 +5754,6 @@ const typeMap: any = {
"IframeResolveActionType": [
"iframeResolveAction",
],
"Resizing": [
"bottom",
"bottom-left",
"bottom-right",
"center",
"left",
"right",
"top",
"top-left",
"top-right",
],
"IframeRestyleType": [
"iframeRestyle",
],
Expand Down

0 comments on commit abcc577

Please sign in to comment.