@scalar/blocks 0.7.3 → 0.8.0
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 +29 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +1 -2
- package/dist/code-example/components/AsyncApiCodeExample.vue.js +1 -2
- package/dist/code-example/components/AsyncApiCodeExample.vue.js.map +1 -1
- package/dist/code-example/components/AsyncApiCodeExample.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/code-example/components/AsyncApiCodeExample.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/code-example/components/CodeExample.vue.d.ts +2 -0
- package/dist/code-example/components/CodeExample.vue.d.ts.map +1 -1
- package/dist/code-example/components/CodeExample.vue.js +4 -5
- package/dist/code-example/components/CodeExample.vue.js.map +1 -1
- package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js +102 -100
- package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/code-example/components/ExamplePicker.vue.js +1 -2
- package/dist/code-example/components/ExamplePicker.vue.js.map +1 -1
- package/dist/code-example/components/ExamplePicker.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/code-example/components/HttpMethod.vue.js +1 -2
- package/dist/code-example/components/HttpMethod.vue.js.map +1 -1
- package/dist/code-example/components/HttpMethod.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/code-example/helpers/filter-clients-by-query.js +1 -2
- package/dist/code-example/helpers/find-client.js +1 -2
- package/dist/code-example/helpers/format-language.js +1 -2
- package/dist/code-example/helpers/generate-client-options.js +1 -2
- package/dist/code-example/helpers/generate-code-snippet.d.ts +2 -1
- package/dist/code-example/helpers/generate-code-snippet.d.ts.map +1 -1
- package/dist/code-example/helpers/generate-code-snippet.js +11 -11
- package/dist/code-example/helpers/generate-code-snippet.js.map +1 -1
- package/dist/code-example/helpers/get-asyncapi-example-context.js +1 -2
- package/dist/code-example/helpers/get-clients.js +8 -9
- package/dist/code-example/helpers/get-custom-code-samples.js +1 -2
- package/dist/code-example/helpers/get-generated-payload-example.js +1 -2
- package/dist/code-example/helpers/get-message-example-content.js +1 -2
- package/dist/code-example/helpers/get-secrets.js +1 -2
- package/dist/code-example/helpers/get-snippet.js +1 -2
- package/dist/code-example/helpers/operation-to-har/operation-to-har.d.ts +2 -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 +32 -31
- 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 +80 -52
- 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 +2 -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 +65 -58
- 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.d.ts.map +1 -1
- package/dist/code-example/helpers/operation-to-har/process-security-schemes.js +31 -28
- 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 +1 -2
- package/dist/code-example/index.js +10 -10
- package/dist/code-example/mount-asyncapi.js +7 -8
- package/dist/code-example/mount.js +5 -6
- package/dist/constants.js +2 -3
- package/dist/schema/LinkButton.vue.js +1 -2
- package/dist/schema/RenderString.vue.js +1 -2
- package/dist/schema/RenderString.vue.js.map +1 -1
- package/dist/schema/RenderString.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/schema/Schema.vue.js +4 -5
- package/dist/schema/Schema.vue.js.map +1 -1
- package/dist/schema/Schema.vue_vue_type_script_setup_true_lang.js +67 -68
- package/dist/schema/Schema.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaCollapsedPreview.vue.js +1 -2
- package/dist/schema/SchemaCollapsedPreview.vue.js.map +1 -1
- package/dist/schema/SchemaCollapsedPreview.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/schema/SchemaCollapsedPreview.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaComposition.vue.js +4 -5
- package/dist/schema/SchemaComposition.vue.js.map +1 -1
- package/dist/schema/SchemaComposition.vue_vue_type_script_setup_true_lang.js +26 -27
- package/dist/schema/SchemaComposition.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaEnumPropertyItem.vue.js +1 -2
- package/dist/schema/SchemaEnumPropertyItem.vue.js.map +1 -1
- package/dist/schema/SchemaEnumPropertyItem.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/schema/SchemaEnumPropertyItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaEnums.vue.js +4 -5
- package/dist/schema/SchemaEnums.vue.js.map +1 -1
- package/dist/schema/SchemaEnums.vue_vue_type_script_setup_true_lang.js +12 -13
- package/dist/schema/SchemaEnums.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaGlyphPuck.vue.js +1 -2
- package/dist/schema/SchemaGlyphPuck.vue.js.map +1 -1
- package/dist/schema/SchemaGlyphPuck.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/schema/SchemaGutterToggle.vue.js +1 -2
- package/dist/schema/SchemaGutterToggle.vue.js.map +1 -1
- package/dist/schema/SchemaGutterToggle.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/schema/SchemaHeading.vue.js +4 -5
- package/dist/schema/SchemaHeading.vue.js.map +1 -1
- package/dist/schema/SchemaHeading.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/schema/SchemaHeading.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaObjectExampleCodeBlock.vue.js +1 -2
- package/dist/schema/SchemaObjectExampleCodeBlock.vue.js.map +1 -1
- package/dist/schema/SchemaObjectExampleCodeBlock.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/schema/SchemaObjectExampleCodeBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaObjectProperties.vue.js +1 -2
- package/dist/schema/SchemaObjectProperties.vue.js.map +1 -1
- package/dist/schema/SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/schema/SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaProperty.vue.js +4 -5
- package/dist/schema/SchemaProperty.vue.js.map +1 -1
- package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js +48 -49
- package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaPropertyDefault.vue.js +4 -5
- package/dist/schema/SchemaPropertyDefault.vue.js.map +1 -1
- package/dist/schema/SchemaPropertyDefault.vue_vue_type_script_setup_true_lang.js +9 -10
- package/dist/schema/SchemaPropertyDefault.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaPropertyDetail.vue.js +4 -5
- package/dist/schema/SchemaPropertyDetail.vue.js.map +1 -1
- package/dist/schema/SchemaPropertyDetail.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/schema/SchemaPropertyDetail.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaPropertyExamples.vue.js +4 -5
- package/dist/schema/SchemaPropertyExamples.vue.js.map +1 -1
- package/dist/schema/SchemaPropertyExamples.vue_vue_type_script_setup_true_lang.js +18 -19
- package/dist/schema/SchemaPropertyExamples.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaPropertyHeading.vue.js +4 -5
- package/dist/schema/SchemaPropertyHeading.vue.js.map +1 -1
- package/dist/schema/SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js +101 -102
- package/dist/schema/SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaPropertyPattern.vue.js +4 -5
- package/dist/schema/SchemaPropertyPattern.vue.js.map +1 -1
- package/dist/schema/SchemaPropertyPattern.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/schema/SchemaRailPanel.vue.js +1 -2
- package/dist/schema/SchemaRailPanel.vue.js.map +1 -1
- package/dist/schema/SchemaRailPanel.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/schema/SchemaRailPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/components/CopyLinkButton.vue.js +1 -2
- package/dist/schema/components/CopyLinkButton.vue.js.map +1 -1
- package/dist/schema/components/CopyLinkButton.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/schema/components/WithBreadcrumb.vue.js +1 -2
- package/dist/schema/components/WithBreadcrumb.vue.js.map +1 -1
- package/dist/schema/components/WithBreadcrumb.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/schema/discriminator-metadata.js +1 -2
- package/dist/schema/helpers/dynamic-scope.js +1 -2
- package/dist/schema/helpers/format-example.js +1 -2
- package/dist/schema/helpers/format-value.js +1 -2
- package/dist/schema/helpers/get-compositions-to-render.js +19 -20
- package/dist/schema/helpers/get-discriminator-values.js +1 -2
- package/dist/schema/helpers/get-enum-values.js +1 -2
- package/dist/schema/helpers/get-property-description.js +1 -2
- package/dist/schema/helpers/get-ref-name.js +1 -2
- package/dist/schema/helpers/get-rendered-example.js +1 -2
- package/dist/schema/helpers/get-schema-type.js +1 -2
- package/dist/schema/helpers/get-type-signature-tokens.d.ts +2 -2
- package/dist/schema/helpers/get-type-signature-tokens.d.ts.map +1 -1
- package/dist/schema/helpers/get-type-signature-tokens.js +3 -4
- package/dist/schema/helpers/get-type-signature-tokens.js.map +1 -1
- package/dist/schema/helpers/has-complex-array-items.js +1 -2
- package/dist/schema/helpers/index.js +13 -13
- package/dist/schema/helpers/is-empty-schema-object.js +1 -2
- package/dist/schema/helpers/is-model-linkable.js +1 -2
- package/dist/schema/helpers/is-on-schema-target-path.js +1 -2
- package/dist/schema/helpers/is-type-object.js +1 -2
- package/dist/schema/helpers/merge-all-of-schemas.js +1 -2
- package/dist/schema/helpers/normalize-object-composition.js +1 -2
- package/dist/schema/helpers/optimize-value-for-display.js +1 -2
- package/dist/schema/helpers/partition-all-of-compositions.js +1 -2
- package/dist/schema/helpers/schema-composition.js +1 -2
- package/dist/schema/helpers/schema-cycle.js +1 -2
- package/dist/schema/helpers/schema-expansion.js +1 -2
- package/dist/schema/helpers/schema-keyboard-nav.js +1 -2
- package/dist/schema/helpers/schema-name.js +2 -3
- package/dist/schema/helpers/schema-name.js.map +1 -1
- package/dist/schema/helpers/should-display-description.js +1 -2
- package/dist/schema/helpers/should-display-heading.js +1 -2
- package/dist/schema/helpers/should-render-array-item-composition.js +1 -2
- package/dist/schema/helpers/sort-property-names.js +1 -2
- package/dist/schema/helpers/unwrap-for-read.js +1 -2
- package/dist/schema/index.js +8 -8
- package/dist/schema/localization/index.js +1 -2
- package/dist/schema/localization/locales/ar.js +1 -2
- package/dist/schema/localization/locales/de.js +1 -2
- package/dist/schema/localization/locales/en.js +1 -2
- package/dist/schema/localization/locales/es.js +1 -2
- package/dist/schema/localization/locales/fr.js +1 -2
- package/dist/schema/localization/locales/pt.js +1 -2
- package/dist/schema/localization/locales/ru.js +1 -2
- package/dist/schema/localization/locales/zh-cn.js +1 -2
- package/dist/schema/localization/locales/zh-tw.js +1 -2
- package/dist/schema/localization/translations.js +1 -2
- package/dist/schema/protobuf-metadata.js +1 -2
- package/dist/schema/recursive-metadata.js +1 -2
- package/dist/schema/request-body-composition-index.js +1 -2
- package/dist/shared/Badge.vue.d.ts.map +1 -1
- package/dist/shared/Badge.vue.js +4 -5
- package/dist/shared/Badge.vue.js.map +1 -1
- package/dist/shared/Badge.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/shared/Badge.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/shared/ExternalDocs.vue.js +1 -2
- package/dist/shared/ExternalDocs.vue.js.map +1 -1
- package/dist/shared/ExternalDocs.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/shared/ExternalDocs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/shared/ScreenReader.vue.js +1 -2
- package/dist/shared/ScreenReader.vue.js.map +1 -1
- package/dist/shared/ScreenReader.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/shared/index.js +4 -4
- package/dist/specification-extensions/ExtensionValue.vue.js +1 -2
- package/dist/specification-extensions/ExtensionValue.vue.js.map +1 -1
- package/dist/specification-extensions/ExtensionValue.vue_vue_type_script_setup_true_lang.js +5 -6
- package/dist/specification-extensions/ExtensionValue.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/specification-extensions/SpecificationExtensions.vue.js +1 -2
- package/dist/specification-extensions/SpecificationExtensions.vue.js.map +1 -1
- package/dist/specification-extensions/SpecificationExtensions.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/specification-extensions/SpecificationExtensions.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/style.css +42 -22
- package/dist/vue-styles.css +1 -1
- package/package.json +24 -24
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { schemaDiscriminator as e } from "../discriminator-metadata.js";
|
|
2
2
|
import { compositions as t } from "./schema-composition.js";
|
|
3
3
|
import { resolve as n } from "@scalar/workspace-store/resolve";
|
|
4
|
-
|
|
4
|
+
// src/schema/helpers/optimize-value-for-display.ts
|
|
5
5
|
function r(...e) {
|
|
6
6
|
let t = {}, n = {}, r = /* @__PURE__ */ new Set(), i = !1, a = !1;
|
|
7
7
|
for (let o of e) if (o) {
|
|
@@ -55,7 +55,6 @@ function i(i) {
|
|
|
55
55
|
}
|
|
56
56
|
return { ...i };
|
|
57
57
|
}
|
|
58
|
-
//#endregion
|
|
59
58
|
export { i as optimizeValueForDisplay };
|
|
60
59
|
|
|
61
60
|
//# sourceMappingURL=optimize-value-for-display.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mergeAllOfSchemas as e } from "./merge-all-of-schemas.js";
|
|
2
2
|
import { getResolvedRef as t } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
3
|
import { resolve as n } from "@scalar/workspace-store/resolve";
|
|
4
|
-
|
|
4
|
+
// src/schema/helpers/partition-all-of-compositions.ts
|
|
5
5
|
var r = ["oneOf", "anyOf"], i = (e, a, o) => {
|
|
6
6
|
let s = t(e);
|
|
7
7
|
if (typeof s == "boolean") {
|
|
@@ -73,7 +73,6 @@ var r = ["oneOf", "anyOf"], i = (e, a, o) => {
|
|
|
73
73
|
}));
|
|
74
74
|
return v(), { segments: h };
|
|
75
75
|
};
|
|
76
|
-
//#endregion
|
|
77
76
|
export { a as partitionAllOfCompositions };
|
|
78
77
|
|
|
79
78
|
//# sourceMappingURL=partition-all-of-compositions.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/helpers/schema-cycle.ts
|
|
2
2
|
var e = Symbol("schema-ancestors"), t = (e) => {
|
|
3
3
|
if (e && typeof e == "object") return "$ref" in e && typeof e.$ref == "string" ? e.$ref : e;
|
|
4
4
|
};
|
|
5
|
-
//#endregion
|
|
6
5
|
export { e as SCHEMA_ANCESTORS_SYMBOL, t as getCycleKey };
|
|
7
6
|
|
|
8
7
|
//# sourceMappingURL=schema-cycle.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isOnSchemaTargetPath as e } from "./is-on-schema-target-path.js";
|
|
2
2
|
import { nextTick as t, onBeforeUnmount as n, onMounted as r, shallowReactive as i, shallowRef as a, watch as o } from "vue";
|
|
3
|
-
|
|
3
|
+
// src/schema/helpers/schema-expansion.ts
|
|
4
4
|
var s = (e, t) => t === "" || e === t || e.startsWith(`${t}.`), c = (e) => e?.join(".") ?? "", l = 300, u = (n = a("")) => {
|
|
5
5
|
let r = i(/* @__PURE__ */ new Map()), o = i(/* @__PURE__ */ new Map()), c = a("default"), u = (e) => {
|
|
6
6
|
if (o.size === 0) return;
|
|
@@ -86,7 +86,6 @@ var s = (e, t) => t === "" || e === t || e.startsWith(`${t}.`), c = (e) => e?.jo
|
|
|
86
86
|
});
|
|
87
87
|
}), t;
|
|
88
88
|
};
|
|
89
|
-
//#endregion
|
|
90
89
|
export { d as SCHEMA_TREE_ROOT_SYMBOL, u as createSchemaExpansionStore, c as toNodeKey, f as useSchemaExpansion };
|
|
91
90
|
|
|
92
91
|
//# sourceMappingURL=schema-expansion.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/helpers/schema-keyboard-nav.ts
|
|
2
2
|
var e = (e) => [...e.querySelectorAll("[data-schema-toggle]")].filter((e) => e.offsetParent !== null && !e.closest("[hidden]")), t = (e) => e.closest(".property-children")?.closest(".property--tree")?.querySelector(":scope > [data-schema-toggle]") ?? null, n = (e) => e.closest(".property--tree")?.querySelector(":scope > .property-children [data-schema-toggle]") ?? null, r = (r) => {
|
|
3
3
|
let i = r.target;
|
|
4
4
|
if (r.defaultPrevented || !(i instanceof HTMLElement) || !i.hasAttribute("data-schema-toggle") || r.altKey || r.ctrlKey || r.metaKey || r.shiftKey) return;
|
|
@@ -30,7 +30,6 @@ var e = (e) => [...e.querySelectorAll("[data-schema-toggle]")].filter((e) => e.o
|
|
|
30
30
|
}
|
|
31
31
|
r.preventDefault();
|
|
32
32
|
};
|
|
33
|
-
//#endregion
|
|
34
33
|
export { r as handleTreeKeydown };
|
|
35
34
|
|
|
36
35
|
//# sourceMappingURL=schema-keyboard-nav.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRefName as e, getSchemaRefName as t } from "./get-ref-name.js";
|
|
2
2
|
import { resolve as n } from "@scalar/workspace-store/resolve";
|
|
3
3
|
import { isArraySchema as r } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
|
|
4
|
-
|
|
4
|
+
// src/schema/helpers/schema-name.ts
|
|
5
5
|
var i = (r) => {
|
|
6
6
|
if (!r || typeof r != "object") return null;
|
|
7
7
|
let i = n.schema(r), a = "$ref" in r ? t(r.$ref) : null;
|
|
@@ -25,7 +25,7 @@ var i = (r) => {
|
|
|
25
25
|
let t = i(e);
|
|
26
26
|
if (t) return t;
|
|
27
27
|
let a = n.schema(e);
|
|
28
|
-
if (r(a) && a.items) {
|
|
28
|
+
if (r(a) && a.items && typeof a.items == "object") {
|
|
29
29
|
let e = i(a.items);
|
|
30
30
|
if (e) return {
|
|
31
31
|
schemaKey: e.schemaKey,
|
|
@@ -34,7 +34,6 @@ var i = (r) => {
|
|
|
34
34
|
}
|
|
35
35
|
return null;
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
export { i as getModelNameFromSchema, a as getModelNameWithArray };
|
|
39
38
|
|
|
40
39
|
//# sourceMappingURL=schema-name.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-name.js","names":["getModelNameFromSchema","schemaOrRef","schema","resolve","schemaKey","getSchemaRefName","label","getRefName","getModelNameWithArray","direct","isArraySchema","itemName"],"sources":["../../../src/schema/helpers/schema-name.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject, SchemaReferenceType } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\nimport { getRefName, getSchemaRefName } from './get-ref-name'\n\ntype SchemaModelName = {\n /**\n * The key in `components.schemas` (extracted from `$ref`), used for sidebar\n * navigation. Only set when the `$ref` actually targets\n * `#/components/schemas/`; `null` for refs into other component buckets or\n * external files, so those never render a dead link.\n */\n schemaKey: string | null\n /** The human-readable name to display (schema.title, schema.name, or ref key). */\n label: string\n}\n\n/**\n * Extract schema name from various schema formats\n *\n * Handles $ref, title, name, type, and schema dictionary lookup\n */\nexport const getModelNameFromSchema = (\n schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>,\n): SchemaModelName | null => {\n if (!schemaOrRef || typeof schemaOrRef !== 'object') {\n return null\n }\n\n const schema = resolve.schema(schemaOrRef)\n\n // Only refs into `#/components/schemas/` are navigable in the models section.\n const schemaKey = '$ref' in schemaOrRef ? getSchemaRefName(schemaOrRef.$ref) : null\n\n if (schema.title) {\n return { schemaKey, label: schema.title }\n }\n\n if (schema.name) {\n return { schemaKey, label: schema.name }\n }\n\n if ('$ref' in schemaOrRef) {\n // Fall back to the last ref segment as a display label, even for\n // non-schema refs. The name still shows, it just is not a link.\n const label = getRefName(schemaOrRef.$ref)\n if (label) {\n return { schemaKey, label }\n }\n }\n\n return null\n}\n\n/**\n * Model name for a schema, resolving array branches too: an inline\n * `{ type: 'array', items: { $ref: Model } }` becomes `Model[]` instead of the\n * structural `array object[]`. Returns `null` when no model name applies (for\n * example an array of primitives), so callers can fall back to `getSchemaType`.\n */\nexport const getModelNameWithArray = (\n schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>,\n): SchemaModelName | null => {\n const direct = getModelNameFromSchema(schemaOrRef)\n if (direct) {\n return direct\n }\n\n const schema = resolve.schema(schemaOrRef)\n if (isArraySchema(schema) && schema.items) {\n const itemName = getModelNameFromSchema(schema.items)\n if (itemName) {\n return { schemaKey: itemName.schemaKey, label: `${itemName.label}[]` }\n }\n }\n\n return null\n}\n"],"mappings":";;;;AAuBA,IAAaA,KACX,MAC2B;CAC3B,IAAI,CAACC,KAAe,OAAOA,KAAgB,UACzC,OAAO;CAGT,IAAMC,IAASC,EAAQ,OAAOF,CAAW,GAGnCG,IAAY,UAAUH,IAAcI,EAAiBJ,EAAY,IAAI,IAAI;CAE/E,IAAIC,EAAO,OACT,OAAO;EAAE;EAAW,OAAOA,EAAO;CAAM;CAG1C,IAAIA,EAAO,MACT,OAAO;EAAE;EAAW,OAAOA,EAAO;CAAK;CAGzC,IAAI,UAAUD,GAAa;EAGzB,IAAMK,IAAQC,EAAWN,EAAY,IAAI;EACzC,IAAIK,GACF,OAAO;GAAE;GAAW;EAAM;CAE9B;CAEA,OAAO;AACT,GAQaE,KACX,MAC2B;CAC3B,IAAMC,IAAST,EAAuBC,CAAW;CACjD,IAAIQ,GACF,OAAOA;CAGT,IAAMP,IAASC,EAAQ,OAAOF,CAAW;CACzC,IAAIS,EAAcR,CAAM,KAAKA,EAAO,
|
|
1
|
+
{"version":3,"file":"schema-name.js","names":["getModelNameFromSchema","schemaOrRef","schema","resolve","schemaKey","getSchemaRefName","label","getRefName","getModelNameWithArray","direct","isArraySchema","itemName"],"sources":["../../../src/schema/helpers/schema-name.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject, SchemaReferenceType } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\nimport { getRefName, getSchemaRefName } from './get-ref-name'\n\ntype SchemaModelName = {\n /**\n * The key in `components.schemas` (extracted from `$ref`), used for sidebar\n * navigation. Only set when the `$ref` actually targets\n * `#/components/schemas/`; `null` for refs into other component buckets or\n * external files, so those never render a dead link.\n */\n schemaKey: string | null\n /** The human-readable name to display (schema.title, schema.name, or ref key). */\n label: string\n}\n\n/**\n * Extract schema name from various schema formats\n *\n * Handles $ref, title, name, type, and schema dictionary lookup\n */\nexport const getModelNameFromSchema = (\n schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>,\n): SchemaModelName | null => {\n if (!schemaOrRef || typeof schemaOrRef !== 'object') {\n return null\n }\n\n const schema = resolve.schema(schemaOrRef)\n\n // Only refs into `#/components/schemas/` are navigable in the models section.\n const schemaKey = '$ref' in schemaOrRef ? getSchemaRefName(schemaOrRef.$ref) : null\n\n if (schema.title) {\n return { schemaKey, label: schema.title }\n }\n\n if (schema.name) {\n return { schemaKey, label: schema.name }\n }\n\n if ('$ref' in schemaOrRef) {\n // Fall back to the last ref segment as a display label, even for\n // non-schema refs. The name still shows, it just is not a link.\n const label = getRefName(schemaOrRef.$ref)\n if (label) {\n return { schemaKey, label }\n }\n }\n\n return null\n}\n\n/**\n * Model name for a schema, resolving array branches too: an inline\n * `{ type: 'array', items: { $ref: Model } }` becomes `Model[]` instead of the\n * structural `array object[]`. Returns `null` when no model name applies (for\n * example an array of primitives), so callers can fall back to `getSchemaType`.\n */\nexport const getModelNameWithArray = (\n schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>,\n): SchemaModelName | null => {\n const direct = getModelNameFromSchema(schemaOrRef)\n if (direct) {\n return direct\n }\n\n const schema = resolve.schema(schemaOrRef)\n if (isArraySchema(schema) && schema.items && typeof schema.items === 'object') {\n const itemName = getModelNameFromSchema(schema.items)\n if (itemName) {\n return { schemaKey: itemName.schemaKey, label: `${itemName.label}[]` }\n }\n }\n\n return null\n}\n"],"mappings":";;;;AAuBA,IAAaA,KACX,MAC2B;CAC3B,IAAI,CAACC,KAAe,OAAOA,KAAgB,UACzC,OAAO;CAGT,IAAMC,IAASC,EAAQ,OAAOF,CAAW,GAGnCG,IAAY,UAAUH,IAAcI,EAAiBJ,EAAY,IAAI,IAAI;CAE/E,IAAIC,EAAO,OACT,OAAO;EAAE;EAAW,OAAOA,EAAO;CAAM;CAG1C,IAAIA,EAAO,MACT,OAAO;EAAE;EAAW,OAAOA,EAAO;CAAK;CAGzC,IAAI,UAAUD,GAAa;EAGzB,IAAMK,IAAQC,EAAWN,EAAY,IAAI;EACzC,IAAIK,GACF,OAAO;GAAE;GAAW;EAAM;CAE9B;CAEA,OAAO;AACT,GAQaE,KACX,MAC2B;CAC3B,IAAMC,IAAST,EAAuBC,CAAW;CACjD,IAAIQ,GACF,OAAOA;CAGT,IAAMP,IAASC,EAAQ,OAAOF,CAAW;CACzC,IAAIS,EAAcR,CAAM,KAAKA,EAAO,SAAS,OAAOA,EAAO,SAAU,UAAU;EAC7E,IAAMS,IAAWX,EAAuBE,EAAO,KAAK;EACpD,IAAIS,GACF,OAAO;GAAE,WAAWA,EAAS;GAAW,OAAO,GAAGA,EAAS,MAAM;EAAI;CAEzE;CAEA,OAAO;AACT"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/helpers/should-display-description.ts
|
|
2
2
|
var e = (e, t) => !e || e.allOf ? null : t && e.description ? t === e.description ? t : `${t}\n\n${e.description}` : t || e.description || null;
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as shouldDisplayDescription };
|
|
5
4
|
|
|
6
5
|
//# sourceMappingURL=should-display-description.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/helpers/should-display-heading.ts
|
|
2
2
|
var e = (e, t, n = !1) => t || n ? !0 : e ? e.deprecated === !0 || e.const !== void 0 || e.enum?.length === 1 || "type" in e && e.type !== void 0 || "nullable" in e && e.nullable === !0 || e.writeOnly === !0 || e.readOnly === !0 : !1;
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as shouldDisplayHeading };
|
|
5
4
|
|
|
6
5
|
//# sourceMappingURL=should-display-heading.js.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { hasComplexArrayItems as e } from "./has-complex-array-items.js";
|
|
2
2
|
import { isArraySchema as t } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
|
|
3
|
-
|
|
3
|
+
// src/schema/helpers/should-render-array-item-composition.ts
|
|
4
4
|
var n = (n, r) => {
|
|
5
5
|
if (!n || !t(n)) return !1;
|
|
6
6
|
let i = n.items;
|
|
7
7
|
return !i || typeof i != "object" || !(r in i) ? !1 : !e(n);
|
|
8
8
|
};
|
|
9
|
-
//#endregion
|
|
10
9
|
export { n as shouldRenderArrayItemComposition };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=should-render-array-item-composition.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isTypeObject as e } from "./is-type-object.js";
|
|
2
2
|
import { resolve as t } from "@scalar/workspace-store/resolve";
|
|
3
|
-
|
|
3
|
+
// src/schema/helpers/sort-property-names.ts
|
|
4
4
|
var n = (e, t) => e.reduce((e, n) => {
|
|
5
5
|
let r = t?.[n];
|
|
6
6
|
return r && (e[n] = r), e;
|
|
@@ -49,7 +49,6 @@ var n = (e, t) => e.reduce((e, n) => {
|
|
|
49
49
|
names: b
|
|
50
50
|
}]]))), b;
|
|
51
51
|
};
|
|
52
|
-
//#endregion
|
|
53
52
|
export { n as reduceNamesToObject, o as sortPropertyNames };
|
|
54
53
|
|
|
55
54
|
//# sourceMappingURL=sort-property-names.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { toRaw as e } from "vue";
|
|
2
2
|
import { unpackDetectChangesProxy as t } from "@scalar/workspace-store/helpers/detect-changes-proxy";
|
|
3
|
-
|
|
3
|
+
// src/schema/helpers/unwrap-for-read.ts
|
|
4
4
|
var n = (n) => t(e(n));
|
|
5
|
-
//#endregion
|
|
6
5
|
export { n as unwrapForRead };
|
|
7
6
|
|
|
8
7
|
//# sourceMappingURL=unwrap-for-read.js.map
|
package/dist/schema/index.js
CHANGED
|
@@ -5,12 +5,12 @@ import { schemaTranslations as r } from "./localization/translations.js";
|
|
|
5
5
|
import { protobufFieldNumber as i, protobufPresence as a } from "./protobuf-metadata.js";
|
|
6
6
|
import { schemaRecursiveTarget as o } from "./recursive-metadata.js";
|
|
7
7
|
import { REQUEST_BODY_COMPOSITION_INDEX_SYMBOL as s } from "./request-body-composition-index.js";
|
|
8
|
-
import c from "./
|
|
9
|
-
import l from "./
|
|
8
|
+
import c from "./Schema.vue.js";
|
|
9
|
+
import l from "./SchemaGlyphPuck.vue.js";
|
|
10
10
|
import u from "./SchemaGutterToggle.vue.js";
|
|
11
|
-
import d from "./
|
|
12
|
-
import f from "./
|
|
13
|
-
import p from "./
|
|
14
|
-
import m from "./
|
|
15
|
-
import h from "./
|
|
16
|
-
export { n as LinkButton, s as REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,
|
|
11
|
+
import d from "./SchemaHeading.vue.js";
|
|
12
|
+
import f from "./SchemaObjectExampleCodeBlock.vue.js";
|
|
13
|
+
import p from "./SchemaProperty.vue.js";
|
|
14
|
+
import m from "./SchemaPropertyExamples.vue.js";
|
|
15
|
+
import h from "./SchemaRailPanel.vue.js";
|
|
16
|
+
export { n as LinkButton, s as REQUEST_BODY_COMPOSITION_INDEX_SYMBOL, c as Schema, l as SchemaGlyphPuck, u as SchemaGutterToggle, d as SchemaHeading, f as SchemaObjectExampleCodeBlock, p as SchemaProperty, m as SchemaPropertyExamples, h as SchemaRailPanel, t as inferDiscriminatorMappingComposition, i as protobufFieldNumber, a as protobufPresence, e as schemaDiscriminator, o as schemaRecursiveTarget, r as schemaTranslations };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { schemaTranslations as e } from "./translations.js";
|
|
2
2
|
import { createLocalization as t } from "@scalar/localization";
|
|
3
|
-
|
|
3
|
+
// src/schema/localization/index.ts
|
|
4
4
|
var { useLocalization: n } = t({
|
|
5
5
|
localeTranslations: e,
|
|
6
6
|
defaultLocale: "en",
|
|
@@ -12,7 +12,6 @@ var { useLocalization: n } = t({
|
|
|
12
12
|
]),
|
|
13
13
|
logPrefix: "[@scalar/blocks/schema]"
|
|
14
14
|
});
|
|
15
|
-
//#endregion
|
|
16
15
|
export { n as useLocalization };
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/localization/locales/ar.ts
|
|
2
2
|
var e = {
|
|
3
3
|
schema: {
|
|
4
4
|
variants: "المتغيرات",
|
|
@@ -64,7 +64,6 @@ var e = {
|
|
|
64
64
|
},
|
|
65
65
|
actions: { copyLinkTo: "نسخ الرابط إلى {name}" }
|
|
66
66
|
};
|
|
67
|
-
//#endregion
|
|
68
67
|
export { e as ar };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=ar.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/localization/locales/de.ts
|
|
2
2
|
var e = {
|
|
3
3
|
schema: {
|
|
4
4
|
variants: "Varianten",
|
|
@@ -64,7 +64,6 @@ var e = {
|
|
|
64
64
|
},
|
|
65
65
|
actions: { copyLinkTo: "Link zu {name} kopieren" }
|
|
66
66
|
};
|
|
67
|
-
//#endregion
|
|
68
67
|
export { e as de };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=de.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/localization/locales/en.ts
|
|
2
2
|
var e = {
|
|
3
3
|
schema: {
|
|
4
4
|
noAllowedValues: "No values satisfy this enum constraint.",
|
|
@@ -64,7 +64,6 @@ var e = {
|
|
|
64
64
|
},
|
|
65
65
|
actions: { copyLinkTo: "Copy link to {name}" }
|
|
66
66
|
};
|
|
67
|
-
//#endregion
|
|
68
67
|
export { e as en };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=en.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/localization/locales/es.ts
|
|
2
2
|
var e = {
|
|
3
3
|
schema: {
|
|
4
4
|
variants: "Variantes",
|
|
@@ -64,7 +64,6 @@ var e = {
|
|
|
64
64
|
},
|
|
65
65
|
actions: { copyLinkTo: "Copiar enlace a {name}" }
|
|
66
66
|
};
|
|
67
|
-
//#endregion
|
|
68
67
|
export { e as es };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=es.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/localization/locales/fr.ts
|
|
2
2
|
var e = {
|
|
3
3
|
schema: {
|
|
4
4
|
variants: "Variantes",
|
|
@@ -64,7 +64,6 @@ var e = {
|
|
|
64
64
|
},
|
|
65
65
|
actions: { copyLinkTo: "Copier le lien vers {name}" }
|
|
66
66
|
};
|
|
67
|
-
//#endregion
|
|
68
67
|
export { e as fr };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=fr.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/localization/locales/pt.ts
|
|
2
2
|
var e = {
|
|
3
3
|
schema: {
|
|
4
4
|
variants: "Variantes",
|
|
@@ -64,7 +64,6 @@ var e = {
|
|
|
64
64
|
},
|
|
65
65
|
actions: { copyLinkTo: "Copiar link para {name}" }
|
|
66
66
|
};
|
|
67
|
-
//#endregion
|
|
68
67
|
export { e as pt };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=pt.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/localization/locales/ru.ts
|
|
2
2
|
var e = {
|
|
3
3
|
schema: {
|
|
4
4
|
variants: "Варианты",
|
|
@@ -64,7 +64,6 @@ var e = {
|
|
|
64
64
|
},
|
|
65
65
|
actions: { copyLinkTo: "Скопировать ссылку на {name}" }
|
|
66
66
|
};
|
|
67
|
-
//#endregion
|
|
68
67
|
export { e as ru };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=ru.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/localization/locales/zh-cn.ts
|
|
2
2
|
var e = {
|
|
3
3
|
schema: {
|
|
4
4
|
variants: "变体",
|
|
@@ -64,7 +64,6 @@ var e = {
|
|
|
64
64
|
},
|
|
65
65
|
actions: { copyLinkTo: "复制指向 {name} 的链接" }
|
|
66
66
|
};
|
|
67
|
-
//#endregion
|
|
68
67
|
export { e as zhCn };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=zh-cn.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/localization/locales/zh-tw.ts
|
|
2
2
|
var e = {
|
|
3
3
|
schema: {
|
|
4
4
|
variants: "變體",
|
|
@@ -64,7 +64,6 @@ var e = {
|
|
|
64
64
|
},
|
|
65
65
|
actions: { copyLinkTo: "複製指向 {name} 的連結" }
|
|
66
66
|
};
|
|
67
|
-
//#endregion
|
|
68
67
|
export { e as zhTw };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=zh-tw.js.map
|
|
@@ -7,7 +7,7 @@ import { pt as a } from "./locales/pt.js";
|
|
|
7
7
|
import { ru as o } from "./locales/ru.js";
|
|
8
8
|
import { zhCn as s } from "./locales/zh-cn.js";
|
|
9
9
|
import { zhTw as c } from "./locales/zh-tw.js";
|
|
10
|
-
|
|
10
|
+
// src/schema/localization/translations.ts
|
|
11
11
|
var l = {
|
|
12
12
|
en: n,
|
|
13
13
|
de: t,
|
|
@@ -19,7 +19,6 @@ var l = {
|
|
|
19
19
|
"zh-CN": s,
|
|
20
20
|
"zh-TW": c
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { l as schemaTranslations };
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=translations.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/protobuf-metadata.ts
|
|
2
2
|
var e = Symbol("protobuf-field-number"), t = Symbol("protobuf-presence");
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as protobufFieldNumber, t as protobufPresence };
|
|
5
4
|
|
|
6
5
|
//# sourceMappingURL=protobuf-metadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.vue.d.ts","sourceRoot":"","sources":["../../src/shared/Badge.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Badge.vue.d.ts","sourceRoot":"","sources":["../../src/shared/Badge.vue"],"names":[],"mappings":"AA8DA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAwDF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK/C,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
package/dist/shared/Badge.vue.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "./Badge.vue_vue_type_script_setup_true_lang.js";
|
|
1
|
+
import e from "./Badge.vue_vue_type_script_setup_true_lang.js";
|
|
3
2
|
/* empty css */
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
// src/shared/Badge.vue
|
|
5
|
+
var n = /*#__PURE__*/ t(e, [["__scopeId", "data-v-7a577ad4"]]);
|
|
7
6
|
export { n as default };
|
|
8
7
|
|
|
9
8
|
//# sourceMappingURL=Badge.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.vue.js","names":["
|
|
1
|
+
{"version":3,"file":"Badge.vue.js","names":["Badge_vue_vue_type_script_setup_true_lang_default","_plugin_vue_export_helper_default","Badge_default"],"sources":[],"mappings":""}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { computed as e, createElementBlock as t, defineComponent as n, mergeProps as r, openBlock as i, renderSlot as a, unref as o } from "vue";
|
|
2
2
|
import { useBindCx as s } from "@scalar/use-hooks/useBindCx";
|
|
3
|
-
|
|
3
|
+
// src/shared/Badge.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var c = /*@__PURE__*/ n({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "Badge",
|
|
7
7
|
props: { color: {} },
|
|
8
8
|
setup(n) {
|
|
9
9
|
let { cx: c } = s(), l = e(() => n.color ? { "--badge-color": n.color } : void 0);
|
|
10
|
-
return (e, s) => (i(), t("div", r(o(c)("badge inline-block rounded-2xl border bg-b-2 px-1.5 py-0.5 text-c-2 text-sm",
|
|
10
|
+
return (e, s) => (i(), t("div", r(o(c)("badge inline-block rounded-2xl border bg-b-2 px-1.5 py-0.5 text-c-2 text-sm", n.color && "bg-(--badge-color) text-auto-contrast-(--badge-color)"), { style: l.value }), [a(e.$slots, "default", {}, void 0, !0)], 16));
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
//#endregion
|
|
14
13
|
export { c as default };
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=Badge.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_mergeProps","_unref","_renderSlot","Badge_vue_vue_type_script_setup_true_lang_default","useBindCx","badgeStyle","computed","__props","openBlock","createElementBlock","mergeProps","unref","cx","renderSlot","_ctx"],"sources":["../../src/shared/Badge.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport { computed } from 'vue'\n\nconst { color } = defineProps<{\n color?: string\n}>()\n\n// Merge fallthrough classes via `cx` so consumer classes can override the base styles.\ndefineOptions({ inheritAttrs: false })\n\nconst { cx } = useBindCx()\n\n// The color only goes in as a custom property;
|
|
1
|
+
{"version":3,"file":"Badge.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_mergeProps","_unref","_renderSlot","Badge_vue_vue_type_script_setup_true_lang_default","useBindCx","badgeStyle","computed","__props","openBlock","createElementBlock","mergeProps","unref","cx","renderSlot","_ctx"],"sources":["../../src/shared/Badge.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport { computed } from 'vue'\n\nconst { color } = defineProps<{\n color?: string\n}>()\n\n// Merge fallthrough classes via `cx` so consumer classes can override the base styles.\ndefineOptions({ inheritAttrs: false })\n\nconst { cx } = useBindCx()\n\n// The color only goes in as a custom property; `text-auto-contrast-*` derives\n// readable text from it in CSS, where the browser can read any color format.\nconst badgeStyle = computed(() =>\n color ? { '--badge-color': color } : undefined,\n)\n</script>\n\n<template>\n <div\n v-bind=\"\n cx(\n 'badge inline-block rounded-2xl border bg-b-2 px-1.5 py-0.5 text-c-2 text-sm',\n color && 'bg-(--badge-color) text-auto-contrast-(--badge-color)',\n )\n \"\n :style=\"badgeStyle\">\n <slot />\n </div>\n</template>\n\n<style scoped>\n/* Colour variants are keyed on the `text-*` class a consumer passes in. */\n.badge.text-orange {\n background: color-mix(in srgb, var(--scalar-color-orange), transparent 90%);\n border: transparent;\n}\n.badge.text-yellow {\n background: color-mix(in srgb, var(--scalar-color-yellow), transparent 90%);\n border: transparent;\n}\n.badge.text-red {\n background: color-mix(in srgb, var(--scalar-color-red), transparent 90%);\n border: transparent;\n}\n.badge.text-purple {\n background: color-mix(in srgb, var(--scalar-color-purple), transparent 90%);\n border: transparent;\n}\n.badge.text-green {\n background: color-mix(in srgb, var(--scalar-color-green), transparent 90%);\n border: transparent;\n}\n</style>\n"],"mappings":";;;;;;;;EAWA,IAAM,EAAE,UAAOM,EAAU,GAInBC,IAAaC,QACjBC,EAAA,QAAQ,EAAE,iBAAiBA,EAAA,MAAM,IAAI,KAAA,CACvC;E,kBAIET,EAAA,GAAAC,EASM,OATNC,EACiBC,EAAAW,CAAA,CAAE,C,+EAAiGL,EAAA,SAAK,uD,GAMtH,EAAA,OAAOF,EAAA,MAAU,CAAA,GAAA,CAClBH,EAAQY,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,EAAA,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalDocs.vue.js","names":["
|
|
1
|
+
{"version":3,"file":"ExternalDocs.vue.js","names":["ExternalDocs_vue_vue_type_script_setup_true_lang_default","ExternalDocs_default"],"sources":[],"mappings":""}
|
|
@@ -2,7 +2,7 @@ import { computed as e, createBlock as t, createCommentVNode as n, createElement
|
|
|
2
2
|
import { ScalarIconBook as d } from "@scalar/icons";
|
|
3
3
|
import { getResolvedRef as f } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
4
4
|
import { sanitizeUrl as p } from "@scalar/helpers/url/is-safe-url";
|
|
5
|
-
|
|
5
|
+
// src/shared/ExternalDocs.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var m = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "group narrow:border-r-0 narrow:first:ml-0 flex items-center border-r first:ml-auto last:border-r-0"
|
|
@@ -40,7 +40,6 @@ var m = {
|
|
|
40
40
|
]))])) : n("", !0);
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
//#endregion
|
|
44
43
|
export { _ as default };
|
|
45
44
|
|
|
46
45
|
//# sourceMappingURL=ExternalDocs.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalDocs.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createBlock","_resolveDynamicComponent","_withCtx","_createVNode","_unref","_toDisplayString","
|
|
1
|
+
{"version":3,"file":"ExternalDocs.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createBlock","_resolveDynamicComponent","_withCtx","_createVNode","_unref","_toDisplayString","_hoisted_1","_hoisted_2","_hoisted_3","ExternalDocs_vue_vue_type_script_setup_true_lang_default","documentation","computed","resolved","getResolvedRef","__props","url","sanitizeUrl","openBlock","createElementBlock","createBlock","resolveDynamicComponent","withCtx","createVNode","unref","ScalarIconBook","toDisplayString","createCommentVNode"],"sources":["../../src/shared/ExternalDocs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { sanitizeUrl } from '@scalar/helpers/url/is-safe-url'\nimport { ScalarIconBook } from '@scalar/icons'\nimport {\n getResolvedRef,\n type NodeInput,\n} from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { ExternalDocumentationObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nconst { value } = defineProps<{\n value?: NodeInput<ExternalDocumentationObject>\n}>()\n\nconst documentation = computed<ExternalDocumentationObject | undefined>(() => {\n const resolved = getResolvedRef(value)\n return resolved && typeof resolved.url === 'string' && resolved.url\n ? resolved\n : undefined\n})\n/** Unsafe URL protocols fall back to a plain-text label. */\nconst url = computed<string | undefined>(() =>\n sanitizeUrl(documentation.value?.url),\n)\n</script>\n\n<template>\n <template v-if=\"documentation\">\n <div\n class=\"group narrow:border-r-0 narrow:first:ml-0 flex items-center border-r first:ml-auto last:border-r-0\">\n <component\n :is=\"url ? 'a' : 'span'\"\n :aria-label=\"documentation.description || documentation.url\"\n class=\"text-c-1 hover:bg-b-2 narrow:border mr-2 flex min-h-7 min-w-7 items-center rounded-lg px-2 py-1 no-underline group-last:mr-0\"\n :href=\"url\"\n :rel=\"url ? 'noopener noreferrer' : undefined\"\n :target=\"url ? '_blank' : undefined\">\n <ScalarIconBook\n class=\"size-3 text-current\"\n weight=\"bold\" />\n <span\n v-if=\"documentation.description\"\n class=\"ml-1 empty:hidden\">\n {{ documentation.description }}\n </span>\n <span\n v-else\n class=\"ml-1 empty:hidden\">\n {{ documentation.url }}\n </span>\n </component>\n </div>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAcA,IAAMY,IAAgBC,QAAwD;GAC5E,IAAMC,IAAWC,EAAeC,EAAA,KAAK;GACrC,OAAOF,KAAY,OAAOA,EAAS,OAAQ,YAAYA,EAAS,MAC5DA,IACA,KAAA;EACN,CAAC,GAEKG,IAAMJ,QACVK,EAAYN,EAAc,OAAO,GAAG,CACtC;E,iBAIkBA,EAAA,SACdZ,EAAA,GAAAC,EAuBM,OAvBNO,GAuBM,EArBJR,EAAA,GAAAE,EAoBYC,EAnBLc,EAAA,QAAG,MAAA,MAAA,GAAA;GACP,cAAYL,EAAA,MAAc,eAAeA,EAAA,MAAc;GACxD,OAAM;GACL,MAAMK,EAAA;GACN,KAAKA,EAAA,QAAG,wBAA2B,KAAA;GACnC,QAAQA,EAAA,QAAG,WAAc,KAAA;;GAC1B,SAAAb,QAEkB,CAFlBC,EAEkBC,EAAAoB,CAAA,GAAA;IADhB,OAAM;IACN,QAAO;G,IAEDd,EAAA,MAAc,eADtBZ,EAAA,GAAAC,EAIO,QAJPQ,GAIOF,EADFK,EAAA,MAAc,WAAW,GAAA,CAAA,MAE9BZ,EAAA,GAAAC,EAIO,QAJPS,GAIOH,EADFK,EAAA,MAAc,GAAG,GAAA,CAAA,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenReader.vue.js","names":["
|
|
1
|
+
{"version":3,"file":"ScreenReader.vue.js","names":["ScreenReader_vue_vue_type_script_setup_true_lang_default","ScreenReader_default"],"sources":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElementBlock as e, defineComponent as t, openBlock as n, renderSlot as r } from "vue";
|
|
2
|
-
|
|
2
|
+
// src/shared/ScreenReader.vue?vue&type=script&setup=true&lang.ts
|
|
3
3
|
var i = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "screenreader-only"
|
|
@@ -13,7 +13,6 @@ var i = {
|
|
|
13
13
|
return (t, a) => t.$props.if ? (n(), e("span", i, [r(t.$slots, "default")])) : r(t.$slots, "default", {}, void 0, void 0, 1);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
//#endregion
|
|
17
16
|
export { a as default };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=ScreenReader.vue_vue_type_script_setup_true_lang.js.map
|
package/dist/shared/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import t from "./
|
|
3
|
-
import n from "./
|
|
4
|
-
export {
|
|
1
|
+
import e from "./Badge.vue.js";
|
|
2
|
+
import t from "./ExternalDocs.vue.js";
|
|
3
|
+
import n from "./ScreenReader.vue.js";
|
|
4
|
+
export { e as Badge, t as ExternalDocs, n as ScreenReader };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import e from "./ExtensionValue.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
-
|
|
2
|
+
// src/specification-extensions/ExtensionValue.vue
|
|
3
3
|
var t = e;
|
|
4
|
-
//#endregion
|
|
5
4
|
export { t as default };
|
|
6
5
|
|
|
7
6
|
//# sourceMappingURL=ExtensionValue.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionValue.vue.js","names":["
|
|
1
|
+
{"version":3,"file":"ExtensionValue.vue.js","names":["ExtensionValue_vue_vue_type_script_setup_true_lang_default","ExtensionValue_default"],"sources":[],"mappings":""}
|