@umami/shiso 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/App.js +76 -49
- package/dist/chunks/abnfDiagram-VCTEODGH.js +109 -0
- package/dist/chunks/arc.js +130 -0
- package/dist/chunks/architecture-7GRP2DOG.js +4 -0
- package/dist/chunks/architectureDiagram-5GKGNRK7.js +7466 -0
- package/dist/chunks/array.js +8 -0
- package/dist/chunks/blockDiagram-I7D4REHJ.js +2546 -0
- package/dist/chunks/c4Diagram-7LVT6UL2.js +3654 -0
- package/dist/chunks/channel.js +9 -0
- package/dist/chunks/chunk-2Q5K7J3B.js +21 -0
- package/dist/chunks/chunk-4HAMMTFA.js +6106 -0
- package/dist/chunks/chunk-5VM5RSS4.js +21 -0
- package/dist/chunks/chunk-75Z2AOVW.js +2185 -0
- package/dist/chunks/chunk-DU6HZSFF.js +8729 -0
- package/dist/chunks/chunk-F27PBJKO.js +95 -0
- package/dist/chunks/chunk-FOHPRMQF.js +27162 -0
- package/dist/chunks/chunk-GMAD6QVW.js +2369 -0
- package/dist/chunks/chunk-GVQU2GXP.js +58 -0
- package/dist/chunks/chunk-IMKFNOWR.js +2593 -0
- package/dist/chunks/chunk-JWPE2WC7.js +12 -0
- package/dist/chunks/chunk-L3NEJ4N5.js +420 -0
- package/dist/chunks/chunk-OSK3NFVY.js +1029 -0
- package/dist/chunks/chunk-P2QGCYS3.js +95 -0
- package/dist/chunks/chunk-POPQ4Y6H.js +33 -0
- package/dist/chunks/chunk-PWAF6VOD.js +467 -0
- package/dist/chunks/chunk-SHT3W25Y.js +4813 -0
- package/dist/chunks/chunk-SVP7TREG.js +686 -0
- package/dist/chunks/chunk-TICWLB2K.js +3800 -0
- package/dist/chunks/chunk-XXDRQBXY.js +12 -0
- package/dist/chunks/chunk-Y2CYZVJY.js +15 -0
- package/dist/chunks/classDiagram-ZZMXUADV.js +33 -0
- package/dist/chunks/classDiagram-v2-VYDZK3BY.js +33 -0
- package/dist/chunks/cose-bilkent-JH36ORCC.js +4268 -0
- package/dist/chunks/cynefin-OW5HDTMX.js +4 -0
- package/dist/chunks/cynefinDiagram-5FMLGOSQ.js +482 -0
- package/dist/chunks/cytoscape.esm.js +28282 -0
- package/dist/chunks/dagre-GXQ25YYZ.js +583 -0
- package/dist/chunks/dagre.js +4235 -0
- package/dist/chunks/defaultLocale.js +246 -0
- package/dist/chunks/diagram-S7CK7UJ4.js +402 -0
- package/dist/chunks/diagram-UQ7AKVKN.js +291 -0
- package/dist/chunks/diagram-VSXAHHWV.js +553 -0
- package/dist/chunks/diagram-VX7I27RA.js +798 -0
- package/dist/chunks/diagram-Z3DM3KII.js +186 -0
- package/dist/chunks/dist.js +92 -0
- package/dist/chunks/docs.js +987 -91
- package/dist/chunks/ebnfDiagram-PWID7BFC.js +123 -0
- package/dist/chunks/erDiagram-RLTQ6QDP.js +2295 -0
- package/dist/chunks/eventmodeling-NTZA5JFV.js +4 -0
- package/dist/chunks/flowDiagram-HODETNUW.js +17 -0
- package/dist/chunks/ganttDiagram-EL5Y4UJY.js +3928 -0
- package/dist/chunks/gitGraph-4MIJSDKK.js +4 -0
- package/dist/chunks/gitGraphDiagram-WWUBYQGX.js +1153 -0
- package/dist/chunks/graphlib.js +4194 -0
- package/dist/chunks/info-A6RAGUB7.js +4 -0
- package/dist/chunks/infoDiagram-27XIBGKW.js +25 -0
- package/dist/chunks/init.js +14 -0
- package/dist/chunks/ishikawaDiagram-5VMMS53U.js +971 -0
- package/dist/chunks/journeyDiagram-3NMN7TZE.js +1226 -0
- package/dist/chunks/kanban-definition-UXKFOSKX.js +1241 -0
- package/dist/chunks/katex.js +26463 -0
- package/dist/chunks/line.js +48 -0
- package/dist/chunks/linear.js +391 -0
- package/dist/chunks/mermaid-parser.core.js +754 -0
- package/dist/chunks/mermaid.core.js +4898 -0
- package/dist/chunks/mindmap-definition-YA3MSWOX.js +1309 -0
- package/dist/chunks/ordinal.js +84 -0
- package/dist/chunks/packet-AYTQ26CC.js +4 -0
- package/dist/chunks/path.js +106 -0
- package/dist/chunks/pegDiagram-XKGWAZYB.js +115 -0
- package/dist/chunks/pie-WAS4IAKB.js +4 -0
- package/dist/chunks/pieDiagram-E7YTZNPT.js +297 -0
- package/dist/chunks/quadrantDiagram-AXDQQJYC.js +2234 -0
- package/dist/chunks/radar-RG4KPBEZ.js +4 -0
- package/dist/chunks/railroad-74A4TZTK.js +4 -0
- package/dist/chunks/railroad-abnf-HS5TGJTU.js +4 -0
- package/dist/chunks/railroad-ebnf-LZEXJU2U.js +4 -0
- package/dist/chunks/railroad-peg-WCYAUIDC.js +4 -0
- package/dist/chunks/railroadDiagram-O6MQD6OU.js +89 -0
- package/dist/chunks/requirementDiagram-BXWQKSXE.js +2464 -0
- package/dist/chunks/rough.esm.js +1396 -0
- package/dist/chunks/sankeyDiagram-P5KCCOFB.js +1308 -0
- package/dist/chunks/sequenceDiagram-WJ2MYXX4.js +5445 -0
- package/dist/chunks/sizeCapture-INFHLROL.js +56 -0
- package/dist/chunks/src.js +2653 -0
- package/dist/chunks/stateDiagram-D77RDMKH.js +368 -0
- package/dist/chunks/stateDiagram-v2-MP3YSRHH.js +33 -0
- package/dist/chunks/swimlanes-42K2YHIH.js +6925 -0
- package/dist/chunks/swimlanesDiagram-VR7AAH4N.js +32 -0
- package/dist/chunks/timeline-definition-24CTP7MA.js +1507 -0
- package/dist/chunks/treeView-Q6P3EWNA.js +4 -0
- package/dist/chunks/treemap-WGGIJYW6.js +4 -0
- package/dist/chunks/vennDiagram-4TSXK5OY.js +2803 -0
- package/dist/chunks/wardley-WFR3VGLG.js +4 -0
- package/dist/chunks/wardleyDiagram-VM6X3IG4.js +877 -0
- package/dist/chunks/xychartDiagram-S5SC5T6Z.js +2698 -0
- package/dist/components.js +2 -2
- package/dist/entry-client.js +1 -1
- package/dist/entry-server.js +1 -1
- package/docs.schema.json +1 -1
- package/package.json +2 -1
- package/scripts/expand-navigation-globs.mjs +77 -8
- package/src/components/CodeBlock.tsx +36 -0
- package/src/components/Docs.tsx +44 -21
- package/src/components/OpenApiOperation.tsx +28 -20
- package/src/components/SideNav.tsx +8 -3
- package/src/components/docs/Changelog.tsx +163 -0
- package/src/components/docs/Mermaid.tsx +164 -0
- package/src/components/docs/Panel.tsx +23 -0
- package/src/components/docs/ParamField.tsx +17 -5
- package/src/components/docs/PropertiesTable.tsx +2 -2
- package/src/components/docs/ResponseField.tsx +17 -5
- package/src/components/docs/Tiles.tsx +59 -0
- package/src/components/docs/Tree.tsx +359 -0
- package/src/components/docs/Update.tsx +72 -0
- package/src/components/docs/index.ts +7 -0
- package/src/components/docs/panel-context.tsx +25 -0
- package/src/components/docs/styles.ts +49 -0
- package/src/components/icons/index.ts +4 -0
- package/src/lib/rehype-shiki.ts +18 -1
- package/types/components.d.ts +79 -0
package/dist/chunks/App.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as useFloatingNodeId, $n as useTimeout, A as safePolygon, An as findNonDisabledListIndex, At as CollapsibleContent, B as attachPreventUnmountOnClose, Bn as isTypeableCombobox, Cn as styles, Cr as Link, D as useAnchorPositioning, Dn as getTabbableAfterElement, Dr as Routes, Dt as renderInlineMarkdown, E as getDisabledMountTransitionStyles, En as getNextTabbable, F as createInitialPopupStoreState, Fn as isListIndexDisabled, Ft as COMPOSITE_KEYS, G as useTriggerDataForwarding, Gn as ARROW_LEFT, H as useImplicitActiveTrigger, Hn as contains, I as popupStoreSelectors, In as isVirtualClick, It as inertValue, J as useDismiss, Jn as jsdom, K as useSyncedFloatingRootContext, Kn as ARROW_RIGHT, L as PopupTriggerMap, Ln as isVirtualPointerEvent, Lt as useCompositeItem, M as useHoverFloatingInteraction, Mn as getMinListIndex, N as useFocus, Nn as isElementVisible, O as popupTransitionStateMapping, On as getTabbableBeforeElement, Or as useLocation, Ot as Expandable, P as usePopupHandleStore, Pn as isIndexOutOfListBounds, Pt as CodeGroup, Q as FloatingTree, Qn as useId$2, Qt as Badge$1, R as FOCUSABLE_POPUP_PROPS, Rn as stopEvent, St as usePanelContent, T as usePositioner, Tn as useDirection, Tr as Route, U as useOpenStateTransitions, Un as getTarget, V as setPopupOpenState, Vn as activeElement, W as usePopupInteractionProps, Wn as ARROW_DOWN, X as FloatingFocusManager, Xn as mac, Y as useClick, Yn as webkit, Z as FloatingNode, Zn as useBaseUiId, Zt as Badge, _n as triggerFocus, _r as isLastTraversableNode, a as DialogTitle, an as useValueAsRef, ar as useMergedRefs, at as POPUP_COLLISION_AVOIDANCE, bn as CompositeList, br as Check, c as useOpenInteractionType, cn as createChangeEventDetails, cr as ownerDocument, ct as fastComponent, d as useScrollLock, dn as focusOut, dr as useIsoLayoutEffect, er as Button, et as useFloatingParentNodeId, f as DialogPortal$1, fn as imperativeAction, fr as useStableCallback, g as DialogBackdrop, gn as siblingOpen, gr as isHTMLElement, gt as ResponseField, h as DialogClose, hn as outsidePress, hr as getWindow, i as DialogContent$1, in as useAnimationsFinished, ir as EMPTY_OBJECT, it as DROPDOWN_COLLISION_AVOIDANCE, j as useHoverReferenceInteraction, jn as getMaxListIndex, jt as CollapsibleTrigger, k as pressableTriggerOpenStateMapping, kn as isOutsideEvent, kr as useNavigate, kt as Collapsible, l as DialogTitle$1, ln as cancelOpen, lr as useCompositeRootContext, lt as fastComponentRef, m as DialogPopup, mn as listNavigation, mr as getParentNode, n as ZoomableImage, nn as getIcon, nr as useRenderElement, nt as FloatingTreeStore, o as DialogTrigger, on as useCompositeListItem, or as useButton, ot as enqueueFocus, p as InternalBackdrop, pn as itemPress, pr as useRefWithInit, q as ReactStore, qn as ARROW_UP, r as Dialog$1, rn as useOpenChangeComplete, rr as EMPTY_ARRAY, rt as FloatingPortal, s as DialogTrigger$1, sn as useAnimationFrame, sr as dispatchClickWithModifiers, st as FocusGuard, t as docs_exports, tn as resolveIcon, tr as cn, tt as useFloatingTree, u as DialogRoot, un as escapeKey, ur as mergeProps$1, vn as triggerHover, vr as X$1, w as TooltipProvider, wn as addEventListener, wr as Navigate, xn as Mermaid, xr as createLucideIcon, xt as PanelProvider, yn as triggerPress, yr as ChevronRight, yt as ParamField, z as PopupHandleAttachment, zn as getFloatingFocusElement } from "./docs.js";
|
|
2
2
|
import { n as highlightTerms } from "./search.js";
|
|
3
3
|
import { resolveSearchProvider } from "../search.js";
|
|
4
4
|
import * as React from "react";
|
|
@@ -7,7 +7,7 @@ import "@fontsource-variable/inter/index.css";
|
|
|
7
7
|
import "@fontsource/jetbrains-mono/400.css";
|
|
8
8
|
import "@umami/shiso/styles.css";
|
|
9
9
|
import { MDXProvider } from "@mdx-js/react";
|
|
10
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import * as ReactDOM from "react-dom";
|
|
12
12
|
import shiso from "virtual:shiso-config";
|
|
13
13
|
import rawConfig from "virtual:shiso-docs-config";
|
|
@@ -1181,6 +1181,16 @@ function ScrollBar({ className, orientation = "vertical", ...props }) {
|
|
|
1181
1181
|
|
|
1182
1182
|
//#endregion
|
|
1183
1183
|
//#region src/components/CodeBlock.tsx
|
|
1184
|
+
function reactChildrenToText(node) {
|
|
1185
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
1186
|
+
if (Array.isArray(node)) return node.map(reactChildrenToText).join("");
|
|
1187
|
+
if (node && typeof node === "object" && "props" in node) {
|
|
1188
|
+
const props = node.props;
|
|
1189
|
+
if (typeof props?.value === "string") return props.value;
|
|
1190
|
+
return reactChildrenToText(props?.children);
|
|
1191
|
+
}
|
|
1192
|
+
return "";
|
|
1193
|
+
}
|
|
1184
1194
|
/**
|
|
1185
1195
|
* Joins the text of each rendered line. Lines marked as removed by
|
|
1186
1196
|
* `// [!code --]` are skipped so the clipboard holds the "after" state; in a
|
|
@@ -1193,9 +1203,15 @@ function copyText(pre, language) {
|
|
|
1193
1203
|
return lines.filter((line) => language === "diff" || line.dataset.diff !== "remove").map((line) => line.textContent || "").join("\n");
|
|
1194
1204
|
}
|
|
1195
1205
|
function CodeBlock({ children, className, style, ...rest }) {
|
|
1196
|
-
const { "data-title": title, "data-language": language, "data-line-start": lineStart, "data-line-count": lineCount, ...preProps } = rest;
|
|
1206
|
+
const { "data-title": title, "data-language": language, "data-line-start": lineStart, "data-line-count": lineCount, "data-placement": placement, "data-actions": actions, ...preProps } = rest;
|
|
1197
1207
|
const textInput = useRef(null);
|
|
1198
1208
|
const [copied, setCopied] = useState(false);
|
|
1209
|
+
if (language === "mermaid") return /* @__PURE__ */ jsx(Mermaid, {
|
|
1210
|
+
chart: reactChildrenToText(children).replace(/\n$/, ""),
|
|
1211
|
+
title,
|
|
1212
|
+
placement,
|
|
1213
|
+
actions: actions === void 0 ? void 0 : actions !== "false"
|
|
1214
|
+
});
|
|
1199
1215
|
const start = Number(lineStart) || 1;
|
|
1200
1216
|
const lastLine = start + Math.max(Number(lineCount) || 1, 1) - 1;
|
|
1201
1217
|
const gutter = `${String(lastLine).length}ch`;
|
|
@@ -2755,8 +2771,8 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
2755
2771
|
store.useControlledProp("openProp", openProp);
|
|
2756
2772
|
store.useControlledProp("triggerIdProp", triggerIdProp);
|
|
2757
2773
|
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
|
|
2758
|
-
const rootId = useId$
|
|
2759
|
-
const floatingId = useId$
|
|
2774
|
+
const rootId = useId$2();
|
|
2775
|
+
const floatingId = useId$2();
|
|
2760
2776
|
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
|
2761
2777
|
const floatingNodeIdFromContext = useFloatingNodeId(floatingTreeRoot);
|
|
2762
2778
|
const floatingParentNodeIdFromContext = useFloatingParentNodeId();
|
|
@@ -4782,14 +4798,14 @@ var __name$11 = (target, value) => __defProp$11(target, "name", {
|
|
|
4782
4798
|
});
|
|
4783
4799
|
var useReactId = React[" useId ".trim().toString()] || (() => void 0);
|
|
4784
4800
|
var count$1 = 0;
|
|
4785
|
-
function useId(deterministicId) {
|
|
4801
|
+
function useId$1(deterministicId) {
|
|
4786
4802
|
const [id, setId] = React.useState(useReactId());
|
|
4787
4803
|
useLayoutEffect2(() => {
|
|
4788
4804
|
if (!deterministicId) setId((reactId) => reactId ?? String(count$1++));
|
|
4789
4805
|
}, [deterministicId]);
|
|
4790
4806
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
4791
4807
|
}
|
|
4792
|
-
__name$11(useId, "useId");
|
|
4808
|
+
__name$11(useId$1, "useId");
|
|
4793
4809
|
|
|
4794
4810
|
//#endregion
|
|
4795
4811
|
//#region ../../node_modules/.pnpm/@radix-ui+react-use-effect-_e8d5e8242c04825bf34212c7f6280f14/node_modules/@radix-ui/react-use-effect-event/dist/index.mjs
|
|
@@ -6657,9 +6673,9 @@ var Dialog = /* @__PURE__ */ __name((props) => {
|
|
|
6657
6673
|
scope: __scopeDialog,
|
|
6658
6674
|
triggerRef,
|
|
6659
6675
|
contentRef,
|
|
6660
|
-
contentId: useId(),
|
|
6661
|
-
titleId: useId(),
|
|
6662
|
-
descriptionId: useId(),
|
|
6676
|
+
contentId: useId$1(),
|
|
6677
|
+
titleId: useId$1(),
|
|
6678
|
+
descriptionId: useId$1(),
|
|
6663
6679
|
titlePresent: titleCount > 0,
|
|
6664
6680
|
descriptionPresent: descriptionCount > 0,
|
|
6665
6681
|
setTitleCount,
|
|
@@ -6798,7 +6814,7 @@ var DialogContentImpl = /* @__PURE__ */ React.forwardRef(/* @__PURE__ */ __name(
|
|
|
6798
6814
|
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
6799
6815
|
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
|
6800
6816
|
useFocusGuards();
|
|
6801
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(FocusScope, {
|
|
6817
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(FocusScope, {
|
|
6802
6818
|
asChild: true,
|
|
6803
6819
|
loop: true,
|
|
6804
6820
|
trapped: trapFocus,
|
|
@@ -6850,7 +6866,7 @@ var me = React.forwardRef((r, o) => {
|
|
|
6850
6866
|
groups: /* @__PURE__ */ new Set()
|
|
6851
6867
|
}
|
|
6852
6868
|
};
|
|
6853
|
-
}), u = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p = pe(r), { label: b, children: m, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = !1, vimBindings: j = !0, ...O } = r, $ = useId(), q = useId(), _ = useId(), I = React.useRef(null), v = ke();
|
|
6869
|
+
}), u = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p = pe(r), { label: b, children: m, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = !1, vimBindings: j = !0, ...O } = r, $ = useId$1(), q = useId$1(), _ = useId$1(), I = React.useRef(null), v = ke();
|
|
6854
6870
|
k(() => {
|
|
6855
6871
|
if (R !== void 0) {
|
|
6856
6872
|
let e = R.trim();
|
|
@@ -7048,7 +7064,7 @@ var me = React.forwardRef((r, o) => {
|
|
|
7048
7064
|
});
|
|
7049
7065
|
var he = React.forwardRef((r, o) => {
|
|
7050
7066
|
var _, I;
|
|
7051
|
-
let n = useId(), u = React.useRef(null), c = React.useContext(fe), d = K(), f = pe(r), p = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount;
|
|
7067
|
+
let n = useId$1(), u = React.useRef(null), c = React.useContext(fe), d = K(), f = pe(r), p = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount;
|
|
7052
7068
|
k(() => {
|
|
7053
7069
|
if (!p) return d.item(n, c == null ? void 0 : c.id);
|
|
7054
7070
|
}, [p]);
|
|
@@ -7089,7 +7105,7 @@ var he = React.forwardRef((r, o) => {
|
|
|
7089
7105
|
}, r.children);
|
|
7090
7106
|
});
|
|
7091
7107
|
var Ee = React.forwardRef((r, o) => {
|
|
7092
|
-
let { heading: n, children: u, forceMount: c, ...d } = r, f = useId(), p = React.useRef(null), b = React.useRef(null), m = useId(), R = K(), x = P((S) => c || R.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(f) : !0);
|
|
7108
|
+
let { heading: n, children: u, forceMount: c, ...d } = r, f = useId$1(), p = React.useRef(null), b = React.useRef(null), m = useId$1(), R = K(), x = P((S) => c || R.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(f) : !0);
|
|
7093
7109
|
k(() => R.group(f), []), ve(f, p, [
|
|
7094
7110
|
r.value,
|
|
7095
7111
|
r.heading,
|
|
@@ -7501,7 +7517,7 @@ function Search({ config, labels, className }) {
|
|
|
7501
7517
|
onSelect: () => select(result),
|
|
7502
7518
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
7503
7519
|
className: "text-[0.9rem] font-semibold text-foreground",
|
|
7504
|
-
children: [renderWithQueryHighlight(result.page, query), result.heading ? /* @__PURE__ */ jsxs(Fragment, { children: [" › ", renderWithQueryHighlight(result.heading, query)] }) : null]
|
|
7520
|
+
children: [renderWithQueryHighlight(result.page, query), result.heading ? /* @__PURE__ */ jsxs(Fragment$1, { children: [" › ", renderWithQueryHighlight(result.heading, query)] }) : null]
|
|
7505
7521
|
}), result.snippet && /* @__PURE__ */ jsx("div", {
|
|
7506
7522
|
className: "mt-[0.15rem] line-clamp-2 text-[0.8rem] text-muted-foreground",
|
|
7507
7523
|
children: renderSnippet(result.snippet)
|
|
@@ -7690,7 +7706,7 @@ function NavbarLinkItem({ link, primary = false }) {
|
|
|
7690
7706
|
const iconOnly = !link.label;
|
|
7691
7707
|
const accessibleLabel = link.ariaLabel || link.icon || link.href;
|
|
7692
7708
|
const className = primary ? `ml-1 inline-flex items-center justify-center rounded-full bg-primary text-sm font-semibold text-primary-foreground hover:opacity-90 ${iconOnly ? "size-8" : "gap-1.5 px-3.5 py-1.5"}` : `inline-flex items-center rounded-md text-sm font-medium text-foreground hover:bg-accent hover:text-foreground ${iconOnly ? "size-8 justify-center" : "gap-1.5 px-2.5 py-1.5"}`;
|
|
7693
|
-
const content = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ConfiguredIcon, { icon: link.icon }), link.label] });
|
|
7709
|
+
const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ConfiguredIcon, { icon: link.icon }), link.label] });
|
|
7694
7710
|
if (isRoutedHref(link.href, link.target)) return /* @__PURE__ */ jsx(Link, {
|
|
7695
7711
|
to: link.href,
|
|
7696
7712
|
className,
|
|
@@ -7713,11 +7729,11 @@ function Header({ site }) {
|
|
|
7713
7729
|
const brandHref = logo?.href || (hasRootStandalonePage ? "/" : docsHomeUrl);
|
|
7714
7730
|
const hasBrand = !!name || !!logo?.light || !!logo?.dark;
|
|
7715
7731
|
const brandClassName = "inline-flex items-center gap-2 text-xl font-bold text-foreground tracking-[-0.03em]";
|
|
7716
|
-
const brandContent = /* @__PURE__ */ jsxs(Fragment, { children: [logo?.invert && logo.light ? /* @__PURE__ */ jsx("img", {
|
|
7732
|
+
const brandContent = /* @__PURE__ */ jsxs(Fragment$1, { children: [logo?.invert && logo.light ? /* @__PURE__ */ jsx("img", {
|
|
7717
7733
|
src: logo.light,
|
|
7718
7734
|
alt: "",
|
|
7719
7735
|
className: "h-6 w-auto dark:brightness-0 dark:invert"
|
|
7720
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [logo?.light ? /* @__PURE__ */ jsx("img", {
|
|
7736
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [logo?.light ? /* @__PURE__ */ jsx("img", {
|
|
7721
7737
|
src: logo.light,
|
|
7722
7738
|
alt: "",
|
|
7723
7739
|
className: "h-6 w-auto dark:hidden"
|
|
@@ -8124,7 +8140,7 @@ const PARAM_LOCATIONS = [
|
|
|
8124
8140
|
"cookie"
|
|
8125
8141
|
];
|
|
8126
8142
|
function FieldChildren({ node }) {
|
|
8127
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8143
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
8128
8144
|
node.description,
|
|
8129
8145
|
node.enum && node.enum.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
8130
8146
|
className: "mt-1",
|
|
@@ -8141,18 +8157,19 @@ function FieldChildren({ node }) {
|
|
|
8141
8157
|
] });
|
|
8142
8158
|
}
|
|
8143
8159
|
function SchemaField({ node }) {
|
|
8160
|
+
const hasDetails = Boolean(node.description || node.enum?.length || node.children?.length);
|
|
8144
8161
|
return /* @__PURE__ */ jsx(ResponseField, {
|
|
8145
8162
|
name: node.name || node.type,
|
|
8146
8163
|
type: node.name ? node.type : void 0,
|
|
8147
8164
|
required: node.required,
|
|
8148
8165
|
deprecated: node.deprecated,
|
|
8149
8166
|
default: node.default,
|
|
8150
|
-
children: /* @__PURE__ */ jsx(FieldChildren, { node })
|
|
8167
|
+
children: hasDetails ? /* @__PURE__ */ jsx(FieldChildren, { node }) : null
|
|
8151
8168
|
});
|
|
8152
8169
|
}
|
|
8153
8170
|
/** Renders a schema tree: a root object's properties, or the node itself. */
|
|
8154
8171
|
function SchemaFields({ node }) {
|
|
8155
|
-
if (!node.name && node.children?.length) return /* @__PURE__ */ jsx(Fragment, { children: node.children.map((child) => /* @__PURE__ */ jsx(SchemaField, { node: child }, child.name || child.type)) });
|
|
8172
|
+
if (!node.name && node.children?.length) return /* @__PURE__ */ jsx(Fragment$1, { children: node.children.map((child) => /* @__PURE__ */ jsx(SchemaField, { node: child }, child.name || child.type)) });
|
|
8156
8173
|
return /* @__PURE__ */ jsx(SchemaField, { node });
|
|
8157
8174
|
}
|
|
8158
8175
|
function HighlightedCode({ language, title, html, source, lineCount }) {
|
|
@@ -8176,24 +8193,21 @@ function OpenApiOperation({ operation }) {
|
|
|
8176
8193
|
return /* @__PURE__ */ jsxs("div", {
|
|
8177
8194
|
className: "docs-markdown",
|
|
8178
8195
|
children: [
|
|
8179
|
-
showParameters && /* @__PURE__ */ jsxs("section", { children: [
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
operation.security.length > 0 && /* @__PURE__ */ jsxs(ParamField, {
|
|
8196
|
+
showParameters && /* @__PURE__ */ jsxs("section", { children: [/* @__PURE__ */ jsx("h2", {
|
|
8197
|
+
id: sections.get("Parameters"),
|
|
8198
|
+
children: "Parameters"
|
|
8199
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
8200
|
+
className: styles.fieldGroup,
|
|
8201
|
+
children: [operation.security.length > 0 && /* @__PURE__ */ jsxs(ParamField, {
|
|
8185
8202
|
header: "Authorization",
|
|
8186
8203
|
type: "string",
|
|
8187
8204
|
required: true,
|
|
8188
8205
|
children: [
|
|
8189
8206
|
"Authentication credentials, e.g. ",
|
|
8190
8207
|
/* @__PURE__ */ jsx("code", { children: "Bearer <token>" }),
|
|
8191
|
-
"
|
|
8192
|
-
operation.security.join(", "),
|
|
8193
|
-
")."
|
|
8208
|
+
"."
|
|
8194
8209
|
]
|
|
8195
|
-
}),
|
|
8196
|
-
PARAM_LOCATIONS.map((location) => operation.parameters[location].map((parameter) => /* @__PURE__ */ jsxs(ParamField, {
|
|
8210
|
+
}), PARAM_LOCATIONS.map((location) => operation.parameters[location].map((parameter) => /* @__PURE__ */ jsxs(ParamField, {
|
|
8197
8211
|
[location]: parameter.name,
|
|
8198
8212
|
type: parameter.type,
|
|
8199
8213
|
required: parameter.required,
|
|
@@ -8202,8 +8216,8 @@ function OpenApiOperation({ operation }) {
|
|
|
8202
8216
|
name: void 0,
|
|
8203
8217
|
description: void 0
|
|
8204
8218
|
} }), parameter.description]
|
|
8205
|
-
}, `${location}-${parameter.name}`)))
|
|
8206
|
-
] }),
|
|
8219
|
+
}, `${location}-${parameter.name}`)))]
|
|
8220
|
+
})] }),
|
|
8207
8221
|
operation.requestBody && /* @__PURE__ */ jsxs("section", { children: [
|
|
8208
8222
|
/* @__PURE__ */ jsx("h2", {
|
|
8209
8223
|
id: sections.get("Request body"),
|
|
@@ -8234,7 +8248,10 @@ function OpenApiOperation({ operation }) {
|
|
|
8234
8248
|
children: response.description
|
|
8235
8249
|
})]
|
|
8236
8250
|
}),
|
|
8237
|
-
response.schema && /* @__PURE__ */ jsx(
|
|
8251
|
+
response.schema && /* @__PURE__ */ jsx("div", {
|
|
8252
|
+
className: styles.fieldGroup,
|
|
8253
|
+
children: /* @__PURE__ */ jsx(SchemaFields, { node: response.schema })
|
|
8254
|
+
}),
|
|
8238
8255
|
response.example && /* @__PURE__ */ jsx(HighlightedCode, {
|
|
8239
8256
|
language: "json",
|
|
8240
8257
|
title: `${response.status} example`,
|
|
@@ -8692,13 +8709,14 @@ function NavNodes({ nodes, pathname, depth, drilldown, expandLabel, collapseLabe
|
|
|
8692
8709
|
}),
|
|
8693
8710
|
children: [
|
|
8694
8711
|
resolveIcon(icon),
|
|
8695
|
-
label,
|
|
8696
8712
|
method ? /* @__PURE__ */ jsx(Badge, {
|
|
8697
8713
|
color: methodColor(method),
|
|
8698
8714
|
size: "xs",
|
|
8699
|
-
className: "
|
|
8715
|
+
className: "w-10 shrink-0 justify-center whitespace-nowrap font-mono",
|
|
8700
8716
|
children: method === "DELETE" ? "DEL" : method
|
|
8701
|
-
}) :
|
|
8717
|
+
}) : null,
|
|
8718
|
+
label,
|
|
8719
|
+
!method && tag ? /* @__PURE__ */ jsx(Badge$1, {
|
|
8702
8720
|
variant: "secondary",
|
|
8703
8721
|
className: "ml-auto h-auto rounded-sm px-[0.35rem] py-[0.05rem] text-[0.7rem] text-muted-foreground uppercase",
|
|
8704
8722
|
children: tag
|
|
@@ -8716,7 +8734,7 @@ function NavNodes({ nodes, pathname, depth, drilldown, expandLabel, collapseLabe
|
|
|
8716
8734
|
collapseLabel
|
|
8717
8735
|
}, `group-${node.label}`));
|
|
8718
8736
|
});
|
|
8719
|
-
return /* @__PURE__ */ jsx(Fragment, { children: rendered });
|
|
8737
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: rendered });
|
|
8720
8738
|
}
|
|
8721
8739
|
function SideNav({ tabs, navigation, anchors, activeTabId, isSticky, drilldown, navigationLabel, expandLabel, collapseLabel }) {
|
|
8722
8740
|
const { pathname } = useLocation();
|
|
@@ -8820,10 +8838,28 @@ function NotFound({ site }) {
|
|
|
8820
8838
|
});
|
|
8821
8839
|
}
|
|
8822
8840
|
function Docs({ page, doc, site }) {
|
|
8841
|
+
if (!page || !doc) return /* @__PURE__ */ jsxs("div", {
|
|
8842
|
+
className: "flex min-h-full flex-col",
|
|
8843
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
8844
|
+
className: "grow",
|
|
8845
|
+
children: /* @__PURE__ */ jsx(NotFound, { site })
|
|
8846
|
+
}), /* @__PURE__ */ jsx(Footer, { footer: site.footer })]
|
|
8847
|
+
});
|
|
8848
|
+
const operation = getOperation(doc.frontmatter?.openapi);
|
|
8849
|
+
const toc = operation ? [...doc.toc || [], ...operationSections(operation)] : doc.toc;
|
|
8850
|
+
return /* @__PURE__ */ jsx(PanelProvider, { children: /* @__PURE__ */ jsx(DocsBody, {
|
|
8851
|
+
page,
|
|
8852
|
+
doc,
|
|
8853
|
+
site,
|
|
8854
|
+
toc
|
|
8855
|
+
}) });
|
|
8856
|
+
}
|
|
8857
|
+
function DocsBody({ page, doc, site, toc }) {
|
|
8823
8858
|
const { pathname } = useLocation();
|
|
8824
8859
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
8825
8860
|
const scopeDocs = getScopeByPathname(pathname).docs;
|
|
8826
8861
|
const { tabs, navigation } = scopeDocs;
|
|
8862
|
+
const panel = usePanelContent();
|
|
8827
8863
|
useEffect(() => {
|
|
8828
8864
|
setMenuOpen(false);
|
|
8829
8865
|
if (!window.location.hash) window.scrollTo({
|
|
@@ -8831,15 +8867,6 @@ function Docs({ page, doc, site }) {
|
|
|
8831
8867
|
left: 0
|
|
8832
8868
|
});
|
|
8833
8869
|
}, [pathname]);
|
|
8834
|
-
if (!page || !doc) return /* @__PURE__ */ jsxs("div", {
|
|
8835
|
-
className: "flex min-h-full flex-col",
|
|
8836
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
8837
|
-
className: "grow",
|
|
8838
|
-
children: /* @__PURE__ */ jsx(NotFound, { site })
|
|
8839
|
-
}), /* @__PURE__ */ jsx(Footer, { footer: site.footer })]
|
|
8840
|
-
});
|
|
8841
|
-
const operation = getOperation(doc.frontmatter?.openapi);
|
|
8842
|
-
const toc = operation ? [...doc.toc || [], ...operationSections(operation)] : doc.toc;
|
|
8843
8870
|
return /* @__PURE__ */ jsxs("div", {
|
|
8844
8871
|
className: "flex min-h-full flex-col gap-6 lg:gap-0",
|
|
8845
8872
|
children: [/* @__PURE__ */ jsxs(Sheet, {
|
|
@@ -8906,7 +8933,7 @@ function Docs({ page, doc, site }) {
|
|
|
8906
8933
|
site
|
|
8907
8934
|
}), /* @__PURE__ */ jsx("div", {
|
|
8908
8935
|
className: "hidden min-w-0 max-w-60 basis-60 self-start lg:sticky lg:top-[calc(var(--header-height)+1.5rem)] lg:block lg:shrink-0",
|
|
8909
|
-
children: /* @__PURE__ */ jsx(PageLinks, {
|
|
8936
|
+
children: panel ?? /* @__PURE__ */ jsx(PageLinks, {
|
|
8910
8937
|
items: toc,
|
|
8911
8938
|
title: site.labels.tableOfContents,
|
|
8912
8939
|
navigationLabel: site.labels.tableOfContentsNavigation
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { m as createRailroadAbnfServices, t as MermaidParseError } from "./mermaid-parser.core.js";
|
|
2
|
+
import { n as __name } from "./chunk-Y2CYZVJY.js";
|
|
3
|
+
import { m as log } from "./src.js";
|
|
4
|
+
import "./chunk-DU6HZSFF.js";
|
|
5
|
+
import { n as getStyles, r as renderer, t as db } from "./chunk-SVP7TREG.js";
|
|
6
|
+
import { t as populateCommonDb } from "./chunk-JWPE2WC7.js";
|
|
7
|
+
import "./mermaid.core.js";
|
|
8
|
+
|
|
9
|
+
//#region ../../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/abnfDiagram-VCTEODGH.mjs
|
|
10
|
+
var langiumParser = createRailroadAbnfServices().RailroadAbnf.parser.LangiumParser;
|
|
11
|
+
var transformAlternation = /* @__PURE__ */ __name((alt) => {
|
|
12
|
+
const alternatives = alt.alternatives.map(transformConcatenation);
|
|
13
|
+
if (alternatives.length === 1) return alternatives[0];
|
|
14
|
+
return {
|
|
15
|
+
type: "choice",
|
|
16
|
+
alternatives
|
|
17
|
+
};
|
|
18
|
+
}, "transformAlternation");
|
|
19
|
+
var transformConcatenation = /* @__PURE__ */ __name((concat) => {
|
|
20
|
+
const elements = concat.elements.map(transformElement);
|
|
21
|
+
if (elements.length === 1) return elements[0];
|
|
22
|
+
return {
|
|
23
|
+
type: "sequence",
|
|
24
|
+
elements
|
|
25
|
+
};
|
|
26
|
+
}, "transformConcatenation");
|
|
27
|
+
var parseRepeat = /* @__PURE__ */ __name((repeat) => {
|
|
28
|
+
if (repeat.includes("*")) {
|
|
29
|
+
const [minStr, maxStr] = repeat.split("*");
|
|
30
|
+
return {
|
|
31
|
+
min: minStr ? parseInt(minStr, 10) : 0,
|
|
32
|
+
max: maxStr ? parseInt(maxStr, 10) : Infinity
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const exact = parseInt(repeat, 10);
|
|
36
|
+
return {
|
|
37
|
+
min: exact,
|
|
38
|
+
max: exact
|
|
39
|
+
};
|
|
40
|
+
}, "parseRepeat");
|
|
41
|
+
var transformElement = /* @__PURE__ */ __name((element) => {
|
|
42
|
+
const inner = transformPrimary(element.primary);
|
|
43
|
+
if (!element.repeat) return inner;
|
|
44
|
+
const { min, max } = parseRepeat(element.repeat);
|
|
45
|
+
if (min === 0 && max === 1) return {
|
|
46
|
+
type: "optional",
|
|
47
|
+
element: inner
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
type: "repetition",
|
|
51
|
+
element: inner,
|
|
52
|
+
min,
|
|
53
|
+
max
|
|
54
|
+
};
|
|
55
|
+
}, "transformElement");
|
|
56
|
+
var transformPrimary = /* @__PURE__ */ __name((primary) => {
|
|
57
|
+
switch (primary.$type) {
|
|
58
|
+
case "AbnfStringLiteral": return {
|
|
59
|
+
type: "terminal",
|
|
60
|
+
value: primary.value
|
|
61
|
+
};
|
|
62
|
+
case "AbnfNumVal": return {
|
|
63
|
+
type: "terminal",
|
|
64
|
+
value: primary.value
|
|
65
|
+
};
|
|
66
|
+
case "AbnfRuleName": return {
|
|
67
|
+
type: "nonterminal",
|
|
68
|
+
name: primary.name
|
|
69
|
+
};
|
|
70
|
+
case "AbnfGroup": return transformAlternation(primary.element);
|
|
71
|
+
case "AbnfOptionalGroup": return {
|
|
72
|
+
type: "optional",
|
|
73
|
+
element: transformAlternation(primary.element)
|
|
74
|
+
};
|
|
75
|
+
default: throw new Error(`Unsupported ABNF primary node: ${primary.$type}`);
|
|
76
|
+
}
|
|
77
|
+
}, "transformPrimary");
|
|
78
|
+
var transformRule = /* @__PURE__ */ __name((rule) => {
|
|
79
|
+
return {
|
|
80
|
+
name: rule.name,
|
|
81
|
+
definition: transformAlternation(rule.definition)
|
|
82
|
+
};
|
|
83
|
+
}, "transformRule");
|
|
84
|
+
var populateDb = /* @__PURE__ */ __name((ast) => {
|
|
85
|
+
populateCommonDb(ast, db);
|
|
86
|
+
if (ast.title) db.setTitle(ast.title);
|
|
87
|
+
ast.rules.map((rule) => db.addRule(transformRule(rule)));
|
|
88
|
+
}, "populateDb");
|
|
89
|
+
var diagram = {
|
|
90
|
+
parser: {
|
|
91
|
+
parse: /* @__PURE__ */ __name((input) => {
|
|
92
|
+
db.clear();
|
|
93
|
+
log.debug("[ABNF Parser] Starting Langium parse");
|
|
94
|
+
const result = langiumParser.parse(input);
|
|
95
|
+
if (result.lexerErrors.length > 0 || result.parserErrors.length > 0) throw new MermaidParseError(result);
|
|
96
|
+
const ast = result.value;
|
|
97
|
+
log.debug("[ABNF Parser] Parsed rules:", ast.rules.length);
|
|
98
|
+
populateDb(ast);
|
|
99
|
+
log.debug("[ABNF Parser] Parse complete");
|
|
100
|
+
}, "parse"),
|
|
101
|
+
parser: { yy: db }
|
|
102
|
+
},
|
|
103
|
+
db,
|
|
104
|
+
renderer,
|
|
105
|
+
styles: getStyles
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
//#endregion
|
|
109
|
+
export { diagram };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { n as constant_default, t as withPath } from "./path.js";
|
|
2
|
+
import { a as atan2, c as halfPi, d as pi, f as sin, i as asin, l as max, m as tau, n as abs, o as cos, p as sqrt, r as acos, s as epsilon, u as min } from "./dist.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/arc.js
|
|
5
|
+
function arcInnerRadius(d) {
|
|
6
|
+
return d.innerRadius;
|
|
7
|
+
}
|
|
8
|
+
function arcOuterRadius(d) {
|
|
9
|
+
return d.outerRadius;
|
|
10
|
+
}
|
|
11
|
+
function arcStartAngle(d) {
|
|
12
|
+
return d.startAngle;
|
|
13
|
+
}
|
|
14
|
+
function arcEndAngle(d) {
|
|
15
|
+
return d.endAngle;
|
|
16
|
+
}
|
|
17
|
+
function arcPadAngle(d) {
|
|
18
|
+
return d && d.padAngle;
|
|
19
|
+
}
|
|
20
|
+
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
|
21
|
+
var x10 = x1 - x0, y10 = y1 - y0, x32 = x3 - x2, y32 = y3 - y2, t = y32 * x10 - x32 * y10;
|
|
22
|
+
if (t * t < 1e-12) return;
|
|
23
|
+
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
|
|
24
|
+
return [x0 + t * x10, y0 + t * y10];
|
|
25
|
+
}
|
|
26
|
+
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
27
|
+
var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r = r1 - rc, D = x11 * y10 - x10 * y11, d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00;
|
|
28
|
+
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
|
|
29
|
+
return {
|
|
30
|
+
cx: cx0,
|
|
31
|
+
cy: cy0,
|
|
32
|
+
x01: -ox,
|
|
33
|
+
y01: -oy,
|
|
34
|
+
x11: cx0 * (r1 / r - 1),
|
|
35
|
+
y11: cy0 * (r1 / r - 1)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function arc_default() {
|
|
39
|
+
var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant_default(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null, path = withPath(arc);
|
|
40
|
+
function arc() {
|
|
41
|
+
var buffer, r, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi, a1 = endAngle.apply(this, arguments) - halfPi, da = abs(a1 - a0), cw = a1 > a0;
|
|
42
|
+
if (!context) context = buffer = path();
|
|
43
|
+
if (r1 < r0) r = r1, r1 = r0, r0 = r;
|
|
44
|
+
if (!(r1 > 1e-12)) context.moveTo(0, 0);
|
|
45
|
+
else if (da > tau - 1e-12) {
|
|
46
|
+
context.moveTo(r1 * cos(a0), r1 * sin(a0));
|
|
47
|
+
context.arc(0, 0, r1, a0, a1, !cw);
|
|
48
|
+
if (r0 > 1e-12) {
|
|
49
|
+
context.moveTo(r0 * cos(a1), r0 * sin(a1));
|
|
50
|
+
context.arc(0, 0, r0, a1, a0, cw);
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > 1e-12 && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t0, t1;
|
|
54
|
+
if (rp > 1e-12) {
|
|
55
|
+
var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap));
|
|
56
|
+
if ((da0 -= p0 * 2) > 1e-12) p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0;
|
|
57
|
+
else da0 = 0, a00 = a10 = (a0 + a1) / 2;
|
|
58
|
+
if ((da1 -= p1 * 2) > 1e-12) p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1;
|
|
59
|
+
else da1 = 0, a01 = a11 = (a0 + a1) / 2;
|
|
60
|
+
}
|
|
61
|
+
var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10);
|
|
62
|
+
if (rc > 1e-12) {
|
|
63
|
+
var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc;
|
|
64
|
+
if (da < pi) if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {
|
|
65
|
+
var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
|
|
66
|
+
rc0 = min(rc, (r0 - lc) / (kc - 1));
|
|
67
|
+
rc1 = min(rc, (r1 - lc) / (kc + 1));
|
|
68
|
+
} else rc0 = rc1 = 0;
|
|
69
|
+
}
|
|
70
|
+
if (!(da1 > 1e-12)) context.moveTo(x01, y01);
|
|
71
|
+
else if (rc1 > 1e-12) {
|
|
72
|
+
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
|
|
73
|
+
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
|
|
74
|
+
context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
75
|
+
if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
|
76
|
+
else {
|
|
77
|
+
context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
|
78
|
+
context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
|
|
79
|
+
context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
|
80
|
+
}
|
|
81
|
+
} else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
|
|
82
|
+
if (!(r0 > 1e-12) || !(da0 > 1e-12)) context.lineTo(x10, y10);
|
|
83
|
+
else if (rc0 > 1e-12) {
|
|
84
|
+
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
|
|
85
|
+
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
|
|
86
|
+
context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
87
|
+
if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
|
88
|
+
else {
|
|
89
|
+
context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
|
90
|
+
context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
|
|
91
|
+
context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
|
92
|
+
}
|
|
93
|
+
} else context.arc(0, 0, r0, a10, a00, cw);
|
|
94
|
+
}
|
|
95
|
+
context.closePath();
|
|
96
|
+
if (buffer) return context = null, buffer + "" || null;
|
|
97
|
+
}
|
|
98
|
+
arc.centroid = function() {
|
|
99
|
+
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;
|
|
100
|
+
return [cos(a) * r, sin(a) * r];
|
|
101
|
+
};
|
|
102
|
+
arc.innerRadius = function(_) {
|
|
103
|
+
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant_default(+_), arc) : innerRadius;
|
|
104
|
+
};
|
|
105
|
+
arc.outerRadius = function(_) {
|
|
106
|
+
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant_default(+_), arc) : outerRadius;
|
|
107
|
+
};
|
|
108
|
+
arc.cornerRadius = function(_) {
|
|
109
|
+
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant_default(+_), arc) : cornerRadius;
|
|
110
|
+
};
|
|
111
|
+
arc.padRadius = function(_) {
|
|
112
|
+
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant_default(+_), arc) : padRadius;
|
|
113
|
+
};
|
|
114
|
+
arc.startAngle = function(_) {
|
|
115
|
+
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant_default(+_), arc) : startAngle;
|
|
116
|
+
};
|
|
117
|
+
arc.endAngle = function(_) {
|
|
118
|
+
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant_default(+_), arc) : endAngle;
|
|
119
|
+
};
|
|
120
|
+
arc.padAngle = function(_) {
|
|
121
|
+
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant_default(+_), arc) : padAngle;
|
|
122
|
+
};
|
|
123
|
+
arc.context = function(_) {
|
|
124
|
+
return arguments.length ? (context = _ == null ? null : _, arc) : context;
|
|
125
|
+
};
|
|
126
|
+
return arc;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
//#endregion
|
|
130
|
+
export { arc_default as t };
|