@scalar/blocks 0.11.1 → 0.11.3
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 +28 -0
- package/dist/code-example/components/AsyncApiCodeExample.vue.js +111 -6
- package/dist/code-example/components/AsyncApiCodeExample.vue.js.map +1 -1
- package/dist/code-example/components/AsyncApiCodeExample3.vue.js +8 -0
- package/dist/code-example/components/AsyncApiCodeExample3.vue.js.map +1 -0
- package/dist/code-example/components/CodeExample.vue.d.ts +10 -0
- package/dist/code-example/components/CodeExample.vue.d.ts.map +1 -1
- package/dist/code-example/components/CodeExample.vue.js +297 -6
- package/dist/code-example/components/CodeExample.vue.js.map +1 -1
- package/dist/code-example/components/CodeExample3.vue.js +8 -0
- package/dist/code-example/components/CodeExample3.vue.js.map +1 -0
- package/dist/code-example/components/ExamplePicker.vue.d.ts +2 -0
- package/dist/code-example/components/ExamplePicker.vue.d.ts.map +1 -1
- package/dist/code-example/components/ExamplePicker.vue.js +50 -4
- package/dist/code-example/components/ExamplePicker.vue.js.map +1 -1
- package/dist/code-example/components/ExamplePicker2.vue.js +6 -0
- package/dist/code-example/components/ExamplePicker2.vue.js.map +1 -0
- package/dist/code-example/components/HttpMethod.vue.js +32 -4
- package/dist/code-example/components/HttpMethod.vue.js.map +1 -1
- package/dist/code-example/components/HttpMethod2.vue.js +6 -0
- package/dist/code-example/components/HttpMethod2.vue.js.map +1 -0
- package/dist/code-example/helpers/filter-clients-by-query.js.map +1 -1
- package/dist/code-example/helpers/find-client.js.map +1 -1
- package/dist/code-example/helpers/format-language.js.map +1 -1
- package/dist/code-example/helpers/generate-client-options.js.map +1 -1
- package/dist/code-example/helpers/generate-code-snippet.d.ts +8 -2
- package/dist/code-example/helpers/generate-code-snippet.d.ts.map +1 -1
- package/dist/code-example/helpers/generate-code-snippet.js +57 -27
- package/dist/code-example/helpers/generate-code-snippet.js.map +1 -1
- package/dist/code-example/helpers/get-asyncapi-example-context.js.map +1 -1
- package/dist/code-example/helpers/get-clients.js.map +1 -1
- package/dist/code-example/helpers/get-custom-code-samples.js.map +1 -1
- package/dist/code-example/helpers/get-generated-payload-example.js.map +1 -1
- package/dist/code-example/helpers/get-message-example-content.js.map +1 -1
- package/dist/code-example/helpers/get-secrets.js.map +1 -1
- package/dist/code-example/helpers/get-snippet.d.ts +2 -2
- package/dist/code-example/helpers/get-snippet.d.ts.map +1 -1
- package/dist/code-example/helpers/get-snippet.js +7 -9
- package/dist/code-example/helpers/get-snippet.js.map +1 -1
- package/dist/code-example/helpers/operation-to-har/operation-to-har.d.ts +1 -1
- package/dist/code-example/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
- package/dist/code-example/helpers/operation-to-har/operation-to-har.js +1 -1
- package/dist/code-example/helpers/operation-to-har/operation-to-har.js.map +1 -1
- package/dist/code-example/helpers/operation-to-har/process-body.d.ts +2 -2
- package/dist/code-example/helpers/operation-to-har/process-body.d.ts.map +1 -1
- package/dist/code-example/helpers/operation-to-har/process-body.js +102 -81
- package/dist/code-example/helpers/operation-to-har/process-body.js.map +1 -1
- package/dist/code-example/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
- package/dist/code-example/helpers/operation-to-har/process-parameters.js +110 -108
- package/dist/code-example/helpers/operation-to-har/process-parameters.js.map +1 -1
- package/dist/code-example/helpers/operation-to-har/process-security-schemes.js +6 -6
- package/dist/code-example/helpers/operation-to-har/process-security-schemes.js.map +1 -1
- package/dist/code-example/helpers/operation-to-har/process-server-url.js.map +1 -1
- package/dist/code-example/index.d.ts +1 -1
- package/dist/code-example/index.d.ts.map +1 -1
- package/dist/code-example/index.js +14 -14
- package/dist/code-example/mount-asyncapi.js +1 -1
- package/dist/code-example/mount-asyncapi.js.map +1 -1
- package/dist/code-example/mount.js +1 -1
- package/dist/code-example/mount.js.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/schema/LinkButton.vue.js.map +1 -1
- package/dist/schema/RenderString.vue.js +11 -4
- package/dist/schema/RenderString.vue.js.map +1 -1
- package/dist/schema/RenderString2.vue.js +6 -0
- package/dist/schema/RenderString2.vue.js.map +1 -0
- package/dist/schema/Schema.vue.js +235 -6
- package/dist/schema/Schema.vue.js.map +1 -1
- package/dist/schema/Schema3.vue.js +8 -0
- package/dist/schema/Schema3.vue.js.map +1 -0
- package/dist/schema/SchemaCollapsedPreview.vue.js +25 -4
- package/dist/schema/SchemaCollapsedPreview.vue.js.map +1 -1
- package/dist/schema/SchemaCollapsedPreview2.vue.js +6 -0
- package/dist/schema/SchemaCollapsedPreview2.vue.js.map +1 -0
- package/dist/schema/SchemaComposition.vue.js +232 -6
- package/dist/schema/SchemaComposition.vue.js.map +1 -1
- package/dist/schema/SchemaComposition3.vue.js +8 -0
- package/dist/schema/SchemaComposition3.vue.js.map +1 -0
- package/dist/schema/SchemaEnumPropertyItem.vue.d.ts +1 -0
- package/dist/schema/SchemaEnumPropertyItem.vue.d.ts.map +1 -1
- package/dist/schema/SchemaEnumPropertyItem.vue.js +23 -4
- package/dist/schema/SchemaEnumPropertyItem.vue.js.map +1 -1
- package/dist/schema/SchemaEnumPropertyItem2.vue.js +6 -0
- package/dist/schema/SchemaEnumPropertyItem2.vue.js.map +1 -0
- package/dist/schema/SchemaEnums.vue.d.ts.map +1 -1
- package/dist/schema/SchemaEnums.vue.js +74 -6
- package/dist/schema/SchemaEnums.vue.js.map +1 -1
- package/dist/schema/SchemaEnums3.vue.js +8 -0
- package/dist/schema/SchemaEnums3.vue.js.map +1 -0
- package/dist/schema/SchemaGlyphPuck.vue.js +27 -4
- package/dist/schema/SchemaGlyphPuck.vue.js.map +1 -1
- package/dist/schema/SchemaGlyphPuck2.vue.js +6 -0
- package/dist/schema/SchemaGlyphPuck2.vue.js.map +1 -0
- package/dist/schema/SchemaGutterToggle.vue.js +40 -4
- package/dist/schema/SchemaGutterToggle.vue.js.map +1 -1
- package/dist/schema/SchemaGutterToggle2.vue.js +6 -0
- package/dist/schema/SchemaGutterToggle2.vue.js.map +1 -0
- package/dist/schema/SchemaHeading.vue.js +32 -6
- package/dist/schema/SchemaHeading.vue.js.map +1 -1
- package/dist/schema/SchemaHeading3.vue.js +8 -0
- package/dist/schema/SchemaHeading3.vue.js.map +1 -0
- package/dist/schema/SchemaObjectExampleCodeBlock.vue.js +42 -4
- package/dist/schema/SchemaObjectExampleCodeBlock.vue.js.map +1 -1
- package/dist/schema/SchemaObjectExampleCodeBlock2.vue.js +6 -0
- package/dist/schema/SchemaObjectExampleCodeBlock2.vue.js.map +1 -0
- package/dist/schema/SchemaObjectProperties.vue.js +213 -4
- package/dist/schema/SchemaObjectProperties.vue.js.map +1 -1
- package/dist/schema/SchemaObjectProperties2.vue.js +6 -0
- package/dist/schema/SchemaObjectProperties2.vue.js.map +1 -0
- package/dist/schema/SchemaProperty.vue.d.ts +1 -1
- package/dist/schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/schema/SchemaProperty.vue.js +472 -6
- package/dist/schema/SchemaProperty.vue.js.map +1 -1
- package/dist/schema/SchemaProperty3.vue.js +8 -0
- package/dist/schema/SchemaProperty3.vue.js.map +1 -0
- package/dist/schema/SchemaPropertyDefault.vue.js +61 -6
- package/dist/schema/SchemaPropertyDefault.vue.js.map +1 -1
- package/dist/schema/SchemaPropertyDefault3.vue.js +8 -0
- package/dist/schema/SchemaPropertyDefault3.vue.js.map +1 -0
- package/dist/schema/SchemaPropertyDetail.vue.js +22 -6
- package/dist/schema/SchemaPropertyDetail.vue.js.map +1 -1
- package/dist/schema/SchemaPropertyDetail3.vue.js +8 -0
- package/dist/schema/SchemaPropertyDetail3.vue.js.map +1 -0
- package/dist/schema/SchemaPropertyExamples.vue.js +133 -6
- package/dist/schema/SchemaPropertyExamples.vue.js.map +1 -1
- package/dist/schema/SchemaPropertyExamples3.vue.js +8 -0
- package/dist/schema/SchemaPropertyExamples3.vue.js.map +1 -0
- package/dist/schema/SchemaPropertyHeading.vue.d.ts +1 -1
- package/dist/schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/schema/SchemaPropertyHeading.vue.js +312 -6
- package/dist/schema/SchemaPropertyHeading.vue.js.map +1 -1
- package/dist/schema/SchemaPropertyHeading3.vue.js +8 -0
- package/dist/schema/SchemaPropertyHeading3.vue.js.map +1 -0
- package/dist/schema/SchemaPropertyPattern.vue.js +42 -6
- package/dist/schema/SchemaPropertyPattern.vue.js.map +1 -1
- package/dist/schema/SchemaPropertyPattern3.vue.js +8 -0
- package/dist/schema/SchemaPropertyPattern3.vue.js.map +1 -0
- package/dist/schema/SchemaRailPanel.vue.js +53 -4
- package/dist/schema/SchemaRailPanel.vue.js.map +1 -1
- package/dist/schema/SchemaRailPanel2.vue.js +6 -0
- package/dist/schema/SchemaRailPanel2.vue.js.map +1 -0
- package/dist/schema/components/CopyLinkButton.vue.d.ts +5 -0
- package/dist/schema/components/CopyLinkButton.vue.d.ts.map +1 -1
- package/dist/schema/components/CopyLinkButton.vue.js +24 -4
- package/dist/schema/components/CopyLinkButton.vue.js.map +1 -1
- package/dist/schema/components/CopyLinkButton2.vue.js +6 -0
- package/dist/schema/components/CopyLinkButton2.vue.js.map +1 -0
- package/dist/schema/components/WithBreadcrumb.vue.js +15 -4
- package/dist/schema/components/WithBreadcrumb.vue.js.map +1 -1
- package/dist/schema/components/WithBreadcrumb2.vue.js +6 -0
- package/dist/schema/components/WithBreadcrumb2.vue.js.map +1 -0
- package/dist/schema/helpers/dynamic-scope.js.map +1 -1
- package/dist/schema/helpers/format-example.js.map +1 -1
- package/dist/schema/helpers/format-structured-value.d.ts +3 -0
- package/dist/schema/helpers/format-structured-value.d.ts.map +1 -0
- package/dist/schema/helpers/format-structured-value.js +6 -0
- package/dist/schema/helpers/format-structured-value.js.map +1 -0
- package/dist/schema/helpers/format-value.js.map +1 -1
- package/dist/schema/helpers/get-compositions-to-render.js.map +1 -1
- package/dist/schema/helpers/get-discriminator-values.js.map +1 -1
- package/dist/schema/helpers/get-enum-values.js.map +1 -1
- package/dist/schema/helpers/get-property-description.js.map +1 -1
- package/dist/schema/helpers/get-ref-name.js.map +1 -1
- package/dist/schema/helpers/get-rendered-example.js.map +1 -1
- package/dist/schema/helpers/get-schema-type.js.map +1 -1
- package/dist/schema/helpers/get-type-signature-tokens.d.ts.map +1 -1
- package/dist/schema/helpers/get-type-signature-tokens.js +37 -36
- package/dist/schema/helpers/get-type-signature-tokens.js.map +1 -1
- package/dist/schema/helpers/has-complex-array-items.js.map +1 -1
- package/dist/schema/helpers/is-empty-schema-object.js.map +1 -1
- package/dist/schema/helpers/is-model-linkable.js.map +1 -1
- package/dist/schema/helpers/is-on-schema-target-path.js.map +1 -1
- package/dist/schema/helpers/is-type-object.js.map +1 -1
- package/dist/schema/helpers/merge-all-of-schemas.js.map +1 -1
- package/dist/schema/helpers/normalize-object-composition.js.map +1 -1
- package/dist/schema/helpers/optimize-value-for-display.js.map +1 -1
- package/dist/schema/helpers/partition-all-of-compositions.js.map +1 -1
- package/dist/schema/helpers/schema-cycle.js.map +1 -1
- package/dist/schema/helpers/schema-expansion.js.map +1 -1
- package/dist/schema/helpers/schema-keyboard-nav.js.map +1 -1
- package/dist/schema/helpers/schema-name.js.map +1 -1
- package/dist/schema/helpers/should-display-description.js.map +1 -1
- package/dist/schema/helpers/should-display-heading.js.map +1 -1
- package/dist/schema/helpers/should-render-array-item-composition.js.map +1 -1
- package/dist/schema/helpers/sort-property-names.js.map +1 -1
- package/dist/schema/helpers/unwrap-for-read.js.map +1 -1
- package/dist/schema/index.js +8 -8
- package/dist/schema/localization/index.d.ts +1 -1
- package/dist/schema/localization/index.js.map +1 -1
- package/dist/schema/localization/translations.js.map +1 -1
- package/dist/shared/Badge.vue.js +13 -6
- package/dist/shared/Badge.vue.js.map +1 -1
- package/dist/shared/Badge3.vue.js +8 -0
- package/dist/shared/Badge3.vue.js.map +1 -0
- package/dist/shared/ExternalDocs.vue.js +43 -4
- package/dist/shared/ExternalDocs.vue.js.map +1 -1
- package/dist/shared/ExternalDocs2.vue.js +6 -0
- package/dist/shared/ExternalDocs2.vue.js.map +1 -0
- package/dist/shared/ExternalExampleStatus.vue.d.ts +12 -0
- package/dist/shared/ExternalExampleStatus.vue.d.ts.map +1 -0
- package/dist/shared/ExternalExampleStatus.vue.js +26 -0
- package/dist/shared/ExternalExampleStatus.vue.js.map +1 -0
- package/dist/shared/ExternalExampleStatus2.vue.js +6 -0
- package/dist/shared/ExternalExampleStatus2.vue.js.map +1 -0
- package/dist/shared/ScreenReader.vue.js +16 -4
- package/dist/shared/ScreenReader.vue.js.map +1 -1
- package/dist/shared/ScreenReader2.vue.js +6 -0
- package/dist/shared/ScreenReader2.vue.js.map +1 -0
- package/dist/shared/external-example-localization/index.d.ts +4 -0
- package/dist/shared/external-example-localization/index.d.ts.map +1 -0
- package/dist/shared/external-example-localization/index.js +17 -0
- package/dist/shared/external-example-localization/index.js.map +1 -0
- package/dist/shared/external-example-localization/locales/ar.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/ar.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/ar.js +9 -0
- package/dist/shared/external-example-localization/locales/ar.js.map +1 -0
- package/dist/shared/external-example-localization/locales/de.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/de.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/de.js +9 -0
- package/dist/shared/external-example-localization/locales/de.js.map +1 -0
- package/dist/shared/external-example-localization/locales/en.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/en.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/en.js +9 -0
- package/dist/shared/external-example-localization/locales/en.js.map +1 -0
- package/dist/shared/external-example-localization/locales/es.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/es.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/es.js +9 -0
- package/dist/shared/external-example-localization/locales/es.js.map +1 -0
- package/dist/shared/external-example-localization/locales/fr.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/fr.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/fr.js +9 -0
- package/dist/shared/external-example-localization/locales/fr.js.map +1 -0
- package/dist/shared/external-example-localization/locales/pt.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/pt.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/pt.js +9 -0
- package/dist/shared/external-example-localization/locales/pt.js.map +1 -0
- package/dist/shared/external-example-localization/locales/ru.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/ru.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/ru.js +9 -0
- package/dist/shared/external-example-localization/locales/ru.js.map +1 -0
- package/dist/shared/external-example-localization/locales/zh-cn.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/zh-cn.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/zh-cn.js +9 -0
- package/dist/shared/external-example-localization/locales/zh-cn.js.map +1 -0
- package/dist/shared/external-example-localization/locales/zh-tw.d.ts +8 -0
- package/dist/shared/external-example-localization/locales/zh-tw.d.ts.map +1 -0
- package/dist/shared/external-example-localization/locales/zh-tw.js +9 -0
- package/dist/shared/external-example-localization/locales/zh-tw.js.map +1 -0
- package/dist/shared/external-example-localization/translations.d.ts +67 -0
- package/dist/shared/external-example-localization/translations.d.ts.map +1 -0
- package/dist/shared/external-example-localization/translations.js +24 -0
- package/dist/shared/external-example-localization/translations.js.map +1 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +6 -4
- package/dist/specification-extensions/ExtensionValue.vue.js +89 -4
- package/dist/specification-extensions/ExtensionValue.vue.js.map +1 -1
- package/dist/specification-extensions/ExtensionValue2.vue.js +6 -0
- package/dist/specification-extensions/ExtensionValue2.vue.js.map +1 -0
- package/dist/specification-extensions/SpecificationExtensions.vue.js +76 -4
- package/dist/specification-extensions/SpecificationExtensions.vue.js.map +1 -1
- package/dist/specification-extensions/SpecificationExtensions2.vue.js +6 -0
- package/dist/specification-extensions/SpecificationExtensions2.vue.js.map +1 -0
- package/dist/specification-extensions/index.js +1 -1
- package/dist/style.css +13 -9
- package/dist/vue-styles.css +1 -1
- package/package.json +18 -18
- package/dist/code-example/components/AsyncApiCodeExample.vue_vue_type_script_setup_true_lang.js +0 -113
- package/dist/code-example/components/AsyncApiCodeExample.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js +0 -275
- package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/code-example/components/ExamplePicker.vue_vue_type_script_setup_true_lang.js +0 -48
- package/dist/code-example/components/ExamplePicker.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/code-example/components/HttpMethod.vue_vue_type_script_setup_true_lang.js +0 -34
- package/dist/code-example/components/HttpMethod.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/RenderString.vue_vue_type_script_setup_true_lang.js +0 -13
- package/dist/schema/RenderString.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/Schema.vue_vue_type_script_setup_true_lang.js +0 -237
- package/dist/schema/Schema.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaCollapsedPreview.vue_vue_type_script_setup_true_lang.js +0 -27
- package/dist/schema/SchemaCollapsedPreview.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaComposition.vue_vue_type_script_setup_true_lang.js +0 -234
- package/dist/schema/SchemaComposition.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaEnumPropertyItem.vue_vue_type_script_setup_true_lang.js +0 -23
- package/dist/schema/SchemaEnumPropertyItem.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaEnums.vue_vue_type_script_setup_true_lang.js +0 -77
- package/dist/schema/SchemaEnums.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaGlyphPuck.vue_vue_type_script_setup_true_lang.js +0 -29
- package/dist/schema/SchemaGlyphPuck.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaGutterToggle.vue_vue_type_script_setup_true_lang.js +0 -42
- package/dist/schema/SchemaGutterToggle.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaHeading.vue_vue_type_script_setup_true_lang.js +0 -34
- package/dist/schema/SchemaHeading.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaObjectExampleCodeBlock.vue_vue_type_script_setup_true_lang.js +0 -44
- package/dist/schema/SchemaObjectExampleCodeBlock.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js +0 -215
- package/dist/schema/SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js +0 -469
- package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaPropertyDefault.vue_vue_type_script_setup_true_lang.js +0 -63
- package/dist/schema/SchemaPropertyDefault.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaPropertyDetail.vue_vue_type_script_setup_true_lang.js +0 -24
- package/dist/schema/SchemaPropertyDetail.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaPropertyExamples.vue_vue_type_script_setup_true_lang.js +0 -135
- package/dist/schema/SchemaPropertyExamples.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js +0 -314
- package/dist/schema/SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaPropertyPattern.vue_vue_type_script_setup_true_lang.js +0 -44
- package/dist/schema/SchemaPropertyPattern.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/SchemaRailPanel.vue_vue_type_script_setup_true_lang.js +0 -55
- package/dist/schema/SchemaRailPanel.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/components/CopyLinkButton.vue_vue_type_script_setup_true_lang.js +0 -25
- package/dist/schema/components/CopyLinkButton.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/schema/components/WithBreadcrumb.vue_vue_type_script_setup_true_lang.js +0 -17
- package/dist/schema/components/WithBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/shared/Badge.vue_vue_type_script_setup_true_lang.js +0 -15
- package/dist/shared/Badge.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/shared/ExternalDocs.vue_vue_type_script_setup_true_lang.js +0 -45
- package/dist/shared/ExternalDocs.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/shared/ScreenReader.vue_vue_type_script_setup_true_lang.js +0 -18
- package/dist/shared/ScreenReader.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/specification-extensions/ExtensionValue.vue_vue_type_script_setup_true_lang.js +0 -91
- package/dist/specification-extensions/ExtensionValue.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/specification-extensions/SpecificationExtensions.vue_vue_type_script_setup_true_lang.js +0 -78
- package/dist/specification-extensions/SpecificationExtensions.vue_vue_type_script_setup_true_lang.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @scalar/blocks
|
|
2
2
|
|
|
3
|
+
## 0.11.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#11317](https://github.com/scalar/scalar/pull/11317): Resolve relative OpenAPI documentation links against the document or schema that declares them.
|
|
8
|
+
|
|
9
|
+
With a known document or schema base, a fragment-only link such as `#section` points into that resource.
|
|
10
|
+
In browser embeds, relative description URLs such as `/openapi.json` use the page's base URI. Server-side processing needs an absolute HTTP(S) retrieval URL or a document or schema that declares an absolute HTTP(S) base.
|
|
11
|
+
- [#11350](https://github.com/scalar/scalar/pull/11350): Keep generated request samples and Test Request in sync with matching named response examples, including parameter examples and changes to the response status or media type.
|
|
12
|
+
- [#11319](https://github.com/scalar/scalar/pull/11319): Accept structured Basic Auth credentials in Snippetz's print API and support them across generators. An explicitly empty username or password is included in the generated credentials. An explicit `Authorization` header takes precedence over configured credentials. Generators use the client's Basic Auth API where supported and a UTF-8 encoded header where needed. Scalar masks entered credentials in the preview.
|
|
13
|
+
- [#11323](https://github.com/scalar/scalar/pull/11323): Preserve the JSON structure of object and array values in schema enum lists so distinct values remain distinguishable. Use compact JSON strings as keys for these values in `x-enumDescriptions` maps.
|
|
14
|
+
- [#11297](https://github.com/scalar/scalar/pull/11297): Preserve a leading `@` in generated cURL request bodies and support whole-body file upload snippets.
|
|
15
|
+
|
|
16
|
+
When calling `@scalar/snippetz` directly, pass `postData: { mimeType: 'image/png', text: '', _fileName: 'photo.png' }` to generate a whole-body file upload. Browser JavaScript snippets use a file selected through an HTML file input. For inline bodies, cURL sends a leading `@` in `postData.text` literally.
|
|
17
|
+
|
|
18
|
+
VS Code REST Client appends CRLF when it includes a file as an entire `multipart/form-data` body. Use the cURL snippet when the file bytes must match exactly.
|
|
19
|
+
- [#11324](https://github.com/scalar/scalar/pull/11324): Prefill required path parameters from OpenAPI 3.1 and later schema constants in Test Request so the request can be sent without entering the fixed value manually.
|
|
20
|
+
|
|
21
|
+
Keep path placeholders in code samples for older API descriptions when a schema constant is the only supplied value. Accept populated OpenAPI 3.2 path examples authored with `dataValue` or `serializedValue` when sending requests.
|
|
22
|
+
|
|
23
|
+
## 0.11.2
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- [#11298](https://github.com/scalar/scalar/pull/11298): Preserve query values containing characters like `&`, `#`, and `+` in generated code samples when `allowReserved` is enabled. Keep existing percent-encoded sequences in code samples and Test Request, and apply reserved expansion to the emitted keys of exploded query objects.
|
|
28
|
+
- [#11302](https://github.com/scalar/scalar/pull/11302): Localize external example loading, error, and retry messages in API Reference and API Client.
|
|
29
|
+
- [#11300](https://github.com/scalar/scalar/pull/11300): Use the full property name in the accessible label of copy-link buttons, including any dots in the name.
|
|
30
|
+
|
|
3
31
|
## 0.11.1
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
|
@@ -1,8 +1,113 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { getAsyncApiExampleContext as e } from "../helpers/get-asyncapi-example-context.js";
|
|
2
|
+
import { getGeneratedPayloadExample as t } from "../helpers/get-generated-payload-example.js";
|
|
3
|
+
import { getMessageExampleContent as n } from "../helpers/get-message-example-content.js";
|
|
4
|
+
import r from "./ExamplePicker2.vue.js";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, mergeModels as f, normalizeClass as p, openBlock as m, ref as h, renderList as g, toDisplayString as _, unref as v, useModel as y, watch as b, withCtx as x } from "vue";
|
|
6
|
+
import { ScalarCard as S, ScalarCardFooter as C, ScalarCardHeader as w, ScalarCardSection as T } from "@scalar/components/card";
|
|
7
|
+
import { ScalarCodeBlock as E } from "@scalar/components/code-block";
|
|
8
|
+
import { ScalarWrappingText as D } from "@scalar/components/wrapping-text";
|
|
9
|
+
import { getResolvedAsyncApiRef as O } from "@scalar/workspace-store/helpers/get-resolved-async-api-ref";
|
|
10
|
+
// src/code-example/components/AsyncApiCodeExample.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
+
var k = { class: "text-c-2 font-code min-w-0 font-semibold break-words" }, A = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "text-c-1 whitespace-nowrap"
|
|
14
|
+
}, j = { class: "flex w-full flex-col" }, M = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "text-c-2 px-3 py-2 text-sm"
|
|
17
|
+
}, N = {
|
|
18
|
+
key: 2,
|
|
19
|
+
class: "text-c-2 p-4",
|
|
20
|
+
role: "status"
|
|
21
|
+
}, P = { class: "flex min-w-0 flex-1 flex-wrap items-center gap-2" }, F = {
|
|
22
|
+
key: 1,
|
|
23
|
+
class: "text-c-2 min-w-0 truncate px-1.5 py-0.75 text-base"
|
|
24
|
+
}, I = { class: "ml-auto flex min-w-0 items-center" }, L = {
|
|
25
|
+
key: 1,
|
|
26
|
+
class: "text-c-2 min-w-0 truncate px-1.5 py-0.75 text-base"
|
|
27
|
+
}, R = /*@__PURE__*/ d({
|
|
28
|
+
__name: "AsyncApiCodeExample",
|
|
29
|
+
props: /*@__PURE__*/ f({
|
|
30
|
+
document: {},
|
|
31
|
+
operationName: {}
|
|
32
|
+
}, {
|
|
33
|
+
selectedMessage: { default: "" },
|
|
34
|
+
selectedMessageModifiers: {}
|
|
35
|
+
}),
|
|
36
|
+
emits: ["update:selectedMessage"],
|
|
37
|
+
setup(d) {
|
|
38
|
+
let f = a(() => e(d.document, d.operationName)), R = a(() => (f.value?.channel?.address ?? d.operationName).split(/({[^}]+})/)), z = y(d, "selectedMessage"), B = h(""), V = a(() => Object.fromEntries((f.value?.messages ?? []).map(({ name: e, message: t }) => [e, { summary: t.title || t.name || e }]))), H = a(() => f.value?.messages.find(({ name: e }) => e === z.value)?.message), U = a(() => (H.value?.examples ?? []).flatMap((e, t) => {
|
|
39
|
+
let n = O(e);
|
|
40
|
+
return n?.payload === void 0 ? [] : [{
|
|
41
|
+
key: String(t),
|
|
42
|
+
...n
|
|
43
|
+
}];
|
|
44
|
+
})), W = a(() => Object.fromEntries(U.value.map((e, t) => [e.key, { summary: e.name || e.summary || `Example ${t + 1}` }]))), G = a(() => U.value.find(({ key: e }) => e === B.value)), K = a(() => `Message: ${V.value[z.value]?.summary ?? "Select a message"}`), q = a(() => `Message example: ${W.value[B.value]?.summary ?? "Select an example"}`);
|
|
45
|
+
b(V, (e) => {
|
|
46
|
+
Object.hasOwn(e, z.value) || (z.value = Object.keys(e)[0] ?? "");
|
|
47
|
+
}, { immediate: !0 }), b([z, () => d.operationName], () => {
|
|
48
|
+
B.value = Object.keys(W.value)[0] ?? "";
|
|
49
|
+
}), b(W, (e) => {
|
|
50
|
+
Object.hasOwn(e, B.value) || (B.value = Object.keys(e)[0] ?? "");
|
|
51
|
+
}, { immediate: !0 });
|
|
52
|
+
let J = a(() => n(G.value ? G.value.payload : H.value ? t(H.value) : void 0, H.value?.contentType ?? d.document.defaultContentType));
|
|
53
|
+
return (e, t) => (m(), o(v(S), {
|
|
54
|
+
class: "request-card dark-mode min-w-0",
|
|
55
|
+
label: "Message example"
|
|
56
|
+
}, {
|
|
57
|
+
default: x(() => [
|
|
58
|
+
u(v(w), { class: "flex-nowrap items-start gap-3 pr-2.5 [&_.scalar-card-header-title]:flex-1 [&_.scalar-card-header-title]:whitespace-normal [&>div:last-child]:shrink-0" }, {
|
|
59
|
+
default: x(() => [
|
|
60
|
+
t[2] ||= l("span", { class: "sr-only" }, "Message example for", -1),
|
|
61
|
+
l("span", { class: p(["font-code mr-1.5 uppercase", f.value?.operation.action === "send" ? "text-blue" : "text-green"]) }, _(f.value?.operation.action), 3),
|
|
62
|
+
l("span", k, [(m(!0), c(i, null, g(R.value, (e, t) => (m(), c(i, { key: t }, [e.startsWith("{") && e.endsWith("}") ? (m(), c("span", A, _(e), 1)) : (m(), o(v(D), {
|
|
63
|
+
key: 1,
|
|
64
|
+
text: e
|
|
65
|
+
}, null, 8, ["text"]))], 64))), 128))])
|
|
66
|
+
]),
|
|
67
|
+
_: 1
|
|
68
|
+
}),
|
|
69
|
+
u(v(T), { class: "custom-scroll flex flex-1 p-0" }, {
|
|
70
|
+
default: x(() => [l("div", j, [J.value?.structural ? (m(), c("p", M, " Structure only; not encoded ")) : s("", !0), J.value ? (m(), o(v(E), {
|
|
71
|
+
key: 1,
|
|
72
|
+
class: "h-full bg-transparent",
|
|
73
|
+
content: J.value.content,
|
|
74
|
+
lang: J.value.lang,
|
|
75
|
+
lineNumbers: ""
|
|
76
|
+
}, null, 8, ["content", "lang"])) : (m(), c("p", N, " No message payload example available. "))])]),
|
|
77
|
+
_: 1
|
|
78
|
+
}),
|
|
79
|
+
Object.keys(V.value).length || U.value.length ? (m(), o(v(C), {
|
|
80
|
+
key: 0,
|
|
81
|
+
class: "relative flex shrink-0 flex-wrap items-center justify-end gap-2 p-1.5"
|
|
82
|
+
}, {
|
|
83
|
+
default: x(() => [l("div", P, [U.value.length > 1 ? (m(), o(r, {
|
|
84
|
+
key: 0,
|
|
85
|
+
modelValue: B.value,
|
|
86
|
+
"onUpdate:modelValue": t[0] ||= (e) => B.value = e,
|
|
87
|
+
"aria-label": q.value,
|
|
88
|
+
examples: W.value
|
|
89
|
+
}, null, 8, [
|
|
90
|
+
"modelValue",
|
|
91
|
+
"aria-label",
|
|
92
|
+
"examples"
|
|
93
|
+
])) : U.value.length === 1 ? (m(), c("span", F, _(W.value[B.value]?.summary), 1)) : s("", !0), l("div", I, [Object.keys(V.value).length > 1 ? (m(), o(r, {
|
|
94
|
+
key: 0,
|
|
95
|
+
modelValue: z.value,
|
|
96
|
+
"onUpdate:modelValue": t[1] ||= (e) => z.value = e,
|
|
97
|
+
"aria-label": K.value,
|
|
98
|
+
examples: V.value
|
|
99
|
+
}, null, 8, [
|
|
100
|
+
"modelValue",
|
|
101
|
+
"aria-label",
|
|
102
|
+
"examples"
|
|
103
|
+
])) : Object.keys(V.value).length === 1 ? (m(), c("span", L, _(V.value[z.value]?.summary), 1)) : s("", !0)])])]),
|
|
104
|
+
_: 1
|
|
105
|
+
})) : s("", !0)
|
|
106
|
+
]),
|
|
107
|
+
_: 1
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
export { R as default };
|
|
7
112
|
|
|
8
113
|
//# sourceMappingURL=AsyncApiCodeExample.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncApiCodeExample.vue.js","names":["AsyncApiCodeExample_vue_vue_type_script_setup_true_lang_default","_plugin_vue_export_helper_default","AsyncApiCodeExample_default"],"sources":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"AsyncApiCodeExample.vue.js","names":["_useModel","_openBlock","_createBlock","_unref","_withCtx","_createVNode","_createElementVNode","_normalizeClass","_toDisplayString","_createElementBlock","_Fragment","_renderList","ExamplePicker","getAsyncApiExampleContext","getGeneratedPayloadExample","getMessageExampleContent","ExamplePicker_default","Fragment","computed","createBlock","createCommentVNode","createElementBlock","createElementVNode","createVNode","defineComponent","mergeModels","normalizeClass","openBlock","ref","renderList","toDisplayString","unref","useModel","watch","withCtx","ScalarCard","ScalarCardFooter","ScalarCardHeader","ScalarCardSection","ScalarCodeBlock","ScalarWrappingText","getResolvedAsyncApiRef","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","AsyncApiCodeExample_vue_vue_type_script_setup_true_lang_default","\"selectedMessage\"","\"selectedMessageModifiers\"","__props","context","channelPathParts","selectedMessage","selectedExample","messages","name","message","examples","node","index","example","exampleOptions","key","messageLabel","exampleLabel","options","content","_ctx","_cache","part","$event"],"sources":["../../../src/code-example/components/AsyncApiCodeExample.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarCard,\n ScalarCardFooter,\n ScalarCardHeader,\n ScalarCardSection,\n} from '@scalar/components/card'\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\nimport type {\n AsyncApiDocument,\n AsyncApiMessageObject,\n} from '@scalar/types/asyncapi/3.1'\nimport { getResolvedAsyncApiRef } from '@scalar/workspace-store/helpers/get-resolved-async-api-ref'\nimport { computed, ref, watch } from 'vue'\n\nimport { getAsyncApiExampleContext } from '../helpers/get-asyncapi-example-context'\nimport { getGeneratedPayloadExample } from '../helpers/get-generated-payload-example'\nimport { getMessageExampleContent } from '../helpers/get-message-example-content'\nimport ExamplePicker from './ExamplePicker.vue'\n\nconst { document, operationName } = defineProps<{\n /** A workspace-resolved AsyncAPI 3.x document. */\n document: AsyncApiDocument\n /** Key in document.operations. */\n operationName: string\n}>()\n\ntype PickerOptions = Record<string, { summary: string }>\ntype MessageExample = Exclude<\n NonNullable<AsyncApiMessageObject['examples']>[number],\n { $ref: string }\n> & { key: string }\nconst context = computed<ReturnType<typeof getAsyncApiExampleContext>>(() =>\n getAsyncApiExampleContext(document, operationName),\n)\nconst channelPathParts = computed(() =>\n (context.value?.channel?.address ?? operationName).split(/({[^}]+})/),\n)\n\nconst selectedMessage = defineModel<string>('selectedMessage', { default: '' })\nconst selectedExample = ref<string>('')\nconst messages = computed<PickerOptions>(() =>\n Object.fromEntries(\n (context.value?.messages ?? []).map(({ name, message }) => [\n name,\n { summary: message.title || message.name || name },\n ]),\n ),\n)\nconst message = computed<AsyncApiMessageObject | undefined>(\n () =>\n context.value?.messages.find(({ name }) => name === selectedMessage.value)\n ?.message,\n)\nconst examples = computed<MessageExample[]>(() =>\n (message.value?.examples ?? []).flatMap((node, index) => {\n const example = getResolvedAsyncApiRef(node)\n return example?.payload !== undefined\n ? [{ key: String(index), ...example }]\n : []\n }),\n)\nconst exampleOptions = computed<PickerOptions>(() =>\n Object.fromEntries(\n examples.value.map((example, index) => [\n example.key,\n { summary: example.name || example.summary || `Example ${index + 1}` },\n ]),\n ),\n)\nconst example = computed<MessageExample | undefined>(() =>\n examples.value.find(({ key }) => key === selectedExample.value),\n)\nconst messageLabel = computed<string>(\n () =>\n `Message: ${messages.value[selectedMessage.value]?.summary ?? 'Select a message'}`,\n)\nconst exampleLabel = computed<string>(\n () =>\n `Message example: ${exampleOptions.value[selectedExample.value]?.summary ?? 'Select an example'}`,\n)\n\n// Keep selections valid when operations, messages, or the active document change.\nwatch(\n messages,\n (options) => {\n if (!Object.hasOwn(options, selectedMessage.value))\n selectedMessage.value = Object.keys(options)[0] ?? ''\n },\n { immediate: true },\n)\nwatch([selectedMessage, () => operationName], () => {\n selectedExample.value = Object.keys(exampleOptions.value)[0] ?? ''\n})\nwatch(\n exampleOptions,\n (options) => {\n if (!Object.hasOwn(options, selectedExample.value))\n selectedExample.value = Object.keys(options)[0] ?? ''\n },\n { immediate: true },\n)\nconst content = computed(() =>\n getMessageExampleContent(\n example.value\n ? example.value.payload\n : message.value\n ? getGeneratedPayloadExample(message.value)\n : undefined,\n message.value?.contentType ?? document.defaultContentType,\n ),\n)\n</script>\n\n<template>\n <ScalarCard\n class=\"request-card dark-mode min-w-0\"\n label=\"Message example\">\n <ScalarCardHeader\n class=\"flex-nowrap items-start gap-3 pr-2.5 [&_.scalar-card-header-title]:flex-1 [&_.scalar-card-header-title]:whitespace-normal [&>div:last-child]:shrink-0\">\n <span class=\"sr-only\">Message example for</span>\n <span\n class=\"font-code mr-1.5 uppercase\"\n :class=\"\n context?.operation.action === 'send' ? 'text-blue' : 'text-green'\n \"\n >{{ context?.operation.action }}</span\n >\n <span class=\"text-c-2 font-code min-w-0 font-semibold break-words\">\n <template\n v-for=\"(part, index) in channelPathParts\"\n :key=\"index\">\n <span\n v-if=\"part.startsWith('{') && part.endsWith('}')\"\n class=\"text-c-1 whitespace-nowrap\"\n >{{ part }}</span\n >\n <ScalarWrappingText\n v-else\n :text=\"part\" />\n </template>\n </span>\n </ScalarCardHeader>\n <ScalarCardSection class=\"custom-scroll flex flex-1 p-0\">\n <div class=\"flex w-full flex-col\">\n <p\n v-if=\"content?.structural\"\n class=\"text-c-2 px-3 py-2 text-sm\">\n Structure only; not encoded\n </p>\n <ScalarCodeBlock\n v-if=\"content\"\n class=\"h-full bg-transparent\"\n :content=\"content.content\"\n :lang=\"content.lang\"\n lineNumbers />\n <p\n v-else\n class=\"text-c-2 p-4\"\n role=\"status\">\n No message payload example available.\n </p>\n </div>\n </ScalarCardSection>\n <ScalarCardFooter\n v-if=\"Object.keys(messages).length || examples.length\"\n class=\"relative flex shrink-0 flex-wrap items-center justify-end gap-2 p-1.5\">\n <div class=\"flex min-w-0 flex-1 flex-wrap items-center gap-2\">\n <ExamplePicker\n v-if=\"examples.length > 1\"\n v-model=\"selectedExample\"\n :aria-label=\"exampleLabel\"\n :examples=\"exampleOptions\" />\n <span\n v-else-if=\"examples.length === 1\"\n class=\"text-c-2 min-w-0 truncate px-1.5 py-0.75 text-base\">\n {{ exampleOptions[selectedExample]?.summary }}\n </span>\n <div class=\"ml-auto flex min-w-0 items-center\">\n <ExamplePicker\n v-if=\"Object.keys(messages).length > 1\"\n v-model=\"selectedMessage\"\n :aria-label=\"messageLabel\"\n :examples=\"messages\" />\n <span\n v-else-if=\"Object.keys(messages).length === 1\"\n class=\"text-c-2 min-w-0 truncate px-1.5 py-0.75 text-base\">\n {{ messages[selectedMessage]?.summary }}\n </span>\n </div>\n </div>\n </ScalarCardFooter>\n </ScalarCard>\n</template>\n\n<style scoped>\n.request-card {\n color: var(--scalar-color-1);\n font-size: var(--scalar-font-size-3);\n}\n</style>\n"],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import e from "./AsyncApiCodeExample.vue.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
// src/code-example/components/AsyncApiCodeExample.vue
|
|
5
|
+
var n = /*#__PURE__*/ t(e, [["__scopeId", "data-v-aaf1efda"]]);
|
|
6
|
+
export { n as default };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=AsyncApiCodeExample3.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncApiCodeExample3.vue.js","names":["AsyncApiCodeExample_vue_vue_type_script_setup_true_lang_default","_plugin_vue_export_helper_default","AsyncApiCodeExample_default"],"sources":[],"mappings":""}
|
|
@@ -14,6 +14,8 @@ export type CodeExampleProps = {
|
|
|
14
14
|
clientPickerLabel?: string;
|
|
15
15
|
/** Localized accessible name for the search field inside the client picker. */
|
|
16
16
|
clientSearchLabel?: string;
|
|
17
|
+
/** Localized accessible purpose of the request example picker. */
|
|
18
|
+
examplePickerLabel?: string;
|
|
17
19
|
/**
|
|
18
20
|
* Localized accessible name for the focusable code sample. The selected client's title is
|
|
19
21
|
* appended so the announcement also says which language the sample is in.
|
|
@@ -82,6 +84,12 @@ export type CodeExampleProps = {
|
|
|
82
84
|
* ```
|
|
83
85
|
*/
|
|
84
86
|
selectedExample?: string;
|
|
87
|
+
/** Initial response example to use when the document-wide selection has no matching request. */
|
|
88
|
+
defaultResponseExample?: string;
|
|
89
|
+
/** Named example selected by the response card for this operation. */
|
|
90
|
+
responseExampleSelection?: {
|
|
91
|
+
key: string;
|
|
92
|
+
};
|
|
85
93
|
/**
|
|
86
94
|
* Event bus
|
|
87
95
|
*/
|
|
@@ -142,8 +150,10 @@ declare const _default: typeof __VLS_export;
|
|
|
142
150
|
export default _default;
|
|
143
151
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CodeExampleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
144
152
|
"update:exampleKey": (value: string) => any;
|
|
153
|
+
selectExample: (value: string) => any;
|
|
145
154
|
}, string, import("vue").PublicProps, Readonly<CodeExampleProps> & Readonly<{
|
|
146
155
|
"onUpdate:exampleKey"?: ((value: string) => any) | undefined;
|
|
156
|
+
onSelectExample?: ((value: string) => any) | undefined;
|
|
147
157
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
148
158
|
header: () => unknown;
|
|
149
159
|
/** Rendered at the start of the footer, only while the example picker does not need that space */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeExample.vue.d.ts","sourceRoot":"","sources":["../../../src/code-example/components/CodeExample.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeExample.vue.d.ts","sourceRoot":"","sources":["../../../src/code-example/components/CodeExample.vue"],"names":[],"mappings":"AAu1BA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAUvE,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAkBrE,OAAO,KAAK,EAEV,iBAAiB,EAElB,MAAM,UAAU,CAAA;AAKjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAElE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,uFAAuF;IACvF,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,kEAAkE;IAClE,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;OAGG;IACH,WAAW,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAA;IACpC;;OAEG;IACH,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IACpC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gGAAgG;IAChG,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,sEAAsE;IACtE,wBAAwB,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;OAEG;IACH,eAAe,EAAE,0BAA0B,EAAE,CAAA;IAC7C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,SAAS,EAAE,eAAe,CAAA;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,CAAA;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,EAAE,CAAA;IAC/B;;;OAGG;IACH,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,yFAAyF;IACzF,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,+BAA+B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACzD,CAAA;AAED;;;;;;;;GAQG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;;;;;;;YA8CN,MAAM,OAAO;IACvB,kGAAkG;qBACjF,MAAM,OAAO;YACpB,CAAC,EAAE,WAAW,EAAE,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO;EA41B7D,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,8 +1,299 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import e from "../../shared/ExternalExampleStatus2.vue.js";
|
|
2
|
+
import { filterClientsByQuery as t } from "../helpers/filter-clients-by-query.js";
|
|
3
|
+
import { findClient as n } from "../helpers/find-client.js";
|
|
4
|
+
import { generateCodeSnippetWithPreview as r } from "../helpers/generate-code-snippet.js";
|
|
5
|
+
import { getClients as i } from "../helpers/get-clients.js";
|
|
6
|
+
import { getCustomCodeSamples as a } from "../helpers/get-custom-code-samples.js";
|
|
7
|
+
import { getSecrets as ee } from "../helpers/get-secrets.js";
|
|
8
|
+
import { operationToHar as te } from "../helpers/operation-to-har/operation-to-har.js";
|
|
9
|
+
import ne from "./ExamplePicker2.vue.js";
|
|
10
|
+
import o from "./HttpMethod2.vue.js";
|
|
11
|
+
import { Fragment as re, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as ie, createTextVNode as ae, createVNode as f, defineComponent as p, normalizeClass as m, openBlock as h, ref as g, renderSlot as _, toDisplayString as v, unref as y, useId as b, watch as x, watchEffect as oe, withCtx as S } from "vue";
|
|
12
|
+
import { ScalarCard as C, ScalarCardFooter as se, ScalarCardHeader as ce, ScalarCardSection as w } from "@scalar/components/card";
|
|
13
|
+
import { ScalarCodeBlock as le, ScalarCodeBlockCopy as ue } from "@scalar/components/code-block";
|
|
14
|
+
import { resolveCredentialPlaceholders as de } from "@scalar/workspace-store/request-example";
|
|
15
|
+
import { ScalarButton as fe } from "@scalar/components/button";
|
|
16
|
+
import { ScalarIconCaretDown as pe } from "@scalar/icons";
|
|
17
|
+
import { getResolvedRef as T } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
18
|
+
import { ScalarCombobox as me } from "@scalar/components/combobox";
|
|
19
|
+
import { ScalarVirtualText as he } from "@scalar/components/virtual-text";
|
|
20
|
+
import { freezeElement as ge } from "@scalar/helpers/dom/freeze-element";
|
|
21
|
+
import { getFirstMediaType as _e } from "@scalar/helpers/http/get-first-media-type";
|
|
22
|
+
import { getOperationExamples as ve, resolveOperationExamples as ye } from "@scalar/workspace-store/helpers/operation-examples";
|
|
23
|
+
import { useExampleVisibility as be, useExternalExamples as xe } from "@scalar/workspace-store/helpers/use-external-examples";
|
|
24
|
+
// src/code-example/components/CodeExample.vue?vue&type=script&setup=true&lang.ts
|
|
25
|
+
var E = ["innerHTML"], D = {
|
|
26
|
+
key: 1,
|
|
27
|
+
class: "text-c-2 flex h-full w-fit items-center px-0.5 py-0 text-base font-normal",
|
|
28
|
+
"data-testid": "client-picker"
|
|
29
|
+
}, O = {
|
|
30
|
+
key: 1,
|
|
31
|
+
class: "text-c-2 p-4",
|
|
32
|
+
role: "status"
|
|
33
|
+
}, k = ["id"], A = {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "request-card-footer-addon"
|
|
36
|
+
}, j = {
|
|
37
|
+
key: 1,
|
|
38
|
+
class: "request-card-footer-start"
|
|
39
|
+
}, M = { class: "request-header" }, Se = {
|
|
40
|
+
key: 0,
|
|
41
|
+
class: "request-card-actions relative max-w-full"
|
|
42
|
+
}, N = /*@__PURE__*/ p({
|
|
43
|
+
__name: "CodeExample",
|
|
44
|
+
props: {
|
|
45
|
+
codeSampleUnavailable: { default: "No code sample available for this example." },
|
|
46
|
+
clientPickerLabel: { default: "Change code sample language" },
|
|
47
|
+
clientSearchLabel: { default: "Search clients" },
|
|
48
|
+
examplePickerLabel: { default: "Request example" },
|
|
49
|
+
codeSampleLabel: { default: "Code sample" },
|
|
50
|
+
integration: {},
|
|
51
|
+
clientOptions: {},
|
|
52
|
+
selectedClient: {},
|
|
53
|
+
selectedServer: { default: null },
|
|
54
|
+
selectedContentType: {},
|
|
55
|
+
selectedExample: {},
|
|
56
|
+
defaultResponseExample: {},
|
|
57
|
+
responseExampleSelection: {},
|
|
58
|
+
eventBus: {},
|
|
59
|
+
securitySchemes: { default: () => [] },
|
|
60
|
+
method: {},
|
|
61
|
+
path: {},
|
|
62
|
+
operation: {},
|
|
63
|
+
fallback: { type: Boolean },
|
|
64
|
+
generateLabel: { type: Function },
|
|
65
|
+
isWebhook: { type: Boolean },
|
|
66
|
+
globalCookies: {},
|
|
67
|
+
openapiVersion: {},
|
|
68
|
+
jsonSchemaDialect: {},
|
|
69
|
+
multipartNaming: {},
|
|
70
|
+
requestBodyCompositionSelection: {}
|
|
71
|
+
},
|
|
72
|
+
emits: ["update:exampleKey", "selectExample"],
|
|
73
|
+
setup(p, { emit: N }) {
|
|
74
|
+
let P = N, F = s(() => {
|
|
75
|
+
let e = T(p.operation.requestBody)?.content ?? {}, t = p.selectedContentType || Object.keys(e)[0], n = Object.entries(e[t ?? ""]?.examples ?? {}), r = new Map(n), i = new Set(r.keys());
|
|
76
|
+
for (let e of p.operation.parameters ?? []) {
|
|
77
|
+
let t = T(e);
|
|
78
|
+
if (!t) continue;
|
|
79
|
+
let n = "content" in t ? _e(t.content)?.[1] : void 0;
|
|
80
|
+
for (let [e, a] of Object.entries({
|
|
81
|
+
...n?.examples,
|
|
82
|
+
...t.examples
|
|
83
|
+
})) r.has(e) ? i.add(e) : r.set(e, a);
|
|
84
|
+
}
|
|
85
|
+
for (let e of Object.values(p.operation.responses ?? {})) {
|
|
86
|
+
let t = T(e);
|
|
87
|
+
for (let e of Object.values(t?.content ?? {})) for (let t of Object.keys(e.examples ?? {})) r.has(t) && i.add(t);
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
examples: r,
|
|
91
|
+
pickerKeys: i,
|
|
92
|
+
defaultKey: n[0]?.[0] ?? ""
|
|
93
|
+
};
|
|
94
|
+
}), I = g(""), Ce = s(() => {
|
|
95
|
+
let { examples: e, pickerKeys: t } = F.value;
|
|
96
|
+
return Object.fromEntries(Array.from(e).filter(([e]) => t.has(e) || e === I.value));
|
|
97
|
+
}), L = (e, t) => {
|
|
98
|
+
let { examples: n, defaultKey: r } = F.value;
|
|
99
|
+
return e && n.has(e) ? e : t && n.has(t) ? t : I.value && n.has(I.value) ? I.value : r;
|
|
100
|
+
};
|
|
101
|
+
I.value = L(p.responseExampleSelection?.key ?? p.selectedExample, p.defaultResponseExample), x(() => p.selectedExample, (e) => {
|
|
102
|
+
I.value = L(e);
|
|
103
|
+
}), x(() => p.responseExampleSelection, (e) => {
|
|
104
|
+
e && (I.value = L(e.key));
|
|
105
|
+
}), x(F, ({ examples: e }) => {
|
|
106
|
+
e.has(I.value) || (I.value = L(p.responseExampleSelection?.key ?? p.selectedExample, p.defaultResponseExample));
|
|
107
|
+
}), oe(() => {
|
|
108
|
+
P("update:exampleKey", I.value);
|
|
109
|
+
});
|
|
110
|
+
let we = (e) => {
|
|
111
|
+
I.value = e, P("selectExample", e), p.eventBus.emit("workspace:update:selected-example", e);
|
|
112
|
+
}, R = s(() => a(p.operation)), z = s(() => i(R.value.samples, p.clientOptions, R.value.label)), B = s(() => z.value.reduce((e, t) => e + t.options.length, 0)), V = g(n(z.value, p.selectedClient));
|
|
113
|
+
x([() => p.selectedClient, z], ([e]) => {
|
|
114
|
+
V.value = n(z.value, e);
|
|
115
|
+
});
|
|
116
|
+
let Te = s(() => [p.clientPickerLabel, V.value?.title].filter(Boolean).join(": ")), Ee = s(() => [p.codeSampleLabel, V.value?.title].filter(Boolean).join(": ")), H = g(null), De = be(H), U = xe(() => ve(p.operation, I.value, p.selectedContentType), () => De.value), W = s(() => ye(p.operation, I.value, p.selectedContentType, U.resolve)), G = s(() => F.value.pickerKeys.size > 1), K = s(() => {
|
|
117
|
+
if (!p.isWebhook) return null;
|
|
118
|
+
try {
|
|
119
|
+
return te({
|
|
120
|
+
operation: W.value,
|
|
121
|
+
method: p.method,
|
|
122
|
+
path: p.path,
|
|
123
|
+
example: I.value,
|
|
124
|
+
openapiVersion: p.openapiVersion,
|
|
125
|
+
jsonSchemaDialect: p.jsonSchemaDialect,
|
|
126
|
+
multipartNaming: p.multipartNaming,
|
|
127
|
+
requestBodyCompositionSelection: p.requestBodyCompositionSelection,
|
|
128
|
+
defaultDisabledParameters: !0
|
|
129
|
+
});
|
|
130
|
+
} catch (e) {
|
|
131
|
+
return console.error("[webhookHar]", e), null;
|
|
132
|
+
}
|
|
133
|
+
}), q = s(() => p.isWebhook ? { content: K.value?.postData?.text ?? "" } : r({
|
|
134
|
+
defaultDisabledParameters: !0,
|
|
135
|
+
includeDefaultHeaders: p.integration === "client",
|
|
136
|
+
clientId: V.value?.id,
|
|
137
|
+
customCodeSamples: R.value.samples,
|
|
138
|
+
operation: W.value,
|
|
139
|
+
method: p.method,
|
|
140
|
+
path: p.path,
|
|
141
|
+
contentType: p.selectedContentType,
|
|
142
|
+
server: p.selectedServer,
|
|
143
|
+
securitySchemes: p.securitySchemes,
|
|
144
|
+
example: I.value,
|
|
145
|
+
globalCookies: p.globalCookies,
|
|
146
|
+
openapiVersion: p.openapiVersion,
|
|
147
|
+
jsonSchemaDialect: p.jsonSchemaDialect,
|
|
148
|
+
multipartNaming: p.multipartNaming,
|
|
149
|
+
requestBodyCompositionSelection: p.requestBodyCompositionSelection
|
|
150
|
+
})), J = s(() => q.value.content), Y = s(() => !p.isWebhook && V.value?.id.startsWith("custom/") && J.value !== null && p.securitySchemes.some((e) => "x-scalar-credential-placeholders" in e) ? de(J.value, p.securitySchemes) : void 0), X = s(() => Y.value?.content ?? J.value), Z = s(() => Y.value?.displayContent ?? q.value.displayContent ?? X.value), Oe = s(() => Y.value || q.value.displayContent !== void 0 ? X.value ?? "" : void 0), Q = s(() => p.isWebhook ? ke.value : V.value?.lang), ke = s(() => {
|
|
151
|
+
if (!K.value?.postData) return "json";
|
|
152
|
+
let e = K.value.postData.mimeType;
|
|
153
|
+
return e?.includes("json") ? "json" : e?.includes("xml") ? "xml" : e?.includes("yaml") || e?.includes("yml") ? "yaml" : e?.includes("text/plain") ? "text" : "json";
|
|
154
|
+
}), Ae = s(() => Y.value ? [] : ee(p.securitySchemes)), je = (e) => {
|
|
155
|
+
if (H.value) {
|
|
156
|
+
let e = ge(H.value.$el);
|
|
157
|
+
setTimeout(() => {
|
|
158
|
+
e();
|
|
159
|
+
}, 300);
|
|
160
|
+
}
|
|
161
|
+
V.value = e, e && p.eventBus.emit("workspace:update:selected-client", e.id);
|
|
162
|
+
}, Me = s(() => (X.value?.length ?? 0) > 2e4), $ = b();
|
|
163
|
+
return (n, r) => X.value === null || X.value || y(U).pending.value ? (h(), c(y(C), {
|
|
164
|
+
key: 0,
|
|
165
|
+
ref_key: "elem",
|
|
166
|
+
ref: H,
|
|
167
|
+
class: "request-card dark-mode"
|
|
168
|
+
}, {
|
|
169
|
+
default: S(() => [
|
|
170
|
+
f(y(ce), { class: "pr-2.5" }, ie({
|
|
171
|
+
default: S(() => [
|
|
172
|
+
r[1] ||= d("span", { class: "sr-only" }, "Request Example for", -1),
|
|
173
|
+
f(o, {
|
|
174
|
+
as: "span",
|
|
175
|
+
class: "request-method",
|
|
176
|
+
method: p.method
|
|
177
|
+
}, null, 8, ["method"]),
|
|
178
|
+
p.generateLabel ? (h(), u("span", {
|
|
179
|
+
key: 0,
|
|
180
|
+
innerHTML: p.generateLabel()
|
|
181
|
+
}, null, 8, E)) : l("", !0),
|
|
182
|
+
_(n.$slots, "header", {}, void 0, !0)
|
|
183
|
+
]),
|
|
184
|
+
_: 2
|
|
185
|
+
}, [!p.isWebhook && B.value ? {
|
|
186
|
+
name: "actions",
|
|
187
|
+
fn: S(() => [B.value > 1 ? (h(), c(y(me), {
|
|
188
|
+
key: 0,
|
|
189
|
+
class: "max-h-80",
|
|
190
|
+
filterFn: y(t),
|
|
191
|
+
inputLabel: p.clientSearchLabel,
|
|
192
|
+
modelValue: V.value,
|
|
193
|
+
options: z.value,
|
|
194
|
+
placement: "bottom-end",
|
|
195
|
+
teleport: "",
|
|
196
|
+
"onUpdate:modelValue": r[0] ||= (e) => je(e)
|
|
197
|
+
}, {
|
|
198
|
+
default: S(({ open: e }) => [f(y(fe), {
|
|
199
|
+
"aria-label": Te.value,
|
|
200
|
+
class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5 py-0 text-base font-normal",
|
|
201
|
+
"data-testid": "client-picker",
|
|
202
|
+
variant: "ghost"
|
|
203
|
+
}, {
|
|
204
|
+
default: S(() => [ae(v(V.value?.title) + " ", 1), f(y(pe), {
|
|
205
|
+
class: m(["mt-px size-3 transition-transform duration-100", { "rotate-180": e }]),
|
|
206
|
+
weight: "bold"
|
|
207
|
+
}, null, 8, ["class"])]),
|
|
208
|
+
_: 2
|
|
209
|
+
}, 1032, ["aria-label"])]),
|
|
210
|
+
_: 1
|
|
211
|
+
}, 8, [
|
|
212
|
+
"filterFn",
|
|
213
|
+
"inputLabel",
|
|
214
|
+
"modelValue",
|
|
215
|
+
"options"
|
|
216
|
+
])) : (h(), u("span", D, v(V.value?.title), 1))]),
|
|
217
|
+
key: "0"
|
|
218
|
+
} : void 0]), 1024),
|
|
219
|
+
f(y(w), { class: "request-editor-section custom-scroll p-0" }, {
|
|
220
|
+
default: S(() => [y(U).pending.value ? (h(), c(e, {
|
|
221
|
+
key: 0,
|
|
222
|
+
failed: y(U).failed.value,
|
|
223
|
+
onRetry: y(U).retry
|
|
224
|
+
}, null, 8, ["failed", "onRetry"])) : X.value === null ? (h(), u("div", O, v(p.codeSampleUnavailable), 1)) : (h(), u("div", {
|
|
225
|
+
key: 2,
|
|
226
|
+
id: `${y($)}-example`,
|
|
227
|
+
class: "code-snippet group/code-block relative"
|
|
228
|
+
}, [Me.value ? (h(), u(re, { key: 1 }, [f(y(ue), {
|
|
229
|
+
"aria-controls": `${y($)}-virtual-code`,
|
|
230
|
+
class: "scalar-code-copy absolute top-2.5 right-2.5 z-1",
|
|
231
|
+
content: X.value,
|
|
232
|
+
lang: Q.value
|
|
233
|
+
}, null, 8, [
|
|
234
|
+
"aria-controls",
|
|
235
|
+
"content",
|
|
236
|
+
"lang"
|
|
237
|
+
]), f(y(he), {
|
|
238
|
+
id: `${y($)}-virtual-code`,
|
|
239
|
+
"aria-label": "Request code sample",
|
|
240
|
+
containerClass: "custom-scroll scalar-code-block flex flex-1 max-h-screen",
|
|
241
|
+
contentClass: "language-plaintext whitespace-pre font-code text-base p-2",
|
|
242
|
+
lineHeight: 20,
|
|
243
|
+
role: "region",
|
|
244
|
+
text: Z.value ?? ""
|
|
245
|
+
}, null, 8, ["id", "text"])], 64)) : (h(), c(y(le), {
|
|
246
|
+
key: 0,
|
|
247
|
+
class: "h-full bg-transparent",
|
|
248
|
+
content: Z.value ?? "",
|
|
249
|
+
copyContent: Oe.value,
|
|
250
|
+
hideCredentials: Ae.value,
|
|
251
|
+
label: Ee.value,
|
|
252
|
+
lang: Q.value,
|
|
253
|
+
lineNumbers: ""
|
|
254
|
+
}, null, 8, [
|
|
255
|
+
"content",
|
|
256
|
+
"copyContent",
|
|
257
|
+
"hideCredentials",
|
|
258
|
+
"label",
|
|
259
|
+
"lang"
|
|
260
|
+
]))], 8, k))]),
|
|
261
|
+
_: 1
|
|
262
|
+
}),
|
|
263
|
+
G.value || n.$slots.footer || n.$slots["footer-start"] ? (h(), c(y(se), {
|
|
264
|
+
key: 0,
|
|
265
|
+
class: m(["request-card-footer", { "request-card-footer--wraps": G.value || n.$slots["footer-start"] }])
|
|
266
|
+
}, {
|
|
267
|
+
default: S(() => [G.value ? (h(), u("div", A, [f(ne, {
|
|
268
|
+
examples: Ce.value,
|
|
269
|
+
label: p.examplePickerLabel,
|
|
270
|
+
modelValue: I.value,
|
|
271
|
+
"onUpdate:modelValue": we
|
|
272
|
+
}, null, 8, [
|
|
273
|
+
"examples",
|
|
274
|
+
"label",
|
|
275
|
+
"modelValue"
|
|
276
|
+
])])) : n.$slots["footer-start"] ? (h(), u("div", j, [_(n.$slots, "footer-start", {}, void 0, !0)])) : l("", !0), _(n.$slots, "footer", { exampleName: I.value }, void 0, !0)]),
|
|
277
|
+
_: 3
|
|
278
|
+
}, 8, ["class"])) : l("", !0)
|
|
279
|
+
]),
|
|
280
|
+
_: 3
|
|
281
|
+
}, 512)) : p.fallback ? (h(), c(y(C), {
|
|
282
|
+
key: 1,
|
|
283
|
+
class: "request-card dark-mode"
|
|
284
|
+
}, {
|
|
285
|
+
default: S(() => [f(y(w), { class: "request-card-simple bg-transparent shadow-none" }, {
|
|
286
|
+
default: S(() => [d("div", M, [f(o, {
|
|
287
|
+
as: "span",
|
|
288
|
+
class: "request-method",
|
|
289
|
+
method: p.method
|
|
290
|
+
}, null, 8, ["method"]), _(n.$slots, "header", {}, void 0, !0)]), n.$slots.footer ? (h(), u("div", Se, [_(n.$slots, "footer", { exampleName: I.value }, void 0, !0)])) : l("", !0)]),
|
|
291
|
+
_: 3
|
|
292
|
+
})]),
|
|
293
|
+
_: 3
|
|
294
|
+
})) : l("", !0);
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
export { N as default };
|
|
7
298
|
|
|
8
299
|
//# sourceMappingURL=CodeExample.vue.js.map
|