From 4dc3770acd77d4749ac036693c2ac41027456fa3 Mon Sep 17 00:00:00 2001 From: Melissa Garcia Date: Tue, 10 Sep 2024 12:54:22 -0700 Subject: [PATCH] feat: try it panel event handlers --- packages/gatsby-theme-aio/package.json | 2 +- .../src/components/RedoclyAPIBlock/index.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/gatsby-theme-aio/package.json b/packages/gatsby-theme-aio/package.json index 1ddf159788..490cfd3b1c 100644 --- a/packages/gatsby-theme-aio/package.json +++ b/packages/gatsby-theme-aio/package.json @@ -1,6 +1,6 @@ { "name": "@adobe/gatsby-theme-aio", - "version": "4.14.10", + "version": "4.14.11-rc3", "description": "The Adobe I/O theme for building markdown powered sites", "main": "index.js", "license": "Apache-2.0", diff --git a/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js b/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js index c5d1614ef7..1992b06497 100644 --- a/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js +++ b/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js @@ -31,6 +31,8 @@ const RedoclyAPIBlock = ({ jsonSampleExpandLevel = 2, generateCodeSamples = 'languages: [], skipOptionalParameters: false,', requestInterceptor = '', + tryItOpenEventHandler = '', + tryItSentEventHandler = '', }) => { const [isRedoclyLoading, setIsRedoclyLoading] = useState(true); @@ -75,6 +77,10 @@ const RedoclyAPIBlock = ({ jsonSampleExpandLevel: ${jsonSampleExpandLevel === all ? `'${jsonSampleExpandLevel}'` : jsonSampleExpandLevel}, ${generateCodeSamples ? "generateCodeSamples: { " + generateCodeSamples + "}," : ''} ${requestInterceptor ? "requestInterceptor: " + requestInterceptor + "," : ''} + events: { + ${tryItOpenEventHandler ? "tryItOpen: " + tryItOpenEventHandler + "," : ''} + ${tryItSentEventHandler ? "tryItSent: " + tryItSentEventHandler + "," : ''} + }, hideLoading: true, theme: { ${typography ? "typography: { " + typography + "}," : ''} @@ -109,6 +115,8 @@ RedoclyAPIBlock.propTypes = { ]), generateCodeSamples: PropTypes.string, requestInterceptor: PropTypes.string, + tryItOpenEventHandler: PropTypes.string, + tryItSentEventHandler: PropTypes.string, }; export { RedoclyAPIBlock }; \ No newline at end of file