@nullix/zod-mongoose-studio 3.3.0 → 3.3.2

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.
Files changed (119) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_fonts/57NSSoFy1VLVs2gqly8Ls9awBnZMFyXGrefpmqvdqmc-zJfbBtpgM4cDmcXBsqZNW79_kFnlpPd62b48glgdydA.woff2 +0 -0
  3. package/.output/public/_fonts/8VR2wSMN-3U4NbWAVYXlkRV6hA0jFBXP-0RtL3X7fko-x2gYI4qfmkRdxyQQUPaBZdZdgl1TeVrquF_TxHeM4lM.woff2 +0 -0
  4. package/.output/public/_fonts/GsKUclqeNLJ96g5AU593ug6yanivOiwjW_7zESNPChw-jHA4tBeM1bjF7LATGUpfBuSTyomIFrWBTzjF7txVYfg.woff2 +0 -0
  5. package/.output/public/_fonts/Ld1FnTo3yTIwDyGfTQ5-Fws9AWsCbKfMvgxduXr7JcY-W25bL8NF1fjpLRSOgJb7RoZPHqGQNwMTM7S9tHVoxx8.woff2 +0 -0
  6. package/.output/public/_fonts/NdzqRASp2bovDUhQT1IRE_EMqKJ2KYQdTCfFcBvL8yw-KhwZiS86o3fErOe5GGMExHUemmI_dBfaEFxjISZrBd0.woff2 +0 -0
  7. package/.output/public/_fonts/iTkrULNFJJkTvihIg1Vqi5IODRH_9btXCioVF5l98I8-AndUyau2HR2felA_ra8V2mutQgschhasE5FD1dXGJX8.woff2 +0 -0
  8. package/.output/public/_nuxt/B6lqezyA.js +27 -0
  9. package/.output/public/_nuxt/{IxYCG8hB.js → B7ScFmDB.js} +1 -1
  10. package/.output/public/_nuxt/B8gqXD2U.js +1 -0
  11. package/.output/public/_nuxt/{ikxafTHA.js → BC9tFNFa.js} +180 -184
  12. package/.output/public/_nuxt/{qwxNOyg7.js → Bbi9UBvi.js} +1 -1
  13. package/.output/public/_nuxt/{CNZorjDf.js → BcYnCaqL.js} +1 -1
  14. package/.output/public/_nuxt/{BzhSDy30.js → BlZ0x31M.js} +1 -1
  15. package/.output/public/_nuxt/Bw82IGM8.js +1 -0
  16. package/.output/public/_nuxt/{qQyvCkbV.js → C8xmwXC2.js} +1 -1
  17. package/.output/public/_nuxt/{Ce-T_1aD.js → C919AVYR.js} +1 -1
  18. package/.output/public/_nuxt/{nDZOJ7rN.js → CsQL5F-l.js} +2 -2
  19. package/.output/public/_nuxt/Czp4_2o-.js +33 -0
  20. package/.output/public/_nuxt/{CC3n3Aga.js → DJa7_7Hz.js} +1 -1
  21. package/.output/public/_nuxt/DKK0Mrrg.js +1 -0
  22. package/.output/public/_nuxt/DbUZZZZu.js +6 -0
  23. package/.output/public/_nuxt/{B7P0wQ35.js → DbqvVYbv.js} +1 -1
  24. package/.output/public/_nuxt/{Ick_23I4.js → JkiDMdYG.js} +1 -1
  25. package/.output/public/_nuxt/{81vqh61j.js → OVQ3C2Ge.js} +1 -1
  26. package/.output/public/_nuxt/{Cs8GXJCB.js → PXBhK7S_.js} +1 -1
  27. package/.output/public/_nuxt/{CAd-qHfI.js → YC-RLggm.js} +1 -1
  28. package/.output/public/_nuxt/builds/latest.json +1 -1
  29. package/.output/public/_nuxt/builds/meta/46174b5e-cab6-4a73-95f8-66a1c9b1be2b.json +1 -0
  30. package/.output/public/_nuxt/{tzj4nvDE.js → d1NBz903.js} +2 -2
  31. package/.output/public/_nuxt/{entry.J_CbC0oY.css → entry.DaqrxXuH.css} +1 -1
  32. package/.output/public/_nuxt/error-404.CTSXlFYa.css +1 -0
  33. package/.output/public/_nuxt/error-500.DqEfQnVZ.css +1 -0
  34. package/.output/public/_nuxt/{Bd32GOUy.js → iGzUozbF.js} +1 -1
  35. package/.output/public/_nuxt/{DjPT-NCE.js → iKW_mt0p.js} +1 -1
  36. package/.output/server/chunks/_/error-500.mjs.map +1 -1
  37. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  38. package/.output/server/chunks/build/{error-404-BN-7rNE4.mjs → error-404-KRkA0DPI.mjs} +10 -4
  39. package/.output/server/chunks/build/error-404-KRkA0DPI.mjs.map +1 -0
  40. package/.output/server/chunks/build/error-404-styles.I0NYw-Bn.mjs +8 -0
  41. package/.output/server/chunks/build/error-404-styles.I0NYw-Bn.mjs.map +1 -0
  42. package/.output/server/chunks/build/{error-500-DhIQ-2yt.mjs → error-500-DIIFf55p.mjs} +10 -4
  43. package/.output/server/chunks/build/error-500-DIIFf55p.mjs.map +1 -0
  44. package/.output/server/chunks/build/error-500-styles.D1cs9hQy.mjs +8 -0
  45. package/.output/server/chunks/build/error-500-styles.D1cs9hQy.mjs.map +1 -0
  46. package/.output/server/chunks/build/index-CB1N4gax.mjs +557 -0
  47. package/.output/server/chunks/build/index-CB1N4gax.mjs.map +1 -0
  48. package/.output/server/chunks/build/server.mjs +326 -248
  49. package/.output/server/chunks/build/server.mjs.map +1 -1
  50. package/.output/server/chunks/build/styles.mjs +4 -4
  51. package/.output/server/chunks/nitro/nitro.mjs +2319 -852
  52. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  53. package/.output/server/chunks/routes/api/editor-types.get.mjs +113 -0
  54. package/.output/server/chunks/routes/api/editor-types.get.mjs.map +1 -0
  55. package/.output/server/chunks/routes/api/parse.post.mjs +26 -1448
  56. package/.output/server/chunks/routes/api/parse.post.mjs.map +1 -1
  57. package/.output/server/chunks/routes/api/resolve.get.mjs +6 -0
  58. package/.output/server/chunks/routes/api/resolve.get.mjs.map +1 -1
  59. package/.output/server/chunks/routes/api/studio/run.post.mjs +40 -0
  60. package/.output/server/chunks/routes/api/studio/run.post.mjs.map +1 -0
  61. package/.output/server/chunks/routes/renderer.mjs +1 -1
  62. package/.output/server/chunks/routes/renderer.mjs.map +1 -1
  63. package/.output/server/index.mjs +7 -1
  64. package/.output/server/index.mjs.map +1 -1
  65. package/.output/server/node_modules/acorn/dist/acorn.mjs +6266 -0
  66. package/.output/server/node_modules/acorn/package.json +50 -0
  67. package/.output/server/node_modules/ip-address/dist/common.js +112 -4
  68. package/.output/server/node_modules/ip-address/dist/ipv4.js +322 -87
  69. package/.output/server/node_modules/ip-address/dist/ipv6.js +654 -199
  70. package/.output/server/node_modules/ip-address/dist/v4/constants.js +45 -2
  71. package/.output/server/node_modules/ip-address/dist/v6/constants.js +55 -3
  72. package/.output/server/node_modules/ip-address/dist/v6/helpers.js +12 -3
  73. package/.output/server/node_modules/ip-address/package.json +49 -37
  74. package/.output/server/node_modules/ufo/dist/index.mjs +2 -2
  75. package/.output/server/node_modules/ufo/package.json +9 -9
  76. package/.output/server/package.json +4 -3
  77. package/README.md +65 -20
  78. package/app/assets/css/main.css +1 -0
  79. package/app/assets/css/studio.css +131 -0
  80. package/app/components/StudioConversion.vue +41 -0
  81. package/app/components/StudioDataPanel.vue +21 -0
  82. package/app/components/StudioEditor.vue +78 -102
  83. package/app/components/StudioExpandButton.vue +11 -0
  84. package/app/components/StudioOutput.vue +7 -1
  85. package/app/components/StudioSourcePanel.vue +16 -0
  86. package/app/components/StudioValidation.vue +47 -0
  87. package/app/components/ZodMongooseStudio.vue +216 -198
  88. package/app/composables/useStudioRunner.ts +142 -0
  89. package/app/pages/index.vue +1 -1
  90. package/app/plugins/monaco.client.ts +2 -0
  91. package/bin/index.mjs +5 -0
  92. package/nuxt.config.ts +4 -3
  93. package/package.json +6 -3
  94. package/server/api/editor-types.get.ts +7 -0
  95. package/server/api/parse.post.ts +17 -175
  96. package/server/api/studio/run.post.ts +29 -0
  97. package/server/middleware/security.ts +29 -7
  98. package/server/utils/editor-types.json +1 -0
  99. package/server/utils/example-data.ts +80 -0
  100. package/server/utils/parse-request.ts +28 -0
  101. package/server/utils/runner-client.ts +40 -0
  102. package/server/utils/studio-execution.ts +176 -0
  103. package/.output/public/_nuxt/BD40YYqZ.js +0 -33
  104. package/.output/public/_nuxt/BlQmLjV4.js +0 -1
  105. package/.output/public/_nuxt/CJ4Cv9fY.js +0 -61
  106. package/.output/public/_nuxt/builds/meta/495a8ebb-444d-4414-9b98-c181aa84d817.json +0 -1
  107. package/.output/public/_nuxt/error-404.64pZEiDn.css +0 -1
  108. package/.output/public/_nuxt/error-500.DHOpI0Ir.css +0 -1
  109. package/.output/public/_nuxt/rH_O4qXT.js +0 -1
  110. package/.output/server/chunks/build/error-404-BN-7rNE4.mjs.map +0 -1
  111. package/.output/server/chunks/build/error-404-styles.Byx46oLR.mjs +0 -8
  112. package/.output/server/chunks/build/error-404-styles.Byx46oLR.mjs.map +0 -1
  113. package/.output/server/chunks/build/error-500-DhIQ-2yt.mjs.map +0 -1
  114. package/.output/server/chunks/build/error-500-styles.BL3UT0Wa.mjs +0 -8
  115. package/.output/server/chunks/build/error-500-styles.BL3UT0Wa.mjs.map +0 -1
  116. package/.output/server/chunks/build/index-B4T6zHp0.mjs +0 -1904
  117. package/.output/server/chunks/build/index-B4T6zHp0.mjs.map +0 -1
  118. package/.output/server/node_modules/zod/index.js +0 -4
  119. /package/.output/public/_nuxt/{editor.CdBKkuhR.css → monaco.CdBKkuhR.css} +0 -0
