@mintlify/msft-sdk 1.1.62 → 1.1.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/dist/api-playground/ApiPlayground/Response/DownloadFileButton.js +6 -5
  2. package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js +13 -12
  3. package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js +8 -7
  4. package/dist/api-playground/ApiPlayground/Response/ResponseTable.js +3 -2
  5. package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js +9 -8
  6. package/dist/api-playground/ApiPlayground/Response/index.js +4 -3
  7. package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js +42 -21
  8. package/dist/api-playground/ApiPlayground/components/ParamFieldWrapper.js +13 -9
  9. package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js +6 -5
  10. package/dist/api-playground/ApiPlayground/components/SendPill.js +3 -2
  11. package/dist/api-playground/ApiPlayground/components/TypeDropdown.js +6 -5
  12. package/dist/api-playground/EndpointFields/ParamFields/ExampleDescription.js +3 -2
  13. package/dist/api-playground/EndpointFields/components/Description.js +6 -5
  14. package/dist/api-playground/EndpointFields/components/OptionDropdown.js +9 -8
  15. package/dist/api-playground/EndpointFields/components/SectionHeading.js +8 -7
  16. package/dist/api-playground-2/ApiExamples.js +19 -20
  17. package/dist/api-playground-2/ApiFields.js +20 -247
  18. package/dist/api-playground-2/EndpointHeader.js +59 -47
  19. package/dist/api-playground-2/OperationPage.js +70 -66
  20. package/dist/api-playground-2/Playground.js +67 -83
  21. package/dist/api-playground-2/SchemaPage.js +22 -9
  22. package/dist/api-playground-2/components/EndpointFields/Body.js +40 -0
  23. package/dist/api-playground-2/components/EndpointFields/Parameters.js +90 -0
  24. package/dist/api-playground-2/components/EndpointFields/Response.js +146 -0
  25. package/dist/api-playground-2/components/EndpointFields/Security.js +88 -0
  26. package/dist/api-playground-2/components/EndpointFields/fields/ArrayParamField.js +93 -0
  27. package/dist/api-playground-2/components/EndpointFields/fields/Enum.js +29 -11
  28. package/dist/api-playground-2/components/EndpointFields/fields/ObjectParamField.js +145 -0
  29. package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js +60 -48
  30. package/dist/api-playground-2/components/EndpointFields/fields/SchemaField.js +230 -0
  31. package/dist/api-playground-2/components/Example/GeneratedRequestExample.js +93 -89
  32. package/dist/api-playground-2/components/Example/GeneratedResponseExample.js +18 -17
  33. package/dist/api-playground-2/components/Example/RequestExample.js +92 -93
  34. package/dist/api-playground-2/components/Example/ResponseExample.js +19 -15
  35. package/dist/api-playground-2/components/Request/ParameterSection.js +20 -18
  36. package/dist/api-playground-2/components/Request/SecuritySection.js +53 -43
  37. package/dist/api-playground-2/components/Request/inputs/ArrayInput.js +89 -40
  38. package/dist/api-playground-2/components/Request/inputs/DifferentiatedInput.js +12 -12
  39. package/dist/api-playground-2/components/Request/inputs/FileInput.js +16 -15
  40. package/dist/api-playground-2/components/Request/inputs/InputContainer.js +76 -57
  41. package/dist/api-playground-2/components/Request/inputs/NumberInput.js +10 -9
  42. package/dist/api-playground-2/components/Request/inputs/ObjectInput.js +98 -80
  43. package/dist/api-playground-2/components/Request/inputs/OneOfInput.js +55 -47
  44. package/dist/api-playground-2/components/Request/inputs/SelectInput.js +18 -17
  45. package/dist/api-playground-2/components/Request/inputs/StringInput.js +19 -18
  46. package/dist/api-playground-2/components/Request/inputs/TextInput.js +12 -11
  47. package/dist/api-playground-2/components/SendPillWrapper.js +35 -0
  48. package/dist/api-playground-2/contexts/ApiPlaygroundContext.js +3 -5
  49. package/dist/api-playground-2/generators/createCookies.js +23 -0
  50. package/dist/api-playground-2/generators/createHeaders.js +53 -36
  51. package/dist/api-playground-2/generators/createQueryString.js +30 -0
  52. package/dist/api-playground-2/generators/generateAuthPlaceholder.js +14 -0
  53. package/dist/api-playground-2/generators/generateInteractiveCodeSample.js +27 -25
  54. package/dist/api-playground-2/generators/generateRequest.js +47 -51
  55. package/dist/api-playground-2/generators/generateResponseExampleMap.js +15 -11
  56. package/dist/api-playground-2/generators/generateSnippetMap.js +13 -11
  57. package/dist/api-playground-2/hooks/useCopyPathWithInputs.js +11 -11
  58. package/dist/api-playground-2/hooks/useInitializeInputs.js +185 -88
  59. package/dist/api-playground-2/hooks/usePlaygroundInputsStore.js +70 -25
  60. package/dist/api-playground-2/hooks/useSelectedBaseUrl.js +13 -0
  61. package/dist/api-playground-2/hooks/useSelectedExample.js +10 -0
  62. package/dist/api-playground-2/hooks/useSelectedRequestBodyContentType.js +12 -0
  63. package/dist/api-playground-2/hooks/useSelectedResponseContentType.js +12 -0
  64. package/dist/api-playground-2/hooks/useSelectedSecurityOption.js +31 -0
  65. package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js +114 -101
  66. package/dist/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js +23 -32
  67. package/dist/api-playground-2/schemaGraph/addTypeLabelsToSchema.js +50 -0
  68. package/dist/api-playground-2/schemaGraph/addUniqueKeysToSchema.js +40 -24
  69. package/dist/api-playground-2/schemaGraph/getExampleBodyInputs.js +94 -0
  70. package/dist/api-playground-2/schemaGraph/getSchemaGraphOperationData.js +56 -50
  71. package/dist/api-playground-2/schemaGraph/processExamples.js +117 -52
  72. package/dist/api-playground-2/schemaGraph/processSchema.js +10 -0
  73. package/dist/api-playground-2/schemaGraph/processSecurityOptions.js +58 -28
  74. package/dist/api-playground-2/schemaGraph/reduceCompositions.js +220 -181
  75. package/dist/api-playground-2/schemaGraph/resolveOperationWithDependencies.js +128 -89
  76. package/dist/api-playground-2/schemaGraph/resolveSchemaWithDependencies.js +15 -16
  77. package/dist/api-playground-2/schemaGraph/sortSchemaByRequired.js +14 -12
  78. package/dist/api-playground-2/schemaGraph/utils.js +185 -147
  79. package/dist/common/guards.js +11 -19
  80. package/dist/components/Api/Expandable.js +10 -9
  81. package/dist/components/Api/Param.js +11 -13
  82. package/dist/components/Api/dropdown-menu.js +10 -9
  83. package/dist/components/content-components/code-group.js +4 -4
  84. package/dist/contexts/EndpointLocationContext.js +3 -3
  85. package/dist/hooks/useApiParamFieldOption.js +10 -0
  86. package/dist/hooks/useEndpoint.js +3 -3
  87. package/dist/hooks/useKeyboardShortcut.js +13 -13
  88. package/dist/hooks/useSendPlaygroundRequest.js +14 -146
  89. package/dist/index.d.ts +65 -58
  90. package/dist/index.js +109 -111
  91. package/dist/openapi/generateTypeStringFromSchema.js +2 -31
  92. package/dist/styles.css +1 -1
  93. package/package.json +1 -1
  94. package/dist/api-playground/ApiPlayground/Request/BodySection.js +0 -64
  95. package/dist/api-playground/ApiPlayground/Request/ParameterSection.js +0 -32
  96. package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js +0 -201
  97. package/dist/api-playground/ApiPlayground/Request/SecuritySection.js +0 -146
  98. package/dist/api-playground/ApiPlayground/Request/ServerSection.js +0 -30
  99. package/dist/api-playground/ApiPlayground/Request/index.js +0 -43
  100. package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js +0 -93
  101. package/dist/api-playground/ApiPlayground/Request/inputs/DifferentiatedInput.js +0 -90
  102. package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js +0 -62
  103. package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js +0 -33
  104. package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js +0 -61
  105. package/dist/api-playground/ApiPlayground/Request/inputs/ObjectChildren.js +0 -109
  106. package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js +0 -87
  107. package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js +0 -61
  108. package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js +0 -54
  109. package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js +0 -67
  110. package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js +0 -44
  111. package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js +0 -42
  112. package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js +0 -43
  113. package/dist/api-playground/ApiPlayground/components/EndpointsMenuSearch.js +0 -38
  114. package/dist/api-playground/ApiPlayground/components/InputContainer.js +0 -128
  115. package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js +0 -59
  116. package/dist/api-playground/ApiPlayground/components/PathHeader.js +0 -162
  117. package/dist/api-playground/ApiPlayground/components/TrashButton.js +0 -26
  118. package/dist/api-playground/ApiPlayground/index.js +0 -67
  119. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.js +0 -19
  120. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js +0 -18
  121. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js +0 -28
  122. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js +0 -5
  123. package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js +0 -13
  124. package/dist/api-playground/EndpointFields/index.js +0 -7
  125. package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js +0 -87
  126. package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js +0 -89
  127. package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js +0 -121
  128. package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js +0 -74
  129. package/dist/api-playground-2/components/EndpointFields/fields/SimpleSchemaField.js +0 -252
  130. package/dist/common/potentiallyParseOpenApiString.js +0 -24
  131. package/dist/common/replaceSlashIndex.js +0 -6
  132. package/dist/common/slugToTitle.js +0 -10
  133. package/dist/constants/prism-languages.js +0 -19
  134. package/dist/contexts/ApiPlaygroundInputsContext.js +0 -17
  135. package/dist/contexts/MDXContentContext.js +0 -17
  136. package/dist/hooks/useApiPlaygroundInputs.js +0 -6
  137. package/dist/hooks/useApiPlaygroundPrefillExamples.js +0 -39
  138. package/dist/hooks/useBaseUrlOptions.js +0 -18
  139. package/dist/hooks/useComponentSchemas.js +0 -9
  140. package/dist/hooks/useGenerateNextAdditionalProperties.js +0 -11
  141. package/dist/hooks/useGenerateNextItems.js +0 -11
  142. package/dist/hooks/useGenerateNextProperties.js +0 -11
  143. package/dist/hooks/useMDXContent.js +0 -6
  144. package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js +0 -9
  145. package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js +0 -15
  146. package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js +0 -15
  147. package/dist/hooks/usePlaygroundSchemaOptions.js +0 -42
  148. package/dist/hooks/usePrefilledInputs/index.js +0 -65
  149. package/dist/hooks/usePrefilledInputs/storedServerVariables.js +0 -29
  150. package/dist/hooks/useSecurityOption.js +0 -10
  151. package/dist/hooks/useSetDefaultValue.js +0 -63
  152. package/dist/openapi/filterEnums.js +0 -20
  153. package/dist/openapi/generateNextAdditionalProperties.js +0 -7
  154. package/dist/openapi/generateNextItems.js +0 -7
  155. package/dist/openapi/generateNextProperties.js +0 -23
  156. package/dist/openapi/generateOptionLabels.js +0 -20
  157. package/dist/openapi/generateSimpleLabels.js +0 -4
  158. package/dist/openapi/getAuthFilteredSchemaArray.js +0 -18
  159. package/dist/paths/isEqualIgnoringLeadingSlash.js +0 -21
  160. package/dist/paths/optionallyRemoveLeadingSlash.js +0 -6
  161. package/dist/paths/optionallyRemoveTrailingSlash.js +0 -6
  162. package/dist/utils/api-playground/defaults.js +0 -15
  163. package/dist/utils/api-playground/paramFieldDefaults.js +0 -10
  164. package/dist/utils/api-reference/getFilteredSecurityOptions.js +0 -4
  165. package/dist/utils/api-reference/getNextPropertiesByType.js +0 -5
  166. package/dist/utils/flattenObject.js +0 -10
