@qualcomm-ui/react-mdx 1.5.8 → 1.6.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/all.min.css +1 -1
- package/dist/code-demo/{qds-angular-demo-runner.d.ts → angular-demo-runner.d.ts} +11 -3
- package/dist/code-demo/angular-demo-runner.d.ts.map +1 -0
- package/dist/code-demo/code-demo.utils.d.ts.map +1 -1
- package/dist/code-demo/index.d.ts +1 -1
- package/dist/code-demo/index.d.ts.map +1 -1
- package/dist/code-demo/index.js +2 -2
- package/dist/code-demo/index.js.map +4 -4
- package/dist/code-demo/internal/css-logo.d.ts +3 -0
- package/dist/code-demo/internal/css-logo.d.ts.map +1 -0
- package/dist/code-demo/internal/demo-code-panel.d.ts +34 -0
- package/dist/code-demo/internal/demo-code-panel.d.ts.map +1 -0
- package/dist/code-demo/internal/demo-style-toggle.d.ts +5 -0
- package/dist/code-demo/internal/demo-style-toggle.d.ts.map +1 -0
- package/dist/code-demo/internal/index.d.ts +3 -0
- package/dist/code-demo/internal/index.d.ts.map +1 -1
- package/dist/code-demo/internal/tailwind-logo.d.ts +3 -0
- package/dist/code-demo/internal/tailwind-logo.d.ts.map +1 -0
- package/dist/code-demo/internal/use-demo-source-code.d.ts +18 -0
- package/dist/code-demo/internal/use-demo-source-code.d.ts.map +1 -0
- package/dist/code-demo/qds-react-demo.d.ts +1 -1
- package/dist/code-demo/qds-react-demo.d.ts.map +1 -1
- package/dist/code-demo/react-demo.d.ts.map +1 -1
- package/dist/context/use-mdx-docs-context.d.ts +12 -1
- package/dist/context/use-mdx-docs-context.d.ts.map +1 -1
- package/dist/copy-to-clipboard/copy-to-clipboard-icon-button.d.ts.map +1 -1
- package/dist/copy-to-clipboard/index.js +1 -1
- package/dist/copy-to-clipboard/index.js.map +2 -2
- package/dist/docs-layout/index.js +1 -1
- package/dist/docs-layout/index.js.map +2 -2
- package/dist/docs-layout/layout/root.d.ts +1 -1
- package/dist/docs-layout/layout/root.d.ts.map +1 -1
- package/dist/docs-layout/types.d.ts +6 -2
- package/dist/docs-layout/types.d.ts.map +1 -1
- package/dist/npm-install-tabs/index.js +1 -1
- package/dist/npm-install-tabs/index.js.map +2 -2
- package/dist/tsbuildinfo +1 -1
- package/package.json +6 -6
- package/dist/code-demo/qds-angular-demo-runner.d.ts.map +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode, RefObject } from "react";
|
|
2
|
+
export interface DemoCodePanelProps {
|
|
3
|
+
/**
|
|
4
|
+
* Additional actions to render before the expand/collapse button.
|
|
5
|
+
*/
|
|
6
|
+
actionsStart?: ReactNode;
|
|
7
|
+
activeTab: string;
|
|
8
|
+
/**
|
|
9
|
+
* Copy button element - allows different copy button implementations.
|
|
10
|
+
*/
|
|
11
|
+
copyButton: ReactNode;
|
|
12
|
+
expanded: boolean;
|
|
13
|
+
fileNames: string[];
|
|
14
|
+
getHighlightedCode: () => string;
|
|
15
|
+
hasInlineStyles: boolean | undefined;
|
|
16
|
+
hasPreview: boolean | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Ref for the highlighted code container (used by React demo for DOM-based
|
|
19
|
+
* code copying).
|
|
20
|
+
*/
|
|
21
|
+
highlighterRef?: RefObject<HTMLDivElement | null>;
|
|
22
|
+
onExpandedChange: (expanded: boolean) => void;
|
|
23
|
+
onTabChange: (tab: string) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to suppress hydration warnings (needed for Angular SSR).
|
|
26
|
+
*/
|
|
27
|
+
suppressHydrationWarning?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Value for the tabs - allows controlling when tabs appear selected.
|
|
30
|
+
*/
|
|
31
|
+
tabsValue?: string | null;
|
|
32
|
+
}
|
|
33
|
+
export declare function DemoCodePanel({ actionsStart, activeTab, copyButton, expanded, fileNames, getHighlightedCode, hasInlineStyles, hasPreview, highlighterRef, onExpandedChange, onTabChange, suppressHydrationWarning, tabsValue, }: DemoCodePanelProps): ReactNode;
|
|
34
|
+
//# sourceMappingURL=demo-code-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo-code-panel.d.ts","sourceRoot":"","sources":["../../../src/code-demo/internal/demo-code-panel.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,OAAO,CAAA;AAU/C,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAA;IACrB,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,kBAAkB,EAAE,MAAM,MAAM,CAAA;IAChC,eAAe,EAAE,OAAO,GAAG,SAAS,CAAA;IACpC,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACjD,gBAAgB,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAA;IAC7C,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC;;OAEG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,wBAAgB,aAAa,CAAC,EAC5B,YAAY,EACZ,SAAS,EACT,UAAU,EACV,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,wBAAwB,EACxB,SAAS,GACV,EAAE,kBAAkB,GAAG,SAAS,CAyEhC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactElement } from "react";
|
|
2
|
+
export interface DemoStyleToggleProps extends ComponentPropsWithRef<"div"> {
|
|
3
|
+
}
|
|
4
|
+
export declare function DemoStyleToggle(props: DemoStyleToggleProps): ReactElement;
|
|
5
|
+
//# sourceMappingURL=demo-style-toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo-style-toggle.d.ts","sourceRoot":"","sources":["../../../src/code-demo/internal/demo-style-toggle.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,qBAAqB,EAAiB,YAAY,EAAC,MAAM,OAAO,CAAA;AAU7E,MAAM,WAAW,oBAAqB,SAAQ,qBAAqB,CAAC,KAAK,CAAC;CAAG;AAE7E,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CA4CzE"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
export * from "./demo-code-panel";
|
|
2
|
+
export * from "./demo-style-toggle";
|
|
1
3
|
export * from "./qds-demo-theme-selector";
|
|
2
4
|
export * from "./use-code-demo-preview";
|
|
5
|
+
export * from "./use-demo-source-code";
|
|
3
6
|
export * from "./use-qds-demo-theme";
|
|
4
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/code-demo/internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/code-demo/internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailwind-logo.d.ts","sourceRoot":"","sources":["../../../src/code-demo/internal/tailwind-logo.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,qBAAqB,EAAE,YAAY,EAAC,MAAM,OAAO,CAAA;AAE9D,wBAAgB,YAAY,CAC1B,KAAK,EAAE,qBAAqB,CAAC,KAAK,CAAC,GAClC,YAAY,CAWd"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SourceCode, SourceCodeData } from "@qualcomm-ui/mdx-common";
|
|
2
|
+
export interface UseDemoSourceCodeOptions {
|
|
3
|
+
activeTab: string;
|
|
4
|
+
expanded: boolean;
|
|
5
|
+
sourceCode: SourceCodeData[];
|
|
6
|
+
}
|
|
7
|
+
export interface UseDemoSourceCodeResult {
|
|
8
|
+
activeHighlightedCode: SourceCode | undefined;
|
|
9
|
+
activeTabSourceCode: SourceCodeData | undefined;
|
|
10
|
+
fileNames: string[];
|
|
11
|
+
filteredSourceCode: SourceCodeData[];
|
|
12
|
+
getHighlightedCode: () => string;
|
|
13
|
+
hasInlineStyles: boolean | undefined;
|
|
14
|
+
hasPreview: boolean | undefined;
|
|
15
|
+
isInlineMode: boolean | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare function useDemoSourceCode({ activeTab, expanded, sourceCode, }: UseDemoSourceCodeOptions): UseDemoSourceCodeResult;
|
|
18
|
+
//# sourceMappingURL=use-demo-source-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-demo-source-code.d.ts","sourceRoot":"","sources":["../../../src/code-demo/internal/use-demo-source-code.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,yBAAyB,CAAA;AAGvE,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,cAAc,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,uBAAuB;IACtC,qBAAqB,EAAE,UAAU,GAAG,SAAS,CAAA;IAC7C,mBAAmB,EAAE,cAAc,GAAG,SAAS,CAAA;IAC/C,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,kBAAkB,EAAE,cAAc,EAAE,CAAA;IACpC,kBAAkB,EAAE,MAAM,MAAM,CAAA;IAChC,eAAe,EAAE,OAAO,GAAG,SAAS,CAAA;IACpC,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,YAAY,EAAE,OAAO,GAAG,SAAS,CAAA;CAClC;AAQD,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,UAAU,GACX,EAAE,wBAAwB,GAAG,uBAAuB,CAmEpD"}
|
|
@@ -53,7 +53,7 @@ export interface QdsReactDemoProps extends ComponentPropsWithRef<"div"> {
|
|
|
53
53
|
wrapperProps?: HTMLAttributes<HTMLDivElement>;
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* @deprecated
|
|
56
|
+
* @deprecated no longer supported. Migrate to ReactDemo
|
|
57
57
|
*/
|
|
58
58
|
export declare function QdsReactDemo({ children, colorScheme, defaultSourceIndex: _defaultSourceIndex, demo: demoProp, expandable, expanded: expandedProp, name, onDemoRendered, qdsBrand, updating, wrapperProps, ...props }: QdsReactDemoProps): ReactNode;
|
|
59
59
|
//# sourceMappingURL=qds-react-demo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qds-react-demo.d.ts","sourceRoot":"","sources":["../../src/code-demo/qds-react-demo.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAA;AAMd,OAAO,KAAK,EAAC,kBAAkB,EAAiB,MAAM,yBAAyB,CAAA;AAG/E,OAAO,KAAK,EAAC,WAAW,EAAE,QAAQ,EAAC,MAAM,8BAA8B,CAAA;AAWvE,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IACrE;;OA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BAAkB,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IACrE;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IAEpB,WAAW,CAAC,EAAE,WAAW,CAAA;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;OAEG;IACH,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAA;IAE/B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;;;;;;;;;;;;OAeG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ,cAAc,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;IAEjE,QAAQ,CAAC,EAAE,QAAQ,CAAA;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAE9B;;OAEG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAA;CAC9C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,WAAW,EACX,kBAAkB,EAAE,mBAAuB,EAC3C,IAAI,EAAE,QAAQ,EACd,UAAiB,EACjB,QAAQ,EAAE,YAAoB,EAC9B,IAAI,EACJ,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,YAAiB,EACjB,GAAG,KAAK,EACT,EAAE,iBAAiB,GAAG,SAAS,CA+M/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-demo.d.ts","sourceRoot":"","sources":["../../src/code-demo/react-demo.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"react-demo.d.ts","sourceRoot":"","sources":["../../src/code-demo/react-demo.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EAKf,MAAM,OAAO,CAAA;AAId,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AAS7D,MAAM,WAAW,cAAe,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IAClE;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IAEpB,WAAW,CAAC,EAAE,WAAW,CAAA;IAEzB,SAAS,EAAE,MAAM,SAAS,CAAA;IAE1B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;OAEG;IACH,IAAI,EAAE,aAAa,GAAG,IAAI,CAAA;IAE1B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;;;;;;;;;;;;OAeG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAA;CAC5C;AAED,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,WAAW,EACX,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,mBAAuB,EAC3C,IAAI,EAAE,QAAQ,EACd,UAAiB,EACjB,QAAQ,EAAE,YAAoB,EAC9B,IAAI,EACJ,YAAiB,EACjB,GAAG,KAAK,EACT,EAAE,cAAc,GAAG,SAAS,CA2I5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Provider } from "react";
|
|
1
|
+
import { type Dispatch, type Provider, type SetStateAction } from "react";
|
|
2
2
|
import type { DocPropsSettings, RenderLink, TocHighlightStrategy } from "@qualcomm-ui/react-mdx/docs-layout";
|
|
3
3
|
export type PackageManager = "npm" | "yarn" | "pnpm";
|
|
4
4
|
export interface DemoStateEntry {
|
|
@@ -12,7 +12,17 @@ export type DemoState = Record<string, DemoStateEntry>;
|
|
|
12
12
|
* <routeUrl, DemoState>
|
|
13
13
|
*/
|
|
14
14
|
export type RouteDemoState = Record<string, DemoState>;
|
|
15
|
+
export interface DemoSettings {
|
|
16
|
+
/**
|
|
17
|
+
* If true, transform tailwind classes in demos to inline styles and vanilla CSS.
|
|
18
|
+
*/
|
|
19
|
+
transformTailwindClasses?: boolean;
|
|
20
|
+
}
|
|
15
21
|
export interface MdxDocsContextValue {
|
|
22
|
+
/**
|
|
23
|
+
* @default {styleMode: 'default'}
|
|
24
|
+
*/
|
|
25
|
+
demoSettings?: DemoSettings;
|
|
16
26
|
/**
|
|
17
27
|
* Demo state for each route, typically persisted via localStorage or a session
|
|
18
28
|
* cookie (SSR). This preserves the expand/collapse state of each demo on reload.
|
|
@@ -25,6 +35,7 @@ export interface MdxDocsContextValue {
|
|
|
25
35
|
*/
|
|
26
36
|
packageManager?: PackageManager;
|
|
27
37
|
renderLink: RenderLink;
|
|
38
|
+
setDemoSettings?: Dispatch<SetStateAction<DemoSettings>>;
|
|
28
39
|
/**
|
|
29
40
|
* onChange handler for the {@link packageManager field}
|
|
30
41
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-mdx-docs-context.d.ts","sourceRoot":"","sources":["../../src/context/use-mdx-docs-context.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"use-mdx-docs-context.d.ts","sourceRoot":"","sources":["../../src/context/use-mdx-docs-context.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,cAAc,EAEpB,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EACV,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACrB,MAAM,oCAAoC,CAAA;AAE3C,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAA;AAEpD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED;;G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A2B,CAAA;AAM1E,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC;IACzE,SAAS,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAA;CACnC;AAED,wBAAgB,yBAAyB,CAAC,EACxC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"copy-to-clipboard-icon-button.d.ts","sourceRoot":"","sources":["../../src/copy-to-clipboard/copy-to-clipboard-icon-button.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,OAAO,CAAA;AAIvC,OAAO,EAAa,KAAK,eAAe,EAAC,MAAM,2BAA2B,CAAA;AAM1E,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC;IACzE,SAAS,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAA;CACnC;AAED,wBAAgB,yBAAyB,CAAC,EACxC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,GAAG,YAAY,CAwBrC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{c as _c}from"react/compiler-runtime";import{jsx}from"react/jsx-runtime";import{Check,Copy}from"lucide-react";import{Button}from"@qualcomm-ui/react/button";import{useCopyToClipboard}from"@qualcomm-ui/react-mdx/copy-to-clipboard";import{booleanDataAttr}from"@qualcomm-ui/utils/attributes";function CopyToClipboardButton(t0){let $=_c(7),{code}=t0,t1;$[0]!==code?(t1={valueOrFn:code},$[0]=code,$[1]=t1):t1=$[1];let{copyToClipboard,isCopied}=useCopyToClipboard(t1),t2;if($[2]!==copyToClipboard||$[3]!==isCopied){let t3;$[5]!==copyToClipboard?(t3=event=>{copyToClipboard(),event.preventDefault(),event.stopPropagation()},$[5]=copyToClipboard,$[6]=t3):t3=$[6],t2=jsx(Button,{"data-copied":booleanDataAttr(isCopied),emphasis:"primary",endIcon:isCopied?Check:Copy,onClick:t3,size:"sm",type:"button",variant:"ghost",children:"Copy"}),$[2]=copyToClipboard,$[3]=isCopied,$[4]=t2}else t2=$[4];return t2}import{createGuardedContext}from"@qualcomm-ui/react-core/context";var context=createGuardedContext({hookName:"useCopyToClipboardContext",providerName:"<CopyToClipboardContextProvider>",strict:!0}),CopyToClipboardContextProvider=context[0],useCopyToClipboardContext=context[1];import{c as _c3}from"react/compiler-runtime";import{jsx as jsx2}from"react/jsx-runtime";import{Check as Check2,Copy as Copy2}from"lucide-react";import{IconButton}from"@qualcomm-ui/react/button";import{booleanDataAttr as booleanDataAttr2}from"@qualcomm-ui/utils/attributes";import{mergeProps}from"@qualcomm-ui/utils/merge-props";import{c as _c2}from"react/compiler-runtime";import{useEffect,useState}from"react";function useCopyToClipboard2(props){let $=_c2(8),context2=useCopyToClipboardContext(!1),{valueOrFn}=props,[isCopied,setCopied]=useState(!1),t0,t1;$[0]!==isCopied?(t0=()=>{if(!isCopied)return _temp;let timerId=setTimeout(()=>{setCopied(!1)},2e3);return()=>{clearTimeout(timerId)}},t1=[isCopied],$[0]=isCopied,$[1]=t0,$[2]=t1):(t0=$[1],t1=$[2]),useEffect(t0,t1);let t2;$[3]!==valueOrFn?(t2=()=>{navigator?.clipboard||console.error("Access to clipboard rejected!");let value=typeof valueOrFn=="function"?valueOrFn():valueOrFn;if(!value){console.error("No value to copy!");return}navigator.clipboard.writeText(value).catch(_temp2).finally(()=>{setCopied(!0)})},$[3]=valueOrFn,$[4]=t2):t2=$[4];let copyToClipboard=t2,t3=context2?.copyToClipboard||copyToClipboard,t4=context2?.isCopied??isCopied,t5;return $[5]!==t3||$[6]!==t4?(t5={copyToClipboard:t3,isCopied:t4},$[5]=t3,$[6]=t4,$[7]=t5):t5=$[7],t5}function _temp2(){return console.error("Failed to copy!")}function _temp(){}function CopyToClipboardIconButton(t0){let $=_c3(2),{valueOrFn,...props}=t0,t1;$[0]!==valueOrFn?(t1={valueOrFn},$[0]=valueOrFn,$[1]=t1):t1=$[1];let{copyToClipboard,isCopied}=useCopyToClipboard2(t1),mergedProps=mergeProps({"data-copied":booleanDataAttr2(isCopied),onClick:copyToClipboard},props);return jsx2(IconButton,{className:"qui-code-copy-button",density:"compact",emphasis:"primary",icon:isCopied?Check2:Copy2,size:"md",tabIndex:0,title:"Copy code",variant:"ghost",...mergedProps})}import{c as _c4}from"react/compiler-runtime";import{jsx as jsx3}from"react/jsx-runtime";import{Check as Check3,Copy as Copy3}from"lucide-react";import{InlineIconButton}from"@qualcomm-ui/react/inline-icon-button";import{booleanDataAttr as booleanDataAttr3}from"@qualcomm-ui/utils/attributes";import{mergeProps as mergeProps2}from"@qualcomm-ui/utils/merge-props";function CopyToClipboardInlineIconButton(t0){let $=_c4(2),{valueOrFn,...props}=t0,t1;$[0]!==valueOrFn?(t1={valueOrFn},$[0]=valueOrFn,$[1]=t1):t1=$[1];let{copyToClipboard,isCopied}=useCopyToClipboard2(t1),mergedProps=mergeProps2({"data-copied":booleanDataAttr3(isCopied),onClick:copyToClipboard},props);return jsx3(InlineIconButton,{icon:isCopied?Check3:Copy3,size:"md",tabIndex:0,title:"Copy code",variant:"fixed",...mergedProps})}export{CopyToClipboardButton,CopyToClipboardContextProvider,CopyToClipboardIconButton,CopyToClipboardInlineIconButton,useCopyToClipboard2 as useCopyToClipboard,useCopyToClipboardContext};
|
|
2
|
+
import{c as _c}from"react/compiler-runtime";import{jsx}from"react/jsx-runtime";import{Check,Copy}from"lucide-react";import{Button}from"@qualcomm-ui/react/button";import{useCopyToClipboard}from"@qualcomm-ui/react-mdx/copy-to-clipboard";import{booleanDataAttr}from"@qualcomm-ui/utils/attributes";function CopyToClipboardButton(t0){let $=_c(7),{code}=t0,t1;$[0]!==code?(t1={valueOrFn:code},$[0]=code,$[1]=t1):t1=$[1];let{copyToClipboard,isCopied}=useCopyToClipboard(t1),t2;if($[2]!==copyToClipboard||$[3]!==isCopied){let t3;$[5]!==copyToClipboard?(t3=event=>{copyToClipboard(),event.preventDefault(),event.stopPropagation()},$[5]=copyToClipboard,$[6]=t3):t3=$[6],t2=jsx(Button,{"data-copied":booleanDataAttr(isCopied),emphasis:"primary",endIcon:isCopied?Check:Copy,onClick:t3,size:"sm",type:"button",variant:"ghost",children:"Copy"}),$[2]=copyToClipboard,$[3]=isCopied,$[4]=t2}else t2=$[4];return t2}import{createGuardedContext}from"@qualcomm-ui/react-core/context";var context=createGuardedContext({hookName:"useCopyToClipboardContext",providerName:"<CopyToClipboardContextProvider>",strict:!0}),CopyToClipboardContextProvider=context[0],useCopyToClipboardContext=context[1];import{c as _c3}from"react/compiler-runtime";import{jsx as jsx2}from"react/jsx-runtime";import{Check as Check2,Copy as Copy2}from"lucide-react";import{IconButton}from"@qualcomm-ui/react/button";import{booleanDataAttr as booleanDataAttr2}from"@qualcomm-ui/utils/attributes";import{mergeProps}from"@qualcomm-ui/utils/merge-props";import{c as _c2}from"react/compiler-runtime";import{useEffect,useState}from"react";function useCopyToClipboard2(props){let $=_c2(8),context2=useCopyToClipboardContext(!1),{valueOrFn}=props,[isCopied,setCopied]=useState(!1),t0,t1;$[0]!==isCopied?(t0=()=>{if(!isCopied)return _temp;let timerId=setTimeout(()=>{setCopied(!1)},2e3);return()=>{clearTimeout(timerId)}},t1=[isCopied],$[0]=isCopied,$[1]=t0,$[2]=t1):(t0=$[1],t1=$[2]),useEffect(t0,t1);let t2;$[3]!==valueOrFn?(t2=()=>{navigator?.clipboard||console.error("Access to clipboard rejected!");let value=typeof valueOrFn=="function"?valueOrFn():valueOrFn;if(!value){console.error("No value to copy!");return}navigator.clipboard.writeText(value).catch(_temp2).finally(()=>{setCopied(!0)})},$[3]=valueOrFn,$[4]=t2):t2=$[4];let copyToClipboard=t2,t3=context2?.copyToClipboard||copyToClipboard,t4=context2?.isCopied??isCopied,t5;return $[5]!==t3||$[6]!==t4?(t5={copyToClipboard:t3,isCopied:t4},$[5]=t3,$[6]=t4,$[7]=t5):t5=$[7],t5}function _temp2(){return console.error("Failed to copy!")}function _temp(){}function CopyToClipboardIconButton(t0){let $=_c3(2),{valueOrFn,...props}=t0,t1;$[0]!==valueOrFn?(t1={valueOrFn},$[0]=valueOrFn,$[1]=t1):t1=$[1];let{copyToClipboard,isCopied}=useCopyToClipboard2(t1),mergedProps=mergeProps({"data-copied":booleanDataAttr2(isCopied),onClick:copyToClipboard},props);return jsx2(IconButton,{"aria-label":"Copy code to clipboard",className:"qui-code-copy-button",density:"compact",emphasis:"primary",icon:isCopied?Check2:Copy2,size:"md",tabIndex:0,title:"Copy code to clipboard",variant:"ghost",...mergedProps})}import{c as _c4}from"react/compiler-runtime";import{jsx as jsx3}from"react/jsx-runtime";import{Check as Check3,Copy as Copy3}from"lucide-react";import{InlineIconButton}from"@qualcomm-ui/react/inline-icon-button";import{booleanDataAttr as booleanDataAttr3}from"@qualcomm-ui/utils/attributes";import{mergeProps as mergeProps2}from"@qualcomm-ui/utils/merge-props";function CopyToClipboardInlineIconButton(t0){let $=_c4(2),{valueOrFn,...props}=t0,t1;$[0]!==valueOrFn?(t1={valueOrFn},$[0]=valueOrFn,$[1]=t1):t1=$[1];let{copyToClipboard,isCopied}=useCopyToClipboard2(t1),mergedProps=mergeProps2({"data-copied":booleanDataAttr3(isCopied),onClick:copyToClipboard},props);return jsx3(InlineIconButton,{icon:isCopied?Check3:Copy3,size:"md",tabIndex:0,title:"Copy code",variant:"fixed",...mergedProps})}export{CopyToClipboardButton,CopyToClipboardContextProvider,CopyToClipboardIconButton,CopyToClipboardInlineIconButton,useCopyToClipboard2 as useCopyToClipboard,useCopyToClipboardContext};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/copy-to-clipboard/copy-to-clipboard-button.tsx", "../../src/copy-to-clipboard/copy-to-clipboard-context.ts", "../../src/copy-to-clipboard/copy-to-clipboard-icon-button.tsx", "../../src/copy-to-clipboard/use-copy-to-clipboard.ts", "../../src/copy-to-clipboard/copy-to-clipboard-inline-icon-button.tsx"],
|
|
4
|
-
"sourcesContent": ["import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Check, Copy } from \"lucide-react\";\nimport { Button } from \"@qualcomm-ui/react/button\";\nimport { useCopyToClipboard } from \"@qualcomm-ui/react-mdx/copy-to-clipboard\";\nimport { booleanDataAttr } from \"@qualcomm-ui/utils/attributes\";\nexport function CopyToClipboardButton(t0) {\n const $ = _c(7);\n const {\n code\n } = t0;\n let t1;\n if ($[0] !== code) {\n t1 = {\n valueOrFn: code\n };\n $[0] = code;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const {\n copyToClipboard,\n isCopied\n } = useCopyToClipboard(t1);\n let t2;\n if ($[2] !== copyToClipboard || $[3] !== isCopied) {\n let t3;\n if ($[5] !== copyToClipboard) {\n t3 = event => {\n copyToClipboard();\n event.preventDefault();\n event.stopPropagation();\n };\n $[5] = copyToClipboard;\n $[6] = t3;\n } else {\n t3 = $[6];\n }\n t2 = jsx(Button, {\n \"data-copied\": booleanDataAttr(isCopied),\n emphasis: \"primary\",\n endIcon: isCopied ? Check : Copy,\n onClick: t3,\n size: \"sm\",\n type: \"button\",\n variant: \"ghost\",\n children: \"Copy\"\n });\n $[2] = copyToClipboard;\n $[3] = isCopied;\n $[4] = t2;\n } else {\n t2 = $[4];\n }\n return t2;\n}", "import { createGuardedContext } from \"@qualcomm-ui/react-core/context\";\nconst context = createGuardedContext({\n hookName: \"useCopyToClipboardContext\",\n providerName: \"<CopyToClipboardContextProvider>\",\n strict: true\n});\nexport const CopyToClipboardContextProvider = context[0];\nexport const useCopyToClipboardContext = context[1];", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Check, Copy } from \"lucide-react\";\nimport { IconButton } from \"@qualcomm-ui/react/button\";\nimport { booleanDataAttr } from \"@qualcomm-ui/utils/attributes\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useCopyToClipboard } from \"./use-copy-to-clipboard\";\nexport function CopyToClipboardIconButton(t0) {\n const $ = _c(2);\n const {\n valueOrFn,\n ...props\n } = t0;\n let t1;\n if ($[0] !== valueOrFn) {\n t1 = {\n valueOrFn\n };\n $[0] = valueOrFn;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const {\n copyToClipboard,\n isCopied\n } = useCopyToClipboard(t1);\n const mergedProps = mergeProps({\n \"data-copied\": booleanDataAttr(isCopied),\n onClick: copyToClipboard\n }, props);\n return jsx(IconButton, {\n className: \"qui-code-copy-button\",\n density: \"compact\",\n emphasis: \"primary\",\n icon: isCopied ? Check : Copy,\n size: \"md\",\n tabIndex: 0,\n title: \"Copy code\",\n variant: \"ghost\",\n ...mergedProps\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { useCopyToClipboardContext } from \"./copy-to-clipboard-context\";\nexport function useCopyToClipboard(props) {\n const $ = _c(8);\n const context = useCopyToClipboardContext(false);\n const {\n valueOrFn\n } = props;\n const [isCopied, setCopied] = useState(false);\n let t0;\n let t1;\n if ($[0] !== isCopied) {\n t0 = () => {\n if (!isCopied) {\n return _temp;\n }\n const timerId = setTimeout(() => {\n setCopied(false);\n }, 2000);\n return () => {\n clearTimeout(timerId);\n };\n };\n t1 = [isCopied];\n $[0] = isCopied;\n $[1] = t0;\n $[2] = t1;\n } else {\n t0 = $[1];\n t1 = $[2];\n }\n useEffect(t0, t1);\n let t2;\n if ($[3] !== valueOrFn) {\n t2 = () => {\n if (!navigator?.clipboard) {\n console.error(\"Access to clipboard rejected!\");\n }\n const value = typeof valueOrFn === \"function\" ? valueOrFn() : valueOrFn;\n if (!value) {\n console.error(\"No value to copy!\");\n return;\n }\n navigator.clipboard.writeText(value).catch(_temp2).finally(() => {\n setCopied(true);\n });\n };\n $[3] = valueOrFn;\n $[4] = t2;\n } else {\n t2 = $[4];\n }\n const copyToClipboard = t2;\n const t3 = context?.copyToClipboard || copyToClipboard;\n const t4 = context?.isCopied ?? isCopied;\n let t5;\n if ($[5] !== t3 || $[6] !== t4) {\n t5 = {\n copyToClipboard: t3,\n isCopied: t4\n };\n $[5] = t3;\n $[6] = t4;\n $[7] = t5;\n } else {\n t5 = $[7];\n }\n return t5;\n}\nfunction _temp2() {\n return console.error(\"Failed to copy!\");\n}\nfunction _temp() {}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Check, Copy } from \"lucide-react\";\nimport { InlineIconButton } from \"@qualcomm-ui/react/inline-icon-button\";\nimport { booleanDataAttr } from \"@qualcomm-ui/utils/attributes\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useCopyToClipboard } from \"./use-copy-to-clipboard\";\nexport function CopyToClipboardInlineIconButton(t0) {\n const $ = _c(2);\n const {\n valueOrFn,\n ...props\n } = t0;\n let t1;\n if ($[0] !== valueOrFn) {\n t1 = {\n valueOrFn\n };\n $[0] = valueOrFn;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const {\n copyToClipboard,\n isCopied\n } = useCopyToClipboard(t1);\n const mergedProps = mergeProps({\n \"data-copied\": booleanDataAttr(isCopied),\n onClick: copyToClipboard\n }, props);\n return jsx(InlineIconButton, {\n icon: isCopied ? Check : Copy,\n size: \"md\",\n tabIndex: 0,\n title: \"Copy code\",\n variant: \"fixed\",\n ...mergedProps\n });\n}"],
|
|
5
|
-
"mappings": ";AAAA,OAAS,KAAK,OAAU,yBACxB,OAAS,QAAW,oBACpB,OAAS,MAAO,SAAY,eAC5B,OAAS,WAAc,4BACvB,OAAS,uBAA0B,2CACnC,OAAS,oBAAuB,gCACzB,SAAS,sBAAsB,GAAI,CACxC,IAAM,EAAI,GAAG,CAAC,EACR,CACJ,IACF,EAAI,GACA,GACA,EAAE,CAAC,IAAM,MACX,GAAK,CACH,UAAW,IACb,EACA,EAAE,CAAC,EAAI,KACP,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ACF,EAAIC,oBAAmB,EAAE,EACnB,YAAc,WAAW,CAC7B,cAAeC,iBAAgB,QAAQ,EACvC,QAAS,eACX,EAAG,KAAK,EACR,OAAOC,KAAI,WAAY,CACrB,UAAW,uBACX,QAAS,UACT,SAAU,UACV,KAAM,SAAWC,OAAQC,MACzB,KAAM,KACN,SAAU,EACV,MAAO,
|
|
4
|
+
"sourcesContent": ["import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Check, Copy } from \"lucide-react\";\nimport { Button } from \"@qualcomm-ui/react/button\";\nimport { useCopyToClipboard } from \"@qualcomm-ui/react-mdx/copy-to-clipboard\";\nimport { booleanDataAttr } from \"@qualcomm-ui/utils/attributes\";\nexport function CopyToClipboardButton(t0) {\n const $ = _c(7);\n const {\n code\n } = t0;\n let t1;\n if ($[0] !== code) {\n t1 = {\n valueOrFn: code\n };\n $[0] = code;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const {\n copyToClipboard,\n isCopied\n } = useCopyToClipboard(t1);\n let t2;\n if ($[2] !== copyToClipboard || $[3] !== isCopied) {\n let t3;\n if ($[5] !== copyToClipboard) {\n t3 = event => {\n copyToClipboard();\n event.preventDefault();\n event.stopPropagation();\n };\n $[5] = copyToClipboard;\n $[6] = t3;\n } else {\n t3 = $[6];\n }\n t2 = jsx(Button, {\n \"data-copied\": booleanDataAttr(isCopied),\n emphasis: \"primary\",\n endIcon: isCopied ? Check : Copy,\n onClick: t3,\n size: \"sm\",\n type: \"button\",\n variant: \"ghost\",\n children: \"Copy\"\n });\n $[2] = copyToClipboard;\n $[3] = isCopied;\n $[4] = t2;\n } else {\n t2 = $[4];\n }\n return t2;\n}", "import { createGuardedContext } from \"@qualcomm-ui/react-core/context\";\nconst context = createGuardedContext({\n hookName: \"useCopyToClipboardContext\",\n providerName: \"<CopyToClipboardContextProvider>\",\n strict: true\n});\nexport const CopyToClipboardContextProvider = context[0];\nexport const useCopyToClipboardContext = context[1];", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Check, Copy } from \"lucide-react\";\nimport { IconButton } from \"@qualcomm-ui/react/button\";\nimport { booleanDataAttr } from \"@qualcomm-ui/utils/attributes\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useCopyToClipboard } from \"./use-copy-to-clipboard\";\nexport function CopyToClipboardIconButton(t0) {\n const $ = _c(2);\n const {\n valueOrFn,\n ...props\n } = t0;\n let t1;\n if ($[0] !== valueOrFn) {\n t1 = {\n valueOrFn\n };\n $[0] = valueOrFn;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const {\n copyToClipboard,\n isCopied\n } = useCopyToClipboard(t1);\n const mergedProps = mergeProps({\n \"data-copied\": booleanDataAttr(isCopied),\n onClick: copyToClipboard\n }, props);\n return jsx(IconButton, {\n \"aria-label\": \"Copy code to clipboard\",\n className: \"qui-code-copy-button\",\n density: \"compact\",\n emphasis: \"primary\",\n icon: isCopied ? Check : Copy,\n size: \"md\",\n tabIndex: 0,\n title: \"Copy code to clipboard\",\n variant: \"ghost\",\n ...mergedProps\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { useCopyToClipboardContext } from \"./copy-to-clipboard-context\";\nexport function useCopyToClipboard(props) {\n const $ = _c(8);\n const context = useCopyToClipboardContext(false);\n const {\n valueOrFn\n } = props;\n const [isCopied, setCopied] = useState(false);\n let t0;\n let t1;\n if ($[0] !== isCopied) {\n t0 = () => {\n if (!isCopied) {\n return _temp;\n }\n const timerId = setTimeout(() => {\n setCopied(false);\n }, 2000);\n return () => {\n clearTimeout(timerId);\n };\n };\n t1 = [isCopied];\n $[0] = isCopied;\n $[1] = t0;\n $[2] = t1;\n } else {\n t0 = $[1];\n t1 = $[2];\n }\n useEffect(t0, t1);\n let t2;\n if ($[3] !== valueOrFn) {\n t2 = () => {\n if (!navigator?.clipboard) {\n console.error(\"Access to clipboard rejected!\");\n }\n const value = typeof valueOrFn === \"function\" ? valueOrFn() : valueOrFn;\n if (!value) {\n console.error(\"No value to copy!\");\n return;\n }\n navigator.clipboard.writeText(value).catch(_temp2).finally(() => {\n setCopied(true);\n });\n };\n $[3] = valueOrFn;\n $[4] = t2;\n } else {\n t2 = $[4];\n }\n const copyToClipboard = t2;\n const t3 = context?.copyToClipboard || copyToClipboard;\n const t4 = context?.isCopied ?? isCopied;\n let t5;\n if ($[5] !== t3 || $[6] !== t4) {\n t5 = {\n copyToClipboard: t3,\n isCopied: t4\n };\n $[5] = t3;\n $[6] = t4;\n $[7] = t5;\n } else {\n t5 = $[7];\n }\n return t5;\n}\nfunction _temp2() {\n return console.error(\"Failed to copy!\");\n}\nfunction _temp() {}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Check, Copy } from \"lucide-react\";\nimport { InlineIconButton } from \"@qualcomm-ui/react/inline-icon-button\";\nimport { booleanDataAttr } from \"@qualcomm-ui/utils/attributes\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useCopyToClipboard } from \"./use-copy-to-clipboard\";\nexport function CopyToClipboardInlineIconButton(t0) {\n const $ = _c(2);\n const {\n valueOrFn,\n ...props\n } = t0;\n let t1;\n if ($[0] !== valueOrFn) {\n t1 = {\n valueOrFn\n };\n $[0] = valueOrFn;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const {\n copyToClipboard,\n isCopied\n } = useCopyToClipboard(t1);\n const mergedProps = mergeProps({\n \"data-copied\": booleanDataAttr(isCopied),\n onClick: copyToClipboard\n }, props);\n return jsx(InlineIconButton, {\n icon: isCopied ? Check : Copy,\n size: \"md\",\n tabIndex: 0,\n title: \"Copy code\",\n variant: \"fixed\",\n ...mergedProps\n });\n}"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,KAAK,OAAU,yBACxB,OAAS,QAAW,oBACpB,OAAS,MAAO,SAAY,eAC5B,OAAS,WAAc,4BACvB,OAAS,uBA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IAAG,CAAC,EACR,CACJ,UACA,GAAG,KACL,EAAI,GACA,GACA,EAAE,CAAC,IAAM,WACX,GAAK,CACH,SACF,EACA,EAAE,CAAC,EAAI,UACP,EAAE,CAAC,EAAI,IAEP,GAAK,EAAE,CAAC,EAEV,GAAM,CACJ,gBACA,QACF,EAAIC,oBAAmB,EAAE,EACnB,YAAc,WAAW,CAC7B,cAAeC,iBAAgB,QAAQ,EACvC,QAAS,eACX,EAAG,KAAK,EACR,OAAOC,KAAI,WAAY,CACrB,aAAc,yBACd,UAAW,uBACX,QAAS,UACT,SAAU,UACV,KAAM,SAAWC,OAAQC,MACzB,KAAM,KACN,SAAU,EACV,MAAO,yBACP,QAAS,QACT,GAAG,WACL,CAAC,CACH,CE3CA,OAAS,KAAKC,QAAU,yBACxB,OAAS,OAAAC,SAAW,oBACpB,OAAS,SAAAC,OAAO,QAAAC,UAAY,eAC5B,OAAS,qBAAwB,wCACjC,OAAS,mBAAAC,qBAAuB,gCAChC,OAAS,cAAAC,gBAAkB,iCAEpB,SAAS,gCAAgC,GAAI,CAClD,IAAM,EAAIC,IAAG,CAAC,EACR,CACJ,UACA,GAAG,KACL,EAAI,GACA,GACA,EAAE,CAAC,IAAM,WACX,GAAK,CACH,SACF,EACA,EAAE,CAAC,EAAI,UACP,EAAE,CAAC,EAAI,IAEP,GAAK,EAAE,CAAC,EAEV,GAAM,CACJ,gBACA,QACF,EAAIC,oBAAmB,EAAE,EACnB,YAAcC,YAAW,CAC7B,cAAeC,iBAAgB,QAAQ,EACvC,QAAS,eACX,EAAG,KAAK,EACR,OAAOC,KAAI,iBAAkB,CAC3B,KAAM,SAAWC,OAAQC,MACzB,KAAM,KACN,SAAU,EACV,MAAO,YACP,QAAS,QACT,GAAG,WACL,CAAC,CACH",
|
|
6
6
|
"names": ["_c", "jsx", "Check", "Copy", "booleanDataAttr", "_c", "useCopyToClipboard", "_c", "context", "_c", "useCopyToClipboard", "booleanDataAttr", "jsx", "Check", "Copy", "_c", "jsx", "Check", "Copy", "booleanDataAttr", "mergeProps", "_c", "useCopyToClipboard", "mergeProps", "booleanDataAttr", "jsx", "Check", "Copy"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{Fragment as Fragment4,jsx as jsx16,jsxs as jsxs8}from"react/jsx-runtime";import{jsx}from"react/jsx-runtime";import{PolymorphicElement}from"@qualcomm-ui/react-core/system";import{clsx}from"@qualcomm-ui/utils/clsx";function DocsFooter({children,className,ref,...props}){return jsx(PolymorphicElement,{ref,as:"div",className:clsx("qui-docs__footer",className),...props,children})}import{jsx as jsx2}from"react/jsx-runtime";import{PolymorphicElement as PolymorphicElement2}from"@qualcomm-ui/react-core/system";import{booleanDataAttr}from"@qualcomm-ui/utils/attributes";import{clsx as clsx2}from"@qualcomm-ui/utils/clsx";import{createContext,useContext}from"react";var MdxDocsLayoutContext=createContext(null),MdxDocsLayoutContextProvider=MdxDocsLayoutContext.Provider;function useMdxDocsLayoutContext(){let context=useContext(MdxDocsLayoutContext);if(!context)throw new Error("useMdxDocsLayoutContext can only be used as children of a <Layout.Root> instance.");return context}function AppContent(t0){let{children,className,...props}=t0,{hideSideNav,showToc}=useMdxDocsLayoutContext();return jsx2(PolymorphicElement2,{as:"div",className:clsx2("qui-docs__app-content",className),"data-hide-side-nav":booleanDataAttr(hideSideNav),"data-hide-toc":booleanDataAttr(!showToc),...props,children})}import{c as _c}from"react/compiler-runtime";import{jsx as jsx3}from"react/jsx-runtime";import"react";import{Breadcrumbs}from"@qualcomm-ui/react/breadcrumbs";import{PolymorphicElement as PolymorphicElement3}from"@qualcomm-ui/react-core/system";import{useMdxDocsContext}from"@qualcomm-ui/react-mdx/context";import{clsx as clsx3}from"@qualcomm-ui/utils/clsx";function DocsBreadcrumbs(t0){let $=_c(7),{className,rootBreadcrumb,...props}=t0,{renderLink:Link4}=useMdxDocsContext(),{pageMap,pathname}=useMdxDocsLayoutContext(),t1;bb0:{let pageMapEntry=pageMap[pathname];if(!pageMapEntry||pageMapEntry.hideBreadcrumbs){let t22;$[0]===Symbol.for("react.memo_cache_sentinel")?(t22=[],$[0]=t22):t22=$[0],t1=t22;break bb0}let t2;if($[1]!==Link4||$[2]!==pageMap||$[3]!==pageMapEntry.categories||$[4]!==pageMapEntry.pathSegments||$[5]!==rootBreadcrumb){let mergedPath="",crumbs=pageMapEntry.pathSegments.reduce((acc,segment,currentIndex)=>{mergedPath=`${mergedPath}/${segment}`;let route=pageMap[mergedPath],pageTitle=pageMapEntry.categories[currentIndex]??route.title;return acc.push({children:pageTitle,id:route?.pathname??route?.id??pageTitle,render:route?.pathname?jsx3(Link4,{href:route.pathname}):jsx3("button",{style:{pointerEvents:"none"}})}),acc},[]);t2=rootBreadcrumb?[{...rootBreadcrumb,id:"/"},...crumbs]:crumbs,$[1]=Link4,$[2]=pageMap,$[3]=pageMapEntry.categories,$[4]=pageMapEntry.pathSegments,$[5]=rootBreadcrumb,$[6]=t2}else t2=$[6];t1=t2}let items=t1;return items.length?jsx3(PolymorphicElement3,{className:clsx3("qui-docs__breadcrumbs",className),...props,children:jsx3(Breadcrumbs.Root,{emphasis:"neutral",children:jsx3(Breadcrumbs.List,{children:items.map(_temp)})})}):null}function _temp(item){return jsx3(Breadcrumbs.Item,{...item},item.id)}import{jsx as jsx4}from"react/jsx-runtime";import{PolymorphicElement as PolymorphicElement4}from"@qualcomm-ui/react-core/system";import{clsx as clsx4}from"@qualcomm-ui/utils/clsx";function ContentWrapper({children,className,...props}){return jsx4(PolymorphicElement4,{as:"div",className:clsx4("qui-docs__content-wrapper",className),...props,children})}import{c as _c2}from"react/compiler-runtime";import{jsx as jsx5}from"react/jsx-runtime";import{useRef}from"react";import{useSafeLayoutEffect}from"@qualcomm-ui/react-core/effects";import{useMergedRef}from"@qualcomm-ui/react-core/refs";import{PolymorphicElement as PolymorphicElement5}from"@qualcomm-ui/react-core/system";import{PropsContextProvider}from"@qualcomm-ui/react-mdx/typedoc";import{clsx as clsx5}from"@qualcomm-ui/utils/clsx";function MainContent(t0){let $=_c2(5),{children,className,id:t1,ref:refProp,...props}=t0,id=t1===void 0?"main-content":t1,ref=useRef(null),{mainContentElement,pageProps,setMainContentElement}=useMdxDocsLayoutContext(),t2;$[0]!==mainContentElement||$[1]!==setMainContentElement?(t2=()=>{mainContentElement!==ref.current&&setMainContentElement(ref.current)},$[0]=mainContentElement,$[1]=setMainContentElement,$[2]=t2):t2=$[2];let t3;$[3]!==mainContentElement?(t3=[mainContentElement],$[3]=mainContentElement,$[4]=t3):t3=$[4],useSafeLayoutEffect(t2,t3);let refs=useMergedRef(refProp,ref);return jsx5(PolymorphicElement5,{ref:refs,as:"article",className:clsx5("qui-docs__main-content",className),id,...props,children:jsx5(PropsContextProvider,{value:pageProps,children})})}import{c as _c3}from"react/compiler-runtime";import{Fragment,jsx as jsx6,jsxs}from"react/jsx-runtime";import"react";import{ChevronLeft,ChevronRight}from"lucide-react";import{Link}from"@qualcomm-ui/react/link";import{bindingRenderProp,PolymorphicElement as PolymorphicElement6}from"@qualcomm-ui/react-core/system";import{useMdxDocsContext as useMdxDocsContext2}from"@qualcomm-ui/react-mdx/context";import{booleanDataAttr as booleanDataAttr2}from"@qualcomm-ui/utils/attributes";import{capitalCase}from"@qualcomm-ui/utils/change-case";import{clsx as clsx6}from"@qualcomm-ui/utils/clsx";import{TreeCollection}from"@qualcomm-ui/utils/collection";function PageLink({currentPage,pageLink,prev,renderLink:RenderLink}){let pathSegments=currentPage?currentPage.pathSegments:[],nextPathSegments=pageLink.pathSegments,pathSegment=nextPathSegments[0]!==pathSegments[0]?capitalCase(nextPathSegments[0]??""):"";return bindingRenderProp(jsx6(RenderLink,{href:pageLink.pathname}),{children:jsx6(Fragment,{children:jsxs("span",{className:"qui-page-link__container",children:[prev?jsx6(Link,{render:jsx6("div",{}),startIcon:ChevronLeft,children:pageLink.title}):jsx6(Link,{endIcon:ChevronRight,render:jsx6("div",{}),children:pageLink.title}),pathSegment&&pathSegment!==pageLink.title?jsx6("div",{className:"qui-page-link__adjacent-route-title","data-next":booleanDataAttr2(!prev),children:pathSegment}):null]})}),className:"qui-page-link__root","data-next":booleanDataAttr2(!prev)})}function PageLinks(t0){let $=_c3(5),{className,...props}=t0,{renderLink}=useMdxDocsContext2(),{navItems,pathname}=useMdxDocsLayoutContext(),t1;$[0]!==navItems?(t1=new TreeCollection({nodeChildren:"items",nodeText:"title",nodeValue:"id",rootNode:{depth:0,id:"ROOT",items:navItems,pathSegments:[],title:""}}).flatten().filter(_temp2),$[0]=navItems,$[1]=t1):t1=$[1];let flattenedItems=t1,t2;$[2]!==flattenedItems||$[3]!==pathname?(t2=getPageLinks(flattenedItems,pathname),$[2]=flattenedItems,$[3]=pathname,$[4]=t2):t2=$[4];let[prevPage,nextPage,currentPage]=t2;return jsxs(PolymorphicElement6,{as:"div",className:clsx6("qui-page-links__container",className),...props,children:[jsx6("div",{className:"qui-page-links__link-wrapper",children:prevPage?jsx6(PageLink,{currentPage,pageLink:prevPage,prev:!0,renderLink}):null}),jsx6("div",{className:"qui-page-links__link-wrapper",children:nextPage?jsx6(PageLink,{currentPage,pageLink:nextPage,renderLink}):null})]})}function _temp2(item){return item.pathname}function getPageLinks(items,route){let index=items.findIndex(item=>item.id===route);if(index===-1)return[!1,!1,!1];let prevPage=items[index-1],nextPage=items[index+1];return[prevPage??!1,nextPage??!1,items[index]]}import{c as _c6}from"react/compiler-runtime";import{jsx as jsx12}from"react/jsx-runtime";import{useState as useState2}from"react";import{bindingRenderProp as bindingRenderProp2,PolymorphicElement as PolymorphicElement9}from"@qualcomm-ui/react-core/system";import{MdxDocsProvider,useSiteContext}from"@qualcomm-ui/react-mdx/context";import{mergeProps as mergeProps2}from"@qualcomm-ui/utils/merge-props";import{c as _c5}from"react/compiler-runtime";import{jsx as jsx11}from"react/jsx-runtime";import"react";import{MDXProvider}from"@mdx-js/react";import{Link as Link3}from"@qualcomm-ui/react/link";import{Table}from"@qualcomm-ui/react/table";import{useMdxDocsContext as useMdxDocsContext3}from"@qualcomm-ui/react-mdx/context";import{SpoilerContent,SpoilerRoot,SpoilerSummary}from"@qualcomm-ui/react-mdx/spoiler";import{jsx as jsx7,jsxs as jsxs2}from"react/jsx-runtime";import{useState}from"react";import{Link2}from"lucide-react";import{Icon}from"@qualcomm-ui/react/icon";import{PolymorphicElement as PolymorphicElement7}from"@qualcomm-ui/react-core/system";function AnchorHeader({children,className,id,ref,renderLink:RenderLink,...props}){let[hovered,setHovered]=useState(!1);return jsx7(PolymorphicElement7,{ref,as:"span",className,id,onMouseEnter:()=>setHovered(!0),onMouseLeave:()=>setHovered(!1),...props,children:jsxs2(RenderLink,{className:"qui-docs-heading",href:`#${id}`,children:[jsx7("span",{className:"qui-docs-heading-text",children}),hovered?jsx7(Icon,{icon:Link2,size:"md"}):null]})})}import{jsx as jsx8,jsxs as jsxs3}from"react/jsx-runtime";import{Children,isValidElement}from"react";import{Tab,Tabs}from"@qualcomm-ui/react/tabs";import{mergeProps}from"@qualcomm-ui/utils/merge-props";function CodeTabs({children,...props}){let tabs=Children.toArray(children).filter(child=>isValidElement(child)),mergedProps=mergeProps({className:"mdx qui-code-tabs"},props),firstTab=tabs[0]?.props?.label;return jsxs3(Tabs.Root,{defaultValue:firstTab,...mergedProps,children:[jsxs3(Tabs.List,{className:"mdx",children:[jsx8(Tabs.Indicator,{}),tabs.map(tab=>{let label=tab.props?.label;return jsx8(Tab.Root,{value:label,children:jsx8(Tab.Button,{children:tab.props?.label})},label)})]}),tabs.map(tab=>{let label=tab.props?.label;return jsx8(Tabs.Panel,{className:"mdx",value:label,children:tab.props?.children},label)})]})}import{jsx as jsx9,jsxs as jsxs4}from"react/jsx-runtime";import{useRef as useRef2}from"react";import{CopyToClipboardIconButton}from"@qualcomm-ui/react-mdx/copy-to-clipboard";import{clsx as clsx7}from"@qualcomm-ui/utils/clsx";function ShikiPre({children,className,"data-code":code,...props}){let preRef=useRef2(null);return jsxs4("div",{className:"shiki-wrapper mdx",children:[jsx9("pre",{ref:preRef,className:clsx7("mdx",className),...props,tabIndex:-1,children}),jsx9(CopyToClipboardIconButton,{valueOrFn:()=>code||preRef.current.innerText})]})}import{c as _c4}from"react/compiler-runtime";import{jsx as jsx10}from"react/jsx-runtime";import{useEffect,useRef as useRef3}from"react";import{useMergedRef as useMergedRef2}from"@qualcomm-ui/react-core/refs";import{PolymorphicElement as PolymorphicElement8}from"@qualcomm-ui/react-core/system";function TocLink(t0){let $=_c4(5),{active,ref:refProp,...props}=t0,localRef=useRef3(null),ref=useMergedRef2(refProp,localRef),t1;$[0]!==active?(t1=()=>{active&&localRef.current&&localRef.current?.scrollIntoView?.({block:"nearest"})},$[0]=active,$[1]=t1):t1=$[1];let t2;return $[2]!==active||$[3]!==ref?(t2=[active,ref],$[2]=active,$[3]=ref,$[4]=t2):t2=$[4],useEffect(t1,t2),jsx10(PolymorphicElement8,{ref,as:"div",className:"qui-toc__link",...props})}function MdxProvider(t0){let $=_c5(18),{children,components}=t0,{renderLink:RenderLink}=useMdxDocsContext3(),t1;$[0]!==RenderLink?(t1=t22=>{let{href:t32,ref:_ref,...props}=t22,href=t32===void 0?"":t32;return!href.startsWith("http")?jsx11(Link3,{emphasis:"primary",render:jsx11(RenderLink,{href:href.startsWith("./#")?href.substring(2):href}),...props}):jsx11(Link3,{emphasis:"primary",href,...props,target:"_blank"})},$[0]=RenderLink,$[1]=t1):t1=$[1];let t2;$[2]!==children?(t2=props_3=>jsx11("div",{...props_3,children}),$[2]=children,$[3]=t2):t2=$[3];let t3,t4,t5;$[4]!==RenderLink?(t3=t62=>{let{children:children2_0,id:id_0}=t62;return jsx11(AnchorHeader,{className:"mdx",id:id_0||void 0,render:jsx11("h2",{}),renderLink:RenderLink,children:children2_0})},t4=t72=>{let{children:children2_1,id:id_1}=t72;return jsx11(AnchorHeader,{className:"mdx",id:id_1||void 0,render:jsx11("h3",{}),renderLink:RenderLink,children:children2_1})},t5=t82=>{let{children:children2_2,id:id_2}=t82;return jsx11(AnchorHeader,{className:"mdx",id:id_2||void 0,render:jsx11("h4",{}),renderLink:RenderLink,children:children2_2})},$[4]=RenderLink,$[5]=t3,$[6]=t4,$[7]=t5):(t3=$[5],t4=$[6],t5=$[7]);let t6;$[8]!==components||$[9]!==t1||$[10]!==t2||$[11]!==t3||$[12]!==t4||$[13]!==t5?(t6={a:t1,blockquote:_temp23,br:_temp22,code:_temp3,CodeTab:t2,CodeTabs,em:_temp4,h1:_temp5,h2:t3,h3:t4,h4:t5,h5:_temp6,h6:_temp7,hr:_temp8,img:_temp9,li:_temp0,ol:_temp1,p:_temp10,pre:_temp11,SpoilerContent,SpoilerRoot,SpoilerSummary,strong:_temp12,sup:_temp13,table:_temp14,tbody:_temp15,td:_temp16,tfoot:_temp17,th:_temp18,thead:_temp19,tr:_temp20,ul:_temp21,...components},$[8]=components,$[9]=t1,$[10]=t2,$[11]=t3,$[12]=t4,$[13]=t5,$[14]=t6):t6=$[14];let t7=t6,t8;return $[15]!==children||$[16]!==t7?(t8=jsx11(MDXProvider,{components:t7,children}),$[15]=children,$[16]=t7,$[17]=t8):t8=$[17],t8}function _temp21(props_23){return jsx11("ul",{className:"mdx",...props_23})}function _temp20(props_22){return jsx11(Table.Row,{className:"mdx",...props_22})}function _temp19(props_21){return jsx11(Table.Header,{className:"mdx",...props_21})}function _temp18(props_20){return jsx11(Table.HeaderCell,{className:"mdx",...props_20})}function _temp17(props_19){return jsx11(Table.Footer,{className:"mdx",...props_19})}function _temp16(props_18){return jsx11(Table.Cell,{className:"mdx",...props_18})}function _temp15(props_17){return jsx11(Table.Body,{className:"mdx",...props_17})}function _temp14(t0){let{children:children2_4,...props_16}=t0;return jsx11("div",{className:"mdx table-wrapper",children:jsx11(Table.Root,{className:"mdx",...props_16,children:jsx11(Table.Table,{className:"mdx",children:children2_4})})})}function _temp13(props_15){return jsx11("sup",{className:"mdx",...props_15})}function _temp12(props_14){return jsx11("strong",{className:"mdx font-semibold",...props_14})}function _temp11(t0){let{children:children2_3,...props_13}=t0;return jsx11(ShikiPre,{...props_13,children:children2_3})}function _temp10(props_12){return jsx11("p",{className:"mdx",...props_12})}function _temp1(props_11){return jsx11("ol",{className:"mdx",...props_11})}function _temp0(props_10){return jsx11("li",{className:"mdx",...props_10})}function _temp9(props_9){return jsx11("img",{className:"mdx",...props_9})}function _temp8(props_8){return jsx11("hr",{className:"mdx",...props_8})}function _temp7(t0){let{id:id_4,...props_7}=t0;return jsx11("h6",{className:"mdx",id:id_4||void 0,...props_7})}function _temp6(t0){let{id:id_3,...props_6}=t0;return jsx11("h5",{className:"mdx",id:id_3||void 0,...props_6})}function _temp5(t0){let{children:children2,id,...props_5}=t0;return jsx11("h1",{className:"mdx",id:id||void 0,...props_5,children:children2})}function _temp4(props_4){return jsx11("em",{className:"mdx",...props_4})}function _temp3(props_2){return jsx11("code",{className:"mdx",...props_2})}function _temp22(props_1){return jsx11("br",{className:"mdx",...props_1})}function _temp23(props_0){return jsx11("blockquote",{className:"mdx",...props_0})}function Root(t0){let $=_c6(30),{children,demoState:demoStateProp,docProps,hideToc,mdxComponents,onDemoStateChange,onPackageManagerChange,packageManager:t1,pathname,renderLink,ssrUserAgent,tocHighlightStrategy:t2,...props}=t0,packageManagerProp=t1===void 0?"npm":t1,tocHighlightStrategy=t2===void 0?"nearest":t2,[mainContentElement,setMainContentElement]=useState2(null),[packageManager,setPackageManager]=useState2(packageManagerProp),t3;$[0]!==demoStateProp?(t3=demoStateProp||{},$[0]=demoStateProp,$[1]=t3):t3=$[1];let[demoState,setDemoState]=useState2(t3),{navItems,pageDocProps,pageMap}=useSiteContext(),t4;$[2]!==onPackageManagerChange?(t4=nextState=>{setPackageManager(nextState),onPackageManagerChange?.(nextState)},$[2]=onPackageManagerChange,$[3]=t4):t4=$[3];let t5;$[4]!==onDemoStateChange?(t5=(routeUrl,demoId,entry)=>{setDemoState(prevState=>{let state=prevState[routeUrl]??{},demos=state[demoId]??{},nextState_0={...prevState,[routeUrl]:{...state,[demoId]:{...demos,...entry}}};return onDemoStateChange?.(nextState_0),nextState_0})},$[4]=onDemoStateChange,$[5]=t5):t5=$[5];let t6;$[6]!==demoState||$[7]!==docProps||$[8]!==packageManager||$[9]!==renderLink||$[10]!==ssrUserAgent||$[11]!==t4||$[12]!==t5||$[13]!==tocHighlightStrategy?(t6={demoState,docProps,packageManager,renderLink,setPackageManager:t4,ssrUserAgent,tocHighlightStrategy,updateDemoState:t5},$[6]=demoState,$[7]=docProps,$[8]=packageManager,$[9]=renderLink,$[10]=ssrUserAgent,$[11]=t4,$[12]=t5,$[13]=tocHighlightStrategy,$[14]=t6):t6=$[14];let mdxDocsContextValue=t6,pageData=pageMap[pathname],t7;$[15]!==pageData?.toc?(t7=pageData?.toc??[],$[15]=pageData?.toc,$[16]=t7):t7=$[16];let toc=t7,showToc=!!toc.length&&!pageData?.hideToc&&!hideToc,hidePageLinks=pageData?.hidePageLinks||!1,hideSideNav=pageData?.hideSideNav||!1,t8;$[17]!==pageDocProps||$[18]!==pathname?(t8=pageDocProps?.[pathname]||{},$[17]=pageDocProps,$[18]=pathname,$[19]=t8):t8=$[19];let pageProps=t8,t9;$[20]!==hidePageLinks||$[21]!==hideSideNav||$[22]!==mainContentElement||$[23]!==navItems||$[24]!==pageMap||$[25]!==pageProps||$[26]!==pathname||$[27]!==showToc||$[28]!==toc?(t9={hidePageLinks,hideSideNav,mainContentElement,navItems,pageMap,pageProps,pathname,setMainContentElement,showToc,toc},$[20]=hidePageLinks,$[21]=hideSideNav,$[22]=mainContentElement,$[23]=navItems,$[24]=pageMap,$[25]=pageProps,$[26]=pathname,$[27]=showToc,$[28]=toc,$[29]=t9):t9=$[29];let layoutContext=t9,mergedProps=mergeProps2({className:"qui-docs__root"},props);return jsx12(MdxDocsProvider,{value:mdxDocsContextValue,children:jsx12(MdxProvider,{components:mdxComponents,pathname,children:jsx12(MdxDocsLayoutContextProvider,{value:layoutContext,children:jsx12(PolymorphicElement9,{as:"div",...mergedProps,children:bindingRenderProp2(children,layoutContext,{forwardPropsToClone:!1})})})})})}import{Fragment as Fragment2,jsx as jsx13,jsxs as jsxs5}from"react/jsx-runtime";import{useCallback,useEffect as useEffect2,useMemo as useMemo5,useRef as useRef4,useState as useState3}from"react";import{createTreeCollection}from"@qualcomm-ui/core/tree";import{SideNav}from"@qualcomm-ui/react/side-nav";import{useSafeLayoutEffect as useSafeLayoutEffect2}from"@qualcomm-ui/react-core/effects";import{useMdxDocsContext as useMdxDocsContext4}from"@qualcomm-ui/react-mdx/context";import{booleanDataAttr as booleanDataAttr3}from"@qualcomm-ui/utils/attributes";import{isDefined}from"@qualcomm-ui/utils/guard";import{matchSorter}from"@qualcomm-ui/utils/match-sorter";import{mergeProps as mergeProps3}from"@qualcomm-ui/utils/merge-props";function Sidebar({children,filterable=!0,mobileDrawerState,stickyHeader,...props}){let ref=useRef4(null),{navItems,pathname}=useMdxDocsLayoutContext(),{renderLink:RenderLink}=useMdxDocsContext4(),initialCollection=useMemo5(()=>createTreeCollection({nodeChildren:"items",nodeText:"title",nodeValue:"id",rootNode:{depth:0,id:"ROOT",items:navItems,pathSegments:[],title:""}}),[navItems]),[query,setQuery]=useState3(""),[collection,setCollection]=useState3(initialCollection),[expandedValue,setExpandedValue]=useState3(getExpandedItems(navItems,pathname));function onSelectedValueChange(value){collection.findNodeBy(node2=>node2.id===value[0])?.pathname&&setSelectedValue(value)}function getSelectedValue(){let node_0=collection.findNodeBy(node2_0=>node2_0.pathname===pathname);return node_0?[node_0.id]:[]}let[selectedValue,setSelectedValue]=useState3(()=>getSelectedValue()),initialExpandedValue=useRef4(expandedValue);useSafeLayoutEffect2(()=>{setSelectedValue(getSelectedValue())},[pathname]),useEffect2(()=>{let node_1=collection.findNodeBy(node2_1=>node2_1.pathname===pathname);if(node_1){let parents=collection.getParentNodes(node_1.id);parents.length&&setExpandedValue(prev=>[...prev,...parents.map(node2_2=>node2_2.id)])}},[collection,pathname]);let search=value_0=>{if(setQuery(value_0),!value_0){setCollection(initialCollection),setExpandedValue(initialExpandedValue.current);return}let nodes=matchSorter(initialCollection.getDescendantNodes(),value_0,{keys:["group","title","searchMeta.*",item=>initialCollection.getParentNodes(item.id).map(node_2=>node_2.group).filter(Boolean)]}),nextCollection=initialCollection.filter(node_3=>nodes.some(n=>n.id===node_3.id));setCollection(nextCollection),setExpandedValue(nextCollection.getBranchValues())},scrollIntoView=useCallback(()=>{if(!ref.current)return;let item_0=Array.from(ref.current.querySelectorAll("a")).find(item2=>item2.getAttribute("href")===pathname);if(!item_0)return;let observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting)observer.disconnect();else{if(item_0.scrollIntoView({block:"nearest",inline:"nearest"}),item_0.getBoundingClientRect().top-100<0){let scrollPos=ref.current.scrollTop;ref.current.scrollTo(0,Math.max(scrollPos-60,0))}observer.disconnect()}},{threshold:.1});return observer.observe(item_0),()=>observer.disconnect()},[pathname]);useEffect2(()=>{requestAnimationFrame(()=>{isDefined(mobileDrawerState)&&scrollIntoView()})},[mobileDrawerState,scrollIntoView]),useEffect2(()=>{scrollIntoView()},[scrollIntoView]);let mergedProps=mergeProps3({className:"qui-docs-sidebar__root",ref},props);return jsx13("div",{...mergedProps,children:jsxs5(SideNav.Root,{collection,expandedValue,onExpandedValueChange:details=>setExpandedValue(details.expandedValue),onSelectedValueChange:details_0=>{onSelectedValueChange(details_0.selectedValue)},selectedValue,children:[children?jsx13(SideNav.Header,{"data-sticky":booleanDataAttr3(stickyHeader),children}):null,filterable?jsxs5(Fragment2,{children:[jsx13(SideNav.FilterInput,{onValueChange:search,placeholder:"Filter...",value:query}),jsx13(SideNav.Divider,{className:"qui-docs-sidebar__group-separator"})]}):null,collection.rootNode.items.map((item_1,index)=>jsx13(SideNav.Nodes,{indexPath:[index],node:item_1,renderBranch:({node:node_4})=>jsxs5(SideNav.BranchNode,{render:node_4.pathname?jsx13(RenderLink,{href:node_4.pathname}):jsx13("div",{}),children:[jsx13(SideNav.NodeText,{children:node_4.title}),jsx13(SideNav.BranchTrigger,{})]}),renderLeaf:({indexPath,node:node_5})=>{let depthStyle={"--depth":indexPath.length},nested=booleanDataAttr3(indexPath.length>1);return node_5.sectionTitle?jsxs5(Fragment2,{children:[node_5.separator?jsx13(SideNav.Divider,{className:"qui-docs-sidebar__group-separator","data-nested":nested,style:depthStyle}):null,jsx13(SideNav.GroupLabel,{className:"qui-docs-sidebar__group-label","data-nested":nested,style:depthStyle,children:node_5.sectionTitle})]}):node_5.separator?jsx13(SideNav.Divider,{className:"qui-docs-sidebar__group-separator","data-nested":nested,style:depthStyle}):jsxs5(SideNav.LeafNode,{render:node_5.pathname?jsx13(RenderLink,{href:node_5.pathname}):jsx13("div",{}),children:[jsx13(SideNav.NodeIndicator,{}),jsx13(SideNav.NodeText,{children:node_5.title})]})},showIndentGuide:!0},collection.getNodeValue(item_1)))]})})}function getExpandedItems(items,pathname){return items.reduce((acc,current)=>{let id=current.id,expandedChildren=getExpandedItems(current.items??[],pathname);return(pathname===id||expandedChildren?.length||current.expanded&¤t.items?.length)&&acc.push(id),[...acc,...expandedChildren]},[])}import{c as _c7}from"react/compiler-runtime";import{jsx as jsx14,jsxs as jsxs6}from"react/jsx-runtime";import{useEffect as useEffect3,useRef as useRef5,useState as useState4}from"react";import{uniq}from"lodash-es";import{useMdxDocsContext as useMdxDocsContext5}from"@qualcomm-ui/react-mdx/context";import{booleanDataAttr as booleanDataAttr4}from"@qualcomm-ui/utils/attributes";var HEADING_LEVELS=["h2","h3","h4"],SCROLL_DEBOUNCE_MS=0,RESIZE_DEBOUNCE_MS=100,HEADING_OFFSET=-48,VIEWPORT_TOP_MARGIN=.1,VIEWPORT_BOTTOM_MARGIN=.2,INDENT_PER_LEVEL=12;function useScrollDebounce(callback,delay){let $=_c7(3),timeoutRef=useRef5(void 0),t0;return $[0]!==callback||$[1]!==delay?(t0=(...t1)=>{let args=t1;clearTimeout(timeoutRef.current),timeoutRef.current=setTimeout(()=>callback(...args),delay)},$[0]=callback,$[1]=delay,$[2]=t0):t0=$[2],t0}function elementIsVisible(rect){return typeof window>"u"?!1:rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth)}function useTocScrollSync(activeId,containerRef){let $=_c7(5),t0;$[0]===Symbol.for("react.memo_cache_sentinel")?(t0=new Map,$[0]=t0):t0=$[0];let linkRefs=useRef5(t0),t1,t2;return $[1]!==activeId||$[2]!==containerRef?(t1=()=>{if(!activeId||!containerRef.current)return;let activeElement=linkRefs.current.get(activeId);if(!activeElement)return;let observer=new IntersectionObserver(t3=>{let[entry]=t3;entry.isIntersecting||activeElement.scrollIntoView({behavior:"smooth",block:"nearest"}),observer.disconnect()},{root:containerRef.current,threshold:1});return observer.observe(activeElement),()=>observer.disconnect()},t2=[activeId,containerRef],$[1]=activeId,$[2]=containerRef,$[3]=t1,$[4]=t2):(t1=$[3],t2=$[4]),useEffect3(t1,t2),linkRefs}function useActiveHeading(){let $=_c7(11),[activeId,setActiveId]=useState4(null),{tocHighlightStrategy}=useMdxDocsContext5(),{mainContentElement,toc:headings}=useMdxDocsLayoutContext(),t0;$[0]!==headings||$[1]!==mainContentElement||$[2]!==tocHighlightStrategy?(t0=()=>{if(!headings.length||!mainContentElement)return;let headingElements=[],contentElement=document.querySelector(".qui-docs__app-content")?.querySelector("article");if(!contentElement)return;contentElement.querySelectorAll(uniq(HEADING_LEVELS).map(_temp25).join(",")).forEach(element=>{headingElements.push(element)});let activeIndex=null;if((tocHighlightStrategy||"nearest")==="nearest")if(window.scrollY===0)activeIndex=0;else if(window.scrollY+window.innerHeight>=document.body.scrollHeight)activeIndex=headingElements.length-1;else{let closestVisibleElementTop=1e5,closestVisibleIndex=-1,found=!1;for(let i=0;i<headingElements.length;i++){let elementRect=headingElements[i].getBoundingClientRect(),elementTop=elementRect.top;elementTop>HEADING_OFFSET&&elementIsVisible(elementRect)&&elementTop<closestVisibleElementTop&&(found=!0,closestVisibleElementTop=elementTop,closestVisibleIndex=i)}if(found)activeIndex=closestVisibleIndex>=0?closestVisibleIndex:null;else{let currentRegionIndex=headingElements.map((element_1,index)=>{let start=element_1.getBoundingClientRect().top+window.scrollY,nextElement=headingElements[index+1],end=nextElement?nextElement.getBoundingClientRect().top+window.scrollY-1:document.body.scrollHeight;return[start,end]}).findIndex(_temp24);activeIndex=currentRegionIndex>=0?currentRegionIndex:null}}else if(window.scrollY===0)activeIndex=0;else{let windowHeight=window.innerHeight;for(let i_0=0;i_0<headingElements.length;i_0++){let itemTop=headingElements[i_0].getBoundingClientRect().top,nextItem=headingElements[i_0+1];if((nextItem?nextItem.getBoundingClientRect().top:mainContentElement.getBoundingClientRect().bottom)>windowHeight*VIEWPORT_TOP_MARGIN&&itemTop<windowHeight*(1-VIEWPORT_BOTTOM_MARGIN)){activeIndex=i_0;break}}}activeIndex!==null&&headings[activeIndex]?setActiveId(headings[activeIndex].id):setActiveId(null)},$[0]=headings,$[1]=mainContentElement,$[2]=tocHighlightStrategy,$[3]=t0):t0=$[3];let calculateActive=t0,debouncedCalculateActive=useScrollDebounce(calculateActive,SCROLL_DEBOUNCE_MS),debouncedResizeHandler=useScrollDebounce(calculateActive,RESIZE_DEBOUNCE_MS),t1,t2;return $[4]!==calculateActive||$[5]!==debouncedCalculateActive||$[6]!==debouncedResizeHandler||$[7]!==headings.length||$[8]!==mainContentElement?(t1=()=>{if(!headings.length||!mainContentElement)return;calculateActive(),window.addEventListener("scroll",debouncedCalculateActive,{passive:!0}),window.addEventListener("resize",debouncedResizeHandler,{passive:!0});let resizeObserver=new ResizeObserver(debouncedResizeHandler);return resizeObserver.observe(mainContentElement),()=>{window.removeEventListener("scroll",debouncedCalculateActive),window.removeEventListener("resize",debouncedResizeHandler),resizeObserver.disconnect()}},t2=[calculateActive,debouncedCalculateActive,debouncedResizeHandler,headings.length,mainContentElement],$[4]=calculateActive,$[5]=debouncedCalculateActive,$[6]=debouncedResizeHandler,$[7]=headings.length,$[8]=mainContentElement,$[9]=t1,$[10]=t2):(t1=$[9],t2=$[10]),useEffect3(t1,t2),activeId}function _temp24(t0){let[start_0,end_0]=t0;return window.scrollY>start_0&&window.scrollY<end_0}function _temp25(level){return`${level}:not(.qui-demo-runner__wrapper ${level})`}function TableOfContents({activeTocClassName="q-active"}){let containerRef=useRef5(null),{renderLink:Link4}=useMdxDocsContext5(),{toc:headings}=useMdxDocsLayoutContext(),activeId=useActiveHeading(),linkRefs=useTocScrollSync(activeId,containerRef);return headings.length?jsx14("div",{className:"qui-toc",children:jsx14("div",{ref:containerRef,className:"qui-toc__container",children:jsxs6("div",{className:"qui-toc__links",children:[jsx14("div",{className:"qui-toc-bar"}),headings.map(({headingLevel,id,textContent})=>{let isActive=activeId===id;return jsxs6(TocLink,{ref:element=>{element?linkRefs.current.set(id,element):linkRefs.current.delete(id)},className:`qui-toc__link${isActive?` ${activeTocClassName}`:""}`,style:{paddingLeft:INDENT_PER_LEVEL*(headingLevel-1)},children:[headingLevel>2?jsx14("div",{"aria-hidden":!0,className:"qui-toc__link-indent-guide","data-active":booleanDataAttr4(isActive)}):null,jsx14(Link4,{href:`#${id}`,children:textContent})]},id)})]})})}):null}var Layout={AppContent,Breadcrumbs:DocsBreadcrumbs,ContentWrapper,Footer:DocsFooter,MainContent,PageLinks,Root,Sidebar,TableOfContents};import{c as _c8}from"react/compiler-runtime";import{Fragment as Fragment3,jsx as jsx15,jsxs as jsxs7}from"react/jsx-runtime";import{Menu,PanelLeftClose}from"lucide-react";import{IconButton}from"@qualcomm-ui/react/button";import{Drawer}from"@qualcomm-ui/react/drawer";import{Icon as Icon2}from"@qualcomm-ui/react/icon";import{Portal}from"@qualcomm-ui/react-core/portal";function MobileSidebar(t0){let $=_c8(2),{children,...props}=t0,{pathname}=useMdxDocsLayoutContext(),t1;return $[0]!==children?(t1=t2=>{let{open,setOpen}=t2;return jsx15(Sidebar,{"data-mobile":!0,filterable:!1,mobileDrawerState:open,stickyHeader:!0,children:jsxs7(Fragment3,{children:[children,jsx15(Drawer.CloseTrigger,{children:jsx15(IconButton,{className:"qui-docs-sidebar__mobile-close-trigger",density:"compact",icon:PanelLeftClose,onClick:()=>setOpen(!1),size:"lg",variant:"ghost"})})]})})},$[0]=children,$[1]=t1):t1=$[1],jsx15("div",{className:"qui-docs-sidebar__mobile-container",children:jsxs7(Drawer.Root,{placement:"start",...props,children:[jsx15(Drawer.Trigger,{children:jsx15(IconButton,{"aria-label":"Open Navigation Menu",icon:jsx15(Icon2,{icon:Menu,size:14}),size:"sm",variant:"ghost"})}),jsxs7(Portal,{children:[jsx15(Drawer.Backdrop,{}),jsx15(Drawer.Positioner,{children:jsx15(Drawer.Content,{className:"qui-docs-sidebar__drawer-content",children:jsx15(Drawer.Body,{className:"qui-docs-sidebar__drawer-body",children:jsx15(Drawer.Context,{children:t1})})})})]})]},pathname)})}function DocsLayout({children,footer,header,rootBreadcrumb,sidebarProps,...props}){return jsx16(Layout.Root,{...props,children:({hidePageLinks,hideSideNav,showToc})=>jsxs8(Fragment4,{children:[header,jsx16(Layout.ContentWrapper,{children:jsxs8(Layout.AppContent,{children:[!hideSideNav&&jsx16(Layout.Sidebar,{...sidebarProps}),jsxs8(Layout.MainContent,{children:[jsx16(Layout.Breadcrumbs,{rootBreadcrumb}),children,!hidePageLinks&&jsx16(Layout.PageLinks,{})]}),showToc?jsx16(Layout.TableOfContents,{}):null]})}),footer]})})}export{DocsFooter,DocsLayout,Layout,MdxDocsLayoutContextProvider,MdxProvider,MobileSidebar,useMdxDocsLayoutContext};
|
|
2
|
+
import{Fragment as Fragment4,jsx as jsx16,jsxs as jsxs8}from"react/jsx-runtime";import{jsx}from"react/jsx-runtime";import{PolymorphicElement}from"@qualcomm-ui/react-core/system";import{clsx}from"@qualcomm-ui/utils/clsx";function DocsFooter({children,className,ref,...props}){return jsx(PolymorphicElement,{ref,as:"div",className:clsx("qui-docs__footer",className),...props,children})}import{jsx as jsx2}from"react/jsx-runtime";import{PolymorphicElement as PolymorphicElement2}from"@qualcomm-ui/react-core/system";import{booleanDataAttr}from"@qualcomm-ui/utils/attributes";import{clsx as clsx2}from"@qualcomm-ui/utils/clsx";import{createContext,useContext}from"react";var MdxDocsLayoutContext=createContext(null),MdxDocsLayoutContextProvider=MdxDocsLayoutContext.Provider;function useMdxDocsLayoutContext(){let context=useContext(MdxDocsLayoutContext);if(!context)throw new Error("useMdxDocsLayoutContext can only be used as children of a <Layout.Root> instance.");return context}function AppContent(t0){let{children,className,...props}=t0,{hideSideNav,showToc}=useMdxDocsLayoutContext();return jsx2(PolymorphicElement2,{as:"div",className:clsx2("qui-docs__app-content",className),"data-hide-side-nav":booleanDataAttr(hideSideNav),"data-hide-toc":booleanDataAttr(!showToc),...props,children})}import{c as _c}from"react/compiler-runtime";import{jsx as jsx3}from"react/jsx-runtime";import"react";import{Breadcrumbs}from"@qualcomm-ui/react/breadcrumbs";import{PolymorphicElement as PolymorphicElement3}from"@qualcomm-ui/react-core/system";import{useMdxDocsContext}from"@qualcomm-ui/react-mdx/context";import{clsx as clsx3}from"@qualcomm-ui/utils/clsx";function DocsBreadcrumbs(t0){let $=_c(7),{className,rootBreadcrumb,...props}=t0,{renderLink:Link4}=useMdxDocsContext(),{pageMap,pathname}=useMdxDocsLayoutContext(),t1;bb0:{let pageMapEntry=pageMap[pathname];if(!pageMapEntry||pageMapEntry.hideBreadcrumbs){let t22;$[0]===Symbol.for("react.memo_cache_sentinel")?(t22=[],$[0]=t22):t22=$[0],t1=t22;break bb0}let t2;if($[1]!==Link4||$[2]!==pageMap||$[3]!==pageMapEntry.categories||$[4]!==pageMapEntry.pathSegments||$[5]!==rootBreadcrumb){let mergedPath="",crumbs=pageMapEntry.pathSegments.reduce((acc,segment,currentIndex)=>{mergedPath=`${mergedPath}/${segment}`;let route=pageMap[mergedPath],pageTitle=pageMapEntry.categories[currentIndex]??route.title;return acc.push({children:pageTitle,id:route?.pathname??route?.id??pageTitle,render:route?.pathname?jsx3(Link4,{href:route.pathname}):jsx3("button",{style:{pointerEvents:"none"}})}),acc},[]);t2=rootBreadcrumb?[{...rootBreadcrumb,id:"/"},...crumbs]:crumbs,$[1]=Link4,$[2]=pageMap,$[3]=pageMapEntry.categories,$[4]=pageMapEntry.pathSegments,$[5]=rootBreadcrumb,$[6]=t2}else t2=$[6];t1=t2}let items=t1;return items.length?jsx3(PolymorphicElement3,{className:clsx3("qui-docs__breadcrumbs",className),...props,children:jsx3(Breadcrumbs.Root,{emphasis:"neutral",children:jsx3(Breadcrumbs.List,{children:items.map(_temp)})})}):null}function _temp(item){return jsx3(Breadcrumbs.Item,{...item},item.id)}import{jsx as jsx4}from"react/jsx-runtime";import{PolymorphicElement as PolymorphicElement4}from"@qualcomm-ui/react-core/system";import{clsx as clsx4}from"@qualcomm-ui/utils/clsx";function ContentWrapper({children,className,...props}){return jsx4(PolymorphicElement4,{as:"div",className:clsx4("qui-docs__content-wrapper",className),...props,children})}import{c as _c2}from"react/compiler-runtime";import{jsx as jsx5}from"react/jsx-runtime";import{useRef}from"react";import{useSafeLayoutEffect}from"@qualcomm-ui/react-core/effects";import{useMergedRef}from"@qualcomm-ui/react-core/refs";import{PolymorphicElement as PolymorphicElement5}from"@qualcomm-ui/react-core/system";import{PropsContextProvider}from"@qualcomm-ui/react-mdx/typedoc";import{clsx as clsx5}from"@qualcomm-ui/utils/clsx";function MainContent(t0){let $=_c2(5),{children,className,id:t1,ref:refProp,...props}=t0,id=t1===void 0?"main-content":t1,ref=useRef(null),{mainContentElement,pageProps,setMainContentElement}=useMdxDocsLayoutContext(),t2;$[0]!==mainContentElement||$[1]!==setMainContentElement?(t2=()=>{mainContentElement!==ref.current&&setMainContentElement(ref.current)},$[0]=mainContentElement,$[1]=setMainContentElement,$[2]=t2):t2=$[2];let t3;$[3]!==mainContentElement?(t3=[mainContentElement],$[3]=mainContentElement,$[4]=t3):t3=$[4],useSafeLayoutEffect(t2,t3);let refs=useMergedRef(refProp,ref);return jsx5(PolymorphicElement5,{ref:refs,as:"article",className:clsx5("qui-docs__main-content",className),id,...props,children:jsx5(PropsContextProvider,{value:pageProps,children})})}import{c as _c3}from"react/compiler-runtime";import{Fragment,jsx as jsx6,jsxs}from"react/jsx-runtime";import"react";import{ChevronLeft,ChevronRight}from"lucide-react";import{Link}from"@qualcomm-ui/react/link";import{bindingRenderProp,PolymorphicElement as PolymorphicElement6}from"@qualcomm-ui/react-core/system";import{useMdxDocsContext as useMdxDocsContext2}from"@qualcomm-ui/react-mdx/context";import{booleanDataAttr as booleanDataAttr2}from"@qualcomm-ui/utils/attributes";import{capitalCase}from"@qualcomm-ui/utils/change-case";import{clsx as clsx6}from"@qualcomm-ui/utils/clsx";import{TreeCollection}from"@qualcomm-ui/utils/collection";function PageLink({currentPage,pageLink,prev,renderLink:RenderLink}){let pathSegments=currentPage?currentPage.pathSegments:[],nextPathSegments=pageLink.pathSegments,pathSegment=nextPathSegments[0]!==pathSegments[0]?capitalCase(nextPathSegments[0]??""):"";return bindingRenderProp(jsx6(RenderLink,{href:pageLink.pathname}),{children:jsx6(Fragment,{children:jsxs("span",{className:"qui-page-link__container",children:[prev?jsx6(Link,{render:jsx6("div",{}),startIcon:ChevronLeft,children:pageLink.title}):jsx6(Link,{endIcon:ChevronRight,render:jsx6("div",{}),children:pageLink.title}),pathSegment&&pathSegment!==pageLink.title?jsx6("div",{className:"qui-page-link__adjacent-route-title","data-next":booleanDataAttr2(!prev),children:pathSegment}):null]})}),className:"qui-page-link__root","data-next":booleanDataAttr2(!prev)})}function PageLinks(t0){let $=_c3(5),{className,...props}=t0,{renderLink}=useMdxDocsContext2(),{navItems,pathname}=useMdxDocsLayoutContext(),t1;$[0]!==navItems?(t1=new TreeCollection({nodeChildren:"items",nodeText:"title",nodeValue:"id",rootNode:{depth:0,id:"ROOT",items:navItems,pathSegments:[],title:""}}).flatten().filter(_temp2),$[0]=navItems,$[1]=t1):t1=$[1];let flattenedItems=t1,t2;$[2]!==flattenedItems||$[3]!==pathname?(t2=getPageLinks(flattenedItems,pathname),$[2]=flattenedItems,$[3]=pathname,$[4]=t2):t2=$[4];let[prevPage,nextPage,currentPage]=t2;return jsxs(PolymorphicElement6,{as:"div",className:clsx6("qui-page-links__container",className),...props,children:[jsx6("div",{className:"qui-page-links__link-wrapper",children:prevPage?jsx6(PageLink,{currentPage,pageLink:prevPage,prev:!0,renderLink}):null}),jsx6("div",{className:"qui-page-links__link-wrapper",children:nextPage?jsx6(PageLink,{currentPage,pageLink:nextPage,renderLink}):null})]})}function _temp2(item){return item.pathname}function getPageLinks(items,route){let index=items.findIndex(item=>item.id===route);if(index===-1)return[!1,!1,!1];let prevPage=items[index-1],nextPage=items[index+1];return[prevPage??!1,nextPage??!1,items[index]]}import{c as _c6}from"react/compiler-runtime";import{jsx as jsx12}from"react/jsx-runtime";import{useState as useState2}from"react";import{bindingRenderProp as bindingRenderProp2,PolymorphicElement as PolymorphicElement9}from"@qualcomm-ui/react-core/system";import{MdxDocsProvider,useSiteContext}from"@qualcomm-ui/react-mdx/context";import{mergeProps as mergeProps2}from"@qualcomm-ui/utils/merge-props";import{c as _c5}from"react/compiler-runtime";import{jsx as jsx11}from"react/jsx-runtime";import"react";import{MDXProvider}from"@mdx-js/react";import{Link as Link3}from"@qualcomm-ui/react/link";import{Table}from"@qualcomm-ui/react/table";import{useMdxDocsContext as useMdxDocsContext3}from"@qualcomm-ui/react-mdx/context";import{SpoilerContent,SpoilerRoot,SpoilerSummary}from"@qualcomm-ui/react-mdx/spoiler";import{jsx as jsx7,jsxs as jsxs2}from"react/jsx-runtime";import{useState}from"react";import{Link2}from"lucide-react";import{Icon}from"@qualcomm-ui/react/icon";import{PolymorphicElement as PolymorphicElement7}from"@qualcomm-ui/react-core/system";function AnchorHeader({children,className,id,ref,renderLink:RenderLink,...props}){let[hovered,setHovered]=useState(!1);return jsx7(PolymorphicElement7,{ref,as:"span",className,id,onMouseEnter:()=>setHovered(!0),onMouseLeave:()=>setHovered(!1),...props,children:jsxs2(RenderLink,{className:"qui-docs-heading",href:`#${id}`,children:[jsx7("span",{className:"qui-docs-heading-text",children}),hovered?jsx7(Icon,{icon:Link2,size:"md"}):null]})})}import{jsx as jsx8,jsxs as jsxs3}from"react/jsx-runtime";import{Children,isValidElement}from"react";import{Tab,Tabs}from"@qualcomm-ui/react/tabs";import{mergeProps}from"@qualcomm-ui/utils/merge-props";function CodeTabs({children,...props}){let tabs=Children.toArray(children).filter(child=>isValidElement(child)),mergedProps=mergeProps({className:"mdx qui-code-tabs"},props),firstTab=tabs[0]?.props?.label;return jsxs3(Tabs.Root,{defaultValue:firstTab,...mergedProps,children:[jsxs3(Tabs.List,{className:"mdx",children:[jsx8(Tabs.Indicator,{}),tabs.map(tab=>{let label=tab.props?.label;return jsx8(Tab.Root,{value:label,children:jsx8(Tab.Button,{children:tab.props?.label})},label)})]}),tabs.map(tab=>{let label=tab.props?.label;return jsx8(Tabs.Panel,{className:"mdx",value:label,children:tab.props?.children},label)})]})}import{jsx as jsx9,jsxs as jsxs4}from"react/jsx-runtime";import{useRef as useRef2}from"react";import{CopyToClipboardIconButton}from"@qualcomm-ui/react-mdx/copy-to-clipboard";import{clsx as clsx7}from"@qualcomm-ui/utils/clsx";function ShikiPre({children,className,"data-code":code,...props}){let preRef=useRef2(null);return jsxs4("div",{className:"shiki-wrapper mdx",children:[jsx9("pre",{ref:preRef,className:clsx7("mdx",className),...props,tabIndex:-1,children}),jsx9(CopyToClipboardIconButton,{valueOrFn:()=>code||preRef.current.innerText})]})}import{c as _c4}from"react/compiler-runtime";import{jsx as jsx10}from"react/jsx-runtime";import{useEffect,useRef as useRef3}from"react";import{useMergedRef as useMergedRef2}from"@qualcomm-ui/react-core/refs";import{PolymorphicElement as PolymorphicElement8}from"@qualcomm-ui/react-core/system";function TocLink(t0){let $=_c4(5),{active,ref:refProp,...props}=t0,localRef=useRef3(null),ref=useMergedRef2(refProp,localRef),t1;$[0]!==active?(t1=()=>{active&&localRef.current&&localRef.current?.scrollIntoView?.({block:"nearest"})},$[0]=active,$[1]=t1):t1=$[1];let t2;return $[2]!==active||$[3]!==ref?(t2=[active,ref],$[2]=active,$[3]=ref,$[4]=t2):t2=$[4],useEffect(t1,t2),jsx10(PolymorphicElement8,{ref,as:"div",className:"qui-toc__link",...props})}function MdxProvider(t0){let $=_c5(18),{children,components}=t0,{renderLink:RenderLink}=useMdxDocsContext3(),t1;$[0]!==RenderLink?(t1=t22=>{let{href:t32,ref:_ref,...props}=t22,href=t32===void 0?"":t32;return!href.startsWith("http")?jsx11(Link3,{emphasis:"primary",render:jsx11(RenderLink,{href:href.startsWith("./#")?href.substring(2):href}),...props}):jsx11(Link3,{emphasis:"primary",href,...props,target:"_blank"})},$[0]=RenderLink,$[1]=t1):t1=$[1];let t2;$[2]!==children?(t2=props_3=>jsx11("div",{...props_3,children}),$[2]=children,$[3]=t2):t2=$[3];let t3,t4,t5;$[4]!==RenderLink?(t3=t62=>{let{children:children2_0,id:id_0}=t62;return jsx11(AnchorHeader,{className:"mdx",id:id_0||void 0,render:jsx11("h2",{}),renderLink:RenderLink,children:children2_0})},t4=t72=>{let{children:children2_1,id:id_1}=t72;return jsx11(AnchorHeader,{className:"mdx",id:id_1||void 0,render:jsx11("h3",{}),renderLink:RenderLink,children:children2_1})},t5=t82=>{let{children:children2_2,id:id_2}=t82;return jsx11(AnchorHeader,{className:"mdx",id:id_2||void 0,render:jsx11("h4",{}),renderLink:RenderLink,children:children2_2})},$[4]=RenderLink,$[5]=t3,$[6]=t4,$[7]=t5):(t3=$[5],t4=$[6],t5=$[7]);let t6;$[8]!==components||$[9]!==t1||$[10]!==t2||$[11]!==t3||$[12]!==t4||$[13]!==t5?(t6={a:t1,blockquote:_temp23,br:_temp22,code:_temp3,CodeTab:t2,CodeTabs,em:_temp4,h1:_temp5,h2:t3,h3:t4,h4:t5,h5:_temp6,h6:_temp7,hr:_temp8,img:_temp9,li:_temp0,ol:_temp1,p:_temp10,pre:_temp11,SpoilerContent,SpoilerRoot,SpoilerSummary,strong:_temp12,sup:_temp13,table:_temp14,tbody:_temp15,td:_temp16,tfoot:_temp17,th:_temp18,thead:_temp19,tr:_temp20,ul:_temp21,...components},$[8]=components,$[9]=t1,$[10]=t2,$[11]=t3,$[12]=t4,$[13]=t5,$[14]=t6):t6=$[14];let t7=t6,t8;return $[15]!==children||$[16]!==t7?(t8=jsx11(MDXProvider,{components:t7,children}),$[15]=children,$[16]=t7,$[17]=t8):t8=$[17],t8}function _temp21(props_23){return jsx11("ul",{className:"mdx",...props_23})}function _temp20(props_22){return jsx11(Table.Row,{className:"mdx",...props_22})}function _temp19(props_21){return jsx11(Table.Header,{className:"mdx",...props_21})}function _temp18(props_20){return jsx11(Table.HeaderCell,{className:"mdx",...props_20})}function _temp17(props_19){return jsx11(Table.Footer,{className:"mdx",...props_19})}function _temp16(props_18){return jsx11(Table.Cell,{className:"mdx",...props_18})}function _temp15(props_17){return jsx11(Table.Body,{className:"mdx",...props_17})}function _temp14(t0){let{children:children2_4,...props_16}=t0;return jsx11("div",{className:"mdx table-wrapper",children:jsx11(Table.Root,{className:"mdx",size:"sm",...props_16,children:jsx11(Table.Table,{className:"mdx",children:children2_4})})})}function _temp13(props_15){return jsx11("sup",{className:"mdx",...props_15})}function _temp12(props_14){return jsx11("strong",{className:"mdx font-semibold",...props_14})}function _temp11(t0){let{children:children2_3,...props_13}=t0;return jsx11(ShikiPre,{...props_13,children:children2_3})}function _temp10(props_12){return jsx11("p",{className:"mdx",...props_12})}function _temp1(props_11){return jsx11("ol",{className:"mdx",...props_11})}function _temp0(props_10){return jsx11("li",{className:"mdx",...props_10})}function _temp9(props_9){return jsx11("img",{className:"mdx",...props_9})}function _temp8(props_8){return jsx11("hr",{className:"mdx",...props_8})}function _temp7(t0){let{id:id_4,...props_7}=t0;return jsx11("h6",{className:"mdx",id:id_4||void 0,...props_7})}function _temp6(t0){let{id:id_3,...props_6}=t0;return jsx11("h5",{className:"mdx",id:id_3||void 0,...props_6})}function _temp5(t0){let{children:children2,id,...props_5}=t0;return jsx11("h1",{className:"mdx",id:id||void 0,...props_5,children:children2})}function _temp4(props_4){return jsx11("em",{className:"mdx",...props_4})}function _temp3(props_2){return jsx11("code",{className:"mdx",...props_2})}function _temp22(props_1){return jsx11("br",{className:"mdx",...props_1})}function _temp23(props_0){return jsx11("blockquote",{className:"mdx",...props_0})}function Root(t0){let $=_c6(37),{children,demoSettings:demoSettingsProp,demoState:demoStateProp,docProps,hideToc,mdxComponents,onDemoSettingsChange,onDemoStateChange,onPackageManagerChange,packageManager:t1,pathname,renderLink,ssrUserAgent,tocHighlightStrategy:t2,...props}=t0,packageManagerProp=t1===void 0?"npm":t1,tocHighlightStrategy=t2===void 0?"nearest":t2,[mainContentElement,setMainContentElement]=useState2(null),[packageManager,setPackageManager]=useState2(packageManagerProp),t3;$[0]!==demoStateProp?(t3=demoStateProp||{},$[0]=demoStateProp,$[1]=t3):t3=$[1];let[demoState,setDemoState]=useState2(t3),t4;$[2]!==demoSettingsProp?(t4=demoSettingsProp||{transformTailwindClasses:!1},$[2]=demoSettingsProp,$[3]=t4):t4=$[3];let[demoSettings,setDemoSettings]=useState2(t4),{navItems,pageDocProps,pageMap}=useSiteContext(),t5;$[4]!==demoSettings||$[5]!==onDemoSettingsChange?(t5=updaterOrValue=>{let nextState=typeof updaterOrValue=="function"?updaterOrValue(demoSettings):updaterOrValue;setDemoSettings(nextState),onDemoSettingsChange?.(nextState)},$[4]=demoSettings,$[5]=onDemoSettingsChange,$[6]=t5):t5=$[6];let t6;$[7]!==onPackageManagerChange?(t6=nextState_0=>{setPackageManager(nextState_0),onPackageManagerChange?.(nextState_0)},$[7]=onPackageManagerChange,$[8]=t6):t6=$[8];let t7;$[9]!==onDemoStateChange?(t7=(routeUrl,demoId,entry)=>{setDemoState(prevState=>{let state=prevState[routeUrl]??{},demos=state[demoId]??{},nextState_1={...prevState,[routeUrl]:{...state,[demoId]:{...demos,...entry}}};return onDemoStateChange?.(nextState_1),nextState_1})},$[9]=onDemoStateChange,$[10]=t7):t7=$[10];let t8;$[11]!==demoSettings||$[12]!==demoState||$[13]!==docProps||$[14]!==packageManager||$[15]!==renderLink||$[16]!==ssrUserAgent||$[17]!==t5||$[18]!==t6||$[19]!==t7||$[20]!==tocHighlightStrategy?(t8={demoSettings,demoState,docProps,packageManager,renderLink,setDemoSettings:t5,setPackageManager:t6,ssrUserAgent,tocHighlightStrategy,updateDemoState:t7},$[11]=demoSettings,$[12]=demoState,$[13]=docProps,$[14]=packageManager,$[15]=renderLink,$[16]=ssrUserAgent,$[17]=t5,$[18]=t6,$[19]=t7,$[20]=tocHighlightStrategy,$[21]=t8):t8=$[21];let mdxDocsContextValue=t8,pageData=pageMap[pathname],t9;$[22]!==pageData?.toc?(t9=pageData?.toc??[],$[22]=pageData?.toc,$[23]=t9):t9=$[23];let toc=t9,showToc=!!toc.length&&!pageData?.hideToc&&!hideToc,hidePageLinks=pageData?.hidePageLinks||!1,hideSideNav=pageData?.hideSideNav||!1,t10;$[24]!==pageDocProps||$[25]!==pathname?(t10=pageDocProps?.[pathname]||{},$[24]=pageDocProps,$[25]=pathname,$[26]=t10):t10=$[26];let pageProps=t10,t11;$[27]!==hidePageLinks||$[28]!==hideSideNav||$[29]!==mainContentElement||$[30]!==navItems||$[31]!==pageMap||$[32]!==pageProps||$[33]!==pathname||$[34]!==showToc||$[35]!==toc?(t11={hidePageLinks,hideSideNav,mainContentElement,navItems,pageMap,pageProps,pathname,setMainContentElement,showToc,toc},$[27]=hidePageLinks,$[28]=hideSideNav,$[29]=mainContentElement,$[30]=navItems,$[31]=pageMap,$[32]=pageProps,$[33]=pathname,$[34]=showToc,$[35]=toc,$[36]=t11):t11=$[36];let layoutContext=t11,mergedProps=mergeProps2({className:"qui-docs__root"},props);return jsx12(MdxDocsProvider,{value:mdxDocsContextValue,children:jsx12(MdxProvider,{components:mdxComponents,pathname,children:jsx12(MdxDocsLayoutContextProvider,{value:layoutContext,children:jsx12(PolymorphicElement9,{as:"div",...mergedProps,children:bindingRenderProp2(children,layoutContext,{forwardPropsToClone:!1})})})})})}import{Fragment as Fragment2,jsx as jsx13,jsxs as jsxs5}from"react/jsx-runtime";import{useCallback,useEffect as useEffect2,useMemo as useMemo5,useRef as useRef4,useState as useState3}from"react";import{createTreeCollection}from"@qualcomm-ui/core/tree";import{SideNav}from"@qualcomm-ui/react/side-nav";import{useSafeLayoutEffect as useSafeLayoutEffect2}from"@qualcomm-ui/react-core/effects";import{useMdxDocsContext as useMdxDocsContext4}from"@qualcomm-ui/react-mdx/context";import{booleanDataAttr as booleanDataAttr3}from"@qualcomm-ui/utils/attributes";import{isDefined}from"@qualcomm-ui/utils/guard";import{matchSorter}from"@qualcomm-ui/utils/match-sorter";import{mergeProps as mergeProps3}from"@qualcomm-ui/utils/merge-props";function Sidebar({children,filterable=!0,mobileDrawerState,stickyHeader,...props}){let ref=useRef4(null),{navItems,pathname}=useMdxDocsLayoutContext(),{renderLink:RenderLink}=useMdxDocsContext4(),initialCollection=useMemo5(()=>createTreeCollection({nodeChildren:"items",nodeText:"title",nodeValue:"id",rootNode:{depth:0,id:"ROOT",items:navItems,pathSegments:[],title:""}}),[navItems]),[query,setQuery]=useState3(""),[collection,setCollection]=useState3(initialCollection),[expandedValue,setExpandedValue]=useState3(getExpandedItems(navItems,pathname));function onSelectedValueChange(value){collection.findNodeBy(node2=>node2.id===value[0])?.pathname&&setSelectedValue(value)}function getSelectedValue(){let node_0=collection.findNodeBy(node2_0=>node2_0.pathname===pathname);return node_0?[node_0.id]:[]}let[selectedValue,setSelectedValue]=useState3(()=>getSelectedValue()),initialExpandedValue=useRef4(expandedValue);useSafeLayoutEffect2(()=>{setSelectedValue(getSelectedValue())},[pathname]),useEffect2(()=>{let node_1=collection.findNodeBy(node2_1=>node2_1.pathname===pathname);if(node_1){let parents=collection.getParentNodes(node_1.id);parents.length&&setExpandedValue(prev=>[...prev,...parents.map(node2_2=>node2_2.id)])}},[collection,pathname]);let search=value_0=>{if(setQuery(value_0),!value_0){setCollection(initialCollection),setExpandedValue(initialExpandedValue.current);return}let nodes=matchSorter(initialCollection.getDescendantNodes(),value_0,{keys:["group","title","searchMeta.*",item=>initialCollection.getParentNodes(item.id).map(node_2=>node_2.group).filter(Boolean)]}),nextCollection=initialCollection.filter(node_3=>nodes.some(n=>n.id===node_3.id));setCollection(nextCollection),setExpandedValue(nextCollection.getBranchValues())},scrollIntoView=useCallback(()=>{if(!ref.current)return;let item_0=Array.from(ref.current.querySelectorAll("a")).find(item2=>item2.getAttribute("href")===pathname);if(!item_0)return;let observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting)observer.disconnect();else{if(item_0.scrollIntoView({block:"nearest",inline:"nearest"}),item_0.getBoundingClientRect().top-100<0){let scrollPos=ref.current.scrollTop;ref.current.scrollTo(0,Math.max(scrollPos-60,0))}observer.disconnect()}},{threshold:.1});return observer.observe(item_0),()=>observer.disconnect()},[pathname]);useEffect2(()=>{requestAnimationFrame(()=>{isDefined(mobileDrawerState)&&scrollIntoView()})},[mobileDrawerState,scrollIntoView]),useEffect2(()=>{scrollIntoView()},[scrollIntoView]);let mergedProps=mergeProps3({className:"qui-docs-sidebar__root",ref},props);return jsx13("div",{...mergedProps,children:jsxs5(SideNav.Root,{collection,expandedValue,onExpandedValueChange:details=>setExpandedValue(details.expandedValue),onSelectedValueChange:details_0=>{onSelectedValueChange(details_0.selectedValue)},selectedValue,children:[children?jsx13(SideNav.Header,{"data-sticky":booleanDataAttr3(stickyHeader),children}):null,filterable?jsxs5(Fragment2,{children:[jsx13(SideNav.FilterInput,{onValueChange:search,placeholder:"Filter...",value:query}),jsx13(SideNav.Divider,{className:"qui-docs-sidebar__group-separator"})]}):null,collection.rootNode.items.map((item_1,index)=>jsx13(SideNav.Nodes,{indexPath:[index],node:item_1,renderBranch:({node:node_4})=>jsxs5(SideNav.BranchNode,{render:node_4.pathname?jsx13(RenderLink,{href:node_4.pathname}):jsx13("div",{}),children:[jsx13(SideNav.NodeText,{children:node_4.title}),jsx13(SideNav.BranchTrigger,{})]}),renderLeaf:({indexPath,node:node_5})=>{let depthStyle={"--depth":indexPath.length},nested=booleanDataAttr3(indexPath.length>1);return node_5.sectionTitle?jsxs5(Fragment2,{children:[node_5.separator?jsx13(SideNav.Divider,{className:"qui-docs-sidebar__group-separator","data-nested":nested,style:depthStyle}):null,jsx13(SideNav.GroupLabel,{className:"qui-docs-sidebar__group-label","data-nested":nested,style:depthStyle,children:node_5.sectionTitle})]}):node_5.separator?jsx13(SideNav.Divider,{className:"qui-docs-sidebar__group-separator","data-nested":nested,style:depthStyle}):jsxs5(SideNav.LeafNode,{render:node_5.pathname?jsx13(RenderLink,{href:node_5.pathname}):jsx13("div",{}),children:[jsx13(SideNav.NodeIndicator,{}),jsx13(SideNav.NodeText,{children:node_5.title})]})},showIndentGuide:!0},collection.getNodeValue(item_1)))]})})}function getExpandedItems(items,pathname){return items.reduce((acc,current)=>{let id=current.id,expandedChildren=getExpandedItems(current.items??[],pathname);return(pathname===id||expandedChildren?.length||current.expanded&¤t.items?.length)&&acc.push(id),[...acc,...expandedChildren]},[])}import{c as _c7}from"react/compiler-runtime";import{jsx as jsx14,jsxs as jsxs6}from"react/jsx-runtime";import{useEffect as useEffect3,useRef as useRef5,useState as useState4}from"react";import{uniq}from"lodash-es";import{useMdxDocsContext as useMdxDocsContext5}from"@qualcomm-ui/react-mdx/context";import{booleanDataAttr as booleanDataAttr4}from"@qualcomm-ui/utils/attributes";var HEADING_LEVELS=["h2","h3","h4"],SCROLL_DEBOUNCE_MS=0,RESIZE_DEBOUNCE_MS=100,HEADING_OFFSET=-48,VIEWPORT_TOP_MARGIN=.1,VIEWPORT_BOTTOM_MARGIN=.2,INDENT_PER_LEVEL=12;function useScrollDebounce(callback,delay){let $=_c7(3),timeoutRef=useRef5(void 0),t0;return $[0]!==callback||$[1]!==delay?(t0=(...t1)=>{let args=t1;clearTimeout(timeoutRef.current),timeoutRef.current=setTimeout(()=>callback(...args),delay)},$[0]=callback,$[1]=delay,$[2]=t0):t0=$[2],t0}function elementIsVisible(rect){return typeof window>"u"?!1:rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth)}function useTocScrollSync(activeId,containerRef){let $=_c7(5),t0;$[0]===Symbol.for("react.memo_cache_sentinel")?(t0=new Map,$[0]=t0):t0=$[0];let linkRefs=useRef5(t0),t1,t2;return $[1]!==activeId||$[2]!==containerRef?(t1=()=>{if(!activeId||!containerRef.current)return;let activeElement=linkRefs.current.get(activeId);if(!activeElement)return;let observer=new IntersectionObserver(t3=>{let[entry]=t3;entry.isIntersecting||activeElement.scrollIntoView({behavior:"smooth",block:"nearest"}),observer.disconnect()},{root:containerRef.current,threshold:1});return observer.observe(activeElement),()=>observer.disconnect()},t2=[activeId,containerRef],$[1]=activeId,$[2]=containerRef,$[3]=t1,$[4]=t2):(t1=$[3],t2=$[4]),useEffect3(t1,t2),linkRefs}function useActiveHeading(){let $=_c7(11),[activeId,setActiveId]=useState4(null),{tocHighlightStrategy}=useMdxDocsContext5(),{mainContentElement,toc:headings}=useMdxDocsLayoutContext(),t0;$[0]!==headings||$[1]!==mainContentElement||$[2]!==tocHighlightStrategy?(t0=()=>{if(!headings.length||!mainContentElement)return;let headingElements=[],contentElement=document.querySelector(".qui-docs__app-content")?.querySelector("article");if(!contentElement)return;contentElement.querySelectorAll(uniq(HEADING_LEVELS).map(_temp25).join(",")).forEach(element=>{headingElements.push(element)});let activeIndex=null;if((tocHighlightStrategy||"nearest")==="nearest")if(window.scrollY===0)activeIndex=0;else if(window.scrollY+window.innerHeight>=document.body.scrollHeight)activeIndex=headingElements.length-1;else{let closestVisibleElementTop=1e5,closestVisibleIndex=-1,found=!1;for(let i=0;i<headingElements.length;i++){let elementRect=headingElements[i].getBoundingClientRect(),elementTop=elementRect.top;elementTop>HEADING_OFFSET&&elementIsVisible(elementRect)&&elementTop<closestVisibleElementTop&&(found=!0,closestVisibleElementTop=elementTop,closestVisibleIndex=i)}if(found)activeIndex=closestVisibleIndex>=0?closestVisibleIndex:null;else{let currentRegionIndex=headingElements.map((element_1,index)=>{let start=element_1.getBoundingClientRect().top+window.scrollY,nextElement=headingElements[index+1],end=nextElement?nextElement.getBoundingClientRect().top+window.scrollY-1:document.body.scrollHeight;return[start,end]}).findIndex(_temp24);activeIndex=currentRegionIndex>=0?currentRegionIndex:null}}else if(window.scrollY===0)activeIndex=0;else{let windowHeight=window.innerHeight;for(let i_0=0;i_0<headingElements.length;i_0++){let itemTop=headingElements[i_0].getBoundingClientRect().top,nextItem=headingElements[i_0+1];if((nextItem?nextItem.getBoundingClientRect().top:mainContentElement.getBoundingClientRect().bottom)>windowHeight*VIEWPORT_TOP_MARGIN&&itemTop<windowHeight*(1-VIEWPORT_BOTTOM_MARGIN)){activeIndex=i_0;break}}}activeIndex!==null&&headings[activeIndex]?setActiveId(headings[activeIndex].id):setActiveId(null)},$[0]=headings,$[1]=mainContentElement,$[2]=tocHighlightStrategy,$[3]=t0):t0=$[3];let calculateActive=t0,debouncedCalculateActive=useScrollDebounce(calculateActive,SCROLL_DEBOUNCE_MS),debouncedResizeHandler=useScrollDebounce(calculateActive,RESIZE_DEBOUNCE_MS),t1,t2;return $[4]!==calculateActive||$[5]!==debouncedCalculateActive||$[6]!==debouncedResizeHandler||$[7]!==headings.length||$[8]!==mainContentElement?(t1=()=>{if(!headings.length||!mainContentElement)return;calculateActive(),window.addEventListener("scroll",debouncedCalculateActive,{passive:!0}),window.addEventListener("resize",debouncedResizeHandler,{passive:!0});let resizeObserver=new ResizeObserver(debouncedResizeHandler);return resizeObserver.observe(mainContentElement),()=>{window.removeEventListener("scroll",debouncedCalculateActive),window.removeEventListener("resize",debouncedResizeHandler),resizeObserver.disconnect()}},t2=[calculateActive,debouncedCalculateActive,debouncedResizeHandler,headings.length,mainContentElement],$[4]=calculateActive,$[5]=debouncedCalculateActive,$[6]=debouncedResizeHandler,$[7]=headings.length,$[8]=mainContentElement,$[9]=t1,$[10]=t2):(t1=$[9],t2=$[10]),useEffect3(t1,t2),activeId}function _temp24(t0){let[start_0,end_0]=t0;return window.scrollY>start_0&&window.scrollY<end_0}function _temp25(level){return`${level}:not(.qui-demo-runner__wrapper ${level})`}function TableOfContents({activeTocClassName="q-active"}){let containerRef=useRef5(null),{renderLink:Link4}=useMdxDocsContext5(),{toc:headings}=useMdxDocsLayoutContext(),activeId=useActiveHeading(),linkRefs=useTocScrollSync(activeId,containerRef);return headings.length?jsx14("div",{className:"qui-toc",children:jsx14("div",{ref:containerRef,className:"qui-toc__container",children:jsxs6("div",{className:"qui-toc__links",children:[jsx14("div",{className:"qui-toc-bar"}),headings.map(({headingLevel,id,textContent})=>{let isActive=activeId===id;return jsxs6(TocLink,{ref:element=>{element?linkRefs.current.set(id,element):linkRefs.current.delete(id)},className:`qui-toc__link${isActive?` ${activeTocClassName}`:""}`,style:{paddingLeft:INDENT_PER_LEVEL*(headingLevel-1)},children:[headingLevel>2?jsx14("div",{"aria-hidden":!0,className:"qui-toc__link-indent-guide","data-active":booleanDataAttr4(isActive)}):null,jsx14(Link4,{href:`#${id}`,children:textContent})]},id)})]})})}):null}var Layout={AppContent,Breadcrumbs:DocsBreadcrumbs,ContentWrapper,Footer:DocsFooter,MainContent,PageLinks,Root,Sidebar,TableOfContents};import{c as _c8}from"react/compiler-runtime";import{Fragment as Fragment3,jsx as jsx15,jsxs as jsxs7}from"react/jsx-runtime";import{Menu,PanelLeftClose}from"lucide-react";import{IconButton}from"@qualcomm-ui/react/button";import{Drawer}from"@qualcomm-ui/react/drawer";import{Icon as Icon2}from"@qualcomm-ui/react/icon";import{Portal}from"@qualcomm-ui/react-core/portal";function MobileSidebar(t0){let $=_c8(2),{children,...props}=t0,{pathname}=useMdxDocsLayoutContext(),t1;return $[0]!==children?(t1=t2=>{let{open,setOpen}=t2;return jsx15(Sidebar,{"data-mobile":!0,filterable:!1,mobileDrawerState:open,stickyHeader:!0,children:jsxs7(Fragment3,{children:[children,jsx15(Drawer.CloseTrigger,{children:jsx15(IconButton,{className:"qui-docs-sidebar__mobile-close-trigger",density:"compact",icon:PanelLeftClose,onClick:()=>setOpen(!1),size:"lg",variant:"ghost"})})]})})},$[0]=children,$[1]=t1):t1=$[1],jsx15("div",{className:"qui-docs-sidebar__mobile-container",children:jsxs7(Drawer.Root,{placement:"start",...props,children:[jsx15(Drawer.Trigger,{children:jsx15(IconButton,{"aria-label":"Open Navigation Menu",icon:jsx15(Icon2,{icon:Menu,size:14}),size:"sm",variant:"ghost"})}),jsxs7(Portal,{children:[jsx15(Drawer.Backdrop,{}),jsx15(Drawer.Positioner,{children:jsx15(Drawer.Content,{className:"qui-docs-sidebar__drawer-content",children:jsx15(Drawer.Body,{className:"qui-docs-sidebar__drawer-body",children:jsx15(Drawer.Context,{children:t1})})})})]})]},pathname)})}function DocsLayout({children,footer,header,rootBreadcrumb,sidebarProps,...props}){return jsx16(Layout.Root,{...props,children:({hidePageLinks,hideSideNav,showToc})=>jsxs8(Fragment4,{children:[header,jsx16(Layout.ContentWrapper,{children:jsxs8(Layout.AppContent,{children:[!hideSideNav&&jsx16(Layout.Sidebar,{...sidebarProps}),jsxs8(Layout.MainContent,{children:[jsx16(Layout.Breadcrumbs,{rootBreadcrumb}),children,!hidePageLinks&&jsx16(Layout.PageLinks,{})]}),showToc?jsx16(Layout.TableOfContents,{}):null]})}),footer]})})}export{DocsFooter,DocsLayout,Layout,MdxDocsLayoutContextProvider,MdxProvider,MobileSidebar,useMdxDocsLayoutContext};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|