slds-json-schema-renderer 1.0.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/LICENSE +21 -0
- package/README.md +118 -0
- package/bin/cli.js +35 -0
- package/lib/cli/generate.js +110 -0
- package/lib/cli/index.js +6 -0
- package/lib/frontend/bundle.mjs +1009 -0
- package/lib/frontend/bundle.umd.js +1 -0
- package/lib/frontend/style.css +1 -0
- package/lib/index.js +14 -0
- package/lib/templates/index.html +21 -0
- package/lib/utils/html-generator.js +160 -0
- package/lib/utils/schema-parser.js +266 -0
- package/package.json +90 -0
- package/src/templates/index.html +21 -0
|
@@ -0,0 +1,1009 @@
|
|
|
1
|
+
import { openBlock as l, createElementBlock as n, createElementVNode as e, toDisplayString as r, ref as T, Fragment as x, renderList as I, normalizeClass as M, createCommentVNode as g, computed as y, renderSlot as j, createBlock as f, createVNode as p, withCtx as S, provide as E, resolveDynamicComponent as R, createStaticVNode as Y, createApp as q } from "vue";
|
|
2
|
+
import { createApp as ot } from "vue";
|
|
3
|
+
const O = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTAwIiB3aWR0aD0iMTAwIiB2aWV3Qm94PSIwIDAgMTAwMCAxMDAwIiBmaWxsPSIjZmZmIj48cGF0aCBkPSJNNzM4IDIwMEgyNjJjLTM0IDAtNjIgMjgtNjIgNjJ2NDc2YzAgMzQgMjggNjIgNjIgNjJoNDc2YzM0IDAgNjItMjggNjItNjJWMjYyYzAtMzQtMjgtNjItNjItNjJ6bS00NTUgNjJoNDM0YzExIDAgMjEgOSAyMSAyMXYzOUgyNjJ2LTM5YzAtMTIgOS0yMSAyMS0yMXptNDM0IDQ3NkgyODNjLTExIDAtMjEtOS0yMS0yMVYzODJoNDc2djMzNWMwIDEyLTkgMjEtMjEgMjF6TTQ2NyA2MzNsLTY2LTY2IDY2LTY2YzQtNCA0LTEwIDAtMTRsLTI4LTI4Yy00LTQtMTAtNC0xNCAwbC03MyA3My0xNSAxNS0xMyAxM2MtMiAyLTMgNS0zIDcgMCAzIDEgNSAzIDdsMTAyIDEwMmM0IDQgMTAgNCAxNCAwbDI4LTI4YzMtNSAzLTExLTEtMTV6bTIxMC03NC0xMy0xMy0xNS0xNS03My03M2MtNC00LTEwLTQtMTQgMGwtMjggMjhjLTQgNC00IDEwIDAgMTRsNjYgNjYtNjYgNjZjLTQgNC00IDEwIDAgMTRsMjggMjhjNCA0IDEwIDQgMTQgMGwxMDItMTAyYzItMiAzLTUgMy03eiIvPjwvc3ZnPg==";
|
|
4
|
+
const V = { class: "slds-page-header" }, G = { class: "slds-page-header__row" }, Q = { class: "slds-page-header__col-title" }, B = { class: "slds-media" }, J = { class: "slds-media__body" }, H = { class: "slds-page-header__name" }, Z = { class: "slds-page-header__name-title" }, U = ["title"], W = {
|
|
5
|
+
__name: "Header",
|
|
6
|
+
props: {
|
|
7
|
+
title: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "JSON Schema Documentation"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
setup(s) {
|
|
13
|
+
return (a, t) => (l(), n("header", V, [
|
|
14
|
+
e("div", G, [
|
|
15
|
+
e("div", Q, [
|
|
16
|
+
e("div", B, [
|
|
17
|
+
t[0] || (t[0] = e("div", { class: "slds-media__figure" }, [
|
|
18
|
+
e("span", { class: "slds-icon_container slds-icon-standard-account" }, [
|
|
19
|
+
e("img", {
|
|
20
|
+
src: O,
|
|
21
|
+
class: "slds-icon slds-icon_small",
|
|
22
|
+
alt: ""
|
|
23
|
+
})
|
|
24
|
+
])
|
|
25
|
+
], -1)),
|
|
26
|
+
e("div", J, [
|
|
27
|
+
e("div", H, [
|
|
28
|
+
e("div", Z, [
|
|
29
|
+
e("h1", {
|
|
30
|
+
class: "slds-page-header__title slds-truncate",
|
|
31
|
+
title: s.title
|
|
32
|
+
}, r(s.title), 9, U)
|
|
33
|
+
])
|
|
34
|
+
])
|
|
35
|
+
])
|
|
36
|
+
])
|
|
37
|
+
])
|
|
38
|
+
])
|
|
39
|
+
]));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const F = { class: "slds-navigation-list--vertical" }, X = { class: "slds-navigation-list__item-content" }, K = { class: "slds-navigation-list__item-title" }, ee = ["onClick"], se = {
|
|
43
|
+
__name: "Sidebar",
|
|
44
|
+
props: {
|
|
45
|
+
schemas: {
|
|
46
|
+
type: Array,
|
|
47
|
+
required: !0
|
|
48
|
+
},
|
|
49
|
+
selectedSchema: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: null
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
emits: ["select-schema"],
|
|
55
|
+
setup(s, { emit: a }) {
|
|
56
|
+
var _;
|
|
57
|
+
const t = s, d = a, i = T(((_ = t.selectedSchema) == null ? void 0 : _.fileName) || null), m = (o) => {
|
|
58
|
+
i.value = o.fileName, d("select-schema", o);
|
|
59
|
+
}, v = (o) => {
|
|
60
|
+
var c;
|
|
61
|
+
return ((c = o.schema) == null ? void 0 : c.title) || o.fileName || "Untitled Schema";
|
|
62
|
+
};
|
|
63
|
+
return (o, c) => (l(), n("div", F, [
|
|
64
|
+
c[0] || (c[0] = e("div", { class: "slds-navigation-list__item" }, [
|
|
65
|
+
e("div", { class: "slds-navigation-list__item-content" }, [
|
|
66
|
+
e("div", { class: "slds-navigation-list__item-title" }, [
|
|
67
|
+
e("span", { class: "slds-text-heading_small" }, "Schemas")
|
|
68
|
+
])
|
|
69
|
+
])
|
|
70
|
+
], -1)),
|
|
71
|
+
(l(!0), n(x, null, I(s.schemas, (h) => (l(), n("div", {
|
|
72
|
+
class: "slds-navigation-list__item",
|
|
73
|
+
key: h.fileName
|
|
74
|
+
}, [
|
|
75
|
+
e("div", X, [
|
|
76
|
+
e("div", K, [
|
|
77
|
+
e("button", {
|
|
78
|
+
class: M(["slds-button slds-button_neutral slds-button_stretch", { "slds-is-active": i.value === h.fileName }]),
|
|
79
|
+
onClick: (u) => m(h)
|
|
80
|
+
}, r(v(h)), 11, ee)
|
|
81
|
+
])
|
|
82
|
+
])
|
|
83
|
+
]))), 128))
|
|
84
|
+
]));
|
|
85
|
+
}
|
|
86
|
+
}, te = { class: "slds-p-around_medium slds-theme_shade slds-text-align_center slds-text-body_small slds-mt-auto" }, le = { class: "slds-grid slds-grid_align-spread slds-wrap" }, ae = { class: "slds-col slds-size_1-of-1 slds-medium-size_1-of-3 slds-p-vertical_x-small" }, ie = {
|
|
87
|
+
key: 0,
|
|
88
|
+
class: "slds-text-color_weak"
|
|
89
|
+
}, ne = { class: "slds-col slds-size_1-of-1 slds-medium-size_1-of-3 slds-p-vertical_x-small" }, oe = { class: "slds-text-color_weak" }, de = { class: "slds-col slds-size_1-of-1 slds-medium-size_1-of-3 slds-p-vertical_x-small" }, ce = { class: "slds-text-color_weak" }, re = {
|
|
90
|
+
__name: "Footer",
|
|
91
|
+
props: {
|
|
92
|
+
description: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: ""
|
|
95
|
+
},
|
|
96
|
+
generatedAt: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: () => (/* @__PURE__ */ new Date()).toISOString()
|
|
99
|
+
},
|
|
100
|
+
schemaCount: {
|
|
101
|
+
type: Number,
|
|
102
|
+
default: 0
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
setup(s) {
|
|
106
|
+
const a = (t) => new Date(t).toLocaleString();
|
|
107
|
+
return (t, d) => (l(), n("footer", te, [
|
|
108
|
+
e("div", le, [
|
|
109
|
+
e("div", ae, [
|
|
110
|
+
s.description ? (l(), n("span", ie, r(s.description), 1)) : g("", !0)
|
|
111
|
+
]),
|
|
112
|
+
e("div", ne, [
|
|
113
|
+
e("span", oe, r(s.schemaCount) + " schema" + r(s.schemaCount !== 1 ? "s" : "") + " documented ", 1)
|
|
114
|
+
]),
|
|
115
|
+
e("div", de, [
|
|
116
|
+
e("span", ce, " Generated at: " + r(a(s.generatedAt)), 1)
|
|
117
|
+
])
|
|
118
|
+
])
|
|
119
|
+
]));
|
|
120
|
+
}
|
|
121
|
+
}, me = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNTIiIHdpZHRoPSI1MiIgdmlld0JveD0iMCAwIDUyMCA1MjAiIGZpbGw9IiNmZmYiPjxwYXRoIGQ9Ik00NzYgMTc4IDI3MSAzODVjLTYgNi0xNiA2LTIyIDBMNDQgMTc4Yy02LTYtNi0xNiAwLTIybDIyLTIyYzYtNiAxNi02IDIyIDBsMTYxIDE2M2M2IDYgMTYgNiAyMiAwbDE2MS0xNjNjNi02IDE2LTYgMjIgMGwyMiAyMmM1IDcgNSAxNiAwIDIyeiIvPjwvc3ZnPg==";
|
|
122
|
+
const ue = { class: "slds-box slds-m-top_small" }, _e = { class: "slds-box slds-theme_shade" }, he = { class: "slds-dl_horizontal slds-wrap" }, ve = { class: "slds-size_1-of-3 slds-p-around_xx-small" }, pe = { class: "slds-text-title_caps" }, ye = { class: "slds-size_2-of-3 slds-p-around_xx-small" }, ge = { class: "slds-text-body_regular" }, k = {
|
|
123
|
+
__name: "SchemaConstraints",
|
|
124
|
+
props: {
|
|
125
|
+
schema: {
|
|
126
|
+
type: Object,
|
|
127
|
+
required: !0
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
setup(s) {
|
|
131
|
+
const a = s, t = y(() => {
|
|
132
|
+
const m = {};
|
|
133
|
+
return [
|
|
134
|
+
"minimum",
|
|
135
|
+
"maximum",
|
|
136
|
+
"exclusiveMinimum",
|
|
137
|
+
"exclusiveMaximum",
|
|
138
|
+
"minLength",
|
|
139
|
+
"maxLength",
|
|
140
|
+
"pattern",
|
|
141
|
+
"minItems",
|
|
142
|
+
"maxItems",
|
|
143
|
+
"uniqueItems",
|
|
144
|
+
"minProperties",
|
|
145
|
+
"maxProperties"
|
|
146
|
+
].forEach((_) => {
|
|
147
|
+
a.schema[_] !== void 0 && (m[_] = a.schema[_]);
|
|
148
|
+
}), m;
|
|
149
|
+
}), d = (m) => m.replace(/([A-Z])/g, " $1").replace(/^./, (v) => v.toUpperCase()), i = (m) => typeof m == "boolean" ? m ? "Yes" : "No" : m;
|
|
150
|
+
return (m, v) => (l(), n("div", ue, [
|
|
151
|
+
v[0] || (v[0] = e("div", { class: "slds-text-heading_small slds-m-bottom_small" }, "Constraints", -1)),
|
|
152
|
+
e("div", _e, [
|
|
153
|
+
e("dl", he, [
|
|
154
|
+
(l(!0), n(x, null, I(t.value, (_, o) => (l(), n(x, { key: o }, [
|
|
155
|
+
e("dt", ve, [
|
|
156
|
+
e("div", pe, r(d(o)), 1)
|
|
157
|
+
]),
|
|
158
|
+
e("dd", ye, [
|
|
159
|
+
e("div", ge, r(i(_)), 1)
|
|
160
|
+
])
|
|
161
|
+
], 64))), 128))
|
|
162
|
+
])
|
|
163
|
+
])
|
|
164
|
+
]));
|
|
165
|
+
}
|
|
166
|
+
}, $ = {
|
|
167
|
+
__name: "NestedSchemaContainer",
|
|
168
|
+
setup(s) {
|
|
169
|
+
return (a, t) => (l(), n("div", null, [
|
|
170
|
+
e("div", null, [
|
|
171
|
+
j(a.$slots, "default")
|
|
172
|
+
])
|
|
173
|
+
]));
|
|
174
|
+
}
|
|
175
|
+
}, L = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNTIiIHdpZHRoPSI1MiIgdmlld0JveD0iMCAwIDUyMCA1MjAiIGZpbGw9IiNmZmYiPjxwYXRoIGQ9Ik01MTQgNDI1IDI4NSA1NWEyOCAyOCAwIDAgMC01MCAwTDYgNDI1Yy0xNCAyMyAwIDU1IDI1IDU1aDQ1OGMyNSAwIDQwLTMyIDI1LTU1em0tMjU0LTI1Yy0xNyAwLTMwLTEzLTMwLTMwczEzLTMwIDMwLTMwIDMwIDEzIDMwIDMwLTEzIDMwLTMwIDMwem0zMC05MGMwIDYtNCAxMC0xMCAxMGgtNDBjLTYgMC0xMC00LTEwLTEwVjE4MGMwLTYgNC0xMCAxMC0xMGg0MGM2IDAgMTAgNCAxMCAxMHYxMzB6Ii8+PC9zdmc+";
|
|
176
|
+
const P = (s, a) => {
|
|
177
|
+
const t = s.__vccOpts || s;
|
|
178
|
+
for (const [d, i] of a)
|
|
179
|
+
t[d] = i;
|
|
180
|
+
return t;
|
|
181
|
+
}, fe = {
|
|
182
|
+
class: "slds-notify slds-notify_alert slds-theme_alert-texture slds-theme_warning",
|
|
183
|
+
role: "alert"
|
|
184
|
+
}, be = { class: "slds-notify__content" }, xe = {
|
|
185
|
+
__name: "NoPropertiesMessage",
|
|
186
|
+
props: {
|
|
187
|
+
title: {
|
|
188
|
+
type: String,
|
|
189
|
+
default: "No Properties Defined"
|
|
190
|
+
},
|
|
191
|
+
message: {
|
|
192
|
+
type: String,
|
|
193
|
+
default: "This object doesn't have any properties defined in the schema."
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
setup(s) {
|
|
197
|
+
return (a, t) => (l(), n("div", fe, [
|
|
198
|
+
t[0] || (t[0] = e("span", { class: "slds-assistive-text" }, "warning", -1)),
|
|
199
|
+
t[1] || (t[1] = e("span", { class: "slds-icon_container slds-icon-utility-warning slds-m-right_x-small" }, [
|
|
200
|
+
e("img", {
|
|
201
|
+
src: L,
|
|
202
|
+
class: "slds-icon slds-icon_x-small warning-icon",
|
|
203
|
+
alt: ""
|
|
204
|
+
})
|
|
205
|
+
], -1)),
|
|
206
|
+
e("h2", null, r(s.title), 1),
|
|
207
|
+
e("div", be, [
|
|
208
|
+
e("p", null, r(s.message), 1)
|
|
209
|
+
])
|
|
210
|
+
]));
|
|
211
|
+
}
|
|
212
|
+
}, w = /* @__PURE__ */ P(xe, [["__scopeId", "data-v-4fd65729"]]);
|
|
213
|
+
const Me = { key: 1 }, Se = { key: 2 }, Ie = { class: "slds-box slds-m-top_small" }, $e = { class: "slds-table_container" }, Ne = { class: "slds-table slds-table_cell-buffer slds-table_bordered" }, Ae = { class: "slds-hint-parent" }, Te = ["title"], De = { class: "slds-truncate" }, we = { class: "slds-badge" }, Ce = ["onClick", "title"], je = ["title"], Oe = { class: "slds-truncate" }, ke = {
|
|
214
|
+
key: 0,
|
|
215
|
+
class: "slds-badge slds-badge_success"
|
|
216
|
+
}, Le = {
|
|
217
|
+
key: 1,
|
|
218
|
+
class: "slds-badge slds-badge_inverse"
|
|
219
|
+
}, Pe = { key: 0 }, ze = {
|
|
220
|
+
colspan: "4",
|
|
221
|
+
class: "slds-p-around_medium"
|
|
222
|
+
}, Ee = { class: "slds-box slds-theme_shade" }, Re = { key: 4 }, Ye = { key: 0 }, qe = { key: 5 }, Ve = {
|
|
223
|
+
__name: "ObjectSchema",
|
|
224
|
+
props: {
|
|
225
|
+
schema: {
|
|
226
|
+
type: Object,
|
|
227
|
+
required: !0
|
|
228
|
+
},
|
|
229
|
+
rootSchema: {
|
|
230
|
+
type: Object,
|
|
231
|
+
required: !0
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
setup(s) {
|
|
235
|
+
const a = s, t = T({}), d = y(() => ["minProperties", "maxProperties"].some((c) => c in a.schema)), i = y(() => a.schema.properties && Object.keys(a.schema.properties).length > 0), m = (o) => a.schema.required && a.schema.required.includes(o), v = (o) => o.type === "object" || o.type === "array" || Array.isArray(o.type) && (o.type.includes("object") || o.type.includes("array")), _ = (o) => {
|
|
236
|
+
t.value[o] = !t.value[o];
|
|
237
|
+
};
|
|
238
|
+
return (o, c) => (l(), n("div", null, [
|
|
239
|
+
c[7] || (c[7] = e("div", null, [
|
|
240
|
+
e("div", null, "Type: object")
|
|
241
|
+
], -1)),
|
|
242
|
+
d.value ? (l(), f(k, {
|
|
243
|
+
key: 0,
|
|
244
|
+
schema: s.schema
|
|
245
|
+
}, null, 8, ["schema"])) : g("", !0),
|
|
246
|
+
s.schema.required && s.schema.required.length > 0 ? (l(), n("div", Me, [
|
|
247
|
+
c[0] || (c[0] = e("span", null, "Required properties:", -1)),
|
|
248
|
+
e("span", null, r(s.schema.required.join(", ")), 1)
|
|
249
|
+
])) : g("", !0),
|
|
250
|
+
i.value ? (l(), n("div", Se, [
|
|
251
|
+
e("div", Ie, [
|
|
252
|
+
c[3] || (c[3] = e("div", { class: "slds-text-heading_small slds-m-bottom_small" }, "Properties", -1)),
|
|
253
|
+
e("div", $e, [
|
|
254
|
+
e("table", Ne, [
|
|
255
|
+
c[2] || (c[2] = e("thead", null, [
|
|
256
|
+
e("tr", { class: "slds-line-height_reset" }, [
|
|
257
|
+
e("th", {
|
|
258
|
+
class: "slds-text-title_caps",
|
|
259
|
+
scope: "col"
|
|
260
|
+
}, [
|
|
261
|
+
e("div", {
|
|
262
|
+
class: "slds-truncate",
|
|
263
|
+
title: "Property"
|
|
264
|
+
}, "Property")
|
|
265
|
+
]),
|
|
266
|
+
e("th", {
|
|
267
|
+
class: "slds-text-title_caps",
|
|
268
|
+
scope: "col"
|
|
269
|
+
}, [
|
|
270
|
+
e("div", {
|
|
271
|
+
class: "slds-truncate",
|
|
272
|
+
title: "Type"
|
|
273
|
+
}, "Type")
|
|
274
|
+
]),
|
|
275
|
+
e("th", {
|
|
276
|
+
class: "slds-text-title_caps",
|
|
277
|
+
scope: "col"
|
|
278
|
+
}, [
|
|
279
|
+
e("div", {
|
|
280
|
+
class: "slds-truncate",
|
|
281
|
+
title: "Description"
|
|
282
|
+
}, "Description")
|
|
283
|
+
]),
|
|
284
|
+
e("th", {
|
|
285
|
+
class: "slds-text-title_caps",
|
|
286
|
+
scope: "col"
|
|
287
|
+
}, [
|
|
288
|
+
e("div", {
|
|
289
|
+
class: "slds-truncate",
|
|
290
|
+
title: "Required"
|
|
291
|
+
}, "Required")
|
|
292
|
+
])
|
|
293
|
+
])
|
|
294
|
+
], -1)),
|
|
295
|
+
e("tbody", null, [
|
|
296
|
+
(l(!0), n(x, null, I(s.schema.properties, (h, u) => (l(), n(x, { key: u }, [
|
|
297
|
+
e("tr", Ae, [
|
|
298
|
+
e("td", null, [
|
|
299
|
+
e("div", {
|
|
300
|
+
class: "slds-truncate",
|
|
301
|
+
title: u
|
|
302
|
+
}, r(u), 9, Te)
|
|
303
|
+
]),
|
|
304
|
+
e("td", null, [
|
|
305
|
+
e("div", De, [
|
|
306
|
+
e("span", we, r(h.type), 1),
|
|
307
|
+
v(h) ? (l(), n("button", {
|
|
308
|
+
key: 0,
|
|
309
|
+
class: "slds-button slds-button_icon slds-button_icon_small slds-m-left_x-small",
|
|
310
|
+
onClick: (z) => _(u),
|
|
311
|
+
title: t.value[u] ? "Collapse" : "Expand"
|
|
312
|
+
}, c[1] || (c[1] = [
|
|
313
|
+
e("img", {
|
|
314
|
+
src: me,
|
|
315
|
+
class: "slds-button__icon",
|
|
316
|
+
alt: ""
|
|
317
|
+
}, null, -1)
|
|
318
|
+
]), 8, Ce)) : g("", !0)
|
|
319
|
+
])
|
|
320
|
+
]),
|
|
321
|
+
e("td", null, [
|
|
322
|
+
e("div", {
|
|
323
|
+
class: "slds-truncate",
|
|
324
|
+
title: h.description
|
|
325
|
+
}, r(h.description || "No description"), 9, je)
|
|
326
|
+
]),
|
|
327
|
+
e("td", null, [
|
|
328
|
+
e("div", Oe, [
|
|
329
|
+
m(u) ? (l(), n("span", ke, "Required")) : (l(), n("span", Le, "Optional"))
|
|
330
|
+
])
|
|
331
|
+
])
|
|
332
|
+
]),
|
|
333
|
+
v(h) && t.value[u] ? (l(), n("tr", Pe, [
|
|
334
|
+
e("td", ze, [
|
|
335
|
+
e("div", Ee, [
|
|
336
|
+
p(b, {
|
|
337
|
+
schema: h,
|
|
338
|
+
rootSchema: s.rootSchema,
|
|
339
|
+
isRoot: !1
|
|
340
|
+
}, null, 8, ["schema", "rootSchema"])
|
|
341
|
+
])
|
|
342
|
+
])
|
|
343
|
+
])) : g("", !0)
|
|
344
|
+
], 64))), 128))
|
|
345
|
+
])
|
|
346
|
+
])
|
|
347
|
+
])
|
|
348
|
+
])
|
|
349
|
+
])) : (l(), f(w, { key: 3 })),
|
|
350
|
+
s.schema.additionalProperties !== void 0 ? (l(), n("div", Re, [
|
|
351
|
+
c[4] || (c[4] = e("div", null, "Additional Properties", -1)),
|
|
352
|
+
typeof s.schema.additionalProperties == "boolean" ? (l(), n("div", Ye, [
|
|
353
|
+
e("span", {
|
|
354
|
+
class: M(s.schema.additionalProperties ? "status-allowed" : "status-denied")
|
|
355
|
+
}, r(s.schema.additionalProperties ? "Allowed" : "Not allowed"), 3)
|
|
356
|
+
])) : (l(), f($, { key: 1 }, {
|
|
357
|
+
default: S(() => [
|
|
358
|
+
p(b, {
|
|
359
|
+
schema: s.schema.additionalProperties,
|
|
360
|
+
rootSchema: s.rootSchema,
|
|
361
|
+
isRoot: !1
|
|
362
|
+
}, null, 8, ["schema", "rootSchema"])
|
|
363
|
+
]),
|
|
364
|
+
_: 1
|
|
365
|
+
}))
|
|
366
|
+
])) : g("", !0),
|
|
367
|
+
s.schema.patternProperties ? (l(), n("div", qe, [
|
|
368
|
+
c[6] || (c[6] = e("div", null, "Pattern Properties", -1)),
|
|
369
|
+
e("div", null, [
|
|
370
|
+
(l(!0), n(x, null, I(s.schema.patternProperties, (h, u) => (l(), n("div", { key: u }, [
|
|
371
|
+
p($, null, {
|
|
372
|
+
default: S(() => [
|
|
373
|
+
e("div", null, [
|
|
374
|
+
e("div", null, [
|
|
375
|
+
c[5] || (c[5] = e("span", null, "Pattern:", -1)),
|
|
376
|
+
e("code", null, r(u), 1)
|
|
377
|
+
])
|
|
378
|
+
]),
|
|
379
|
+
p(b, {
|
|
380
|
+
schema: h,
|
|
381
|
+
rootSchema: s.rootSchema,
|
|
382
|
+
isRoot: !1
|
|
383
|
+
}, null, 8, ["schema", "rootSchema"])
|
|
384
|
+
]),
|
|
385
|
+
_: 2
|
|
386
|
+
}, 1024)
|
|
387
|
+
]))), 128))
|
|
388
|
+
])
|
|
389
|
+
])) : g("", !0)
|
|
390
|
+
]));
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
const Ge = { key: 1 }, Qe = { key: 3 }, Be = { key: 4 }, Je = { key: 0 }, He = {
|
|
394
|
+
key: 5,
|
|
395
|
+
class: "slds-box slds-m-top_small"
|
|
396
|
+
}, Ze = { class: "slds-box slds-theme_shade" }, Ue = { class: "slds-text-body_regular" }, We = { class: "slds-grid slds-gutters" }, Fe = { class: "slds-col" }, Xe = { class: "slds-badge" }, Ke = { class: "slds-col" }, es = {
|
|
397
|
+
__name: "ArraySchema",
|
|
398
|
+
props: {
|
|
399
|
+
schema: {
|
|
400
|
+
type: Object,
|
|
401
|
+
required: !0
|
|
402
|
+
},
|
|
403
|
+
rootSchema: {
|
|
404
|
+
type: Object,
|
|
405
|
+
required: !0
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
setup(s) {
|
|
409
|
+
const a = s, t = y(() => ["minItems", "maxItems", "uniqueItems"].some((i) => i in a.schema));
|
|
410
|
+
return (d, i) => (l(), n("div", null, [
|
|
411
|
+
i[6] || (i[6] = e("div", null, [
|
|
412
|
+
e("span", null, "Type: array")
|
|
413
|
+
], -1)),
|
|
414
|
+
t.value ? (l(), f(k, {
|
|
415
|
+
key: 0,
|
|
416
|
+
schema: s.schema
|
|
417
|
+
}, null, 8, ["schema"])) : g("", !0),
|
|
418
|
+
s.schema.items ? (l(), n("div", Ge, [
|
|
419
|
+
i[0] || (i[0] = e("div", null, "Items:", -1)),
|
|
420
|
+
p($, null, {
|
|
421
|
+
default: S(() => [
|
|
422
|
+
Array.isArray(s.schema.items) ? (l(!0), n(x, { key: 0 }, I(s.schema.items, (m, v) => (l(), n("div", { key: v }, [
|
|
423
|
+
e("div", null, " Index " + r(v) + ": ", 1),
|
|
424
|
+
p(b, {
|
|
425
|
+
schema: m,
|
|
426
|
+
rootSchema: s.rootSchema,
|
|
427
|
+
isRoot: !1
|
|
428
|
+
}, null, 8, ["schema", "rootSchema"])
|
|
429
|
+
]))), 128)) : (l(), f(b, {
|
|
430
|
+
key: 1,
|
|
431
|
+
schema: s.schema.items,
|
|
432
|
+
rootSchema: s.rootSchema,
|
|
433
|
+
isRoot: !1
|
|
434
|
+
}, null, 8, ["schema", "rootSchema"]))
|
|
435
|
+
]),
|
|
436
|
+
_: 1
|
|
437
|
+
})
|
|
438
|
+
])) : (l(), f(w, {
|
|
439
|
+
key: 2,
|
|
440
|
+
title: "No Items Defined",
|
|
441
|
+
message: "This array doesn't have any items defined in the schema."
|
|
442
|
+
})),
|
|
443
|
+
s.schema.contains ? (l(), n("div", Qe, [
|
|
444
|
+
i[1] || (i[1] = e("div", null, "Contains:", -1)),
|
|
445
|
+
p($, null, {
|
|
446
|
+
default: S(() => [
|
|
447
|
+
p(b, {
|
|
448
|
+
schema: s.schema.contains,
|
|
449
|
+
rootSchema: s.rootSchema,
|
|
450
|
+
isRoot: !1
|
|
451
|
+
}, null, 8, ["schema", "rootSchema"])
|
|
452
|
+
]),
|
|
453
|
+
_: 1
|
|
454
|
+
})
|
|
455
|
+
])) : g("", !0),
|
|
456
|
+
s.schema.additionalItems !== void 0 && Array.isArray(s.schema.items) ? (l(), n("div", Be, [
|
|
457
|
+
i[2] || (i[2] = e("div", null, "Additional Items:", -1)),
|
|
458
|
+
typeof s.schema.additionalItems == "boolean" ? (l(), n("div", Je, [
|
|
459
|
+
e("span", {
|
|
460
|
+
class: M(s.schema.additionalItems ? "status-allowed" : "status-denied")
|
|
461
|
+
}, r(s.schema.additionalItems ? "Allowed" : "Not allowed"), 3)
|
|
462
|
+
])) : (l(), f($, { key: 1 }, {
|
|
463
|
+
default: S(() => [
|
|
464
|
+
p(b, {
|
|
465
|
+
schema: s.schema.additionalItems,
|
|
466
|
+
rootSchema: s.rootSchema,
|
|
467
|
+
isRoot: !1
|
|
468
|
+
}, null, 8, ["schema", "rootSchema"])
|
|
469
|
+
]),
|
|
470
|
+
_: 1
|
|
471
|
+
}))
|
|
472
|
+
])) : g("", !0),
|
|
473
|
+
s.schema.items ? (l(), n("div", He, [
|
|
474
|
+
i[5] || (i[5] = e("div", { class: "slds-text-heading_small slds-m-bottom_small" }, "Array Items", -1)),
|
|
475
|
+
e("div", Ze, [
|
|
476
|
+
e("div", Ue, [
|
|
477
|
+
e("div", We, [
|
|
478
|
+
e("div", Fe, [
|
|
479
|
+
i[3] || (i[3] = e("div", { class: "slds-text-title_caps slds-m-bottom_xx-small" }, "Type", -1)),
|
|
480
|
+
e("div", Xe, r(s.schema.items.type), 1)
|
|
481
|
+
]),
|
|
482
|
+
e("div", Ke, [
|
|
483
|
+
i[4] || (i[4] = e("div", { class: "slds-text-title_caps slds-m-bottom_xx-small" }, "Description", -1)),
|
|
484
|
+
e("div", null, r(s.schema.items.description || "No description"), 1)
|
|
485
|
+
])
|
|
486
|
+
])
|
|
487
|
+
])
|
|
488
|
+
])
|
|
489
|
+
])) : g("", !0)
|
|
490
|
+
]));
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
const ss = { class: "slds-box slds-m-top_small" }, ts = { class: "slds-box slds-theme_shade" }, ls = { class: "slds-text-body_regular" }, as = { class: "slds-grid slds-gutters" }, is = { class: "slds-col" }, ns = { class: "slds-badge" }, os = { class: "slds-col" }, N = {
|
|
494
|
+
__name: "PrimitiveSchema",
|
|
495
|
+
props: {
|
|
496
|
+
schema: {
|
|
497
|
+
type: Object,
|
|
498
|
+
required: !0
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
setup(s) {
|
|
502
|
+
const a = s;
|
|
503
|
+
return y(() => ({
|
|
504
|
+
string: ["minLength", "maxLength", "pattern"],
|
|
505
|
+
number: ["minimum", "maximum", "exclusiveMinimum", "exclusiveMaximum", "multipleOf"],
|
|
506
|
+
integer: ["minimum", "maximum", "exclusiveMinimum", "exclusiveMaximum", "multipleOf"]
|
|
507
|
+
}[a.schema.type] || []).some((i) => i in a.schema)), y(() => ({
|
|
508
|
+
string: "type-string",
|
|
509
|
+
number: "type-number",
|
|
510
|
+
integer: "type-integer",
|
|
511
|
+
boolean: "type-boolean",
|
|
512
|
+
null: "type-null"
|
|
513
|
+
})[a.schema.type] || ""), (t, d) => (l(), n("div", ss, [
|
|
514
|
+
d[2] || (d[2] = e("div", { class: "slds-text-heading_small slds-m-bottom_small" }, "Type Information", -1)),
|
|
515
|
+
e("div", ts, [
|
|
516
|
+
e("div", ls, [
|
|
517
|
+
e("div", as, [
|
|
518
|
+
e("div", is, [
|
|
519
|
+
d[0] || (d[0] = e("div", { class: "slds-text-title_caps slds-m-bottom_xx-small" }, "Type", -1)),
|
|
520
|
+
e("div", ns, r(s.schema.type), 1)
|
|
521
|
+
]),
|
|
522
|
+
e("div", os, [
|
|
523
|
+
d[1] || (d[1] = e("div", { class: "slds-text-title_caps slds-m-bottom_xx-small" }, "Description", -1)),
|
|
524
|
+
e("div", null, r(s.schema.description || "No description"), 1)
|
|
525
|
+
])
|
|
526
|
+
])
|
|
527
|
+
])
|
|
528
|
+
])
|
|
529
|
+
]));
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
const ds = { class: "slds-box slds-theme_shade" }, cs = { class: "slds-text-heading_small slds-m-bottom_small" }, rs = { class: "slds-tabs_default" }, ms = {
|
|
533
|
+
class: "slds-tabs_default__nav",
|
|
534
|
+
role: "tablist"
|
|
535
|
+
}, us = ["aria-selected", "aria-controls", "onClick"], _s = { class: "slds-tabs_default__title" }, hs = ["id"], vs = { class: "slds-p-around_medium" }, ps = { class: "slds-text-title_caps slds-m-bottom_small" }, ys = {
|
|
536
|
+
__name: "CompositionSchema",
|
|
537
|
+
props: {
|
|
538
|
+
schema: {
|
|
539
|
+
type: Object,
|
|
540
|
+
required: !0
|
|
541
|
+
},
|
|
542
|
+
compositionType: {
|
|
543
|
+
type: String,
|
|
544
|
+
required: !0,
|
|
545
|
+
validator: (s) => ["anyOf", "oneOf", "allOf"].includes(s)
|
|
546
|
+
},
|
|
547
|
+
rootSchema: {
|
|
548
|
+
type: Object,
|
|
549
|
+
required: !0
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
setup(s) {
|
|
553
|
+
const a = s, t = T(0), d = y(() => a.schema[a.compositionType] || []), i = y(() => {
|
|
554
|
+
switch (a.compositionType) {
|
|
555
|
+
case "oneOf":
|
|
556
|
+
return "One Of (Choose One)";
|
|
557
|
+
case "anyOf":
|
|
558
|
+
return "Any Of (Choose Any)";
|
|
559
|
+
case "allOf":
|
|
560
|
+
return "All Of (Must Match All)";
|
|
561
|
+
default:
|
|
562
|
+
return a.compositionType;
|
|
563
|
+
}
|
|
564
|
+
}), m = y(() => {
|
|
565
|
+
switch (a.compositionType) {
|
|
566
|
+
case "oneOf":
|
|
567
|
+
return "slds-badge_success";
|
|
568
|
+
case "anyOf":
|
|
569
|
+
return "slds-badge_warning";
|
|
570
|
+
case "allOf":
|
|
571
|
+
return "slds-badge_inverse";
|
|
572
|
+
default:
|
|
573
|
+
return "";
|
|
574
|
+
}
|
|
575
|
+
}), v = (o) => Array.isArray(o.type) ? o.type.join(" | ") : o.type || "object", _ = (o, c) => o.title ? o.title : `Option ${c + 1}`;
|
|
576
|
+
return (o, c) => (l(), n("div", ds, [
|
|
577
|
+
e("div", cs, [
|
|
578
|
+
e("span", {
|
|
579
|
+
class: M(["slds-badge", m.value])
|
|
580
|
+
}, r(i.value), 3)
|
|
581
|
+
]),
|
|
582
|
+
e("div", rs, [
|
|
583
|
+
e("ul", ms, [
|
|
584
|
+
(l(!0), n(x, null, I(d.value, (h, u) => (l(), n("li", {
|
|
585
|
+
key: u,
|
|
586
|
+
class: M(["slds-tabs_default__item", { "slds-is-active": t.value === u }]),
|
|
587
|
+
role: "presentation"
|
|
588
|
+
}, [
|
|
589
|
+
e("a", {
|
|
590
|
+
class: "slds-tabs_default__link",
|
|
591
|
+
role: "tab",
|
|
592
|
+
tabindex: "0",
|
|
593
|
+
"aria-selected": t.value === u,
|
|
594
|
+
"aria-controls": `tab-${u}`,
|
|
595
|
+
onClick: (z) => t.value = u
|
|
596
|
+
}, [
|
|
597
|
+
e("span", _s, r(_(h, u)), 1)
|
|
598
|
+
], 8, us)
|
|
599
|
+
], 2))), 128))
|
|
600
|
+
]),
|
|
601
|
+
(l(!0), n(x, null, I(d.value, (h, u) => (l(), n("div", {
|
|
602
|
+
key: u,
|
|
603
|
+
id: `tab-${u}`,
|
|
604
|
+
class: M(["slds-tabs_default__content", { "slds-show": t.value === u, "slds-hide": t.value !== u }]),
|
|
605
|
+
role: "tabpanel"
|
|
606
|
+
}, [
|
|
607
|
+
e("div", vs, [
|
|
608
|
+
e("div", ps, "Schema Type: " + r(v(h)), 1),
|
|
609
|
+
p($, null, {
|
|
610
|
+
default: S(() => [
|
|
611
|
+
p(b, {
|
|
612
|
+
schema: h,
|
|
613
|
+
rootSchema: s.rootSchema,
|
|
614
|
+
isRoot: !1
|
|
615
|
+
}, null, 8, ["schema", "rootSchema"])
|
|
616
|
+
]),
|
|
617
|
+
_: 2
|
|
618
|
+
}, 1024)
|
|
619
|
+
])
|
|
620
|
+
], 10, hs))), 128))
|
|
621
|
+
])
|
|
622
|
+
]));
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
const gs = ["title"], fs = { key: 0 }, bs = { key: 1 }, xs = {
|
|
626
|
+
__name: "ReferenceResolver",
|
|
627
|
+
props: {
|
|
628
|
+
schema: {
|
|
629
|
+
type: Object,
|
|
630
|
+
required: !0
|
|
631
|
+
},
|
|
632
|
+
rootSchema: {
|
|
633
|
+
type: Object,
|
|
634
|
+
required: !0
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
emits: ["navigate-to-definition"],
|
|
638
|
+
setup(s, { emit: a }) {
|
|
639
|
+
const t = s, d = a, i = (_) => {
|
|
640
|
+
const o = _.split("/");
|
|
641
|
+
return o[o.length - 1];
|
|
642
|
+
}, m = y(() => {
|
|
643
|
+
if (!t.schema.$ref)
|
|
644
|
+
return null;
|
|
645
|
+
const _ = t.schema.$ref.split("/");
|
|
646
|
+
let o = t.rootSchema;
|
|
647
|
+
for (let c = 1; c < _.length; c++) {
|
|
648
|
+
if (!o)
|
|
649
|
+
return null;
|
|
650
|
+
o = o[_[c]];
|
|
651
|
+
}
|
|
652
|
+
return o;
|
|
653
|
+
}), v = () => {
|
|
654
|
+
d("navigate-to-definition", {
|
|
655
|
+
definitionName: i(t.schema.$ref)
|
|
656
|
+
});
|
|
657
|
+
};
|
|
658
|
+
return (_, o) => (l(), n("div", null, [
|
|
659
|
+
e("div", null, [
|
|
660
|
+
o[0] || (o[0] = e("span", null, "Reference", -1)),
|
|
661
|
+
e("button", {
|
|
662
|
+
onClick: v,
|
|
663
|
+
title: s.schema.$ref
|
|
664
|
+
}, r(i(s.schema.$ref)), 9, gs)
|
|
665
|
+
]),
|
|
666
|
+
m.value ? (l(), n("div", fs, [
|
|
667
|
+
p($, null, {
|
|
668
|
+
default: S(() => [
|
|
669
|
+
p(b, {
|
|
670
|
+
schema: m.value,
|
|
671
|
+
rootSchema: s.rootSchema,
|
|
672
|
+
isRoot: !1
|
|
673
|
+
}, null, 8, ["schema", "rootSchema"])
|
|
674
|
+
]),
|
|
675
|
+
_: 1
|
|
676
|
+
})
|
|
677
|
+
])) : (l(), n("div", bs, [
|
|
678
|
+
e("div", null, [
|
|
679
|
+
o[2] || (o[2] = e("div", null, [
|
|
680
|
+
e("span", null, [
|
|
681
|
+
e("img", {
|
|
682
|
+
src: L,
|
|
683
|
+
class: "warning-icon",
|
|
684
|
+
alt: ""
|
|
685
|
+
})
|
|
686
|
+
])
|
|
687
|
+
], -1)),
|
|
688
|
+
e("div", null, [
|
|
689
|
+
o[1] || (o[1] = e("h3", null, "Reference Not Found", -1)),
|
|
690
|
+
e("p", null, "Could not resolve reference: " + r(s.schema.$ref), 1)
|
|
691
|
+
])
|
|
692
|
+
])
|
|
693
|
+
]))
|
|
694
|
+
]));
|
|
695
|
+
}
|
|
696
|
+
}, Ms = /* @__PURE__ */ P(xs, [["__scopeId", "data-v-c4f26fb8"]]);
|
|
697
|
+
function D(s, a) {
|
|
698
|
+
if (!s)
|
|
699
|
+
return s;
|
|
700
|
+
if (s.$ref) {
|
|
701
|
+
const t = s.$ref.split("/");
|
|
702
|
+
let d = a;
|
|
703
|
+
for (let i = 1; i < t.length; i++) {
|
|
704
|
+
if (!d)
|
|
705
|
+
return s;
|
|
706
|
+
d = d[t[i]];
|
|
707
|
+
}
|
|
708
|
+
return D(d, a);
|
|
709
|
+
}
|
|
710
|
+
if (Array.isArray(s))
|
|
711
|
+
return s.map((t) => D(t, a));
|
|
712
|
+
if (typeof s == "object") {
|
|
713
|
+
const t = {};
|
|
714
|
+
for (const [d, i] of Object.entries(s))
|
|
715
|
+
d !== "$ref" && (t[d] = D(i, a));
|
|
716
|
+
return t;
|
|
717
|
+
}
|
|
718
|
+
return s;
|
|
719
|
+
}
|
|
720
|
+
const Ss = {
|
|
721
|
+
object: Ve,
|
|
722
|
+
array: es,
|
|
723
|
+
string: N,
|
|
724
|
+
number: N,
|
|
725
|
+
integer: N,
|
|
726
|
+
boolean: N,
|
|
727
|
+
null: N
|
|
728
|
+
}, A = {
|
|
729
|
+
hasReference: (s) => !!s.$ref,
|
|
730
|
+
hasComposition: (s) => !!(s.anyOf || s.oneOf || s.allOf),
|
|
731
|
+
getCompositionType: (s) => s.anyOf ? "anyOf" : s.oneOf ? "oneOf" : s.allOf ? "allOf" : null,
|
|
732
|
+
isPrimitiveType: (s) => ["string", "number", "integer", "boolean", "null"].includes(s.type),
|
|
733
|
+
getComponentForSchema: (s) => A.hasReference(s) ? Ms : A.hasComposition(s) ? ys : Ss[s.type] || null,
|
|
734
|
+
resolveReferences: D
|
|
735
|
+
};
|
|
736
|
+
const Is = { class: "slds-grid slds-grid_vertical" }, $s = { class: "slds-col slds-size_1-of-1" }, Ns = { class: "slds-card" }, As = { class: "slds-card__body slds-card__body_inner" }, Ts = {
|
|
737
|
+
__name: "SchemaLayout",
|
|
738
|
+
setup(s) {
|
|
739
|
+
return (a, t) => (l(), n("div", Is, [
|
|
740
|
+
e("div", $s, [
|
|
741
|
+
e("div", Ns, [
|
|
742
|
+
e("div", As, [
|
|
743
|
+
j(a.$slots, "default")
|
|
744
|
+
])
|
|
745
|
+
])
|
|
746
|
+
])
|
|
747
|
+
]));
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
const Ds = {
|
|
751
|
+
class: "slds-tabs_default__nav",
|
|
752
|
+
role: "tablist"
|
|
753
|
+
}, ws = {
|
|
754
|
+
__name: "SchemaTabs",
|
|
755
|
+
props: {
|
|
756
|
+
modelValue: {
|
|
757
|
+
type: String,
|
|
758
|
+
required: !0
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
emits: ["update:modelValue"],
|
|
762
|
+
setup(s) {
|
|
763
|
+
return (a, t) => (l(), n("ul", Ds, [
|
|
764
|
+
e("li", {
|
|
765
|
+
class: M(["slds-tabs_default__item", { "slds-is-active": s.modelValue === "visual" }]),
|
|
766
|
+
role: "presentation"
|
|
767
|
+
}, [
|
|
768
|
+
e("a", {
|
|
769
|
+
class: "slds-tabs_default__link",
|
|
770
|
+
role: "tab",
|
|
771
|
+
tabindex: "0",
|
|
772
|
+
"aria-selected": "true",
|
|
773
|
+
"aria-controls": "visual-tab",
|
|
774
|
+
onClick: t[0] || (t[0] = (d) => a.$emit("update:modelValue", "visual"))
|
|
775
|
+
}, t[2] || (t[2] = [
|
|
776
|
+
e("span", { class: "slds-tabs_default__title" }, "Visual", -1)
|
|
777
|
+
]))
|
|
778
|
+
], 2),
|
|
779
|
+
e("li", {
|
|
780
|
+
class: M(["slds-tabs_default__item", { "slds-is-active": s.modelValue === "plain" }]),
|
|
781
|
+
role: "presentation"
|
|
782
|
+
}, [
|
|
783
|
+
e("a", {
|
|
784
|
+
class: "slds-tabs_default__link",
|
|
785
|
+
role: "tab",
|
|
786
|
+
tabindex: "0",
|
|
787
|
+
"aria-selected": "true",
|
|
788
|
+
"aria-controls": "plain-tab",
|
|
789
|
+
onClick: t[1] || (t[1] = (d) => a.$emit("update:modelValue", "plain"))
|
|
790
|
+
}, t[3] || (t[3] = [
|
|
791
|
+
e("span", { class: "slds-tabs_default__title" }, "Plain JSON", -1)
|
|
792
|
+
]))
|
|
793
|
+
], 2)
|
|
794
|
+
]));
|
|
795
|
+
}
|
|
796
|
+
};
|
|
797
|
+
const Cs = { class: "slds-page-header" }, js = { class: "slds-page-header__row" }, Os = { class: "slds-page-header__col-title" }, ks = { class: "slds-media" }, Ls = { class: "slds-media__body" }, Ps = { class: "slds-page-header__name" }, zs = { class: "slds-page-header__name-title" }, Es = {
|
|
798
|
+
class: "slds-page-header__title slds-truncate",
|
|
799
|
+
title: "{{ schema.title || 'Schema' }}"
|
|
800
|
+
}, Rs = { class: "slds-page-header__meta-text" }, Ys = {
|
|
801
|
+
__name: "SchemaHeader",
|
|
802
|
+
props: {
|
|
803
|
+
schema: {
|
|
804
|
+
type: Object,
|
|
805
|
+
required: !0
|
|
806
|
+
}
|
|
807
|
+
},
|
|
808
|
+
setup(s) {
|
|
809
|
+
const a = s;
|
|
810
|
+
return y(() => !!(a.schema.title || a.schema.description)), (t, d) => (l(), n("div", Cs, [
|
|
811
|
+
e("div", js, [
|
|
812
|
+
e("div", Os, [
|
|
813
|
+
e("div", ks, [
|
|
814
|
+
d[0] || (d[0] = e("div", { class: "slds-media__figure" }, [
|
|
815
|
+
e("span", { class: "slds-icon_container slds-icon-standard-account" }, [
|
|
816
|
+
e("img", {
|
|
817
|
+
src: O,
|
|
818
|
+
class: "slds-icon slds-icon_small",
|
|
819
|
+
alt: ""
|
|
820
|
+
})
|
|
821
|
+
])
|
|
822
|
+
], -1)),
|
|
823
|
+
e("div", Ls, [
|
|
824
|
+
e("div", Ps, [
|
|
825
|
+
e("div", zs, [
|
|
826
|
+
e("h1", Es, r(s.schema.title || "Schema"), 1)
|
|
827
|
+
])
|
|
828
|
+
]),
|
|
829
|
+
e("div", Rs, r(s.schema.description || "No description provided"), 1)
|
|
830
|
+
])
|
|
831
|
+
])
|
|
832
|
+
])
|
|
833
|
+
])
|
|
834
|
+
]));
|
|
835
|
+
}
|
|
836
|
+
};
|
|
837
|
+
const qs = { class: "slds-box" }, Vs = { class: "slds-box slds-theme_shade" }, Gs = {
|
|
838
|
+
__name: "PlainSchemaView",
|
|
839
|
+
props: {
|
|
840
|
+
schema: {
|
|
841
|
+
type: Object,
|
|
842
|
+
required: !0
|
|
843
|
+
}
|
|
844
|
+
},
|
|
845
|
+
setup(s) {
|
|
846
|
+
const a = s, t = y(() => JSON.stringify(a.schema, null, 2));
|
|
847
|
+
return (d, i) => (l(), n("div", qs, [
|
|
848
|
+
i[0] || (i[0] = e("div", { class: "slds-text-heading_small slds-m-bottom_small" }, "Raw JSON Schema", -1)),
|
|
849
|
+
e("pre", Vs, [
|
|
850
|
+
e("code", null, r(t.value), 1)
|
|
851
|
+
])
|
|
852
|
+
]));
|
|
853
|
+
}
|
|
854
|
+
}, Qs = { class: "slds-box slds-theme_shade" }, Bs = { class: "slds-grid slds-wrap slds-gutters" }, Js = { class: "slds-badge slds-badge_inverse" }, Hs = {
|
|
855
|
+
__name: "SchemaEnum",
|
|
856
|
+
props: {
|
|
857
|
+
values: {
|
|
858
|
+
type: Array,
|
|
859
|
+
required: !0
|
|
860
|
+
}
|
|
861
|
+
},
|
|
862
|
+
setup(s) {
|
|
863
|
+
return (a, t) => (l(), n("div", Qs, [
|
|
864
|
+
t[0] || (t[0] = e("div", { class: "slds-text-heading_small slds-m-bottom_small" }, "Enum Values", -1)),
|
|
865
|
+
e("div", Bs, [
|
|
866
|
+
(l(!0), n(x, null, I(s.values, (d, i) => (l(), n("div", {
|
|
867
|
+
key: i,
|
|
868
|
+
class: "slds-col slds-size_1-of-3 slds-p-around_xx-small"
|
|
869
|
+
}, [
|
|
870
|
+
e("div", Js, r(d), 1)
|
|
871
|
+
]))), 128))
|
|
872
|
+
])
|
|
873
|
+
]));
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
const Zs = { class: "slds-tabs_default" }, Us = { class: "slds-p-around_medium" }, Ws = { class: "slds-m-top_medium" }, Fs = { class: "slds-p-around_medium" }, b = {
|
|
877
|
+
__name: "SchemaViewer",
|
|
878
|
+
props: {
|
|
879
|
+
schema: {
|
|
880
|
+
type: Object,
|
|
881
|
+
required: !0
|
|
882
|
+
},
|
|
883
|
+
rootSchema: {
|
|
884
|
+
type: Object,
|
|
885
|
+
default: null
|
|
886
|
+
},
|
|
887
|
+
isRoot: {
|
|
888
|
+
type: Boolean,
|
|
889
|
+
default: !0
|
|
890
|
+
}
|
|
891
|
+
},
|
|
892
|
+
setup(s) {
|
|
893
|
+
const a = s, t = T("visual"), d = y(() => a.isRoot ? a.schema : a.rootSchema), i = y(() => A.resolveReferences(a.schema, d.value));
|
|
894
|
+
E("rootSchema", d);
|
|
895
|
+
const m = y(() => A.getComponentForSchema(i.value)), v = y(() => A.getCompositionType(i.value)), _ = (o) => {
|
|
896
|
+
const c = document.getElementById(`definition-${o.definitionName}`);
|
|
897
|
+
c && (c.scrollIntoView({ behavior: "smooth" }), c.classList.add("highlight"), setTimeout(() => {
|
|
898
|
+
c.classList.remove("highlight");
|
|
899
|
+
}, 2e3));
|
|
900
|
+
};
|
|
901
|
+
return (o, c) => (l(), f(Ts, null, {
|
|
902
|
+
default: S(() => [
|
|
903
|
+
e("div", Zs, [
|
|
904
|
+
p(ws, {
|
|
905
|
+
modelValue: t.value,
|
|
906
|
+
"onUpdate:modelValue": c[0] || (c[0] = (h) => t.value = h)
|
|
907
|
+
}, null, 8, ["modelValue"]),
|
|
908
|
+
e("div", {
|
|
909
|
+
class: M({ "slds-show": t.value === "visual", "slds-hide": t.value !== "visual" })
|
|
910
|
+
}, [
|
|
911
|
+
e("div", Us, [
|
|
912
|
+
p(Ys, { schema: i.value }, null, 8, ["schema"]),
|
|
913
|
+
e("div", Ws, [
|
|
914
|
+
m.value ? (l(), f(R(m.value), {
|
|
915
|
+
key: 0,
|
|
916
|
+
schema: i.value,
|
|
917
|
+
rootSchema: d.value,
|
|
918
|
+
compositionType: v.value,
|
|
919
|
+
onNavigateToDefinition: _
|
|
920
|
+
}, null, 40, ["schema", "rootSchema", "compositionType"])) : (l(), f(w, { key: 1 })),
|
|
921
|
+
i.value.enum ? (l(), f(Hs, {
|
|
922
|
+
key: 2,
|
|
923
|
+
values: i.value.enum,
|
|
924
|
+
class: "slds-m-top_medium"
|
|
925
|
+
}, null, 8, ["values"])) : g("", !0)
|
|
926
|
+
])
|
|
927
|
+
])
|
|
928
|
+
], 2),
|
|
929
|
+
e("div", {
|
|
930
|
+
class: M({ "slds-show": t.value === "plain", "slds-hide": t.value !== "plain" })
|
|
931
|
+
}, [
|
|
932
|
+
e("div", Fs, [
|
|
933
|
+
p(Gs, { schema: i.value }, null, 8, ["schema"])
|
|
934
|
+
])
|
|
935
|
+
], 2)
|
|
936
|
+
])
|
|
937
|
+
]),
|
|
938
|
+
_: 1
|
|
939
|
+
}));
|
|
940
|
+
}
|
|
941
|
+
}, Xs = { class: "slds-grid slds-grid_vertical" }, Ks = { class: "slds-grid slds-gutters slds-grid_vertical-fill" }, et = { class: "slds-col slds-size_2-of-12" }, st = { class: "slds-col slds-size_10-of-12" }, tt = {
|
|
942
|
+
key: 1,
|
|
943
|
+
class: "slds-p-around_medium"
|
|
944
|
+
}, lt = {
|
|
945
|
+
__name: "App",
|
|
946
|
+
props: {
|
|
947
|
+
title: {
|
|
948
|
+
type: String,
|
|
949
|
+
default: "JSON Schema Documentation"
|
|
950
|
+
},
|
|
951
|
+
description: {
|
|
952
|
+
type: String,
|
|
953
|
+
default: ""
|
|
954
|
+
},
|
|
955
|
+
schemas: {
|
|
956
|
+
type: Array,
|
|
957
|
+
default: () => []
|
|
958
|
+
},
|
|
959
|
+
generatedAt: {
|
|
960
|
+
type: String,
|
|
961
|
+
default: () => (/* @__PURE__ */ new Date()).toISOString()
|
|
962
|
+
}
|
|
963
|
+
},
|
|
964
|
+
setup(s) {
|
|
965
|
+
const a = s, t = T(a.schemas.length > 0 ? a.schemas[0] : null), d = (i) => {
|
|
966
|
+
t.value = i;
|
|
967
|
+
};
|
|
968
|
+
return (i, m) => (l(), n("div", Xs, [
|
|
969
|
+
p(W, { title: s.title }, null, 8, ["title"]),
|
|
970
|
+
e("div", Ks, [
|
|
971
|
+
e("div", et, [
|
|
972
|
+
p(se, {
|
|
973
|
+
schemas: s.schemas,
|
|
974
|
+
selectedSchema: t.value,
|
|
975
|
+
onSelectSchema: d
|
|
976
|
+
}, null, 8, ["schemas", "selectedSchema"])
|
|
977
|
+
]),
|
|
978
|
+
e("div", st, [
|
|
979
|
+
t.value ? (l(), f(b, {
|
|
980
|
+
key: 0,
|
|
981
|
+
schema: t.value.schema,
|
|
982
|
+
"is-root": !0
|
|
983
|
+
}, null, 8, ["schema"])) : (l(), n("div", tt, m[0] || (m[0] = [
|
|
984
|
+
Y('<div class="slds-text-align_center"><svg viewBox="0 0 454 272" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><circle vector-effect="non-scaling-stroke" cx="150" cy="150" r="40" fill="#F9F9F9"></circle><circle vector-effect="non-scaling-stroke" cx="150" cy="150" r="30" fill="#ECEBEA"></circle><circle vector-effect="non-scaling-stroke" cx="150" cy="150" r="20" fill="#D9D7D5"></circle></g></svg></div><div class="slds-text-align_center slds-m-top_medium"><h3 class="slds-text-heading_medium">No Schema Selected</h3><p class="slds-text-body_regular slds-m-top_small"> Select a schema from the sidebar to view its documentation. </p></div>', 2)
|
|
985
|
+
])))
|
|
986
|
+
])
|
|
987
|
+
]),
|
|
988
|
+
p(re, {
|
|
989
|
+
description: s.description,
|
|
990
|
+
generatedAt: s.generatedAt,
|
|
991
|
+
schemaCount: s.schemas.length
|
|
992
|
+
}, null, 8, ["description", "generatedAt", "schemaCount"])
|
|
993
|
+
]));
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
async function C() {
|
|
997
|
+
const s = window.__JSON_SCHEMA_DOCS_DATA__ || {
|
|
998
|
+
title: "JSON Schema Documentation",
|
|
999
|
+
description: "",
|
|
1000
|
+
schemas: [],
|
|
1001
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1002
|
+
};
|
|
1003
|
+
document.getElementById("app") && q(lt, s).mount("#app");
|
|
1004
|
+
}
|
|
1005
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", C) : C();
|
|
1006
|
+
export {
|
|
1007
|
+
lt as App,
|
|
1008
|
+
ot as createApp
|
|
1009
|
+
};
|