@@ -1,53 +1,63 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { mapParamInToPlaygroundInputKey as O, escapeDots as x } from "../../schemaGraph/utils.js";
3
- import { cn as g } from "../../../utils/cn.js";
4
- import { TypeDropdown as P } from "../TypeDropdown.js";
5
- import { InputSectionContainer as v } from "./InputSectionContainer.js";
6
- import { DifferentiatedInput as D } from "./inputs/DifferentiatedInput.js";
7
- import { useSelectedSecurityOption as K, usePlaygroundInputsStore as d } from "../../hooks/usePlaygroundInputsStore.js";
8
- import { useRef as w, useEffect as E } from "react";
9
- const S = (c) => {
10
- const { scheme: t, schema: s } = c, r = "in" in t ? t.in : "header", i = "name" in t ? t.name : s.title ?? "";
11
- return `${O(r)}.${x(i)}`;
12
- }, N = ({ apiReferenceData: c }) => {
13
- var l;
14
- const { selectedSecurityOptionIndex: t, setSelectedSecurityOptionIndex: s } = K(), r = d((e) => e.inputs), i = d((e) => e.replaceInputs), p = w(t), n = (l = c.dependencies) == null ? void 0 : l.processedSecurityOptions;
15
- if (E(() => {
16
- if (p.current !== t) {
17
- if (!n) return;
18
- const e = n[p.current];
19
- if (e) {
20
- const I = S(e), m = { ...r };
21
- Object.keys(m).forEach((f) => {
22
- f.startsWith(I) && delete m[f];
23
- }), i(m);
24
- }
25
- p.current = t;
26
- }
27
- }, [t, n, r, i]), !n || n.length === 0) return null;
28
- const u = n[t];
29
- if (!u) return null;
30
- const y = n.map((e) => ({
31
- label: e.schema.title ?? "Authorization",
32
- schema: e.schema
33
- })), { schema: a } = u, h = S(u);
34
- return /* @__PURE__ */ o(v, { name: "Authorization", rightElement: /* @__PURE__ */ o(() => /* @__PURE__ */ o(
1
+ import { jsx as i, jsxs as u } from "react/jsx-runtime";
2
+ import y from "react";
3
+ import { useSelectedSecurityOption as f } from "../../hooks/useSelectedSecurityOption.js";
4
+ import { getSecurityOptionInputKeyPrefix as a } from "../../schemaGraph/utils.js";
5
+ import { Description as S } from "../../../api-playground/EndpointFields/components/Description.js";
6
+ import { cn as x } from "../../../utils/cn.js";
7
+ import { TypeDropdown as O } from "../TypeDropdown.js";
8
+ import { InputSectionContainer as g } from "./InputSectionContainer.js";
9
+ import { DifferentiatedInput as h } from "./inputs/DifferentiatedInput.js";
10
+ const N = ({ apiReferenceData: s }) => {
11
+ var c;
12
+ const { selectedSecurityOptionIndex: r, setSelectedSecurityOptionIndex: m } = f(), n = (c = s.dependencies) == null ? void 0 : c.processedSecurityOptions;
13
+ if (!n || n.length === 0) return null;
14
+ const p = n[r];
15
+ if (!p) return null;
16
+ const d = n.map((t) => {
17
+ var e;
18
+ return {
19
+ label: t.title,
20
+ schema: ((e = t.schemes[0]) == null ? void 0 : e.schema) ?? { type: "string" }
21
+ };
22
+ });
23
+ return /* @__PURE__ */ i(g, { name: "Authorization", rightElement: /* @__PURE__ */ i(() => /* @__PURE__ */ i(
35
24
  "div",
36
25
  {
37
- onClick: (e) => e.stopPropagation(),
38
- className: g("mint:text-xs mint:font-mono", n.length <= 1 && "mint:hidden"),
39
- children: /* @__PURE__ */ o(
40
- P,
26
+ onClick: (t) => t.stopPropagation(),
27
+ className: x("mint:text-xs mint:font-mono", n.length <= 1 && "mint:hidden"),
28
+ children: /* @__PURE__ */ i(
29
+ O,
41
30
  {
42
- options: y,
43
- selectedIndex: t,
44
- onSelectOption: (e) => {
45
- s(e);
31
+ options: d,
32
+ selectedIndex: r,
33
+ onSelectOption: (t) => {
34
+ m(t);
46
35
  }
47
36
  }
48
37
  )
49
38
  }
50
- ), {}), children: /* @__PURE__ */ o(D, { name: a.title, schema: a, inputKeyPrefix: h }) });
39
+ ), {}), children: p.schemes.map(({ scheme: t, schema: e, name: o }) => {
40
+ const l = a({ scheme: t, name: o });
41
+ return /* @__PURE__ */ u(y.Fragment, { children: [
42
+ e.description && e.type === "object" && /* @__PURE__ */ i(
43
+ S,
44
+ {
45
+ markdown: e.description,
46
+ className: "mint:text-gray-500 mint:dark:text-gray-400 mint:py-2"
47
+ }
48
+ ),
49
+ /* @__PURE__ */ i(
50
+ h,
51
+ {
52
+ name: o,
53
+ schema: e,
54
+ inputKeyPrefix: l,
55
+ skipContainer: e.type === "object"
56
+ },
57
+ `${t.type}-${o}`
58
+ )
59
+ ] }, `${t.type}-${o}`);
60
+ }) });
51
61
  };
52
62
  export {
53
63
  N as SecuritySection
@@ -1,51 +1,100 @@
1
- import { jsxs as I, Fragment as y, jsx as m } from "react/jsx-runtime";
2
- import { useState as A } from "react";
3
- import { v4 as s } from "uuid";
4
- import { isSchemaObject as h } from "../../../schemaGraph/utils.js";
5
- import { AdditionalItemButton as x } from "../../../../api-playground/ApiPlayground/components/AdditionalItemButton.js";
6
- import { cn as b } from "../../../../utils/cn.js";
7
- import { DifferentiatedInput as c } from "./DifferentiatedInput.js";
8
- const k = ({ schema: n, depth: d, parentNames: r, inputKeyPrefix: a }) => {
9
- const u = s(), t = "items" in n && h(n.items) ? n.items : void 0, [e, l] = A([]);
10
- if (!t) return null;
11
- const p = () => {
12
- const o = s(), i = [...e, o];
13
- l(i);
14
- };
15
- return /* @__PURE__ */ I(y, { children: [
16
- /* @__PURE__ */ m(
17
- c,
18
- {
19
- schema: t,
20
- arrayIndex: 0,
21
- depth: (d ?? 0) + 1,
22
- parentNames: r,
23
- inputKeyPrefix: a
1
+ import { jsxs as q, Fragment as E, jsx as g } from "react/jsx-runtime";
2
+ import { v4 as j } from "uuid";
3
+ import { useShallow as v } from "zustand/react/shallow";
4
+ import { getUniqueInputKey as I } from "../../../schemaGraph/addUniqueKeysToSchema.js";
5
+ import { isSchemaObject as f, getDifferentiatedType as K } from "../../../schemaGraph/utils.js";
6
+ import { AdditionalItemButton as D } from "../../../../api-playground/ApiPlayground/components/AdditionalItemButton.js";
7
+ import { cn as T } from "../../../../utils/cn.js";
8
+ import { usePlaygroundInputsStore as l } from "../../../hooks/usePlaygroundInputsStore.js";
9
+ import { DifferentiatedInput as N } from "./DifferentiatedInput.js";
10
+ const d = (e) => {
11
+ switch (K(e)) {
12
+ case "object":
13
+ return {};
14
+ case "array":
15
+ return [];
16
+ case "string":
17
+ case "enum<string>":
18
+ return "";
19
+ case "number":
20
+ case "integer":
21
+ case "enum<number>":
22
+ case "enum<integer>":
23
+ return 0;
24
+ case "boolean":
25
+ return !1;
26
+ case "null":
27
+ return null;
28
+ case "oneOf":
29
+ if (e.oneOf && Array.isArray(e.oneOf) && e.oneOf.length > 0) {
30
+ const u = e.oneOf[0];
31
+ if (f(u) && u.type !== "null")
32
+ return d(u);
33
+ if (e.oneOf.length > 1 && f(e.oneOf[1]))
34
+ return d(e.oneOf[1]);
24
35
  }
25
- ),
26
- e.map((o, i) => {
27
- const f = i + 1;
28
- return /* @__PURE__ */ m(
29
- c,
36
+ return;
37
+ case "file":
38
+ return;
39
+ default:
40
+ return;
41
+ }
42
+ }, k = ({
43
+ schema: e,
44
+ depth: p,
45
+ parentNames: u,
46
+ inputKeyPrefix: m,
47
+ arrayIndices: a
48
+ }) => {
49
+ const h = l((t) => t.setInput), y = l((t) => t.deleteInput), O = l(v((t) => t.inputs)), b = j(), n = "items" in e && f(e.items) ? e.items : void 0;
50
+ if (!n) return null;
51
+ const A = "uniqueKey" in n ? n.uniqueKey : "";
52
+ let i = `${m}.${A}`;
53
+ a == null || a.forEach((t) => {
54
+ i = i.replace("[INDEX]", String(t));
55
+ }), i = i.replaceAll("[INDEX]", "");
56
+ const r = [];
57
+ Object.keys(O).forEach((t) => {
58
+ if (t.startsWith(i)) {
59
+ const s = t.substring(i.length).match(/^(\d+)/);
60
+ if (s) {
61
+ const c = parseInt(s[1] ?? "0", 10);
62
+ r.includes(c) || r.push(c);
63
+ }
64
+ }
65
+ }), r.sort((t, o) => t - o);
66
+ const S = r.length > 0 ? Math.max(...r) + 1 : 0, x = () => {
67
+ const t = [...a ?? [], S], o = I(m, n, t), s = d(n);
68
+ h(o, s);
69
+ };
70
+ return /* @__PURE__ */ q(E, { children: [
71
+ r.map((t) => {
72
+ const o = [...a ?? [], t], s = I(m, n, o), c = () => {
73
+ y(s);
74
+ };
75
+ return /* @__PURE__ */ g(
76
+ N,
30
77
  {
31
- schema: t,
32
- arrayIndex: f,
33
- depth: (d ?? 0) + 1,
34
- parentNames: r,
35
- inputKeyPrefix: a
78
+ schema: n,
79
+ arrayIndices: o,
80
+ depth: (p ?? 0) + 1,
81
+ parentNames: u,
82
+ inputKeyPrefix: m,
83
+ clearValue: c,
84
+ isArrayChild: !0
36
85
  },
37
- o
86
+ `item-${t}`
38
87
  );
39
88
  }),
40
- /* @__PURE__ */ m(
41
- x,
89
+ /* @__PURE__ */ g(
90
+ D,
42
91
  {
43
92
  label: "Add an item",
44
- className: b(e.length > 0 && "mint:mt-4"),
45
- onClick: p,
46
- dataTestId: ("name" in t && t.name ? t.name : "") + "-add-item-button"
93
+ className: T(r.length > 0 && "mint:mt-4"),
94
+ onClick: x,
95
+ dataTestId: ("name" in n && n.name ? n.name : "") + "-add-item-button"
47
96
  },
48
- "add-item-button" + u
97
+ "add-item-button" + b
49
98
  )
50
99
  ] });
51
100
  };
@@ -1,22 +1,22 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { getDifferentiatedType as c } from "../../../schemaGraph/utils.js";
3
- import { ArrayInput as a } from "./ArrayInput.js";
4
- import { FileInput as f } from "./FileInput.js";
2
+ import { getDifferentiatedType as a } from "../../../schemaGraph/utils.js";
3
+ import { ArrayInput as f } from "./ArrayInput.js";
4
+ import { FileInput as d } from "./FileInput.js";
5
5
  import { InputContainer as t } from "./InputContainer.js";
6
6
  import { NullInput as l } from "./NullInput.js";
7
7
  import { NumberInput as i } from "./NumberInput.js";
8
8
  import { ObjectInput as u } from "./ObjectInput.js";
9
- import { OneOfInput as d } from "./OneOfInput.js";
9
+ import { OneOfInput as h } from "./OneOfInput.js";
10
10
  import { SelectInput as r } from "./SelectInput.js";
11
- import { StringInput as h } from "./StringInput.js";
11
+ import { StringInput as m } from "./StringInput.js";
12
12
  import { TextInput as y } from "./TextInput.js";
13
13
  const S = ({ ...e }) => {
14
- switch (c(e.schema)) {
14
+ switch (a(e.schema)) {
15
15
  case "oneOf":
16
- return /* @__PURE__ */ n(d, { ...e });
16
+ return /* @__PURE__ */ n(h, { ...e });
17
17
  case "string": {
18
- const m = e.isBody && e.depth === 0 || e.skipContainer ? y : h;
19
- return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(m, { ...e }) });
18
+ const c = e.isBody && e.depth === 0 || e.skipContainer ? y : m;
19
+ return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(c, { ...e }) });
20
20
  }
21
21
  case "object":
22
22
  return e.isBody && e.depth === 0 || e.skipContainer ? /* @__PURE__ */ n(u, { ...e }) : /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(u, { ...e }) });
@@ -25,7 +25,7 @@ const S = ({ ...e }) => {
25
25
  case "integer":
26
26
  return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(i, { ...e, numberType: "integer" }) });
27
27
  case "array":
28
- return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(a, { ...e }) });
28
+ return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(f, { ...e }) });
29
29
  case "boolean":
30
30
  return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(r, { ...e, enumType: "boolean" }) });
31
31
  case "enum<string>":
@@ -35,11 +35,11 @@ const S = ({ ...e }) => {
35
35
  case "enum<integer>":
36
36
  return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(r, { ...e, enumType: "integer" }) });
37
37
  case "file":
38
- return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(f, { ...e }) });
38
+ return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(d, { ...e }) });
39
39
  case "null":
