@ragrails/api-playground-react 0.1.4 → 0.1.6
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/README.md +2 -2
- package/dist/index.cjs +10 -10
- package/dist/index.js +335 -268
- package/dist/src/features/api-widget/ApiConsole.d.ts +1 -0
- package/dist/src/features/api-widget/format.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __RAGRAILS_API_PLAYGROUND_CSS__="/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}:root,:host{--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-green-500:oklch(72.3% .219 149.579);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--font-weight-medium:500;--font-weight-semibold:600;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--font-heading:system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.top-2{top:calc(var(--spacing) * 2)}.top-5{top:calc(var(--spacing) * 5)}.top-full{top:100%}.right-2{right:calc(var(--spacing) * 2)}.right-5{right:calc(var(--spacing) * 5)}.-bottom-px{bottom:-1px}.left-0{left:0}.isolate{isolation:isolate}.-z-10{z-index:calc(10 * -1)}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-4{margin-right:calc(var(--spacing) * 4)}.mb-1{margin-bottom:var(--spacing)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-1\\.5{margin-left:calc(var(--spacing) * 1.5)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.\\[field-sizing\\:content\\]{field-sizing:content}.h-0\\.5{height:calc(var(--spacing) * .5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-full{height:100%}.min-h-0{min-height:0}.min-h-10{min-height:calc(var(--spacing) * 10)}.w-3{width:calc(var(--spacing) * 3)}.w-3\\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-11{width:calc(var(--spacing) * 11)}.w-full{width:100%}.w-max{width:max-content}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-28{min-width:calc(var(--spacing) * 28)}.min-w-\\[7rem\\]{min-width:7rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-6{--tw-translate-x:calc(var(--spacing) * 6);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.-skew-x-12{--tw-skew-x:skewX(calc(12deg * -1));transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[shimmer_2s_linear_infinite\\]{animation:2s linear infinite shimmer}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.grid-cols-\\[auto_1fr_auto\\]{grid-template-columns:auto 1fr auto}.\\[grid-template-rows\\:1fr\\]{grid-template-rows:1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\\[\\#52b788\\]\\/25{border-color:oklab(70.6413% -.111726 .0387149/.25)}.border-\\[\\#FC7070\\]\\/20{border-color:oklab(71.4755% .158854 .0655041/.2)}.border-amber-500\\/30{border-color:#f99c004d}@supports (color:color-mix(in lab, red, red)){.border-amber-500\\/30{border-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)}}.border-border{border-color:var(--border)}.border-current{border-color:currentColor}.border-primary,.border-primary\\/30{border-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.border-primary\\/30{border-color:color-mix(in oklab, var(--primary) 30%, transparent)}}.border-red-500{border-color:var(--color-red-500)}.border-red-500\\/60{border-color:#fb2c3699}@supports (color:color-mix(in lab, red, red)){.border-red-500\\/60{border-color:color-mix(in oklab, var(--color-red-500) 60%, transparent)}}.border-sky-500\\/30{border-color:#00a5ef4d}@supports (color:color-mix(in lab, red, red)){.border-sky-500\\/30{border-color:color-mix(in oklab, var(--color-sky-500) 30%, transparent)}}.border-transparent{border-color:#0000}.border-t-primary{border-top-color:var(--primary)}.border-t-transparent{border-top-color:#0000}.bg-\\[\\#4A0F0F\\]{background-color:#4a0f0f}.bg-\\[\\#52b788\\]\\/15{background-color:oklab(70.6413% -.111726 .0387149/.15)}.bg-\\[\\#EF5350\\]{background-color:#ef5350}.bg-amber-500\\/15{background-color:#f99c0026}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\\/15{background-color:color-mix(in oklab, var(--color-amber-500) 15%, transparent)}}.bg-bg{background-color:var(--bg)}.bg-primary{background-color:var(--primary)}.bg-primary-soft{background-color:var(--primary-soft)}.bg-sky-500\\/15{background-color:#00a5ef26}@supports (color:color-mix(in lab, red, red)){.bg-sky-500\\/15{background-color:color-mix(in oklab, var(--color-sky-500) 15%, transparent)}}.bg-surface{background-color:var(--surface)}.bg-surface-2{background-color:var(--surface-2)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-muted{--tw-gradient-from:var(--text-muted);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-content{--tw-gradient-via:var(--text);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\\/5{--tw-gradient-via:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.via-white\\/5{--tw-gradient-via:color-mix(in oklab, var(--color-white) 5%, transparent)}}.via-white\\/5{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\\/10{--tw-gradient-via:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.via-white\\/10{--tw-gradient-via:color-mix(in oklab, var(--color-white) 10%, transparent)}}.via-white\\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\\/25{--tw-gradient-via:#ffffff40}@supports (color:color-mix(in lab, red, red)){.via-white\\/25{--tw-gradient-via:color-mix(in oklab, var(--color-white) 25%, transparent)}}.via-white\\/25{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-muted{--tw-gradient-to:var(--text-muted);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.bg-\\[length\\:200\\%_100\\%\\]{background-size:200% 100%}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.px-0\\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:var(--spacing)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-7{padding-inline:calc(var(--spacing) * 7)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.pr-28{padding-right:calc(var(--spacing) * 28)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-heading{font-family:var(--font-heading)}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[16px\\]{font-size:16px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-\\[550\\]{--tw-font-weight:550;font-weight:550}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre{white-space:pre}.text-\\[\\#52b788\\]{color:#52b788}.text-\\[\\#FC7070\\]{color:#fc7070}.text-amber-400{color:var(--color-amber-400)}.text-amber-500{color:var(--color-amber-500)}.text-content{color:var(--text)}.text-green-500{color:var(--color-green-500)}.text-muted,.text-muted\\/60{color:var(--text-muted)}@supports (color:color-mix(in lab, red, red)){.text-muted\\/60{color:color-mix(in oklab, var(--text-muted) 60%, transparent)}}.text-primary{color:var(--primary)}.text-primary-contrast{color:var(--primary-contrast)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-sky-400{color:var(--color-sky-400)}.text-transparent{color:#0000}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-0{--tw-duration:0s;transition-duration:0s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\:translate-x-full:is(:where(.group):hover *){--tw-translate-x:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\\:\\[animation\\:text-shimmer_1\\.2s_linear_1_forwards\\]:is(:where(.group):hover *){animation:1.2s linear forwards text-shimmer}.group-hover\\:text-transparent:is(:where(.group):hover *){color:#0000}.group-hover\\:duration-\\[1200ms\\]:is(:where(.group):hover *){--tw-duration:1.2s;transition-duration:1.2s}.group-hover\\/seg\\:\\[animation\\:text-shimmer_1\\.2s_linear_1_forwards\\]:is(:where(.group\\/seg):hover *){animation:1.2s linear forwards text-shimmer}.group-hover\\/seg\\:text-transparent:is(:where(.group\\/seg):hover *){color:#0000}}.group-disabled\\:hidden:is(:where(.group):disabled *){display:none}.placeholder\\:text-muted::placeholder,.placeholder\\:text-muted\\/50::placeholder{color:var(--text-muted)}@supports (color:color-mix(in lab, red, red)){.placeholder\\:text-muted\\/50::placeholder{color:color-mix(in oklab, var(--text-muted) 50%, transparent)}}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.read-only\\:cursor-default:read-only{cursor:default}.focus-within\\:border-primary:focus-within,.focus-within\\:border-primary\\/60:focus-within{border-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus-within\\:border-primary\\/60:focus-within{border-color:color-mix(in oklab, var(--primary) 60%, transparent)}}.focus-within\\:border-primary\\/70:focus-within{border-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus-within\\:border-primary\\/70:focus-within{border-color:color-mix(in oklab, var(--primary) 70%, transparent)}}.focus-within\\:ring-2:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\\:ring-primary\\/15:focus-within{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus-within\\:ring-primary\\/15:focus-within{--tw-ring-color:color-mix(in oklab, var(--primary) 15%, transparent)}}.focus-within\\:ring-primary\\/20:focus-within{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus-within\\:ring-primary\\/20:focus-within{--tw-ring-color:color-mix(in oklab, var(--primary) 20%, transparent)}}@media (hover:hover){.hover\\:border-primary\\/70:hover{border-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:border-primary\\/70:hover{border-color:color-mix(in oklab, var(--primary) 70%, transparent)}}.hover\\:bg-\\[\\#e53935\\]:hover{background-color:#e53935}.hover\\:bg-border:hover{background-color:var(--border)}.hover\\:bg-primary-hover:hover{background-color:var(--primary-hover)}.hover\\:bg-surface-2:hover{background-color:var(--surface-2)}.hover\\:text-content:hover{color:var(--text)}.hover\\:text-primary-hover:hover{color:var(--primary-hover)}}.focus\\:border-primary\\/60:focus{border-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus\\:border-primary\\/60:focus{border-color:color-mix(in oklab, var(--primary) 60%, transparent)}}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\\:ring-primary\\/20:focus{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus\\:ring-primary\\/20:focus{--tw-ring-color:color-mix(in oklab, var(--primary) 20%, transparent)}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-primary\\/60:focus-visible{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-primary\\/60:focus-visible{--tw-ring-color:color-mix(in oklab, var(--primary) 60%, transparent)}}.active\\:scale-105:active{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-40:disabled{opacity:.4}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:opacity-60:disabled{opacity:.6}@media (prefers-reduced-motion:no-preference){.motion-safe\\:animate-\\[dropdown-expand_0\\.2s_ease-out\\]{animation:.2s ease-out dropdown-expand}.motion-safe\\:animate-\\[dropdown-expand_0\\.18s_ease-in_reverse_forwards\\]{animation:.18s ease-in reverse forwards dropdown-expand}.motion-safe\\:animate-\\[fade-in_0\\.6s_ease-out_both\\]{animation:.6s ease-out both fade-in}.motion-safe\\:animate-\\[widget-slide-in_180ms_ease-out\\]{animation:.18s ease-out widget-slide-in}}@media (prefers-reduced-motion:reduce){.motion-reduce\\:active\\:scale-100:active{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}@media (min-width:40rem){.sm\\:inline{display:inline}}@media (min-width:48rem){.md\\:col-start-auto{grid-column-start:auto}.md\\:row-span-1{grid-row:span 1/span 1}.md\\:inline{display:inline}.md\\:grid-cols-\\[1fr_auto\\]{grid-template-columns:1fr auto}.md\\:grid-cols-\\[auto_1fr\\]{grid-template-columns:auto 1fr}.md\\:grid-cols-\\[auto_1fr_1fr_auto\\]{grid-template-columns:auto 1fr 1fr auto}.md\\:grid-cols-\\[minmax\\(0\\,0\\.7fr\\)_minmax\\(0\\,1fr\\)\\]{grid-template-columns:minmax(0,.7fr) minmax(0,1fr)}}.\\[\\&_button\\]\\:text-\\[14px\\] button{font-size:14px}[data-theme=light]{--bg:#f2f4f7;--surface:#fff;--surface-2:#e7ebf3;--border:#d2d7df;--text:#0f1216;--text-muted:#4b5563;--primary:#7855ff;--primary-contrast:#fff}[data-theme=dark]{--bg:#16171d;--surface:#1f2028;--surface-2:#2a2c36;--border:#2e303a;--text:#f3f4f6;--text-muted:#9ca3af;--primary:#7855ff;--primary-contrast:#fff}[data-theme]{--primary-hover:var(--primary)}@supports (color:color-mix(in lab, red, red)){[data-theme]{--primary-hover:color-mix(in srgb, var(--primary) 86%, #000)}}[data-theme]{--primary-soft:var(--primary)}@supports (color:color-mix(in lab, red, red)){[data-theme]{--primary-soft:color-mix(in srgb, var(--primary) 16%, transparent)}}@keyframes shimmer{to{transform:translate(100%)}}@keyframes text-shimmer{0%{background-position:200%}to{background-position:-200%}}@keyframes dropdown-expand{0%{opacity:0;grid-template-rows:0fr}to{opacity:1;grid-template-rows:1fr}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes widget-slide-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:var(--text-muted);font-style:italic}.token.punctuation{color:var(--text-muted)}.token.property,.token.tag,.token.symbol,.token.deleted{color:#7aa2f7}.token.number{color:#e5c07b}.token.boolean,.token.null,.token.keyword,.token.atrule,.token.important{color:var(--primary)}.token.string,.token.char,.token.attr-name,.token.attr-value,.token.regex,.token.inserted,.token.selector{color:#9ece6a}.token.operator,.token.entity,.token.url,.token.variable{color:var(--text)}.token.function,.token.class-name{color:#61afef}.token.builtin{color:#56b6c2}[data-theme=light] .token.property,[data-theme=light] .token.tag,[data-theme=light] .token.symbol,[data-theme=light] .token.deleted{color:#0550ae}[data-theme=light] .token.number{color:#953800}[data-theme=light] .token.string,[data-theme=light] .token.char,[data-theme=light] .token.attr-name,[data-theme=light] .token.attr-value,[data-theme=light] .token.regex,[data-theme=light] .token.inserted,[data-theme=light] .token.selector{color:#116329}[data-theme=light] .token.function,[data-theme=light] .token.class-name{color:#1f6feb}[data-theme=light] .token.builtin{color:#0e7490}@layer base{[data-theme] button:not(:disabled),[data-theme] [role=button]:not([aria-disabled=true]){cursor:pointer}}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:\"*\";inherits:false}@property --tw-rotate-y{syntax:\"*\";inherits:false}@property --tw-rotate-z{syntax:\"*\";inherits:false}@property --tw-skew-x{syntax:\"*\";inherits:false}@property --tw-skew-y{syntax:\"*\";inherits:false}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:\"*\";inherits:false}@property --tw-gradient-from{syntax:\"<color>\";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:\"<color>\";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:\"<color>\";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:\"*\";inherits:false}@property --tw-gradient-via-stops{syntax:\"*\";inherits:false}@property --tw-gradient-from-position{syntax:\"<length-percentage>\";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:\"<length-percentage>\";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:\"<length-percentage>\";inherits:false;initial-value:100%}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-ordinal{syntax:\"*\";inherits:false}@property --tw-slashed-zero{syntax:\"*\";inherits:false}@property --tw-numeric-figure{syntax:\"*\";inherits:false}@property --tw-numeric-spacing{syntax:\"*\";inherits:false}@property --tw-numeric-fraction{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:\"*\";inherits:false}@property --tw-ease{syntax:\"*\";inherits:false}@property --tw-scale-x{syntax:\"*\";inherits:false;initial-value:1}@property --tw-scale-y{syntax:\"*\";inherits:false;initial-value:1}@property --tw-scale-z{syntax:\"*\";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}";
|
|
1
|
+
const __RAGRAILS_API_PLAYGROUND_CSS__="/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}:root,:host{--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-green-500:oklch(72.3% .219 149.579);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--font-weight-medium:500;--font-weight-semibold:600;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--font-heading:system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.top-2{top:calc(var(--spacing) * 2)}.top-5{top:calc(var(--spacing) * 5)}.top-full{top:100%}.right-2{right:calc(var(--spacing) * 2)}.right-5{right:calc(var(--spacing) * 5)}.-bottom-px{bottom:-1px}.left-0{left:0}.isolate{isolation:isolate}.-z-10{z-index:calc(10 * -1)}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-4{margin-right:calc(var(--spacing) * 4)}.mb-1{margin-bottom:var(--spacing)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-1\\.5{margin-left:calc(var(--spacing) * 1.5)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.\\[field-sizing\\:content\\]{field-sizing:content}.h-0\\.5{height:calc(var(--spacing) * .5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-full{height:100%}.min-h-0{min-height:0}.min-h-10{min-height:calc(var(--spacing) * 10)}.w-3{width:calc(var(--spacing) * 3)}.w-3\\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-11{width:calc(var(--spacing) * 11)}.w-full{width:100%}.w-max{width:max-content}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-28{min-width:calc(var(--spacing) * 28)}.min-w-\\[7rem\\]{min-width:7rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-6{--tw-translate-x:calc(var(--spacing) * 6);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.-skew-x-12{--tw-skew-x:skewX(calc(12deg * -1));transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[shimmer_2s_linear_infinite\\]{animation:2s linear infinite shimmer}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.grid-cols-\\[auto_1fr_auto\\]{grid-template-columns:auto 1fr auto}.\\[grid-template-rows\\:1fr\\]{grid-template-rows:1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\\[\\#52b788\\]\\/25{border-color:oklab(70.6413% -.111726 .0387149/.25)}.border-\\[\\#FC7070\\]\\/20{border-color:oklab(71.4755% .158854 .0655041/.2)}.border-amber-500\\/30{border-color:#f99c004d}@supports (color:color-mix(in lab, red, red)){.border-amber-500\\/30{border-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)}}.border-border{border-color:var(--border)}.border-current{border-color:currentColor}.border-primary,.border-primary\\/30{border-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.border-primary\\/30{border-color:color-mix(in oklab, var(--primary) 30%, transparent)}}.border-red-500{border-color:var(--color-red-500)}.border-red-500\\/60{border-color:#fb2c3699}@supports (color:color-mix(in lab, red, red)){.border-red-500\\/60{border-color:color-mix(in oklab, var(--color-red-500) 60%, transparent)}}.border-sky-500\\/30{border-color:#00a5ef4d}@supports (color:color-mix(in lab, red, red)){.border-sky-500\\/30{border-color:color-mix(in oklab, var(--color-sky-500) 30%, transparent)}}.border-transparent{border-color:#0000}.border-t-primary{border-top-color:var(--primary)}.border-t-transparent{border-top-color:#0000}.bg-\\[\\#4A0F0F\\]{background-color:#4a0f0f}.bg-\\[\\#52b788\\]\\/15{background-color:oklab(70.6413% -.111726 .0387149/.15)}.bg-\\[\\#EF5350\\]{background-color:#ef5350}.bg-amber-500\\/15{background-color:#f99c0026}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\\/15{background-color:color-mix(in oklab, var(--color-amber-500) 15%, transparent)}}.bg-primary{background-color:var(--primary)}.bg-primary-soft{background-color:var(--primary-soft)}.bg-sky-500\\/15{background-color:#00a5ef26}@supports (color:color-mix(in lab, red, red)){.bg-sky-500\\/15{background-color:color-mix(in oklab, var(--color-sky-500) 15%, transparent)}}.bg-surface{background-color:var(--surface)}.bg-surface-2{background-color:var(--surface-2)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-muted{--tw-gradient-from:var(--text-muted);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-content{--tw-gradient-via:var(--text);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\\/5{--tw-gradient-via:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.via-white\\/5{--tw-gradient-via:color-mix(in oklab, var(--color-white) 5%, transparent)}}.via-white\\/5{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\\/10{--tw-gradient-via:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.via-white\\/10{--tw-gradient-via:color-mix(in oklab, var(--color-white) 10%, transparent)}}.via-white\\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\\/25{--tw-gradient-via:#ffffff40}@supports (color:color-mix(in lab, red, red)){.via-white\\/25{--tw-gradient-via:color-mix(in oklab, var(--color-white) 25%, transparent)}}.via-white\\/25{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-muted{--tw-gradient-to:var(--text-muted);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.bg-\\[length\\:200\\%_100\\%\\]{background-size:200% 100%}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.px-0\\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:var(--spacing)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-7{padding-inline:calc(var(--spacing) * 7)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.pr-28{padding-right:calc(var(--spacing) * 28)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-heading{font-family:var(--font-heading)}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[16px\\]{font-size:16px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-\\[550\\]{--tw-font-weight:550;font-weight:550}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre{white-space:pre}.text-\\[\\#52b788\\]{color:#52b788}.text-\\[\\#FC7070\\]{color:#fc7070}.text-amber-400{color:var(--color-amber-400)}.text-amber-500{color:var(--color-amber-500)}.text-content{color:var(--text)}.text-green-500{color:var(--color-green-500)}.text-muted,.text-muted\\/45{color:var(--text-muted)}@supports (color:color-mix(in lab, red, red)){.text-muted\\/45{color:color-mix(in oklab, var(--text-muted) 45%, transparent)}}.text-muted\\/60{color:var(--text-muted)}@supports (color:color-mix(in lab, red, red)){.text-muted\\/60{color:color-mix(in oklab, var(--text-muted) 60%, transparent)}}.text-primary{color:var(--primary)}.text-primary-contrast{color:var(--primary-contrast)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-sky-400{color:var(--color-sky-400)}.text-transparent{color:#0000}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[height\\]{transition-property:height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-0{--tw-duration:0s;transition-duration:0s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-\\[240ms\\]{--tw-duration:.24s;transition-duration:.24s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\:translate-x-full:is(:where(.group):hover *){--tw-translate-x:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\\:\\[animation\\:text-shimmer_1\\.2s_linear_1_forwards\\]:is(:where(.group):hover *){animation:1.2s linear forwards text-shimmer}.group-hover\\:text-transparent:is(:where(.group):hover *){color:#0000}.group-hover\\:duration-\\[1200ms\\]:is(:where(.group):hover *){--tw-duration:1.2s;transition-duration:1.2s}.group-hover\\/seg\\:\\[animation\\:text-shimmer_1\\.2s_linear_1_forwards\\]:is(:where(.group\\/seg):hover *){animation:1.2s linear forwards text-shimmer}.group-hover\\/seg\\:text-transparent:is(:where(.group\\/seg):hover *){color:#0000}}.group-disabled\\:hidden:is(:where(.group):disabled *){display:none}.placeholder\\:text-muted::placeholder,.placeholder\\:text-muted\\/50::placeholder{color:var(--text-muted)}@supports (color:color-mix(in lab, red, red)){.placeholder\\:text-muted\\/50::placeholder{color:color-mix(in oklab, var(--text-muted) 50%, transparent)}}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.read-only\\:cursor-default:read-only{cursor:default}.focus-within\\:border-primary:focus-within,.focus-within\\:border-primary\\/60:focus-within{border-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus-within\\:border-primary\\/60:focus-within{border-color:color-mix(in oklab, var(--primary) 60%, transparent)}}.focus-within\\:border-primary\\/70:focus-within{border-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus-within\\:border-primary\\/70:focus-within{border-color:color-mix(in oklab, var(--primary) 70%, transparent)}}.focus-within\\:ring-2:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\\:ring-primary\\/15:focus-within{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus-within\\:ring-primary\\/15:focus-within{--tw-ring-color:color-mix(in oklab, var(--primary) 15%, transparent)}}.focus-within\\:ring-primary\\/20:focus-within{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus-within\\:ring-primary\\/20:focus-within{--tw-ring-color:color-mix(in oklab, var(--primary) 20%, transparent)}}@media (hover:hover){.hover\\:border-primary\\/70:hover{border-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:border-primary\\/70:hover{border-color:color-mix(in oklab, var(--primary) 70%, transparent)}}.hover\\:bg-\\[\\#e53935\\]:hover{background-color:#e53935}.hover\\:bg-border:hover{background-color:var(--border)}.hover\\:bg-primary-hover:hover{background-color:var(--primary-hover)}.hover\\:bg-surface-2:hover{background-color:var(--surface-2)}.hover\\:text-content:hover{color:var(--text)}.hover\\:text-muted:hover{color:var(--text-muted)}.hover\\:text-primary-hover:hover{color:var(--primary-hover)}}.focus\\:border-primary\\/60:focus{border-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus\\:border-primary\\/60:focus{border-color:color-mix(in oklab, var(--primary) 60%, transparent)}}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\\:ring-primary\\/20:focus{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus\\:ring-primary\\/20:focus{--tw-ring-color:color-mix(in oklab, var(--primary) 20%, transparent)}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-primary\\/60:focus-visible{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-primary\\/60:focus-visible{--tw-ring-color:color-mix(in oklab, var(--primary) 60%, transparent)}}.active\\:scale-105:active{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-40:disabled{opacity:.4}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:opacity-60:disabled{opacity:.6}@media (prefers-reduced-motion:no-preference){.motion-safe\\:animate-\\[dropdown-expand_0\\.2s_ease-out\\]{animation:.2s ease-out dropdown-expand}.motion-safe\\:animate-\\[dropdown-expand_0\\.18s_ease-in_reverse_forwards\\]{animation:.18s ease-in reverse forwards dropdown-expand}.motion-safe\\:animate-\\[fade-in_0\\.6s_ease-out_both\\]{animation:.6s ease-out both fade-in}.motion-safe\\:animate-\\[widget-slide-in_180ms_ease-out\\]{animation:.18s ease-out widget-slide-in}}@media (prefers-reduced-motion:reduce){.motion-reduce\\:active\\:scale-100:active{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}@media (min-width:40rem){.sm\\:inline{display:inline}}@media (min-width:48rem){.md\\:col-start-auto{grid-column-start:auto}.md\\:row-span-1{grid-row:span 1/span 1}.md\\:inline{display:inline}.md\\:grid-cols-\\[1fr_auto\\]{grid-template-columns:1fr auto}.md\\:grid-cols-\\[auto_1fr\\]{grid-template-columns:auto 1fr}.md\\:grid-cols-\\[auto_1fr_1fr_auto\\]{grid-template-columns:auto 1fr 1fr auto}.md\\:grid-cols-\\[minmax\\(0\\,0\\.7fr\\)_minmax\\(0\\,1fr\\)\\]{grid-template-columns:minmax(0,.7fr) minmax(0,1fr)}}.\\[\\&_button\\]\\:text-\\[14px\\] button{font-size:14px}[data-theme=light]{--bg:#f2f4f7;--surface:#fff;--surface-2:#e7ebf3;--border:#d2d7df;--text:#0f1216;--text-muted:#4b5563;--primary:#7855ff;--primary-contrast:#fff}[data-theme=dark]{--bg:#16171d;--surface:#1f2028;--surface-2:#2a2c36;--border:#2e303a;--text:#f3f4f6;--text-muted:#9ca3af;--primary:#7855ff;--primary-contrast:#fff}[data-theme]{--primary-hover:var(--primary)}@supports (color:color-mix(in lab, red, red)){[data-theme]{--primary-hover:color-mix(in srgb, var(--primary) 86%, #000)}}[data-theme]{--primary-soft:var(--primary)}@supports (color:color-mix(in lab, red, red)){[data-theme]{--primary-soft:color-mix(in srgb, var(--primary) 16%, transparent)}}@keyframes shimmer{to{transform:translate(100%)}}@keyframes text-shimmer{0%{background-position:200%}to{background-position:-200%}}@keyframes dropdown-expand{0%{opacity:0;grid-template-rows:0fr}to{opacity:1;grid-template-rows:1fr}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes widget-slide-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:var(--text-muted);font-style:italic}.token.punctuation{color:var(--text-muted)}.token.property,.token.tag,.token.symbol,.token.deleted{color:#7aa2f7}.token.number{color:#e5c07b}.token.boolean,.token.null,.token.keyword,.token.atrule,.token.important{color:var(--primary)}.token.string,.token.char,.token.attr-name,.token.attr-value,.token.regex,.token.inserted,.token.selector{color:#9ece6a}.token.operator,.token.entity,.token.url,.token.variable{color:var(--text)}.token.function,.token.class-name{color:#61afef}.token.builtin{color:#56b6c2}[data-theme=light] .token.property,[data-theme=light] .token.tag,[data-theme=light] .token.symbol,[data-theme=light] .token.deleted{color:#0550ae}[data-theme=light] .token.number{color:#953800}[data-theme=light] .token.string,[data-theme=light] .token.char,[data-theme=light] .token.attr-name,[data-theme=light] .token.attr-value,[data-theme=light] .token.regex,[data-theme=light] .token.inserted,[data-theme=light] .token.selector{color:#116329}[data-theme=light] .token.function,[data-theme=light] .token.class-name{color:#1f6feb}[data-theme=light] .token.builtin{color:#0e7490}@layer base{[data-theme] button:not(:disabled),[data-theme] [role=button]:not([aria-disabled=true]){cursor:pointer}}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:\"*\";inherits:false}@property --tw-rotate-y{syntax:\"*\";inherits:false}@property --tw-rotate-z{syntax:\"*\";inherits:false}@property --tw-skew-x{syntax:\"*\";inherits:false}@property --tw-skew-y{syntax:\"*\";inherits:false}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:\"*\";inherits:false}@property --tw-gradient-from{syntax:\"<color>\";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:\"<color>\";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:\"<color>\";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:\"*\";inherits:false}@property --tw-gradient-via-stops{syntax:\"*\";inherits:false}@property --tw-gradient-from-position{syntax:\"<length-percentage>\";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:\"<length-percentage>\";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:\"<length-percentage>\";inherits:false;initial-value:100%}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-ordinal{syntax:\"*\";inherits:false}@property --tw-slashed-zero{syntax:\"*\";inherits:false}@property --tw-numeric-figure{syntax:\"*\";inherits:false}@property --tw-numeric-spacing{syntax:\"*\";inherits:false}@property --tw-numeric-fraction{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:\"*\";inherits:false}@property --tw-ease{syntax:\"*\";inherits:false}@property --tw-scale-x{syntax:\"*\";inherits:false;initial-value:1}@property --tw-scale-y{syntax:\"*\";inherits:false;initial-value:1}@property --tw-scale-z{syntax:\"*\";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}";
|
|
2
2
|
if(typeof document!=="undefined"&&!document.getElementById("ragrails-api-playground-react-styles")){const style=document.createElement("style");style.id="ragrails-api-playground-react-styles";style.textContent=__RAGRAILS_API_PLAYGROUND_CSS__;(document.head||document.documentElement).appendChild(style);}
|
|
3
3
|
import e, { useEffect as t, useId as n, useLayoutEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
4
4
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
@@ -314,17 +314,17 @@ var S = ({ value: e, variant: t = "surface", size: n = "md", className: r, label
|
|
|
314
314
|
}, w = ({ tone: e = "neutral", className: t, children: n }) => /* @__PURE__ */ c("span", {
|
|
315
315
|
className: u("inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-xs font-heading font-[550]", C[e], t),
|
|
316
316
|
children: n
|
|
317
|
-
}),
|
|
317
|
+
}), T = {
|
|
318
318
|
GET: "success",
|
|
319
319
|
POST: "info",
|
|
320
320
|
PUT: "warning",
|
|
321
321
|
PATCH: "primary",
|
|
322
322
|
DELETE: "error"
|
|
323
|
-
},
|
|
324
|
-
tone:
|
|
323
|
+
}, E = ({ method: e, className: t }) => /* @__PURE__ */ c(w, {
|
|
324
|
+
tone: T[e],
|
|
325
325
|
className: t,
|
|
326
326
|
children: e
|
|
327
|
-
}),
|
|
327
|
+
}), D = ({ status: e, statusText: t, className: n }) => /* @__PURE__ */ l(w, {
|
|
328
328
|
tone: e >= 200 && e < 300 ? "success" : e >= 300 && e < 400 ? "warning" : "error",
|
|
329
329
|
className: n,
|
|
330
330
|
children: [
|
|
@@ -332,16 +332,16 @@ var S = ({ value: e, variant: t = "surface", size: n = "md", className: r, label
|
|
|
332
332
|
" ",
|
|
333
333
|
t
|
|
334
334
|
]
|
|
335
|
-
}),
|
|
335
|
+
}), ee = {
|
|
336
336
|
sm: "h-4 w-4 rounded",
|
|
337
337
|
md: "h-5 w-5 rounded-md"
|
|
338
|
-
},
|
|
338
|
+
}, O = {
|
|
339
339
|
sm: "h-3 w-3",
|
|
340
340
|
md: "h-3.5 w-3.5"
|
|
341
|
-
},
|
|
341
|
+
}, te = {
|
|
342
342
|
sm: "text-xs",
|
|
343
343
|
md: "text-sm"
|
|
344
|
-
},
|
|
344
|
+
}, k = ({ checked: e, onChange: t, label: n, disabled: r, size: i = "md", className: a, "aria-label": o }) => {
|
|
345
345
|
let s = /* @__PURE__ */ c("button", {
|
|
346
346
|
type: "button",
|
|
347
347
|
role: "checkbox",
|
|
@@ -349,23 +349,23 @@ var S = ({ value: e, variant: t = "surface", size: n = "md", className: r, label
|
|
|
349
349
|
"aria-label": o ?? n,
|
|
350
350
|
disabled: r,
|
|
351
351
|
onClick: () => t(!e),
|
|
352
|
-
className: u("inline-flex shrink-0 items-center justify-center border transition-colors duration-150", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60", "disabled:cursor-not-allowed disabled:opacity-50",
|
|
352
|
+
className: u("inline-flex shrink-0 items-center justify-center border transition-colors duration-150", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60", "disabled:cursor-not-allowed disabled:opacity-50", ee[i], e ? "border-primary bg-primary text-primary-contrast" : "border-border bg-surface-2 text-transparent hover:border-primary/70"),
|
|
353
353
|
children: /* @__PURE__ */ c(f, {
|
|
354
354
|
name: "check",
|
|
355
|
-
className:
|
|
355
|
+
className: O[i]
|
|
356
356
|
})
|
|
357
357
|
});
|
|
358
358
|
return n ? /* @__PURE__ */ l("label", {
|
|
359
359
|
className: u("inline-flex cursor-pointer select-none items-center gap-2", a),
|
|
360
360
|
children: [s, /* @__PURE__ */ c("span", {
|
|
361
|
-
className: u("text-content",
|
|
361
|
+
className: u("text-content", te[i]),
|
|
362
362
|
children: n
|
|
363
363
|
})]
|
|
364
364
|
}) : /* @__PURE__ */ c("span", {
|
|
365
365
|
className: a,
|
|
366
366
|
children: s
|
|
367
367
|
});
|
|
368
|
-
},
|
|
368
|
+
}, A = ({ label: e, flush: t, className: n, children: r }) => /* @__PURE__ */ l("div", {
|
|
369
369
|
className: "w-full",
|
|
370
370
|
children: [e && /* @__PURE__ */ c("div", {
|
|
371
371
|
className: "mb-2 text-sm text-muted",
|
|
@@ -374,7 +374,7 @@ var S = ({ value: e, variant: t = "surface", size: n = "md", className: r, label
|
|
|
374
374
|
className: u("rounded-xl border border-border bg-surface", !t && "p-3", n),
|
|
375
375
|
children: r
|
|
376
376
|
})]
|
|
377
|
-
}),
|
|
377
|
+
}), j = ({ items: e, activeId: n, onChange: i, variant: s = "underline", size: d = "md", className: f }) => {
|
|
378
378
|
let p = a({}), [m, h] = o({
|
|
379
379
|
left: 0,
|
|
380
380
|
top: 0,
|
|
@@ -450,7 +450,7 @@ var S = ({ value: e, variant: t = "surface", size: n = "md", className: r, label
|
|
|
450
450
|
}
|
|
451
451
|
})]
|
|
452
452
|
});
|
|
453
|
-
},
|
|
453
|
+
}, ne = {
|
|
454
454
|
sm: "gap-1.5 rounded-md px-2.5",
|
|
455
455
|
md: "gap-2 rounded-lg px-3",
|
|
456
456
|
lg: "gap-2.5 rounded-lg px-4"
|
|
@@ -458,26 +458,26 @@ var S = ({ value: e, variant: t = "surface", size: n = "md", className: r, label
|
|
|
458
458
|
sm: "py-1.5 text-[12px]",
|
|
459
459
|
md: "py-2 text-sm",
|
|
460
460
|
lg: "py-2.5 text-base"
|
|
461
|
-
},
|
|
461
|
+
}, re = {
|
|
462
462
|
sm: "mb-1 text-xs",
|
|
463
463
|
md: "mb-1.5 text-sm",
|
|
464
464
|
lg: "mb-2 text-sm"
|
|
465
|
-
},
|
|
465
|
+
}, N = {
|
|
466
466
|
sm: "mt-1 text-[11px]",
|
|
467
467
|
md: "mt-1 text-xs",
|
|
468
468
|
lg: "mt-1.5 text-xs"
|
|
469
|
-
},
|
|
469
|
+
}, P = ({ label: e, error: t, hint: r, size: i = "md", leftSlot: a, rightSlot: o, className: s, containerClassName: d, id: f, ...p }) => {
|
|
470
470
|
let m = n(), h = f ?? m;
|
|
471
471
|
return /* @__PURE__ */ l("div", {
|
|
472
472
|
className: u("w-full", d),
|
|
473
473
|
children: [
|
|
474
474
|
e && /* @__PURE__ */ c("label", {
|
|
475
475
|
htmlFor: h,
|
|
476
|
-
className: u("block font-medium text-muted",
|
|
476
|
+
className: u("block font-medium text-muted", re[i]),
|
|
477
477
|
children: e
|
|
478
478
|
}),
|
|
479
479
|
/* @__PURE__ */ l("div", {
|
|
480
|
-
className: u("flex items-center border bg-surface-2", "focus-within:border-primary/70 focus-within:ring-2 focus-within:ring-primary/15",
|
|
480
|
+
className: u("flex items-center border bg-surface-2", "focus-within:border-primary/70 focus-within:ring-2 focus-within:ring-primary/15", ne[i], t ? "border-red-500" : "border-border"),
|
|
481
481
|
children: [
|
|
482
482
|
a,
|
|
483
483
|
/* @__PURE__ */ c("input", {
|
|
@@ -489,22 +489,22 @@ var S = ({ value: e, variant: t = "surface", size: n = "md", className: r, label
|
|
|
489
489
|
]
|
|
490
490
|
}),
|
|
491
491
|
t ? /* @__PURE__ */ c("p", {
|
|
492
|
-
className: u("text-red-500",
|
|
492
|
+
className: u("text-red-500", N[i]),
|
|
493
493
|
children: t
|
|
494
494
|
}) : r ? /* @__PURE__ */ c("p", {
|
|
495
|
-
className: u("text-muted",
|
|
495
|
+
className: u("text-muted", N[i]),
|
|
496
496
|
children: r
|
|
497
497
|
}) : null
|
|
498
498
|
]
|
|
499
499
|
});
|
|
500
|
-
},
|
|
500
|
+
}, F = {
|
|
501
501
|
sm: "gap-1.5 px-2.5 py-1.5 text-[12px]",
|
|
502
502
|
md: "gap-1 px-2 py-1.5 text-[14px]"
|
|
503
503
|
}, I = {
|
|
504
504
|
sm: "px-2.5 py-1.5 text-[12px]",
|
|
505
505
|
md: "px-3 py-1.5 text-[14px]"
|
|
506
506
|
};
|
|
507
|
-
function
|
|
507
|
+
function L({ items: e, value: n, onChange: r, size: i = "md", disabled: s, minWidthClassName: d = "min-w-[7rem]", className: p }) {
|
|
508
508
|
let [m, h] = o(!1), [g, _] = o(!1), v = a(null), y = e.find((e) => e.id === n) ?? e[0];
|
|
509
509
|
t(() => {
|
|
510
510
|
if (m) {
|
|
@@ -536,7 +536,7 @@ function ie({ items: e, value: n, onChange: r, size: i = "md", disabled: s, minW
|
|
|
536
536
|
"aria-expanded": m,
|
|
537
537
|
disabled: s,
|
|
538
538
|
onClick: () => h((e) => !e),
|
|
539
|
-
className: u("inline-flex cursor-pointer items-center rounded-md font-heading transition-colors duration-150", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60", "disabled:cursor-not-allowed disabled:opacity-60",
|
|
539
|
+
className: u("inline-flex cursor-pointer items-center rounded-md font-heading transition-colors duration-150", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60", "disabled:cursor-not-allowed disabled:opacity-60", F[i], y?.className ?? "text-content hover:bg-surface-2"),
|
|
540
540
|
children: [y?.label, /* @__PURE__ */ c(f, {
|
|
541
541
|
name: "chevron-down",
|
|
542
542
|
className: u("h-4 w-4 text-muted transition-transform duration-200", m && "rotate-180")
|
|
@@ -568,30 +568,30 @@ function ie({ items: e, value: n, onChange: r, size: i = "md", disabled: s, minW
|
|
|
568
568
|
}
|
|
569
569
|
//#endregion
|
|
570
570
|
//#region src/components/ui/MethodSelect.tsx
|
|
571
|
-
var
|
|
571
|
+
var ie = [
|
|
572
572
|
"GET",
|
|
573
573
|
"POST",
|
|
574
574
|
"PUT",
|
|
575
575
|
"PATCH",
|
|
576
576
|
"DELETE"
|
|
577
|
-
],
|
|
577
|
+
], R = {
|
|
578
578
|
GET: "text-[#52b788]",
|
|
579
579
|
POST: "text-sky-400",
|
|
580
580
|
PUT: "text-amber-400",
|
|
581
581
|
PATCH: "text-primary",
|
|
582
582
|
DELETE: "text-red-400"
|
|
583
|
-
},
|
|
583
|
+
}, ae = (e) => e.map((e) => ({
|
|
584
584
|
id: e,
|
|
585
585
|
label: e,
|
|
586
|
-
className: `${
|
|
587
|
-
})),
|
|
586
|
+
className: `${R[e]} font-semibold`
|
|
587
|
+
})), oe = ({ value: e, onChange: t, methods: n = ie, disabled: r, className: i }) => /* @__PURE__ */ c(L, {
|
|
588
588
|
value: e,
|
|
589
589
|
onChange: t,
|
|
590
|
-
items:
|
|
590
|
+
items: ae(n),
|
|
591
591
|
disabled: r,
|
|
592
592
|
minWidthClassName: "min-w-[7rem]",
|
|
593
593
|
className: i
|
|
594
|
-
}),
|
|
594
|
+
}), se = {
|
|
595
595
|
json: [
|
|
596
596
|
{
|
|
597
597
|
type: "property",
|
|
@@ -759,7 +759,7 @@ var ae = [
|
|
|
759
759
|
}
|
|
760
760
|
]
|
|
761
761
|
};
|
|
762
|
-
function
|
|
762
|
+
function ce(e, t, n) {
|
|
763
763
|
for (let r of n) {
|
|
764
764
|
r.pattern.lastIndex = t;
|
|
765
765
|
let n = r.pattern.exec(e);
|
|
@@ -770,11 +770,11 @@ function ue(e, t, n) {
|
|
|
770
770
|
}
|
|
771
771
|
return null;
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function le(e, t) {
|
|
774
774
|
if (t === "plain" || !e) return e;
|
|
775
|
-
let n =
|
|
775
|
+
let n = se[t], r = [], i = "", a = 0, o = 0;
|
|
776
776
|
for (; a < e.length;) {
|
|
777
|
-
let t =
|
|
777
|
+
let t = ce(e, a, n);
|
|
778
778
|
if (!t) {
|
|
779
779
|
i += e[a], a += 1;
|
|
780
780
|
continue;
|
|
@@ -788,7 +788,7 @@ function de(e, t) {
|
|
|
788
788
|
}
|
|
789
789
|
//#endregion
|
|
790
790
|
//#region src/components/ui/CodeBlock.tsx
|
|
791
|
-
var
|
|
791
|
+
var z = ({ code: e, language: t = "plain", showLineNumbers: n = !1, copyable: r = !0, maxHeight: a, reveal: o = !1, revealStagger: s = 70, className: d }) => {
|
|
792
792
|
let f = i(() => e.replace(/\n$/, "").split("\n"), [e]), p = String(f.length).length;
|
|
793
793
|
return /* @__PURE__ */ l("div", {
|
|
794
794
|
className: u("group relative w-full overflow-hidden rounded-lg border border-border bg-surface-2", d),
|
|
@@ -814,14 +814,14 @@ var L = ({ code: e, language: t = "plain", showLineNumbers: n = !1, copyable: r
|
|
|
814
814
|
children: r + 1
|
|
815
815
|
}), /* @__PURE__ */ c("span", {
|
|
816
816
|
className: "whitespace-pre",
|
|
817
|
-
children:
|
|
817
|
+
children: le(e, t) || " "
|
|
818
818
|
})]
|
|
819
819
|
}, r))
|
|
820
820
|
})
|
|
821
821
|
})
|
|
822
822
|
})]
|
|
823
823
|
});
|
|
824
|
-
},
|
|
824
|
+
}, B = /* @__PURE__ */ new Set([
|
|
825
825
|
"accept-charset",
|
|
826
826
|
"accept-encoding",
|
|
827
827
|
"access-control-request-headers",
|
|
@@ -843,7 +843,7 @@ var L = ({ code: e, language: t = "plain", showLineNumbers: n = !1, copyable: r
|
|
|
843
843
|
"upgrade",
|
|
844
844
|
"via"
|
|
845
845
|
]);
|
|
846
|
-
function
|
|
846
|
+
function ue(e) {
|
|
847
847
|
return !e.auth || e.auth.type === "none" ? null : e.auth.type === "bearer" ? {
|
|
848
848
|
key: "Authorization",
|
|
849
849
|
value: `Bearer ${e.auth.token}`
|
|
@@ -852,23 +852,23 @@ function fe(e) {
|
|
|
852
852
|
value: e.auth.value
|
|
853
853
|
};
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function de(e) {
|
|
856
856
|
let t = new Headers();
|
|
857
|
-
for (let n of e.headers ?? []) n.key.trim() && (
|
|
858
|
-
let n =
|
|
859
|
-
return n && !
|
|
857
|
+
for (let n of e.headers ?? []) n.key.trim() && (B.has(n.key.trim().toLowerCase()) || t.set(n.key, n.value));
|
|
858
|
+
let n = ue(e);
|
|
859
|
+
return n && !B.has(n.key.toLowerCase()) && t.set(n.key, n.value), t;
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function fe(e) {
|
|
862
862
|
return [...e.entries()].map(([e, t]) => ({
|
|
863
863
|
key: e,
|
|
864
864
|
value: t
|
|
865
865
|
}));
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function pe(e) {
|
|
868
868
|
let t = new TextEncoder().encode(e).length;
|
|
869
869
|
return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function me(e, t) {
|
|
872
872
|
if (!(t?.includes("json") || /^[\s\n]*(?:\[|\{)/.test(e))) return e;
|
|
873
873
|
try {
|
|
874
874
|
return JSON.stringify(JSON.parse(e), null, 2);
|
|
@@ -876,11 +876,11 @@ function he(e, t) {
|
|
|
876
876
|
return e;
|
|
877
877
|
}
|
|
878
878
|
}
|
|
879
|
-
function
|
|
879
|
+
function he(e) {
|
|
880
880
|
return e instanceof Error ? e.message : "Request failed";
|
|
881
881
|
}
|
|
882
|
-
function
|
|
883
|
-
let n =
|
|
882
|
+
function V(e, t = performance.now()) {
|
|
883
|
+
let n = he(e);
|
|
884
884
|
return {
|
|
885
885
|
status: 0,
|
|
886
886
|
statusText: "Network Error",
|
|
@@ -894,27 +894,27 @@ function B(e, t = performance.now()) {
|
|
|
894
894
|
error: n
|
|
895
895
|
};
|
|
896
896
|
}
|
|
897
|
-
async function
|
|
897
|
+
async function H(e) {
|
|
898
898
|
let t = performance.now();
|
|
899
899
|
try {
|
|
900
900
|
let n = await fetch(e.url, {
|
|
901
901
|
method: e.method,
|
|
902
|
-
headers:
|
|
902
|
+
headers: de(e),
|
|
903
903
|
body: e.body && e.method !== "GET" ? e.body : void 0
|
|
904
|
-
}), r = await n.text(), i =
|
|
904
|
+
}), r = await n.text(), i = me(r, n.headers.get("content-type"));
|
|
905
905
|
return {
|
|
906
906
|
status: n.status,
|
|
907
907
|
statusText: n.statusText || (n.ok ? "OK" : "Error"),
|
|
908
|
-
headers:
|
|
908
|
+
headers: fe(n.headers),
|
|
909
909
|
body: i,
|
|
910
910
|
timeMs: Math.round(performance.now() - t),
|
|
911
|
-
size:
|
|
911
|
+
size: pe(r)
|
|
912
912
|
};
|
|
913
913
|
} catch (e) {
|
|
914
|
-
return
|
|
914
|
+
return V(e, t);
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
|
-
function
|
|
917
|
+
function ge(e) {
|
|
918
918
|
let t = e.sampleResponse ?? JSON.stringify({
|
|
919
919
|
ok: !0,
|
|
920
920
|
request: e.title
|
|
@@ -931,7 +931,7 @@ function H(e) {
|
|
|
931
931
|
}],
|
|
932
932
|
body: t,
|
|
933
933
|
timeMs: 142,
|
|
934
|
-
size:
|
|
934
|
+
size: pe(t)
|
|
935
935
|
};
|
|
936
936
|
}
|
|
937
937
|
//#endregion
|
|
@@ -1094,7 +1094,7 @@ var Re = ({ children: e, className: t }) => /* @__PURE__ */ c("div", {
|
|
|
1094
1094
|
className: "grid gap-3 md:grid-cols-[1fr_auto]",
|
|
1095
1095
|
children: [/* @__PURE__ */ l(Re, {
|
|
1096
1096
|
className: "min-w-0",
|
|
1097
|
-
children: [/* @__PURE__ */ c(
|
|
1097
|
+
children: [/* @__PURE__ */ c(oe, {
|
|
1098
1098
|
value: e,
|
|
1099
1099
|
onChange: i,
|
|
1100
1100
|
methods: Ae,
|
|
@@ -1123,7 +1123,7 @@ var Re = ({ children: e, className: t }) => /* @__PURE__ */ c("div", {
|
|
|
1123
1123
|
children: [
|
|
1124
1124
|
/* @__PURE__ */ c("span", {
|
|
1125
1125
|
className: "flex h-8 items-center",
|
|
1126
|
-
children: /* @__PURE__ */ c(
|
|
1126
|
+
children: /* @__PURE__ */ c(k, {
|
|
1127
1127
|
size: "sm",
|
|
1128
1128
|
checked: e.enabled,
|
|
1129
1129
|
onChange: (e) => r(t, { enabled: e }),
|
|
@@ -1131,7 +1131,7 @@ var Re = ({ children: e, className: t }) => /* @__PURE__ */ c("div", {
|
|
|
1131
1131
|
"aria-label": `Enable ${e.key}`
|
|
1132
1132
|
})
|
|
1133
1133
|
}),
|
|
1134
|
-
/* @__PURE__ */ c(
|
|
1134
|
+
/* @__PURE__ */ c(P, {
|
|
1135
1135
|
size: "sm",
|
|
1136
1136
|
value: e.key,
|
|
1137
1137
|
onChange: (e) => r(t, { key: e.target.value }),
|
|
@@ -1139,7 +1139,7 @@ var Re = ({ children: e, className: t }) => /* @__PURE__ */ c("div", {
|
|
|
1139
1139
|
"aria-label": "Header name",
|
|
1140
1140
|
className: "font-mono"
|
|
1141
1141
|
}),
|
|
1142
|
-
/* @__PURE__ */ c(
|
|
1142
|
+
/* @__PURE__ */ c(P, {
|
|
1143
1143
|
size: "sm",
|
|
1144
1144
|
value: e.value,
|
|
1145
1145
|
onChange: (e) => r(t, { value: e.target.value }),
|
|
@@ -1190,7 +1190,7 @@ var Re = ({ children: e, className: t }) => /* @__PURE__ */ c("div", {
|
|
|
1190
1190
|
return /* @__PURE__ */ l("div", {
|
|
1191
1191
|
className: "grid items-start gap-3 md:grid-cols-[auto_1fr]",
|
|
1192
1192
|
children: [
|
|
1193
|
-
/* @__PURE__ */ c(
|
|
1193
|
+
/* @__PURE__ */ c(L, {
|
|
1194
1194
|
value: e.type,
|
|
1195
1195
|
onChange: (t) => {
|
|
1196
1196
|
t === "none" && n({ type: "none" }), t === "bearer" && n({
|
|
@@ -1212,7 +1212,7 @@ var Re = ({ children: e, className: t }) => /* @__PURE__ */ c("div", {
|
|
|
1212
1212
|
className: "rounded-lg border border-border bg-surface-2 p-2.5 text-xs text-muted",
|
|
1213
1213
|
children: "Auth is disabled for this request."
|
|
1214
1214
|
}),
|
|
1215
|
-
e.type === "bearer" && /* @__PURE__ */ c(
|
|
1215
|
+
e.type === "bearer" && /* @__PURE__ */ c(P, {
|
|
1216
1216
|
size: "sm",
|
|
1217
1217
|
type: r ? "text" : "password",
|
|
1218
1218
|
value: e.token,
|
|
@@ -1226,7 +1226,7 @@ var Re = ({ children: e, className: t }) => /* @__PURE__ */ c("div", {
|
|
|
1226
1226
|
}),
|
|
1227
1227
|
e.type === "apiKey" && /* @__PURE__ */ l("div", {
|
|
1228
1228
|
className: "grid gap-3 md:grid-cols-[minmax(0,0.7fr)_minmax(0,1fr)]",
|
|
1229
|
-
children: [/* @__PURE__ */ c(
|
|
1229
|
+
children: [/* @__PURE__ */ c(P, {
|
|
1230
1230
|
size: "sm",
|
|
1231
1231
|
value: e.key,
|
|
1232
1232
|
onChange: (t) => n({
|
|
@@ -1237,7 +1237,7 @@ var Re = ({ children: e, className: t }) => /* @__PURE__ */ c("div", {
|
|
|
1237
1237
|
}),
|
|
1238
1238
|
readOnly: !t,
|
|
1239
1239
|
className: "font-mono"
|
|
1240
|
-
}), /* @__PURE__ */ c(
|
|
1240
|
+
}), /* @__PURE__ */ c(P, {
|
|
1241
1241
|
size: "sm",
|
|
1242
1242
|
type: r ? "text" : "password",
|
|
1243
1243
|
value: e.value,
|
|
@@ -1325,7 +1325,7 @@ var Re = ({ children: e, className: t }) => /* @__PURE__ */ c("div", {
|
|
|
1325
1325
|
size: "sm"
|
|
1326
1326
|
})
|
|
1327
1327
|
]
|
|
1328
|
-
}), /* @__PURE__ */ c(
|
|
1328
|
+
}), /* @__PURE__ */ c(z, {
|
|
1329
1329
|
code: i,
|
|
1330
1330
|
language: n ? "json" : "plain",
|
|
1331
1331
|
copyable: !1,
|
|
@@ -1383,7 +1383,7 @@ var qe = ({ entries: e, onSelect: t, onClear: n }) => e.length === 0 ? /* @__PUR
|
|
|
1383
1383
|
onClick: () => t(e),
|
|
1384
1384
|
className: "flex w-full items-center gap-3 px-3 py-2.5 text-left transition-colors hover:bg-surface-2",
|
|
1385
1385
|
children: [
|
|
1386
|
-
/* @__PURE__ */ c(
|
|
1386
|
+
/* @__PURE__ */ c(E, {
|
|
1387
1387
|
method: e.request.method,
|
|
1388
1388
|
className: "shrink-0"
|
|
1389
1389
|
}),
|
|
@@ -1391,7 +1391,7 @@ var qe = ({ entries: e, onSelect: t, onClear: n }) => e.length === 0 ? /* @__PUR
|
|
|
1391
1391
|
className: "min-w-0 flex-1 truncate font-mono text-[13px] text-content",
|
|
1392
1392
|
children: e.request.url
|
|
1393
1393
|
}),
|
|
1394
|
-
/* @__PURE__ */ c(
|
|
1394
|
+
/* @__PURE__ */ c(D, {
|
|
1395
1395
|
status: e.response.status,
|
|
1396
1396
|
statusText: e.response.statusText,
|
|
1397
1397
|
className: "shrink-0"
|
|
@@ -1412,30 +1412,30 @@ var qe = ({ entries: e, onSelect: t, onClear: n }) => e.length === 0 ? /* @__PUR
|
|
|
1412
1412
|
async function Je(e, t) {
|
|
1413
1413
|
let n = performance.now();
|
|
1414
1414
|
try {
|
|
1415
|
-
return t ? await t(e) : await
|
|
1415
|
+
return t ? await t(e) : await H(e);
|
|
1416
1416
|
} catch (e) {
|
|
1417
|
-
return
|
|
1417
|
+
return V(e, n);
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
-
var Ye = ({ request: e, onRequestChange: t, onSend: n,
|
|
1421
|
-
let
|
|
1420
|
+
var Ye = ({ request: e, onRequestChange: t, onSend: n, title: r, editable: d = !0, onBack: p, onImport: m, className: h }) => {
|
|
1421
|
+
let _ = i(() => we(e), [e]), v = i(() => Te(e, _), [e, _]), y = Le(e.body ?? ke), b = e.body ?? "", [x, S] = o("body"), [C, w] = o("response"), [T, E] = o("body"), [ee, O] = o(!1), [te, k] = o([]), [ne, M] = o(null), [re, N] = o(null), P = a(null), F = i(() => ge(e), [e]), I = re ?? F, L = v.filter((e) => e.enabled).length, ie = je.map((e) => e.id === "headers" ? {
|
|
1422
1422
|
...e,
|
|
1423
|
-
badge:
|
|
1424
|
-
} : e),
|
|
1425
|
-
if (!
|
|
1426
|
-
let
|
|
1423
|
+
badge: L
|
|
1424
|
+
} : e), R = (n) => {
|
|
1425
|
+
if (!d) return;
|
|
1426
|
+
let r = Oe(e, {
|
|
1427
1427
|
method: e.method,
|
|
1428
1428
|
url: e.url,
|
|
1429
|
-
body:
|
|
1430
|
-
auth:
|
|
1431
|
-
headers:
|
|
1429
|
+
body: b,
|
|
1430
|
+
auth: _,
|
|
1431
|
+
headers: v,
|
|
1432
1432
|
...n
|
|
1433
1433
|
});
|
|
1434
|
-
t?.(
|
|
1434
|
+
t?.(r);
|
|
1435
1435
|
};
|
|
1436
1436
|
return /* @__PURE__ */ l("div", {
|
|
1437
|
-
className: u("space-y-3",
|
|
1438
|
-
children: [/* @__PURE__ */ l(
|
|
1437
|
+
className: u("space-y-3", h),
|
|
1438
|
+
children: [/* @__PURE__ */ l(A, {
|
|
1439
1439
|
flush: !0,
|
|
1440
1440
|
children: [
|
|
1441
1441
|
/* @__PURE__ */ l("div", {
|
|
@@ -1444,24 +1444,24 @@ var Ye = ({ request: e, onRequestChange: t, onSend: n, editable: r = !0, onBack:
|
|
|
1444
1444
|
className: "mb-4 flex items-center justify-between gap-3",
|
|
1445
1445
|
children: [/* @__PURE__ */ l("div", {
|
|
1446
1446
|
className: "flex min-w-0 items-center gap-3",
|
|
1447
|
-
children: [
|
|
1447
|
+
children: [p && /* @__PURE__ */ c("button", {
|
|
1448
1448
|
type: "button",
|
|
1449
1449
|
"aria-label": "Back to request snippets",
|
|
1450
|
-
onClick:
|
|
1450
|
+
onClick: p,
|
|
1451
1451
|
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-content transition-colors hover:bg-surface-2",
|
|
1452
1452
|
children: /* @__PURE__ */ c(f, {
|
|
1453
1453
|
name: "arrow-left",
|
|
1454
1454
|
className: "h-5 w-5"
|
|
1455
1455
|
})
|
|
1456
1456
|
}), /* @__PURE__ */ c("div", {
|
|
1457
|
-
className: "font-heading text-sm font-semibold text-content",
|
|
1458
|
-
children: "Try it Out"
|
|
1457
|
+
className: "truncate font-heading text-sm font-semibold text-content",
|
|
1458
|
+
children: r ?? "Try it Out"
|
|
1459
1459
|
})]
|
|
1460
|
-
}),
|
|
1460
|
+
}), d && m && /* @__PURE__ */ c(g, {
|
|
1461
1461
|
type: "button",
|
|
1462
1462
|
size: "sm",
|
|
1463
1463
|
variant: "ghost",
|
|
1464
|
-
onClick:
|
|
1464
|
+
onClick: m,
|
|
1465
1465
|
leftIcon: /* @__PURE__ */ c(f, {
|
|
1466
1466
|
name: "download",
|
|
1467
1467
|
className: "h-4 w-4"
|
|
@@ -1472,20 +1472,25 @@ var Ye = ({ request: e, onRequestChange: t, onSend: n, editable: r = !0, onBack:
|
|
|
1472
1472
|
method: e.method,
|
|
1473
1473
|
url: e.url,
|
|
1474
1474
|
isSending: ee,
|
|
1475
|
-
editable:
|
|
1476
|
-
onMethodChange: (e) =>
|
|
1477
|
-
onUrlChange: (e) =>
|
|
1475
|
+
editable: d,
|
|
1476
|
+
onMethodChange: (e) => R({ method: e }),
|
|
1477
|
+
onUrlChange: (e) => R({ url: e }),
|
|
1478
1478
|
onSend: async () => {
|
|
1479
1479
|
let t = Oe(e, {
|
|
1480
1480
|
method: e.method,
|
|
1481
1481
|
url: e.url,
|
|
1482
|
-
body:
|
|
1483
|
-
auth:
|
|
1484
|
-
headers:
|
|
1482
|
+
body: b,
|
|
1483
|
+
auth: _,
|
|
1484
|
+
headers: v
|
|
1485
1485
|
}), r = K(t);
|
|
1486
|
-
|
|
1486
|
+
O(!0);
|
|
1487
1487
|
let i = await Je(t, n);
|
|
1488
|
-
|
|
1488
|
+
O(!1), N(i), w("response"), window.requestAnimationFrame(() => {
|
|
1489
|
+
P.current?.scrollIntoView({
|
|
1490
|
+
behavior: "smooth",
|
|
1491
|
+
block: "center"
|
|
1492
|
+
});
|
|
1493
|
+
}), k((e) => [{
|
|
1489
1494
|
request: t,
|
|
1490
1495
|
response: i,
|
|
1491
1496
|
at: Date.now()
|
|
@@ -1495,23 +1500,23 @@ var Ye = ({ request: e, onRequestChange: t, onSend: n, editable: r = !0, onBack:
|
|
|
1495
1500
|
}),
|
|
1496
1501
|
/* @__PURE__ */ l("div", {
|
|
1497
1502
|
className: "flex items-center justify-between gap-3 border-y border-border px-3",
|
|
1498
|
-
children: [/* @__PURE__ */ c(
|
|
1499
|
-
items:
|
|
1500
|
-
activeId:
|
|
1501
|
-
onChange: (e) =>
|
|
1503
|
+
children: [/* @__PURE__ */ c(j, {
|
|
1504
|
+
items: ie,
|
|
1505
|
+
activeId: x,
|
|
1506
|
+
onChange: (e) => S(e),
|
|
1502
1507
|
className: "border-b-0"
|
|
1503
|
-
}),
|
|
1508
|
+
}), x === "body" && /* @__PURE__ */ c(g, {
|
|
1504
1509
|
type: "button",
|
|
1505
1510
|
size: "sm",
|
|
1506
1511
|
variant: "ghost",
|
|
1507
1512
|
onClick: () => {
|
|
1508
1513
|
try {
|
|
1509
|
-
|
|
1514
|
+
R({ body: Ie(y) }), M(null);
|
|
1510
1515
|
} catch {
|
|
1511
|
-
|
|
1516
|
+
M("Invalid JSON");
|
|
1512
1517
|
}
|
|
1513
1518
|
},
|
|
1514
|
-
disabled: !
|
|
1519
|
+
disabled: !d,
|
|
1515
1520
|
leftIcon: /* @__PURE__ */ c(f, {
|
|
1516
1521
|
name: "magic",
|
|
1517
1522
|
className: "h-4 w-4"
|
|
@@ -1522,83 +1527,86 @@ var Ye = ({ request: e, onRequestChange: t, onSend: n, editable: r = !0, onBack:
|
|
|
1522
1527
|
/* @__PURE__ */ c("div", {
|
|
1523
1528
|
className: "p-3",
|
|
1524
1529
|
children: /* @__PURE__ */ c(We, {
|
|
1525
|
-
activeTab:
|
|
1526
|
-
auth:
|
|
1527
|
-
headers:
|
|
1528
|
-
body:
|
|
1529
|
-
bodyError:
|
|
1530
|
-
editable:
|
|
1530
|
+
activeTab: x,
|
|
1531
|
+
auth: _,
|
|
1532
|
+
headers: v,
|
|
1533
|
+
body: y,
|
|
1534
|
+
bodyError: ne,
|
|
1535
|
+
editable: d,
|
|
1531
1536
|
onAuthChange: (e) => {
|
|
1532
|
-
|
|
1537
|
+
R({
|
|
1533
1538
|
auth: e,
|
|
1534
|
-
headers: Ee(
|
|
1539
|
+
headers: Ee(v, e, _)
|
|
1535
1540
|
});
|
|
1536
1541
|
},
|
|
1537
1542
|
onHeaderUpdate: (e, t) => {
|
|
1538
|
-
let n =
|
|
1543
|
+
let n = v[e], r = v.map((n, r) => r === e ? {
|
|
1539
1544
|
...n,
|
|
1540
1545
|
...t
|
|
1541
1546
|
} : n), i = r[e];
|
|
1542
|
-
|
|
1543
|
-
auth: i && (n && G(n,
|
|
1547
|
+
R({
|
|
1548
|
+
auth: i && (n && G(n, _) || G(i, _) || W(i.key, q)) ? i.enabled ? Se(i) : { type: "none" } : _,
|
|
1544
1549
|
headers: r
|
|
1545
1550
|
});
|
|
1546
1551
|
},
|
|
1547
1552
|
onHeaderRemove: (e) => {
|
|
1548
|
-
let t =
|
|
1549
|
-
|
|
1550
|
-
auth: t && (G(t,
|
|
1551
|
-
headers:
|
|
1553
|
+
let t = v[e];
|
|
1554
|
+
R({
|
|
1555
|
+
auth: t && (G(t, _) || W(t.key, q)) ? { type: "none" } : _,
|
|
1556
|
+
headers: v.filter((t, n) => n !== e)
|
|
1552
1557
|
});
|
|
1553
1558
|
},
|
|
1554
1559
|
onHeaderAdd: () => {
|
|
1555
|
-
|
|
1560
|
+
R({ headers: [...v, {
|
|
1556
1561
|
key: "",
|
|
1557
1562
|
value: "",
|
|
1558
1563
|
enabled: !0
|
|
1559
1564
|
}] });
|
|
1560
1565
|
},
|
|
1561
|
-
onBodyChange: (e) =>
|
|
1562
|
-
onBodyErrorClear: () =>
|
|
1566
|
+
onBodyChange: (e) => R({ body: e }),
|
|
1567
|
+
onBodyErrorClear: () => M(null)
|
|
1563
1568
|
})
|
|
1564
1569
|
})
|
|
1565
1570
|
]
|
|
1566
|
-
}), /* @__PURE__ */
|
|
1567
|
-
|
|
1568
|
-
children:
|
|
1569
|
-
|
|
1570
|
-
children: [/* @__PURE__ */
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1571
|
+
}), /* @__PURE__ */ c("div", {
|
|
1572
|
+
ref: P,
|
|
1573
|
+
children: /* @__PURE__ */ l(A, {
|
|
1574
|
+
flush: !0,
|
|
1575
|
+
children: [/* @__PURE__ */ l("div", {
|
|
1576
|
+
className: "flex flex-wrap items-center justify-between gap-3 border-b border-border px-3",
|
|
1577
|
+
children: [/* @__PURE__ */ c(j, {
|
|
1578
|
+
items: Me,
|
|
1579
|
+
activeId: C,
|
|
1580
|
+
onChange: (e) => w(e),
|
|
1581
|
+
className: "border-b-0"
|
|
1582
|
+
}), C === "response" && /* @__PURE__ */ c(ze, {
|
|
1583
|
+
value: T,
|
|
1584
|
+
onChange: E
|
|
1585
|
+
})]
|
|
1586
|
+
}), C === "response" ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("div", {
|
|
1587
|
+
className: "flex flex-wrap items-center gap-5 border-b border-border px-3 py-3 text-xs text-muted",
|
|
1588
|
+
children: [
|
|
1589
|
+
/* @__PURE__ */ c(D, {
|
|
1590
|
+
status: I.status,
|
|
1591
|
+
statusText: I.statusText
|
|
1592
|
+
}),
|
|
1593
|
+
/* @__PURE__ */ l("span", { children: [I.timeMs, "ms"] }),
|
|
1594
|
+
/* @__PURE__ */ c("span", { children: I.size })
|
|
1595
|
+
]
|
|
1596
|
+
}), /* @__PURE__ */ c(Ge, {
|
|
1597
|
+
responsePanel: T,
|
|
1598
|
+
response: I
|
|
1599
|
+
})] }) : /* @__PURE__ */ c("div", {
|
|
1600
|
+
className: "p-3",
|
|
1601
|
+
children: /* @__PURE__ */ c(qe, {
|
|
1602
|
+
entries: te,
|
|
1603
|
+
onSelect: (e) => {
|
|
1604
|
+
t?.(e.request), N(e.response), w("response");
|
|
1605
|
+
},
|
|
1606
|
+
onClear: () => k([])
|
|
1607
|
+
})
|
|
1578
1608
|
})]
|
|
1579
|
-
})
|
|
1580
|
-
className: "flex flex-wrap items-center gap-5 border-b border-border px-3 py-3 text-xs text-muted",
|
|
1581
|
-
children: [
|
|
1582
|
-
/* @__PURE__ */ c(te, {
|
|
1583
|
-
status: P.status,
|
|
1584
|
-
statusText: P.statusText
|
|
1585
|
-
}),
|
|
1586
|
-
/* @__PURE__ */ l("span", { children: [P.timeMs, "ms"] }),
|
|
1587
|
-
/* @__PURE__ */ c("span", { children: P.size })
|
|
1588
|
-
]
|
|
1589
|
-
}), /* @__PURE__ */ c(Ge, {
|
|
1590
|
-
responsePanel: C,
|
|
1591
|
-
response: P
|
|
1592
|
-
})] }) : /* @__PURE__ */ c("div", {
|
|
1593
|
-
className: "p-3",
|
|
1594
|
-
children: /* @__PURE__ */ c(qe, {
|
|
1595
|
-
entries: ne,
|
|
1596
|
-
onSelect: (e) => {
|
|
1597
|
-
t?.(e.request), M(e.response), S("response");
|
|
1598
|
-
},
|
|
1599
|
-
onClear: () => E([])
|
|
1600
|
-
})
|
|
1601
|
-
})]
|
|
1609
|
+
})
|
|
1602
1610
|
})]
|
|
1603
1611
|
});
|
|
1604
1612
|
}, Xe = [
|
|
@@ -1669,14 +1677,14 @@ function ct(e) {
|
|
|
1669
1677
|
let t = e.toUpperCase();
|
|
1670
1678
|
return Xe.includes(t) ? t : null;
|
|
1671
1679
|
}
|
|
1672
|
-
function
|
|
1680
|
+
function lt(e) {
|
|
1673
1681
|
let t = e.indexOf(":");
|
|
1674
1682
|
return t < 0 ? null : {
|
|
1675
1683
|
key: e.slice(0, t).trim(),
|
|
1676
1684
|
value: e.slice(t + 1).trim()
|
|
1677
1685
|
};
|
|
1678
1686
|
}
|
|
1679
|
-
function
|
|
1687
|
+
function ut(e) {
|
|
1680
1688
|
let t = e.find((e) => e.key.toLowerCase() === tt);
|
|
1681
1689
|
if (t) return t.value.toLowerCase().startsWith(nt.toLowerCase()) ? {
|
|
1682
1690
|
type: "bearer",
|
|
@@ -1688,14 +1696,14 @@ function lt(e) {
|
|
|
1688
1696
|
in: "header"
|
|
1689
1697
|
};
|
|
1690
1698
|
}
|
|
1691
|
-
function
|
|
1699
|
+
function dt(e) {
|
|
1692
1700
|
try {
|
|
1693
1701
|
return JSON.stringify(JSON.parse(e), null, 2);
|
|
1694
1702
|
} catch {
|
|
1695
1703
|
return e;
|
|
1696
1704
|
}
|
|
1697
1705
|
}
|
|
1698
|
-
function
|
|
1706
|
+
function Y(e) {
|
|
1699
1707
|
let t = ot(at(e));
|
|
1700
1708
|
if (t.length === 0) return null;
|
|
1701
1709
|
let n = [], r = [], i = null, a = "";
|
|
@@ -1710,12 +1718,12 @@ function X(e) {
|
|
|
1710
1718
|
continue;
|
|
1711
1719
|
}
|
|
1712
1720
|
if (Qe.has(o) && s) {
|
|
1713
|
-
let t =
|
|
1721
|
+
let t = lt(s);
|
|
1714
1722
|
t && n.push(t), e++;
|
|
1715
1723
|
continue;
|
|
1716
1724
|
}
|
|
1717
1725
|
if (o.startsWith("-H") && o.length > 2) {
|
|
1718
|
-
let e =
|
|
1726
|
+
let e = lt(o.slice(2));
|
|
1719
1727
|
e && n.push(e);
|
|
1720
1728
|
continue;
|
|
1721
1729
|
}
|
|
@@ -1739,7 +1747,7 @@ function X(e) {
|
|
|
1739
1747
|
!o.startsWith("-") && st(o) && (a = J(o));
|
|
1740
1748
|
}
|
|
1741
1749
|
if (!a) return null;
|
|
1742
|
-
let o = r.length ?
|
|
1750
|
+
let o = r.length ? dt(r.join("&")) : "", s = i ?? (o ? "POST" : "GET"), c = ut(n);
|
|
1743
1751
|
return {
|
|
1744
1752
|
title: "Imported request",
|
|
1745
1753
|
method: s,
|
|
@@ -1751,9 +1759,9 @@ function X(e) {
|
|
|
1751
1759
|
}
|
|
1752
1760
|
//#endregion
|
|
1753
1761
|
//#region src/features/api-widget/ImportCard.tsx
|
|
1754
|
-
var
|
|
1762
|
+
var ft = "curl -X POST 'https://jsonplaceholder.typicode.com/posts' \\\n -H 'Content-Type: application/json' \\\n -d '{ \"title\": \"API client\", \"body\": \"Live request\", \"userId\": 1 }'", pt = ({ onImport: e, onCancel: t, className: n }) => {
|
|
1755
1763
|
let [r, i] = o(""), [a, s] = o(null);
|
|
1756
|
-
return /* @__PURE__ */ c(
|
|
1764
|
+
return /* @__PURE__ */ c(A, {
|
|
1757
1765
|
flush: !0,
|
|
1758
1766
|
className: n,
|
|
1759
1767
|
children: /* @__PURE__ */ l("div", {
|
|
@@ -1786,7 +1794,7 @@ var dt = "curl -X POST 'https://jsonplaceholder.typicode.com/posts' \\\n -H 'Co
|
|
|
1786
1794
|
},
|
|
1787
1795
|
spellCheck: !1,
|
|
1788
1796
|
rows: 5,
|
|
1789
|
-
placeholder:
|
|
1797
|
+
placeholder: ft,
|
|
1790
1798
|
"aria-label": "cURL command",
|
|
1791
1799
|
className: u("w-full resize-none rounded-lg border bg-surface-2 p-3 font-mono text-[13px] leading-relaxed text-content outline-none", "placeholder:text-muted/50 focus:ring-2 focus:ring-primary/20", a ? "border-red-500/60" : "border-border focus:border-primary/60")
|
|
1792
1800
|
}),
|
|
@@ -1799,7 +1807,7 @@ var dt = "curl -X POST 'https://jsonplaceholder.typicode.com/posts' \\\n -H 'Co
|
|
|
1799
1807
|
children: /* @__PURE__ */ c(g, {
|
|
1800
1808
|
size: "sm",
|
|
1801
1809
|
onClick: () => {
|
|
1802
|
-
let t =
|
|
1810
|
+
let t = Y(r);
|
|
1803
1811
|
if (!t) {
|
|
1804
1812
|
s("Could not parse a valid cURL command. Make sure it includes a URL.");
|
|
1805
1813
|
return;
|
|
@@ -1817,7 +1825,21 @@ var dt = "curl -X POST 'https://jsonplaceholder.typicode.com/posts' \\\n -H 'Co
|
|
|
1817
1825
|
]
|
|
1818
1826
|
})
|
|
1819
1827
|
});
|
|
1820
|
-
}
|
|
1828
|
+
};
|
|
1829
|
+
//#endregion
|
|
1830
|
+
//#region src/features/api-widget/format.ts
|
|
1831
|
+
function mt(e) {
|
|
1832
|
+
let t = e.trim();
|
|
1833
|
+
if (!t) return e;
|
|
1834
|
+
try {
|
|
1835
|
+
return JSON.stringify(JSON.parse(t), null, 2);
|
|
1836
|
+
} catch {
|
|
1837
|
+
return e;
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
//#endregion
|
|
1841
|
+
//#region src/features/api-widget/snippets.ts
|
|
1842
|
+
var X = [
|
|
1821
1843
|
{
|
|
1822
1844
|
id: "curl",
|
|
1823
1845
|
label: "cURL"
|
|
@@ -1835,10 +1857,10 @@ var dt = "curl -X POST 'https://jsonplaceholder.typicode.com/posts' \\\n -H 'Co
|
|
|
1835
1857
|
label: "Go"
|
|
1836
1858
|
}
|
|
1837
1859
|
];
|
|
1838
|
-
function
|
|
1860
|
+
function ht(e) {
|
|
1839
1861
|
return e === "curl" ? "bash" : e;
|
|
1840
1862
|
}
|
|
1841
|
-
function
|
|
1863
|
+
function gt(e) {
|
|
1842
1864
|
return !e || e.type === "none" ? null : e.type === "bearer" ? {
|
|
1843
1865
|
key: "Authorization",
|
|
1844
1866
|
value: `Bearer ${e.token}`
|
|
@@ -1848,15 +1870,15 @@ function ht(e) {
|
|
|
1848
1870
|
};
|
|
1849
1871
|
}
|
|
1850
1872
|
function Z(e) {
|
|
1851
|
-
let t =
|
|
1873
|
+
let t = gt(e.auth);
|
|
1852
1874
|
return t ? [...(e.headers ?? []).filter((e) => e.key.toLowerCase() !== t.key.toLowerCase()), t] : e.headers ?? [];
|
|
1853
1875
|
}
|
|
1854
|
-
function
|
|
1876
|
+
function _t(e) {
|
|
1855
1877
|
let t = `curl -X ${e.method} '${e.url}'`;
|
|
1856
1878
|
for (let n of Z(e)) t += ` \\\n -H '${n.key}: ${n.value}'`;
|
|
1857
1879
|
return e.body && (t += ` \\\n -d '${e.body}'`), t;
|
|
1858
1880
|
}
|
|
1859
|
-
function
|
|
1881
|
+
function vt(e) {
|
|
1860
1882
|
let t = [`method: '${e.method}'`], n = Z(e);
|
|
1861
1883
|
if (n.length) {
|
|
1862
1884
|
let e = n.map((e) => ` '${e.key}': '${e.value}'`).join(",\n");
|
|
@@ -1871,7 +1893,7 @@ function _t(e) {
|
|
|
1871
1893
|
"console.log(data);"
|
|
1872
1894
|
].join("\n");
|
|
1873
1895
|
}
|
|
1874
|
-
function
|
|
1896
|
+
function yt(e) {
|
|
1875
1897
|
let t = [
|
|
1876
1898
|
"import requests",
|
|
1877
1899
|
"",
|
|
@@ -1884,7 +1906,7 @@ function vt(e) {
|
|
|
1884
1906
|
}
|
|
1885
1907
|
return e.body && (t.push("", `payload = ${e.body}`), n.push("json=payload")), t.push("", `response = requests.${e.method.toLowerCase()}(${n.join(", ")})`, "print(response.json())"), t.join("\n");
|
|
1886
1908
|
}
|
|
1887
|
-
function
|
|
1909
|
+
function bt(e) {
|
|
1888
1910
|
let t = [
|
|
1889
1911
|
"\"fmt\"",
|
|
1890
1912
|
"\"io\"",
|
|
@@ -1903,51 +1925,48 @@ function yt(e) {
|
|
|
1903
1925
|
}
|
|
1904
1926
|
function Q(e, t) {
|
|
1905
1927
|
switch (t) {
|
|
1906
|
-
case "curl": return
|
|
1907
|
-
case "javascript": return
|
|
1908
|
-
case "python": return
|
|
1909
|
-
case "go": return
|
|
1928
|
+
case "curl": return _t(e);
|
|
1929
|
+
case "javascript": return vt(e);
|
|
1930
|
+
case "python": return yt(e);
|
|
1931
|
+
case "go": return bt(e);
|
|
1910
1932
|
}
|
|
1911
1933
|
}
|
|
1912
1934
|
//#endregion
|
|
1913
1935
|
//#region src/features/api-widget/RequestSnippet.tsx
|
|
1914
|
-
var
|
|
1915
|
-
let [n, r] = o("curl"), a = i(() => Q(e, n), [e, n]), s =
|
|
1936
|
+
var xt = ({ request: e, onTryItOut: t }) => {
|
|
1937
|
+
let [n, r] = o("curl"), a = i(() => Q(e, n), [e, n]), s = i(() => e.sampleResponse ? mt(e.sampleResponse) : "", [e.sampleResponse]);
|
|
1916
1938
|
return /* @__PURE__ */ l("div", {
|
|
1917
1939
|
className: "space-y-3",
|
|
1918
|
-
children: [/* @__PURE__ */ l(
|
|
1919
|
-
|
|
1920
|
-
children: [/* @__PURE__ */
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
}),
|
|
1937
|
-
children: "Try it"
|
|
1938
|
-
})]
|
|
1939
|
-
}), /* @__PURE__ */ c("div", {
|
|
1940
|
-
className: "mt-4",
|
|
1941
|
-
children: /* @__PURE__ */ c(L, {
|
|
1942
|
-
code: a,
|
|
1943
|
-
language: mt(n),
|
|
1944
|
-
showLineNumbers: !0
|
|
1945
|
-
})
|
|
1940
|
+
children: [/* @__PURE__ */ l(A, { children: [/* @__PURE__ */ l("div", {
|
|
1941
|
+
className: "relative flex items-center justify-between",
|
|
1942
|
+
children: [/* @__PURE__ */ c(j, {
|
|
1943
|
+
items: X,
|
|
1944
|
+
activeId: n,
|
|
1945
|
+
onChange: (e) => {
|
|
1946
|
+
r(e);
|
|
1947
|
+
},
|
|
1948
|
+
className: "[&_button]:text-[14px]"
|
|
1949
|
+
}), !!t && /* @__PURE__ */ c(g, {
|
|
1950
|
+
size: "sm",
|
|
1951
|
+
variant: "primary",
|
|
1952
|
+
onClick: t,
|
|
1953
|
+
rightIcon: /* @__PURE__ */ c(f, {
|
|
1954
|
+
name: "arrow-right",
|
|
1955
|
+
className: "h-4 w-4"
|
|
1956
|
+
}),
|
|
1957
|
+
children: "Try it"
|
|
1946
1958
|
})]
|
|
1947
|
-
}),
|
|
1959
|
+
}), /* @__PURE__ */ c("div", {
|
|
1960
|
+
className: "mt-4",
|
|
1961
|
+
children: /* @__PURE__ */ c(z, {
|
|
1962
|
+
code: a,
|
|
1963
|
+
language: ht(n),
|
|
1964
|
+
showLineNumbers: !0
|
|
1965
|
+
})
|
|
1966
|
+
})] }), s && /* @__PURE__ */ c(A, {
|
|
1948
1967
|
label: "",
|
|
1949
|
-
children: /* @__PURE__ */ c(
|
|
1950
|
-
code:
|
|
1968
|
+
children: /* @__PURE__ */ c(z, {
|
|
1969
|
+
code: s,
|
|
1951
1970
|
language: "json"
|
|
1952
1971
|
})
|
|
1953
1972
|
})]
|
|
@@ -1955,7 +1974,7 @@ var bt = ({ request: e, onTryItOut: t }) => {
|
|
|
1955
1974
|
};
|
|
1956
1975
|
//#endregion
|
|
1957
1976
|
//#region src/features/api-widget/ApiPlayground.tsx
|
|
1958
|
-
function
|
|
1977
|
+
function St(e) {
|
|
1959
1978
|
let [n, r] = o(() => typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
|
|
1960
1979
|
return t(() => {
|
|
1961
1980
|
if (e !== "system") return;
|
|
@@ -1963,7 +1982,7 @@ function xt(e) {
|
|
|
1963
1982
|
return n(), t.addEventListener("change", n), () => t.removeEventListener("change", n);
|
|
1964
1983
|
}, [e]), e === "system" ? n : e;
|
|
1965
1984
|
}
|
|
1966
|
-
function
|
|
1985
|
+
function Ct(e) {
|
|
1967
1986
|
try {
|
|
1968
1987
|
let t = new URL(e.url);
|
|
1969
1988
|
return `${e.method} ${t.pathname || "/"}`;
|
|
@@ -1971,7 +1990,7 @@ function St(e) {
|
|
|
1971
1990
|
return `${e.method} ${e.url || "/"}`;
|
|
1972
1991
|
}
|
|
1973
1992
|
}
|
|
1974
|
-
var
|
|
1993
|
+
var wt = ({ request: e, allowImport: t, editable: n, onTryImport: r }) => /* @__PURE__ */ l(A, {
|
|
1975
1994
|
label: "Invalid request",
|
|
1976
1995
|
children: [
|
|
1977
1996
|
/* @__PURE__ */ l("div", {
|
|
@@ -1992,7 +2011,7 @@ var Ct = ({ request: e, allowImport: t, editable: n, onTryImport: r }) => /* @__
|
|
|
1992
2011
|
}),
|
|
1993
2012
|
/* @__PURE__ */ c("div", {
|
|
1994
2013
|
className: "mt-4",
|
|
1995
|
-
children: /* @__PURE__ */ c(
|
|
2014
|
+
children: /* @__PURE__ */ c(z, {
|
|
1996
2015
|
code: e.trim() || "Paste or pass a cURL request with a URL.",
|
|
1997
2016
|
language: "bash",
|
|
1998
2017
|
showLineNumbers: !0
|
|
@@ -2003,72 +2022,120 @@ var Ct = ({ request: e, allowImport: t, editable: n, onTryImport: r }) => /* @__
|
|
|
2003
2022
|
children: "The request could not be parsed into a valid URL."
|
|
2004
2023
|
})
|
|
2005
2024
|
]
|
|
2006
|
-
})
|
|
2025
|
+
}), Tt = 240, Et = ({ panelKey: e, children: n }) => {
|
|
2026
|
+
let r = a(null), i = a(null), s = a(e), l = a(null), [u, d] = o(null), [f, p] = o(!1);
|
|
2027
|
+
return t(() => {
|
|
2028
|
+
let t = r.current, n = i.current;
|
|
2029
|
+
if (!t || !n || s.current === e) return;
|
|
2030
|
+
let a = window.matchMedia("(prefers-reduced-motion: reduce)").matches, o = l.current ?? t.getBoundingClientRect().height, c = n.getBoundingClientRect().height;
|
|
2031
|
+
if (s.current = e, l.current = c, a || Math.abs(o - c) < 1) {
|
|
2032
|
+
d(null), p(!1);
|
|
2033
|
+
return;
|
|
2034
|
+
}
|
|
2035
|
+
p(!0), d(o);
|
|
2036
|
+
let u = window.requestAnimationFrame(() => {
|
|
2037
|
+
d(c);
|
|
2038
|
+
}), f = window.setTimeout(() => {
|
|
2039
|
+
d(null), p(!1);
|
|
2040
|
+
}, Tt);
|
|
2041
|
+
return () => {
|
|
2042
|
+
window.cancelAnimationFrame(u), window.clearTimeout(f);
|
|
2043
|
+
};
|
|
2044
|
+
}, [e]), t(() => {
|
|
2045
|
+
let e = i.current;
|
|
2046
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
2047
|
+
let t = new ResizeObserver(([e]) => {
|
|
2048
|
+
l.current = e.contentRect.height;
|
|
2049
|
+
});
|
|
2050
|
+
return t.observe(e), () => t.disconnect();
|
|
2051
|
+
}, []), /* @__PURE__ */ c("div", {
|
|
2052
|
+
ref: r,
|
|
2053
|
+
className: "transition-[height] duration-[240ms] ease-out",
|
|
2054
|
+
style: {
|
|
2055
|
+
height: u === null ? void 0 : `${u}px`,
|
|
2056
|
+
overflow: f ? "hidden" : void 0
|
|
2057
|
+
},
|
|
2058
|
+
children: /* @__PURE__ */ c("div", {
|
|
2059
|
+
ref: i,
|
|
2060
|
+
children: n
|
|
2061
|
+
})
|
|
2062
|
+
});
|
|
2063
|
+
};
|
|
2007
2064
|
function $(e, t, n) {
|
|
2008
2065
|
return {
|
|
2009
2066
|
...e,
|
|
2010
|
-
title: t ??
|
|
2011
|
-
sampleResponse: n
|
|
2067
|
+
title: t ?? Ct(e),
|
|
2068
|
+
sampleResponse: n ? mt(n) : void 0
|
|
2012
2069
|
};
|
|
2013
2070
|
}
|
|
2014
|
-
var
|
|
2015
|
-
let
|
|
2071
|
+
var Dt = ({ request: e, title: n, sampleResponse: r, onUpdateRequest: a, editable: s = !0, allowImport: u = !0, mode: d = "dark", syncSnippet: f = !1, customization: p }) => {
|
|
2072
|
+
let m = St(d), [h, g] = o("idle"), [_, v] = o(e);
|
|
2016
2073
|
t(() => {
|
|
2017
|
-
|
|
2074
|
+
v(e);
|
|
2018
2075
|
}, [e]);
|
|
2019
|
-
let
|
|
2020
|
-
let e =
|
|
2076
|
+
let y = i(() => {
|
|
2077
|
+
let e = Y(_);
|
|
2021
2078
|
return e ? $(e, n, r) : null;
|
|
2022
2079
|
}, [
|
|
2023
|
-
|
|
2080
|
+
_,
|
|
2024
2081
|
n,
|
|
2025
2082
|
r
|
|
2026
|
-
]),
|
|
2027
|
-
let e =
|
|
2083
|
+
]), b = f ? _ : e, x = i(() => {
|
|
2084
|
+
let e = Y(b);
|
|
2028
2085
|
return e ? $(e, n, r) : null;
|
|
2029
2086
|
}, [
|
|
2030
|
-
|
|
2087
|
+
b,
|
|
2031
2088
|
n,
|
|
2032
2089
|
r
|
|
2033
|
-
]),
|
|
2034
|
-
|
|
2035
|
-
},
|
|
2036
|
-
|
|
2037
|
-
},
|
|
2038
|
-
|
|
2039
|
-
}
|
|
2040
|
-
|
|
2041
|
-
"
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
className: "
|
|
2047
|
-
children:
|
|
2048
|
-
|
|
2049
|
-
children: /* @__PURE__ */ c(
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2090
|
+
]), S = (e) => {
|
|
2091
|
+
v(e), a?.(e);
|
|
2092
|
+
}, C = (e) => {
|
|
2093
|
+
S(Q(e, "curl"));
|
|
2094
|
+
}, w = (e, t) => {
|
|
2095
|
+
S(t.trim()), g("console");
|
|
2096
|
+
}, T = {
|
|
2097
|
+
...p?.primary ? { "--primary": p.primary } : {},
|
|
2098
|
+
...p?.background ? { "--bg": p.background } : {}
|
|
2099
|
+
}, E = h === "console" && y, D = h === "import" ? "import" : E ? "console" : x ? "snippet" : "invalid";
|
|
2100
|
+
return /* @__PURE__ */ l("div", {
|
|
2101
|
+
"data-theme": m,
|
|
2102
|
+
style: T,
|
|
2103
|
+
className: "text-content text-left",
|
|
2104
|
+
children: [/* @__PURE__ */ c(Et, {
|
|
2105
|
+
panelKey: D,
|
|
2106
|
+
children: /* @__PURE__ */ c("div", {
|
|
2107
|
+
className: "motion-safe:animate-[widget-slide-in_180ms_ease-out]",
|
|
2108
|
+
children: h === "import" ? /* @__PURE__ */ c(pt, {
|
|
2109
|
+
onImport: w,
|
|
2110
|
+
onCancel: () => g(y ? "console" : "idle")
|
|
2111
|
+
}) : E ? /* @__PURE__ */ c(Ye, {
|
|
2112
|
+
request: y,
|
|
2113
|
+
onRequestChange: C,
|
|
2114
|
+
title: n,
|
|
2115
|
+
editable: s,
|
|
2116
|
+
onBack: () => g("idle"),
|
|
2117
|
+
onImport: u && s ? () => g("import") : void 0
|
|
2118
|
+
}) : x ? /* @__PURE__ */ c(xt, {
|
|
2119
|
+
request: x,
|
|
2120
|
+
onTryItOut: () => g("console")
|
|
2121
|
+
}) : /* @__PURE__ */ c(wt, {
|
|
2122
|
+
request: b,
|
|
2123
|
+
allowImport: u,
|
|
2124
|
+
editable: s,
|
|
2125
|
+
onTryImport: () => g("import")
|
|
2126
|
+
})
|
|
2127
|
+
}, D)
|
|
2128
|
+
}), /* @__PURE__ */ c("div", {
|
|
2129
|
+
className: "mt-2 flex justify-end",
|
|
2130
|
+
children: /* @__PURE__ */ c("a", {
|
|
2131
|
+
href: "https://www.npmjs.com/package/@ragrails/api-playground-react",
|
|
2132
|
+
target: "_blank",
|
|
2133
|
+
rel: "noreferrer",
|
|
2134
|
+
className: "text-[11px] font-medium text-muted/45 transition-colors hover:text-muted",
|
|
2135
|
+
children: "Build yours with RagRails"
|
|
2061
2136
|
})
|
|
2062
|
-
}
|
|
2063
|
-
request: b,
|
|
2064
|
-
onTryItOut: () => h("console")
|
|
2065
|
-
}) : /* @__PURE__ */ c(Ct, {
|
|
2066
|
-
request: y,
|
|
2067
|
-
allowImport: l,
|
|
2068
|
-
editable: s,
|
|
2069
|
-
onTryImport: () => h("import")
|
|
2070
|
-
})
|
|
2137
|
+
})]
|
|
2071
2138
|
});
|
|
2072
2139
|
};
|
|
2073
2140
|
//#endregion
|
|
2074
|
-
export { Ye as ApiConsole,
|
|
2141
|
+
export { Ye as ApiConsole, Dt as ApiPlayground, pt as ImportCard, xt as RequestSnippet, X as SNIPPET_LANGUAGES, H as executeWidgetRequest, Q as generateSnippet, ht as highlightFor, ge as mockWidgetResponse, Y as parseCurl, V as widgetErrorResponse };
|