@scalar/blocks 0.10.0 → 0.11.1
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/CodeExample.vue.d.ts.map +1 -1
- package/dist/code-example/components/CodeExample.vue.js +1 -1
- package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.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 +131 -158
- package/dist/code-example/helpers/operation-to-har/process-parameters.js.map +1 -1
- package/dist/code-example/mount.d.ts +1 -1
- package/dist/code-example/mount.d.ts.map +1 -1
- package/dist/code-example/mount.js +49 -39
- package/dist/code-example/mount.js.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/schema/Schema.vue.d.ts.map +1 -1
- package/dist/schema/Schema.vue.js +1 -1
- package/dist/schema/Schema.vue_vue_type_script_setup_true_lang.js +40 -39
- package/dist/schema/Schema.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaObjectProperties.vue.d.ts.map +1 -1
- package/dist/schema/SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js +30 -22
- package/dist/schema/SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaProperty.vue.d.ts +5 -0
- package/dist/schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/schema/SchemaProperty.vue.js +1 -1
- package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js +3 -0
- package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaPropertyHeading.vue.d.ts +6 -4
- package/dist/schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/schema/SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js +155 -132
- package/dist/schema/SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/helpers/dynamic-scope.d.ts +3 -1
- package/dist/schema/helpers/dynamic-scope.d.ts.map +1 -1
- package/dist/schema/helpers/dynamic-scope.js +19 -4
- package/dist/schema/helpers/dynamic-scope.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 +24 -24
- package/dist/schema/helpers/get-compositions-to-render.js.map +1 -1
- package/dist/schema/helpers/index.d.ts +1 -0
- package/dist/schema/helpers/index.d.ts.map +1 -1
- package/dist/schema/helpers/index.js +14 -13
- package/dist/schema/helpers/optimize-value-for-display.d.ts.map +1 -1
- package/dist/schema/helpers/optimize-value-for-display.js +11 -11
- package/dist/schema/helpers/optimize-value-for-display.js.map +1 -1
- package/dist/schema/helpers/partition-all-of-compositions.d.ts.map +1 -1
- package/dist/schema/helpers/partition-all-of-compositions.js +24 -14
- package/dist/schema/helpers/partition-all-of-compositions.js.map +1 -1
- package/dist/schema/helpers/should-render-array-item-composition.d.ts +2 -0
- package/dist/schema/helpers/should-render-array-item-composition.d.ts.map +1 -1
- package/dist/schema/helpers/should-render-array-item-composition.js +2 -6
- package/dist/schema/helpers/should-render-array-item-composition.js.map +1 -1
- package/dist/style.css +67 -42
- package/dist/vue-styles.css +1 -1
- package/package.json +10 -10
|
@@ -5,8 +5,9 @@ import { sortPropertyNames as r } from "./helpers/sort-property-names.js";
|
|
|
5
5
|
import i from "./SchemaProperty.vue.js";
|
|
6
6
|
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, defineComponent as u, openBlock as d, renderList as f, unref as p } from "vue";
|
|
7
7
|
import { resolve as m } from "@scalar/workspace-store/resolve";
|
|
8
|
+
import { getXBadges as h } from "@scalar/workspace-store/schemas/extensions/get-x-badges";
|
|
8
9
|
// src/schema/SchemaObjectProperties.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
10
|
+
var g = /*@__PURE__*/ u({
|
|
10
11
|
__name: "SchemaObjectProperties",
|
|
11
12
|
props: {
|
|
12
13
|
schema: {},
|
|
@@ -26,7 +27,7 @@ var h = /*@__PURE__*/ u({
|
|
|
26
27
|
expansion: {}
|
|
27
28
|
},
|
|
28
29
|
setup(u) {
|
|
29
|
-
let
|
|
30
|
+
let g = o(() => r(u.schema, u.discriminator, u.options)), _ = (e, t) => {
|
|
30
31
|
let n = typeof e == "boolean" ? e : m.schema(e);
|
|
31
32
|
if (typeof n == "object" && typeof n["x-additionalPropertiesName"] == "string" && n["x-additionalPropertiesName"].trim().length > 0) return `${n["x-additionalPropertiesName"].trim()}`;
|
|
32
33
|
if (t) {
|
|
@@ -34,32 +35,33 @@ var h = /*@__PURE__*/ u({
|
|
|
34
35
|
if (e?.title) return e.title;
|
|
35
36
|
}
|
|
36
37
|
return "propertyName";
|
|
37
|
-
},
|
|
38
|
+
}, v = (e) => {
|
|
38
39
|
if (!e) return;
|
|
39
40
|
let t = m.schema(e);
|
|
40
41
|
if (t && "enum" in t && Array.isArray(t.enum) && t.enum.length > 0) return t.enum;
|
|
41
|
-
},
|
|
42
|
-
if (t(u.schema) && u.schema.additionalProperties) return
|
|
43
|
-
}),
|
|
42
|
+
}, y = o(() => {
|
|
43
|
+
if (t(u.schema) && u.schema.additionalProperties) return v(u.schema.propertyNames);
|
|
44
|
+
}), b = o(() => {
|
|
44
45
|
if (t(u.schema) && u.schema.additionalProperties) return u.schema.propertyNames ? m.schema(u.schema.propertyNames) : void 0;
|
|
45
|
-
}),
|
|
46
|
+
}), x = (t) => {
|
|
46
47
|
if (t !== void 0) return m.schema(e(t));
|
|
47
|
-
},
|
|
48
|
+
}, S = (e) => {
|
|
48
49
|
if (e) return typeof e.description == "string" ? e.description : void 0;
|
|
49
|
-
},
|
|
50
|
+
}, C = o(() => {
|
|
50
51
|
if (!t(u.schema) || !u.schema.properties) return [];
|
|
51
52
|
let { properties: e } = u.schema, r = new Set(u.schema.required ?? []);
|
|
52
|
-
return
|
|
53
|
+
return g.value.map((t) => {
|
|
53
54
|
let i = e[t];
|
|
54
55
|
return {
|
|
56
|
+
badges: h(i),
|
|
55
57
|
name: t,
|
|
56
58
|
cycleKey: n(i),
|
|
57
|
-
description:
|
|
59
|
+
description: S(i),
|
|
58
60
|
required: r.has(t),
|
|
59
|
-
schema:
|
|
61
|
+
schema: x(i)
|
|
60
62
|
};
|
|
61
63
|
});
|
|
62
|
-
}),
|
|
64
|
+
}), w = (e) => {
|
|
63
65
|
let t = typeof e == "boolean" ? e : m.schema(e);
|
|
64
66
|
return t === !0 || typeof t == "object" && Object.keys(t).length === 0 || typeof t != "object" || !("type" in t) ? {
|
|
65
67
|
type: "anything",
|
|
@@ -67,8 +69,9 @@ var h = /*@__PURE__*/ u({
|
|
|
67
69
|
} : t;
|
|
68
70
|
};
|
|
69
71
|
return (e, r) => (d(), l(a, null, [
|
|
70
|
-
p(t)(u.schema) && u.schema.properties ? (d(!0), l(a, { key: 0 }, f(
|
|
72
|
+
p(t)(u.schema) && u.schema.properties ? (d(!0), l(a, { key: 0 }, f(C.value, (e) => (d(), s(i, {
|
|
71
73
|
key: e.name,
|
|
74
|
+
badges: e.badges,
|
|
72
75
|
breadcrumb: u.breadcrumb,
|
|
73
76
|
compact: u.compact,
|
|
74
77
|
compositionPath: u.compositionPath,
|
|
@@ -90,6 +93,7 @@ var h = /*@__PURE__*/ u({
|
|
|
90
93
|
scrollTargetId: u.scrollTargetId,
|
|
91
94
|
specificationExtension: u.specificationExtension
|
|
92
95
|
}, null, 8, [
|
|
96
|
+
"badges",
|
|
93
97
|
"breadcrumb",
|
|
94
98
|
"compact",
|
|
95
99
|
"compositionPath",
|
|
@@ -113,13 +117,14 @@ var h = /*@__PURE__*/ u({
|
|
|
113
117
|
]))), 128)) : c("", !0),
|
|
114
118
|
p(t)(u.schema) && u.schema.patternProperties ? (d(!0), l(a, { key: 1 }, f(Object.entries(u.schema.patternProperties), ([e, t]) => (d(), s(i, {
|
|
115
119
|
key: e,
|
|
120
|
+
badges: p(h)(t),
|
|
116
121
|
breadcrumb: u.breadcrumb,
|
|
117
122
|
compact: u.compact,
|
|
118
123
|
compositionPath: u.compositionPath,
|
|
119
124
|
compositionPathSegment: e,
|
|
120
125
|
cycleKey: p(n)(t),
|
|
121
126
|
depth: u.depth,
|
|
122
|
-
description:
|
|
127
|
+
description: S(t),
|
|
123
128
|
discriminator: u.discriminator,
|
|
124
129
|
eventBus: u.eventBus,
|
|
125
130
|
expansion: u.expansion,
|
|
@@ -128,11 +133,12 @@ var h = /*@__PURE__*/ u({
|
|
|
128
133
|
level: u.level,
|
|
129
134
|
name: e,
|
|
130
135
|
options: u.options,
|
|
131
|
-
schema:
|
|
136
|
+
schema: x(t),
|
|
132
137
|
schemaContext: u.schemaContext,
|
|
133
138
|
scrollTargetId: u.scrollTargetId,
|
|
134
139
|
specificationExtension: u.specificationExtension
|
|
135
140
|
}, null, 8, [
|
|
141
|
+
"badges",
|
|
136
142
|
"breadcrumb",
|
|
137
143
|
"compact",
|
|
138
144
|
"compositionPath",
|
|
@@ -155,10 +161,11 @@ var h = /*@__PURE__*/ u({
|
|
|
155
161
|
]))), 128)) : c("", !0),
|
|
156
162
|
p(t)(u.schema) && u.schema.additionalProperties ? (d(), s(i, {
|
|
157
163
|
key: 2,
|
|
164
|
+
badges: p(h)(u.schema.additionalProperties),
|
|
158
165
|
breadcrumb: u.breadcrumb,
|
|
159
166
|
compact: u.compact,
|
|
160
167
|
compositionPath: u.compositionPath,
|
|
161
|
-
compositionPathSegment:
|
|
168
|
+
compositionPathSegment: _(u.schema.additionalProperties, u.schema.propertyNames),
|
|
162
169
|
cycleKey: p(n)(u.schema.additionalProperties),
|
|
163
170
|
depth: u.depth,
|
|
164
171
|
discriminator: u.discriminator,
|
|
@@ -167,17 +174,18 @@ var h = /*@__PURE__*/ u({
|
|
|
167
174
|
hideHeading: u.hideHeading,
|
|
168
175
|
hideModelNames: u.hideModelNames,
|
|
169
176
|
level: u.level,
|
|
170
|
-
name:
|
|
177
|
+
name: _(u.schema.additionalProperties, u.schema.propertyNames),
|
|
171
178
|
noncollapsible: "",
|
|
172
179
|
options: u.options,
|
|
173
|
-
propertyNamesEnum:
|
|
174
|
-
propertyNamesSchema:
|
|
175
|
-
schema:
|
|
180
|
+
propertyNamesEnum: y.value,
|
|
181
|
+
propertyNamesSchema: b.value,
|
|
182
|
+
schema: w(u.schema.additionalProperties),
|
|
176
183
|
schemaContext: u.schemaContext,
|
|
177
184
|
scrollTargetId: u.scrollTargetId,
|
|
178
185
|
specificationExtension: u.specificationExtension,
|
|
179
186
|
variant: "additionalProperties"
|
|
180
187
|
}, null, 8, [
|
|
188
|
+
"badges",
|
|
181
189
|
"breadcrumb",
|
|
182
190
|
"compact",
|
|
183
191
|
"compositionPath",
|
|
@@ -202,6 +210,6 @@ var h = /*@__PURE__*/ u({
|
|
|
202
210
|
], 64));
|
|
203
211
|
}
|
|
204
212
|
});
|
|
205
|
-
export {
|
|
213
|
+
export { g as default };
|
|
206
214
|
|
|
207
215
|
//# sourceMappingURL=SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_Fragment","_unref","_renderList","_createBlock","SchemaProperty","SchemaProperty_default","SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default","sortedProperties","computed","sortPropertyNames","__props","getAdditionalPropertiesName","additionalProperties","_additionalProperties","resolve","_propertyNames","resolved","getPropertyNamesEnum","additionalPropertiesEnum","isTypeObject","additionalPropertiesKeySchema","getPropertySchema","property","resolveDynamicSchema","getPropertyDescription","rows","requiredSet","properties","name","getCycleKey","getAdditionalPropertiesValue","openBlock","createElementBlock","Fragment","unref","renderList","createBlock","row","createCommentVNode","key"],"sources":["../../src/schema/SchemaObjectProperties.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { resolveDynamicSchema } from './helpers/dynamic-scope'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { getCycleKey } from './helpers/schema-cycle'\nimport { sortPropertyNames } from './helpers/sort-property-names'\nimport SchemaProperty from './SchemaProperty.vue'\nimport type { SchemaOptions, SchemaRenderingProps } from './types'\n\nconst { schema, discriminator, options, schemaContext, compositionPath } =\n defineProps<\n {\n schema: SchemaObject\n discriminator?: DiscriminatorObject\n compact?: boolean\n hideHeading?: boolean\n level?: number\n /** Real nesting depth (see SchemaProperty) */\n depth?: number\n hideModelNames?: boolean\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n schemaContext?: string\n compositionPath?: string[]\n } & SchemaRenderingProps\n >()\n\n/**\n * Sorts properties by required status first, then alphabetically.\n * Required properties appear first, followed by optional properties.\n */\nconst sortedProperties = computed(() =>\n sortPropertyNames(schema, discriminator, options),\n)\n\n/**\n * Get the display name for additional properties.\n *\n * Checks x-additionalPropertiesName extension first, then falls back to the\n * propertyNames schema title if available.\n */\nconst getAdditionalPropertiesName = (\n _additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n) => {\n const additionalProperties =\n typeof _additionalProperties === 'boolean'\n ? _additionalProperties\n : resolve.schema(_additionalProperties)\n\n if (\n typeof additionalProperties === 'object' &&\n typeof additionalProperties['x-additionalPropertiesName'] === 'string' &&\n additionalProperties['x-additionalPropertiesName'].trim().length > 0\n ) {\n return `${additionalProperties['x-additionalPropertiesName'].trim()}`\n }\n\n // Fall back to the propertyNames title when available\n if (_propertyNames) {\n const resolved = resolve.schema(_propertyNames)\n if (resolved?.title) {\n return resolved.title\n }\n }\n\n return 'propertyName'\n}\n\n/**\n * Extract enum values from the propertyNames schema.\n *\n * JSON Schema's propertyNames keyword constrains which keys are valid\n * in an object with additionalProperties. When it contains an enum,\n * these are the allowed key names.\n */\nconst getPropertyNamesEnum = (\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n): string[] | undefined => {\n if (!_propertyNames) {\n return undefined\n }\n\n const resolved = resolve.schema(_propertyNames)\n if (\n resolved &&\n 'enum' in resolved &&\n Array.isArray(resolved.enum) &&\n resolved.enum.length > 0\n ) {\n return resolved.enum as string[]\n }\n\n return undefined\n}\n\n/** Enum values for the property keys, derived from propertyNames if present. */\nconst additionalPropertiesEnum = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return getPropertyNamesEnum(schema.propertyNames)\n})\n\n/**\n * The resolved propertyNames schema for the property keys.\n *\n * Surfaces key constraints such as `format` (for example `uuid`) so they are\n * not lost when rendering a map of additional properties.\n */\nconst additionalPropertiesKeySchema = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return schema.propertyNames ? resolve.schema(schema.propertyNames) : undefined\n})\n\n/**\n * Keep sibling property descriptions separate from the referenced schema.\n *\n * This allows us to render both:\n * - the property-specific description written next to the $ref, and\n * - the referenced schema's own description (for example discriminator parent docs)\n *\n * A property that is itself a `$dynamicRef` is bound to its concrete type first, while the value is\n * still a magic proxy. `resolve.schema` coerces the value into a plain object and would drop the proxy's\n * virtual `$dynamicRef-value` accessor, so binding afterwards is impossible — see {@link resolveDynamicSchema}.\n */\nconst getPropertySchema = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): SchemaObject | undefined => {\n if (property === undefined) {\n return undefined\n }\n return resolve.schema(resolveDynamicSchema(property))\n}\n\nconst getPropertyDescription = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): string | undefined => {\n if (!property) {\n return undefined\n }\n\n return typeof property.description === 'string'\n ? property.description\n : undefined\n}\n\ntype PropertyRow = {\n name: string\n cycleKey: unknown\n description: string | undefined\n required: boolean\n schema: SchemaObject | undefined\n}\n\n/**\n * Each child read once, in panel order.\n *\n * The template used to fetch `schema.properties[name]` three times per row\n * (cycle key, description, schema) and walk the `required` array with\n * `includes` for every row. Through the document's proxy stack those reads\n * were the panel's largest per-row JS cost, and none of them can change while\n * the panel is up. `false` for a name outside `required` lands on the same\n * `required: false` default in SchemaProperty that `undefined` did.\n */\nconst rows = computed((): PropertyRow[] => {\n if (!isTypeObject(schema) || !schema.properties) {\n return []\n }\n\n const { properties } = schema\n const requiredSet = new Set(schema.required ?? [])\n\n return sortedProperties.value.map((name): PropertyRow => {\n const property = properties[name]\n\n return {\n name,\n cycleKey: getCycleKey(property),\n description: getPropertyDescription(property),\n required: requiredSet.has(name),\n schema: getPropertySchema(property),\n }\n })\n})\n\n/**\n * Get the value for additional properties.\n *\n * When additionalProperties is true or an empty object, it should render as { type: 'anything' }.\n * $ref values are resolved before the type check so the referenced schema is rendered correctly.\n */\nconst getAdditionalPropertiesValue = (\n additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n): SchemaObject => {\n // Resolve $ref first so the type check below works on the actual schema\n const resolved =\n typeof additionalProperties === 'boolean'\n ? additionalProperties\n : resolve.schema(additionalProperties)\n\n if (\n resolved === true ||\n (typeof resolved === 'object' && Object.keys(resolved).length === 0) ||\n typeof resolved !== 'object' ||\n !('type' in resolved)\n ) {\n return {\n // @ts-expect-error - ask hans\n type: 'anything',\n ...(typeof resolved === 'object' ? resolved : {}),\n }\n }\n\n return resolved\n}\n</script>\n\n<template>\n <!-- Properties -->\n <template v-if=\"isTypeObject(schema) && schema.properties\">\n <SchemaProperty\n v-for=\"row in rows\"\n :key=\"row.name\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"row.name\"\n :cycleKey=\"row.cycleKey\"\n :depth\n :description=\"row.description\"\n :discriminator\n :eventBus=\"eventBus\"\n :expansion=\"expansion\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"row.name\"\n :options=\"options\"\n :required=\"row.required\"\n :schema=\"row.schema\"\n :schemaContext=\"schemaContext\"\n :scrollTargetId=\"scrollTargetId\"\n :specificationExtension=\"specificationExtension\" />\n </template>\n\n <!-- patternProperties -->\n <template v-if=\"isTypeObject(schema) && schema.patternProperties\">\n <SchemaProperty\n v-for=\"[key, property] in Object.entries(schema.patternProperties)\"\n :key=\"key\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"key\"\n :cycleKey=\"getCycleKey(property)\"\n :depth\n :description=\"getPropertyDescription(property)\"\n :discriminator\n :eventBus=\"eventBus\"\n :expansion=\"expansion\"\n :hideHeading\n :hideModelNames=\"hideModelNames\"\n :level\n :name=\"key\"\n :options=\"options\"\n :schema=\"getPropertySchema(property)\"\n :schemaContext=\"schemaContext\"\n :scrollTargetId=\"scrollTargetId\"\n :specificationExtension=\"specificationExtension\" />\n </template>\n\n <!-- additionalProperties -->\n <template v-if=\"isTypeObject(schema) && schema.additionalProperties\">\n <SchemaProperty\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n :cycleKey=\"getCycleKey(schema.additionalProperties)\"\n :depth\n :discriminator\n :eventBus=\"eventBus\"\n :expansion=\"expansion\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n noncollapsible\n :options=\"options\"\n :propertyNamesEnum=\"additionalPropertiesEnum\"\n :propertyNamesSchema=\"additionalPropertiesKeySchema\"\n :schema=\"getAdditionalPropertiesValue(schema.additionalProperties)\"\n :schemaContext=\"schemaContext\"\n :scrollTargetId=\"scrollTargetId\"\n :specificationExtension=\"specificationExtension\"\n variant=\"addition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sBAAgCA,EAAA,OAAO,a;IAMrG,gBAAA;IACC,SAASA,EAAA;IACT,mBAAmBQ,EAAA;IACnB,qBAAqBE,EAAA;IACrB,QAAQU,EAA6BpB,EAAA,OAAO,oBAAoB;IAChE,eAAeA,EAAA;IACf,gBAAgBA,EAAA;IAChB,wBAAwBA,EAAA;IACzB,SAAQ"}
|
|
1
|
+
{"version":3,"file":"SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_Fragment","_unref","_renderList","_createBlock","SchemaProperty","SchemaProperty_default","SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default","sortedProperties","computed","sortPropertyNames","__props","getAdditionalPropertiesName","additionalProperties","_additionalProperties","resolve","_propertyNames","resolved","getPropertyNamesEnum","additionalPropertiesEnum","isTypeObject","additionalPropertiesKeySchema","getPropertySchema","property","resolveDynamicSchema","getPropertyDescription","rows","requiredSet","properties","name","getXBadges","getCycleKey","getAdditionalPropertiesValue","openBlock","createElementBlock","Fragment","unref","renderList","createBlock","row","createCommentVNode","key"],"sources":["../../src/schema/SchemaObjectProperties.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport { getXBadges } from '@scalar/workspace-store/schemas/extensions/get-x-badges'\nimport type { XBadge } from '@scalar/workspace-store/schemas/extensions/operation'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { resolveDynamicSchema } from './helpers/dynamic-scope'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { getCycleKey } from './helpers/schema-cycle'\nimport { sortPropertyNames } from './helpers/sort-property-names'\nimport SchemaProperty from './SchemaProperty.vue'\nimport type { SchemaOptions, SchemaRenderingProps } from './types'\n\nconst { schema, discriminator, options, schemaContext, compositionPath } =\n defineProps<\n {\n schema: SchemaObject\n discriminator?: DiscriminatorObject\n compact?: boolean\n hideHeading?: boolean\n level?: number\n /** Real nesting depth (see SchemaProperty) */\n depth?: number\n hideModelNames?: boolean\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n schemaContext?: string\n compositionPath?: string[]\n } & SchemaRenderingProps\n >()\n\n/**\n * Sorts properties by required status first, then alphabetically.\n * Required properties appear first, followed by optional properties.\n */\nconst sortedProperties = computed(() =>\n sortPropertyNames(schema, discriminator, options),\n)\n\n/**\n * Get the display name for additional properties.\n *\n * Checks x-additionalPropertiesName extension first, then falls back to the\n * propertyNames schema title if available.\n */\nconst getAdditionalPropertiesName = (\n _additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n) => {\n const additionalProperties =\n typeof _additionalProperties === 'boolean'\n ? _additionalProperties\n : resolve.schema(_additionalProperties)\n\n if (\n typeof additionalProperties === 'object' &&\n typeof additionalProperties['x-additionalPropertiesName'] === 'string' &&\n additionalProperties['x-additionalPropertiesName'].trim().length > 0\n ) {\n return `${additionalProperties['x-additionalPropertiesName'].trim()}`\n }\n\n // Fall back to the propertyNames title when available\n if (_propertyNames) {\n const resolved = resolve.schema(_propertyNames)\n if (resolved?.title) {\n return resolved.title\n }\n }\n\n return 'propertyName'\n}\n\n/**\n * Extract enum values from the propertyNames schema.\n *\n * JSON Schema's propertyNames keyword constrains which keys are valid\n * in an object with additionalProperties. When it contains an enum,\n * these are the allowed key names.\n */\nconst getPropertyNamesEnum = (\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n): string[] | undefined => {\n if (!_propertyNames) {\n return undefined\n }\n\n const resolved = resolve.schema(_propertyNames)\n if (\n resolved &&\n 'enum' in resolved &&\n Array.isArray(resolved.enum) &&\n resolved.enum.length > 0\n ) {\n return resolved.enum as string[]\n }\n\n return undefined\n}\n\n/** Enum values for the property keys, derived from propertyNames if present. */\nconst additionalPropertiesEnum = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return getPropertyNamesEnum(schema.propertyNames)\n})\n\n/**\n * The resolved propertyNames schema for the property keys.\n *\n * Surfaces key constraints such as `format` (for example `uuid`) so they are\n * not lost when rendering a map of additional properties.\n */\nconst additionalPropertiesKeySchema = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return schema.propertyNames ? resolve.schema(schema.propertyNames) : undefined\n})\n\n/**\n * Keep sibling property descriptions separate from the referenced schema.\n *\n * This allows us to render both:\n * - the property-specific description written next to the $ref, and\n * - the referenced schema's own description (for example discriminator parent docs)\n *\n * A property that is itself a `$dynamicRef` is bound to its concrete type first, while the value is\n * still a magic proxy. `resolve.schema` coerces the value into a plain object and would drop the proxy's\n * virtual `$dynamicRef-value` accessor, so binding afterwards is impossible — see {@link resolveDynamicSchema}.\n */\nconst getPropertySchema = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): SchemaObject | undefined => {\n if (property === undefined) {\n return undefined\n }\n return resolve.schema(resolveDynamicSchema(property))\n}\n\nconst getPropertyDescription = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): string | undefined => {\n if (!property) {\n return undefined\n }\n\n return typeof property.description === 'string'\n ? property.description\n : undefined\n}\n\ntype PropertyRow = {\n badges: XBadge[] | undefined\n name: string\n cycleKey: unknown\n description: string | undefined\n required: boolean\n schema: SchemaObject | undefined\n}\n\n/**\n * Each child read once, in panel order.\n *\n * The template used to fetch `schema.properties[name]` three times per row\n * (cycle key, description, schema) and walk the `required` array with\n * `includes` for every row. Through the document's proxy stack those reads\n * were the panel's largest per-row JS cost, and none of them can change while\n * the panel is up. `false` for a name outside `required` lands on the same\n * `required: false` default in SchemaProperty that `undefined` did.\n */\nconst rows = computed((): PropertyRow[] => {\n if (!isTypeObject(schema) || !schema.properties) {\n return []\n }\n\n const { properties } = schema\n const requiredSet = new Set(schema.required ?? [])\n\n return sortedProperties.value.map((name): PropertyRow => {\n const property = properties[name]\n\n return {\n badges: getXBadges(property),\n name,\n cycleKey: getCycleKey(property),\n description: getPropertyDescription(property),\n required: requiredSet.has(name),\n schema: getPropertySchema(property),\n }\n })\n})\n\n/**\n * Get the value for additional properties.\n *\n * When additionalProperties is true or an empty object, it should render as { type: 'anything' }.\n * $ref values are resolved before the type check so the referenced schema is rendered correctly.\n */\nconst getAdditionalPropertiesValue = (\n additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n): SchemaObject => {\n // Resolve $ref first so the type check below works on the actual schema\n const resolved =\n typeof additionalProperties === 'boolean'\n ? additionalProperties\n : resolve.schema(additionalProperties)\n\n if (\n resolved === true ||\n (typeof resolved === 'object' && Object.keys(resolved).length === 0) ||\n typeof resolved !== 'object' ||\n !('type' in resolved)\n ) {\n return {\n // @ts-expect-error - ask hans\n type: 'anything',\n ...(typeof resolved === 'object' ? resolved : {}),\n }\n }\n\n return resolved\n}\n</script>\n\n<template>\n <!-- Properties -->\n <template v-if=\"isTypeObject(schema) && schema.properties\">\n <SchemaProperty\n v-for=\"row in rows\"\n :key=\"row.name\"\n :badges=\"row.badges\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"row.name\"\n :cycleKey=\"row.cycleKey\"\n :depth\n :description=\"row.description\"\n :discriminator\n :eventBus=\"eventBus\"\n :expansion=\"expansion\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"row.name\"\n :options=\"options\"\n :required=\"row.required\"\n :schema=\"row.schema\"\n :schemaContext=\"schemaContext\"\n :scrollTargetId=\"scrollTargetId\"\n :specificationExtension=\"specificationExtension\" />\n </template>\n\n <!-- patternProperties -->\n <template v-if=\"isTypeObject(schema) && schema.patternProperties\">\n <SchemaProperty\n v-for=\"[key, property] in Object.entries(schema.patternProperties)\"\n :key=\"key\"\n :badges=\"getXBadges(property)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"key\"\n :cycleKey=\"getCycleKey(property)\"\n :depth\n :description=\"getPropertyDescription(property)\"\n :discriminator\n :eventBus=\"eventBus\"\n :expansion=\"expansion\"\n :hideHeading\n :hideModelNames=\"hideModelNames\"\n :level\n :name=\"key\"\n :options=\"options\"\n :schema=\"getPropertySchema(property)\"\n :schemaContext=\"schemaContext\"\n :scrollTargetId=\"scrollTargetId\"\n :specificationExtension=\"specificationExtension\" />\n </template>\n\n <!-- additionalProperties -->\n <template v-if=\"isTypeObject(schema) && schema.additionalProperties\">\n <SchemaProperty\n :badges=\"getXBadges(schema.additionalProperties)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n :cycleKey=\"getCycleKey(schema.additionalProperties)\"\n :depth\n :discriminator\n :eventBus=\"eventBus\"\n :expansion=\"expansion\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n noncollapsible\n :options=\"options\"\n :propertyNamesEnum=\"additionalPropertiesEnum\"\n :propertyNamesSchema=\"additionalPropertiesKeySchema\"\n :schema=\"getAdditionalPropertiesValue(schema.additionalProperties)\"\n :schemaContext=\"schemaContext\"\n :scrollTargetId=\"scrollTargetId\"\n :specificationExtension=\"specificationExtension\"\n variant=\"additionalProperties\" />\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,IAAMS,IAAmBC,QACvBC,EAAkBC,EAAA,QAAQA,EAAA,eAAeA,EAAA,OAAO,CAClD,GAQMC,KACJ,GAIA,MACG;GACH,IAAMC,IACJ,OAAOC,KAA0B,YAC7BA,IACAC,EAAQ,OAAOD,CAAqB;GAE1C,IACE,OAAOD,KAAyB,YAChC,OAAOA,EAAqB,iCAAkC,YAC9DA,EAAqB,6BAA6B,CAAC,KAAK,CAAC,CAAC,SAAS,GAEn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BA,EAAA;IACzB,SAAQ"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
2
|
+
import type { XBadge } from '@scalar/workspace-store/schemas/extensions/operation';
|
|
2
3
|
import type { DiscriminatorObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
|
|
3
4
|
import { type Component } from 'vue';
|
|
4
5
|
import type { SchemaOptions, SchemaRenderingProps } from './types';
|
|
@@ -7,6 +8,8 @@ export default _default;
|
|
|
7
8
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
8
9
|
is?: string | Component;
|
|
9
10
|
schema: SchemaObject | undefined;
|
|
11
|
+
/** Badges authored on this property before resolving its schema. */
|
|
12
|
+
badges?: XBadge[];
|
|
10
13
|
/** Extensions on the containing parameter or header; schema values take precedence. */
|
|
11
14
|
extensionSource?: Record<string, unknown>;
|
|
12
15
|
noncollapsible?: boolean;
|
|
@@ -44,6 +47,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
44
47
|
} & SchemaRenderingProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
45
48
|
is?: string | Component;
|
|
46
49
|
schema: SchemaObject | undefined;
|
|
50
|
+
/** Badges authored on this property before resolving its schema. */
|
|
51
|
+
badges?: XBadge[];
|
|
47
52
|
/** Extensions on the containing parameter or header; schema values take precedence. */
|
|
48
53
|
extensionSource?: Record<string, unknown>;
|
|
49
54
|
noncollapsible?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../src/schema/SchemaProperty.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../src/schema/SchemaProperty.vue"],"names":[],"mappings":"AAi3CA,OAAO,KAAK,EAAE,iBAAiB,EAAE,M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sB,GAAG,mBAAmB;iBACzC,MAAM,EAAE;cACX,iBAAiB,GAAG,IAAI;aACzB,aAAa;IACtB,+EAA+E;wBAC3D,MAAM,EAAE;IAC5B,iFAAiF;0BAC3D,YAAY;IAClC,mFAAmF;oBACnE,MAAM;IACtB,uFAAuF;sBACrE,MAAM,EAAE;IAC1B,oFAAoF;6BAC3D,MAAM;IAC/B,2EAA2E;eAChE,OAAO;;cAvBP,OAAO;WAPV,MAAM;oBAWG,OAAO;WANhB,MAAM;aAGJ,OAAO;6EA+iDnB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import e from "./SchemaProperty.vue_vue_type_script_setup_true_lang.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
// src/schema/SchemaProperty.vue
|
|
5
|
-
var n = /*#__PURE__*/ t(e, [["__scopeId", "data-v-
|
|
5
|
+
var n = /*#__PURE__*/ t(e, [["__scopeId", "data-v-171bc332"]]);
|
|
6
6
|
export { n as default };
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=SchemaProperty.vue.js.map
|
|
@@ -57,6 +57,7 @@ var ze = ["id"], Be = {
|
|
|
57
57
|
props: {
|
|
58
58
|
is: {},
|
|
59
59
|
schema: {},
|
|
60
|
+
badges: {},
|
|
60
61
|
extensionSource: {},
|
|
61
62
|
noncollapsible: { type: Boolean },
|
|
62
63
|
level: { default: 0 },
|
|
@@ -261,6 +262,7 @@ var ze = ["id"], Be = {
|
|
|
261
262
|
])) : u("", !0),
|
|
262
263
|
M.value ? (h(), l(Se, m({
|
|
263
264
|
key: 1,
|
|
265
|
+
badges: p.badges,
|
|
264
266
|
class: ["group", [{ "cursor-pointer": U.value }, "relative row-start-1 min-h-5 content-center [&>*:has(+.copy-link-trailing)]:me-0!"]],
|
|
265
267
|
discriminatorValue: ht.value,
|
|
266
268
|
enum: tt.value,
|
|
@@ -336,6 +338,7 @@ var ze = ["id"], Be = {
|
|
|
336
338
|
key: "3"
|
|
337
339
|
} : void 0
|
|
338
340
|
]), 1040, [
|
|
341
|
+
"badges",
|
|
339
342
|
"class",
|
|
340
343
|
"discriminatorValue",
|
|
341
344
|
"enum",
|