@stainless-api/docs-ui 0.1.0-beta.74 → 0.1.0-beta.76
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/dist/components/breadcrumbs.d.ts +1 -1
- package/dist/components/icons.d.ts +6 -1
- package/dist/components/icons.js +57 -1
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +3 -2
- package/dist/components/overview.d.ts +1 -1
- package/dist/components/sdk-sidebar.d.ts +1 -1
- package/dist/components/sdk.d.ts +4 -2
- package/dist/components/sdk.js +91 -17
- package/dist/components/snippets.d.ts +1 -1
- package/dist/contexts/docs.d.ts +1 -1
- package/dist/{index-PdnFhQF9.d.ts → index-Cl6Gny0o.d.ts} +37 -2
- package/dist/languages/cli.d.ts +1 -1
- package/dist/languages/csharp.d.ts +1 -1
- package/dist/languages/go.d.ts +1 -1
- package/dist/languages/http.d.ts +1 -1
- package/dist/languages/index.d.ts +4 -3
- package/dist/languages/index.js +3 -1
- package/dist/languages/java.d.ts +1 -1
- package/dist/languages/php.d.ts +40 -0
- package/dist/languages/php.js +313 -0
- package/dist/languages/python.d.ts +1 -1
- package/dist/languages/ruby.d.ts +1 -1
- package/dist/languages/terraform.d.ts +1 -1
- package/dist/languages/typescript.d.ts +1 -1
- package/dist/markdown/index.d.ts +1 -1
- package/dist/markdown/printer.d.ts +1 -1
- package/dist/markdown/utils.d.ts +1 -1
- package/dist/routing.d.ts +1 -1
- package/dist/routing.js +1 -0
- package/dist/spec.d.ts +3 -3
- package/dist/styles/sidebar.css +9 -0
- package/dist/styles.css +9 -0
- package/dist/utils.d.ts +1 -1
- package/package.json +3 -3
|
@@ -56,5 +56,10 @@ declare function CLIIcon({
|
|
|
56
56
|
}: {
|
|
57
57
|
className?: string;
|
|
58
58
|
}): react_jsx_runtime0.JSX.Element;
|
|
59
|
+
declare function PHPIcon({
|
|
60
|
+
className
|
|
61
|
+
}: {
|
|
62
|
+
className?: string;
|
|
63
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
59
64
|
//#endregion
|
|
60
|
-
export { CLIIcon, CSharpIcon, CurlIcon, GoIcon, JavaIcon, KotlinIcon, PowershellIcon, PythonIcon, RubyIcon, TerraformIcon, TypescriptIcon };
|
|
65
|
+
export { CLIIcon, CSharpIcon, CurlIcon, GoIcon, JavaIcon, KotlinIcon, PHPIcon, PowershellIcon, PythonIcon, RubyIcon, TerraformIcon, TypescriptIcon };
|
package/dist/components/icons.js
CHANGED
|
@@ -880,6 +880,62 @@ function CLIIcon({ className }) {
|
|
|
880
880
|
})
|
|
881
881
|
});
|
|
882
882
|
}
|
|
883
|
+
function PHPIcon({ className }) {
|
|
884
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
885
|
+
className,
|
|
886
|
+
viewBox: "0 0 128 128",
|
|
887
|
+
width: "24",
|
|
888
|
+
height: "24",
|
|
889
|
+
children: [
|
|
890
|
+
/* @__PURE__ */ jsx("path", {
|
|
891
|
+
fill: "url(#a)",
|
|
892
|
+
d: "M0 64c0 18.593 28.654 33.667 64 33.667 35.346 0 64-15.074 64-33.667 0-18.593-28.655-33.667-64-33.667C28.654 30.333 0 45.407 0 64Z"
|
|
893
|
+
}),
|
|
894
|
+
/* @__PURE__ */ jsx("path", {
|
|
895
|
+
fill: "#777bb3",
|
|
896
|
+
d: "M64 95.167c33.965 0 61.5-13.955 61.5-31.167 0-17.214-27.535-31.167-61.5-31.167S2.5 46.786 2.5 64c0 17.212 27.535 31.167 61.5 31.167Z"
|
|
897
|
+
}),
|
|
898
|
+
/* @__PURE__ */ jsx("path", { d: "M34.772 67.864c2.793 0 4.877-.515 6.196-1.53 1.306-1.006 2.207-2.747 2.68-5.175.44-2.27.272-3.854-.5-4.71-.788-.874-2.493-1.317-5.067-1.317h-4.464l-2.473 12.732zM20.173 83.547a.694.694 0 0 1-.68-.828l6.557-33.738a.695.695 0 0 1 .68-.561h14.134c4.442 0 7.748 1.206 9.827 3.585 2.088 2.39 2.734 5.734 1.917 9.935-.333 1.711-.905 3.3-1.7 4.724a15.818 15.818 0 0 1-3.128 3.92c-1.531 1.432-3.264 2.472-5.147 3.083-1.852.604-4.232.91-7.07.91h-5.724l-1.634 8.408a.695.695 0 0 1-.682.562z" }),
|
|
899
|
+
/* @__PURE__ */ jsx("path", {
|
|
900
|
+
fill: "#fff",
|
|
901
|
+
d: "M34.19 55.826h3.891c3.107 0 4.186.682 4.553 1.089.607.674.723 2.097.331 4.112-.439 2.257-1.253 3.858-2.42 4.756-1.194.92-3.138 1.386-5.773 1.386h-2.786l2.205-11.342zm6.674-8.1H26.731a1.39 1.39 0 0 0-1.364 1.123L18.81 82.588a1.39 1.39 0 0 0 1.363 1.653h7.35a1.39 1.39 0 0 0 1.363-1.124l1.525-7.846h5.151c2.912 0 5.364-.318 7.287-.944 1.977-.642 3.796-1.731 5.406-3.237a16.522 16.522 0 0 0 3.259-4.087c.831-1.487 1.429-3.147 1.775-4.931.86-4.423.161-7.964-2.076-10.524-2.216-2.537-5.698-3.823-10.349-3.823zM30.301 68.557h4.471c2.963 0 5.17-.557 6.62-1.675 1.451-1.116 2.428-2.98 2.938-5.591.485-2.508.264-4.277-.665-5.308-.931-1.03-2.791-1.546-5.584-1.546h-5.036l-2.743 14.12m10.563-19.445c4.252 0 7.353 1.117 9.303 3.348 1.95 2.232 2.536 5.347 1.76 9.346-.322 1.648-.863 3.154-1.625 4.518-.764 1.366-1.76 2.614-2.991 3.747-1.468 1.373-3.097 2.352-4.892 2.935-1.794.584-4.08.875-6.857.875h-6.296l-1.743 8.97h-7.35l6.558-33.739h14.133"
|
|
902
|
+
}),
|
|
903
|
+
/* @__PURE__ */ jsx("path", { d: "M69.459 74.577a.694.694 0 0 1-.682-.827l2.9-14.928c.277-1.42.209-2.438-.19-2.87-.245-.263-.979-.704-3.15-.704h-5.256l-3.646 18.768a.695.695 0 0 1-.683.56h-7.29a.695.695 0 0 1-.683-.826l6.558-33.739a.695.695 0 0 1 .682-.561h7.29a.695.695 0 0 1 .683.826L64.41 48.42h5.653c4.307 0 7.227.758 8.928 2.321 1.733 1.593 2.275 4.14 1.608 7.573l-3.051 15.702a.695.695 0 0 1-.682.56h-7.407z" }),
|
|
904
|
+
/* @__PURE__ */ jsx("path", {
|
|
905
|
+
fill: "#fff",
|
|
906
|
+
d: "M65.31 38.755h-7.291a1.39 1.39 0 0 0-1.364 1.124l-6.557 33.738a1.39 1.39 0 0 0 1.363 1.654h7.291a1.39 1.39 0 0 0 1.364-1.124l3.537-18.205h4.682c2.168 0 2.624.463 2.641.484.132.14.305.795.019 2.264l-2.9 14.927a1.39 1.39 0 0 0 1.364 1.654h7.408a1.39 1.39 0 0 0 1.363-1.124l3.051-15.7c.715-3.686.103-6.45-1.82-8.217-1.836-1.686-4.91-2.505-9.398-2.505h-4.81l1.421-7.315a1.39 1.39 0 0 0-1.364-1.655zm0 1.39-1.743 8.968h6.496c4.087 0 6.907.714 8.457 2.14 1.553 1.426 2.017 3.735 1.398 6.93l-3.052 15.699h-7.407l2.901-14.928c.33-1.698.208-2.856-.365-3.474-.573-.617-1.793-.926-3.658-.926h-5.829l-3.756 19.327H51.46l6.558-33.739h7.292z"
|
|
907
|
+
}),
|
|
908
|
+
/* @__PURE__ */ jsx("path", { d: "M92.136 67.864c2.793 0 4.878-.515 6.198-1.53 1.304-1.006 2.206-2.747 2.679-5.175.44-2.27.273-3.854-.5-4.71-.788-.874-2.493-1.317-5.067-1.317h-4.463l-2.475 12.732zM77.54 83.547a.694.694 0 0 1-.682-.828l6.557-33.738a.695.695 0 0 1 .682-.561H98.23c4.442 0 7.748 1.206 9.826 3.585 2.089 2.39 2.734 5.734 1.917 9.935a15.878 15.878 0 0 1-1.699 4.724 15.838 15.838 0 0 1-3.128 3.92c-1.53 1.432-3.265 2.472-5.147 3.083-1.852.604-4.232.91-7.071.91h-5.723l-1.633 8.408a.695.695 0 0 1-.683.562z" }),
|
|
909
|
+
/* @__PURE__ */ jsx("path", {
|
|
910
|
+
fill: "#fff",
|
|
911
|
+
d: "M91.555 55.826h3.891c3.107 0 4.186.682 4.552 1.089.61.674.724 2.097.333 4.112-.44 2.257-1.254 3.858-2.421 4.756-1.195.92-3.139 1.386-5.773 1.386h-2.786l2.204-11.342zm6.674-8.1H84.096a1.39 1.39 0 0 0-1.363 1.123l-6.558 33.739a1.39 1.39 0 0 0 1.364 1.653h7.35a1.39 1.39 0 0 0 1.363-1.124l1.525-7.846h5.15c2.911 0 5.364-.318 7.286-.944 1.978-.642 3.797-1.731 5.408-3.238a16.52 16.52 0 0 0 3.258-4.086c.832-1.487 1.428-3.147 1.775-4.931.86-4.423.162-7.964-2.076-10.524-2.216-2.537-5.697-3.823-10.35-3.823zM87.666 68.557h4.47c2.964 0 5.17-.557 6.622-1.675 1.45-1.116 2.428-2.98 2.936-5.591.487-2.508.266-4.277-.665-5.308-.93-1.03-2.791-1.546-5.583-1.546h-5.035Zm10.563-19.445c4.251 0 7.354 1.117 9.303 3.348 1.95 2.232 2.537 5.347 1.759 9.346-.32 1.648-.862 3.154-1.624 4.518-.763 1.366-1.76 2.614-2.992 3.747-1.467 1.373-3.097 2.352-4.892 2.935-1.793.584-4.078.875-6.856.875h-6.295l-1.745 8.97h-7.35l6.558-33.739h14.133"
|
|
912
|
+
}),
|
|
913
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("radialGradient", {
|
|
914
|
+
id: "a",
|
|
915
|
+
cx: "0",
|
|
916
|
+
cy: "0",
|
|
917
|
+
r: "1",
|
|
918
|
+
gradientTransform: "matrix(84.04136 0 0 84.04136 38.426 42.169)",
|
|
919
|
+
gradientUnits: "userSpaceOnUse",
|
|
920
|
+
children: [
|
|
921
|
+
/* @__PURE__ */ jsx("stop", { stopColor: "#AEB2D5" }),
|
|
922
|
+
/* @__PURE__ */ jsx("stop", {
|
|
923
|
+
offset: ".3",
|
|
924
|
+
"stop-color": "#AEB2D5"
|
|
925
|
+
}),
|
|
926
|
+
/* @__PURE__ */ jsx("stop", {
|
|
927
|
+
offset: ".75",
|
|
928
|
+
"stop-color": "#484C89"
|
|
929
|
+
}),
|
|
930
|
+
/* @__PURE__ */ jsx("stop", {
|
|
931
|
+
offset: "1",
|
|
932
|
+
"stop-color": "#484C89"
|
|
933
|
+
})
|
|
934
|
+
]
|
|
935
|
+
}) })
|
|
936
|
+
]
|
|
937
|
+
});
|
|
938
|
+
}
|
|
883
939
|
|
|
884
940
|
//#endregion
|
|
885
|
-
export { CLIIcon, CSharpIcon, CurlIcon, GoIcon, JavaIcon, KotlinIcon, PowershellIcon, PythonIcon, RubyIcon, TerraformIcon, TypescriptIcon };
|
|
941
|
+
export { CLIIcon, CSharpIcon, CurlIcon, GoIcon, JavaIcon, KotlinIcon, PHPIcon, PowershellIcon, PythonIcon, RubyIcon, TerraformIcon, TypescriptIcon };
|
|
@@ -2,7 +2,7 @@ import { Badge, Expander, Input, InputProps, Join, Link, ListView, ListViewProps
|
|
|
2
2
|
import { SDKBreadcrumbs, generateApiBreadcrumbs } from "./breadcrumbs.js";
|
|
3
3
|
import { Method, MethodDescription, MethodDescriptionProps, MethodHeader, MethodHeaderProps, MethodInfo, MethodInfoProps, MethodProps, MethodRoute, MethodRouteProps } from "./method.js";
|
|
4
4
|
import { Property, PropertyDescription, PropertyDescriptionProps, PropertyProps, PropertyTitle, PropertyTitleProps, PropertyToggle, PropertyToggleProps } from "./properties.js";
|
|
5
|
-
import { PropertyModelContext, PropertyModelContextType, ReferenceNestingContext, ReferenceNestingContextType, SDKChildren, SDKConstraints, SDKConstraintsProps, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKMethodProps, SDKModel, SDKModelProps, SDKReference, SDKRequestTitle, SDKRequestTitleProps, SDKSnippetLanguages, SDKSnippetLanguagesType, TransformRequestSnippetFn, usePropertyModel, useReferenceNesting, useStreamingResponse } from "./sdk.js";
|
|
5
|
+
import { DeclarationParentsContextType, PropertyModelContext, PropertyModelContextType, ReferenceNestingContext, ReferenceNestingContextType, SDKChildren, SDKConstraints, SDKConstraintsProps, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKMethodProps, SDKModel, SDKModelProps, SDKReference, SDKRequestTitle, SDKRequestTitleProps, SDKSnippetLanguages, SDKSnippetLanguagesType, TransformRequestSnippetFn, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse } from "./sdk.js";
|
|
6
6
|
import { MultiSnippets, MultiSnippetsProps, Snippet, SnippetButtons, SnippetCode, SnippetCodeProps, SnippetContainer, SnippetContainerProps, SnippetFooter, SnippetProps, SnippetRequestContainer, SnippetRequestContainerProps, SnippetResponse } from "./snippets.js";
|
|
7
7
|
import { SDKMethodSummary, SDKMethodSummaryProps, SDKOverview, SDKOverviewProps, SDKResource, SDKResourceHeader, SDKResourceProps, SDKRoot, SDKRootProps } from "./overview.js";
|
|
8
8
|
import { SDKSidebar, SDKSidebarProps } from "./sdk-sidebar.js";
|
|
@@ -10,7 +10,7 @@ import { StlSidebar, StlSidebarEntry, StlSidebarGroup, StlSidebarLink, StlSideba
|
|
|
10
10
|
|
|
11
11
|
//#region src/components/index.d.ts
|
|
12
12
|
declare namespace index_d_exports {
|
|
13
|
-
export { Badge, Expander, Input, InputProps, Join, Link, ListView, ListViewProps, Markdown, Method, MethodDescription, MethodDescriptionProps, MethodHeader, MethodHeaderProps, MethodInfo, MethodInfoProps, MethodProps, MethodRoute, MethodRouteProps, MultiSnippets, MultiSnippetsProps, Property, PropertyDescription, PropertyDescriptionProps, PropertyModelContext, PropertyModelContextType, PropertyProps, PropertyTitle, PropertyTitleProps, PropertyToggle, PropertyToggleProps, ReferenceNestingContext, ReferenceNestingContextType, SDKBreadcrumbs, SDKChildren, SDKConstraints, SDKConstraintsProps, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKMethodProps, SDKMethodSummary, SDKMethodSummaryProps, SDKModel, SDKModelProps, SDKOverview, SDKOverviewProps, SDKReference, SDKRequestTitle, SDKRequestTitleProps, SDKResource, SDKResourceHeader, SDKResourceProps, SDKRoot, SDKRootProps, SDKSidebar, SDKSidebarProps, SDKSnippetLanguages, SDKSnippetLanguagesType, Snippet, SnippetButtons, SnippetCode, SnippetCodeProps, SnippetContainer, SnippetContainerProps, SnippetFooter, SnippetProps, SnippetRequestContainer, SnippetRequestContainerProps, SnippetResponse, StlSidebar, StlSidebarEntry, StlSidebarGroup, StlSidebarLink, StlSidebarProps, StlSidebarTarget, ToggleButton, ToggleButtonProps, Tooltip, TransformRequestSnippetFn, VirtualExpander, generateApiBreadcrumbs, usePropertyModel, useReferenceNesting, useStreamingResponse };
|
|
13
|
+
export { Badge, DeclarationParentsContextType, Expander, Input, InputProps, Join, Link, ListView, ListViewProps, Markdown, Method, MethodDescription, MethodDescriptionProps, MethodHeader, MethodHeaderProps, MethodInfo, MethodInfoProps, MethodProps, MethodRoute, MethodRouteProps, MultiSnippets, MultiSnippetsProps, Property, PropertyDescription, PropertyDescriptionProps, PropertyModelContext, PropertyModelContextType, PropertyProps, PropertyTitle, PropertyTitleProps, PropertyToggle, PropertyToggleProps, ReferenceNestingContext, ReferenceNestingContextType, SDKBreadcrumbs, SDKChildren, SDKConstraints, SDKConstraintsProps, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKMethodProps, SDKMethodSummary, SDKMethodSummaryProps, SDKModel, SDKModelProps, SDKOverview, SDKOverviewProps, SDKReference, SDKRequestTitle, SDKRequestTitleProps, SDKResource, SDKResourceHeader, SDKResourceProps, SDKRoot, SDKRootProps, SDKSidebar, SDKSidebarProps, SDKSnippetLanguages, SDKSnippetLanguagesType, Snippet, SnippetButtons, SnippetCode, SnippetCodeProps, SnippetContainer, SnippetContainerProps, SnippetFooter, SnippetProps, SnippetRequestContainer, SnippetRequestContainerProps, SnippetResponse, StlSidebar, StlSidebarEntry, StlSidebarGroup, StlSidebarLink, StlSidebarProps, StlSidebarTarget, ToggleButton, ToggleButtonProps, Tooltip, TransformRequestSnippetFn, VirtualExpander, generateApiBreadcrumbs, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse };
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
16
|
-
export { Badge, Expander, Input, InputProps, Join, Link, ListView, ListViewProps, Markdown, Method, MethodDescription, MethodDescriptionProps, MethodHeader, MethodHeaderProps, MethodInfo, MethodInfoProps, MethodProps, MethodRoute, MethodRouteProps, MultiSnippets, MultiSnippetsProps, Property, PropertyDescription, PropertyDescriptionProps, PropertyModelContext, PropertyModelContextType, PropertyProps, PropertyTitle, PropertyTitleProps, PropertyToggle, PropertyToggleProps, ReferenceNestingContext, ReferenceNestingContextType, SDKBreadcrumbs, SDKChildren, SDKConstraints, SDKConstraintsProps, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKMethodProps, SDKMethodSummary, SDKMethodSummaryProps, SDKModel, SDKModelProps, SDKOverview, SDKOverviewProps, SDKReference, SDKRequestTitle, SDKRequestTitleProps, SDKResource, SDKResourceHeader, SDKResourceProps, SDKRoot, SDKRootProps, SDKSidebar, SDKSidebarProps, SDKSnippetLanguages, SDKSnippetLanguagesType, Snippet, SnippetButtons, SnippetCode, SnippetCodeProps, SnippetContainer, SnippetContainerProps, SnippetFooter, SnippetProps, SnippetRequestContainer, SnippetRequestContainerProps, SnippetResponse, StlSidebar, StlSidebarEntry, StlSidebarGroup, StlSidebarLink, StlSidebarProps, StlSidebarTarget, ToggleButton, ToggleButtonProps, Tooltip, TransformRequestSnippetFn, VirtualExpander, generateApiBreadcrumbs, index_d_exports as t, usePropertyModel, useReferenceNesting, useStreamingResponse };
|
|
16
|
+
export { Badge, DeclarationParentsContextType, Expander, Input, InputProps, Join, Link, ListView, ListViewProps, Markdown, Method, MethodDescription, MethodDescriptionProps, MethodHeader, MethodHeaderProps, MethodInfo, MethodInfoProps, MethodProps, MethodRoute, MethodRouteProps, MultiSnippets, MultiSnippetsProps, Property, PropertyDescription, PropertyDescriptionProps, PropertyModelContext, PropertyModelContextType, PropertyProps, PropertyTitle, PropertyTitleProps, PropertyToggle, PropertyToggleProps, ReferenceNestingContext, ReferenceNestingContextType, SDKBreadcrumbs, SDKChildren, SDKConstraints, SDKConstraintsProps, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKMethodProps, SDKMethodSummary, SDKMethodSummaryProps, SDKModel, SDKModelProps, SDKOverview, SDKOverviewProps, SDKReference, SDKRequestTitle, SDKRequestTitleProps, SDKResource, SDKResourceHeader, SDKResourceProps, SDKRoot, SDKRootProps, SDKSidebar, SDKSidebarProps, SDKSnippetLanguages, SDKSnippetLanguagesType, Snippet, SnippetButtons, SnippetCode, SnippetCodeProps, SnippetContainer, SnippetContainerProps, SnippetFooter, SnippetProps, SnippetRequestContainer, SnippetRequestContainerProps, SnippetResponse, StlSidebar, StlSidebarEntry, StlSidebarGroup, StlSidebarLink, StlSidebarProps, StlSidebarTarget, ToggleButton, ToggleButtonProps, Tooltip, TransformRequestSnippetFn, VirtualExpander, generateApiBreadcrumbs, index_d_exports as t, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse };
|
package/dist/components/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import "../use-strict-context-L0c8JKg4.js";
|
|
|
3
3
|
import { Property, PropertyDescription, PropertyTitle, PropertyToggle } from "./properties.js";
|
|
4
4
|
import { Method, MethodDescription, MethodHeader, MethodInfo, MethodRoute } from "./method.js";
|
|
5
5
|
import { Badge, Expander, Input, Join, Link, ListView, Markdown, ToggleButton, Tooltip, VirtualExpander } from "./primitives.js";
|
|
6
|
-
import { PropertyModelContext, ReferenceNestingContext, SDKChildren, SDKConstraints, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKModel, SDKReference, SDKRequestTitle, SDKSnippetLanguages, usePropertyModel, useReferenceNesting, useStreamingResponse } from "./sdk.js";
|
|
6
|
+
import { PropertyModelContext, ReferenceNestingContext, SDKChildren, SDKConstraints, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKModel, SDKReference, SDKRequestTitle, SDKSnippetLanguages, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse } from "./sdk.js";
|
|
7
7
|
import { MultiSnippets, Snippet, SnippetButtons, SnippetCode, SnippetContainer, SnippetFooter, SnippetRequestContainer, SnippetResponse } from "./snippets.js";
|
|
8
8
|
import { SDKMethodSummary, SDKOverview, SDKResource, SDKResourceHeader, SDKRoot } from "./overview.js";
|
|
9
9
|
import { SDKBreadcrumbs, generateApiBreadcrumbs } from "./breadcrumbs.js";
|
|
@@ -64,10 +64,11 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
64
64
|
Tooltip: () => Tooltip,
|
|
65
65
|
VirtualExpander: () => VirtualExpander,
|
|
66
66
|
generateApiBreadcrumbs: () => generateApiBreadcrumbs,
|
|
67
|
+
useDeclarationParents: () => useDeclarationParents,
|
|
67
68
|
usePropertyModel: () => usePropertyModel,
|
|
68
69
|
useReferenceNesting: () => useReferenceNesting,
|
|
69
70
|
useStreamingResponse: () => useStreamingResponse
|
|
70
71
|
});
|
|
71
72
|
|
|
72
73
|
//#endregion
|
|
73
|
-
export { Badge, Expander, Input, Join, Link, ListView, Markdown, Method, MethodDescription, MethodHeader, MethodInfo, MethodRoute, MultiSnippets, Property, PropertyDescription, PropertyModelContext, PropertyTitle, PropertyToggle, ReferenceNestingContext, SDKBreadcrumbs, SDKChildren, SDKConstraints, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKMethodSummary, SDKModel, SDKOverview, SDKReference, SDKRequestTitle, SDKResource, SDKResourceHeader, SDKRoot, SDKSidebar, SDKSnippetLanguages, Snippet, SnippetButtons, SnippetCode, SnippetContainer, SnippetFooter, SnippetRequestContainer, SnippetResponse, StlSidebar, ToggleButton, Tooltip, VirtualExpander, generateApiBreadcrumbs, components_exports as t, usePropertyModel, useReferenceNesting, useStreamingResponse };
|
|
74
|
+
export { Badge, Expander, Input, Join, Link, ListView, Markdown, Method, MethodDescription, MethodHeader, MethodInfo, MethodRoute, MultiSnippets, Property, PropertyDescription, PropertyModelContext, PropertyTitle, PropertyToggle, ReferenceNestingContext, SDKBreadcrumbs, SDKChildren, SDKConstraints, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKMethodSummary, SDKModel, SDKOverview, SDKReference, SDKRequestTitle, SDKResource, SDKResourceHeader, SDKRoot, SDKSidebar, SDKSnippetLanguages, Snippet, SnippetButtons, SnippetCode, SnippetContainer, SnippetFooter, SnippetRequestContainer, SnippetResponse, StlSidebar, ToggleButton, Tooltip, VirtualExpander, generateApiBreadcrumbs, components_exports as t, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse };
|
package/dist/components/sdk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as ID, d as Method, f as Model,
|
|
1
|
+
import { _ as SnippetLanguage, c as ID, d as Method, f as Model, o as HasStainlessPath, t as BaseDeclaration } from "../index-Cl6Gny0o.js";
|
|
2
2
|
import { DocsLanguage } from "../routing.js";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -13,6 +13,8 @@ declare function usePropertyModel(): PropertyModelContextType;
|
|
|
13
13
|
type ReferenceNestingContextType = string[];
|
|
14
14
|
declare const ReferenceNestingContext: React$1.Context<ReferenceNestingContextType>;
|
|
15
15
|
declare function useReferenceNesting(): ReferenceNestingContextType;
|
|
16
|
+
type DeclarationParentsContextType = ReadonlySet<string>;
|
|
17
|
+
declare function useDeclarationParents(): DeclarationParentsContextType;
|
|
16
18
|
type SDKSnippetLanguagesType = Record<SnippetLanguage, {
|
|
17
19
|
name: string;
|
|
18
20
|
}>;
|
|
@@ -119,4 +121,4 @@ declare function SDKLanguageBlock({
|
|
|
119
121
|
links
|
|
120
122
|
}: SDKLanguageBlockProps): react_jsx_runtime0.JSX.Element;
|
|
121
123
|
//#endregion
|
|
122
|
-
export { PropertyModelContext, PropertyModelContextType, ReferenceNestingContext, ReferenceNestingContextType, SDKChildren, SDKConstraints, SDKConstraintsProps, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKMethodProps, SDKModel, SDKModelProps, SDKReference, SDKRequestTitle, SDKRequestTitleProps, SDKSnippetLanguages, SDKSnippetLanguagesType, TransformRequestSnippetFn, usePropertyModel, useReferenceNesting, useStreamingResponse };
|
|
124
|
+
export { DeclarationParentsContextType, PropertyModelContext, PropertyModelContextType, ReferenceNestingContext, ReferenceNestingContextType, SDKChildren, SDKConstraints, SDKConstraintsProps, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKMethodProps, SDKModel, SDKModelProps, SDKReference, SDKRequestTitle, SDKRequestTitleProps, SDKSnippetLanguages, SDKSnippetLanguagesType, TransformRequestSnippetFn, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse };
|
package/dist/components/sdk.js
CHANGED
|
@@ -5,7 +5,7 @@ import { useLanguageComponents } from "../contexts/index.js";
|
|
|
5
5
|
import { useComponents } from "../contexts/use-components.js";
|
|
6
6
|
import style_default from "../style.js";
|
|
7
7
|
import { LanguageNames, generateRoute, getLanguageSnippet, parseStainlessPath } from "../routing.js";
|
|
8
|
-
import { CLIIcon, CSharpIcon, CurlIcon, GoIcon, JavaIcon, KotlinIcon, PowershellIcon, PythonIcon, RubyIcon, TerraformIcon, TypescriptIcon } from "./icons.js";
|
|
8
|
+
import { CLIIcon, CSharpIcon, CurlIcon, GoIcon, JavaIcon, KotlinIcon, PHPIcon, PowershellIcon, PythonIcon, RubyIcon, TerraformIcon, TypescriptIcon } from "./icons.js";
|
|
9
9
|
import * as React$1 from "react";
|
|
10
10
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import clsx from "clsx";
|
|
@@ -21,6 +21,14 @@ const ReferenceNestingContext = React$1.createContext([]);
|
|
|
21
21
|
function useReferenceNesting() {
|
|
22
22
|
return React$1.useContext(ReferenceNestingContext);
|
|
23
23
|
}
|
|
24
|
+
const DeclarationParentsContext = React$1.createContext(/* @__PURE__ */ new Set());
|
|
25
|
+
const AddToDeclarationParents = ({ id, children }) => /* @__PURE__ */ jsx(DeclarationParentsContext, {
|
|
26
|
+
value: new Set([...useDeclarationParents(), id.replace(/(?<=> \(schema\))((?!> \(schema\) > ).)+$/, "")]),
|
|
27
|
+
children
|
|
28
|
+
});
|
|
29
|
+
function useDeclarationParents() {
|
|
30
|
+
return React$1.useContext(DeclarationParentsContext);
|
|
31
|
+
}
|
|
24
32
|
const SDKSnippetLanguages = {
|
|
25
33
|
"node.default": { name: "TypeScript" },
|
|
26
34
|
"typescript.default": { name: "TypeScript" },
|
|
@@ -78,19 +86,78 @@ function normalizeDeclaration(raw, http) {
|
|
|
78
86
|
function SDKDeclaration({ path, expand, depth = 0 }) {
|
|
79
87
|
const Lang = useLanguageComponents();
|
|
80
88
|
const Docs = useComponents();
|
|
81
|
-
|
|
89
|
+
let pendingDecl = normalizeDeclaration(useDeclaration(path, true), useDeclaration(path.replace(/ > \(schema\)$/, "") + " > (schema)", false, "http"));
|
|
82
90
|
const settings = useSettings();
|
|
83
91
|
const model = usePropertyModel();
|
|
84
92
|
const nesting = useReferenceNesting();
|
|
85
|
-
const { selectedPath } = useNavigation();
|
|
93
|
+
const { selectedPath, basePath } = useNavigation();
|
|
94
|
+
const parents = useDeclarationParents();
|
|
95
|
+
const language = useLanguage();
|
|
96
|
+
if (parents.has(path)) if (pendingDecl.kind === "GoDeclType") pendingDecl = {
|
|
97
|
+
...pendingDecl,
|
|
98
|
+
kind: "GoDeclType",
|
|
99
|
+
type: {
|
|
100
|
+
kind: "GoTypeReference",
|
|
101
|
+
typeName: pendingDecl.ident,
|
|
102
|
+
$ref: pendingDecl.stainlessPath
|
|
103
|
+
},
|
|
104
|
+
children: []
|
|
105
|
+
};
|
|
106
|
+
else if (pendingDecl.kind === "HttpDeclTypeAlias") pendingDecl = {
|
|
107
|
+
...pendingDecl,
|
|
108
|
+
kind: "HttpDeclTypeAlias",
|
|
109
|
+
children: []
|
|
110
|
+
};
|
|
111
|
+
else if (pendingDecl.kind === "PythonDeclClass") pendingDecl = {
|
|
112
|
+
kind: "PythonDeclType",
|
|
113
|
+
ident: pendingDecl.ident,
|
|
114
|
+
stainlessPath: pendingDecl.stainlessPath,
|
|
115
|
+
type: {
|
|
116
|
+
kind: "PythonTypeReference",
|
|
117
|
+
typeName: pendingDecl.ident,
|
|
118
|
+
$ref: pendingDecl.stainlessPath
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
else if (pendingDecl.kind === "TSDeclInterface") pendingDecl = {
|
|
122
|
+
kind: "TSDeclTypeAlias",
|
|
123
|
+
ident: pendingDecl.ident,
|
|
124
|
+
stainlessPath: pendingDecl.stainlessPath,
|
|
125
|
+
type: {
|
|
126
|
+
kind: "TSTypeReference",
|
|
127
|
+
ident: pendingDecl.ident,
|
|
128
|
+
$ref: pendingDecl.stainlessPath
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
else if ("ident" in pendingDecl) {
|
|
132
|
+
const ident = pendingDecl.ident;
|
|
133
|
+
const url = generateRoute(basePath ?? "/", language, pendingDecl.stainlessPath);
|
|
134
|
+
return /* @__PURE__ */ jsx("span", {
|
|
135
|
+
className: style_default.Type,
|
|
136
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
137
|
+
className: style_default.TypeReference,
|
|
138
|
+
children: url ? /* @__PURE__ */ jsx("a", {
|
|
139
|
+
href: url,
|
|
140
|
+
children: ident
|
|
141
|
+
}) : ident
|
|
142
|
+
})
|
|
143
|
+
});
|
|
144
|
+
} else throw new Error("Infinite recursion in SDKDeclaration: " + JSON.stringify({
|
|
145
|
+
parents: [...parents],
|
|
146
|
+
path,
|
|
147
|
+
pendingDecl
|
|
148
|
+
}));
|
|
149
|
+
const decl = pendingDecl;
|
|
86
150
|
if (decl.kind.endsWith("Reference")) {
|
|
87
151
|
const refId = "type" in decl && decl.type !== void 0 && typeof decl.type !== "string" && "$ref" in decl.type ? decl.type["$ref"] : void 0;
|
|
88
|
-
if (refId && refId !== path && !nesting.includes(refId)) return /* @__PURE__ */ jsx(
|
|
89
|
-
|
|
90
|
-
children: /* @__PURE__ */ jsx(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
152
|
+
if (refId && refId !== path && !nesting.includes(refId)) return /* @__PURE__ */ jsx(AddToDeclarationParents, {
|
|
153
|
+
id: path,
|
|
154
|
+
children: /* @__PURE__ */ jsx(ReferenceNestingContext.Provider, {
|
|
155
|
+
value: [...nesting, refId],
|
|
156
|
+
children: /* @__PURE__ */ jsx(SDKDeclaration, {
|
|
157
|
+
path: refId,
|
|
158
|
+
expand,
|
|
159
|
+
depth
|
|
160
|
+
})
|
|
94
161
|
})
|
|
95
162
|
});
|
|
96
163
|
}
|
|
@@ -126,12 +193,18 @@ function SDKDeclaration({ path, expand, depth = 0 }) {
|
|
|
126
193
|
modelPath: decl.modelPath,
|
|
127
194
|
propertyPath: decl.stainlessPath
|
|
128
195
|
};
|
|
129
|
-
return /* @__PURE__ */ jsx(
|
|
130
|
-
|
|
131
|
-
children:
|
|
196
|
+
return /* @__PURE__ */ jsx(AddToDeclarationParents, {
|
|
197
|
+
id: path,
|
|
198
|
+
children: /* @__PURE__ */ jsx(PropertyModelContext.Provider, {
|
|
199
|
+
value,
|
|
200
|
+
children: content
|
|
201
|
+
})
|
|
132
202
|
});
|
|
133
203
|
}
|
|
134
|
-
return
|
|
204
|
+
return /* @__PURE__ */ jsx(AddToDeclarationParents, {
|
|
205
|
+
id: path,
|
|
206
|
+
children: content
|
|
207
|
+
});
|
|
135
208
|
}
|
|
136
209
|
function SDKConstraints({ constraints }) {
|
|
137
210
|
if (constraints) return /* @__PURE__ */ jsx("div", {
|
|
@@ -161,7 +234,7 @@ const snippetIcons = {
|
|
|
161
234
|
"kotlin.default": KotlinIcon,
|
|
162
235
|
"csharp.default": CSharpIcon,
|
|
163
236
|
"cli.default": CLIIcon,
|
|
164
|
-
"php.default":
|
|
237
|
+
"php.default": PHPIcon
|
|
165
238
|
};
|
|
166
239
|
function SDKIcon({ language }) {
|
|
167
240
|
const LangIcon = snippetIcons[language];
|
|
@@ -224,7 +297,8 @@ function SDKMethodInfo({ method }) {
|
|
|
224
297
|
const Docs = useComponents();
|
|
225
298
|
const Lang = useLanguageComponents();
|
|
226
299
|
const decl = useDeclaration(method.stainlessPath, true);
|
|
227
|
-
const
|
|
300
|
+
const streamingResponseID = useStreamingResponse(method);
|
|
301
|
+
const streamingResponseDecl = useDeclaration(streamingResponseID ?? "", false);
|
|
228
302
|
const spec = useSpec();
|
|
229
303
|
const language = useLanguage();
|
|
230
304
|
if (Lang.MethodInfo) return /* @__PURE__ */ jsx(Lang.MethodInfo, { decl });
|
|
@@ -236,7 +310,7 @@ function SDKMethodInfo({ method }) {
|
|
|
236
310
|
return decl && "children" in decl && decl.children && decl.children.length > 0;
|
|
237
311
|
}
|
|
238
312
|
const responseChildren = "responseChildren" in decl && decl.responseChildren && decl.responseChildren.length > 0 ? [...decl.responseChildren] : [];
|
|
239
|
-
if (
|
|
313
|
+
if (streamingResponseDecl && streamingResponseID && !responseChildren.includes(streamingResponseID)) responseChildren.push(streamingResponseID);
|
|
240
314
|
return /* @__PURE__ */ jsx(Docs.MethodInfo, {
|
|
241
315
|
parameters: "paramsChildren" in decl && Array.isArray(decl.paramsChildren) && decl.paramsChildren.length > 0 && /* @__PURE__ */ jsx(Docs.SDKChildren, {
|
|
242
316
|
expand: shouldExpand(decl.paramsChildren),
|
|
@@ -403,4 +477,4 @@ function SDKLanguageBlock({ language, version, install, links }) {
|
|
|
403
477
|
}
|
|
404
478
|
|
|
405
479
|
//#endregion
|
|
406
|
-
export { PropertyModelContext, ReferenceNestingContext, SDKChildren, SDKConstraints, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKModel, SDKReference, SDKRequestTitle, SDKSnippetLanguages, usePropertyModel, useReferenceNesting, useStreamingResponse };
|
|
480
|
+
export { PropertyModelContext, ReferenceNestingContext, SDKChildren, SDKConstraints, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodNotImplemented, SDKModel, SDKReference, SDKRequestTitle, SDKSnippetLanguages, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as Method, o as HasStainlessPath } from "../index-
|
|
1
|
+
import { d as Method, o as HasStainlessPath } from "../index-Cl6Gny0o.js";
|
|
2
2
|
import { TransformRequestSnippetFn } from "./sdk.js";
|
|
3
3
|
import { useSnippet } from "../contexts/docs.js";
|
|
4
4
|
import "../contexts/index.js";
|
package/dist/contexts/docs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as Resource, u as LanguageDeclNodes, v as Spec, y as SpecLanguage } from "../index-Cl6Gny0o.js";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -816,6 +816,12 @@ type PhpMethodParameter = {
|
|
|
816
816
|
optional: boolean;
|
|
817
817
|
hasDefault?: boolean;
|
|
818
818
|
};
|
|
819
|
+
type PhpMethodDeclParameter = BaseDeclaration & {
|
|
820
|
+
kind: 'PhpMethodDeclParameter';
|
|
821
|
+
ident: PhpIdentifier;
|
|
822
|
+
typeAnnotation: PhpType;
|
|
823
|
+
hasDefault?: boolean;
|
|
824
|
+
};
|
|
819
825
|
type PhpDeclReference = BaseDeclaration & {
|
|
820
826
|
kind: 'PhpDeclReference';
|
|
821
827
|
docstring?: string;
|
|
@@ -932,6 +938,35 @@ type PhpTypeComplexBuiltin = BaseType & {
|
|
|
932
938
|
kind: 'PhpTypeComplexBuiltin';
|
|
933
939
|
typeName: 'resource' | 'callable' | 'class-string' | 'array' | 'object';
|
|
934
940
|
};
|
|
941
|
+
type PhpAST_PhpDeclAssocArray = PhpDeclAssocArray;
|
|
942
|
+
type PhpAST_PhpDeclAssocArrayProperty = PhpDeclAssocArrayProperty;
|
|
943
|
+
type PhpAST_PhpDeclClass = PhpDeclClass;
|
|
944
|
+
type PhpAST_PhpDeclClassProperty = PhpDeclClassProperty;
|
|
945
|
+
type PhpAST_PhpDeclEnum = PhpDeclEnum;
|
|
946
|
+
type PhpAST_PhpDeclMethod = PhpDeclMethod;
|
|
947
|
+
type PhpAST_PhpDeclParam = PhpDeclParam;
|
|
948
|
+
type PhpAST_PhpDeclReference = PhpDeclReference;
|
|
949
|
+
type PhpAST_PhpDeclaration = PhpDeclaration;
|
|
950
|
+
type PhpAST_PhpMethodDeclParameter = PhpMethodDeclParameter;
|
|
951
|
+
type PhpAST_PhpMethodParameter = PhpMethodParameter;
|
|
952
|
+
type PhpAST_PhpType = PhpType;
|
|
953
|
+
type PhpAST_PhpTypeBool = PhpTypeBool;
|
|
954
|
+
type PhpAST_PhpTypeComplexBuiltin = PhpTypeComplexBuiltin;
|
|
955
|
+
type PhpAST_PhpTypeDatetime = PhpTypeDatetime;
|
|
956
|
+
type PhpAST_PhpTypeFloat = PhpTypeFloat;
|
|
957
|
+
type PhpAST_PhpTypeInt = PhpTypeInt;
|
|
958
|
+
type PhpAST_PhpTypeListArray<T extends Code = string> = PhpTypeListArray<T>;
|
|
959
|
+
type PhpAST_PhpTypeLiteral = PhpTypeLiteral;
|
|
960
|
+
type PhpAST_PhpTypeMapArray<T extends Code = string> = PhpTypeMapArray<T>;
|
|
961
|
+
type PhpAST_PhpTypeMixed = PhpTypeMixed;
|
|
962
|
+
type PhpAST_PhpTypeNull = PhpTypeNull;
|
|
963
|
+
type PhpAST_PhpTypeReference<T extends Code = string> = PhpTypeReference<T>;
|
|
964
|
+
type PhpAST_PhpTypeString = PhpTypeString;
|
|
965
|
+
type PhpAST_PhpTypeUnion<T extends Code = string> = PhpTypeUnion<T>;
|
|
966
|
+
type PhpAST_SDKJSONPhpType<T extends Code = string> = SDKJSONPhpType<T>;
|
|
967
|
+
declare namespace PhpAST {
|
|
968
|
+
export type { PhpAST_PhpDeclAssocArray as PhpDeclAssocArray, PhpAST_PhpDeclAssocArrayProperty as PhpDeclAssocArrayProperty, PhpAST_PhpDeclClass as PhpDeclClass, PhpAST_PhpDeclClassProperty as PhpDeclClassProperty, PhpAST_PhpDeclEnum as PhpDeclEnum, PhpAST_PhpDeclMethod as PhpDeclMethod, PhpAST_PhpDeclParam as PhpDeclParam, PhpAST_PhpDeclReference as PhpDeclReference, PhpAST_PhpDeclaration as PhpDeclaration, PhpAST_PhpMethodDeclParameter as PhpMethodDeclParameter, PhpAST_PhpMethodParameter as PhpMethodParameter, PhpAST_PhpType as PhpType, PhpAST_PhpTypeBool as PhpTypeBool, PhpAST_PhpTypeComplexBuiltin as PhpTypeComplexBuiltin, PhpAST_PhpTypeDatetime as PhpTypeDatetime, PhpAST_PhpTypeFloat as PhpTypeFloat, PhpAST_PhpTypeInt as PhpTypeInt, PhpAST_PhpTypeListArray as PhpTypeListArray, PhpAST_PhpTypeLiteral as PhpTypeLiteral, PhpAST_PhpTypeMapArray as PhpTypeMapArray, PhpAST_PhpTypeMixed as PhpTypeMixed, PhpAST_PhpTypeNull as PhpTypeNull, PhpAST_PhpTypeReference as PhpTypeReference, PhpAST_PhpTypeString as PhpTypeString, PhpAST_PhpTypeUnion as PhpTypeUnion, PhpAST_SDKJSONPhpType as SDKJSONPhpType };
|
|
969
|
+
}
|
|
935
970
|
type PythonDeclaration = PythonDeclFunction | PythonDeclClass | PythonDeclType | PythonDeclProperty | PythonDeclReference | ErrorDecl;
|
|
936
971
|
type PythonDeclFunction = BaseDeclaration & {
|
|
937
972
|
kind: 'PythonDeclFunction';
|
|
@@ -1468,7 +1503,7 @@ type SnippetLanguage<lang extends SpecLanguage = SpecLanguage> = (typeof Snippet
|
|
|
1468
1503
|
/**
|
|
1469
1504
|
* A literal property path from Spec down to a given node
|
|
1470
1505
|
*/
|
|
1471
|
-
type Type = HttpType | TSType | PythonType | GoType | RubyType | JavaType | CSharpType | AttributeType;
|
|
1506
|
+
type Type = HttpType | TSType | PythonType | GoType | RubyType | JavaType | CSharpType | PhpType | AttributeType;
|
|
1472
1507
|
type Spec = {
|
|
1473
1508
|
name: string;
|
|
1474
1509
|
kind: 'spec';
|
|
@@ -1734,4 +1769,4 @@ declare namespace GoAST {
|
|
|
1734
1769
|
export type { GoAST_GoDeclConst as GoDeclConst, GoAST_GoDeclFunction as GoDeclFunction, GoAST_GoDeclProperty as GoDeclProperty, GoAST_GoDeclReference as GoDeclReference, GoAST_GoDeclType as GoDeclType, GoAST_GoDeclTypeAlias as GoDeclTypeAlias, GoAST_GoDeclaration as GoDeclaration, GoAST_GoFunctionParameter as GoFunctionParameter, GoAST_GoGenericParameter as GoGenericParameter, GoAST_GoIdentifier as GoIdentifier, GoAST_GoType as GoType, GoAST_GoTypeAny as GoTypeAny, GoAST_GoTypeArray as GoTypeArray, GoAST_GoTypeBool as GoTypeBool, GoAST_GoTypeError as GoTypeError, GoAST_GoTypeFloat as GoTypeFloat, GoAST_GoTypeInt as GoTypeInt, GoAST_GoTypeInterface as GoTypeInterface, GoAST_GoTypeMap as GoTypeMap, GoAST_GoTypePointer as GoTypePointer, GoAST_GoTypeReference as GoTypeReference, GoAST_GoTypeString as GoTypeString, GoAST_GoTypeStruct as GoTypeStruct, GoAST_GoTypeUnknown as GoTypeUnknown };
|
|
1735
1770
|
}
|
|
1736
1771
|
//#endregion
|
|
1737
|
-
export {
|
|
1772
|
+
export { Type as S, SnippetLanguage as _, GoAST as a, TSAST as b, ID as c, Method as d, Model as f, RubyAST as g, Resource as h, DeclarationNode as i, JavaAST as l, PythonAST as m, CLIAST as n, HasStainlessPath as o, PhpAST as p, CSharpAST as r, HttpAST as s, BaseDeclaration as t, LanguageDeclNodes as u, Spec as v, TerraformAST as x, SpecLanguage as y };
|
package/dist/languages/cli.d.ts
CHANGED
package/dist/languages/go.d.ts
CHANGED
package/dist/languages/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as Type, h as Resource, i as DeclarationNode } from "../index-Cl6Gny0o.js";
|
|
2
2
|
import { PropertyProps } from "../components/properties.js";
|
|
3
3
|
import { t as typescript_d_exports } from "./typescript.js";
|
|
4
4
|
import { t as java_d_exports } from "./java.js";
|
|
@@ -7,6 +7,7 @@ import { t as python_d_exports } from "./python.js";
|
|
|
7
7
|
import { t as ruby_d_exports } from "./ruby.js";
|
|
8
8
|
import { t as http_d_exports } from "./http.js";
|
|
9
9
|
import { t as csharp_d_exports } from "./csharp.js";
|
|
10
|
+
import { t as php_d_exports } from "./php.js";
|
|
10
11
|
import { t as cli_d_exports } from "./cli.js";
|
|
11
12
|
import { t as terraform_d_exports } from "./terraform.js";
|
|
12
13
|
import "../components/index.js";
|
|
@@ -14,7 +15,7 @@ import { ReactNode } from "react";
|
|
|
14
15
|
|
|
15
16
|
//#region src/languages/index.d.ts
|
|
16
17
|
declare namespace index_d_exports {
|
|
17
|
-
export { LanguageComponentDefinition, PropertyFn, cli_d_exports as cli, csharp_d_exports as csharp, go_d_exports as go, http_d_exports as http, java_d_exports as java, kotlin, node, python_d_exports as python, ruby_d_exports as ruby, terraform_d_exports as terraform, typescript_d_exports as typescript };
|
|
18
|
+
export { LanguageComponentDefinition, PropertyFn, cli_d_exports as cli, csharp_d_exports as csharp, go_d_exports as go, http_d_exports as http, java_d_exports as java, kotlin, node, php_d_exports as php, python_d_exports as python, ruby_d_exports as ruby, terraform_d_exports as terraform, typescript_d_exports as typescript };
|
|
18
19
|
}
|
|
19
20
|
declare const node: typeof typescript_d_exports;
|
|
20
21
|
declare const kotlin: typeof java_d_exports;
|
|
@@ -47,4 +48,4 @@ interface LanguageComponentDefinition {
|
|
|
47
48
|
}): ReactNode;
|
|
48
49
|
}
|
|
49
50
|
//#endregion
|
|
50
|
-
export { LanguageComponentDefinition, PropertyFn, cli_d_exports as cli, csharp_d_exports as csharp, go_d_exports as go, http_d_exports as http, java_d_exports as java, kotlin, node, python_d_exports as python, ruby_d_exports as ruby, index_d_exports as t, terraform_d_exports as terraform, typescript_d_exports as typescript };
|
|
51
|
+
export { LanguageComponentDefinition, PropertyFn, cli_d_exports as cli, csharp_d_exports as csharp, go_d_exports as go, http_d_exports as http, java_d_exports as java, kotlin, node, php_d_exports as php, python_d_exports as python, ruby_d_exports as ruby, index_d_exports as t, terraform_d_exports as terraform, typescript_d_exports as typescript };
|
package/dist/languages/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { t as python_exports } from "./python.js";
|
|
|
7
7
|
import { t as ruby_exports } from "./ruby.js";
|
|
8
8
|
import { t as http_exports } from "./http.js";
|
|
9
9
|
import { t as csharp_exports } from "./csharp.js";
|
|
10
|
+
import { t as php_exports } from "./php.js";
|
|
10
11
|
import { t as cli_exports } from "./cli.js";
|
|
11
12
|
import { t as terraform_exports } from "./terraform.js";
|
|
12
13
|
|
|
@@ -19,6 +20,7 @@ var languages_exports = /* @__PURE__ */ __exportAll({
|
|
|
19
20
|
java: () => java_exports,
|
|
20
21
|
kotlin: () => kotlin,
|
|
21
22
|
node: () => node,
|
|
23
|
+
php: () => php_exports,
|
|
22
24
|
python: () => python_exports,
|
|
23
25
|
ruby: () => ruby_exports,
|
|
24
26
|
terraform: () => terraform_exports,
|
|
@@ -28,4 +30,4 @@ const node = typescript_exports;
|
|
|
28
30
|
const kotlin = java_exports;
|
|
29
31
|
|
|
30
32
|
//#endregion
|
|
31
|
-
export { cli_exports as cli, csharp_exports as csharp, go_exports as go, http_exports as http, java_exports as java, kotlin, node, python_exports as python, ruby_exports as ruby, languages_exports as t, terraform_exports as terraform, typescript_exports as typescript };
|
|
33
|
+
export { cli_exports as cli, csharp_exports as csharp, go_exports as go, http_exports as http, java_exports as java, kotlin, node, php_exports as php, python_exports as python, ruby_exports as ruby, languages_exports as t, terraform_exports as terraform, typescript_exports as typescript };
|
package/dist/languages/java.d.ts
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { p as PhpAST } from "../index-Cl6Gny0o.js";
|
|
2
|
+
import { PropertyFn } from "./index.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/languages/php.d.ts
|
|
7
|
+
declare namespace php_d_exports {
|
|
8
|
+
export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName };
|
|
9
|
+
}
|
|
10
|
+
type TypeProps = {
|
|
11
|
+
type: PhpAST.PhpType;
|
|
12
|
+
};
|
|
13
|
+
declare function TypeName({
|
|
14
|
+
type
|
|
15
|
+
}: TypeProps): string | react_jsx_runtime0.JSX.Element;
|
|
16
|
+
declare function Type({
|
|
17
|
+
type
|
|
18
|
+
}: TypeProps): react_jsx_runtime0.JSX.Element;
|
|
19
|
+
type MethodSignatureProps = {
|
|
20
|
+
decl: PhpAST.PhpDeclMethod;
|
|
21
|
+
};
|
|
22
|
+
declare function MethodSignature({
|
|
23
|
+
decl
|
|
24
|
+
}: MethodSignatureProps): react_jsx_runtime0.JSX.Element;
|
|
25
|
+
type PropertyProps = {
|
|
26
|
+
decl: PhpAST.PhpDeclaration;
|
|
27
|
+
children: PropertyFn;
|
|
28
|
+
};
|
|
29
|
+
declare function Property({
|
|
30
|
+
decl,
|
|
31
|
+
children
|
|
32
|
+
}: PropertyProps): React$1.ReactNode;
|
|
33
|
+
type DeclarationProps = {
|
|
34
|
+
decl: PhpAST.PhpDeclaration;
|
|
35
|
+
};
|
|
36
|
+
declare function Declaration({
|
|
37
|
+
decl
|
|
38
|
+
}: DeclarationProps): react_jsx_runtime0.JSX.Element | undefined;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName, php_d_exports as t };
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
+
import "../use-strict-context-L0c8JKg4.js";
|
|
3
|
+
import { useLanguageComponents } from "../contexts/index.js";
|
|
4
|
+
import { useComponents } from "../contexts/use-components.js";
|
|
5
|
+
import style_default from "../style.js";
|
|
6
|
+
import * as React$1 from "react";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/languages/php.tsx
|
|
10
|
+
var php_exports = /* @__PURE__ */ __exportAll({
|
|
11
|
+
Declaration: () => Declaration,
|
|
12
|
+
MethodSignature: () => MethodSignature,
|
|
13
|
+
Property: () => Property,
|
|
14
|
+
Type: () => Type,
|
|
15
|
+
TypeName: () => TypeName
|
|
16
|
+
});
|
|
17
|
+
const ComplexTypes = {
|
|
18
|
+
PHPTypeMapArray: "array",
|
|
19
|
+
PhpTypeListArray: "list",
|
|
20
|
+
PhpTypeUnion: "union"
|
|
21
|
+
};
|
|
22
|
+
const constStyle = {
|
|
23
|
+
string: style_default.LiteralString,
|
|
24
|
+
number: style_default.LiteralNumeric,
|
|
25
|
+
boolean: style_default.LiteralBoolean
|
|
26
|
+
};
|
|
27
|
+
function TypeName({ type }) {
|
|
28
|
+
const Lang = useLanguageComponents();
|
|
29
|
+
return ComplexTypes[type.kind] ?? /* @__PURE__ */ jsx(Lang.Type, { type });
|
|
30
|
+
}
|
|
31
|
+
function Type({ type }) {
|
|
32
|
+
const Docs = useComponents();
|
|
33
|
+
const Lang = useLanguageComponents();
|
|
34
|
+
const { Join } = useComponents();
|
|
35
|
+
switch (type.kind) {
|
|
36
|
+
case "PhpTypeFloat":
|
|
37
|
+
case "PhpTypeInt":
|
|
38
|
+
case "PhpTypeBool":
|
|
39
|
+
case "PhpTypeNull":
|
|
40
|
+
case "PhpTypeMixed": return /* @__PURE__ */ jsx("span", {
|
|
41
|
+
className: style_default.Type,
|
|
42
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
43
|
+
className: style_default.TypeKeyword,
|
|
44
|
+
children: type.kind.slice(7).toLowerCase()
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
case "PhpTypeString": return /* @__PURE__ */ jsx("span", {
|
|
48
|
+
className: style_default.Type,
|
|
49
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
50
|
+
className: style_default.TypeString,
|
|
51
|
+
children: "string"
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
case "PhpTypeComplexBuiltin": return /* @__PURE__ */ jsx("span", {
|
|
55
|
+
className: style_default.Type,
|
|
56
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
57
|
+
className: style_default.TypeKeyword,
|
|
58
|
+
children: type.typeName
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
case "PhpTypeLiteral": return /* @__PURE__ */ jsx("span", {
|
|
62
|
+
className: style_default.Type,
|
|
63
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
64
|
+
className: constStyle[typeof type.literal],
|
|
65
|
+
children: JSON.stringify(type.literal)
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
case "PhpTypeDatetime": return /* @__PURE__ */ jsx("span", {
|
|
69
|
+
className: style_default.Type,
|
|
70
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
71
|
+
className: style_default.TypeReference,
|
|
72
|
+
children: "\\Datetime"
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
case "PhpTypeReference": {
|
|
76
|
+
const params = type.typeParameters?.map((param, key) => /* @__PURE__ */ jsx(Lang.Type, { type: param }, key));
|
|
77
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
78
|
+
className: style_default.Type,
|
|
79
|
+
children: [/* @__PURE__ */ jsx(Docs.SDKReference, {
|
|
80
|
+
stainlessPath: type.$ref,
|
|
81
|
+
children: type.typeName
|
|
82
|
+
}), params && params.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
83
|
+
/* @__PURE__ */ jsx("span", {
|
|
84
|
+
className: style_default.TypeBracket,
|
|
85
|
+
children: "<"
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ jsx(Join, {
|
|
88
|
+
items: params,
|
|
89
|
+
limit: 3,
|
|
90
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
91
|
+
className: style_default.TextOperator,
|
|
92
|
+
children: ", "
|
|
93
|
+
})
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ jsx("span", {
|
|
96
|
+
className: style_default.TypeBracket,
|
|
97
|
+
children: ">"
|
|
98
|
+
})
|
|
99
|
+
] })]
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
case "PhpTypeMapArray": return /* @__PURE__ */ jsxs("span", {
|
|
103
|
+
className: style_default.Type,
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ jsx("span", {
|
|
106
|
+
className: style_default.TypeArray,
|
|
107
|
+
children: "array<string,"
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: type.elementType }),
|
|
110
|
+
/* @__PURE__ */ jsx("span", {
|
|
111
|
+
className: style_default.TypeArray,
|
|
112
|
+
children: ">"
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
});
|
|
116
|
+
case "PhpTypeListArray": return /* @__PURE__ */ jsxs("span", {
|
|
117
|
+
className: style_default.Type,
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ jsx("span", {
|
|
120
|
+
className: style_default.TypeArray,
|
|
121
|
+
children: "list<"
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: type.elementType }),
|
|
124
|
+
/* @__PURE__ */ jsx("span", {
|
|
125
|
+
className: style_default.TypeArray,
|
|
126
|
+
children: ">"
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
});
|
|
130
|
+
case "PhpTypeUnion": {
|
|
131
|
+
const items = type.types.map((t, key) => /* @__PURE__ */ jsx(Lang.Type, { type: t }, key));
|
|
132
|
+
return /* @__PURE__ */ jsx("span", {
|
|
133
|
+
className: style_default.Type,
|
|
134
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
135
|
+
className: style_default.TypePreview,
|
|
136
|
+
"data-stldocs-type-preview": "union",
|
|
137
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
138
|
+
className: style_default.TypePreviewContent,
|
|
139
|
+
children: /* @__PURE__ */ jsx(Join, {
|
|
140
|
+
items,
|
|
141
|
+
limit: 3,
|
|
142
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
143
|
+
className: style_default.TextOperator,
|
|
144
|
+
children: " | "
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function MethodSignature({ decl }) {
|
|
154
|
+
const Lang = useLanguageComponents();
|
|
155
|
+
const { Join } = useComponents();
|
|
156
|
+
const params = decl.parameters.map((param, i) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [
|
|
157
|
+
param.optional && /* @__PURE__ */ jsx("span", {
|
|
158
|
+
className: style_default.TextPunctuation,
|
|
159
|
+
children: "?"
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: param.typeAnnotation }),
|
|
162
|
+
" ",
|
|
163
|
+
/* @__PURE__ */ jsx("span", {
|
|
164
|
+
className: style_default.TextIdentifier,
|
|
165
|
+
children: param.ident
|
|
166
|
+
}),
|
|
167
|
+
param.hasDefault && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
168
|
+
className: style_default.TextPunctuation,
|
|
169
|
+
children: " = "
|
|
170
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
171
|
+
className: style_default.TextKeyword,
|
|
172
|
+
children: "default"
|
|
173
|
+
})] })
|
|
174
|
+
] }, i));
|
|
175
|
+
return /* @__PURE__ */ jsx("div", {
|
|
176
|
+
className: style_default.MethodSignature,
|
|
177
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
178
|
+
className: style_default.SignatureTitle,
|
|
179
|
+
children: [
|
|
180
|
+
decl.qualified && /* @__PURE__ */ jsx("span", {
|
|
181
|
+
className: style_default.SignatureQualified,
|
|
182
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
183
|
+
className: style_default.TextIdentifier,
|
|
184
|
+
children: ["$client->", decl.qualified?.slice(0, -decl.ident.length)]
|
|
185
|
+
})
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ jsx("span", {
|
|
188
|
+
className: style_default.SignatureName,
|
|
189
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
190
|
+
className: style_default.TextIdentifier,
|
|
191
|
+
children: decl.ident
|
|
192
|
+
})
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ jsxs("span", {
|
|
195
|
+
className: style_default.MethodSignature,
|
|
196
|
+
children: [
|
|
197
|
+
/* @__PURE__ */ jsx("span", {
|
|
198
|
+
className: style_default.SignatureParen,
|
|
199
|
+
children: "("
|
|
200
|
+
}),
|
|
201
|
+
/* @__PURE__ */ jsx("span", {
|
|
202
|
+
className: style_default.SignatureParams,
|
|
203
|
+
children: /* @__PURE__ */ jsx(Join, {
|
|
204
|
+
items: params,
|
|
205
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
206
|
+
className: style_default.TextOperator,
|
|
207
|
+
children: ", "
|
|
208
|
+
})
|
|
209
|
+
})
|
|
210
|
+
}),
|
|
211
|
+
/* @__PURE__ */ jsx("span", {
|
|
212
|
+
className: style_default.SignatureParen,
|
|
213
|
+
children: ")"
|
|
214
|
+
}),
|
|
215
|
+
/* @__PURE__ */ jsx("span", {
|
|
216
|
+
className: style_default.TextPunctuation,
|
|
217
|
+
children: ": "
|
|
218
|
+
}),
|
|
219
|
+
decl.returnType ? /* @__PURE__ */ jsx(Lang.Type, { type: decl.returnType }) : /* @__PURE__ */ jsx("span", {
|
|
220
|
+
className: style_default.Type,
|
|
221
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
222
|
+
className: style_default.TypeKeyword,
|
|
223
|
+
children: "void"
|
|
224
|
+
})
|
|
225
|
+
})
|
|
226
|
+
]
|
|
227
|
+
})
|
|
228
|
+
]
|
|
229
|
+
})
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
function Property({ decl, children }) {
|
|
233
|
+
const Lang = useLanguageComponents();
|
|
234
|
+
if (!decl) return;
|
|
235
|
+
switch (decl.kind) {
|
|
236
|
+
case "PhpDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
|
|
237
|
+
case "PhpDeclClassProperty":
|
|
238
|
+
case "PhpDeclParam": return children({
|
|
239
|
+
name: decl.ident,
|
|
240
|
+
typeName: /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type }),
|
|
241
|
+
type: decl.type.kind in ComplexTypes && /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
function Declaration({ decl }) {
|
|
246
|
+
const Lang = useLanguageComponents();
|
|
247
|
+
if (!decl) return;
|
|
248
|
+
switch (decl.kind) {
|
|
249
|
+
case "PhpDeclClass":
|
|
250
|
+
case "PhpDeclAssocArray":
|
|
251
|
+
case "PhpDeclEnum": return /* @__PURE__ */ jsx(Fragment$1, { children: "Not yet implemented." });
|
|
252
|
+
case "PhpDeclReference": return /* @__PURE__ */ jsxs(Fragment$1, { children: [decl.scope && /* @__PURE__ */ jsxs("span", {
|
|
253
|
+
className: style_default.TextKeyword,
|
|
254
|
+
children: [decl.scope, " "]
|
|
255
|
+
}), /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })] });
|
|
256
|
+
case "PhpDeclParam": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
257
|
+
/* @__PURE__ */ jsx("span", {
|
|
258
|
+
className: style_default.TextIdentifier,
|
|
259
|
+
children: decl.ident
|
|
260
|
+
}),
|
|
261
|
+
decl.isPositional ? /* @__PURE__ */ jsx("span", {
|
|
262
|
+
className: style_default.TextOperator,
|
|
263
|
+
children: ": "
|
|
264
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
265
|
+
className: style_default.TextOperator,
|
|
266
|
+
children: decl.optional ? "?:" : ": "
|
|
267
|
+
}), decl.optional && /* @__PURE__ */ jsx("span", {
|
|
268
|
+
className: style_default.TextOperator,
|
|
269
|
+
children: "optional "
|
|
270
|
+
})] }),
|
|
271
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
272
|
+
] });
|
|
273
|
+
case "PhpDeclAssocArrayProperty": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
274
|
+
/* @__PURE__ */ jsxs("span", {
|
|
275
|
+
className: style_default.LiteralString,
|
|
276
|
+
children: [
|
|
277
|
+
"'",
|
|
278
|
+
decl.ident,
|
|
279
|
+
"'"
|
|
280
|
+
]
|
|
281
|
+
}),
|
|
282
|
+
decl.optional && /* @__PURE__ */ jsx("span", {
|
|
283
|
+
className: style_default.TextOperator,
|
|
284
|
+
children: "?"
|
|
285
|
+
}),
|
|
286
|
+
/* @__PURE__ */ jsx("span", {
|
|
287
|
+
className: style_default.TextOperator,
|
|
288
|
+
children: ": "
|
|
289
|
+
}),
|
|
290
|
+
decl.optional && /* @__PURE__ */ jsx("span", {
|
|
291
|
+
className: style_default.TextKeyword,
|
|
292
|
+
children: "optional "
|
|
293
|
+
}),
|
|
294
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
295
|
+
] });
|
|
296
|
+
case "PhpDeclClassProperty": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
297
|
+
decl.nullable && /* @__PURE__ */ jsx("span", {
|
|
298
|
+
className: style_default.TextOperator,
|
|
299
|
+
children: "?"
|
|
300
|
+
}),
|
|
301
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: decl.type }),
|
|
302
|
+
" ",
|
|
303
|
+
/* @__PURE__ */ jsx("span", {
|
|
304
|
+
className: style_default.TextIdentifier,
|
|
305
|
+
children: decl.ident
|
|
306
|
+
})
|
|
307
|
+
] });
|
|
308
|
+
case "PhpDeclMethod": return /* @__PURE__ */ jsx(Lang.MethodSignature, { decl });
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
//#endregion
|
|
313
|
+
export { Declaration, MethodSignature, Property, Type, TypeName, php_exports as t };
|
package/dist/languages/ruby.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as Resource$1, x as TerraformAST } from "../index-Cl6Gny0o.js";
|
|
2
2
|
import { PropertyFn } from "./index.js";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
package/dist/markdown/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as Method, f as Model,
|
|
1
|
+
import { d as Method, f as Model, h as Resource, i as DeclarationNode } from "../index-Cl6Gny0o.js";
|
|
2
2
|
import { EnvironmentType } from "./utils.js";
|
|
3
3
|
import { t as printer_d_exports } from "./printer.js";
|
|
4
4
|
import { Node } from "@markdoc/markdoc";
|
package/dist/markdown/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { u as LanguageDeclNodes, v as Spec, y as SpecLanguage } from "../index-Cl6Gny0o.js";
|
|
2
2
|
import { DocsLanguage } from "../routing.js";
|
|
3
3
|
import { TransformRequestSnippetFn } from "../components/sdk.js";
|
|
4
4
|
|
package/dist/routing.d.ts
CHANGED
package/dist/routing.js
CHANGED
package/dist/spec.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as Method, f as Model, h as Resource, i as DeclarationNode, v as Spec, y as SpecLanguage } from "./index-Cl6Gny0o.js";
|
|
2
2
|
import { DocsLanguage } from "./routing.js";
|
|
3
3
|
|
|
4
4
|
//#region src/spec.d.ts
|
|
@@ -36,13 +36,13 @@ declare function generateNavigation(resource: Partial<Resource>): {
|
|
|
36
36
|
declare function generateSpecForResource(spec: Spec, name: string, lang: DocsLanguage, transforms: SpecTransforms): Partial<Spec>;
|
|
37
37
|
declare function transform(spec: Spec, transforms: SpecTransforms): {
|
|
38
38
|
name: string;
|
|
39
|
-
lang: "
|
|
39
|
+
lang: "http" | "node" | "python" | "go" | "typescript" | "terraform" | "ruby" | "java" | "kotlin" | "csharp" | "php" | "cli";
|
|
40
40
|
spec: Partial<Spec>;
|
|
41
41
|
}[];
|
|
42
42
|
declare function split(spec: Spec, transforms?: SpecTransforms): {
|
|
43
43
|
resources: ReturnType<typeof transform>;
|
|
44
44
|
navigation: {
|
|
45
|
-
languages: ("
|
|
45
|
+
languages: ("http" | "node" | "python" | "go" | "typescript" | "terraform" | "ruby" | "java" | "kotlin" | "csharp" | "php" | "cli" | "sql" | "openapi")[] | undefined;
|
|
46
46
|
resources: {
|
|
47
47
|
[k: string]: {
|
|
48
48
|
title: string | undefined;
|
package/dist/styles/sidebar.css
CHANGED
|
@@ -59,6 +59,15 @@
|
|
|
59
59
|
transform: rotate(90deg);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
/* Explicitly prevent collapsed groups from painting.
|
|
63
|
+
Browsers should not be computing styles/layout on collapsed <details> non-summary children, but Safari still seems to.
|
|
64
|
+
Applying display: none lowers rendering cost for trees with many items (eg. the CF API which has ~2k+ items)
|
|
65
|
+
In Arena's testing using dev server, Safari paint time for a CF page went from 10-14 seconds to ~3 seconds.
|
|
66
|
+
*/
|
|
67
|
+
.stldocs-sidebar-expander:not([open]) > .stldocs-sidebar-list {
|
|
68
|
+
display: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
62
71
|
/* List items. */
|
|
63
72
|
.stldocs-sidebar-entry,
|
|
64
73
|
.stldocs-expander-summary {
|
package/dist/styles.css
CHANGED
|
@@ -2917,6 +2917,15 @@ a.stl-ui-button {
|
|
|
2917
2917
|
transform: rotate(90deg);
|
|
2918
2918
|
}
|
|
2919
2919
|
|
|
2920
|
+
/* Explicitly prevent collapsed groups from painting.
|
|
2921
|
+
Browsers should not be computing styles/layout on collapsed <details> non-summary children, but Safari still seems to.
|
|
2922
|
+
Applying display: none lowers rendering cost for trees with many items (eg. the CF API which has ~2k+ items)
|
|
2923
|
+
In Arena's testing using dev server, Safari paint time for a CF page went from 10-14 seconds to ~3 seconds.
|
|
2924
|
+
*/
|
|
2925
|
+
.stldocs-sidebar-expander:not([open]) > .stldocs-sidebar-list {
|
|
2926
|
+
display: none;
|
|
2927
|
+
}
|
|
2928
|
+
|
|
2920
2929
|
/* List items. */
|
|
2921
2930
|
.stldocs-sidebar-entry,
|
|
2922
2931
|
.stldocs-expander-summary {
|
package/dist/utils.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stainless-api/docs-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.0-beta.
|
|
4
|
+
"version": "0.1.0-beta.76",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"clsx": "^2.1.1",
|
|
19
19
|
"htmlparser2": "^10.1.0",
|
|
20
20
|
"lucide-react": "^0.562.0",
|
|
21
|
-
"@stainless-api/ui-primitives": "0.1.0-beta.
|
|
21
|
+
"@stainless-api/ui-primitives": "0.1.0-beta.48"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "24.10.9",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tsdown": "^0.20.3",
|
|
31
31
|
"typescript": "5.9.3",
|
|
32
32
|
"@stainless/eslint-config": "0.1.0-beta.1",
|
|
33
|
-
"@stainless/sdk-json": "^0.1.0-beta.
|
|
33
|
+
"@stainless/sdk-json": "^0.1.0-beta.7"
|
|
34
34
|
},
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|