40
40
  return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(l, {}) });
41
41
  default:
42
- return null;
42
+ return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(m, { ...e }) });
43
43
  }
44
44
  };
45
45
  export {
@@ -1,20 +1,21 @@
1
- import { jsxs as x, Fragment as y, jsx as a } from "react/jsx-runtime";
2
- import { useRef as I } from "react";
3
- import { usePlaygroundInputsStore as k } from "../../../hooks/usePlaygroundInputsStore.js";
4
- import { getSchemaPlaceholder as w, getUniqueInputKey as v } from "../../../schemaGraph/utils.js";
5
- import { useSelectedLocale as F } from "../../../../utils/locales/index.js";
6
- import { cn as P } from "../../../../utils/cn.js";
7
- const N = ({ name: c, schema: n, inputKeyPrefix: m, arrayIndex: u }) => {
8
- const { getInput: d, setInput: p } = k(), s = F(), o = I(null), f = w(n) ?? "Drop a file here or click to upload", i = v(m, n, u), r = d(i), t = typeof window < "u" && r instanceof File ? r : void 0, h = (t == null ? void 0 : t.name) ?? f, g = (e) => {
1
+ import { jsxs as g, Fragment as x, jsx as a } from "react/jsx-runtime";
2
+ import { useRef as y } from "react";
3
+ import { usePlaygroundInput as I } from "../../../hooks/usePlaygroundInputsStore.js";
4
+ import { getUniqueInputKey as k } from "../../../schemaGraph/addUniqueKeysToSchema.js";
5
+ import { getSchemaPlaceholder as w } from "../../../schemaGraph/utils.js";
6
+ import { useSelectedLocale as v } from "../../../../utils/locales/index.js";
7
+ import { cn as F } from "../../../../utils/cn.js";
8
+ const R = ({ name: c, schema: n, inputKeyPrefix: m, arrayIndices: d }) => {
9
+ const p = v(), o = y(null), u = w(n) ?? "Drop a file here or click to upload", i = k(m, n, d), { value: r, setInput: s } = I(i), t = typeof window < "u" && r instanceof File ? r : void 0, f = (t == null ? void 0 : t.name) ?? u, h = (e) => {
9
10
  var l;
10
- p(i, (l = e.target.files) == null ? void 0 : l[0]);
11
+ s(i, (l = e.target.files) == null ? void 0 : l[0]);
11
12
  };
12
- return /* @__PURE__ */ x(y, { children: [
13
+ return /* @__PURE__ */ g(x, { children: [
13
14
  /* @__PURE__ */ a(
14
15
  "button",
15
16
  {
16
- "aria-label": s["aria.fileUploadButton"],
17
- className: P(
17
+ "aria-label": p["aria.fileUploadButton"],
18
+ className: F(
18
19
  "mint:text-left mint:flex mint:text-playground-input mint:overflow-hidden",
19
20
  t ? "mint:text-gray-900! mint:dark:text-gray-100!" : "mint:text-gray-400! mint:dark:text-white/30!"
20
21
  ),
@@ -22,7 +23,7 @@ const N = ({ name: c, schema: n, inputKeyPrefix: m, arrayIndex: u }) => {
22
23
  var e;
23
24
  return (e = o.current) == null ? void 0 : e.click();
24
25
  },
25
- children: h
26
+ children: f
26
27
  }
27
28
  ),
28
29
  /* @__PURE__ */ a(
@@ -30,7 +31,7 @@ const N = ({ name: c, schema: n, inputKeyPrefix: m, arrayIndex: u }) => {
30
31
  {
31
32
  type: "file",
32
33
  "data-testid": `${c ?? "file"}-input`,
33
- onChange: g,
34
+ onChange: h,
34
35
  ref: o,
35
36
  className: "mint:hidden"
36
37
  }
@@ -38,5 +39,5 @@ const N = ({ name: c, schema: n, inputKeyPrefix: m, arrayIndex: u }) => {
38
39
  ] });
39
40
  };
40
41
  export {
41
- N as FileInput
42
+ R as FileInput
42
43
  };
@@ -1,45 +1,46 @@
1
- import { jsxs as e, Fragment as l, jsx as i } from "react/jsx-runtime";
2
- import { useState as N } from "react";
3
- import { isEnum as g } from "../../../schemaGraph/utils.js";
4
- import { ArrayCount as $ } from "../../../../api-playground/ApiPlayground/components/ArrayCount.js";
5
- import { ObjectExpandButton as O } from "../../../../api-playground/ApiPlayground/components/ObjectExpandButton.js";
6
- import { TrashButton as P } from "../../../../api-playground/ApiPlayground/components/TrashButton.js";
7
- import { Description as x } from "../../../../api-playground/EndpointFields/components/Description.js";
8
- import { InfoPill as T, RequiredPill as q, DeprecatedPill as A } from "../../../../components/Api/Param.js";
9
- import { containsMarkdownTable as B } from "../../../../utils/containsMarkdownTable.js";
1
+ import { jsxs as e, Fragment as s, jsx as t } from "react/jsx-runtime";
2
+ import { useState as O } from "react";
3
+ import { isEnum as T } from "../../../schemaGraph/utils.js";
4
+ import { ArrayCount as A } from "../../../../api-playground/ApiPlayground/components/ArrayCount.js";
5
+ import { ObjectExpandButton as P } from "../../../../api-playground/ApiPlayground/components/ObjectExpandButton.js";
6
+ import { TrashIcon as S } from "lucide-react";
7
+ import { Description as h } from "../../../../api-playground/EndpointFields/components/Description.js";
8
+ import { InfoPill as $, RequiredPill as q, DeprecatedPill as B } from "../../../../components/Api/Param.js";
9
+ import { useSelectedLocale as L } from "../../../../utils/locales/index.js";
10
+ import { containsMarkdownTable as R } from "../../../../utils/containsMarkdownTable.js";
10
11
  import { cn as m } from "../../../../utils/cn.js";
11
- const J = ({
12
- name: d,
13
- schema: t,
14
- defaultExpanded: a = !0,
15
- typeDropdown: p,
16
- arrayIndex: o,
12
+ const W = ({
13
+ name: o,
14
+ schema: i,
15
+ defaultExpanded: d = !0,
16
+ typeDropdown: x,
17
+ arrayIndices: l,
17
18
  parentNames: n,
18
- clearValue: y,
19
+ clearValue: p,
19
20
  style: b,
20
- explode: v,
21
- children: u
21
+ explode: u,
22
+ children: k,
23
+ isArrayChild: v
22
24
  }) => {
23
- const [s, k] = N(a), f = g(t) && t.description && B(t.description), h = t.format && typeof t.format == "string" ? `${t.type}<${t.format}>` : g(t) ? `enum<${t.type}>` : t.type, c = t.type === "array", r = t.type === "object", w = r ? Object.keys(t.properties ?? {}).length : 0;
24
- return /* @__PURE__ */ e(l, { children: [
25
+ const [c, w] = O(d), g = T(i) && i.description && R(i.description), y = i.type === "array", r = i.type === "object", j = r ? Object.keys(i.properties ?? {}).length : 0, f = l && l.length > 0 ? l[l.length - 1] : void 0, a = f != null && v;
26
+ return /* @__PURE__ */ e(s, { children: [
25
27
  /* @__PURE__ */ e(
26
28
  "div",
27
29
  {
28
30
  className: m(
29
31
  "mint:flex mint:space-x-3 mint:items-start",
30
- o != null && !r && "mint:flex mint:items-center"
32
+ a && !r && "mint:flex mint:items-center"
31
33
  ),
32
34
  children: [
33
- o != null && /* @__PURE__ */ i($, { className: m(r && "mint:mt-8"), children: o + 1 }),
35
+ a && /* @__PURE__ */ t(A, { className: m(r && "mint:mt-8"), children: f + 1 }),
34
36
  /* @__PURE__ */ e(
35
37
  "div",
36
38
  {
37
39
  className: m(
38
- "mint:flex-1 mint:lg:grid-cols-2 mint:gap-x-12 mint:gap-y-4 mint:py-5 mint:max-w-full",
39
- !c && !r && "mint:grid",
40
- c && "mint:flex mint:flex-col",
40
+ "mint:flex-1 mint:grid mint:lg:grid-cols-2 mint:gap-x-12 mint:gap-y-4 mint:py-5 mint:max-w-full",
41
+ y && "mint:flex mint:flex-col",
41
42
  r && "mint:gap-y-0 mint:flex mint:flex-col mint:border mint:border-gray-50 mint:dark:border-white/5 mint:rounded-xl mint:px-4 mint:py-0 mint:my-5",
42
- o !== void 0 && "mint:py-1 mint:my-2"
43
+ a && "mint:py-1 mint:my-2"
43
44
  ),
44
45
  children: [
45
46
  /* @__PURE__ */ e(
@@ -48,8 +49,8 @@ const J = ({
48
49
  className: m(
49
50
  "mint:space-y-2",
50
51
  r && "mint:py-5 mint:border-b mint:border-gray-50 mint:dark:border-white/5",
51
- !s && "mint:border-none",
52
- o != null && !r && "mint:flex mint:items-center"
52
+ !c && "mint:border-none",
53
+ a && !r && "mint:flex mint:items-center"
53
54
  ),
54
55
  children: [
55
56
  /* @__PURE__ */ e("div", { className: "mint:flex mint:items-center mint:justify-between mint:font-mono mint:font-bold", children: [
@@ -57,70 +58,88 @@ const J = ({
57
58
  "div",
58
59
  {
59
60
  className: "mint:flex mint:flex-wrap mint:items-center mint:gap-2 mint:text-xs mint:truncate",
60
- title: n && n.length > 0 ? `${n.join(".")}.${d}` : d,
61
+ title: n && n.length > 0 ? `${n.join(".")}.${o}` : o,
61
62
  children: [
62
- /* @__PURE__ */ i("div", { className: m("mint:text-sm mint:truncate", d == null && "mint:hidden"), children: n && n.length > 0 && b === "deepObject" && v ? /* @__PURE__ */ e(l, { children: [
63
- /* @__PURE__ */ i("span", { className: "mint:text-gray-500 mint:dark:text-gray-400", children: n.map((j, C) => /* @__PURE__ */ e(l, { children: [
64
- j,
65
- C === 0 ? "[" : "]["
63
+ /* @__PURE__ */ t("div", { className: m("mint:text-sm mint:truncate", o == null && "mint:hidden"), children: n && n.length > 0 && b === "deepObject" && u ? /* @__PURE__ */ e(s, { children: [
64
+ /* @__PURE__ */ t("span", { className: "mint:text-gray-500 mint:dark:text-gray-400", children: n.map((C, N) => /* @__PURE__ */ e(s, { children: [
65
+ C,
66
+ N === 0 ? "[" : "]["
66
67
  ] })) }),
67
- /* @__PURE__ */ i("span", { className: "mint:font-semibold mint:text-gray-900 mint:dark:text-gray-100", children: d }),
68
- /* @__PURE__ */ i("span", { className: "mint:text-gray-500 mint:dark:text-gray-400", children: "]" })
69
- ] }) : /* @__PURE__ */ e(l, { children: [
70
- /* @__PURE__ */ i("span", { className: "mint:text-gray-500 mint:dark:text-gray-400", children: n ? `${n.join(".")}.` : "" }),
71
- /* @__PURE__ */ i("span", { className: "mint:font-semibold mint:text-gray-900 mint:dark:text-gray-100", children: d })
68
+ /* @__PURE__ */ t("span", { className: "mint:font-semibold mint:text-gray-900 mint:dark:text-gray-100", children: o }),
69
+ /* @__PURE__ */ t("span", { className: "mint:text-gray-500 mint:dark:text-gray-400", children: "]" })
70
+ ] }) : /* @__PURE__ */ e(s, { children: [
71
+ /* @__PURE__ */ t("span", { className: "mint:text-gray-500 mint:dark:text-gray-400", children: n ? `${n.join(".")}.` : "" }),
72
+ /* @__PURE__ */ t("span", { className: "mint:font-semibold mint:text-gray-900 mint:dark:text-gray-100", children: o })
72
73
  ] }) }),
73
- p ?? /* @__PURE__ */ i(T, { children: h }),
74
- t.isRequired && /* @__PURE__ */ i(q, {}),
75
- t.deprecated && /* @__PURE__ */ i(A, {})
74
+ x ?? /* @__PURE__ */ t($, { className: "mint:text-wrap", children: i.typeLabel }),
75
+ i.isRequired && /* @__PURE__ */ t(q, {}),
76
+ i.deprecated && /* @__PURE__ */ t(B, {})
76
77
  ]
77
78
  }
78
79
  ),
79
- r && /* @__PURE__ */ i(
80
- O,
80
+ r && /* @__PURE__ */ t(
81
+ P,
81
82
  {
82
- onClick: () => k(!s),
83
- count: w,
84
- labeled: a == !1
83
+ onClick: () => w(!c),
84
+ count: j,
85
+ labeled: d == !1
85
86
  }
86
87
  )
87
88
  ] }),
88
- t.description && !f && /* @__PURE__ */ i(
89
- x,
89
+ i.description && !g && /* @__PURE__ */ t(
90
+ h,
90
91
  {
91
- markdown: t.description,
92
+ markdown: i.description,
92
93
  className: "mint:text-gray-500 mint:dark:text-gray-400"
93
94
  }
94
95
  )
95
96
  ]
96
97
  }
97
98
  ),
98
- s && /* @__PURE__ */ i(
99
+ c && /* @__PURE__ */ t(
99
100
  "div",
100
101
  {
101
102
  className: m(
102
103
  "mint:grid mint:grid-cols-1 mint:w-full mint:items-start mint:divide-y mint:divide-gray-50 mint:dark:divide-white/5",
103
- c && "mint:divide-y-0"
104
+ y && "mint:divide-y-0"
104
105
  ),
105
- children: u
106
+ children: k
106
107
  }
107
108
  )
108
109
  ]
109
110
  }
110
111
  ),
111
- (o != null || n) && y && /* @__PURE__ */ i(
112
- P,
112
+ (l != null && l.length > 0 || n) && p && /* @__PURE__ */ t(
113
+ D,
113
114
  {
114
115
  className: m(r && "mint:mt-8", n && "mint:mt-7"),
115
- onClick: () => y()
116
+ onClick: () => p()
116
117
  }
117
118
  )
118
119
  ]
119
120
  }
120
121
  ),
121
- t.description && f && /* @__PURE__ */ i(x, { markdown: t.description, className: "mint:text-gray-500 mint:dark:text-gray-400" })
122
+ i.description && g && /* @__PURE__ */ t(h, { markdown: i.description, className: "mint:text-gray-500 mint:dark:text-gray-400" })
122
123
  ] });
124
+ }, D = ({
125
+ className: o,
126
+ onClick: i
127
+ }) => {
128
+ const d = L();
129
+ return /* @__PURE__ */ t(
130
+ "button",
131
+ {
132
+ className: m(
133
+ "mint:px-1 mint:text-gray-400 mint:dark:text-gray-600 mint:hover:text-gray-600 mint:dark:hover:text-gray-400",
134
+ o
135
+ ),
136
+ onClick: i,
137
+ "aria-label": d["aria.deleteItem"],
138
+ children: /* @__PURE__ */ t(S, { className: "mint:w-4 mint:h-4" })
139
+ }
140
+ );
123
141
  };
124
142
  export {
125
- J as InputContainer
143
+ W as InputContainer,
144
+ D as InputContainerTrashButton
126
145
  };
@@ -1,7 +1,8 @@
1
1
  import { jsx as y } from "react/jsx-runtime";
2
- import { isInteger as b, isNumber as N } from "../../../../common/guards.js";
3
- import { usePlaygroundInputsStore as h } from "../../../hooks/usePlaygroundInputsStore.js";
4
- import { getSchemaPlaceholder as P, getUniqueInputKey as S } from "../../../schemaGraph/utils.js";
2
+ import { isInteger as I, isNumber as b } from "../../../../common/guards.js";
3
+ import { usePlaygroundInput as N } from "../../../hooks/usePlaygroundInputsStore.js";
4
+ import { getUniqueInputKey as h } from "../../../schemaGraph/addUniqueKeysToSchema.js";
5
+ import { getSchemaPlaceholder as P } from "../../../schemaGraph/utils.js";
5
6
  import { useSelectedLocale as v } from "../../../../utils/locales/index.js";
6
7
  import { Ids as x } from "../../../types/index.js";
7
8
  const A = ({
@@ -9,9 +10,9 @@ const A = ({
9
10
  schema: n,
10
11
  inputKeyPrefix: l,
11
12
  numberType: s,
12
- arrayIndex: p
13
+ arrayIndices: m
13
14
  }) => {
14
- const m = v(), { getInput: c, setInput: o } = h(), u = P(n), r = S(l, n, p), g = c(r), f = u ?? `enter ${a ?? "value"}`, i = n.type, d = ((e, t) => e === "integer" ? b(t) ? t : void 0 : N(t) ? t : void 0)(s, g), I = (e) => {
15
+ const p = v(), u = P(n), r = h(l, n, m), { value: c, setInput: o } = N(r), g = u ?? `enter ${a ?? "value"}`, i = n.type, f = ((e, t) => e === "integer" ? I(t) ? t : void 0 : b(t) ? t : void 0)(s, c), d = (e) => {
15
16
  if (e.target.value.length === 0) {
16
17
  o(r, void 0);
17
18
  return;
@@ -29,14 +30,14 @@ const A = ({
29
30
  {
30
31
  id: x.APIPlaygroundInput,
31
32
  className: "mint:flex-1 mint:min-w-0 mint:bg-transparent mint:outline-0 mint:text-playground-input",
32
- placeholder: f,
33
- "aria-label": u ?? m["aria.enterValue"].replace("{name}", a ?? "value"),
33
+ placeholder: g,
34
+ "aria-label": u ?? p["aria.enterValue"].replace("{name}", a ?? "value"),
34
35
  onKeyDown: (e) => {
35
36
  (e.key === "e" || e.key === "." && i === "integer") && e.preventDefault();
36
37
  },
37
38
  type: "number",
38
- value: d ?? "",
39
- onChange: I
39
+ value: f ?? "",
40
+ onChange: d
40
41
  }
41
42
  );
42
43
  };