@scalar/api-reference-react 0.9.60 → 0.9.61

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/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @scalar/api-reference-react
2
2
 
3
+ ## 0.9.61
4
+
3
5
  ## 0.9.60
4
6
 
5
7
  ## 0.9.59
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/vue-bundler-flags.ts","../src/ApiReferenceReact.tsx"],"sourcesContent":["// Ensure Vue ESM-bundler feature flags exist before Vue-based modules are imported.\nglobalThis.__VUE_OPTIONS_API__ = true\nglobalThis.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = true\nglobalThis.__VUE_PROD_DEVTOOLS__ = false\n","'use client'\n\nimport './vue-bundler-flags'\nimport { createApiReference } from '@scalar/api-reference'\nimport type { AnyApiReferenceConfiguration, ApiReferenceInstance } from '@scalar/types/api-reference'\nimport { useEffect, useRef, useState } from 'react'\n\nimport './style.css'\n\n/**\n * React wrapper around the Scalar API Reference\n */\nexport const ApiReferenceReact = (props: { configuration: AnyApiReferenceConfiguration }) => {\n const el = useRef<HTMLDivElement | null>(null)\n\n const [reference, setReference] = useState<ApiReferenceInstance | null>(null)\n\n /** handle adding the integration to the config */\n const addIntegration = () =>\n Array.isArray(props.configuration)\n ? props.configuration.map((c) => ({ _integration: 'react' as const, ...c }))\n : { _integration: 'react' as const, ...props.configuration }\n\n useEffect(() => {\n if (!el.current) {\n return reference?.app?.unmount\n }\n\n const instance = createApiReference(el.current, addIntegration())\n setReference(instance)\n\n // Unmount on cleanup\n return instance.destroy\n }, [el])\n\n useEffect(() => {\n reference?.updateConfiguration(addIntegration())\n }, [props.configuration, reference])\n\n return <div ref={el} />\n}\n"],"mappings":";;;;;AACA,WAAW,sBAAsB;AACjC,WAAW,0CAA0C;AACrD,WAAW,wBAAwB;;;;;;ACSnC,IAAa,qBAAqB,UAA2D;CAC3F,MAAM,KAAK,OAA8B,KAAK;CAE9C,MAAM,CAAC,WAAW,gBAAgB,SAAsC,KAAK;;CAG7E,MAAM,uBACJ,MAAM,QAAQ,MAAM,cAAc,GAC9B,MAAM,cAAc,KAAK,OAAO;EAAE,cAAc;EAAkB,GAAG;EAAG,EAAE,GAC1E;EAAE,cAAc;EAAkB,GAAG,MAAM;EAAe;AAEhE,iBAAgB;AACd,MAAI,CAAC,GAAG,QACN,QAAO,WAAW,KAAK;EAGzB,MAAM,WAAW,mBAAmB,GAAG,SAAS,gBAAgB,CAAC;AACjE,eAAa,SAAS;AAGtB,SAAO,SAAS;IACf,CAAC,GAAG,CAAC;AAER,iBAAgB;AACd,aAAW,oBAAoB,gBAAgB,CAAC;IAC/C,CAAC,MAAM,eAAe,UAAU,CAAC;AAEpC,QAAO,oBAAC,OAAD,EAAK,KAAK,IAAM,CAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/vue-bundler-flags.ts","../src/ApiReferenceReact.tsx"],"sourcesContent":["// Ensure Vue ESM-bundler feature flags exist before Vue-based modules are imported.\nglobalThis.__VUE_OPTIONS_API__ = true\nglobalThis.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = true\nglobalThis.__VUE_PROD_DEVTOOLS__ = false\n","'use client'\n\nimport './vue-bundler-flags'\nimport { createApiReference } from '@scalar/api-reference'\nimport type { AnyApiReferenceConfiguration, ApiReferenceInstance } from '@scalar/types/api-reference'\nimport { useEffect, useRef, useState } from 'react'\n\nimport './style.css'\n\n/**\n * React wrapper around the Scalar API Reference\n */\nexport const ApiReferenceReact = (props: { configuration: AnyApiReferenceConfiguration }) => {\n const el = useRef<HTMLDivElement | null>(null)\n\n const [reference, setReference] = useState<ApiReferenceInstance | null>(null)\n\n /** handle adding the integration to the config */\n const addIntegration = () =>\n Array.isArray(props.configuration)\n ? props.configuration.map((c) => ({ _integration: 'react' as const, ...c }))\n : { _integration: 'react' as const, ...props.configuration }\n\n useEffect(() => {\n if (!el.current) {\n return reference?.app?.unmount\n }\n\n const instance = createApiReference(el.current, addIntegration())\n setReference(instance)\n\n // Unmount on cleanup\n return instance.destroy\n }, [el])\n\n useEffect(() => {\n reference?.updateConfiguration(addIntegration())\n }, [props.configuration, reference])\n\n return <div ref={el} />\n}\n"],"mappings":";;;;;AACA,WAAW,sBAAsB;AACjC,WAAW,0CAA0C;AACrD,WAAW,wBAAwB;;;;;;ACSnC,IAAa,qBAAqB,UAA2D;CAC3F,MAAM,KAAK,OAA8B,IAAI;CAE7C,MAAM,CAAC,WAAW,gBAAgB,SAAsC,IAAI;;CAG5E,MAAM,uBACJ,MAAM,QAAQ,MAAM,aAAa,IAC7B,MAAM,cAAc,KAAK,OAAO;EAAE,cAAc;EAAkB,GAAG;CAAE,EAAE,IACzE;EAAE,cAAc;EAAkB,GAAG,MAAM;CAAc;CAE/D,gBAAgB;EACd,IAAI,CAAC,GAAG,SACN,OAAO,WAAW,KAAK;EAGzB,MAAM,WAAW,mBAAmB,GAAG,SAAS,eAAe,CAAC;EAChE,aAAa,QAAQ;EAGrB,OAAO,SAAS;CAClB,GAAG,CAAC,EAAE,CAAC;CAEP,gBAAgB;EACd,WAAW,oBAAoB,eAAe,CAAC;CACjD,GAAG,CAAC,MAAM,eAAe,SAAS,CAAC;CAEnC,OAAO,oBAAC,OAAD,EAAK,KAAK,GAAK,CAAA;AACxB"}