@@ -1,1904 +0,0 @@
1
- import * as vue from 'vue';
2
- import { defineComponent, ref, computed, watch, mergeProps, withCtx, createTextVNode, createVNode, unref, withModifiers, useSlots, renderSlot, openBlock, createBlock, createCommentVNode, toDisplayString, useId as useId$1, toRef, isRef, shallowRef, toRefs, nextTick, customRef, useSSRContext } from 'vue';
3
- import { ssrRenderComponent, ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrInterpolate } from 'vue/server-renderer';
4
- import { _ as _export_sfc, s as _sfc_main$8$1, v as __nuxt_component_4, m as _sfc_main$d, w as useRuntimeConfig, h as useAppConfig, j as useComponentUI, k as useFieldGroup, l as useComponentIcons, t as tv, P as Primitive, n as _sfc_main$b, b as useNuxtApp, q as useForwardPropsEmits, r as reactivePick, e as createContext, o as useLocale, p as useStorage, c as useVModel, d as useForwardExpose, f as useEventListener, g as Presence_default, i as injectConfigProviderContext } from './server.mjs';
5
- import { l as klona, E as parse, F as getRequestHeader, G as isEqual, H as setCookie, I as getCookie, J as deleteCookie } from '../nitro/nitro.mjs';
6
- import 'tailwindcss/colors';
7
- import 'perfect-debounce';
8
- import '../routes/renderer.mjs';
9
- import 'vue-bundle-renderer/runtime';
10
- import 'unhead/server';
11
- import 'devalue';
12
- import 'unhead/utils';
13
- import 'node:http';
14
- import 'node:https';
15
- import 'node:events';
16
- import 'node:buffer';
17
- import 'node:fs';
18
- import 'node:path';
19
- import 'node:crypto';
20
- import 'node:url';
21
- import '@iconify/utils';
22
- import 'consola';
23
-
24
- function useRequestEvent(nuxtApp) {
25
- nuxtApp ||= useNuxtApp();
26
- return nuxtApp.ssrContext?.event;
27
- }
28
- let count = 0;
29
- function useId(deterministicId, prefix = "reka") {
30
- let id;
31
- if ("useId" in vue) id = vue.useId?.();
32
- else {
33
- const configProviderContext = injectConfigProviderContext({ useId: void 0 });
34
- id = configProviderContext.useId?.() ?? `${++count}`;
35
- }
36
- return prefix ? `${prefix}-${id}` : id;
37
- }
38
- const [injectCollapsibleRootContext, provideCollapsibleRootContext] = createContext("CollapsibleRoot");
39
- var CollapsibleRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
40
- __name: "CollapsibleRoot",
41
- props: {
42
- defaultOpen: {
43
- type: Boolean,
44
- required: false,
45
- default: false
46
- },
47
- open: {
48
- type: Boolean,
49
- required: false,
50
- default: void 0
51
- },
52
- disabled: {
53
- type: Boolean,
54
- required: false
55
- },
56
- unmountOnHide: {
57
- type: Boolean,
58
- required: false,
59
- default: true
60
- },
61
- asChild: {
62
- type: Boolean,
63
- required: false
64
- },
65
- as: {
66
- type: null,
67
- required: false
68
- }
69
- },
70
- emits: ["update:open"],
71
- setup(__props, { expose: __expose, emit: __emit }) {
72
- const props = __props;
73
- const emit = __emit;
74
- const open = useVModel(props, "open", emit, {
75
- defaultValue: props.defaultOpen,
76
- passive: props.open === void 0
77
- });
78
- const { disabled, unmountOnHide } = toRefs(props);
79
- provideCollapsibleRootContext({
80
- contentId: "",
81
- disabled,
82
- open,
83
- unmountOnHide,
84
- onOpenToggle: () => {
85
- if (disabled.value) return;
86
- open.value = !open.value;
87
- }
88
- });
89
- __expose({ open });
90
- useForwardExpose();
91
- return (_ctx, _cache) => {
92
- return openBlock(), createBlock(unref(Primitive), {
93
- as: _ctx.as,
94
- "as-child": props.asChild,
95
- "data-state": unref(open) ? "open" : "closed",
96
- "data-disabled": unref(disabled) ? "" : void 0
97
- }, {
98
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", { open: unref(open) })]),
99
- _: 3
100
- }, 8, [
101
- "as",
102
- "as-child",
103
- "data-state",
104
- "data-disabled"
105
- ]);
106
- };
107
- }
108
- });
109
- var CollapsibleRoot_default = CollapsibleRoot_vue_vue_type_script_setup_true_lang_default;
110
- var CollapsibleContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
111
- inheritAttrs: false,
112
- __name: "CollapsibleContent",
113
- props: {
114
- forceMount: {
115
- type: Boolean,
116
- required: false
117
- },
118
- asChild: {
119
- type: Boolean,
120
- required: false
121
- },
122
- as: {
123
- type: null,
124
- required: false
125
- }
126
- },
127
- emits: ["contentFound"],
128
- setup(__props, { emit: __emit }) {
129
- const props = __props;
130
- const emits = __emit;
131
- const rootContext = injectCollapsibleRootContext();
132
- rootContext.contentId ||= useId(void 0, "reka-collapsible-content");
133
- const presentRef = ref();
134
- const { forwardRef, currentElement } = useForwardExpose();
135
- const width = ref(0);
136
- const height = ref(0);
137
- const isOpen = computed(() => rootContext.open.value);
138
- const isMountAnimationPrevented = ref(isOpen.value);
139
- const currentStyle = ref();
140
- watch(() => [isOpen.value, presentRef.value?.present], async () => {
141
- await nextTick();
142
- const node = currentElement.value;
143
- if (!node) return;
144
- currentStyle.value = currentStyle.value || {
145
- transitionDuration: node.style.transitionDuration,
146
- animationName: node.style.animationName
147
- };
148
- node.style.transitionDuration = "0s";
149
- node.style.animationName = "none";
150
- const rect = node.getBoundingClientRect();
151
- height.value = rect.height;
152
- width.value = rect.width;
153
- if (!isMountAnimationPrevented.value) {
154
- node.style.transitionDuration = currentStyle.value.transitionDuration;
155
- node.style.animationName = currentStyle.value.animationName;
156
- }
157
- }, { immediate: true });
158
- const skipAnimation = computed(() => isMountAnimationPrevented.value && rootContext.open.value);
159
- useEventListener(currentElement, "beforematch", (ev) => {
160
- requestAnimationFrame(() => {
161
- rootContext.onOpenToggle();
162
- emits("contentFound");
163
- });
164
- });
165
- return (_ctx, _cache) => {
166
- return openBlock(), createBlock(unref(Presence_default), {
167
- ref_key: "presentRef",
168
- ref: presentRef,
169
- present: _ctx.forceMount || unref(rootContext).open.value,
170
- "force-mount": true
171
- }, {
172
- default: withCtx(({ present }) => [createVNode(unref(Primitive), mergeProps(_ctx.$attrs, {
173
- id: unref(rootContext).contentId,
174
- ref: unref(forwardRef),
175
- "as-child": props.asChild,
176
- as: _ctx.as,
177
- hidden: !present ? unref(rootContext).unmountOnHide.value ? "" : "until-found" : void 0,
178
- "data-state": skipAnimation.value ? void 0 : unref(rootContext).open.value ? "open" : "closed",
179
- "data-disabled": unref(rootContext).disabled?.value ? "" : void 0,
180
- style: {
181
- [`--reka-collapsible-content-height`]: `${height.value}px`,
182
- [`--reka-collapsible-content-width`]: `${width.value}px`
183
- }
184
- }), {
185
- default: withCtx(() => [(unref(rootContext).unmountOnHide.value ? present : true) ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true)]),
186
- _: 2
187
- }, 1040, [
188
- "id",
189
- "as-child",
190
- "as",
191
- "hidden",
192
- "data-state",
193
- "data-disabled",
194
- "style"
195
- ])]),
196
- _: 3
197
- }, 8, ["present"]);
198
- };
199
- }
200
- });
201
- var CollapsibleContent_default = CollapsibleContent_vue_vue_type_script_setup_true_lang_default;
202
- var CollapsibleTrigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
203
- __name: "CollapsibleTrigger",
204
- props: {
205
- asChild: {
206
- type: Boolean,
207
- required: false
208
- },
209
- as: {
210
- type: null,
211
- required: false,
212
- default: "button"
213
- }
214
- },
215
- setup(__props) {
216
- const props = __props;
217
- useForwardExpose();
218
- const rootContext = injectCollapsibleRootContext();
219
- return (_ctx, _cache) => {
220
- return openBlock(), createBlock(unref(Primitive), {
221
- type: _ctx.as === "button" ? "button" : void 0,
222
- as: _ctx.as,
223
- "as-child": props.asChild,
224
- "aria-controls": unref(rootContext).contentId,
225
- "aria-expanded": unref(rootContext).open.value,
226
- "data-state": unref(rootContext).open.value ? "open" : "closed",
227
- "data-disabled": unref(rootContext).disabled?.value ? "" : void 0,
228
- disabled: unref(rootContext).disabled?.value,
229
- onClick: unref(rootContext).onOpenToggle
230
- }, {
231
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
232
- _: 3
233
- }, 8, [
234
- "type",
235
- "as",
236
- "as-child",
237
- "aria-controls",
238
- "aria-expanded",
239
- "data-state",
240
- "data-disabled",
241
- "disabled",
242
- "onClick"
243
- ]);
244
- };
245
- }
246
- });
247
- var CollapsibleTrigger_default = CollapsibleTrigger_vue_vue_type_script_setup_true_lang_default;
248
- const theme$4 = {
249
- "slots": {
250
- "base": "font-medium inline-flex items-center",
251
- "label": "truncate",
252
- "leadingIcon": "shrink-0",
253
- "leadingAvatar": "shrink-0",
254
- "leadingAvatarSize": "",
255
- "trailingIcon": "shrink-0"
256
- },
257
- "variants": {
258
- "fieldGroup": {
259
- "horizontal": "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",
260
- "vertical": "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"
261
- },
262
- "color": {
263
- "primary": "",
264
- "secondary": "",
265
- "success": "",
266
- "info": "",
267
- "warning": "",
268
- "error": "",
269
- "neutral": ""
270
- },
271
- "variant": {
272
- "solid": "",
273
- "outline": "",
274
- "soft": "",
275
- "subtle": ""
276
- },
277
- "size": {
278
- "xs": {
279
- "base": "text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm",
280
- "leadingIcon": "size-3",
281
- "leadingAvatarSize": "3xs",
282
- "trailingIcon": "size-3"
283
- },
284
- "sm": {
285
- "base": "text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm",
286
- "leadingIcon": "size-3",
287
- "leadingAvatarSize": "3xs",
288
- "trailingIcon": "size-3"
289
- },
290
- "md": {
291
- "base": "text-xs px-2 py-1 gap-1 rounded-md",
292
- "leadingIcon": "size-4",
293
- "leadingAvatarSize": "3xs",
294
- "trailingIcon": "size-4"
295
- },
296
- "lg": {
297
- "base": "text-sm px-2 py-1 gap-1.5 rounded-md",
298
- "leadingIcon": "size-5",
299
- "leadingAvatarSize": "2xs",
300
- "trailingIcon": "size-5"
301
- },
302
- "xl": {
303
- "base": "text-base px-2.5 py-1 gap-1.5 rounded-md",
304
- "leadingIcon": "size-6",
305
- "leadingAvatarSize": "2xs",
306
- "trailingIcon": "size-6"
307
- }
308
- },
309
- "square": {
310
- "true": ""
311
- }
312
- },
313
- "compoundVariants": [
314
- {
315
- "color": "primary",
316
- "variant": "solid",
317
- "class": "bg-primary text-inverted"
318
- },
319
- {
320
- "color": "secondary",
321
- "variant": "solid",
322
- "class": "bg-secondary text-inverted"
323
- },
324
- {
325
- "color": "success",
326
- "variant": "solid",
327
- "class": "bg-success text-inverted"
328
- },
329
- {
330
- "color": "info",
331
- "variant": "solid",
332
- "class": "bg-info text-inverted"
333
- },
334
- {
335
- "color": "warning",
336
- "variant": "solid",
337
- "class": "bg-warning text-inverted"
338
- },
339
- {
340
- "color": "error",
341
- "variant": "solid",
342
- "class": "bg-error text-inverted"
343
- },
344
- {
345
- "color": "primary",
346
- "variant": "outline",
347
- "class": "text-primary ring ring-inset ring-primary/50"
348
- },
349
- {
350
- "color": "secondary",
351
- "variant": "outline",
352
- "class": "text-secondary ring ring-inset ring-secondary/50"
353
- },
354
- {
355
- "color": "success",
356
- "variant": "outline",
357
- "class": "text-success ring ring-inset ring-success/50"
358
- },
359
- {
360
- "color": "info",
361
- "variant": "outline",
362
- "class": "text-info ring ring-inset ring-info/50"
363
- },
364
- {
365
- "color": "warning",
366
- "variant": "outline",
367
- "class": "text-warning ring ring-inset ring-warning/50"
368
- },
369
- {
370
- "color": "error",
371
- "variant": "outline",
372
- "class": "text-error ring ring-inset ring-error/50"
373
- },
374
- {
375
- "color": "primary",
376
- "variant": "soft",
377
- "class": "bg-primary/10 text-primary"
378
- },
379
- {
380
- "color": "secondary",
381
- "variant": "soft",
382
- "class": "bg-secondary/10 text-secondary"
383
- },
384
- {
385
- "color": "success",
386
- "variant": "soft",
387
- "class": "bg-success/10 text-success"
388
- },
389
- {
390
- "color": "info",
391
- "variant": "soft",
392
- "class": "bg-info/10 text-info"
393
- },
394
- {
395
- "color": "warning",
396
- "variant": "soft",
397
- "class": "bg-warning/10 text-warning"
398
- },
399
- {
400
- "color": "error",
401
- "variant": "soft",
402
- "class": "bg-error/10 text-error"
403
- },
404
- {
405
- "color": "primary",
406
- "variant": "subtle",
407
- "class": "bg-primary/10 text-primary ring ring-inset ring-primary/25"
408
- },
409
- {
410
- "color": "secondary",
411
- "variant": "subtle",
412
- "class": "bg-secondary/10 text-secondary ring ring-inset ring-secondary/25"
413
- },
414
- {
415
- "color": "success",
416
- "variant": "subtle",
417
- "class": "bg-success/10 text-success ring ring-inset ring-success/25"
418
- },
419
- {
420
- "color": "info",
421
- "variant": "subtle",
422
- "class": "bg-info/10 text-info ring ring-inset ring-info/25"
423
- },
424
- {
425
- "color": "warning",
426
- "variant": "subtle",
427
- "class": "bg-warning/10 text-warning ring ring-inset ring-warning/25"
428
- },
429
- {
430
- "color": "error",
431
- "variant": "subtle",
432
- "class": "bg-error/10 text-error ring ring-inset ring-error/25"
433
- },
434
- {
435
- "color": "neutral",
436
- "variant": "solid",
437
- "class": "text-inverted bg-inverted"
438
- },
439
- {
440
- "color": "neutral",
441
- "variant": "outline",
442
- "class": "ring ring-inset ring-accented text-default bg-default"
443
- },
444
- {
445
- "color": "neutral",
446
- "variant": "soft",
447
- "class": "text-default bg-elevated"
448
- },
449
- {
450
- "color": "neutral",
451
- "variant": "subtle",
452
- "class": "ring ring-inset ring-accented text-default bg-elevated"
453
- },
454
- {
455
- "size": "xs",
456
- "square": true,
457
- "class": "p-0.5"
458
- },
459
- {
460
- "size": "sm",
461
- "square": true,
462
- "class": "p-1"
463
- },
464
- {
465
- "size": "md",
466
- "square": true,
467
- "class": "p-1"
468
- },
469
- {
470
- "size": "lg",
471
- "square": true,
472
- "class": "p-1"
473
- },
474
- {
475
- "size": "xl",
476
- "square": true,
477
- "class": "p-1"
478
- }
479
- ],
480
- "defaultVariants": {
481
- "color": "primary",
482
- "variant": "solid",
483
- "size": "md"
484
- }
485
- };
486
- const _sfc_main$8 = {
487
- __name: "UBadge",
488
- __ssrInlineRender: true,
489
- props: {
490
- as: { type: null, required: false, default: "span" },
491
- label: { type: [String, Number], required: false },
492
- color: { type: null, required: false },
493
- variant: { type: null, required: false },
494
- size: { type: null, required: false },
495
- square: { type: Boolean, required: false },
496
- class: { type: null, required: false },
497
- ui: { type: Object, required: false },
498
- icon: { type: null, required: false },
499
- avatar: { type: Object, required: false },
500
- leading: { type: Boolean, required: false },
501
- leadingIcon: { type: null, required: false },
502
- trailing: { type: Boolean, required: false },
503
- trailingIcon: { type: null, required: false }
504
- },
505
- setup(__props) {
506
- const props = __props;
507
- const slots = useSlots();
508
- const appConfig = useAppConfig();
509
- const uiProp = useComponentUI("badge", props);
510
- const { orientation, size: fieldGroupSize } = useFieldGroup(props);
511
- const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
512
- const ui = computed(() => tv({ extend: tv(theme$4), ...appConfig.ui?.badge || {} })({
513
- color: props.color,
514
- variant: props.variant,
515
- size: fieldGroupSize.value || props.size,
516
- square: props.square || !slots.default && !props.label,
517
- fieldGroup: orientation.value
518
- }));
519
- return (_ctx, _push, _parent, _attrs) => {
520
- _push(ssrRenderComponent(unref(Primitive), mergeProps({
521
- as: __props.as,
522
- "data-slot": "base",
523
- class: ui.value.base({ class: [unref(uiProp)?.base, props.class] })
524
- }, _attrs), {
525
- default: withCtx((_, _push2, _parent2, _scopeId) => {
526
- if (_push2) {
527
- ssrRenderSlot(_ctx.$slots, "leading", { ui: ui.value }, () => {
528
- if (unref(isLeading) && unref(leadingIconName)) {
529
- _push2(ssrRenderComponent(_sfc_main$d, {
530
- name: unref(leadingIconName),
531
- "data-slot": "leadingIcon",
532
- class: ui.value.leadingIcon({ class: unref(uiProp)?.leadingIcon })
533
- }, null, _parent2, _scopeId));
534
- } else if (!!__props.avatar) {
535
- _push2(ssrRenderComponent(_sfc_main$b, mergeProps({
536
- size: unref(uiProp)?.leadingAvatarSize || ui.value.leadingAvatarSize()
537
- }, __props.avatar, {
538
- "data-slot": "leadingAvatar",
539
- class: ui.value.leadingAvatar({ class: unref(uiProp)?.leadingAvatar })
540
- }), null, _parent2, _scopeId));
541
- } else {
542
- _push2(`<!---->`);
543
- }
544
- }, _push2, _parent2, _scopeId);
545
- ssrRenderSlot(_ctx.$slots, "default", { ui: ui.value }, () => {
546
- if (__props.label !== void 0 && __props.label !== null) {
547
- _push2(`<span data-slot="label" class="${ssrRenderClass(ui.value.label({ class: unref(uiProp)?.label }))}"${_scopeId}>${ssrInterpolate(__props.label)}</span>`);
548
- } else {
549
- _push2(`<!---->`);
550
- }
551
- }, _push2, _parent2, _scopeId);
552
- ssrRenderSlot(_ctx.$slots, "trailing", { ui: ui.value }, () => {
553
- if (unref(isTrailing) && unref(trailingIconName)) {
554
- _push2(ssrRenderComponent(_sfc_main$d, {
555
- name: unref(trailingIconName),
556
- "data-slot": "trailingIcon",
557
- class: ui.value.trailingIcon({ class: unref(uiProp)?.trailingIcon })
558
- }, null, _parent2, _scopeId));
559
- } else {
560
- _push2(`<!---->`);
561
- }
562
- }, _push2, _parent2, _scopeId);
563
- } else {
564
- return [
565
- renderSlot(_ctx.$slots, "leading", { ui: ui.value }, () => [
566
- unref(isLeading) && unref(leadingIconName) ? (openBlock(), createBlock(_sfc_main$d, {
567
- key: 0,
568
- name: unref(leadingIconName),
569
- "data-slot": "leadingIcon",
570
- class: ui.value.leadingIcon({ class: unref(uiProp)?.leadingIcon })
571
- }, null, 8, ["name", "class"])) : !!__props.avatar ? (openBlock(), createBlock(_sfc_main$b, mergeProps({
572
- key: 1,
573
- size: unref(uiProp)?.leadingAvatarSize || ui.value.leadingAvatarSize()
574
- }, __props.avatar, {
575
- "data-slot": "leadingAvatar",
576
- class: ui.value.leadingAvatar({ class: unref(uiProp)?.leadingAvatar })
577
- }), null, 16, ["size", "class"])) : createCommentVNode("", true)
578
- ]),
579
- renderSlot(_ctx.$slots, "default", { ui: ui.value }, () => [
580
- __props.label !== void 0 && __props.label !== null ? (openBlock(), createBlock("span", {
581
- key: 0,
582
- "data-slot": "label",
583
- class: ui.value.label({ class: unref(uiProp)?.label })
584
- }, toDisplayString(__props.label), 3)) : createCommentVNode("", true)
585
- ]),
586
- renderSlot(_ctx.$slots, "trailing", { ui: ui.value }, () => [
587
- unref(isTrailing) && unref(trailingIconName) ? (openBlock(), createBlock(_sfc_main$d, {
588
- key: 0,
589
- name: unref(trailingIconName),
590
- "data-slot": "trailingIcon",
591
- class: ui.value.trailingIcon({ class: unref(uiProp)?.trailingIcon })
592
- }, null, 8, ["name", "class"])) : createCommentVNode("", true)
593
- ])
594
- ];
595
- }
596
- }),
597
- _: 3
598
- }, _parent));
599
- };
600
- }
601
- };
602
- const _sfc_setup$8 = _sfc_main$8.setup;
603
- _sfc_main$8.setup = (props, ctx) => {
604
- const ssrContext = useSSRContext();
605
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../../../node_modules/.pnpm/@nuxt+ui@4.6.0_@nuxt+content@3.12.0_better-sqlite3@12.8.0_magicast@0.5.2__@tiptap+exten_3f393c9004f614ad44f8f6b00c452ac6/node_modules/@nuxt/ui/dist/runtime/components/Badge.vue");
606
- return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : void 0;
607
- };
608
- const [useDashboard, provideDashboardContext] = createContext("DashboardGroup");
609
- const theme$3 = {
610
- "base": "fixed inset-0 flex overflow-hidden"
611
- };
612
- const _sfc_main$7 = {
613
- __name: "UDashboardGroup",
614
- __ssrInlineRender: true,
615
- props: {
616
- as: { type: null, required: false },
617
- class: { type: null, required: false },
618
- ui: { type: Object, required: false },
619
- storage: { type: String, required: false, default: "cookie" },
620
- storageKey: { type: String, required: false, default: "dashboard" },
621
- persistent: { type: Boolean, required: false, default: true },
622
- unit: { type: String, required: false, default: "%" }
623
- },
624
- setup(__props) {
625
- const props = __props;
626
- const nuxtApp = useNuxtApp();
627
- const appConfig = useAppConfig();
628
- const uiProp = useComponentUI("dashboardGroup", props);
629
- const ui = computed(() => tv({ extend: tv(theme$3), ...appConfig.ui?.dashboardGroup || {} }));
630
- const sidebarOpen = ref(false);
631
- const sidebarCollapsed = ref(false);
632
- provideDashboardContext({
633
- storage: props.storage,
634
- storageKey: props.storageKey,
635
- persistent: props.persistent,
636
- unit: props.unit,
637
- sidebarOpen,
638
- toggleSidebar: () => {
639
- nuxtApp.hooks.callHook("dashboard:sidebar:toggle");
640
- },
641
- sidebarCollapsed,
642
- collapseSidebar: (collapsed) => {
643
- nuxtApp.hooks.callHook("dashboard:sidebar:collapse", collapsed);
644
- },
645
- toggleSearch: () => {
646
- nuxtApp.hooks.callHook("dashboard:search:toggle");
647
- }
648
- });
649
- return (_ctx, _push, _parent, _attrs) => {
650
- _push(ssrRenderComponent(unref(Primitive), mergeProps({
651
- as: __props.as,
652
- class: ui.value({ class: [unref(uiProp)?.base, props.class] })
653
- }, _attrs), {
654
- default: withCtx((_, _push2, _parent2, _scopeId) => {
655
- if (_push2) {
656
- ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
657
- } else {
658
- return [
659
- renderSlot(_ctx.$slots, "default")
660
- ];
661
- }
662
- }),
663
- _: 3
664
- }, _parent));
665
- };
666
- }
667
- };
668
- const _sfc_setup$7 = _sfc_main$7.setup;
669
- _sfc_main$7.setup = (props, ctx) => {
670
- const ssrContext = useSSRContext();
671
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../../../node_modules/.pnpm/@nuxt+ui@4.6.0_@nuxt+content@3.12.0_better-sqlite3@12.8.0_magicast@0.5.2__@tiptap+exten_3f393c9004f614ad44f8f6b00c452ac6/node_modules/@nuxt/ui/dist/runtime/components/DashboardGroup.vue");
672
- return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
673
- };
674
- function parseCookieValue(value) {
675
- if (value === "undefined") {
676
- return void 0;
677
- }
678
- try {
679
- const parsed = JSON.parse(value);
680
- if (typeof parsed === "number" && String(parsed) !== value) {
681
- return value;
682
- }
683
- return parsed;
684
- } catch {
685
- return value;
686
- }
687
- }
688
- const CookieDefaults = {
689
- path: "/",
690
- watch: true,
691
- decode: (val) => parseCookieValue(decodeURIComponent(val)),
692
- encode: (val) => {
693
- if (typeof val !== "string" || val === "undefined") {
694
- return encodeURIComponent(JSON.stringify(val));
695
- }
696
- try {
697
- if (typeof JSON.parse(val) !== "string") {
698
- return encodeURIComponent(JSON.stringify(val));
699
- }
700
- } catch {
701
- }
702
- return encodeURIComponent(val);
703
- },
704
- refresh: false
705
- };
706
- function useCookie(name, _opts) {
707
- const opts = { ...CookieDefaults, ..._opts };
708
- opts.filter ??= (key) => key === name;
709
- const cookies = readRawCookies(opts) || {};
710
- let delay;
711
- if (opts.maxAge !== void 0) {
712
- delay = opts.maxAge * 1e3;
713
- } else if (opts.expires) {
714
- delay = opts.expires.getTime() - Date.now();
715
- }
716
- const hasExpired = delay !== void 0 && delay <= 0;
717
- const cookieValue = klona(hasExpired ? void 0 : cookies[name] ?? opts.default?.());
718
- const cookie = cookieServerRef(name, cookieValue);
719
- {
720
- const nuxtApp = useNuxtApp();
721
- const writeFinalCookieValue = () => {
722
- const valueIsSame = isEqual(cookie.value, cookies[name]);
723
- if (opts.readonly || valueIsSame && !opts.refresh) {
724
- return;
725
- }
726
- nuxtApp._cookiesChanged ||= {};
727
- if (valueIsSame && opts.refresh && !nuxtApp._cookiesChanged[name]) {
728
- return;
729
- }
730
- nuxtApp._cookies ||= {};
731
- if (name in nuxtApp._cookies) {
732
- if (isEqual(cookie.value, nuxtApp._cookies[name])) {
733
- return;
734
- }
735
- }
736
- nuxtApp._cookies[name] = cookie.value;
737
- writeServerCookie(useRequestEvent(nuxtApp), name, cookie.value, opts);
738
- };
739
- const unhook = nuxtApp.hooks.hookOnce("app:rendered", writeFinalCookieValue);
740
- nuxtApp.hooks.hookOnce("app:error", () => {
741
- unhook();
742
- return writeFinalCookieValue();
743
- });
744
- }
745
- return cookie;
746
- }
747
- function readRawCookies(opts = {}) {
748
- {
749
- return parse(getRequestHeader(useRequestEvent(), "cookie") || "", opts);
750
- }
751
- }
752
- function writeServerCookie(event, name, value, opts = {}) {
753
- if (event) {
754
- if (value !== null && value !== void 0) {
755
- return setCookie(event, name, value, opts);
756
- }
757
- if (getCookie(event, name) !== void 0) {
758
- return deleteCookie(event, name, opts);
759
- }
760
- }
761
- }
762
- function cookieServerRef(name, value) {
763
- const internalRef = ref(value);
764
- const nuxtApp = useNuxtApp();
765
- return customRef((track, trigger) => {
766
- return {
767
- get() {
768
- track();
769
- return internalRef.value;
770
- },
771
- set(newValue) {
772
- nuxtApp._cookiesChanged ||= {};
773
- nuxtApp._cookiesChanged[name] = true;
774
- internalRef.value = newValue;
775
- trigger();
776
- }
777
- };
778
- });
779
- }
780
- function useResizable(key, options = {}, { collapsed = ref(false) } = {}) {
781
- const el = ref(null);
782
- const opts = computed(() => ({
783
- side: "left",
784
- minSize: 0,
785
- maxSize: 100,
786
- defaultSize: 0,
787
- storage: "cookie",
788
- persistent: true,
789
- collapsible: false,
790
- collapsedSize: 0,
791
- resizable: true,
792
- unit: "%",
793
- ...isRef(options) ? options.value : options
794
- }));
795
- const { dir } = useLocale();
796
- const defaultStorageValue = {
797
- size: opts.value.defaultSize,
798
- collapsed: unref(collapsed) ?? false
799
- };
800
- const storageData = opts.value.persistent && (opts.value.resizable || opts.value.collapsible) ? opts.value.storage === "cookie" ? useCookie(key, { default: () => defaultStorageValue }) : useStorage(key, defaultStorageValue) : ref(defaultStorageValue);
801
- const isCollapsed = computed({
802
- get: () => storageData.value.collapsed,
803
- set: (value) => {
804
- if (!opts.value.collapsible) {
805
- return;
806
- }
807
- if (isRef(collapsed)) {
808
- collapsed.value = value;
809
- }
810
- storageData.value.collapsed = value;
811
- }
812
- });
813
- const previousSize = ref(opts.value.defaultSize);
814
- const size = computed({
815
- get: () => storageData.value.size,
816
- set: (value) => {
817
- storageData.value.size = value;
818
- }
819
- });
820
- const currentSize = computed(() => isCollapsed.value ? opts.value.collapsedSize : size.value);
821
- const isDragging = ref(false);
822
- const onMouseMove = (e, initialPos, initialSize) => {
823
- if (!el.value || !opts.value.resizable) {
824
- return;
825
- }
826
- const parentSize = el.value.parentElement?.offsetWidth || 1;
827
- const isRtl = dir.value === "rtl";
828
- let delta;
829
- if (isRtl) {
830
- delta = opts.value.side === "left" ? initialPos - e.clientX : e.clientX - initialPos;
831
- } else {
832
- delta = opts.value.side === "left" ? e.clientX - initialPos : initialPos - e.clientX;
833
- }
834
- const newSize = initialSize + delta;
835
- let newValue;
836
- if (opts.value.unit === "rem") {
837
- const rootFontSize = Number.parseFloat(getComputedStyle((void 0).documentElement).fontSize);
838
- newValue = newSize / rootFontSize;
839
- } else if (opts.value.unit === "px") {
840
- newValue = newSize;
841
- } else {
842
- newValue = newSize / parentSize * 100;
843
- }
844
- if (opts.value.collapsible && newValue < opts.value.collapsedSize + 4) {
845
- collapse(true);
846
- return;
847
- } else if (isCollapsed.value) {
848
- collapse(false);
849
- }
850
- size.value = Math.min(opts.value.maxSize, Math.max(opts.value.minSize, newValue));
851
- };
852
- const onMouseDown = (e) => {
853
- if (!el.value || !opts.value.resizable) {
854
- return;
855
- }
856
- e.preventDefault();
857
- e.stopPropagation();
858
- const elWidth = el.value.getBoundingClientRect().width;
859
- if (!elWidth) {
860
- return;
861
- }
862
- const initialX = e.clientX;
863
- const initialWidth = elWidth;
864
- isDragging.value = true;
865
- const handleMouseMove = (e2) => {
866
- onMouseMove(e2, initialX, initialWidth);
867
- };
868
- const handleMouseUp = () => {
869
- isDragging.value = false;
870
- (void 0).removeEventListener("mousemove", handleMouseMove);
871
- (void 0).removeEventListener("mouseup", handleMouseUp);
872
- };
873
- (void 0).addEventListener("mousemove", handleMouseMove);
874
- (void 0).addEventListener("mouseup", handleMouseUp);
875
- };
876
- const onTouchMove = (e, initialPos, initialSize) => {
877
- if (!el.value || !opts.value.resizable || !e.touches[0]) {
878
- return;
879
- }
880
- const parentSize = el.value.parentElement?.offsetWidth || 1;
881
- const isRtl = dir.value === "rtl";
882
- let delta;
883
- if (isRtl) {
884
- delta = opts.value.side === "left" ? initialPos - e.touches[0].clientX : e.touches[0].clientX - initialPos;
885
- } else {
886
- delta = opts.value.side === "left" ? e.touches[0].clientX - initialPos : initialPos - e.touches[0].clientX;
887
- }
888
- const newSize = initialSize + delta;
889
- let newValue;
890
- if (opts.value.unit === "rem") {
891
- const rootFontSize = Number.parseFloat(getComputedStyle((void 0).documentElement).fontSize);
892
- newValue = newSize / rootFontSize;
893
- } else if (opts.value.unit === "px") {
894
- newValue = newSize;
895
- } else {
896
- newValue = newSize / parentSize * 100;
897
- }
898
- if (opts.value.collapsible && newValue < opts.value.collapsedSize + 4) {
899
- collapse(true);
900
- return;
901
- } else if (isCollapsed.value) {
902
- collapse(false);
903
- }
904
- size.value = Math.min(opts.value.maxSize, Math.max(opts.value.minSize, newValue));
905
- };
906
- const onTouchStart = (e) => {
907
- if (!el.value || !opts.value.resizable || !e.touches[0]) {
908
- return;
909
- }
910
- e.preventDefault();
911
- e.stopPropagation();
912
- const elWidth = el.value.getBoundingClientRect().width;
913
- if (!elWidth) {
914
- return;
915
- }
916
- const initialX = e.touches[0].clientX;
917
- const initialWidth = elWidth;
918
- isDragging.value = true;
919
- const handleTouchMove = (e2) => {
920
- onTouchMove(e2, initialX, initialWidth);
921
- };
922
- const handleTouchEnd = () => {
923
- isDragging.value = false;
924
- (void 0).removeEventListener("touchmove", handleTouchMove);
925
- (void 0).removeEventListener("touchend", handleTouchEnd);
926
- (void 0).removeEventListener("touchcancel", handleTouchEnd);
927
- };
928
- (void 0).addEventListener("touchmove", handleTouchMove, { passive: false });
929
- (void 0).addEventListener("touchend", handleTouchEnd);
930
- (void 0).addEventListener("touchcancel", handleTouchEnd);
931
- };
932
- const onDoubleClick = (e) => {
933
- if (!el.value || !opts.value.resizable) {
934
- return;
935
- }
936
- e.preventDefault();
937
- e.stopPropagation();
938
- if (isCollapsed.value) {
939
- collapse(false);
940
- }
941
- size.value = opts.value.defaultSize;
942
- };
943
- const collapse = (value) => {
944
- if (!opts.value.collapsible) {
945
- return;
946
- }
947
- const newCollapsed = value ?? !isCollapsed.value;
948
- if (newCollapsed && !isCollapsed.value) {
949
- previousSize.value = size.value;
950
- } else if (!newCollapsed && isCollapsed.value) {
951
- size.value = previousSize.value;
952
- }
953
- isCollapsed.value = newCollapsed;
954
- };
955
- if (isRef(collapsed) && storageData.value.collapsed) {
956
- collapsed.value = storageData.value.collapsed;
957
- }
958
- if (isRef(collapsed)) {
959
- watch(collapsed, (value) => {
960
- if (!opts.value.collapsible) {
961
- return;
962
- }
963
- if (storageData.value.collapsed !== value) {
964
- storageData.value.collapsed = value;
965
- }
966
- });
967
- }
968
- return {
969
- el,
970
- size: currentSize,
971
- isDragging,
972
- isCollapsed,
973
- onMouseDown,
974
- onTouchStart,
975
- onDoubleClick,
976
- collapse
977
- };
978
- }
979
- const theme$2 = {
980
- "base": "hidden lg:block touch-none select-none cursor-ew-resize relative before:absolute before:inset-y-0 before:-left-1.5 before:-right-1.5 before:z-1"
981
- };
982
- const _sfc_main$6 = {
983
- __name: "UDashboardResizeHandle",
984
- __ssrInlineRender: true,
985
- props: {
986
- as: { type: null, required: false },
987
- class: { type: null, required: false },
988
- ui: { type: Object, required: false }
989
- },
990
- setup(__props) {
991
- const props = __props;
992
- const appConfig = useAppConfig();
993
- const uiProp = useComponentUI("dashboardResizeHandle", props);
994
- const ui = computed(() => tv({ extend: tv(theme$2), ...appConfig.ui?.dashboardResizeHandle || {} }));
995
- return (_ctx, _push, _parent, _attrs) => {
996
- _push(ssrRenderComponent(unref(Primitive), mergeProps({
997
- as: __props.as,
998
- role: "separator",
999
- class: ui.value({ class: [unref(uiProp)?.base, props.class] })
1000
- }, _attrs), {
1001
- default: withCtx((_, _push2, _parent2, _scopeId) => {
1002
- if (_push2) {
1003
- ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
1004
- } else {
1005
- return [
1006
- renderSlot(_ctx.$slots, "default")
1007
- ];
1008
- }
1009
- }),
1010
- _: 3
1011
- }, _parent));
1012
- };
1013
- }
1014
- };
1015
- const _sfc_setup$6 = _sfc_main$6.setup;
1016
- _sfc_main$6.setup = (props, ctx) => {
1017
- const ssrContext = useSSRContext();
1018
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../../../node_modules/.pnpm/@nuxt+ui@4.6.0_@nuxt+content@3.12.0_better-sqlite3@12.8.0_magicast@0.5.2__@tiptap+exten_3f393c9004f614ad44f8f6b00c452ac6/node_modules/@nuxt/ui/dist/runtime/components/DashboardResizeHandle.vue");
1019
- return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
1020
- };
1021
- const theme$1 = {
1022
- "slots": {
1023
- "root": "relative flex flex-col min-w-0 min-h-svh lg:not-last:border-e lg:not-last:border-default shrink-0",
1024
- "body": "flex flex-col gap-4 sm:gap-6 flex-1 overflow-y-auto p-4 sm:p-6",
1025
- "handle": ""
1026
- },
1027
- "variants": {
1028
- "size": {
1029
- "true": {
1030
- "root": "w-full lg:w-(--width)"
1031
- },
1032
- "false": {
1033
- "root": "flex-1"
1034
- }
1035
- }
1036
- }
1037
- };
1038
- const _sfc_main$5 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
1039
- __name: "UDashboardPanel",
1040
- __ssrInlineRender: true,
1041
- props: {
1042
- class: { type: null, required: false },
1043
- ui: { type: Object, required: false },
1044
- id: { type: String, required: false },
1045
- minSize: { type: Number, required: false, default: 15 },
1046
- maxSize: { type: Number, required: false },
1047
- defaultSize: { type: Number, required: false },
1048
- resizable: { type: Boolean, required: false, default: false }
1049
- },
1050
- setup(__props) {
1051
- const props = __props;
1052
- const appConfig = useAppConfig();
1053
- const uiProp = useComponentUI("dashboardPanel", props);
1054
- const dashboardContext = useDashboard({ storageKey: "dashboard", unit: "%" });
1055
- const id = `${dashboardContext.storageKey}-panel-${props.id || useId$1()}`;
1056
- const { el, size, isDragging, onMouseDown, onTouchStart, onDoubleClick } = useResizable(id, toRef(() => ({ ...dashboardContext, ...props })));
1057
- const ui = computed(() => tv({ extend: tv(theme$1), ...appConfig.ui?.dashboardPanel || {} })({
1058
- size: !!size.value
1059
- }));
1060
- return (_ctx, _push, _parent, _attrs) => {
1061
- _push(`<!--[--><div${ssrRenderAttrs(mergeProps({
1062
- id,
1063
- ref_key: "el",
1064
- ref: el
1065
- }, _ctx.$attrs, {
1066
- "data-dragging": unref(isDragging),
1067
- "data-slot": "root",
1068
- class: ui.value.root({ class: [unref(uiProp)?.root, props.class] }),
1069
- style: [unref(size) ? { "--width": `${unref(size)}${unref(dashboardContext).unit}` } : void 0]
1070
- }))}>`);
1071
- ssrRenderSlot(_ctx.$slots, "default", {}, () => {
1072
- ssrRenderSlot(_ctx.$slots, "header", {}, null, _push, _parent);
1073
- _push(`<div data-slot="body" class="${ssrRenderClass(ui.value.body({ class: unref(uiProp)?.body }))}">`);
1074
- ssrRenderSlot(_ctx.$slots, "body", {}, null, _push, _parent);
1075
- _push(`</div>`);
1076
- ssrRenderSlot(_ctx.$slots, "footer", {}, null, _push, _parent);
1077
- }, _push, _parent);
1078
- _push(`</div>`);
1079
- ssrRenderSlot(_ctx.$slots, "resize-handle", {
1080
- onMouseDown: unref(onMouseDown),
1081
- onTouchStart: unref(onTouchStart),
1082
- onDoubleClick: unref(onDoubleClick)
1083
- }, () => {
1084
- if (__props.resizable) {
1085
- _push(ssrRenderComponent(_sfc_main$6, {
1086
- "aria-controls": id,
1087
- "data-slot": "handle",
1088
- class: ui.value.handle({ class: unref(uiProp)?.handle }),
1089
- onMousedown: unref(onMouseDown),
1090
- onTouchstart: unref(onTouchStart),
1091
- onDblclick: unref(onDoubleClick)
1092
- }, null, _parent));
1093
- } else {
1094
- _push(`<!---->`);
1095
- }
1096
- }, _push, _parent);
1097
- _push(`<!--]-->`);
1098
- };
1099
- }
1100
- });
1101
- const _sfc_setup$5 = _sfc_main$5.setup;
1102
- _sfc_main$5.setup = (props, ctx) => {
1103
- const ssrContext = useSSRContext();
1104
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../../../node_modules/.pnpm/@nuxt+ui@4.6.0_@nuxt+content@3.12.0_better-sqlite3@12.8.0_magicast@0.5.2__@tiptap+exten_3f393c9004f614ad44f8f6b00c452ac6/node_modules/@nuxt/ui/dist/runtime/components/DashboardPanel.vue");
1105
- return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
1106
- };
1107
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1108
- __name: "StudioEditor",
1109
- __ssrInlineRender: true,
1110
- props: {
1111
- modelValue: {}
1112
- },
1113
- emits: ["update:modelValue"],
1114
- setup(__props, { emit: __emit }) {
1115
- const props = __props;
1116
- const editorContainer = ref(null);
1117
- const editorInstance = shallowRef(null);
1118
- watch(
1119
- () => props.modelValue,
1120
- (newValue) => {
1121
- if (editorInstance.value && editorInstance.value.getValue() !== newValue) {
1122
- editorInstance.value.setValue(newValue);
1123
- }
1124
- }
1125
- );
1126
- return (_ctx, _push, _parent, _attrs) => {
1127
- _push(`<div${ssrRenderAttrs(mergeProps({
1128
- ref_key: "editorContainer",
1129
- ref: editorContainer,
1130
- class: "w-full h-full"
1131
- }, _attrs))}></div>`);
1132
- };
1133
- }
1134
- });
1135
- const _sfc_setup$4 = _sfc_main$4.setup;
1136
- _sfc_main$4.setup = (props, ctx) => {
1137
- const ssrContext = useSSRContext();
1138
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/StudioEditor.vue");
1139
- return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
1140
- };
1141
- const __nuxt_component_5 = Object.assign(_sfc_main$4, { __name: "StudioEditor" });
1142
- const theme = {
1143
- "slots": {
1144
- "root": "",
1145
- "content": "data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden"
1146
- }
1147
- };
1148
- const _sfc_main$3 = {
1149
- __name: "UCollapsible",
1150
- __ssrInlineRender: true,
1151
- props: {
1152
- as: { type: null, required: false },
1153
- class: { type: null, required: false },
1154
- ui: { type: Object, required: false },
1155
- defaultOpen: { type: Boolean, required: false },
1156
- open: { type: Boolean, required: false },
1157
- disabled: { type: Boolean, required: false },
1158
- unmountOnHide: { type: Boolean, required: false, default: true }
1159
- },
1160
- emits: ["update:open"],
1161
- setup(__props, { emit: __emit }) {
1162
- const props = __props;
1163
- const emits = __emit;
1164
- const slots = useSlots();
1165
- const appConfig = useAppConfig();
1166
- const uiProp = useComponentUI("collapsible", props);
1167
- const rootProps = useForwardPropsEmits(reactivePick(props, "as", "defaultOpen", "open", "disabled", "unmountOnHide"), emits);
1168
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.collapsible || {} })());
1169
- return (_ctx, _push, _parent, _attrs) => {
1170
- _push(ssrRenderComponent(unref(CollapsibleRoot_default), mergeProps(unref(rootProps), {
1171
- "data-slot": "root",
1172
- class: ui.value.root({ class: [unref(uiProp)?.root, props.class] })
1173
- }, _attrs), {
1174
- default: withCtx(({ open }, _push2, _parent2, _scopeId) => {
1175
- if (_push2) {
1176
- if (!!slots.default) {
1177
- _push2(ssrRenderComponent(unref(CollapsibleTrigger_default), { "as-child": "" }, {
1178
- default: withCtx((_, _push3, _parent3, _scopeId2) => {
1179
- if (_push3) {
1180
- ssrRenderSlot(_ctx.$slots, "default", { open }, null, _push3, _parent3, _scopeId2);
1181
- } else {
1182
- return [
1183
- renderSlot(_ctx.$slots, "default", { open })
1184
- ];
1185
- }
1186
- }),
1187
- _: 2
1188
- }, _parent2, _scopeId));
1189
- } else {
1190
- _push2(`<!---->`);
1191
- }
1192
- _push2(ssrRenderComponent(unref(CollapsibleContent_default), {
1193
- "data-slot": "content",
1194
- class: ui.value.content({ class: unref(uiProp)?.content })
1195
- }, {
1196
- default: withCtx((_, _push3, _parent3, _scopeId2) => {
1197
- if (_push3) {
1198
- ssrRenderSlot(_ctx.$slots, "content", {}, null, _push3, _parent3, _scopeId2);
1199
- } else {
1200
- return [
1201
- renderSlot(_ctx.$slots, "content")
1202
- ];
1203
- }
1204
- }),
1205
- _: 2
1206
- }, _parent2, _scopeId));
1207
- } else {
1208
- return [
1209
- !!slots.default ? (openBlock(), createBlock(unref(CollapsibleTrigger_default), {
1210
- key: 0,
1211
- "as-child": ""
1212
- }, {
1213
- default: withCtx(() => [
1214
- renderSlot(_ctx.$slots, "default", { open })
1215
- ]),
1216
- _: 2
1217
- }, 1024)) : createCommentVNode("", true),
1218
- createVNode(unref(CollapsibleContent_default), {
1219
- "data-slot": "content",
1220
- class: ui.value.content({ class: unref(uiProp)?.content })
1221
- }, {
1222
- default: withCtx(() => [
1223
- renderSlot(_ctx.$slots, "content")
1224
- ]),
1225
- _: 3
1226
- }, 8, ["class"])
1227
- ];
1228
- }
1229
- }),
1230
- _: 3
1231
- }, _parent));
1232
- };
1233
- }
1234
- };
1235
- const _sfc_setup$3 = _sfc_main$3.setup;
1236
- _sfc_main$3.setup = (props, ctx) => {
1237
- const ssrContext = useSSRContext();
1238
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../../../node_modules/.pnpm/@nuxt+ui@4.6.0_@nuxt+content@3.12.0_better-sqlite3@12.8.0_magicast@0.5.2__@tiptap+exten_3f393c9004f614ad44f8f6b00c452ac6/node_modules/@nuxt/ui/dist/runtime/components/Collapsible.vue");
1239
- return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
1240
- };
1241
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1242
- __name: "StudioOutput",
1243
- __ssrInlineRender: true,
1244
- props: {
1245
- modelValue: {}
1246
- },
1247
- setup(__props) {
1248
- const props = __props;
1249
- const outputContainer = ref(null);
1250
- const editorInstance = shallowRef(null);
1251
- watch(
1252
- () => props.modelValue,
1253
- (newValue) => {
1254
- if (editorInstance.value) {
1255
- editorInstance.value.setValue(newValue);
1256
- }
1257
- }
1258
- );
1259
- return (_ctx, _push, _parent, _attrs) => {
1260
- _push(`<div${ssrRenderAttrs(mergeProps({
1261
- ref_key: "outputContainer",
1262
- ref: outputContainer,
1263
- class: "w-full h-full"
1264
- }, _attrs))}></div>`);
1265
- };
1266
- }
1267
- });
1268
- const _sfc_setup$2 = _sfc_main$2.setup;
1269
- _sfc_main$2.setup = (props, ctx) => {
1270
- const ssrContext = useSSRContext();
1271
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/StudioOutput.vue");
1272
- return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
1273
- };
1274
- const __nuxt_component_8 = Object.assign(_sfc_main$2, { __name: "StudioOutput" });
1275
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1276
- __name: "ZodMongooseStudio",
1277
- __ssrInlineRender: true,
1278
- setup(__props) {
1279
- let debounceTimer;
1280
- const config = useRuntimeConfig();
1281
- const isLocalMode = ref(config.public.isLocalMode);
1282
- const isDocsMode = ref(config.public.isDocsMode);
1283
- const sourceCode = ref(`import { z } from 'zod/v4';
1284
- import { extractMongooseDef, toMongooseSchema } from '@nullix/zod-mongoose';
1285
-
1286
- const UserSchema = z.object({
1287
- name: z.string(),
1288
- age: z.number().optional()
1289
- });
1290
-
1291
- // Export your schema so the Studio can transform it
1292
- export default UserSchema;`);
1293
- const outputDef = ref("// Definition output...");
1294
- const outputSchema = ref("// Mongoose Schema output...");
1295
- const outputTree = ref("// Mongoose Schema tree output...");
1296
- const outputPaths = ref("// Mongoose Schema paths output...");
1297
- const activeSchemaView = ref("obj");
1298
- const activeSchemaViewOutput = computed(() => {
1299
- switch (activeSchemaView.value) {
1300
- case "obj":
1301
- return outputSchema;
1302
- case "tree":
1303
- return outputTree;
1304
- case "paths":
1305
- return outputPaths;
1306
- }
1307
- });
1308
- const isDefOpen = ref(true);
1309
- const isSchemaOpen = ref(true);
1310
- const isCompiling = ref(false);
1311
- const handleCompile = async () => {
1312
- isCompiling.value = true;
1313
- try {
1314
- const response = await $fetch("/api/parse", {
1315
- method: "POST",
1316
- body: { sourceCode: sourceCode.value }
1317
- });
1318
- outputDef.value = `// Result of extractMongooseDef()
1319
- const definition = ${response.definition};`;
1320
- outputSchema.value = `// Result of toMongooseSchema().obj
1321
- const schemaObj = ${response.schemaObj};`;
1322
- outputTree.value = `// Result of toMongooseSchema().tree
1323
- const schemaTree = ${response.schemaTree};`;
1324
- outputPaths.value = `// Result of toMongooseSchema().paths
1325
- const schemaPaths = ${response.schemaPaths};`;
1326
- } catch (error) {
1327
- const errText = `// Error
1328
- ${error.data?.message || error.message}`;
1329
- outputDef.value = errText;
1330
- outputSchema.value = errText;
1331
- outputTree.value = errText;
1332
- outputPaths.value = errText;
1333
- } finally {
1334
- isCompiling.value = false;
1335
- }
1336
- };
1337
- watch(sourceCode, () => {
1338
- if (isDocsMode.value) return;
1339
- clearTimeout(debounceTimer);
1340
- debounceTimer = setTimeout(handleCompile, 600);
1341
- });
1342
- if (isDocsMode.value) {
1343
- handleCompile();
1344
- }
1345
- return (_ctx, _push, _parent, _attrs) => {
1346
- const _component_UBadge = _sfc_main$8;
1347
- const _component_UButton = _sfc_main$8$1;
1348
- const _component_UDashboardGroup = _sfc_main$7;
1349
- const _component_UDashboardPanel = _sfc_main$5;
1350
- const _component_ClientOnly = __nuxt_component_4;
1351
- const _component_StudioEditor = __nuxt_component_5;
1352
- const _component_UCollapsible = _sfc_main$3;
1353
- const _component_UIcon = _sfc_main$d;
1354
- const _component_StudioOutput = __nuxt_component_8;
1355
- _push(`<div${ssrRenderAttrs(mergeProps({
1356
- class: ["flex flex-col bg-gray-50 dark:bg-gray-950 overflow-hidden relative", [
1357
- isDocsMode.value ? "h-[calc(100vh-var(--ui-header-height,64px))] sticky top-[var(--ui-header-height,64px)]" : "h-screen"
1358
- ]]
1359
- }, _attrs))}><header class="bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-800 py-3 px-4 flex justify-between items-center shrink-0 z-20"><div class="flex items-center gap-4"><h1 class="text-xl font-bold text-primary"> @nullix/zod-mongoose Studio </h1>`);
1360
- if (isLocalMode.value) {
1361
- _push(ssrRenderComponent(_component_UBadge, {
1362
- color: "success",
1363
- variant: "soft"
1364
- }, {
1365
- default: withCtx((_, _push2, _parent2, _scopeId) => {
1366
- if (_push2) {
1367
- _push2(`Local Mode`);
1368
- } else {
1369
- return [
1370
- createTextVNode("Local Mode")
1371
- ];
1372
- }
1373
- }),
1374
- _: 1
1375
- }, _parent));
1376
- } else {
1377
- _push(ssrRenderComponent(_component_UBadge, {
1378
- color: "info",
1379
- variant: "soft"
1380
- }, {
1381
- default: withCtx((_, _push2, _parent2, _scopeId) => {
1382
- if (_push2) {
1383
- _push2(`Docs Mode`);
1384
- } else {
1385
- return [
1386
- createTextVNode("Docs Mode")
1387
- ];
1388
- }
1389
- }),
1390
- _: 1
1391
- }, _parent));
1392
- }
1393
- _push(`</div><div class="flex items-center gap-2">`);
1394
- if (isDocsMode.value) {
1395
- _push(ssrRenderComponent(_component_UButton, {
1396
- icon: "i-heroicons-play-solid",
1397
- color: "primary",
1398
- loading: isCompiling.value,
1399
- onClick: handleCompile
1400
- }, {
1401
- default: withCtx((_, _push2, _parent2, _scopeId) => {
1402
- if (_push2) {
1403
- _push2(` Run `);
1404
- } else {
1405
- return [
1406
- createTextVNode(" Run ")
1407
- ];
1408
- }
1409
- }),
1410
- _: 1
1411
- }, _parent));
1412
- } else if (isCompiling.value) {
1413
- _push(`<span class="text-sm text-gray-500">Transforming...</span>`);
1414
- } else {
1415
- _push(`<!---->`);
1416
- }
1417
- _push(`</div></header>`);
1418
- _push(ssrRenderComponent(_component_UDashboardGroup, {
1419
- class: "flex-1 min-h-0 !relative !inset-auto",
1420
- "storage-key": "studio-layout"
1421
- }, {
1422
- default: withCtx((_, _push2, _parent2, _scopeId) => {
1423
- if (_push2) {
1424
- _push2(ssrRenderComponent(_component_UDashboardPanel, {
1425
- id: "editor",
1426
- collapsible: "",
1427
- resizable: "",
1428
- "min-size": 20
1429
- }, {
1430
- default: withCtx((_2, _push3, _parent3, _scopeId2) => {
1431
- if (_push3) {
1432
- _push3(`<div class="h-full relative bg-white dark:bg-gray-950"${_scopeId2}>`);
1433
- _push3(ssrRenderComponent(_component_ClientOnly, null, {}, _parent3, _scopeId2));
1434
- _push3(`</div>`);
1435
- } else {
1436
- return [
1437
- createVNode("div", { class: "h-full relative bg-white dark:bg-gray-950" }, [
1438
- createVNode(_component_ClientOnly, null, {
1439
- default: withCtx(() => [
1440
- createVNode(_component_StudioEditor, {
1441
- modelValue: sourceCode.value,
1442
- "onUpdate:modelValue": ($event) => sourceCode.value = $event
1443
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
1444
- ]),
1445
- _: 1
1446
- })
1447
- ])
1448
- ];
1449
- }
1450
- }),
1451
- _: 1
1452
- }, _parent2, _scopeId));
1453
- _push2(ssrRenderComponent(_component_UDashboardPanel, {
1454
- id: "outputs",
1455
- resizable: "",
1456
- "min-size": 20,
1457
- class: "flex flex-col h-full bg-gray-200 dark:bg-gray-800 overflow-hidden"
1458
- }, {
1459
- default: withCtx((_2, _push3, _parent3, _scopeId2) => {
1460
- if (_push3) {
1461
- _push3(ssrRenderComponent(_component_UCollapsible, {
1462
- open: isDefOpen.value,
1463
- "onUpdate:open": ($event) => isDefOpen.value = $event,
1464
- class: [[isDefOpen.value ? "flex-1" : "flex-none"], "bg-white dark:bg-gray-950 flex flex-col min-h-0"],
1465
- ui: { content: "flex-1 flex flex-col min-h-0" }
1466
- }, {
1467
- default: withCtx(({ open }, _push4, _parent4, _scopeId3) => {
1468
- if (_push4) {
1469
- _push4(`<div class="px-3 py-1 bg-gray-100 dark:bg-gray-900 text-xs font-semibold text-gray-600 dark:text-gray-400 border-b border-gray-200 dark:border-gray-800 z-10 flex justify-between items-center cursor-pointer select-none"${_scopeId3}><span${_scopeId3}>extractMongooseDef()</span>`);
1470
- _push4(ssrRenderComponent(_component_UIcon, {
1471
- name: open ? "i-heroicons-chevron-down" : "i-heroicons-chevron-right"
1472
- }, null, _parent4, _scopeId3));
1473
- _push4(`</div>`);
1474
- } else {
1475
- return [
1476
- createVNode("div", { class: "px-3 py-1 bg-gray-100 dark:bg-gray-900 text-xs font-semibold text-gray-600 dark:text-gray-400 border-b border-gray-200 dark:border-gray-800 z-10 flex justify-between items-center cursor-pointer select-none" }, [
1477
- createVNode("span", null, "extractMongooseDef()"),
1478
- createVNode(_component_UIcon, {
1479
- name: open ? "i-heroicons-chevron-down" : "i-heroicons-chevron-right"
1480
- }, null, 8, ["name"])
1481
- ])
1482
- ];
1483
- }
1484
- }),
1485
- content: withCtx((_3, _push4, _parent4, _scopeId3) => {
1486
- if (_push4) {
1487
- _push4(`<div class="flex-1 relative"${_scopeId3}>`);
1488
- _push4(ssrRenderComponent(_component_ClientOnly, null, {}, _parent4, _scopeId3));
1489
- _push4(`</div>`);
1490
- } else {
1491
- return [
1492
- createVNode("div", { class: "flex-1 relative" }, [
1493
- createVNode(_component_ClientOnly, null, {
1494
- default: withCtx(() => [
1495
- createVNode(_component_StudioOutput, { "model-value": outputDef.value }, null, 8, ["model-value"])
1496
- ]),
1497
- _: 1
1498
- })
1499
- ])
1500
- ];
1501
- }
1502
- }),
1503
- _: 1
1504
- }, _parent3, _scopeId2));
1505
- _push3(ssrRenderComponent(_component_UCollapsible, {
1506
- open: isSchemaOpen.value,
1507
- "onUpdate:open": ($event) => isSchemaOpen.value = $event,
1508
- class: [[isSchemaOpen.value ? "flex-1" : "flex-none"], "bg-white dark:bg-gray-950 flex flex-col min-h-0"],
1509
- ui: { content: "flex-1 flex flex-col min-h-0" }
1510
- }, {
1511
- default: withCtx(({ open }, _push4, _parent4, _scopeId3) => {
1512
- if (_push4) {
1513
- _push4(`<div class="px-3 py-1 bg-gray-100 dark:bg-gray-900 text-xs font-semibold text-gray-600 dark:text-gray-400 border-b border-gray-200 dark:border-gray-800 z-10 flex justify-between items-center cursor-pointer select-none"${_scopeId3}><div class="flex items-center gap-2"${_scopeId3}><span${_scopeId3}>toMongooseSchema()</span><div class="flex gap-1"${_scopeId3}>`);
1514
- _push4(ssrRenderComponent(_component_UButton, {
1515
- size: "xs",
1516
- variant: "ghost",
1517
- color: activeSchemaView.value === "obj" ? "primary" : "neutral",
1518
- onClick: ($event) => activeSchemaView.value = "obj"
1519
- }, {
1520
- default: withCtx((_3, _push5, _parent5, _scopeId4) => {
1521
- if (_push5) {
1522
- _push5(` .obj `);
1523
- } else {
1524
- return [
1525
- createTextVNode(" .obj ")
1526
- ];
1527
- }
1528
- }),
1529
- _: 2
1530
- }, _parent4, _scopeId3));
1531
- _push4(ssrRenderComponent(_component_UButton, {
1532
- size: "xs",
1533
- variant: "ghost",
1534
- color: activeSchemaView.value === "tree" ? "primary" : "neutral",
1535
- onClick: ($event) => activeSchemaView.value = "tree"
1536
- }, {
1537
- default: withCtx((_3, _push5, _parent5, _scopeId4) => {
1538
- if (_push5) {
1539
- _push5(` .tree `);
1540
- } else {
1541
- return [
1542
- createTextVNode(" .tree ")
1543
- ];
1544
- }
1545
- }),
1546
- _: 2
1547
- }, _parent4, _scopeId3));
1548
- _push4(ssrRenderComponent(_component_UButton, {
1549
- size: "xs",
1550
- variant: "ghost",
1551
- color: activeSchemaView.value === "paths" ? "primary" : "neutral",
1552
- onClick: ($event) => activeSchemaView.value = "paths"
1553
- }, {
1554
- default: withCtx((_3, _push5, _parent5, _scopeId4) => {
1555
- if (_push5) {
1556
- _push5(` .paths `);
1557
- } else {
1558
- return [
1559
- createTextVNode(" .paths ")
1560
- ];
1561
- }
1562
- }),
1563
- _: 2
1564
- }, _parent4, _scopeId3));
1565
- _push4(`</div></div>`);
1566
- _push4(ssrRenderComponent(_component_UIcon, {
1567
- name: open ? "i-heroicons-chevron-down" : "i-heroicons-chevron-right"
1568
- }, null, _parent4, _scopeId3));
1569
- _push4(`</div>`);
1570
- } else {
1571
- return [
1572
- createVNode("div", { class: "px-3 py-1 bg-gray-100 dark:bg-gray-900 text-xs font-semibold text-gray-600 dark:text-gray-400 border-b border-gray-200 dark:border-gray-800 z-10 flex justify-between items-center cursor-pointer select-none" }, [
1573
- createVNode("div", { class: "flex items-center gap-2" }, [
1574
- createVNode("span", null, "toMongooseSchema()"),
1575
- createVNode("div", {
1576
- class: "flex gap-1",
1577
- onClick: withModifiers(() => {
1578
- }, ["stop"])
1579
- }, [
1580
- createVNode(_component_UButton, {
1581
- size: "xs",
1582
- variant: "ghost",
1583
- color: activeSchemaView.value === "obj" ? "primary" : "neutral",
1584
- onClick: ($event) => activeSchemaView.value = "obj"
1585
- }, {
1586
- default: withCtx(() => [
1587
- createTextVNode(" .obj ")
1588
- ]),
1589
- _: 1
1590
- }, 8, ["color", "onClick"]),
1591
- createVNode(_component_UButton, {
1592
- size: "xs",
1593
- variant: "ghost",
1594
- color: activeSchemaView.value === "tree" ? "primary" : "neutral",
1595
- onClick: ($event) => activeSchemaView.value = "tree"
1596
- }, {
1597
- default: withCtx(() => [
1598
- createTextVNode(" .tree ")
1599
- ]),
1600
- _: 1
1601
- }, 8, ["color", "onClick"]),
1602
- createVNode(_component_UButton, {
1603
- size: "xs",
1604
- variant: "ghost",
1605
- color: activeSchemaView.value === "paths" ? "primary" : "neutral",
1606
- onClick: ($event) => activeSchemaView.value = "paths"
1607
- }, {
1608
- default: withCtx(() => [
1609
- createTextVNode(" .paths ")
1610
- ]),
1611
- _: 1
1612
- }, 8, ["color", "onClick"])
1613
- ], 8, ["onClick"])
1614
- ]),
1615
- createVNode(_component_UIcon, {
1616
- name: open ? "i-heroicons-chevron-down" : "i-heroicons-chevron-right"
1617
- }, null, 8, ["name"])
1618
- ])
1619
- ];
1620
- }
1621
- }),
1622
- content: withCtx((_3, _push4, _parent4, _scopeId3) => {
1623
- if (_push4) {
1624
- _push4(`<div class="flex-1 relative"${_scopeId3}>`);
1625
- _push4(ssrRenderComponent(_component_ClientOnly, null, {}, _parent4, _scopeId3));
1626
- _push4(`</div>`);
1627
- } else {
1628
- return [
1629
- createVNode("div", { class: "flex-1 relative" }, [
1630
- createVNode(_component_ClientOnly, null, {
1631
- default: withCtx(() => [
1632
- createVNode(_component_StudioOutput, {
1633
- "model-value": unref(activeSchemaViewOutput).value
1634
- }, null, 8, ["model-value"])
1635
- ]),
1636
- _: 1
1637
- })
1638
- ])
1639
- ];
1640
- }
1641
- }),
1642
- _: 1
1643
- }, _parent3, _scopeId2));
1644
- } else {
1645
- return [
1646
- createVNode(_component_UCollapsible, {
1647
- open: isDefOpen.value,
1648
- "onUpdate:open": ($event) => isDefOpen.value = $event,
1649
- class: [[isDefOpen.value ? "flex-1" : "flex-none"], "bg-white dark:bg-gray-950 flex flex-col min-h-0"],
1650
- ui: { content: "flex-1 flex flex-col min-h-0" }
1651
- }, {
1652
- default: withCtx(({ open }) => [
1653
- createVNode("div", { class: "px-3 py-1 bg-gray-100 dark:bg-gray-900 text-xs font-semibold text-gray-600 dark:text-gray-400 border-b border-gray-200 dark:border-gray-800 z-10 flex justify-between items-center cursor-pointer select-none" }, [
1654
- createVNode("span", null, "extractMongooseDef()"),
1655
- createVNode(_component_UIcon, {
1656
- name: open ? "i-heroicons-chevron-down" : "i-heroicons-chevron-right"
1657
- }, null, 8, ["name"])
1658
- ])
1659
- ]),
1660
- content: withCtx(() => [
1661
- createVNode("div", { class: "flex-1 relative" }, [
1662
- createVNode(_component_ClientOnly, null, {
1663
- default: withCtx(() => [
1664
- createVNode(_component_StudioOutput, { "model-value": outputDef.value }, null, 8, ["model-value"])
1665
- ]),
1666
- _: 1
1667
- })
1668
- ])
1669
- ]),
1670
- _: 1
1671
- }, 8, ["open", "onUpdate:open", "class"]),
1672
- createVNode(_component_UCollapsible, {
1673
- open: isSchemaOpen.value,
1674
- "onUpdate:open": ($event) => isSchemaOpen.value = $event,
1675
- class: [[isSchemaOpen.value ? "flex-1" : "flex-none"], "bg-white dark:bg-gray-950 flex flex-col min-h-0"],
1676
- ui: { content: "flex-1 flex flex-col min-h-0" }
1677
- }, {
1678
- default: withCtx(({ open }) => [
1679
- createVNode("div", { class: "px-3 py-1 bg-gray-100 dark:bg-gray-900 text-xs font-semibold text-gray-600 dark:text-gray-400 border-b border-gray-200 dark:border-gray-800 z-10 flex justify-between items-center cursor-pointer select-none" }, [
1680
- createVNode("div", { class: "flex items-center gap-2" }, [
1681
- createVNode("span", null, "toMongooseSchema()"),
1682
- createVNode("div", {
1683
- class: "flex gap-1",
1684
- onClick: withModifiers(() => {
1685
- }, ["stop"])
1686
- }, [
1687
- createVNode(_component_UButton, {
1688
- size: "xs",
1689
- variant: "ghost",
1690
- color: activeSchemaView.value === "obj" ? "primary" : "neutral",
1691
- onClick: ($event) => activeSchemaView.value = "obj"
1692
- }, {
1693
- default: withCtx(() => [
1694
- createTextVNode(" .obj ")
1695
- ]),
1696
- _: 1
1697
- }, 8, ["color", "onClick"]),
1698
- createVNode(_component_UButton, {
1699
- size: "xs",
1700
- variant: "ghost",
1701
- color: activeSchemaView.value === "tree" ? "primary" : "neutral",
1702
- onClick: ($event) => activeSchemaView.value = "tree"
1703
- }, {
1704
- default: withCtx(() => [
1705
- createTextVNode(" .tree ")
1706
- ]),
1707
- _: 1
1708
- }, 8, ["color", "onClick"]),
1709
- createVNode(_component_UButton, {
1710
- size: "xs",
1711
- variant: "ghost",
1712
- color: activeSchemaView.value === "paths" ? "primary" : "neutral",
1713
- onClick: ($event) => activeSchemaView.value = "paths"
1714
- }, {
1715
- default: withCtx(() => [
1716
- createTextVNode(" .paths ")
1717
- ]),
1718
- _: 1
1719
- }, 8, ["color", "onClick"])
1720
- ], 8, ["onClick"])
1721
- ]),
1722
- createVNode(_component_UIcon, {
1723
- name: open ? "i-heroicons-chevron-down" : "i-heroicons-chevron-right"
1724
- }, null, 8, ["name"])
1725
- ])
1726
- ]),
1727
- content: withCtx(() => [
1728
- createVNode("div", { class: "flex-1 relative" }, [
1729
- createVNode(_component_ClientOnly, null, {
1730
- default: withCtx(() => [
1731
- createVNode(_component_StudioOutput, {
1732
- "model-value": unref(activeSchemaViewOutput).value
1733
- }, null, 8, ["model-value"])
1734
- ]),
1735
- _: 1
1736
- })
1737
- ])
1738
- ]),
1739
- _: 1
1740
- }, 8, ["open", "onUpdate:open", "class"])
1741
- ];
1742
- }
1743
- }),
1744
- _: 1
1745
- }, _parent2, _scopeId));
1746
- } else {
1747
- return [
1748
- createVNode(_component_UDashboardPanel, {
1749
- id: "editor",
1750
- collapsible: "",
1751
- resizable: "",
1752
- "min-size": 20
1753
- }, {
1754
- default: withCtx(() => [
1755
- createVNode("div", { class: "h-full relative bg-white dark:bg-gray-950" }, [
1756
- createVNode(_component_ClientOnly, null, {
1757
- default: withCtx(() => [
1758
- createVNode(_component_StudioEditor, {
1759
- modelValue: sourceCode.value,
1760
- "onUpdate:modelValue": ($event) => sourceCode.value = $event
1761
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
1762
- ]),
1763
- _: 1
1764
- })
1765
- ])
1766
- ]),
1767
- _: 1
1768
- }),
1769
- createVNode(_component_UDashboardPanel, {
1770
- id: "outputs",
1771
- resizable: "",
1772
- "min-size": 20,
1773
- class: "flex flex-col h-full bg-gray-200 dark:bg-gray-800 overflow-hidden"
1774
- }, {
1775
- default: withCtx(() => [
1776
- createVNode(_component_UCollapsible, {
1777
- open: isDefOpen.value,
1778
- "onUpdate:open": ($event) => isDefOpen.value = $event,
1779
- class: [[isDefOpen.value ? "flex-1" : "flex-none"], "bg-white dark:bg-gray-950 flex flex-col min-h-0"],
1780
- ui: { content: "flex-1 flex flex-col min-h-0" }
1781
- }, {
1782
- default: withCtx(({ open }) => [
1783
- createVNode("div", { class: "px-3 py-1 bg-gray-100 dark:bg-gray-900 text-xs font-semibold text-gray-600 dark:text-gray-400 border-b border-gray-200 dark:border-gray-800 z-10 flex justify-between items-center cursor-pointer select-none" }, [
1784
- createVNode("span", null, "extractMongooseDef()"),
1785
- createVNode(_component_UIcon, {
1786
- name: open ? "i-heroicons-chevron-down" : "i-heroicons-chevron-right"
1787
- }, null, 8, ["name"])
1788
- ])
1789
- ]),
1790
- content: withCtx(() => [
1791
- createVNode("div", { class: "flex-1 relative" }, [
1792
- createVNode(_component_ClientOnly, null, {
1793
- default: withCtx(() => [
1794
- createVNode(_component_StudioOutput, { "model-value": outputDef.value }, null, 8, ["model-value"])
1795
- ]),
1796
- _: 1
1797
- })
1798
- ])
1799
- ]),
1800
- _: 1
1801
- }, 8, ["open", "onUpdate:open", "class"]),
1802
- createVNode(_component_UCollapsible, {
1803
- open: isSchemaOpen.value,
1804
- "onUpdate:open": ($event) => isSchemaOpen.value = $event,
1805
- class: [[isSchemaOpen.value ? "flex-1" : "flex-none"], "bg-white dark:bg-gray-950 flex flex-col min-h-0"],
1806
- ui: { content: "flex-1 flex flex-col min-h-0" }
1807
- }, {
1808
- default: withCtx(({ open }) => [
1809
- createVNode("div", { class: "px-3 py-1 bg-gray-100 dark:bg-gray-900 text-xs font-semibold text-gray-600 dark:text-gray-400 border-b border-gray-200 dark:border-gray-800 z-10 flex justify-between items-center cursor-pointer select-none" }, [
1810
- createVNode("div", { class: "flex items-center gap-2" }, [
1811
- createVNode("span", null, "toMongooseSchema()"),
1812
- createVNode("div", {
1813
- class: "flex gap-1",
1814
- onClick: withModifiers(() => {
1815
- }, ["stop"])
1816
- }, [
1817
- createVNode(_component_UButton, {
1818
- size: "xs",
1819
- variant: "ghost",
1820
- color: activeSchemaView.value === "obj" ? "primary" : "neutral",
1821
- onClick: ($event) => activeSchemaView.value = "obj"
1822
- }, {
1823
- default: withCtx(() => [
1824
- createTextVNode(" .obj ")
1825
- ]),
1826
- _: 1
1827
- }, 8, ["color", "onClick"]),
1828
- createVNode(_component_UButton, {
1829
- size: "xs",
1830
- variant: "ghost",
1831
- color: activeSchemaView.value === "tree" ? "primary" : "neutral",
1832
- onClick: ($event) => activeSchemaView.value = "tree"
1833
- }, {
1834
- default: withCtx(() => [
1835
- createTextVNode(" .tree ")
1836
- ]),
1837
- _: 1
1838
- }, 8, ["color", "onClick"]),
1839
- createVNode(_component_UButton, {
1840
- size: "xs",
1841
- variant: "ghost",
1842
- color: activeSchemaView.value === "paths" ? "primary" : "neutral",
1843
- onClick: ($event) => activeSchemaView.value = "paths"
1844
- }, {
1845
- default: withCtx(() => [
1846
- createTextVNode(" .paths ")
1847
- ]),
1848
- _: 1
1849
- }, 8, ["color", "onClick"])
1850
- ], 8, ["onClick"])
1851
- ]),
1852
- createVNode(_component_UIcon, {
1853
- name: open ? "i-heroicons-chevron-down" : "i-heroicons-chevron-right"
1854
- }, null, 8, ["name"])
1855
- ])
1856
- ]),
1857
- content: withCtx(() => [
1858
- createVNode("div", { class: "flex-1 relative" }, [
1859
- createVNode(_component_ClientOnly, null, {
1860
- default: withCtx(() => [
1861
- createVNode(_component_StudioOutput, {
1862
- "model-value": unref(activeSchemaViewOutput).value
1863
- }, null, 8, ["model-value"])
1864
- ]),
1865
- _: 1
1866
- })
1867
- ])
1868
- ]),
1869
- _: 1
1870
- }, 8, ["open", "onUpdate:open", "class"])
1871
- ]),
1872
- _: 1
1873
- })
1874
- ];
1875
- }
1876
- }),
1877
- _: 1
1878
- }, _parent));
1879
- _push(`</div>`);
1880
- };
1881
- }
1882
- });
1883
- const _sfc_setup$1 = _sfc_main$1.setup;
1884
- _sfc_main$1.setup = (props, ctx) => {
1885
- const ssrContext = useSSRContext();
1886
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ZodMongooseStudio.vue");
1887
- return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
1888
- };
1889
- const __nuxt_component_0 = Object.assign(_sfc_main$1, { __name: "ZodMongooseStudio" });
1890
- const _sfc_main = {};
1891
- function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
1892
- const _component_ZodMongooseStudio = __nuxt_component_0;
1893
- _push(ssrRenderComponent(_component_ZodMongooseStudio, _attrs, null, _parent));
1894
- }
1895
- const _sfc_setup = _sfc_main.setup;
1896
- _sfc_main.setup = (props, ctx) => {
1897
- const ssrContext = useSSRContext();
1898
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/index.vue");
1899
- return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
1900
- };
1901
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
1902
-
1903
- export { index as default };
1904
- //# sourceMappingURL=index-B4T6zHp0.mjs.map