@qualcomm-ui/react-mdx 1.0.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/LICENSE.txt +31 -0
- package/dist/all.min.css +1 -0
- package/dist/angular-logo/angular-logo.d.ts +3 -0
- package/dist/angular-logo/angular-logo.d.ts.map +1 -0
- package/dist/angular-logo/index.d.ts +2 -0
- package/dist/angular-logo/index.d.ts.map +1 -0
- package/dist/angular-logo/index.js +3 -0
- package/dist/angular-logo/index.js.map +7 -0
- package/dist/code-demo/code-demo.types.d.ts +14 -0
- package/dist/code-demo/code-demo.types.d.ts.map +1 -0
- package/dist/code-demo/code-demo.utils.d.ts +54 -0
- package/dist/code-demo/code-demo.utils.d.ts.map +1 -0
- package/dist/code-demo/index.d.ts +6 -0
- package/dist/code-demo/index.d.ts.map +1 -0
- package/dist/code-demo/index.js +7 -0
- package/dist/code-demo/index.js.map +7 -0
- package/dist/code-demo/internal/index.d.ts +4 -0
- package/dist/code-demo/internal/index.d.ts.map +1 -0
- package/dist/code-demo/internal/qds-demo-theme-selector.d.ts +6 -0
- package/dist/code-demo/internal/qds-demo-theme-selector.d.ts.map +1 -0
- package/dist/code-demo/internal/use-code-demo-preview.d.ts +21 -0
- package/dist/code-demo/internal/use-code-demo-preview.d.ts.map +1 -0
- package/dist/code-demo/internal/use-qds-demo-theme.d.ts +19 -0
- package/dist/code-demo/internal/use-qds-demo-theme.d.ts.map +1 -0
- package/dist/code-demo/qds-angular-demo-runner.d.ts +32 -0
- package/dist/code-demo/qds-angular-demo-runner.d.ts.map +1 -0
- package/dist/code-demo/qds-demo-runner.d.ts +46 -0
- package/dist/code-demo/qds-demo-runner.d.ts.map +1 -0
- package/dist/code-demo/qds-react-demo.d.ts +56 -0
- package/dist/code-demo/qds-react-demo.d.ts.map +1 -0
- package/dist/code-highlight/code-highlight.d.ts +65 -0
- package/dist/code-highlight/code-highlight.d.ts.map +1 -0
- package/dist/code-highlight/index.d.ts +2 -0
- package/dist/code-highlight/index.d.ts.map +1 -0
- package/dist/code-highlight/index.js +4 -0
- package/dist/code-highlight/index.js.map +7 -0
- package/dist/code-highlight/reflection-reference-popup.d.ts +8 -0
- package/dist/code-highlight/reflection-reference-popup.d.ts.map +1 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +3 -0
- package/dist/context/index.js.map +7 -0
- package/dist/context/use-mdx-docs-context.d.ts +44 -0
- package/dist/context/use-mdx-docs-context.d.ts.map +1 -0
- package/dist/context/use-site-context.d.ts +5 -0
- package/dist/context/use-site-context.d.ts.map +1 -0
- package/dist/copy-to-clipboard/copy-to-clipboard-button.d.ts +6 -0
- package/dist/copy-to-clipboard/copy-to-clipboard-button.d.ts.map +1 -0
- package/dist/copy-to-clipboard/copy-to-clipboard-context.d.ts +8 -0
- package/dist/copy-to-clipboard/copy-to-clipboard-context.d.ts.map +1 -0
- package/dist/copy-to-clipboard/copy-to-clipboard-icon-button.d.ts +6 -0
- package/dist/copy-to-clipboard/copy-to-clipboard-icon-button.d.ts.map +1 -0
- package/dist/copy-to-clipboard/index.d.ts +5 -0
- package/dist/copy-to-clipboard/index.d.ts.map +1 -0
- package/dist/copy-to-clipboard/index.js +3 -0
- package/dist/copy-to-clipboard/index.js.map +7 -0
- package/dist/copy-to-clipboard/use-copy-to-clipboard.d.ts +9 -0
- package/dist/copy-to-clipboard/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/deprecated-module/deprecated-module.d.ts +14 -0
- package/dist/deprecated-module/deprecated-module.d.ts.map +1 -0
- package/dist/deprecated-module/index.d.ts +2 -0
- package/dist/deprecated-module/index.d.ts.map +1 -0
- package/dist/deprecated-module/index.js +3 -0
- package/dist/deprecated-module/index.js.map +7 -0
- package/dist/docs-layout/docs-layout.d.ts +15 -0
- package/dist/docs-layout/docs-layout.d.ts.map +1 -0
- package/dist/docs-layout/index.d.ts +5 -0
- package/dist/docs-layout/index.d.ts.map +1 -0
- package/dist/docs-layout/index.js +3 -0
- package/dist/docs-layout/index.js.map +7 -0
- package/dist/docs-layout/internal/anchor-header.d.ts +22 -0
- package/dist/docs-layout/internal/anchor-header.d.ts.map +1 -0
- package/dist/docs-layout/internal/code-tabs.d.ts +6 -0
- package/dist/docs-layout/internal/code-tabs.d.ts.map +1 -0
- package/dist/docs-layout/internal/index.d.ts +5 -0
- package/dist/docs-layout/internal/index.d.ts.map +1 -0
- package/dist/docs-layout/internal/shiki-pre.d.ts +5 -0
- package/dist/docs-layout/internal/shiki-pre.d.ts.map +1 -0
- package/dist/docs-layout/internal/toc-link.d.ts +10 -0
- package/dist/docs-layout/internal/toc-link.d.ts.map +1 -0
- package/dist/docs-layout/layout/app-content.d.ts +10 -0
- package/dist/docs-layout/layout/app-content.d.ts.map +1 -0
- package/dist/docs-layout/layout/breadcrumbs.d.ts +11 -0
- package/dist/docs-layout/layout/breadcrumbs.d.ts.map +1 -0
- package/dist/docs-layout/layout/content-wrapper.d.ts +10 -0
- package/dist/docs-layout/layout/content-wrapper.d.ts.map +1 -0
- package/dist/docs-layout/layout/docs-footer.d.ts +10 -0
- package/dist/docs-layout/layout/docs-footer.d.ts.map +1 -0
- package/dist/docs-layout/layout/index.d.ts +5 -0
- package/dist/docs-layout/layout/index.d.ts.map +1 -0
- package/dist/docs-layout/layout/layout.d.ts +21 -0
- package/dist/docs-layout/layout/layout.d.ts.map +1 -0
- package/dist/docs-layout/layout/main-content.d.ts +14 -0
- package/dist/docs-layout/layout/main-content.d.ts.map +1 -0
- package/dist/docs-layout/layout/mobile-sidebar.d.ts +12 -0
- package/dist/docs-layout/layout/mobile-sidebar.d.ts.map +1 -0
- package/dist/docs-layout/layout/page-links.d.ts +8 -0
- package/dist/docs-layout/layout/page-links.d.ts.map +1 -0
- package/dist/docs-layout/layout/root.d.ts +12 -0
- package/dist/docs-layout/layout/root.d.ts.map +1 -0
- package/dist/docs-layout/layout/sidebar.d.ts +27 -0
- package/dist/docs-layout/layout/sidebar.d.ts.map +1 -0
- package/dist/docs-layout/layout/table-of-contents.d.ts +7 -0
- package/dist/docs-layout/layout/table-of-contents.d.ts.map +1 -0
- package/dist/docs-layout/layout/use-mdx-docs-layout.d.ts +18 -0
- package/dist/docs-layout/layout/use-mdx-docs-layout.d.ts.map +1 -0
- package/dist/docs-layout/mdx-provider.d.ts +44 -0
- package/dist/docs-layout/mdx-provider.d.ts.map +1 -0
- package/dist/docs-layout/types.d.ts +88 -0
- package/dist/docs-layout/types.d.ts.map +1 -0
- package/dist/file-tree/file-tree.d.ts +12 -0
- package/dist/file-tree/file-tree.d.ts.map +1 -0
- package/dist/file-tree/index.d.ts +2 -0
- package/dist/file-tree/index.d.ts.map +1 -0
- package/dist/file-tree/index.js +3 -0
- package/dist/file-tree/index.js.map +7 -0
- package/dist/not-found/index.d.ts +2 -0
- package/dist/not-found/index.d.ts.map +1 -0
- package/dist/not-found/index.js +3 -0
- package/dist/not-found/index.js.map +7 -0
- package/dist/not-found/not-found.d.ts +5 -0
- package/dist/not-found/not-found.d.ts.map +1 -0
- package/dist/npm-install-tabs/index.d.ts +2 -0
- package/dist/npm-install-tabs/index.d.ts.map +1 -0
- package/dist/npm-install-tabs/index.js +3 -0
- package/dist/npm-install-tabs/index.js.map +7 -0
- package/dist/npm-install-tabs/npm-install-tabs.d.ts +19 -0
- package/dist/npm-install-tabs/npm-install-tabs.d.ts.map +1 -0
- package/dist/qui-ecosystem/index.d.ts +2 -0
- package/dist/qui-ecosystem/index.d.ts.map +1 -0
- package/dist/qui-ecosystem/index.js +3 -0
- package/dist/qui-ecosystem/index.js.map +7 -0
- package/dist/qui-ecosystem/qui-ecosystem.d.ts +8 -0
- package/dist/qui-ecosystem/qui-ecosystem.d.ts.map +1 -0
- package/dist/react-logo/index.d.ts +2 -0
- package/dist/react-logo/index.d.ts.map +1 -0
- package/dist/react-logo/index.js +3 -0
- package/dist/react-logo/index.js.map +7 -0
- package/dist/react-logo/react-logo.d.ts +6 -0
- package/dist/react-logo/react-logo.d.ts.map +1 -0
- package/dist/runner/index.d.ts +5 -0
- package/dist/runner/index.d.ts.map +1 -0
- package/dist/runner/index.js +3 -0
- package/dist/runner/index.js.map +7 -0
- package/dist/runner/runner.d.ts +26 -0
- package/dist/runner/runner.d.ts.map +1 -0
- package/dist/runner/transform.d.ts +3 -0
- package/dist/runner/transform.d.ts.map +1 -0
- package/dist/runner/types.d.ts +11 -0
- package/dist/runner/types.d.ts.map +1 -0
- package/dist/runner/use-runner.d.ts +12 -0
- package/dist/runner/use-runner.d.ts.map +1 -0
- package/dist/runner/utils.d.ts +6 -0
- package/dist/runner/utils.d.ts.map +1 -0
- package/dist/shiki/index.d.ts +3 -0
- package/dist/shiki/index.d.ts.map +1 -0
- package/dist/shiki/index.js +3 -0
- package/dist/shiki/index.js.map +7 -0
- package/dist/shiki/shiki-highlighter.d.ts +12 -0
- package/dist/shiki/shiki-highlighter.d.ts.map +1 -0
- package/dist/shiki/shiki-instance.d.ts +10 -0
- package/dist/shiki/shiki-instance.d.ts.map +1 -0
- package/dist/site-search/grouped-result-item.d.ts +9 -0
- package/dist/site-search/grouped-result-item.d.ts.map +1 -0
- package/dist/site-search/index.d.ts +6 -0
- package/dist/site-search/index.d.ts.map +1 -0
- package/dist/site-search/index.js +3 -0
- package/dist/site-search/index.js.map +7 -0
- package/dist/site-search/search-result-item.d.ts +11 -0
- package/dist/site-search/search-result-item.d.ts.map +1 -0
- package/dist/site-search/site-search.d.ts +12 -0
- package/dist/site-search/site-search.d.ts.map +1 -0
- package/dist/site-search/use-grouped-results.d.ts +11 -0
- package/dist/site-search/use-grouped-results.d.ts.map +1 -0
- package/dist/site-search/use-site-search.d.ts +6 -0
- package/dist/site-search/use-site-search.d.ts.map +1 -0
- package/dist/spoiler/index.d.ts +2 -0
- package/dist/spoiler/index.d.ts.map +1 -0
- package/dist/spoiler/index.js +3 -0
- package/dist/spoiler/index.js.map +7 -0
- package/dist/spoiler/spoiler.d.ts +25 -0
- package/dist/spoiler/spoiler.d.ts.map +1 -0
- package/dist/tsbuildinfo +1 -0
- package/dist/typedoc/docs-external-link.d.ts +9 -0
- package/dist/typedoc/docs-external-link.d.ts.map +1 -0
- package/dist/typedoc/index.d.ts +15 -0
- package/dist/typedoc/index.d.ts.map +1 -0
- package/dist/typedoc/index.js +10 -0
- package/dist/typedoc/index.js.map +7 -0
- package/dist/typedoc/internal/index.d.ts +3 -0
- package/dist/typedoc/internal/index.d.ts.map +1 -0
- package/dist/typedoc/internal/jsdoc-comment.d.ts +7 -0
- package/dist/typedoc/internal/jsdoc-comment.d.ts.map +1 -0
- package/dist/typedoc/internal/prop-types.utils.d.ts +30 -0
- package/dist/typedoc/internal/prop-types.utils.d.ts.map +1 -0
- package/dist/typedoc/prop-default.d.ts +7 -0
- package/dist/typedoc/prop-default.d.ts.map +1 -0
- package/dist/typedoc/prop-description/index.d.ts +9 -0
- package/dist/typedoc/prop-description/index.d.ts.map +1 -0
- package/dist/typedoc/prop-description/prop-description-block-tags.d.ts +7 -0
- package/dist/typedoc/prop-description/prop-description-block-tags.d.ts.map +1 -0
- package/dist/typedoc/prop-description/prop-description-extra-details.d.ts +8 -0
- package/dist/typedoc/prop-description/prop-description-extra-details.d.ts.map +1 -0
- package/dist/typedoc/prop-description/prop-description-function-args.d.ts +8 -0
- package/dist/typedoc/prop-description/prop-description-function-args.d.ts.map +1 -0
- package/dist/typedoc/prop-description/prop-description-inline-tag.d.ts +8 -0
- package/dist/typedoc/prop-description/prop-description-inline-tag.d.ts.map +1 -0
- package/dist/typedoc/prop-description/prop-description-option-tags.d.ts +8 -0
- package/dist/typedoc/prop-description/prop-description-option-tags.d.ts.map +1 -0
- package/dist/typedoc/prop-description/prop-description-see-tags.d.ts +9 -0
- package/dist/typedoc/prop-description/prop-description-see-tags.d.ts.map +1 -0
- package/dist/typedoc/prop-description/prop-description-summary.d.ts +8 -0
- package/dist/typedoc/prop-description/prop-description-summary.d.ts.map +1 -0
- package/dist/typedoc/prop-description/prop-description.d.ts +8 -0
- package/dist/typedoc/prop-description/prop-description.d.ts.map +1 -0
- package/dist/typedoc/prop-name.d.ts +10 -0
- package/dist/typedoc/prop-name.d.ts.map +1 -0
- package/dist/typedoc/prop-types/index.d.ts +7 -0
- package/dist/typedoc/prop-types/index.d.ts.map +1 -0
- package/dist/typedoc/prop-types/prop-type.d.ts +8 -0
- package/dist/typedoc/prop-types/prop-type.d.ts.map +1 -0
- package/dist/typedoc/prop-types/reference.d.ts +8 -0
- package/dist/typedoc/prop-types/reference.d.ts.map +1 -0
- package/dist/typedoc/prop-types/reflection.d.ts +7 -0
- package/dist/typedoc/prop-types/reflection.d.ts.map +1 -0
- package/dist/typedoc/prop-types/simple-type.d.ts +10 -0
- package/dist/typedoc/prop-types/simple-type.d.ts.map +1 -0
- package/dist/typedoc/prop-types/ts-icon.d.ts +5 -0
- package/dist/typedoc/prop-types/ts-icon.d.ts.map +1 -0
- package/dist/typedoc/prop-types/type-info-popup.d.ts +7 -0
- package/dist/typedoc/prop-types/type-info-popup.d.ts.map +1 -0
- package/dist/typedoc/reflection/index.d.ts +4 -0
- package/dist/typedoc/reflection/index.d.ts.map +1 -0
- package/dist/typedoc/reflection/type-doc-parameters-table.d.ts +7 -0
- package/dist/typedoc/reflection/type-doc-parameters-table.d.ts.map +1 -0
- package/dist/typedoc/reflection/type-doc-reflection-return.d.ts +7 -0
- package/dist/typedoc/reflection/type-doc-reflection-return.d.ts.map +1 -0
- package/dist/typedoc/reflection/type-doc-reflection.d.ts +9 -0
- package/dist/typedoc/reflection/type-doc-reflection.d.ts.map +1 -0
- package/dist/typedoc/type-doc-angular-attributes.d.ts +6 -0
- package/dist/typedoc/type-doc-angular-attributes.d.ts.map +1 -0
- package/dist/typedoc/type-doc-attributes.d.ts +10 -0
- package/dist/typedoc/type-doc-attributes.d.ts.map +1 -0
- package/dist/typedoc/type-doc-props.d.ts +71 -0
- package/dist/typedoc/type-doc-props.d.ts.map +1 -0
- package/dist/typedoc/typedoc-props-list.d.ts +11 -0
- package/dist/typedoc/typedoc-props-list.d.ts.map +1 -0
- package/dist/typedoc/typedoc-props-table.d.ts +11 -0
- package/dist/typedoc/typedoc-props-table.d.ts.map +1 -0
- package/dist/typedoc/use-props-context.d.ts +6 -0
- package/dist/typedoc/use-props-context.d.ts.map +1 -0
- package/dist/typedoc/use-props-layout-context.d.ts +16 -0
- package/dist/typedoc/use-props-layout-context.d.ts.map +1 -0
- package/dist/typedoc/use-typedoc-context.d.ts +21 -0
- package/dist/typedoc/use-typedoc-context.d.ts.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import type { DecorationItem } from "shiki/types";
|
|
3
|
+
import { type ElementRenderProp } from "@qualcomm-ui/react-core/system";
|
|
4
|
+
import { type CopyToClipboardProps } from "@qualcomm-ui/react-mdx/copy-to-clipboard";
|
|
5
|
+
import type { RenderLink } from "@qualcomm-ui/react-mdx/docs-layout";
|
|
6
|
+
export interface HighlightedReference {
|
|
7
|
+
href: string;
|
|
8
|
+
prettyType?: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface CodeHighlightProps extends ElementRenderProp<"div"> {
|
|
11
|
+
/**
|
|
12
|
+
* The code to highlight.
|
|
13
|
+
*/
|
|
14
|
+
code: string;
|
|
15
|
+
/**
|
|
16
|
+
* Code blocks are automatically collapsible if {@link label} is supplied.
|
|
17
|
+
* Set this prop to false to override this behavior.
|
|
18
|
+
*
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
collapsible?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* props passed to the copy button.
|
|
24
|
+
*/
|
|
25
|
+
copyButtonProps?: Omit<CopyToClipboardProps, "getValue">;
|
|
26
|
+
/**
|
|
27
|
+
* Default collapsed state when {@link collapsible} is true.
|
|
28
|
+
*/
|
|
29
|
+
defaultCollapsed?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* If false, the copy button will not render.
|
|
32
|
+
*/
|
|
33
|
+
disableCopy?: boolean;
|
|
34
|
+
forceShowCopyButton?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Hides the copy button until the user hovers over the code block.
|
|
37
|
+
*/
|
|
38
|
+
hideCopyUntilHover?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Lines to highlight.
|
|
41
|
+
*
|
|
42
|
+
* Broken until shiki supports decorations with structure: inline.
|
|
43
|
+
* https://github.com/shikijs/shiki/issues/992
|
|
44
|
+
*/
|
|
45
|
+
highlight?: number[] | DecorationItem[];
|
|
46
|
+
/**
|
|
47
|
+
* Replaces reference text snippets with internal links and popups.
|
|
48
|
+
*/
|
|
49
|
+
highlightedReferences?: Record<string, HighlightedReference>;
|
|
50
|
+
/**
|
|
51
|
+
* Label to render as the code block's title.
|
|
52
|
+
*/
|
|
53
|
+
label?: ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* shiki target language.
|
|
56
|
+
*/
|
|
57
|
+
language: string;
|
|
58
|
+
/**
|
|
59
|
+
* Props applied to the inner `pre` element.
|
|
60
|
+
*/
|
|
61
|
+
preProps?: ComponentPropsWithRef<"pre">;
|
|
62
|
+
renderLink?: RenderLink;
|
|
63
|
+
}
|
|
64
|
+
export declare function CodeHighlight({ className, code, collapsible, copyButtonProps, defaultCollapsed, disableCopy, forceShowCopyButton, hideCopyUntilHover, highlight: linesProp, highlightedReferences: _highlightedReferences, label, language, preProps, ref, renderLink: _DocLink, ...props }: CodeHighlightProps): ReactElement;
|
|
65
|
+
//# sourceMappingURL=code-highlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-highlight.d.ts","sourceRoot":"","sources":["../../src/code-highlight/code-highlight.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;AAK/C,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,0CAA0C,CAAA;AACjD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,oCAAoC,CAAA;AAKlE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B;AAED,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB,CAAC,KAAK,CAAC;IAClE;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;OAEG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAA;IAExD;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAE1B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAE7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAE5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAAA;IAEvC;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;IAE5D;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAA;IAEvC,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB;AAED,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,IAAI,EACJ,WAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,mBAA2B,EAC3B,kBAAkB,EAClB,SAAS,EAAE,SAAS,EACpB,qBAAqB,EAAE,sBAAsB,EAC7C,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,GAAG,EACH,UAAU,EAAE,QAAQ,EACpB,GAAG,KAAK,EACT,EAAE,kBAAkB,GAAG,YAAY,CAuGnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/code-highlight/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as t,jsxs as C}from"react/jsx-runtime";import{useCallback as _,useMemo as l,useState as k}from"react";import{ChevronDownIcon as B}from"lucide-react";import{Button as H}from"@qualcomm-ui/react/button";import{Collapsible as v}from"@qualcomm-ui/react/collapsible";import{Icon as P}from"@qualcomm-ui/react/icon";import{PolymorphicElement as S}from"@qualcomm-ui/react-core/system";import{CopyToClipboardIconButton as A}from"@qualcomm-ui/react-mdx/copy-to-clipboard";import{ShikiHighlighter as F}from"@qualcomm-ui/react-mdx/shiki";import{booleanDataAttr as O}from"@qualcomm-ui/utils/attributes";import{clsx as r}from"@qualcomm-ui/utils/clsx";function oo({className:w,code:n,collapsible:i=!0,copyButtonProps:m,defaultCollapsed:x,disableCopy:I,forceShowCopyButton:s=!1,hideCopyUntilHover:N,highlight:c,highlightedReferences:T,label:h,language:b,preProps:q,ref:y,renderLink:z,...L}){let u=n.trim(),[a,g]=k(!N||s),[e,D]=k(!x),d=l(()=>{let o=c??[];return o&&typeof o?.[0]=="number"?o.map(p=>({end:{character:-1,line:p},properties:{"data-highlight":"true"},start:{character:0,line:p},transform:(f,j)=>(console.debug(f,j),f)})):o},[c]),E=_(()=>{g(!0)},[]),M=_(()=>{g(s||!1)},[s]),R=l(()=>a&&n.split(`
|
|
3
|
+
`).filter(o=>o.trim()).length===1,[n,a]);return C(S,{ref:y,as:"div",className:r("qui-docs-highlighter__root",w),onMouseEnter:E,onMouseLeave:M,...L,children:[h?t(H,{className:r("qui-demo-runner__title",{"showing-panel":e}),endIcon:i?t(P,{className:r("qui-demo-runner__collapse-icon",{"showing-panel":e}),icon:B}):null,onClick:()=>i?D(o=>!o):null,tabIndex:i?0:-1,variant:"outline",children:h}):null,t(v.Root,{open:e,children:C(v.Content,{children:[I||!e||!a?null:t(A,{...m,className:r("qui-code-copy-button",{"has-title":h,showing:e},m?.className),"data-centered":O(R),valueOrFn:u}),t(F,{cache:!0,code:u,language:b,shikiConfig:l(()=>({decorations:d}),[d]),...q})]})})]})}export{oo as CodeHighlight};
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/code-highlight/code-highlight.tsx"],
|
|
4
|
+
"sourcesContent": ["import { jsx, jsxs } from \"react/jsx-runtime\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport { ChevronDownIcon } from \"lucide-react\";\nimport { Button } from \"@qualcomm-ui/react/button\";\nimport { Collapsible } from \"@qualcomm-ui/react/collapsible\";\nimport { Icon } from \"@qualcomm-ui/react/icon\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { CopyToClipboardIconButton } from \"@qualcomm-ui/react-mdx/copy-to-clipboard\";\nimport { ShikiHighlighter } from \"@qualcomm-ui/react-mdx/shiki\";\nimport { booleanDataAttr } from \"@qualcomm-ui/utils/attributes\";\nimport { clsx } from \"@qualcomm-ui/utils/clsx\";\nexport function CodeHighlight({\n className,\n code,\n collapsible = true,\n copyButtonProps,\n defaultCollapsed,\n disableCopy,\n forceShowCopyButton = false,\n hideCopyUntilHover,\n highlight: linesProp,\n highlightedReferences: _highlightedReferences,\n label,\n language,\n preProps,\n ref,\n renderLink: _DocLink,\n ...props\n}) {\n const formattedCode = code.trim();\n const [showCopyButton, setShowCopyButton] = useState(!hideCopyUntilHover || forceShowCopyButton);\n const [showingPanel, setShowingPanel] = useState(!defaultCollapsed);\n const highlight = useMemo(() => {\n const highlightProp = linesProp ?? [];\n if (highlightProp && typeof highlightProp?.[0] === \"number\") {\n return highlightProp.map(line => ({\n end: {\n character: -1,\n line\n },\n properties: {\n \"data-highlight\": \"true\"\n },\n start: {\n character: 0,\n line\n },\n transform: (element, type) => {\n console.debug(element, type);\n return element;\n }\n }));\n }\n return highlightProp;\n }, [linesProp]);\n const mouseEnter = useCallback(() => {\n setShowCopyButton(true);\n }, []);\n const mouseLeave = useCallback(() => {\n setShowCopyButton(forceShowCopyButton || false);\n }, [forceShowCopyButton]);\n const shouldCenterCopyButton = useMemo(() => showCopyButton && code.split(\"\\n\").filter(line_0 => line_0.trim()).length === 1, [code, showCopyButton]);\n return /* @__PURE__ */jsxs(PolymorphicElement, {\n ref,\n as: \"div\",\n className: clsx(\"qui-docs-highlighter__root\", className),\n onMouseEnter: mouseEnter,\n onMouseLeave: mouseLeave,\n ...props,\n children: [label ? /* @__PURE__ */jsx(Button, {\n className: clsx(\"qui-demo-runner__title\", {\n \"showing-panel\": showingPanel\n }),\n endIcon: collapsible ? /* @__PURE__ */jsx(Icon, {\n className: clsx(\"qui-demo-runner__collapse-icon\", {\n \"showing-panel\": showingPanel\n }),\n icon: ChevronDownIcon\n }) : null,\n onClick: () => collapsible ? setShowingPanel(prevState => !prevState) : null,\n tabIndex: collapsible ? 0 : -1,\n variant: \"outline\",\n children: label\n }) : null, /* @__PURE__ */jsx(Collapsible.Root, {\n open: showingPanel,\n children: /* @__PURE__ */jsxs(Collapsible.Content, {\n children: [disableCopy || !showingPanel || !showCopyButton ? null : /* @__PURE__ */jsx(CopyToClipboardIconButton, {\n ...copyButtonProps,\n className: clsx(\"qui-code-copy-button\", {\n \"has-title\": label,\n showing: showingPanel\n }, copyButtonProps?.className),\n \"data-centered\": booleanDataAttr(shouldCenterCopyButton),\n valueOrFn: formattedCode\n }), /* @__PURE__ */jsx(ShikiHighlighter, {\n cache: true,\n code: formattedCode,\n language,\n shikiConfig: useMemo(() => ({\n decorations: highlight\n }), [highlight]),\n ...preProps\n })]\n })\n })]\n });\n}"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["jsx", "jsxs", "useCallback", "useMemo", "useState", "ChevronDownIcon", "Button", "Collapsible", "Icon", "PolymorphicElement", "CopyToClipboardIconButton", "ShikiHighlighter", "booleanDataAttr", "clsx", "CodeHighlight", "className", "code", "collapsible", "copyButtonProps", "defaultCollapsed", "disableCopy", "forceShowCopyButton", "hideCopyUntilHover", "linesProp", "_highlightedReferences", "label", "language", "preProps", "ref", "_DocLink", "props", "formattedCode", "showCopyButton", "setShowCopyButton", "showingPanel", "setShowingPanel", "highlight", "highlightProp", "line", "element", "type", "mouseEnter", "mouseLeave", "shouldCenterCopyButton", "line_0", "prevState"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
children: ReactElement;
|
|
4
|
+
prettyType: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function ReflectionReferencePopup({ children, prettyType, }: Props): ReactNode;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=reflection-reference-popup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reflection-reference-popup.d.ts","sourceRoot":"","sources":["../../src/code-highlight/reflection-reference-popup.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAC,KAAK,YAAY,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAA;AAKjE,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,wBAAwB,CAAC,EACvC,QAAQ,EACR,UAAU,GACX,EAAE,KAAK,GAAG,SAAS,CA4CnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{createContext as n,useContext as r}from"react";var e=n(null),a=e.Provider;function d(){let t=r(e);if(!t)throw new Error("useMdxDocsContext can only be used as children of an <MdxDocsProvider> instance.");return t}import{createContext as c,useContext as s}from"react";var o=c(null),l=o.Provider,x={navItems:[],pageMap:{},searchIndex:[]};function f(){let t=s(o);return t||(console.warn("`useSiteContext` can only be used in a child of <SiteContextProvider>"),x)}export{a as MdxDocsProvider,l as SiteContextProvider,d as useMdxDocsContext,f as useSiteContext};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/context/use-mdx-docs-context.ts", "../../src/context/use-site-context.ts"],
|
|
4
|
+
"sourcesContent": ["import { createContext, useContext } from \"react\";\nconst MdxDocsContext = createContext(null);\nexport const MdxDocsProvider = MdxDocsContext.Provider;\nexport function useMdxDocsContext() {\n const context = useContext(MdxDocsContext);\n if (!context) {\n throw new Error(\"useMdxDocsContext can only be used as children of an <MdxDocsProvider> instance.\");\n }\n return context;\n}", "import { createContext, useContext } from \"react\";\nconst SiteContext = createContext(null);\nexport const SiteContextProvider = SiteContext.Provider;\nconst siteDataFallback = {\n navItems: [],\n pageMap: {},\n searchIndex: []\n};\nexport function useSiteContext() {\n const context = useContext(SiteContext);\n if (!context) {\n console.warn(\"`useSiteContext` can only be used in a child of <SiteContextProvider>\");\n return siteDataFallback;\n }\n return context;\n}"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,iBAAAA,EAAe,cAAAC,MAAkB,QAC1C,IAAMC,EAAiBF,EAAc,IAAI,EAC5BG,EAAkBD,EAAe,SACvC,SAASE,GAAoB,CAClC,IAAMC,EAAUJ,EAAWC,CAAc,EACzC,GAAI,CAACG,EACH,MAAM,IAAI,MAAM,kFAAkF,EAEpG,OAAOA,CACT,CCTA,OAAS,iBAAAC,EAAe,cAAAC,MAAkB,QAC1C,IAAMC,EAAcF,EAAc,IAAI,EACzBG,EAAsBD,EAAY,SACzCE,EAAmB,CACvB,SAAU,CAAC,EACX,QAAS,CAAC,EACV,YAAa,CAAC,CAChB,EACO,SAASC,GAAiB,CAC/B,IAAMC,EAAUL,EAAWC,CAAW,EACtC,OAAKI,IACH,QAAQ,KAAK,uEAAuE,EAC7EF,EAGX",
|
|
6
|
+
"names": ["createContext", "useContext", "MdxDocsContext", "MdxDocsProvider", "useMdxDocsContext", "context", "createContext", "useContext", "SiteContext", "SiteContextProvider", "siteDataFallback", "useSiteContext", "context"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type Provider } from "react";
|
|
2
|
+
import type { DocPropsSettings, RenderLink, TocHighlightStrategy } from "@qualcomm-ui/react-mdx/docs-layout";
|
|
3
|
+
export type PackageManager = "npm" | "yarn" | "pnpm";
|
|
4
|
+
export interface DemoStateEntry {
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* <demoId, DemoStateEntry>
|
|
9
|
+
*/
|
|
10
|
+
export type DemoState = Record<string, DemoStateEntry>;
|
|
11
|
+
/**
|
|
12
|
+
* <routeUrl, DemoState>
|
|
13
|
+
*/
|
|
14
|
+
export type RouteDemoState = Record<string, DemoState>;
|
|
15
|
+
export interface MdxDocsContextValue {
|
|
16
|
+
/**
|
|
17
|
+
* Demo state for each route, typically persisted via localStorage or a session
|
|
18
|
+
* cookie (SSR). This preserves the expand/collapse state of each demo on reload.
|
|
19
|
+
*/
|
|
20
|
+
demoState: RouteDemoState;
|
|
21
|
+
docProps?: DocPropsSettings;
|
|
22
|
+
/**
|
|
23
|
+
* When the user selects the package manager in our npm install tabs component,
|
|
24
|
+
* we persist their choice here.
|
|
25
|
+
*/
|
|
26
|
+
packageManager?: PackageManager;
|
|
27
|
+
renderLink: RenderLink;
|
|
28
|
+
/**
|
|
29
|
+
* onChange handler for the {@link packageManager field}
|
|
30
|
+
*/
|
|
31
|
+
setPackageManager?: (packageManager: PackageManager) => void;
|
|
32
|
+
/**
|
|
33
|
+
* User agent from SSR>
|
|
34
|
+
*/
|
|
35
|
+
ssrUserAgent?: string;
|
|
36
|
+
/**
|
|
37
|
+
* @default 'nearest'
|
|
38
|
+
*/
|
|
39
|
+
tocHighlightStrategy?: TocHighlightStrategy;
|
|
40
|
+
updateDemoState: (routeUrl: string, demoId: string, state: DemoStateEntry) => void;
|
|
41
|
+
}
|
|
42
|
+
export declare const MdxDocsProvider: Provider<MdxDocsContextValue | null>;
|
|
43
|
+
export declare function useMdxDocsContext(): MdxDocsContextValue;
|
|
44
|
+
//# sourceMappingURL=use-mdx-docs-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-mdx-docs-context.d.ts","sourceRoot":"","sources":["../../src/context/use-mdx-docs-context.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,QAAQ,EAAa,MAAM,OAAO,CAAA;AAE9D,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;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;AAEtD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAEtD,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,SAAS,EAAE,cAAc,CAAA;IAEzB,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAE3B;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAA;IAE/B,UAAU,EAAE,UAAU,CAAA;IACtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,IAAI,CAAA;IAE5D;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,oBAAoB,CAAC,EAAE,oBAAoB,CAAA;IAE3C,eAAe,EAAE,CACf,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,cAAc,KAClB,IAAI,CAAA;CACV;AAID,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,mBAAmB,GAAG,IAAI,CACxC,CAAA;AAEzB,wBAAgB,iBAAiB,IAAI,mBAAmB,CAUvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-site-context.d.ts","sourceRoot":"","sources":["../../src/context/use-site-context.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,QAAQ,EAAa,MAAM,OAAO,CAAA;AAE9D,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAA;AAIrD,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,CACpC,CAAA;AAItB,wBAAgB,cAAc,IAAI,QAAQ,CAWzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-to-clipboard-button.d.ts","sourceRoot":"","sources":["../../src/copy-to-clipboard/copy-to-clipboard-button.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,OAAO,CAAA;AAOvC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAA;CAC9B;AAED,wBAAgB,qBAAqB,CAAC,EAAC,IAAI,EAAC,EAAE,eAAe,GAAG,YAAY,CAuB3E"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ProviderExoticComponent, ProviderProps } from "react";
|
|
2
|
+
export interface CopyToClipboardContextValue {
|
|
3
|
+
copyToClipboard: () => void;
|
|
4
|
+
isCopied: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const CopyToClipboardContextProvider: ProviderExoticComponent<ProviderProps<CopyToClipboardContextValue>>;
|
|
7
|
+
export declare const useCopyToClipboardContext: (requireContext?: boolean) => CopyToClipboardContextValue;
|
|
8
|
+
//# sourceMappingURL=copy-to-clipboard-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-to-clipboard-context.d.ts","sourceRoot":"","sources":["../../src/copy-to-clipboard/copy-to-clipboard-context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,uBAAuB,EAAE,aAAa,EAAC,MAAM,OAAO,CAAA;AAIjE,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,QAAQ,EAAE,OAAO,CAAA;CAClB;AAQD,eAAO,MAAM,8BAA8B,EAAE,uBAAuB,CAClE,aAAa,CAAC,2BAA2B,CAAC,CAC9B,CAAA;AAEd,eAAO,MAAM,yBAAyB,EAAE,CACtC,cAAc,CAAC,EAAE,OAAO,KACrB,2BAAwC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentProps, ReactElement } from "react";
|
|
2
|
+
export interface CopyToClipboardProps extends Omit<ComponentProps<"button">, "color" | "ref"> {
|
|
3
|
+
valueOrFn: string | (() => string);
|
|
4
|
+
}
|
|
5
|
+
export declare function CopyToClipboardIconButton({ valueOrFn, ...props }: CopyToClipboardProps): ReactElement;
|
|
6
|
+
//# sourceMappingURL=copy-to-clipboard-icon-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,cAAc,EAAE,YAAY,EAAC,MAAM,OAAO,CAAA;AASvD,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACvD,SAAS,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAA;CACnC;AAED,wBAAgB,yBAAyB,CAAC,EACxC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,GAAG,YAAY,CAkBrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/copy-to-clipboard/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{c as b}from"react/compiler-runtime";import{jsx as x}from"react/jsx-runtime";import{Check as T,Copy as v}from"lucide-react";import{Button as h}from"@qualcomm-ui/react/button";import{useCopyToClipboard as g}from"@qualcomm-ui/react-mdx/copy-to-clipboard";function q(c){let o=b(7),{code:i}=c,r;o[0]!==i?(r={valueOrFn:i},o[0]=i,o[1]=r):r=o[1];let{copyToClipboard:t,isCopied:s}=g(r),p=s?T:v,e;o[2]!==t?(e=a=>{t(),a.preventDefault(),a.stopPropagation()},o[2]=t,o[3]=e):e=o[3];let n;return o[4]!==p||o[5]!==e?(n=x(h,{emphasis:"primary",endIcon:p,onClick:e,size:"sm",type:"button",variant:"ghost",children:"Copy"}),o[4]=p,o[5]=e,o[6]=n):n=o[6],n}import{createGuardedContext as k}from"@qualcomm-ui/react-core/context";var d=k({hookName:"useCopyToClipboardContext",providerName:"<CopyToClipboardContextProvider>",strict:!0}),K=d[0],u=d[1];import{c as j}from"react/compiler-runtime";import{jsx as N}from"react/jsx-runtime";import{Check as O,Copy as $}from"lucide-react";import{IconButton as z}from"@qualcomm-ui/react/button";import{mergeProps as w}from"@qualcomm-ui/utils/merge-props";import{c as I}from"react/compiler-runtime";import{useEffect as P,useState as _}from"react";function y(c){let o=I(8),i=u(!1),{valueOrFn:r}=c,[t,s]=_(!1),p,e;o[0]!==t?(p=()=>{if(!t)return F;let m=setTimeout(()=>{s(!1)},2e3);return()=>{clearTimeout(m)}},e=[t],o[0]=t,o[1]=p,o[2]=e):(p=o[1],e=o[2]),P(p,e);let n;o[3]!==r?(n=()=>{navigator?.clipboard||console.error("Access to clipboard rejected!");let m=typeof r=="function"?r():r;if(!m){console.error("No value to copy!");return}navigator.clipboard.writeText(m).catch(B).finally(()=>{s(!0)})},o[3]=r,o[4]=n):n=o[4];let a=n,C=i?.copyToClipboard||a,f=i?.isCopied??t,l;return o[5]!==C||o[6]!==f?(l={copyToClipboard:C,isCopied:f},o[5]=C,o[6]=f,o[7]=l):l=o[7],l}function B(){return console.error("Failed to copy!")}function F(){}function eo(c){let o=j(2),{valueOrFn:i,...r}=c,t;o[0]!==i?(t={valueOrFn:i},o[0]=i,o[1]=t):t=o[1];let{copyToClipboard:s,isCopied:p}=y(t),e=w({onClick:s},r);return N(z,{emphasis:"primary",icon:p?O:$,size:"sm",tabIndex:0,title:"Copy code",variant:"ghost",...e})}export{q as CopyToClipboardButton,K as CopyToClipboardContextProvider,eo as CopyToClipboardIconButton,y as useCopyToClipboard,u as useCopyToClipboardContext};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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"],
|
|
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\";\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 const t2 = isCopied ? Check : Copy;\n let t3;\n if ($[2] !== copyToClipboard) {\n t3 = event => {\n copyToClipboard();\n event.preventDefault();\n event.stopPropagation();\n };\n $[2] = copyToClipboard;\n $[3] = t3;\n } else {\n t3 = $[3];\n }\n let t4;\n if ($[4] !== t2 || $[5] !== t3) {\n t4 = jsx(Button, {\n emphasis: \"primary\",\n endIcon: t2,\n onClick: t3,\n size: \"sm\",\n type: \"button\",\n variant: \"ghost\",\n children: \"Copy\"\n });\n $[4] = t2;\n $[5] = t3;\n $[6] = t4;\n } else {\n t4 = $[6];\n }\n return t4;\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 { 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 onClick: copyToClipboard\n }, props);\n return jsx(IconButton, {\n emphasis: \"primary\",\n icon: isCopied ? Check : Copy,\n size: \"sm\",\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() {}"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,KAAKA,MAAU,yBACxB,OAAS,OAAAC,MAAW,oBACpB,OAAS,SAAAC,EAAO,QAAAC,MAAY,eAC5B,OAAS,UAAAC,MAAc,4BACvB,OAAS,sBAAAC,MAA0B,2CAC5B,SAASC,EAAsBC,EAAI,CACxC,IAAMC,EAAIR,EAAG,CAAC,EACR,CACJ,KAAAS,CACF,EAAIF,EACAG,EACAF,EAAE,CAAC,IAAMC,GACXC,EAAK,CACH,UAAWD,CACb,EACAD,EAAE,CAAC,EAAIC,EACPD,EAAE,CAAC,EAAIE,GAEPA,EAAKF,EAAE,CAAC,EAEV,GAAM,CACJ,gBAAAG,EACA,SAAAC,CACF,EAAIP,EAAmBK,CAAE,EACnBG,EAAKD,EAAWV,EAAQC,EAC1BW,EACAN,EAAE,CAAC,IAAMG,GACXG,EAAKC,GAAS,CACZJ,EAAgB,EAChBI,EAAM,eAAe,EACrBA,EAAM,gBAAgB,CACxB,EACAP,EAAE,CAAC,EAAIG,EACPH,EAAE,CAAC,EAAIM,GAEPA,EAAKN,EAAE,CAAC,EAEV,IAAIQ,EACJ,OAAIR,EAAE,CAAC,IAAMK,GAAML,EAAE,CAAC,IAAMM,GAC1BE,EAAKf,EAAIG,EAAQ,CACf,SAAU,UACV,QAASS,EACT,QAASC,EACT,KAAM,KACN,KAAM,SACN,QAAS,QACT,SAAU,MACZ,CAAC,EACDN,EAAE,CAAC,EAAIK,EACPL,EAAE,CAAC,EAAIM,EACPN,EAAE,CAAC,EAAIQ,GAEPA,EAAKR,EAAE,CAAC,EAEHQ,CACT,CCvDA,OAAS,wBAAAC,MAA4B,kCACrC,IAAMC,EAAUD,EAAqB,CACnC,SAAU,4BACV,aAAc,mCACd,OAAQ,EACV,CAAC,EACYE,EAAiCD,EAAQ,CAAC,EAC1CE,EAA4BF,EAAQ,CAAC,ECPlD,OAAS,KAAKG,MAAU,yBACxB,OAAS,OAAAC,MAAW,oBACpB,OAAS,SAAAC,EAAO,QAAAC,MAAY,eAC5B,OAAS,cAAAC,MAAkB,4BAC3B,OAAS,cAAAC,MAAkB,iCCJ3B,OAAS,KAAKC,MAAU,yBACxB,OAAsB,aAAAC,EAAW,YAAAC,MAAgB,QAE1C,SAASC,EAAmBC,EAAO,CACxC,IAAMC,EAAIC,EAAG,CAAC,EACRC,EAAUC,EAA0B,EAAK,EACzC,CACJ,UAAAC,CACF,EAAIL,EACE,CAACM,EAAUC,CAAS,EAAIC,EAAS,EAAK,EACxCC,EACAC,EACAT,EAAE,CAAC,IAAMK,GACXG,EAAK,IAAM,CACT,GAAI,CAACH,EACH,OAAOK,EAET,IAAMC,EAAU,WAAW,IAAM,CAC/BL,EAAU,EAAK,CACjB,EAAG,GAAI,EACP,MAAO,IAAM,CACX,aAAaK,CAAO,CACtB,CACF,EACAF,EAAK,CAACJ,CAAQ,EACdL,EAAE,CAAC,EAAIK,EACPL,EAAE,CAAC,EAAIQ,EACPR,EAAE,CAAC,EAAIS,IAEPD,EAAKR,EAAE,CAAC,EACRS,EAAKT,EAAE,CAAC,GAEVY,EAAUJ,EAAIC,CAAE,EAChB,IAAII,EACAb,EAAE,CAAC,IAAMI,GACXS,EAAK,IAAM,CACJ,WAAW,WACd,QAAQ,MAAM,+BAA+B,EAE/C,IAAMC,EAAQ,OAAOV,GAAc,WAAaA,EAAU,EAAIA,EAC9D,GAAI,CAACU,EAAO,CACV,QAAQ,MAAM,mBAAmB,EACjC,MACF,CACA,UAAU,UAAU,UAAUA,CAAK,EAAE,MAAMC,CAAM,EAAE,QAAQ,IAAM,CAC/DT,EAAU,EAAI,CAChB,CAAC,CACH,EACAN,EAAE,CAAC,EAAII,EACPJ,EAAE,CAAC,EAAIa,GAEPA,EAAKb,EAAE,CAAC,EAEV,IAAMgB,EAAkBH,EAClBI,EAAKf,GAAS,iBAAmBc,EACjCE,EAAKhB,GAAS,UAAYG,EAC5Bc,EACJ,OAAInB,EAAE,CAAC,IAAMiB,GAAMjB,EAAE,CAAC,IAAMkB,GAC1BC,EAAK,CACH,gBAAiBF,EACjB,SAAUC,CACZ,EACAlB,EAAE,CAAC,EAAIiB,EACPjB,EAAE,CAAC,EAAIkB,EACPlB,EAAE,CAAC,EAAImB,GAEPA,EAAKnB,EAAE,CAAC,EAEHmB,CACT,CACA,SAASJ,GAAS,CAChB,OAAO,QAAQ,MAAM,iBAAiB,CACxC,CACA,SAASL,GAAQ,CAAC,CDnEX,SAASU,GAA0BC,EAAI,CAC5C,IAAMC,EAAIC,EAAG,CAAC,EACR,CACJ,UAAAC,EACA,GAAGC,CACL,EAAIJ,EACAK,EACAJ,EAAE,CAAC,IAAME,GACXE,EAAK,CACH,UAAAF,CACF,EACAF,EAAE,CAAC,EAAIE,EACPF,EAAE,CAAC,EAAII,GAEPA,EAAKJ,EAAE,CAAC,EAEV,GAAM,CACJ,gBAAAK,EACA,SAAAC,CACF,EAAIC,EAAmBH,CAAE,EACnBI,EAAcC,EAAW,CAC7B,QAASJ,CACX,EAAGF,CAAK,EACR,OAAOO,EAAIC,EAAY,CACrB,SAAU,UACV,KAAML,EAAWM,EAAQC,EACzB,KAAM,KACN,SAAU,EACV,MAAO,YACP,QAAS,QACT,GAAGL,CACL,CAAC,CACH",
|
|
6
|
+
"names": ["_c", "jsx", "Check", "Copy", "Button", "useCopyToClipboard", "CopyToClipboardButton", "t0", "$", "code", "t1", "copyToClipboard", "isCopied", "t2", "t3", "event", "t4", "createGuardedContext", "context", "CopyToClipboardContextProvider", "useCopyToClipboardContext", "_c", "jsx", "Check", "Copy", "IconButton", "mergeProps", "_c", "useEffect", "useState", "useCopyToClipboard", "props", "$", "_c", "context", "useCopyToClipboardContext", "valueOrFn", "isCopied", "setCopied", "useState", "t0", "t1", "_temp", "timerId", "useEffect", "t2", "value", "_temp2", "copyToClipboard", "t3", "t4", "t5", "CopyToClipboardIconButton", "t0", "$", "_c", "valueOrFn", "props", "t1", "copyToClipboard", "isCopied", "useCopyToClipboard", "mergedProps", "mergeProps", "jsx", "IconButton", "Check", "Copy"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface UseCopyToClipboardProps {
|
|
2
|
+
valueOrFn: (() => string) | string;
|
|
3
|
+
}
|
|
4
|
+
export interface UseCopyToClipboard {
|
|
5
|
+
copyToClipboard: () => void;
|
|
6
|
+
isCopied: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function useCopyToClipboard(props: UseCopyToClipboardProps): UseCopyToClipboard;
|
|
9
|
+
//# sourceMappingURL=use-copy-to-clipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-copy-to-clipboard.d.ts","sourceRoot":"","sources":["../../src/copy-to-clipboard/use-copy-to-clipboard.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,MAAM,CAAA;CACnC;AAED,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,uBAAuB,GAC7B,kBAAkB,CAuCpB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
interface DeprecatedModuleProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.
|
|
5
|
+
*/
|
|
6
|
+
message?: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Version that the module was deprecated in.
|
|
9
|
+
*/
|
|
10
|
+
since: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function DeprecatedModule({ message, since, ...props }: DeprecatedModuleProps): ReactNode;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=deprecated-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecated-module.d.ts","sourceRoot":"","sources":["../../src/deprecated-module/deprecated-module.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,cAAc,EAAE,SAAS,EAAC,MAAM,OAAO,CAAA;AAKpD,UAAU,qBAAsB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACpE;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;IAEnB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAA;CACjB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,qBAAqB,GAAG,SAAS,CAwBnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deprecated-module/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{InlineNotification as s}from"@qualcomm-ui/react/inline-notification";import{mergeProps as n}from"@qualcomm-ui/utils/merge-props";function l({message:i,since:o,...d}){let a=n({className:"qui-deprecated-module__root"},d);return e("div",{...a,children:e(s,{className:"qui-deprecated-module__notification",description:r("div",{className:"qui-deprecated-module__message",children:[r("span",{children:["This module was deprecated in ",o," and will be removed in a future release."]}),e("span",{children:i})]}),emphasis:"warning",label:"Deprecated"})})}export{l as DeprecatedModule};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/deprecated-module/deprecated-module.tsx"],
|
|
4
|
+
"sourcesContent": ["import { jsx, jsxs } from \"react/jsx-runtime\";\nimport { InlineNotification } from \"@qualcomm-ui/react/inline-notification\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nexport function DeprecatedModule({\n message,\n since,\n ...props\n}) {\n const mergedProps = mergeProps({\n className: \"qui-deprecated-module__root\"\n }, props);\n return /* @__PURE__ */jsx(\"div\", {\n ...mergedProps,\n children: /* @__PURE__ */jsx(InlineNotification, {\n className: \"qui-deprecated-module__notification\",\n description: /* @__PURE__ */jsxs(\"div\", {\n className: \"qui-deprecated-module__message\",\n children: [/* @__PURE__ */jsxs(\"span\", {\n children: [\"This module was deprecated in \", since, \" and will be removed in a future release.\"]\n }), /* @__PURE__ */jsx(\"span\", {\n children: message\n })]\n }),\n emphasis: \"warning\",\n label: \"Deprecated\"\n })\n });\n}"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,OAAAA,EAAK,QAAAC,MAAY,oBAC1B,OAAS,sBAAAC,MAA0B,yCACnC,OAAS,cAAAC,MAAkB,iCACpB,SAASC,EAAiB,CAC/B,QAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EAAG,CACD,IAAMC,EAAcL,EAAW,CAC7B,UAAW,6BACb,EAAGI,CAAK,EACR,OAAsBP,EAAI,MAAO,CAC/B,GAAGQ,EACH,SAAyBR,EAAIE,EAAoB,CAC/C,UAAW,sCACX,YAA4BD,EAAK,MAAO,CACtC,UAAW,iCACX,SAAU,CAAgBA,EAAK,OAAQ,CACrC,SAAU,CAAC,iCAAkCK,EAAO,2CAA2C,CACjG,CAAC,EAAkBN,EAAI,OAAQ,CAC7B,SAAUK,CACZ,CAAC,CAAC,CACJ,CAAC,EACD,SAAU,UACV,MAAO,YACT,CAAC,CACH,CAAC,CACH",
|
|
6
|
+
"names": ["jsx", "jsxs", "InlineNotification", "mergeProps", "DeprecatedModule", "message", "since", "props", "mergedProps"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ElementRenderProp } from "@qualcomm-ui/react-core/system";
|
|
3
|
+
import type { DocsLayoutSettings } from "./types";
|
|
4
|
+
export interface DocsLayoutProps extends DocsLayoutSettings {
|
|
5
|
+
/**
|
|
6
|
+
* React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Props to pass to the sidebar.
|
|
11
|
+
*/
|
|
12
|
+
sidebarProps?: ElementRenderProp<"div">;
|
|
13
|
+
}
|
|
14
|
+
export declare function DocsLayout({ children, footer, header, rootBreadcrumb, sidebarProps, ...props }: DocsLayoutProps): ReactNode;
|
|
15
|
+
//# sourceMappingURL=docs-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-layout.d.ts","sourceRoot":"","sources":["../../src/docs-layout/docs-layout.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAA;AAEpC,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAA;AAGrE,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAE/C,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAA;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAA;CACxC;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,MAAM,EACN,MAAM,EACN,cAAc,EACd,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,SAAS,CA4B7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/docs-layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,mBAAmB,SAAS,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{Fragment as mr,jsx as O,jsxs as de}from"react/jsx-runtime";import{jsx as et}from"react/jsx-runtime";import{PolymorphicElement as tt}from"@qualcomm-ui/react-core/system";import{clsx as ot}from"@qualcomm-ui/utils/clsx";function ge({children:t,className:e,ref:o,...i}){return et(tt,{ref:o,as:"div",className:ot("qui-docs__footer",e),...i,children:t})}import{jsx as it}from"react/jsx-runtime";import{PolymorphicElement as st}from"@qualcomm-ui/react-core/system";import{booleanDataAttr as Ne}from"@qualcomm-ui/utils/attributes";import{clsx as ct}from"@qualcomm-ui/utils/clsx";import{createContext as rt,useContext as nt}from"react";var _e=rt(null),be=_e.Provider;function k(){let t=nt(_e);if(!t)throw new Error("useMdxDocsLayoutContext can only be used as children of a <Layout.Root> instance.");return t}function ve(t){let{children:e,className:o,...i}=t,{hideSideNav:n,showToc:r}=k();return it(st,{as:"div",className:ct("qui-docs__app-content",o),"data-hide-side-nav":Ne(n),"data-hide-toc":Ne(!r),...i,children:e})}import{c as lt}from"react/compiler-runtime";import{jsx as A}from"react/jsx-runtime";import"react";import{Breadcrumbs as ie}from"@qualcomm-ui/react/breadcrumbs";import{PolymorphicElement as at}from"@qualcomm-ui/react-core/system";import{useMdxDocsContext as mt}from"@qualcomm-ui/react-mdx/context";import{clsx as dt}from"@qualcomm-ui/utils/clsx";function Ce(t){let e=lt(7),{className:o,rootBreadcrumb:i,...n}=t,{renderLink:r}=mt(),{pageMap:s,pathname:c}=k(),l;e:{let d=s[c];if(!d||d.hideBreadcrumbs){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=[],e[0]=m):m=e[0],l=m;break e}let f;if(e[1]!==r||e[2]!==s||e[3]!==d.categories||e[4]!==d.pathSegments||e[5]!==i){let m="",h=d.pathSegments.reduce((p,b,N)=>{m=`${m}/${b}`;let _=s[m],M=d.categories[N]??_.title;return p.push({children:M,id:M,render:_?.pathname?A(r,{href:_.pathname}):A("button",{style:{pointerEvents:"none"}})}),p},[]);f=i?[{...i,id:"/"},...h]:h,e[1]=r,e[2]=s,e[3]=d.categories,e[4]=d.pathSegments,e[5]=i,e[6]=f}else f=e[6];l=f}let a=l;return a.length?A(at,{className:dt("qui-docs__breadcrumbs",o),...n,children:A(ie.Root,{emphasis:"neutral",children:A(ie.List,{children:a.map(ut)})})}):null}function ut(t){return A(ie.Item,{...t},t.id)}import{jsx as pt}from"react/jsx-runtime";import{PolymorphicElement as ft}from"@qualcomm-ui/react-core/system";import{clsx as ht}from"@qualcomm-ui/utils/clsx";function ye({children:t,className:e,...o}){return pt(ft,{as:"div",className:ht("qui-docs__content-wrapper",e),...o,children:t})}import{c as xt}from"react/compiler-runtime";import{jsx as Le}from"react/jsx-runtime";import{useRef as gt}from"react";import{useSafeLayoutEffect as _t}from"@qualcomm-ui/react-core/effects";import{useMergedRef as bt}from"@qualcomm-ui/react-core/refs";import{PolymorphicElement as Nt}from"@qualcomm-ui/react-core/system";import{PropsContextProvider as vt}from"@qualcomm-ui/react-mdx/typedoc";import{clsx as Ct}from"@qualcomm-ui/utils/clsx";function ke(t){let e=xt(5),{children:o,className:i,id:n,ref:r,...s}=t,c=n===void 0?"main-content":n,l=gt(null),{mainContentElement:a,pageProps:d,setMainContentElement:f}=k(),m;e[0]!==a||e[1]!==f?(m=()=>{a!==l.current&&f(l.current)},e[0]=a,e[1]=f,e[2]=m):m=e[2];let h;e[3]!==a?(h=[a],e[3]=a,e[4]=h):h=e[4],_t(m,h);let p=bt(r,l);return Le(Nt,{ref:p,as:"article",className:Ct("qui-docs__main-content",i),id:c,...s,children:Le(vt,{value:d,children:o})})}import{c as yt}from"react/compiler-runtime";import{Fragment as Lt,jsx as T,jsxs as kt}from"react/jsx-runtime";import"react";import{ChevronLeft as Pt,ChevronRight as Et}from"lucide-react";import{Link as Pe}from"@qualcomm-ui/react/link";import{bindingRenderProp as wt,PolymorphicElement as Mt}from"@qualcomm-ui/react-core/system";import{useMdxDocsContext as St}from"@qualcomm-ui/react-mdx/context";import{clsx as we}from"@qualcomm-ui/utils/clsx";import{TreeCollection as Rt}from"@qualcomm-ui/utils/collection";function Ee({pageLink:t,prev:e,renderLink:o}){return wt(T(o,{href:t.pathname}),{children:T(Lt,{children:T("span",{className:"qui-page-link__container",children:e?T(Pe,{render:T("div",{}),startIcon:Pt,children:t.title}):T(Pe,{endIcon:Et,render:T("div",{}),children:t.title})})}),className:we("qui-page-link__root",{"q-next":!e})})}function Me(t){let e=yt(5),{className:o,...i}=t,{renderLink:n}=St(),{navItems:r,pathname:s}=k(),c;e[0]!==r?(c=new Rt({nodeChildren:"items",nodeText:"title",nodeValue:"id",rootNode:{depth:0,id:"ROOT",items:r,pathSegments:[],title:""}}).flatten().filter(Tt),e[0]=r,e[1]=c):c=e[1];let l=c,a;e[2]!==l||e[3]!==s?(a=Dt(l,s),e[2]=l,e[3]=s,e[4]=a):a=e[4];let[d,f]=a;return kt(Mt,{as:"div",className:we("qui-page-links__container",o),...i,children:[T("div",{className:"qui-page-links__link-wrapper",children:d?T(Ee,{pageLink:d,prev:!0,renderLink:n}):null}),T("div",{className:"qui-page-links__link-wrapper",children:f?T(Ee,{pageLink:f,renderLink:n}):null})]})}function Tt(t){return t.pathname}function Dt(t,e){let o=t.findIndex(r=>r.id===e);if(o===-1)return[!1,!1];let i=t[o-1],n=t[o+1];return[i??!1,n??!1]}import{c as Mo}from"react/compiler-runtime";import{jsx as J}from"react/jsx-runtime";import{useState as ce}from"react";import{bindingRenderProp as So,PolymorphicElement as Ro}from"@qualcomm-ui/react-core/system";import{MdxDocsProvider as To,useSiteContext as Do}from"@qualcomm-ui/react-mdx/context";import{mergeProps as qo}from"@qualcomm-ui/utils/merge-props";import{c as Kt}from"react/compiler-runtime";import{jsx as u}from"react/jsx-runtime";import"react";import{MDXProvider as eo}from"@mdx-js/react";import{Link as Be}from"@qualcomm-ui/react/link";import{Table as B}from"@qualcomm-ui/react/table";import{useMdxDocsContext as to}from"@qualcomm-ui/react-mdx/context";import{SpoilerContent as oo,SpoilerRoot as ro,SpoilerSummary as no}from"@qualcomm-ui/react-mdx/spoiler";import{jsx as se,jsxs as qt}from"react/jsx-runtime";import{useState as It}from"react";import{Link2 as Bt}from"lucide-react";import{Icon as Vt}from"@qualcomm-ui/react/icon";import{PolymorphicElement as jt}from"@qualcomm-ui/react-core/system";function Q({children:t,className:e,id:o,ref:i,renderLink:n,...r}){let[s,c]=It(!1);return se(jt,{ref:i,as:"span",className:e,id:o,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),...r,children:qt(n,{className:"qui-docs-heading",href:`#${o}`,children:[se("span",{className:"qui-docs-heading-text",children:t}),s?se(Vt,{icon:Bt,size:"md"}):null]})})}import{jsx as X,jsxs as Se}from"react/jsx-runtime";import{Children as At,isValidElement as Ot}from"react";import{Tab as Re,Tabs as Z}from"@qualcomm-ui/react/tabs";import{mergeProps as Ht}from"@qualcomm-ui/utils/merge-props";function Te({children:t,...e}){let o=At.toArray(t).filter(r=>Ot(r)),i=Ht({className:"mdx"},e),n=o[0]?.props?.label;return Se(Z.Root,{defaultValue:n,...i,children:[Se(Z.List,{children:[X(Z.Indicator,{}),o.map(r=>{let s=r.props?.label;return X(Re.Root,{value:s,children:X(Re.Button,{children:r.props?.label})},s)})]}),o.map(r=>{let s=r.props?.label;return X(Z.Panel,{value:s,children:r.props?.children},s)})]})}import{jsx as De,jsxs as $t}from"react/jsx-runtime";import{useRef as Ft,useState as zt}from"react";import{CopyToClipboardIconButton as Wt}from"@qualcomm-ui/react-mdx/copy-to-clipboard";import{clsx as Yt}from"@qualcomm-ui/utils/clsx";function qe({children:t,className:e,...o}){let i=Ft(null),[n,r]=zt(!1);return $t("div",{className:"shiki-wrapper mdx",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[De("pre",{ref:i,className:Yt("mdx",e),...o,tabIndex:-1,children:t}),n?De(Wt,{className:"qui-code-copy-button",valueOrFn:()=>i.current.innerText}):null]})}import{c as Gt}from"react/compiler-runtime";import{jsx as Ut}from"react/jsx-runtime";import{useEffect as Qt,useRef as Xt}from"react";import{useMergedRef as Zt}from"@qualcomm-ui/react-core/refs";import{PolymorphicElement as Jt}from"@qualcomm-ui/react-core/system";function Ie(t){let e=Gt(5),{active:o,ref:i,...n}=t,r=Xt(null),s=Zt(i,r),c;e[0]!==o?(c=()=>{o&&r.current&&r.current?.scrollIntoView?.({block:"nearest"})},e[0]=o,e[1]=c):c=e[1];let l;return e[2]!==o||e[3]!==s?(l=[o,s],e[2]=o,e[3]=s,e[4]=l):l=e[4],Qt(c,l),Ut(Jt,{ref:s,as:"div",className:"qui-toc__link",...n})}function Ve(t){let e=Kt(18),{children:o,components:i}=t,{renderLink:n}=to(),r;e[0]!==n?(r=h=>{let{href:p,ref:b,...N}=h,_=p===void 0?"":p;return!_.startsWith("http")?u(Be,{emphasis:"primary",render:u(n,{href:_.startsWith("./#")?_.substring(2):_}),...N}):u(Be,{emphasis:"primary",href:_,...N,target:"_blank"})},e[0]=n,e[1]=r):r=e[1];let s;e[2]!==o?(s=h=>u("div",{...h,children:o}),e[2]=o,e[3]=s):s=e[3];let c,l,a;e[4]!==n?(c=h=>{let{children:p,id:b}=h;return u(Q,{className:"mdx",id:b||void 0,render:u("h2",{}),renderLink:n,children:p})},l=h=>{let{children:p,id:b}=h;return u(Q,{className:"mdx",id:b||void 0,render:u("h3",{}),renderLink:n,children:p})},a=h=>{let{children:p,id:b}=h;return u(Q,{className:"mdx",id:b||void 0,render:u("h4",{}),renderLink:n,children:p})},e[4]=n,e[5]=c,e[6]=l,e[7]=a):(c=e[5],l=e[6],a=e[7]);let d;e[8]!==i||e[9]!==r||e[10]!==s||e[11]!==c||e[12]!==l||e[13]!==a?(d={a:r,blockquote:wo,br:Eo,code:Po,CodeTab:s,CodeTabs:Te,em:ko,h1:Lo,h2:c,h3:l,h4:a,h5:yo,h6:Co,hr:vo,img:No,li:bo,ol:_o,p:go,pre:xo,SpoilerContent:oo,SpoilerRoot:ro,SpoilerSummary:no,strong:ho,sup:fo,table:po,tbody:uo,td:mo,tfoot:ao,th:lo,thead:co,tr:so,ul:io,...i},e[8]=i,e[9]=r,e[10]=s,e[11]=c,e[12]=l,e[13]=a,e[14]=d):d=e[14];let f=d,m;return e[15]!==o||e[16]!==f?(m=u(eo,{components:f,children:o}),e[15]=o,e[16]=f,e[17]=m):m=e[17],m}function io(t){return u("ul",{className:"mdx",...t})}function so(t){return u(B.Row,{className:"mdx",...t})}function co(t){return u(B.Header,{className:"mdx",...t})}function lo(t){return u(B.HeaderCell,{className:"mdx",...t})}function ao(t){return u(B.Footer,{className:"mdx",...t})}function mo(t){return u(B.Cell,{className:"mdx",...t})}function uo(t){return u(B.Body,{className:"mdx",...t})}function po(t){let{children:e,...o}=t;return u("div",{className:"mdx table-wrapper",children:u(B.Root,{className:"mdx",...o,children:u(B.Table,{className:"mdx",children:e})})})}function fo(t){return u("sup",{className:"mdx",...t})}function ho(t){return u("strong",{className:"mdx font-semibold",...t})}function xo(t){let{children:e,...o}=t;return u(qe,{...o,children:e})}function go(t){return u("p",{className:"mdx",...t})}function _o(t){return u("ol",{className:"mdx",...t})}function bo(t){return u("li",{className:"mdx",...t})}function No(t){return u("img",{className:"mdx",...t})}function vo(t){return u("hr",{className:"mdx",...t})}function Co(t){let{id:e,...o}=t;return u("h6",{className:"mdx",id:e||void 0,...o})}function yo(t){let{id:e,...o}=t;return u("h5",{className:"mdx",id:e||void 0,...o})}function Lo(t){let{children:e,id:o,...i}=t;return u("h1",{className:"mdx",id:o||void 0,...i,children:e})}function ko(t){return u("em",{className:"mdx",...t})}function Po(t){return u("code",{className:"mdx",...t})}function Eo(t){return u("br",{className:"mdx",...t})}function wo(t){return u("blockquote",{className:"mdx",...t})}function je(t){let e=Mo(30),{children:o,demoState:i,docProps:n,hideToc:r,mdxComponents:s,onDemoStateChange:c,onPackageManagerChange:l,packageManager:a,pathname:d,renderLink:f,ssrUserAgent:m,tocHighlightStrategy:h,...p}=t,b=a===void 0?"npm":a,N=h===void 0?"nearest":h,[_,M]=ce(null),[y,I]=ce(b),R;e[0]!==i?(R=i||{},e[0]=i,e[1]=R):R=e[1];let[P,H]=ce(R),{navItems:x,pageDocProps:C,pageMap:v}=Do(),g;e[2]!==l?(g=$=>{I($),l?.($)},e[2]=l,e[3]=g):g=e[3];let L;e[4]!==c?(L=($,pe,Je)=>{H(fe=>{let he=fe[$]??{},Ke=he[pe]??{},xe={...fe,[$]:{...he,[pe]:{...Ke,...Je}}};return c?.(xe),xe})},e[4]=c,e[5]=L):L=e[5];let D;e[6]!==P||e[7]!==n||e[8]!==y||e[9]!==f||e[10]!==m||e[11]!==g||e[12]!==L||e[13]!==N?(D={demoState:P,docProps:n,packageManager:y,renderLink:f,setPackageManager:g,ssrUserAgent:m,tocHighlightStrategy:N,updateDemoState:L},e[6]=P,e[7]=n,e[8]=y,e[9]=f,e[10]=m,e[11]=g,e[12]=L,e[13]=N,e[14]=D):D=e[14];let Xe=D,j=v[d],W;e[15]!==j?.toc?(W=j?.toc??[],e[15]=j?.toc,e[16]=W):W=e[16];let Y=W,te=!!Y.length&&!j?.hideToc&&!r,oe=j?.hidePageLinks||!1,re=j?.hideSideNav||!1,G;e[17]!==C||e[18]!==d?(G=C?.[d]||{},e[17]=C,e[18]=d,e[19]=G):G=e[19];let ne=G,U;e[20]!==oe||e[21]!==re||e[22]!==_||e[23]!==x||e[24]!==v||e[25]!==ne||e[26]!==d||e[27]!==te||e[28]!==Y?(U={hidePageLinks:oe,hideSideNav:re,mainContentElement:_,navItems:x,pageMap:v,pageProps:ne,pathname:d,setMainContentElement:M,showToc:te,toc:Y},e[20]=oe,e[21]=re,e[22]=_,e[23]=x,e[24]=v,e[25]=ne,e[26]=d,e[27]=te,e[28]=Y,e[29]=U):U=e[29];let ue=U,Ze=qo({className:"qui-docs__root"},p);return J(To,{value:Xe,children:J(Ve,{components:s,pathname:d,children:J(be,{value:ue,children:J(Ro,{as:"div",...Ze,children:So(o,ue,{forwardPropsToClone:!1})})})})})}import{Fragment as Ae,jsx as E,jsxs as F}from"react/jsx-runtime";import{useCallback as Io,useEffect as Oe,useMemo as Bo,useRef as He,useState as K}from"react";import{createTreeCollection as Vo}from"@qualcomm-ui/core/tree";import{SideNav as w}from"@qualcomm-ui/react/side-nav";import{useSafeLayoutEffect as jo}from"@qualcomm-ui/react-core/effects";import{useMdxDocsContext as Ao}from"@qualcomm-ui/react-mdx/context";import{booleanDataAttr as $e}from"@qualcomm-ui/utils/attributes";import{isDefined as Oo}from"@qualcomm-ui/utils/guard";import{matchSorter as Ho}from"@qualcomm-ui/utils/match-sorter";import{mergeProps as $o}from"@qualcomm-ui/utils/merge-props";function ee({children:t,filterable:e=!0,mobileDrawerState:o,stickyHeader:i,...n}){let r=He(null),{navItems:s,pathname:c}=k(),{renderLink:l}=Ao(),a=Bo(()=>Vo({nodeChildren:"items",nodeText:"title",nodeValue:"id",rootNode:{depth:0,id:"ROOT",items:s,pathSegments:[],title:""}}),[s]),[d,f]=K(""),[m,h]=K(a),[p,b]=K(Fe(s,c));function N(x){m.findNodeBy(v=>v.id===x[0])?.pathname&&y(x)}function _(){let x=m.findNodeBy(C=>C.pathname===c);return x?[x.id]:[]}let[M,y]=K(()=>_()),I=He(p);jo(()=>{y(_())},[c]);let R=x=>{if(f(x),!x){h(a),b(I.current);return}let C=Ho(a.getDescendantNodes(),x,{keys:["group","title","searchMeta.*",g=>a.getParentNodes(g.id).map(L=>L.group).filter(Boolean)]}),v=a.filter(g=>C.some(L=>L.id===g.id));h(v),b(v.getBranchValues())},P=Io(()=>{if(!r.current)return;let C=Array.from(r.current.querySelectorAll("a")).find(g=>g.getAttribute("href")===c);if(!C)return;let v=new IntersectionObserver(([g])=>{if(g.isIntersecting)v.disconnect();else{if(C.scrollIntoView({block:"nearest",inline:"nearest"}),C.getBoundingClientRect().top-100<0){let D=r.current.scrollTop;r.current.scrollTo(0,Math.max(D-60,0))}v.disconnect()}},{threshold:.1});return v.observe(C),()=>v.disconnect()},[c]);Oe(()=>{requestAnimationFrame(()=>{Oo(o)&&P()})},[o,P]),Oe(()=>{P()},[P]);let H=$o({className:"qui-docs-sidebar__root",ref:r},n);return E("div",{...H,children:F(w.Root,{collection:m,expandedValue:p,onExpandedValueChange:x=>b(x.expandedValue),onSelectedValueChange:x=>{N(x.selectedValue)},selectedValue:M,surface:"secondary",children:[t?E(w.Header,{"data-sticky":$e(i),children:t}):null,e?F(Ae,{children:[E(w.FilterInput,{onValueChange:R,placeholder:"Filter...",value:d}),E(w.Divider,{className:"qui-docs-sidebar__group-separator"})]}):null,m.rootNode.items.map((x,C)=>E(w.Nodes,{indexPath:[C],node:x,renderBranch:({node:v})=>F(w.BranchNode,{children:[E(w.NodeText,{children:v.title}),E(w.BranchTrigger,{})]}),renderLeaf:({indexPath:v,node:g})=>{let L={"--depth":v.length},D=$e(v.length>1);return g.sectionTitle?F(Ae,{children:[g.separator?E(w.Divider,{className:"qui-docs-sidebar__group-separator","data-nested":D,style:L}):null,E(w.GroupLabel,{className:"qui-docs-sidebar__group-label","data-nested":D,style:L,children:g.sectionTitle})]}):g.separator?E(w.Divider,{className:"qui-docs-sidebar__group-separator","data-nested":D,style:L}):F(w.LeafNode,{render:g.pathname?E(l,{href:g.pathname}):E("div",{}),children:[E(w.NodeIndicator,{}),E(w.NodeText,{children:g.title})]})},showIndentGuide:!0},m.getNodeValue(x)))]})})}function Fe(t,e){return t.reduce((o,i)=>{let n=i.id,r=Fe(i.items??[],e);return(e===n||r?.length||i.expanded&&i.items?.length)&&o.push(n),[...o,...r]},[])}import{c as le}from"react/compiler-runtime";import{jsx as z,jsxs as ze}from"react/jsx-runtime";import{useEffect as Ye,useRef as ae,useState as Fo}from"react";import{uniq as zo}from"lodash-es";import{useMdxDocsContext as Ge}from"@qualcomm-ui/react-mdx/context";import{booleanDataAttr as Wo}from"@qualcomm-ui/utils/attributes";var Yo=["h2","h3","h4"],Go=0,Uo=100,Qo=-48,Xo=.1,Zo=.2,Jo=12;function We(t,e){let o=le(3),i=ae(void 0),n;return o[0]!==t||o[1]!==e?(n=(...r)=>{let s=r;clearTimeout(i.current),i.current=setTimeout(()=>t(...s),e)},o[0]=t,o[1]=e,o[2]=n):n=o[2],n}function Ko(t){return typeof window>"u"?!1:t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function er(t,e){let o=le(5),i;o[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Map,o[0]=i):i=o[0];let n=ae(i),r,s;return o[1]!==t||o[2]!==e?(r=()=>{if(!t||!e.current)return;let c=n.current.get(t);if(!c)return;let l=new IntersectionObserver(a=>{let[d]=a;d.isIntersecting||c.scrollIntoView({behavior:"smooth",block:"nearest"}),l.disconnect()},{root:e.current,threshold:1});return l.observe(c),()=>l.disconnect()},s=[t,e],o[1]=t,o[2]=e,o[3]=r,o[4]=s):(r=o[3],s=o[4]),Ye(r,s),n}function tr(){let t=le(11),[e,o]=Fo(null),{tocHighlightStrategy:i}=Ge(),{mainContentElement:n,toc:r}=k(),s;t[0]!==r||t[1]!==n||t[2]!==i?(s=()=>{if(!r.length||!n)return;let m=[],h=document.querySelector(".qui-docs__app-content")?.querySelector("article");if(!h)return;h.querySelectorAll(zo(Yo).map(rr).join(",")).forEach(b=>{m.push(b)});let p=null;if((i||"nearest")==="nearest")if(window.scrollY===0)p=0;else if(window.scrollY+window.innerHeight>=document.body.scrollHeight)p=m.length-1;else{let N=1e5,_=-1,M=!1;for(let y=0;y<m.length;y++){let R=m[y].getBoundingClientRect(),P=R.top;P>Qo&&Ko(R)&&P<N&&(M=!0,N=P,_=y)}if(M)p=_>=0?_:null;else{let I=m.map((R,P)=>{let H=R.getBoundingClientRect().top+window.scrollY,x=m[P+1],C=x?x.getBoundingClientRect().top+window.scrollY-1:document.body.scrollHeight;return[H,C]}).findIndex(or);p=I>=0?I:null}}else if(window.scrollY===0)p=0;else{let b=window.innerHeight;for(let N=0;N<m.length;N++){let M=m[N].getBoundingClientRect().top,y=m[N+1];if((y?y.getBoundingClientRect().top:n.getBoundingClientRect().bottom)>b*Xo&&M<b*(1-Zo)){p=N;break}}}p!==null&&r[p]?o(r[p].id):o(null)},t[0]=r,t[1]=n,t[2]=i,t[3]=s):s=t[3];let c=s,l=We(c,Go),a=We(c,Uo),d,f;return t[4]!==c||t[5]!==l||t[6]!==a||t[7]!==r.length||t[8]!==n?(d=()=>{if(!r.length||!n)return;c(),window.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",a,{passive:!0});let m=new ResizeObserver(a);return m.observe(n),()=>{window.removeEventListener("scroll",l),window.removeEventListener("resize",a),m.disconnect()}},f=[c,l,a,r.length,n],t[4]=c,t[5]=l,t[6]=a,t[7]=r.length,t[8]=n,t[9]=d,t[10]=f):(d=t[9],f=t[10]),Ye(d,f),e}function or(t){let[e,o]=t;return window.scrollY>e&&window.scrollY<o}function rr(t){return`${t}:not(.qui-demo-runner__wrapper ${t})`}function Ue({activeTocClassName:t="q-active"}){let e=ae(null),{renderLink:o}=Ge(),{toc:i}=k(),n=tr(),r=er(n,e);return i.length?z("div",{className:"qui-toc",children:z("div",{ref:e,className:"qui-toc__container",children:ze("div",{className:"qui-toc__links",children:[z("div",{className:"qui-toc-bar"}),i.map(({headingLevel:s,id:c,textContent:l})=>{let a=n===c;return ze(Ie,{ref:d=>{d?r.current.set(c,d):r.current.delete(c)},className:`qui-toc__link${a?` ${t}`:""}`,style:{paddingLeft:Jo*(s-1)},children:[s>2?z("div",{"aria-hidden":!0,className:"qui-toc__link-indent-guide","data-active":Wo(a)}):null,z(o,{href:`#${c}`,children:l})]},c)})]})})}):null}var q={AppContent:ve,Breadcrumbs:Ce,ContentWrapper:ye,Footer:ge,MainContent:ke,PageLinks:Me,Root:je,Sidebar:ee,TableOfContents:Ue};import{c as nr}from"react/compiler-runtime";import{Fragment as ir,jsx as S,jsxs as me}from"react/jsx-runtime";import{Menu as sr,PanelLeftClose as cr}from"lucide-react";import{IconButton as Qe}from"@qualcomm-ui/react/button";import{Drawer as V}from"@qualcomm-ui/react/drawer";import{Icon as lr}from"@qualcomm-ui/react/icon";import{Portal as ar}from"@qualcomm-ui/react-core/portal";function $i(t){let e=nr(2),{children:o,...i}=t,{pathname:n}=k(),r;return e[0]!==o?(r=s=>{let{open:c,setOpen:l}=s;return S(ee,{"data-mobile":!0,filterable:!1,mobileDrawerState:c,stickyHeader:!0,children:me(ir,{children:[o,S(V.CloseTrigger,{children:S(Qe,{className:"qui-docs-sidebar__mobile-close-trigger",density:"compact",icon:cr,onClick:()=>l(!1),size:"lg",variant:"ghost"})})]})})},e[0]=o,e[1]=r):r=e[1],S("div",{className:"qui-docs-sidebar__mobile-container",children:me(V.Root,{placement:"start",...i,children:[S(V.Trigger,{children:S(Qe,{"aria-label":"Open Navigation Menu",icon:S(lr,{icon:sr,size:14}),size:"sm",variant:"ghost"})}),me(ar,{children:[S(V.Backdrop,{}),S(V.Positioner,{children:S(V.Content,{className:"qui-docs-sidebar__drawer-content",children:S(V.Body,{className:"qui-docs-sidebar__drawer-body",children:S(V.Context,{children:r})})})})]})]},n)})}function Zi({children:t,footer:e,header:o,rootBreadcrumb:i,sidebarProps:n,...r}){return O(q.Root,{...r,children:({hidePageLinks:s,hideSideNav:c,showToc:l})=>de(mr,{children:[o,O(q.ContentWrapper,{children:de(q.AppContent,{children:[!c&&O(q.Sidebar,{...n}),de(q.MainContent,{children:[O(q.Breadcrumbs,{rootBreadcrumb:i}),t,!s&&O(q.PageLinks,{})]}),l?O(q.TableOfContents,{}):null]})}),e]})})}export{ge as DocsFooter,Zi as DocsLayout,q as Layout,be as MdxDocsLayoutContextProvider,Ve as MdxProvider,$i as MobileSidebar,k as useMdxDocsLayoutContext};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|