From 08332a23de7b59140370b75a90b9739020b22e6b Mon Sep 17 00:00:00 2001 From: Jay Chesterman Date: Wed, 9 Apr 2025 16:32:12 -0400 Subject: [PATCH 1/3] adding displayOptions config --- packages/sandbox/src/EmbeddedSandbox.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/sandbox/src/EmbeddedSandbox.ts b/packages/sandbox/src/EmbeddedSandbox.ts index 229fa57..ecfaae2 100644 --- a/packages/sandbox/src/EmbeddedSandbox.ts +++ b/packages/sandbox/src/EmbeddedSandbox.ts @@ -6,6 +6,12 @@ import packageJSON from '../package.json'; import type { JSONObject } from './helpers/types'; type InitialState = { + /** + * optional. Set initial display options for sandbox + */ + displayOptions?: { + docsPanelState?: 'open' | 'closed'; // default to 'open', + }; /** * optional. Set headers for every operation a user triggers from this Sandbox. * Users can check and uncheck these headers, but not edit them. @@ -139,7 +145,8 @@ export class EmbeddedSandbox { let element: HTMLElement | null; const { target, runTelemetry } = this.options; - const { includeCookies, sharedHeaders } = this.options.initialState || {}; + const { includeCookies, sharedHeaders, displayOptions } = + this.options.initialState || {}; const queryParams = { runtime: this.options.runtime, @@ -185,6 +192,7 @@ export class EmbeddedSandbox { shouldDefaultAutoupdateSchema: this.options.initialState?.pollForSchemaUpdates ?? true, endpointIsEditable: this.options.endpointIsEditable, + docsPanelState: displayOptions?.docsPanelState ?? 'open', }; const queryString = Object.entries(queryParams) From ca5e8db34a1263ae311461ae709a1ff9a4ad7fd4 Mon Sep 17 00:00:00 2001 From: Jay Chesterman Date: Thu, 10 Apr 2025 12:58:52 -0400 Subject: [PATCH 2/3] trigger fresh build From 494ef9e270d0521dc4bd86dec88780acbbdea738 Mon Sep 17 00:00:00 2001 From: Jay Chesterman Date: Thu, 10 Apr 2025 13:36:02 -0400 Subject: [PATCH 3/3] rebuild