@scalar/blocks 0.11.2 → 0.11.4
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 +49 -47
- 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.d.ts.map +1 -1
- 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 +7 -2
- package/dist/schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/schema/SchemaProperty.vue.js +494 -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 +4 -1
- package/dist/schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/schema/SchemaPropertyHeading.vue.js +313 -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.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.d.ts.map +1 -1
- package/dist/schema/helpers/get-compositions-to-render.js +34 -31
- 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.d.ts +14 -5
- package/dist/schema/helpers/get-ref-name.d.ts.map +1 -1
- package/dist/schema/helpers/get-ref-name.js +8 -11
- 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/index.d.ts +1 -1
- package/dist/schema/helpers/index.d.ts.map +1 -1
- package/dist/schema/helpers/index.js +3 -3
- 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.d.ts +7 -3
- package/dist/schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/schema/helpers/schema-name.js +36 -26
- 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.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.d.ts +2 -0
- package/dist/shared/ExternalDocs.vue.d.ts.map +1 -1
- package/dist/shared/ExternalDocs.vue.js +50 -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.js +24 -4
- package/dist/shared/ExternalExampleStatus.vue.js.map +1 -1
- 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.js.map +1 -1
- package/dist/shared/external-example-localization/translations.js.map +1 -1
- package/dist/shared/index.js +4 -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 +23 -19
- package/dist/vue-styles.css +1 -1
- package/package.json +19 -19
- 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 -269
- 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 -474
- 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 -26
- 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/ExternalExampleStatus.vue_vue_type_script_setup_true_lang.js +0 -26
- package/dist/shared/ExternalExampleStatus.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
|
@@ -1,8 +1,315 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import e from "../shared/Badge3.vue.js";
|
|
2
|
+
import { getSchemaType as t } from "./helpers/get-schema-type.js";
|
|
3
|
+
import { getDisplayTypeSignatureTokens as n } from "./helpers/get-type-signature-tokens.js";
|
|
4
|
+
import { isModelLinkable as r } from "./helpers/is-model-linkable.js";
|
|
5
|
+
import { getModelNameWithArray as ee } from "./helpers/schema-name.js";
|
|
6
|
+
import { useLocalization as te } from "./localization/index.js";
|
|
7
|
+
import { protobufFieldNumber as ne, protobufPresence as re } from "./protobuf-metadata.js";
|
|
8
|
+
import { schemaRecursiveTarget as ie } from "./recursive-metadata.js";
|
|
9
|
+
import i from "./RenderString2.vue.js";
|
|
10
|
+
import ae from "./SchemaPropertyDefault3.vue.js";
|
|
11
|
+
import a from "./SchemaPropertyDetail3.vue.js";
|
|
12
|
+
import oe from "./SchemaPropertyExamples3.vue.js";
|
|
13
|
+
import se from "./SchemaPropertyPattern3.vue.js";
|
|
14
|
+
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as ce, createTextVNode as f, createVNode as p, defineComponent as m, normalizeClass as h, openBlock as g, renderList as _, renderSlot as v, toDisplayString as y, toRef as b, unref as x, withCtx as S } from "vue";
|
|
15
|
+
import { resolve as C } from "@scalar/workspace-store/resolve";
|
|
16
|
+
import { isArraySchema as w, isNumberSchema as T, isStringSchema as E } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
|
|
17
|
+
import { isDefined as D } from "@scalar/helpers/array/is-defined";
|
|
18
|
+
import { ScalarTooltip as O } from "@scalar/components/tooltip";
|
|
19
|
+
// src/schema/SchemaPropertyHeading.vue?vue&type=script&setup=true&lang.ts
|
|
20
|
+
var le = { class: "property-heading [&>.property-detail:has(+.property-detail)]:mr-0" }, ue = { class: "text-c-3 font-code mr-2 text-xs" }, de = { "aria-hidden": "true" }, fe = { class: "sr-only" }, pe = {
|
|
21
|
+
key: 2,
|
|
22
|
+
class: "property-discriminator"
|
|
23
|
+
}, k = { class: "font-code text-c-accent" }, me = { class: "screenreader-only" }, he = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "property-type-signature text-c-2 text-(length:--scalar-mini)"
|
|
26
|
+
}, ge = {
|
|
27
|
+
key: 1,
|
|
28
|
+
class: "property-type-signature text-c-2 text-(length:--scalar-mini)"
|
|
29
|
+
}, A = { class: "text-c-2 mr-2 text-xs" }, j = { class: "sr-only" }, M = {
|
|
30
|
+
key: 0,
|
|
31
|
+
class: "screenreader-only"
|
|
32
|
+
}, N = {
|
|
33
|
+
key: 4,
|
|
34
|
+
class: "property-additional"
|
|
35
|
+
}, P = {
|
|
36
|
+
key: 5,
|
|
37
|
+
class: "property-deprecated"
|
|
38
|
+
}, F = {
|
|
39
|
+
key: 6,
|
|
40
|
+
class: "text-c-2"
|
|
41
|
+
}, I = {
|
|
42
|
+
key: 7,
|
|
43
|
+
class: "property-const"
|
|
44
|
+
}, _e = {
|
|
45
|
+
key: 9,
|
|
46
|
+
class: "property-write-only"
|
|
47
|
+
}, ve = {
|
|
48
|
+
key: 10,
|
|
49
|
+
class: "property-read-only"
|
|
50
|
+
}, ye = {
|
|
51
|
+
key: 11,
|
|
52
|
+
class: "property-required"
|
|
53
|
+
}, L = "min-w-0 wrap-anywhere whitespace-normal", R = /*@__PURE__*/ m({
|
|
54
|
+
__name: "SchemaPropertyHeading",
|
|
55
|
+
props: {
|
|
56
|
+
value: {},
|
|
57
|
+
badges: {},
|
|
58
|
+
enum: { type: Boolean },
|
|
59
|
+
isDiscriminator: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: !1
|
|
62
|
+
},
|
|
63
|
+
discriminatorValue: {},
|
|
64
|
+
required: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: !1
|
|
67
|
+
},
|
|
68
|
+
additional: { type: Boolean },
|
|
69
|
+
withExamples: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: !0
|
|
72
|
+
},
|
|
73
|
+
hideModelNames: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: !1
|
|
76
|
+
},
|
|
77
|
+
modelLinkOptions: {},
|
|
78
|
+
model: {},
|
|
79
|
+
modelName: {},
|
|
80
|
+
propertyNames: {},
|
|
81
|
+
eventBus: { default: null },
|
|
82
|
+
keyKind: {},
|
|
83
|
+
recursiveTo: {}
|
|
84
|
+
},
|
|
85
|
+
setup(m) {
|
|
86
|
+
let R = m, { translate: z } = te(), B = s(() => R.value?.[ne]), V = s(() => R.recursiveTo ?? R.value?.[ie]), H = s(() => R.value?.[re]), U = s(() => H.value === "explicit" ? "Explicit presence: Protobuf distinguishes an unset field from one set to its default value." : "Implicit presence: Protobuf does not distinguish an unset field from one set to its default value."), W = b(R, "value"), G = s(() => {
|
|
87
|
+
let e = R.badges;
|
|
88
|
+
if (e) return {
|
|
89
|
+
before: e.filter((e) => e.position === "before"),
|
|
90
|
+
after: e.filter((e) => e.position !== "before")
|
|
91
|
+
};
|
|
92
|
+
}), K = s(() => {
|
|
93
|
+
if (!W.value) return;
|
|
94
|
+
let e = W.value;
|
|
95
|
+
if (e.const !== void 0) return e.const;
|
|
96
|
+
if (e.enum?.length === 1) return e.enum[0];
|
|
97
|
+
if (w(e) && e.items) {
|
|
98
|
+
let t = C.schema(e.items);
|
|
99
|
+
if (D(t.const)) return t.const;
|
|
100
|
+
if (t.enum?.length === 1) return t.enum[0];
|
|
101
|
+
}
|
|
102
|
+
}), q = (e) => {
|
|
103
|
+
let t = [];
|
|
104
|
+
return E(e) && (D(e.minLength) && t.push({
|
|
105
|
+
key: "min-length",
|
|
106
|
+
prefix: `${z("schema.minLength")}: `,
|
|
107
|
+
value: e.minLength
|
|
108
|
+
}), D(e.maxLength) && t.push({
|
|
109
|
+
key: "max-length",
|
|
110
|
+
prefix: `${z("schema.maxLength")}: `,
|
|
111
|
+
value: e.maxLength
|
|
112
|
+
})), (E(e) || T(e)) && e.format && t.push({
|
|
113
|
+
key: "format",
|
|
114
|
+
value: e.format,
|
|
115
|
+
truncate: !0
|
|
116
|
+
}), T(e) && (D(e.exclusiveMinimum) && t.push({
|
|
117
|
+
key: "exclusive-minimum",
|
|
118
|
+
prefix: `${z("schema.greaterThan")}: `,
|
|
119
|
+
value: e.exclusiveMinimum
|
|
120
|
+
}), D(e.minimum) && t.push({
|
|
121
|
+
key: "minimum",
|
|
122
|
+
prefix: `${z("schema.min")}: `,
|
|
123
|
+
value: e.minimum
|
|
124
|
+
}), D(e.exclusiveMaximum) && t.push({
|
|
125
|
+
key: "exclusive-maximum",
|
|
126
|
+
prefix: `${z("schema.lessThan")}: `,
|
|
127
|
+
value: e.exclusiveMaximum
|
|
128
|
+
}), D(e.maximum) && t.push({
|
|
129
|
+
key: "maximum",
|
|
130
|
+
prefix: `${z("schema.max")}: `,
|
|
131
|
+
value: e.maximum
|
|
132
|
+
}), D(e.multipleOf) && t.push({
|
|
133
|
+
key: "multiple-of",
|
|
134
|
+
prefix: `${z("schema.multipleOf")}: `,
|
|
135
|
+
value: e.multipleOf
|
|
136
|
+
})), t;
|
|
137
|
+
}, be = s(() => {
|
|
138
|
+
if (!W.value) return [];
|
|
139
|
+
let e = W.value, t = [];
|
|
140
|
+
return w(e) && ((D(e.minItems) || D(e.maxItems)) && t.push({
|
|
141
|
+
key: "array-range",
|
|
142
|
+
value: `${e.minItems ?? ""}…${e.maxItems ?? ""}`
|
|
143
|
+
}), e.uniqueItems && t.push({
|
|
144
|
+
key: "unique-items",
|
|
145
|
+
value: `${z("schema.unique")}!`
|
|
146
|
+
})), t.push(...q(e)), w(e) && e.items && t.push(...q(C.schema(e.items))), t;
|
|
147
|
+
}), J = b(R, "model"), Y = s(() => !R.value || R.hideModelNames ? null : J.value ? J.value : R.modelName ? {
|
|
148
|
+
schemaKey: R.modelName,
|
|
149
|
+
label: R.modelName
|
|
150
|
+
} : ee(R.value)), xe = s(() => r(Y.value?.schemaKey, R.modelLinkOptions ?? {})), X = s(() => n(R.value, {
|
|
151
|
+
hideModelNames: R.hideModelNames,
|
|
152
|
+
modelName: Y.value?.label
|
|
153
|
+
})), Se = s(() => !R.value || !("type" in R.value) ? !1 : R.value.type === "array" || !K.value), Z = s(() => {
|
|
154
|
+
let e = R.propertyNames;
|
|
155
|
+
if (!e) return;
|
|
156
|
+
let n = [t(e)];
|
|
157
|
+
"format" in e && typeof e.format == "string" && n.push(e.format);
|
|
158
|
+
let r = n.filter(Boolean).join(" · ");
|
|
159
|
+
return r.length > 0 ? r : void 0;
|
|
160
|
+
}), Q = s(() => {
|
|
161
|
+
if (R.value && "example" in R.value && R.value.example !== void 0) return R.value.example;
|
|
162
|
+
if (R.value && w(R.value) && !R.value.examples?.length) {
|
|
163
|
+
let e = C.schema(R.value.items);
|
|
164
|
+
if (e && "example" in e && e.example !== void 0) return e.example;
|
|
165
|
+
}
|
|
166
|
+
}), Ce = s(() => {
|
|
167
|
+
if (Q.value !== void 0) return !0;
|
|
168
|
+
let e = R.value?.examples;
|
|
169
|
+
return !!e && typeof e == "object" && Object.keys(e).length > 0;
|
|
170
|
+
}), $ = s(() => {
|
|
171
|
+
let e = W.value;
|
|
172
|
+
if (e) {
|
|
173
|
+
if (E(e) && e.pattern) return e.pattern;
|
|
174
|
+
if (w(e) && e.items) {
|
|
175
|
+
let t = C.schema(e.items);
|
|
176
|
+
if (E(t) && t.pattern) return t.pattern;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
return (t, n) => (g(), u("div", le, [
|
|
181
|
+
(g(!0), u(o, null, _(G.value?.before, (t, n) => (g(), c(e, {
|
|
182
|
+
key: n,
|
|
183
|
+
class: h(L),
|
|
184
|
+
color: t.color
|
|
185
|
+
}, {
|
|
186
|
+
default: S(() => [f(y(t.name), 1)]),
|
|
187
|
+
_: 2
|
|
188
|
+
}, 1032, ["color"]))), 128)),
|
|
189
|
+
t.$slots.name ? (g(), u("div", {
|
|
190
|
+
key: 0,
|
|
191
|
+
class: h(["property-name", { deprecated: R.value?.deprecated }])
|
|
192
|
+
}, [v(t.$slots, "name", {}, void 0, !0)], 2)) : l("", !0),
|
|
193
|
+
B.value === void 0 ? l("", !0) : (g(), c(x(O), {
|
|
194
|
+
key: 1,
|
|
195
|
+
content: "Protobuf field number"
|
|
196
|
+
}, {
|
|
197
|
+
default: S(() => [d("span", ue, [d("span", de, "#" + y(B.value), 1), d("span", fe, "Protobuf field number: " + y(B.value), 1)])]),
|
|
198
|
+
_: 1
|
|
199
|
+
})),
|
|
200
|
+
R.isDiscriminator ? (g(), u("div", pe, y(x(z)("schema.discriminator")), 1)) : l("", !0),
|
|
201
|
+
R.value ? (g(), u(o, { key: 3 }, [
|
|
202
|
+
R.keyKind ? (g(), c(a, {
|
|
203
|
+
key: 0,
|
|
204
|
+
class: "property-key-kind"
|
|
205
|
+
}, {
|
|
206
|
+
default: S(() => [d("span", k, y(R.keyKind === "pattern" ? "patternProperty" : "additionalProperty"), 1)]),
|
|
207
|
+
_: 1
|
|
208
|
+
})) : l("", !0),
|
|
209
|
+
Se.value ? (g(), c(a, {
|
|
210
|
+
key: 1,
|
|
211
|
+
truncate: ""
|
|
212
|
+
}, {
|
|
213
|
+
default: S(() => [d("span", me, y(x(z)("schema.type")) + ": ", 1), R.eventBus && Y.value?.schemaKey && xe.value ? (g(), u("button", {
|
|
214
|
+
key: 0,
|
|
215
|
+
class: "text-c-2 hover:text-c-1 underline",
|
|
216
|
+
type: "button",
|
|
217
|
+
onClick: n[0] ||= (e) => R.eventBus.emit("scroll-to:model-by-name", { name: Y.value.schemaKey })
|
|
218
|
+
}, [X.value.length ? (g(), u("span", he, [(g(!0), u(o, null, _(X.value, (e, t) => (g(), u(o, { key: t }, [f(y(t > 0 ? " " : ""), 1), d("span", { class: h(["property-type-token", [
|
|
219
|
+
`property-type-token--${e.kind}`,
|
|
220
|
+
e.kind === "word" ? "font-sans" : "",
|
|
221
|
+
e.kind === "ident" || e.kind === "literal" ? "font-code" : "",
|
|
222
|
+
e.kind === "punctuation" ? "text-c-2" : ""
|
|
223
|
+
]]) }, y(e.text), 3)], 64))), 128))])) : l("", !0)])) : X.value.length ? (g(), u("span", ge, [(g(!0), u(o, null, _(X.value, (e, t) => (g(), u(o, { key: t }, [f(y(t > 0 ? " " : ""), 1), d("span", { class: h(["property-type-token", [
|
|
224
|
+
`property-type-token--${e.kind}`,
|
|
225
|
+
e.kind === "word" ? "font-sans" : "",
|
|
226
|
+
e.kind === "ident" || e.kind === "literal" ? "font-code" : "",
|
|
227
|
+
e.kind === "punctuation" ? "text-c-2" : ""
|
|
228
|
+
]]) }, y(e.text), 3)], 64))), 128))])) : l("", !0)]),
|
|
229
|
+
_: 1
|
|
230
|
+
})) : l("", !0),
|
|
231
|
+
V.value ? (g(), c(a, {
|
|
232
|
+
key: 2,
|
|
233
|
+
class: "property-recursive",
|
|
234
|
+
title: x(z)("schema.recursiveReference", { name: V.value })
|
|
235
|
+
}, {
|
|
236
|
+
default: S(() => [f(y(x(z)("schema.recursive")), 1)]),
|
|
237
|
+
_: 1
|
|
238
|
+
}, 8, ["title"])) : l("", !0),
|
|
239
|
+
H.value ? (g(), c(x(O), {
|
|
240
|
+
key: 3,
|
|
241
|
+
content: U.value
|
|
242
|
+
}, {
|
|
243
|
+
default: S(() => [d("span", A, [n[1] ||= d("span", { "aria-hidden": "true" }, "optional", -1), d("span", j, "Optional (" + y(H.value) + " presence). " + y(U.value), 1)])]),
|
|
244
|
+
_: 1
|
|
245
|
+
}, 8, ["content"])) : l("", !0),
|
|
246
|
+
Z.value ? (g(), c(a, {
|
|
247
|
+
key: 4,
|
|
248
|
+
truncate: ""
|
|
249
|
+
}, {
|
|
250
|
+
prefix: S(() => [f(y(x(z)("schema.keys")) + ":", 1)]),
|
|
251
|
+
default: S(() => [f(" " + y(Z.value), 1)]),
|
|
252
|
+
_: 1
|
|
253
|
+
})) : l("", !0),
|
|
254
|
+
(g(!0), u(o, null, _(be.value, (e) => (g(), c(a, {
|
|
255
|
+
key: e.key,
|
|
256
|
+
code: e.code,
|
|
257
|
+
truncate: e.truncate
|
|
258
|
+
}, ce({
|
|
259
|
+
default: S(() => [e.key === "format" ? (g(), u("span", M, y(x(z)("schema.format")) + ": ", 1)) : l("", !0), f(" " + y(e.value), 1)]),
|
|
260
|
+
_: 2
|
|
261
|
+
}, [e.prefix ? {
|
|
262
|
+
name: "prefix",
|
|
263
|
+
fn: S(() => [f(y(e.prefix), 1)]),
|
|
264
|
+
key: "0"
|
|
265
|
+
} : void 0]), 1032, ["code", "truncate"]))), 128)),
|
|
266
|
+
R.enum ? (g(), c(a, { key: 5 }, {
|
|
267
|
+
default: S(() => [f(y(x(z)("schema.enum")), 1)]),
|
|
268
|
+
_: 1
|
|
269
|
+
})) : l("", !0)
|
|
270
|
+
], 64)) : l("", !0),
|
|
271
|
+
R.additional ? (g(), u("div", N, [R.value?.["x-additionalPropertiesName"] ? (g(), u(o, { key: 0 }, [f(y(R.value["x-additionalPropertiesName"]), 1)], 64)) : (g(), u(o, { key: 1 }, [f(y(x(z)("schema.additionalProperties")), 1)], 64))])) : l("", !0),
|
|
272
|
+
R.value?.deprecated ? (g(), u("div", P, [p(e, null, {
|
|
273
|
+
default: S(() => [f(y(x(z)("schema.deprecated")), 1)]),
|
|
274
|
+
_: 1
|
|
275
|
+
})])) : l("", !0),
|
|
276
|
+
(g(!0), u(o, null, _(G.value?.after, (t, n) => (g(), c(e, {
|
|
277
|
+
key: n,
|
|
278
|
+
class: h(L),
|
|
279
|
+
color: t.color
|
|
280
|
+
}, {
|
|
281
|
+
default: S(() => [f(y(t.name), 1)]),
|
|
282
|
+
_: 2
|
|
283
|
+
}, 1032, ["color"]))), 128)),
|
|
284
|
+
m.discriminatorValue === void 0 ? l("", !0) : (g(), u("span", F, [f(y(x(z)("schema.discriminatorValue")) + ": ", 1), p(i, { value: m.discriminatorValue }, null, 8, ["value"])])),
|
|
285
|
+
K.value === void 0 ? (g(), u(o, { key: 8 }, [R.value?.nullable === !0 ? (g(), c(a, { key: 0 }, {
|
|
286
|
+
default: S(() => [f(y(x(z)("schema.nullable")), 1)]),
|
|
287
|
+
_: 1
|
|
288
|
+
})) : l("", !0)], 64)) : (g(), u("div", I, [p(a, { truncate: "" }, {
|
|
289
|
+
prefix: S(() => [f(y(x(z)("schema.const")) + ": ", 1)]),
|
|
290
|
+
default: S(() => [p(i, { value: K.value }, null, 8, ["value"])]),
|
|
291
|
+
_: 1
|
|
292
|
+
})])),
|
|
293
|
+
R.value?.writeOnly ? (g(), u("div", _e, y(x(z)("schema.writeOnly")), 1)) : R.value?.readOnly ? (g(), u("div", ve, y(x(z)("schema.readOnly")), 1)) : l("", !0),
|
|
294
|
+
R.required ? (g(), u("div", ye, y(x(z)("schema.required")), 1)) : l("", !0),
|
|
295
|
+
R.value?.default === void 0 ? l("", !0) : (g(), c(ae, {
|
|
296
|
+
key: 12,
|
|
297
|
+
value: R.value?.default
|
|
298
|
+
}, null, 8, ["value"])),
|
|
299
|
+
$.value ? (g(), c(se, {
|
|
300
|
+
key: 13,
|
|
301
|
+
pattern: $.value
|
|
302
|
+
}, null, 8, ["pattern"])) : l("", !0),
|
|
303
|
+
R.withExamples && Ce.value ? (g(), c(oe, {
|
|
304
|
+
key: 14,
|
|
305
|
+
example: Q.value,
|
|
306
|
+
examples: R.value?.examples
|
|
307
|
+
}, null, 8, ["example", "examples"])) : l("", !0),
|
|
308
|
+
v(t.$slots, "preview", {}, void 0, !0),
|
|
309
|
+
v(t.$slots, "trailing", {}, void 0, !0)
|
|
310
|
+
]));
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
export { R as default };
|
|
7
314
|
|
|
8
315
|
//# sourceMappingURL=SchemaPropertyHeading.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaPropertyHeading.vue.js","names":["SchemaPropertyHeading_vue_vue_type_script_setup_true_lang_default","_plugin_vue_export_helper_default","SchemaPropertyHeading_default"],"sources":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"SchemaPropertyHeading.vue.js","names":["$slots","_openBlock","_createElementBlock","_Fragment","_renderList","_createBlock","Badge","_normalizeClass","_withCtx","_createTextVNode","_toDisplayString","_renderSlot","_unref","_createElementVNode","SchemaPropertyDetail","_createVNode","RenderString","SchemaPropertyDefault","SchemaPropertyPattern","SchemaPropertyExamples","Badge_default","getSchemaType","getDisplayTypeSignatureTokens","isModelLinkable","getModelNameWithArray","useLocalization","protobufFieldNumber","protobufPresence","schemaRecursiveTarget","RenderString_default","SchemaPropertyDefault_default","SchemaPropertyDetail_default","SchemaPropertyExamples_default","SchemaPropertyPattern_default","Fragment","computed","createBlock","createCommentVNode","createElementBlock","createElementVNode","createSlots","createTextVNode","createVNode","defineComponent","normalizeClass","openBlock","renderList","renderSlot","toDisplayString","toRef","unref","withCtx","resolve","isArraySchema","isNumberSchema","isStringSchema","isDefined","ScalarTooltip","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","badgeClass","SchemaPropertyHeading_vue_vue_type_script_setup_true_lang_default","__props","props","translate","fieldNumber","recursiveTarget","presence","presenceDescription","valueRef","positionedBadges","entries","badge","constValue","schema","items","getLeafConstraints","properties","validationProperties","model","modelLink","modelLinkable","signatureTokens","shouldShowType","propertyNamesDetail","parts","detail","exampleValue","itemsSchema","hasExampleContent","examples","patternValue","_ctx","_cache","index","$event","token","property"],"sources":["../../src/schema/SchemaPropertyHeading.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarTooltip } from '@scalar/components/tooltip'\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { XBadge } from '@scalar/workspace-store/schemas/extensions/operation'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport {\n isArraySchema,\n isNumberSchema,\n isStringSchema,\n} from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\nimport { computed, toRef } from 'vue'\n\nimport Badge from '../shared/Badge.vue'\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { getDisplayTypeSignatureTokens } from './helpers/get-type-signature-tokens'\nimport {\n isModelLinkable,\n type ModelLinkOptions,\n} from './helpers/is-model-linkable'\nimport {\n getModelNameWithArray,\n type SchemaModelName,\n} from './helpers/schema-name'\nimport { useLocalization } from './localization'\nimport {\n protobufFieldNumber,\n protobufPresence,\n type ProtobufSchema,\n} from './protobuf-metadata'\nimport {\n schemaRecursiveTarget,\n type RecursiveSchema,\n} from './recursive-metadata'\nimport RenderString from './RenderString.vue'\nimport SchemaPropertyDefault from './SchemaPropertyDefault.vue'\nimport SchemaPropertyDetail from './SchemaPropertyDetail.vue'\nimport SchemaPropertyExamples from './SchemaPropertyExamples.vue'\nimport SchemaPropertyPattern from './SchemaPropertyPattern.vue'\n\nconst props = withDefaults(\n defineProps<{\n value: SchemaObject | undefined\n badges?: XBadge[]\n enum?: boolean\n isDiscriminator?: boolean\n /** Effective AsyncAPI variant value, separate from const/enum constraints. */\n discriminatorValue?: string\n required?: boolean\n additional?: boolean\n withExamples?: boolean\n hideModelNames?: boolean\n /**\n * Config for deciding whether a model name links to the models section. When the section or\n * the referenced model is hidden there is nothing to scroll to, so the name renders as plain text.\n */\n modelLinkOptions?: ModelLinkOptions\n /** Display and navigation metadata supplied by the containing row. */\n model?: SchemaModelName | null\n /** @deprecated Use `model` to provide the display label and model key. */\n modelName?: string | null\n /** Resolved propertyNames schema, used to surface key constraints like `format` for additional properties. */\n propertyNames?: SchemaObject\n eventBus?: WorkspaceEventBus | null\n /**\n * The row's name is a stand-in for keys the caller chooses\n * (`additionalProperties`) or keys matching a regex (`patternProperties`),\n * not a literal property. The heading says so in the signature line, where\n * the tree already describes shapes, instead of styling the name itself.\n */\n keyKind?: 'additional' | 'pattern'\n /**\n * The name of the schema this row loops back to. A cut cycle is a leaf, so\n * the signature line says why it does not expand; the model link beside it\n * already names the schema the loop returns to.\n */\n recursiveTo?: string\n }>(),\n {\n isDiscriminator: false,\n required: false,\n withExamples: true,\n hideModelNames: false,\n eventBus: null,\n },\n)\nconst { translate } = useLocalization()\n\n// Convert to reactive refs for composables\nconst fieldNumber = computed(\n () => (props.value as ProtobufSchema | undefined)?.[protobufFieldNumber],\n)\n\nconst recursiveTarget = computed(\n () =>\n props.recursiveTo ??\n (props.value as RecursiveSchema | undefined)?.[schemaRecursiveTarget],\n)\n\nconst presence = computed(\n () => (props.value as ProtobufSchema | undefined)?.[protobufPresence],\n)\nconst presenceDescription = computed(() =>\n presence.value === 'explicit'\n ? 'Explicit presence: Protobuf distinguishes an unset field from one set to its default value.'\n : 'Implicit presence: Protobuf does not distinguish an unset field from one set to its default value.',\n)\n\nconst valueRef = toRef(props, 'value')\nconst badgeClass = 'min-w-0 wrap-anywhere whitespace-normal'\n\nconst positionedBadges = computed<\n { before: XBadge[]; after: XBadge[] } | undefined\n>(() => {\n const entries = props.badges\n if (!entries) {\n return undefined\n }\n\n return {\n before: entries.filter((badge) => badge.position === 'before'),\n after: entries.filter((badge) => badge.position !== 'before'),\n }\n})\n\nconst constValue = computed(() => {\n if (!valueRef.value) {\n return undefined\n }\n\n const schema = valueRef.value\n\n // Direct const value\n if (schema.const !== undefined) {\n return schema.const\n }\n\n // Single-item enum acts as const\n if (schema.enum?.length === 1) {\n return schema.enum[0]\n }\n\n // Check items for const values (for arrays)\n if (isArraySchema(schema) && schema.items) {\n const items = resolve.schema(schema.items)\n\n if (isDefined(items.const)) {\n return items.const\n }\n\n if (items.enum?.length === 1) {\n return items.enum[0]\n }\n }\n\n return undefined\n})\n\ntype ValidationProperty = {\n key: string\n value: string | number\n prefix?: string\n code?: boolean\n truncate?: boolean\n}\n\n/**\n * Constraints that live on a leaf (string or number) schema: length, pattern,\n * format and numeric ranges. Extracted so they can be surfaced for a primitive\n * schema as well as for a primitive array's items, which are not rendered on\n * their own. See https://github.com/scalar/scalar/issues/9690\n */\nconst getLeafConstraints = (schema: SchemaObject) => {\n const properties: ValidationProperty[] = []\n\n if (isStringSchema(schema)) {\n if (isDefined(schema.minLength)) {\n properties.push({\n key: 'min-length',\n prefix: `${translate('schema.minLength')}: `,\n value: schema.minLength,\n })\n }\n\n if (isDefined(schema.maxLength)) {\n properties.push({\n key: 'max-length',\n prefix: `${translate('schema.maxLength')}: `,\n value: schema.maxLength,\n })\n }\n\n // pattern is rendered via SchemaPropertyPattern (hover dropdown), skip here\n }\n\n if ((isStringSchema(schema) || isNumberSchema(schema)) && schema.format) {\n properties.push({\n key: 'format',\n value: schema.format,\n truncate: true,\n })\n }\n\n if (isNumberSchema(schema)) {\n if (isDefined(schema.exclusiveMinimum)) {\n properties.push({\n key: 'exclusive-minimum',\n prefix: `${translate('schema.greaterThan')}: `,\n value: schema.exclusiveMinimum,\n })\n }\n\n if (isDefined(schema.minimum)) {\n properties.push({\n key: 'minimum',\n prefix: `${translate('schema.min')}: `,\n value: schema.minimum,\n })\n }\n\n if (isDefined(schema.exclusiveMaximum)) {\n properties.push({\n key: 'exclusive-maximum',\n prefix: `${translate('schema.lessThan')}: `,\n value: schema.exclusiveMaximum,\n })\n }\n\n if (isDefined(schema.maximum)) {\n properties.push({\n key: 'maximum',\n prefix: `${translate('schema.max')}: `,\n value: schema.maximum,\n })\n }\n\n if (isDefined(schema.multipleOf)) {\n properties.push({\n key: 'multiple-of',\n prefix: `${translate('schema.multipleOf')}: `,\n value: schema.multipleOf,\n })\n }\n }\n\n return properties\n}\n\nconst validationProperties = computed(() => {\n if (!valueRef.value) {\n return []\n }\n\n const schema = valueRef.value\n const properties: ValidationProperty[] = []\n\n // Array validation properties\n if (isArraySchema(schema)) {\n if (isDefined(schema.minItems) || isDefined(schema.maxItems)) {\n properties.push({\n key: 'array-range',\n value: `${schema.minItems ?? ''}…${schema.maxItems ?? ''}`,\n })\n }\n\n // Unique items\n if (schema.uniqueItems) {\n properties.push({\n key: 'unique-items',\n value: `${translate('schema.unique')}!`,\n })\n }\n }\n\n properties.push(...getLeafConstraints(schema))\n\n // Primitive array items carry their own constraints (e.g. an array of `uuid`\n // strings) but are not rendered separately, so surface them here.\n if (isArraySchema(schema) && schema.items) {\n properties.push(...getLeafConstraints(resolve.schema(schema.items)))\n }\n\n return properties\n})\n\nconst model = toRef(props, 'model')\n\n/** Link data for navigating to the referenced model in the sidebar. */\nconst modelLink = computed<SchemaModelName | null>(() => {\n if (!props.value) {\n return null\n }\n\n if (props.hideModelNames) {\n return null\n }\n\n if (model.value) {\n return model.value\n }\n\n if (props.modelName) {\n return { schemaKey: props.modelName, label: props.modelName }\n }\n\n return getModelNameWithArray(props.value)\n})\n\n/** Whether the model name links to the models section, or renders as plain text. */\nconst modelLinkable = computed(() =>\n isModelLinkable(modelLink.value?.schemaKey, props.modelLinkOptions ?? {}),\n)\n\n/**\n * The type as a run of tokens rather than a single string — identifiers in\n * the code face, English words like `array of` in the sans face, and a muted\n * `|` so `string | null` reads as one type with an alternative.\n *\n * The token run and the screen-reader label are written straight into the\n * template instead of being their own components: the tree mounts one per\n * typed row, and a component instance costs more to create than the span it\n * renders. On a flat object the type cells would be most of the instance\n * count. The linked and the plain copy of the token markup below must stay\n * identical.\n */\nconst signatureTokens = computed(() =>\n getDisplayTypeSignatureTokens(props.value, {\n hideModelNames: props.hideModelNames,\n modelName: modelLink.value?.label,\n }),\n)\n\n/** Check if we should show the type information */\nconst shouldShowType = computed(() => {\n if (!props.value || !('type' in props.value)) {\n return false\n }\n\n // Always show type for arrays, even when items have const values\n if (props.value.type === 'array') {\n return true\n }\n\n // For non-arrays, only show if no const value at the schema level\n return !constValue.value\n})\n\n/**\n * Type and format of the property keys, derived from the propertyNames schema.\n *\n * For a map keyed by UUIDs this renders e.g. \"string · uuid\" so the key\n * constraints are not lost. Returns undefined when there is nothing to show.\n */\nconst propertyNamesDetail = computed(() => {\n const schema = props.propertyNames\n if (!schema) {\n return undefined\n }\n\n const parts = [getSchemaType(schema)]\n if ('format' in schema && typeof schema.format === 'string') {\n parts.push(schema.format)\n }\n\n const detail = parts.filter(Boolean).join(' · ')\n return detail.length > 0 ? detail : undefined\n})\n\nconst exampleValue = computed(() => {\n // Treat only `undefined` as \"not set\" — `null` is a valid example value on a nullable schema.\n if (\n props.value &&\n 'example' in props.value &&\n props.value.example !== undefined\n ) {\n return props.value.example\n }\n\n // An array's own examples take precedence over the fallback from its items.\n if (\n props.value &&\n isArraySchema(props.value) &&\n !props.value.examples?.length\n ) {\n const itemsSchema = resolve.schema(props.value.items)\n if (\n itemsSchema &&\n 'example' in itemsSchema &&\n itemsSchema.example !== undefined\n ) {\n return itemsSchema.example\n }\n }\n\n return undefined\n})\n\n/**\n * Whether the examples chip has anything to render.\n *\n * `SchemaPropertyExamples` already renders nothing without an example, but it\n * still mounts, and mounting is what installs its popup's window-level click\n * and keydown listeners. `withExamples` defaults to true, so without this gate\n * every property row on the page — including a plain `{ type: 'string' }` —\n * pays for a popup it never opens. Mirrors the component's own two branches.\n */\nconst hasExampleContent = computed((): boolean => {\n if (exampleValue.value !== undefined) {\n return true\n }\n\n const examples = props.value?.examples\n\n return (\n !!examples &&\n typeof examples === 'object' &&\n Object.keys(examples).length > 0\n )\n})\n\n/**\n * The regex `pattern` to surface via the hover dropdown. It lives on a string\n * schema, or on the items of a primitive array (which is not rendered on its\n * own, so its constraints are surfaced on the array heading — see\n * https://github.com/scalar/scalar/issues/9690).\n */\nconst patternValue = computed(() => {\n const schema = valueRef.value\n if (!schema) {\n return undefined\n }\n\n if (isStringSchema(schema) && schema.pattern) {\n return schema.pattern\n }\n\n if (isArraySchema(schema) && schema.items) {\n const items = resolve.schema(schema.items)\n if (isStringSchema(items) && items.pattern) {\n return items.pattern\n }\n }\n\n return undefined\n})\n</script>\n<template>\n <div\n class=\"property-heading [&>.property-detail:has(+.property-detail)]:mr-0\">\n <!-- `:has(+.property-detail)`: only a detail FOLLOWED BY another detail\n drops its right margin, because the `·` separator supplies the gap\n there. Not `:not(:last-of-type)`, which matches by element type: the\n collapsed preview and the trailing copy-link are spans as well, so it\n would strip the margin from the final detail and glue \"Addressrequired\"\n together on a collapsed row. -->\n <Badge\n v-for=\"(badge, index) in positionedBadges?.before\"\n :key=\"index\"\n :class=\"badgeClass\"\n :color=\"badge.color\">\n {{ badge.name }}\n </Badge>\n <div\n v-if=\"$slots.name\"\n class=\"property-name\"\n :class=\"{ deprecated: props.value?.deprecated }\">\n <slot name=\"name\" />\n </div>\n <ScalarTooltip\n v-if=\"fieldNumber !== undefined\"\n content=\"Protobuf field number\">\n <span class=\"text-c-3 font-code mr-2 text-xs\">\n <span aria-hidden=\"true\">#{{ fieldNumber }}</span>\n <span class=\"sr-only\">Protobuf field number: {{ fieldNumber }}</span>\n </span>\n </ScalarTooltip>\n <div\n v-if=\"props.isDiscriminator\"\n class=\"property-discriminator\">\n {{ translate('schema.discriminator') }}\n </div>\n <template v-if=\"props.value\">\n <!-- A map key reads `additionalProperty · string`: the keyword leads the\n detail list in the accent colour, like a type word, so the name\n above it can look like every other name. -->\n <SchemaPropertyDetail\n v-if=\"props.keyKind\"\n class=\"property-key-kind\">\n <span class=\"font-code text-c-accent\">{{\n props.keyKind === 'pattern' ? 'patternProperty' : 'additionalProperty'\n }}</span>\n </SchemaPropertyDetail>\n <!-- Type information -->\n <SchemaPropertyDetail\n v-if=\"shouldShowType\"\n truncate>\n <!-- The type is a token run (`array of Planet`) and a $ref link IS the\n type, not an appended `· Account` -->\n <!-- Written across lines on purpose: Vue drops whitespace-only text\n between two elements, so a single-line label would read\n `Type:string`. -->\n <span class=\"screenreader-only\"> {{ translate('schema.type') }}: </span>\n <button\n v-if=\"props.eventBus && modelLink?.schemaKey && modelLinkable\"\n class=\"text-c-2 hover:text-c-1 underline\"\n type=\"button\"\n @click=\"\n props.eventBus.emit('scroll-to:model-by-name', {\n name: modelLink.schemaKey,\n })\n \">\n <span\n v-if=\"signatureTokens.length\"\n class=\"property-type-signature text-c-2 text-(length:--scalar-mini)\">\n <template\n v-for=\"(token, index) in signatureTokens\"\n :key=\"index\">\n {{ index > 0 ? ' ' : ''\n }}<span\n class=\"property-type-token\"\n :class=\"[\n `property-type-token--${token.kind}`,\n token.kind === 'word' ? 'font-sans' : '',\n token.kind === 'ident' || token.kind === 'literal'\n ? 'font-code'\n : '',\n token.kind === 'punctuation' ? 'text-c-2' : '',\n ]\"\n >{{ token.text }}</span\n >\n </template>\n </span>\n </button>\n <span\n v-else-if=\"signatureTokens.length\"\n class=\"property-type-signature text-c-2 text-(length:--scalar-mini)\">\n <template\n v-for=\"(token, index) in signatureTokens\"\n :key=\"index\">\n {{ index > 0 ? ' ' : ''\n }}<span\n class=\"property-type-token\"\n :class=\"[\n `property-type-token--${token.kind}`,\n token.kind === 'word' ? 'font-sans' : '',\n token.kind === 'ident' || token.kind === 'literal'\n ? 'font-code'\n : '',\n token.kind === 'punctuation' ? 'text-c-2' : '',\n ]\"\n >{{ token.text }}</span\n >\n </template>\n </span>\n </SchemaPropertyDetail>\n\n <!-- A cycle reads `array of Satellite · recursive`, a modifier like\n `nullable`; the full sentence rides the tooltip. -->\n <SchemaPropertyDetail\n v-if=\"recursiveTarget\"\n class=\"property-recursive\"\n :title=\"\n translate('schema.recursiveReference', { name: recursiveTarget })\n \">\n {{ translate('schema.recursive') }}\n </SchemaPropertyDetail>\n\n <ScalarTooltip\n v-if=\"presence\"\n :content=\"presenceDescription\">\n <span class=\"text-c-2 mr-2 text-xs\">\n <span aria-hidden=\"true\">optional</span>\n <span class=\"sr-only\"\n >Optional ({{ presence }} presence). {{ presenceDescription }}</span\n >\n </span>\n </ScalarTooltip>\n\n <!-- Key constraints from propertyNames (e.g. \"keys: string · uuid\") -->\n <SchemaPropertyDetail\n v-if=\"propertyNamesDetail\"\n truncate>\n <template #prefix>{{ translate('schema.keys') }}:</template>\n {{ propertyNamesDetail }}\n </SchemaPropertyDetail>\n\n <!-- Dynamic validation properties from composable -->\n <SchemaPropertyDetail\n v-for=\"property in validationProperties\"\n :key=\"property.key\"\n :code=\"property.code\"\n :truncate=\"property.truncate\">\n <span\n v-if=\"property.key === 'format'\"\n class=\"screenreader-only\">\n {{ translate('schema.format') }}:\n </span>\n <template\n v-if=\"property.prefix\"\n #prefix>\n {{ property.prefix }}\n </template>\n {{ property.value }}\n </SchemaPropertyDetail>\n\n <!-- Enum indicator -->\n <SchemaPropertyDetail v-if=\"props.enum\">\n {{ translate('schema.enum') }}\n </SchemaPropertyDetail>\n </template>\n <div\n v-if=\"props.additional\"\n class=\"property-additional\">\n <template v-if=\"props.value?.['x-additionalPropertiesName']\">\n {{ props.value['x-additionalPropertiesName'] }}\n </template>\n <template v-else>{{ translate('schema.additionalProperties') }}</template>\n </div>\n <div\n v-if=\"props.value?.deprecated\"\n class=\"property-deprecated\">\n <Badge>{{ translate('schema.deprecated') }}</Badge>\n </div>\n <Badge\n v-for=\"(badge, index) in positionedBadges?.after\"\n :key=\"index\"\n :class=\"badgeClass\"\n :color=\"badge.color\">\n {{ badge.name }}\n </Badge>\n <span\n v-if=\"discriminatorValue !== undefined\"\n class=\"text-c-2\">\n {{ translate('schema.discriminatorValue') }}:\n <RenderString :value=\"discriminatorValue\" />\n </span>\n <!-- Don't use `isDefined` here, we want to show `const` when the value is `null` -->\n <div\n v-if=\"constValue !== undefined\"\n class=\"property-const\">\n <SchemaPropertyDetail truncate>\n <template #prefix>{{ translate('schema.const') }}: </template>\n <RenderString :value=\"constValue\" />\n </SchemaPropertyDetail>\n </div>\n <template v-else>\n <!-- Shows only when a composition is used (so props.value?.type is undefined) -->\n <SchemaPropertyDetail v-if=\"(props.value as any)?.nullable === true\">\n {{ translate('schema.nullable') }}\n </SchemaPropertyDetail>\n </template>\n <div\n v-if=\"props.value?.writeOnly\"\n class=\"property-write-only\">\n {{ translate('schema.writeOnly') }}\n </div>\n <div\n v-else-if=\"props.value?.readOnly\"\n class=\"property-read-only\">\n {{ translate('schema.readOnly') }}\n </div>\n <div\n v-if=\"props.required\"\n class=\"property-required\">\n {{ translate('schema.required') }}\n </div>\n <!-- Gated here, not only inside the component: each popup instance installs\n window-level click and keydown listeners for its dismissal, so mounting\n one per row costs the page a listener per row it never shows anything\n for. Same reason `SchemaPropertyPattern` below is gated. -->\n <SchemaPropertyDefault\n v-if=\"props.value?.default !== undefined\"\n :value=\"props.value?.default\" />\n <!--\n Pattern is a hover dropdown chip like Examples, not an inline constraint,\n so it sits beside the example. This keeps the real constraints (length,\n nullable, …) together in the dotted list. See #9966.\n -->\n <SchemaPropertyPattern\n v-if=\"patternValue\"\n :pattern=\"patternValue\" />\n <SchemaPropertyExamples\n v-if=\"props.withExamples && hasExampleContent\"\n :example=\"exampleValue\"\n :examples=\"props.value?.examples\" />\n <!-- The collapsed preview rides the end of the heading line -->\n <slot name=\"preview\" />\n <!-- Last so the tab order matches the visual order: the trailing copy-link\n is painted at the row's right edge, after every control to its left -->\n <slot name=\"trailing\" />\n </div>\n</template>\n<style scoped>\n.property-heading {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n row-gap: 9px;\n white-space: nowrap;\n}\n\n.property-heading:has(+ .children),\n.property-heading:has(+ .property-rule) {\n margin-bottom: 9px;\n}\n\n.property-heading > * {\n margin-right: 9px;\n}\n\n.property-heading:last-child {\n margin-right: 0;\n}\n\n.property-name {\n max-width: 100%;\n font-family: var(--scalar-font-code);\n font-weight: var(--scalar-bold);\n font-size: var(--scalar-font-size-4);\n white-space: normal;\n overflow-wrap: break-word;\n}\n\n.property-additional {\n font-family: var(--scalar-font-code);\n}\n\n.property-required,\n.property-optional {\n color: var(--scalar-color-2);\n}\n\n.property-required {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-orange);\n}\n/*\n * Light-mode oranges are too bright on a light page for 13px text (the default\n * #ff5800 is 3.16:1), so blend the theme orange toward the text colour to reach\n * WCAG 1.4.3 (4.5:1) while keeping the hue and letting custom themes flow\n * through. Dark mode already passes (8.37:1) and keeps the plain token.\n */\n.light-mode .property-required {\n color: color-mix(\n in srgb,\n var(--scalar-color-orange),\n var(--scalar-color-1) 32%\n );\n}\n\n.property-read-only {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-blue);\n}\n\n.property-write-only {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-green);\n}\n\n.property-discriminator {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-purple);\n}\n\n.property-detail {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-2);\n display: flex;\n align-items: center;\n\n min-width: 0;\n}\n\n.property-const {\n color: var(--scalar-color-1);\n}\n\n.deprecated {\n text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// src/schema/SchemaPropertyHeading.vue
|
|
5
|
+
var n = /*#__PURE__*/ t(e, [["__scopeId", "data-v-2f543636"]]);
|
|
6
|
+
export { n as default };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=SchemaPropertyHeading3.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaPropertyHeading3.vue.js","names":["SchemaPropertyHeading_vue_vue_type_script_setup_true_lang_default","_plugin_vue_export_helper_default","SchemaPropertyHeading_default"],"sources":[],"mappings":""}
|
|
@@ -1,8 +1,44 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import e from "./LinkButton.vue.js";
|
|
2
|
+
import { useLocalization as t } from "./localization/index.js";
|
|
3
|
+
import { createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, ref as l, toDisplayString as u, unref as d, withCtx as f } from "vue";
|
|
4
|
+
import { ScalarIcon as p } from "@scalar/components/icon";
|
|
5
|
+
import { useClipboard as m } from "@scalar/use-hooks/useClipboard";
|
|
6
|
+
import { onClickOutside as h, onKeyStroke as g } from "@vueuse/core";
|
|
7
|
+
// src/schema/SchemaPropertyPattern.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var _ = { class: "property-pattern-popup" }, v = ["aria-label"], y = /*@__PURE__*/ o({
|
|
9
|
+
__name: "SchemaPropertyPattern",
|
|
10
|
+
props: { pattern: {} },
|
|
11
|
+
setup(o) {
|
|
12
|
+
let { copyToClipboard: y } = m(), { translate: b } = t(), x = l(null), S = l(!1), C = () => {
|
|
13
|
+
S.value = !S.value;
|
|
14
|
+
}, w = () => {
|
|
15
|
+
S.value = !1;
|
|
16
|
+
};
|
|
17
|
+
return h(x, w), g("Escape", () => {
|
|
18
|
+
S.value && w();
|
|
19
|
+
}), (t, l) => (c(), n("div", {
|
|
20
|
+
ref_key: "rootRef",
|
|
21
|
+
ref: x,
|
|
22
|
+
class: s(["property-pattern", { "is-open": S.value }])
|
|
23
|
+
}, [a(e, {
|
|
24
|
+
class: "decoration-dotted",
|
|
25
|
+
onClick: C
|
|
26
|
+
}, {
|
|
27
|
+
default: f(() => [i(u(d(b)("schema.pattern")), 1)]),
|
|
28
|
+
_: 1
|
|
29
|
+
}), r("div", _, [r("button", {
|
|
30
|
+
"aria-label": `${d(b)("schema.copyPattern")}: ${o.pattern}`,
|
|
31
|
+
class: "property-pattern-value group",
|
|
32
|
+
type: "button",
|
|
33
|
+
onClick: l[0] ||= (e) => d(y)(o.pattern)
|
|
34
|
+
}, [r("code", null, u(o.pattern), 1), a(d(p), {
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
class: "group-hover:text-c-1 text-c-3 ml-auto min-h-3 min-w-3",
|
|
37
|
+
icon: "Clipboard",
|
|
38
|
+
size: "xs"
|
|
39
|
+
})], 8, v)])], 2));
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
export { y as default };
|
|
7
43
|
|
|
8
44
|
//# sourceMappingURL=SchemaPropertyPattern.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaPropertyPattern.vue.js","names":["SchemaPropertyPattern_vue_vue_type_script_setup_true_lang_default","
|
|
1
|
+
{"version":3,"file":"SchemaPropertyPattern.vue.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createVNode","LinkButton","_withCtx","_createTextVNode","_toDisplayString","_unref","_createElementVNode","LinkButton_default","useLocalization","createElementBlock","createElementVNode","createTextVNode","createVNode","defineComponent","normalizeClass","openBlock","ref","toDisplayString","unref","withCtx","ScalarIcon","useClipboard","onClickOutside","onKeyStroke","_hoisted_1","_hoisted_2","SchemaPropertyPattern_vue_vue_type_script_setup_true_lang_default","__props","copyToClipboard","translate","rootRef","isOpen","toggle","close","_ctx","_cache","$event"],"sources":["../../src/schema/SchemaPropertyPattern.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\nimport { onClickOutside, onKeyStroke } from '@vueuse/core'\nimport { ref } from 'vue'\n\nimport LinkButton from './LinkButton.vue'\nimport { useLocalization } from './localization'\n\nconst { pattern } = defineProps<{ pattern: string }>()\n\nconst { copyToClipboard } = useClipboard()\nconst { translate } = useLocalization()\n\n/**\n * The popup reveals on hover and keyboard focus purely via CSS. Touch devices\n * have no hover, so a click/tap also pins it open, and a second click, a click\n * outside, or Escape closes it again. Without this the full pattern was\n * unreachable on mobile — a regression from the old inline (truncated) text.\n */\nconst rootRef = ref<HTMLElement | null>(null)\nconst isOpen = ref(false)\n\nconst toggle = () => {\n isOpen.value = !isOpen.value\n}\n\nconst close = () => {\n isOpen.value = false\n}\n\nonClickOutside(rootRef, close)\nonKeyStroke('Escape', () => {\n if (isOpen.value) {\n close()\n }\n})\n</script>\n<template>\n <div\n ref=\"rootRef\"\n class=\"property-pattern\"\n :class=\"{ 'is-open': isOpen }\">\n <LinkButton\n class=\"decoration-dotted\"\n @click=\"toggle\">\n {{ translate('schema.pattern') }}\n </LinkButton>\n <div class=\"property-pattern-popup\">\n <button\n :aria-label=\"`${translate('schema.copyPattern')}: ${pattern}`\"\n class=\"property-pattern-value group\"\n type=\"button\"\n @click=\"copyToClipboard(pattern)\">\n <code>{{ pattern }}</code>\n <ScalarIcon\n aria-hidden=\"true\"\n class=\"group-hover:text-c-1 text-c-3 ml-auto min-h-3 min-w-3\"\n icon=\"Clipboard\"\n size=\"xs\" />\n </button>\n </div>\n </div>\n</template>\n<style scoped>\n@reference \"../style.css\";\n\n.property-pattern {\n display: flex;\n flex-direction: column;\n font-size: var(--scalar-mini);\n position: relative;\n}\n\n/*\n * Invisible bridge that fills the gap between the label and the popup, so the\n * pointer can travel down into the popup without dropping the `:hover` state.\n * Mirrors the same trick in SchemaPropertyExamples.vue.\n */\n.property-pattern:hover::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 20px;\n border-radius: var(--scalar-radius);\n}\n\n.property-pattern-popup {\n position: absolute;\n top: 18px;\n left: 50%;\n transform: translate3d(-50%, 0, 0);\n background-color: var(--scalar-background-1);\n box-shadow: var(--scalar-shadow-1);\n border-radius: var(--scalar-radius-lg);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n padding: 9px;\n min-width: 200px;\n /* Cap the width so the centered popup never overflows a narrow viewport\n * (mobile, modal). Long patterns wrap instead of widening it. */\n max-width: min(500px, calc(100vw - 32px));\n /* Cap the height too, so a very long multi-line regex scrolls inside the\n * popup instead of running off the bottom of the viewport. */\n max-height: min(400px, calc(100vh - 32px));\n overflow-y: auto;\n display: none;\n @apply z-context;\n}\n\n.property-pattern:hover .property-pattern-popup,\n.property-pattern:focus-within .property-pattern-popup,\n.property-pattern.is-open .property-pattern-popup {\n display: flex;\n}\n\n.property-pattern-value {\n font-family: var(--scalar-font-code);\n display: flex;\n gap: 8px;\n /* Top-align so the copy icon stays with the first line of a wrapped pattern. */\n align-items: flex-start;\n width: 100%;\n padding: 6px;\n background: var(--scalar-background-2);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius);\n}\n\n.property-pattern-value code {\n font-family: var(--scalar-font-code);\n font-size: var(--scalar-font-size-3);\n color: var(--scalar-color-2);\n /* Wrap long regex so the full pattern is readable, not just copyable. */\n white-space: pre-wrap;\n word-break: break-word;\n overflow-wrap: anywhere;\n flex: 1;\n text-align: left;\n}\n</style>\n"],"mappings":";;;;;;;;;;;EAWA,IAAM,EAAE+B,uBAAoBP,EAAa,GACnC,EAAEQ,iBAAcrB,EAAgB,GAQhCsB,IAAUd,EAAwB,IAAI,GACtCe,IAASf,EAAI,EAAK,GAElBgB,UAAe;GACnBD,EAAO,QAAQ,CAACA,EAAO;EACzB,GAEME,UAAc;GAClBF,EAAO,QAAQ;EACjB;E,OAEAT,EAAeQ,GAASG,CAAK,GAC7BV,EAAY,gBAAgB;GACtBQ,EAAO,SACTE,EAAM;EAEV,CAAC,I,UAGCpC,EAAA,GAAAC,EAuBM,OAAA;GAtBA,SAAA;GAAJ,KAAIgC;GACJ,OAAK/B,EAAA,CAAC,oBAAkB,EAAA,WACHgC,EAAA,MAAM,CAAA,CAAA;E,IAC3B/B,EAIaC,GAAA;GAHX,OAAM;GACL,SAAO+B;;GACR,SAAA9B,QAAiC,CAA9BC,EAAAC,EAAAC,EAAAwB,CAAA,CAAS,CAAA,gBAAA,CAAA,GAAA,CAAA,C;;E,IAEdvB,EAaM,OAbNkB,GAaM,CAZJlB,EAWS,UAAA;GAVN,cAAU,GAAKD,EAAAwB,CAAA,CAAS,CAAA,oBAAA,EAAA,IAA2BF,EAAA;GACpD,OAAM;GACN,MAAK;GACJ,SAAKQ,EAAA,QAAAC,MAAE/B,EAAAuB,CAAA,CAAe,CAACD,EAAA,OAAO;E,IAC/BrB,EAA0B,QAAA,MAAAF,EAAjBuB,EAAA,OAAO,GAAA,CAAA,GAChB3B,EAIcK,EAAAe,CAAA,GAAA;GAHZ,eAAY;GACZ,OAAM;GACN,MAAK;GACL,MAAK"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import e from "./SchemaPropertyPattern.vue.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
// src/schema/SchemaPropertyPattern.vue
|
|
5
|
+
var n = /*#__PURE__*/ t(e, [["__scopeId", "data-v-e8f7b07b"]]);
|
|
6
|
+
export { n as default };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=SchemaPropertyPattern3.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaPropertyPattern3.vue.js","names":["SchemaPropertyPattern_vue_vue_type_script_setup_true_lang_default","_plugin_vue_export_helper_default","SchemaPropertyPattern_default"],"sources":[],"mappings":""}
|
|
@@ -1,6 +1,55 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
// src/schema/SchemaRailPanel.vue
|
|
3
|
-
var
|
|
4
|
-
|
|
1
|
+
import { createBlock as e, createCommentVNode as t, createElementBlock as n, defineComponent as r, normalizeStyle as i, onBeforeUnmount as a, openBlock as o, renderSlot as s, resolveDynamicComponent as c, withCtx as l, withModifiers as u } from "vue";
|
|
2
|
+
// src/schema/SchemaRailPanel.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var d = /*@__PURE__*/ r({
|
|
4
|
+
__name: "SchemaRailPanel",
|
|
5
|
+
props: {
|
|
6
|
+
depth: {},
|
|
7
|
+
closeOnRail: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: !1
|
|
10
|
+
},
|
|
11
|
+
as: {
|
|
12
|
+
type: [
|
|
13
|
+
String,
|
|
14
|
+
Object,
|
|
15
|
+
Function
|
|
16
|
+
],
|
|
17
|
+
default: "div"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
emits: ["close"],
|
|
21
|
+
setup(r, { emit: d }) {
|
|
22
|
+
let f = d, p = null, m = () => {
|
|
23
|
+
p?.panel.removeAttribute("data-rail-hovered"), p?.row?.removeAttribute("data-child-rail-hovered"), p = null;
|
|
24
|
+
}, h = (e, t) => {
|
|
25
|
+
if (m(), !t) return;
|
|
26
|
+
let n = e.currentTarget instanceof HTMLElement ? e.currentTarget.parentElement : null;
|
|
27
|
+
if (!n) return;
|
|
28
|
+
let r = n.parentElement;
|
|
29
|
+
n.setAttribute("data-rail-hovered", ""), r?.setAttribute("data-child-rail-hovered", ""), p = {
|
|
30
|
+
panel: n,
|
|
31
|
+
row: r
|
|
32
|
+
};
|
|
33
|
+
}, g = () => {
|
|
34
|
+
m(), f("close");
|
|
35
|
+
};
|
|
36
|
+
return a(m), (a, d) => (o(), e(c(r.as), {
|
|
37
|
+
class: "schema-rail-panel schema-rail rail-hover:border-s-c-1 relative ps-[var(--schema-gutter,16px)]",
|
|
38
|
+
style: i({ "--schema-depth": r.depth })
|
|
39
|
+
}, {
|
|
40
|
+
default: l(() => [r.closeOnRail ? (o(), n("div", {
|
|
41
|
+
key: 0,
|
|
42
|
+
"aria-hidden": "true",
|
|
43
|
+
class: "rail-hit z-[1]",
|
|
44
|
+
"data-rail-hit": "",
|
|
45
|
+
onClick: u(g, ["stop"]),
|
|
46
|
+
onPointerenter: d[0] ||= (e) => h(e, !0),
|
|
47
|
+
onPointerleave: d[1] ||= (e) => h(e, !1)
|
|
48
|
+
}, null, 32)) : t("", !0), s(a.$slots, "default")]),
|
|
49
|
+
_: 3
|
|
50
|
+
}, 8, ["style"]));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
export { d as default };
|
|
5
54
|
|
|
6
55
|
//# sourceMappingURL=SchemaRailPanel.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaRailPanel.vue.js","names":["SchemaRailPanel_vue_vue_type_script_setup_true_lang_default","
|
|
1
|
+
{"version":3,"file":"SchemaRailPanel.vue.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_normalizeStyle","_withCtx","_createElementBlock","_withModifiers","_renderSlot","createBlock","createCommentVNode","createElementBlock","defineComponent","normalizeStyle","onBeforeUnmount","openBlock","renderSlot","resolveDynamicComponent","withCtx","withModifiers","SchemaRailPanel_vue_vue_type_script_setup_true_lang_default","__props","__emit","emit","hovered","clearRailHover","setRailHover","event","on","panel","row","onStripClick","_ctx","_cache","$event"],"sources":["../../src/schema/SchemaRailPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, type Component } from 'vue'\n\n/**\n * The railed panel of the schema tree: an expanded row's children behind a rail\n * that fades with depth. See the indentation model in SchemaProperty.vue.\n *\n * `--schema-depth` must stay inline on the element itself: the `schema-rail`\n * utility reads it for the fade. No margins of its own, because each surface\n * that joins the tree spaces its panel differently.\n */\nconst {\n depth,\n closeOnRail = false,\n as = 'div',\n} = defineProps<{\n /** Nesting depth of the panel, driving how far the rail fades */\n depth: number\n /** Render the pointer strip over the rail that closes the panel on click */\n closeOnRail?: boolean\n /** Panel root element or component, so a headless-ui DisclosurePanel can keep the rail recipe */\n as?: string | Component\n}>()\n\nconst emit = defineEmits<{\n (e: 'close'): void\n}>()\n\n/**\n * A hovered strip colours this panel's rail and lights the puck of the control\n * that owns the panel. Both used to be `:has(... :hover)` selectors, which made\n * every railed row a `:has()` invalidation anchor, so each element inserted\n * under an open row restyled its whole subtree. The strip's pointer events now\n * write the same state as attributes that exist only while it is hovered:\n * `data-rail-hovered` on the panel root and `data-child-rail-hovered` on the\n * panel's parent, the element the tailwind.config.css variants look through to\n * the control. Read off DOM adjacency exactly like the selectors they replace,\n * so every surface that rails a panel is covered without wiring.\n */\nlet hovered: { panel: HTMLElement; row: HTMLElement | null } | null = null\n\nconst clearRailHover = (): void => {\n hovered?.panel.removeAttribute('data-rail-hovered')\n hovered?.row?.removeAttribute('data-child-rail-hovered')\n hovered = null\n}\n\nconst setRailHover = (event: Event, on: boolean): void => {\n clearRailHover()\n\n if (!on) {\n return\n }\n\n const panel =\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget.parentElement\n : null\n\n if (!panel) {\n return\n }\n\n const row = panel.parentElement\n panel.setAttribute('data-rail-hovered', '')\n row?.setAttribute('data-child-rail-hovered', '')\n hovered = { panel, row }\n}\n\n/**\n * Folding the panel hides the strip under the pointer, so no pointerleave ever\n * follows the click: the marks go before the close, or the puck stays lit.\n */\nconst onStripClick = (): void => {\n clearRailHover()\n emit('close')\n}\n\n/* The strip also disappears without a pointerleave when the panel unmounts,\n and the parent row it marked outlives it. */\nonBeforeUnmount(clearRailHover)\n</script>\n<template>\n <component\n :is=\"as\"\n class=\"schema-rail-panel schema-rail rail-hover:border-s-c-1 relative ps-[var(--schema-gutter,16px)]\"\n :style=\"{ '--schema-depth': depth }\">\n <!-- Pointer-only strip along the rail that folds the panel; hidden from\n assistive tech because the row's own toggle is the accessible control. -->\n <div\n v-if=\"closeOnRail\"\n aria-hidden=\"true\"\n class=\"rail-hit z-[1]\"\n data-rail-hit\n @click.stop=\"onStripClick\"\n @pointerenter=\"setRailHover($event, true)\"\n @pointerleave=\"setRailHover($event, false)\" />\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAwBA,IAAMsB,IAAOD,GAeTE,IAAkE,MAEhEC,UAA6B;GACjCD,GAAS,MAAM,gBAAgB,mBAAmB,GAClDA,GAAS,KAAK,gBAAgB,yBAAyB,GACvDA,IAAU;EACZ,GAEME,KAAgBC,GAAcC,MAAsB;GAGxD,IAFAH,EAAe,GAEX,CAACG,GACH;GAGF,IAAMC,IACJF,EAAM,yBAAyB,cAC3BA,EAAM,cAAc,gBACpB;GAEN,IAAI,CAACE,GACH;GAGF,IAAMC,IAAMD,EAAM;GAClBA,EAAM,aAAa,qBAAqB,EAAE,GAC1CC,GAAK,aAAa,2BAA2B,EAAE,GAC/CN,IAAU;IAAEK;IAAOC;GAAI;EACzB,GAMMC,UAA2B;GAC/BN,EAAe,GACfF,EAAK,OAAO;EACd;E,OAIAT,EAAgBW,CAAc,I,UAG5BxB,EAAA,GAAAC,EAeYC,EAdLkB,EAAA,EAAE,GAAA;GACP,OAAM;GACL,OAAKjB,EAAA,EAAA,kBAAsBiB,EAAA,MAAK,CAAA;;GAGjC,SAAAhB,QAOgD,CANxCgB,EAAA,eADRpB,EAAA,GAAAK,EAOgD,OAAA;;IAL9C,eAAY;IACZ,OAAM;IACN,iBAAA;IACC,SAAKC,EAAOwB,GAAY,CAAA,MAAA,CAAA;IACxB,gBAAYE,EAAA,QAAAC,MAAER,EAAaQ,GAAM,EAAA;IACjC,gBAAYD,EAAA,QAAAC,MAAER,EAAaQ,GAAM,EAAA;G,2BACpC1B,EAAQwB,EAAA,QAAA,SAAA,C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaRailPanel2.vue.js","names":["SchemaRailPanel_vue_vue_type_script_setup_true_lang_default","SchemaRailPanel_default"],"sources":[],"mappings":""}
|
|
@@ -1,6 +1,26 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { useLocalization as e } from "../localization/index.js";
|
|
2
|
+
import { computed as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, openBlock as s, renderSlot as c, toDisplayString as l, unref as u } from "vue";
|
|
3
|
+
import { ScalarIconHash as d } from "@scalar/icons";
|
|
4
|
+
// src/schema/components/CopyLinkButton.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var f = { class: "sr-only" }, p = /*@__PURE__*/ o({
|
|
6
|
+
__name: "CopyLinkButton",
|
|
7
|
+
props: {
|
|
8
|
+
anchorId: {},
|
|
9
|
+
propertyName: {},
|
|
10
|
+
eventBus: {}
|
|
11
|
+
},
|
|
12
|
+
setup(o) {
|
|
13
|
+
let { translate: p } = e(), m = t(() => p("actions.copyLinkTo", { name: o.propertyName }));
|
|
14
|
+
return (e, t) => (s(), n("button", {
|
|
15
|
+
class: "copy-link-trailing text-c-3 hover:text-c-1 -my-1.25 ms-1.25! -me-1.25! flex shrink-0 cursor-pointer items-center justify-center self-center p-1.25 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 pointer-coarse:hidden",
|
|
16
|
+
type: "button",
|
|
17
|
+
onClick: t[0] ||= () => o.eventBus?.emit("copy-url:nav-item", { id: o.anchorId })
|
|
18
|
+
}, [a(u(d), {
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
class: "size-3.5"
|
|
21
|
+
}), r("span", f, [c(e.$slots, "sr-label", {}, () => [i(l(m.value), 1)])])]));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export { p as default };
|
|
5
25
|
|
|
6
26
|
//# sourceMappingURL=CopyLinkButton.vue.js.map
|