@acmekit/docs-ui 2.13.41
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/Items-YPPZD6C6.mjs +312 -0
- package/dist/chunk-JD7BP7O5.mjs +13144 -0
- package/dist/index.d.mts +1550 -0
- package/dist/index.d.ts +1550 -0
- package/dist/index.js +15218 -0
- package/dist/index.mjs +366 -0
- package/package.json +58 -0
- package/src/components/Badge/index.tsx +74 -0
- package/src/components/BadgesList/index.tsx +18 -0
- package/src/components/BetaBadge/index.tsx +24 -0
- package/src/components/Bordered/index.tsx +21 -0
- package/src/components/BorderedIcon/index.tsx +60 -0
- package/src/components/Breadcrumbs/index.tsx +83 -0
- package/src/components/Button/index.tsx +100 -0
- package/src/components/Card/Layout/Default/index.tsx +124 -0
- package/src/components/Card/Layout/Filler/index.tsx +30 -0
- package/src/components/Card/Layout/Large/index.tsx +88 -0
- package/src/components/Card/Layout/Mini/index.tsx +142 -0
- package/src/components/Card/index.tsx +50 -0
- package/src/components/CardList/index.tsx +40 -0
- package/src/components/ChildDocs/index.tsx +9 -0
- package/src/components/CodeBlock/Actions/AskAi/index.tsx +10 -0
- package/src/components/CodeBlock/Actions/Copy/index.tsx +59 -0
- package/src/components/CodeBlock/Actions/index.tsx +137 -0
- package/src/components/CodeBlock/Collapsible/Button/index.tsx +58 -0
- package/src/components/CodeBlock/Collapsible/Fade/index.tsx +55 -0
- package/src/components/CodeBlock/Collapsible/Lines/index.tsx +22 -0
- package/src/components/CodeBlock/Header/Wrapper/index.tsx +46 -0
- package/src/components/CodeBlock/Header/index.tsx +67 -0
- package/src/components/CodeBlock/Inline/index.tsx +20 -0
- package/src/components/CodeBlock/Line/index.tsx +331 -0
- package/src/components/CodeBlock/index.tsx +510 -0
- package/src/components/CodeMdx/index.tsx +45 -0
- package/src/components/CodeTabs/Item/index.tsx +67 -0
- package/src/components/CodeTabs/index.tsx +319 -0
- package/src/components/ContentMenu/Actions/index.tsx +7 -0
- package/src/components/ContentMenu/Products/index.tsx +64 -0
- package/src/components/ContentMenu/Toc/index.tsx +148 -0
- package/src/components/ContentMenu/Version/index.tsx +77 -0
- package/src/components/ContentMenu/index.tsx +31 -0
- package/src/components/CopyButton/index.tsx +76 -0
- package/src/components/Details/Summary/index.tsx +75 -0
- package/src/components/Details/index.tsx +98 -0
- package/src/components/DetailsList/index.tsx +32 -0
- package/src/components/DottedSeparator/index.tsx +30 -0
- package/src/components/EditButton/index.tsx +32 -0
- package/src/components/EditDate/index.tsx +33 -0
- package/src/components/ErrorPage/Icon/index.tsx +428 -0
- package/src/components/ErrorPage/index.tsx +32 -0
- package/src/components/Feedback/Solutions/index.tsx +105 -0
- package/src/components/Feedback/index.tsx +304 -0
- package/src/components/Footer/index.tsx +23 -0
- package/src/components/Heading/H1/index.tsx +21 -0
- package/src/components/Heading/H2/index.tsx +47 -0
- package/src/components/Heading/H3/index.tsx +42 -0
- package/src/components/Heading/H4/index.tsx +14 -0
- package/src/components/Heading/index.tsx +4 -0
- package/src/components/IconHeadline/index.tsx +15 -0
- package/src/components/Icons/AiAssistant/index.tsx +462 -0
- package/src/components/Icons/ArrowRightDown/index.tsx +30 -0
- package/src/components/Icons/BundledProduct/index.tsx +72 -0
- package/src/components/Icons/CalendarRefresh/index.tsx +70 -0
- package/src/components/Icons/ChefHat/index.tsx +65 -0
- package/src/components/Icons/CircleDottedLine/index.tsx +60 -0
- package/src/components/Icons/CloudSolid/index.tsx +47 -0
- package/src/components/Icons/ColoredAcmeKit/index.tsx +13 -0
- package/src/components/Icons/DecisionProcess/index.tsx +58 -0
- package/src/components/Icons/Erp/index.tsx +92 -0
- package/src/components/Icons/Github/index.tsx +22 -0
- package/src/components/Icons/House/index.tsx +23 -0
- package/src/components/Icons/ImageBinary/index.tsx +69 -0
- package/src/components/Icons/Kapa/index.tsx +22 -0
- package/src/components/Icons/Markdown/index.tsx +25 -0
- package/src/components/Icons/NavigationDropdown/Admin/index.tsx +33 -0
- package/src/components/Icons/NavigationDropdown/Doc/index.tsx +41 -0
- package/src/components/Icons/NavigationDropdown/DocV1/index.tsx +37 -0
- package/src/components/Icons/NavigationDropdown/Modules/index.tsx +33 -0
- package/src/components/Icons/NavigationDropdown/Resources/index.tsx +37 -0
- package/src/components/Icons/NavigationDropdown/Store/index.tsx +37 -0
- package/src/components/Icons/NavigationDropdown/Ui/index.tsx +37 -0
- package/src/components/Icons/NavigationDropdown/User/index.tsx +37 -0
- package/src/components/Icons/PuzzleColored/index.tsx +35 -0
- package/src/components/Icons/QuestionMark/index.tsx +23 -0
- package/src/components/Icons/Restock/index.tsx +55 -0
- package/src/components/Icons/ScrollText/index.tsx +68 -0
- package/src/components/Icons/ShadedBg/index.tsx +334 -0
- package/src/components/Icons/Shop/index.tsx +68 -0
- package/src/components/Icons/SidebarLeft/index.tsx +42 -0
- package/src/components/Icons/StripeColored/index.tsx +60 -0
- package/src/components/Icons/ThumbDown/index.tsx +23 -0
- package/src/components/Icons/ThumbUp/index.tsx +23 -0
- package/src/components/Icons/WindowPaintbrush/index.tsx +57 -0
- package/src/components/Icons/index.tsx +20 -0
- package/src/components/InlineCode/index.tsx +42 -0
- package/src/components/InlineIcon/index.tsx +21 -0
- package/src/components/InlineThemeImage/index.tsx +14 -0
- package/src/components/Input/Search/index.tsx +64 -0
- package/src/components/Input/Text/index.tsx +39 -0
- package/src/components/Kbd/index.tsx +33 -0
- package/src/components/Label/index.tsx +19 -0
- package/src/components/Link/index.tsx +67 -0
- package/src/components/LinkButton/index.tsx +43 -0
- package/src/components/Loading/Dots/index.tsx +16 -0
- package/src/components/Loading/Spinner/index.tsx +19 -0
- package/src/components/Loading/index.tsx +43 -0
- package/src/components/MDXComponents/index.tsx +209 -0
- package/src/components/MainNav/DesktopMenu/ThemeMenu/index.tsx +76 -0
- package/src/components/MainNav/DesktopMenu/index.tsx +100 -0
- package/src/components/MainNav/Items/Dropdown/index.tsx +88 -0
- package/src/components/MainNav/Items/Link/index.tsx +34 -0
- package/src/components/MainNav/Items/index.tsx +61 -0
- package/src/components/MainNav/MobileMenu/Main/index.tsx +67 -0
- package/src/components/MainNav/MobileMenu/SubMenu/index.tsx +77 -0
- package/src/components/MainNav/MobileMenu/index.tsx +103 -0
- package/src/components/MainNav/Version/index.tsx +33 -0
- package/src/components/MainNav/index.tsx +153 -0
- package/src/components/MarkdownContent/index.tsx +41 -0
- package/src/components/Menu/Action/index.tsx +43 -0
- package/src/components/Menu/Divider/index.tsx +35 -0
- package/src/components/Menu/Dropdown/index.tsx +78 -0
- package/src/components/Menu/Item/index.tsx +36 -0
- package/src/components/Menu/SubMenu/index.tsx +47 -0
- package/src/components/Menu/index.tsx +44 -0
- package/src/components/Modal/Footer/index.tsx +29 -0
- package/src/components/Modal/Header/index.tsx +33 -0
- package/src/components/Modal/index.tsx +124 -0
- package/src/components/Note/Layout/index.tsx +139 -0
- package/src/components/Note/Types/checks.tsx +7 -0
- package/src/components/Note/Types/default.tsx +7 -0
- package/src/components/Note/Types/error.tsx +7 -0
- package/src/components/Note/Types/soon.tsx +7 -0
- package/src/components/Note/Types/sucess.tsx +7 -0
- package/src/components/Note/Types/warning.tsx +7 -0
- package/src/components/Note/index.tsx +32 -0
- package/src/components/Notices/DeprecatedNotice/index.tsx +33 -0
- package/src/components/Notices/ExpandableNotice/index.tsx +36 -0
- package/src/components/Notices/FeatureFlagNotice/index.tsx +36 -0
- package/src/components/Notices/VersionNotice/index.tsx +37 -0
- package/src/components/Notification/Item/Layout/Default/index.tsx +89 -0
- package/src/components/Notification/Item/index.tsx +88 -0
- package/src/components/Notification/index.tsx +65 -0
- package/src/components/Pagination/Card/index.tsx +80 -0
- package/src/components/Pagination/index.tsx +35 -0
- package/src/components/Prerequisites/Item/index.tsx +43 -0
- package/src/components/Prerequisites/index.tsx +94 -0
- package/src/components/RadioItem/index.tsx +38 -0
- package/src/components/Rating/index.tsx +133 -0
- package/src/components/RootProviders/index.tsx +31 -0
- package/src/components/Select/Badge/index.tsx +122 -0
- package/src/components/Select/Dropdown/index.tsx +188 -0
- package/src/components/Select/Input/index.tsx +123 -0
- package/src/components/Select/index.ts +13 -0
- package/src/components/Sidebar/Child/index.tsx +43 -0
- package/src/components/Sidebar/Item/Category/index.tsx +151 -0
- package/src/components/Sidebar/Item/Link/index.tsx +174 -0
- package/src/components/Sidebar/Item/Sidebar/index.tsx +67 -0
- package/src/components/Sidebar/Item/SubCategory/index.tsx +83 -0
- package/src/components/Sidebar/Item/index.tsx +41 -0
- package/src/components/Sidebar/Top/MobileClose/index.tsx +21 -0
- package/src/components/Sidebar/Top/index.tsx +33 -0
- package/src/components/Sidebar/index.tsx +153 -0
- package/src/components/SourceCodeLink/index.tsx +37 -0
- package/src/components/SplitLists/index.tsx +58 -0
- package/src/components/Table/index.tsx +87 -0
- package/src/components/Tabs/index.tsx +106 -0
- package/src/components/TextArea/index.tsx +30 -0
- package/src/components/ThemeImage/index.tsx +26 -0
- package/src/components/Toggle/index.tsx +28 -0
- package/src/components/Tooltip/index.tsx +65 -0
- package/src/components/TypeList/Items/index.tsx +337 -0
- package/src/components/TypeList/index.tsx +63 -0
- package/src/components/WideSection/index.tsx +25 -0
- package/src/components/ZoomImg/index.tsx +17 -0
- package/src/components/index.ts +75 -0
- package/src/constants.tsx +261 -0
- package/src/global-config.ts +11 -0
- package/src/hooks/index.ts +14 -0
- package/src/hooks/use-active-on-scroll/index.tsx +223 -0
- package/src/hooks/use-click-outside/index.tsx +37 -0
- package/src/hooks/use-collapsible/index.tsx +128 -0
- package/src/hooks/use-collapsible-code-lines/index.tsx +149 -0
- package/src/hooks/use-copy/index.tsx +28 -0
- package/src/hooks/use-heading-url/index.tsx +32 -0
- package/src/hooks/use-is-external-link/index.tsx +19 -0
- package/src/hooks/use-keyboard-shortcut/index.tsx +71 -0
- package/src/hooks/use-mutation-observer/index.ts +32 -0
- package/src/hooks/use-page-scroll-manager/index.tsx +82 -0
- package/src/hooks/use-resize-observer/index.ts +20 -0
- package/src/hooks/use-scroll-utils/index.tsx +372 -0
- package/src/hooks/use-select/index.tsx +99 -0
- package/src/hooks/use-tabs/index.tsx +94 -0
- package/src/index.ts +8 -0
- package/src/layouts/barebone.tsx +18 -0
- package/src/layouts/index.ts +4 -0
- package/src/layouts/main-content.tsx +86 -0
- package/src/layouts/root.tsx +43 -0
- package/src/layouts/tight.tsx +29 -0
- package/src/layouts/wide.tsx +25 -0
- package/src/providers/AiAssistant/index.tsx +65 -0
- package/src/providers/BrowserProvider/index.tsx +40 -0
- package/src/providers/ColorMode/index.tsx +73 -0
- package/src/providers/Layout/index.tsx +52 -0
- package/src/providers/MainNav/index.tsx +134 -0
- package/src/providers/Mobile/index.tsx +62 -0
- package/src/providers/Modal/index.tsx +52 -0
- package/src/providers/Notification/index.tsx +149 -0
- package/src/providers/Pagination/index.tsx +230 -0
- package/src/providers/Search/index.tsx +91 -0
- package/src/providers/Sidebar/index.tsx +745 -0
- package/src/providers/SiteConfig/index.tsx +70 -0
- package/src/providers/index.ts +13 -0
- package/src/types/config.ts +34 -0
- package/src/types/frontmatter.ts +23 -0
- package/src/types/general.ts +1 -0
- package/src/types/index.ts +9 -0
- package/src/types/menu.ts +40 -0
- package/src/types/navigation-dropdown.ts +16 -0
- package/src/types/navigation.ts +21 -0
- package/src/types/sidebar.ts +109 -0
- package/src/types/toc.ts +19 -0
- package/src/types/ui.ts +9 -0
- package/src/utils/array-same-elms.ts +10 -0
- package/src/utils/capitalize.ts +3 -0
- package/src/utils/check-sidebar-item-visibility.ts +47 -0
- package/src/utils/decode-str.ts +8 -0
- package/src/utils/dom-utils.ts +29 -0
- package/src/utils/event-parser.ts +54 -0
- package/src/utils/get-link-with-base-path.ts +3 -0
- package/src/utils/get-navbar-items.ts +55 -0
- package/src/utils/get-scrolled-top.ts +8 -0
- package/src/utils/index.ts +13 -0
- package/src/utils/is-elm-window.ts +3 -0
- package/src/utils/is-in-view.ts +10 -0
- package/src/utils/os-browser-utils.ts +39 -0
- package/src/utils/set-obj-value.ts +38 -0
- package/src/utils/sidebar-utils.ts +129 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import clsx from "clsx"
|
|
2
|
+
import React, { Suspense, lazy } from "react"
|
|
3
|
+
import { Loading } from "../../components/Loading"
|
|
4
|
+
|
|
5
|
+
export type CommonProps = {
|
|
6
|
+
expandUrl?: string
|
|
7
|
+
sectionTitle?: string
|
|
8
|
+
openedLevel?: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type Type = {
|
|
12
|
+
name: string
|
|
13
|
+
type: string
|
|
14
|
+
optional?: boolean
|
|
15
|
+
defaultValue?: string
|
|
16
|
+
example?: string
|
|
17
|
+
description?: string
|
|
18
|
+
featureFlag?: string
|
|
19
|
+
expandable: boolean
|
|
20
|
+
children?: Type[]
|
|
21
|
+
deprecated?: {
|
|
22
|
+
is_deprecated: boolean
|
|
23
|
+
description?: string
|
|
24
|
+
}
|
|
25
|
+
since?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
type ParameterTypesType = {
|
|
29
|
+
types: Type[]
|
|
30
|
+
sectionTitle?: string
|
|
31
|
+
} & CommonProps &
|
|
32
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
33
|
+
|
|
34
|
+
const TypeListItems = lazy(async () => import("./Items"))
|
|
35
|
+
|
|
36
|
+
export const TypeList = ({
|
|
37
|
+
types,
|
|
38
|
+
className,
|
|
39
|
+
sectionTitle,
|
|
40
|
+
expandUrl,
|
|
41
|
+
openedLevel,
|
|
42
|
+
...props
|
|
43
|
+
}: ParameterTypesType) => {
|
|
44
|
+
return (
|
|
45
|
+
<div
|
|
46
|
+
className={clsx(
|
|
47
|
+
"bg-acmekit-bg-subtle rounded my-docs_1",
|
|
48
|
+
"shadow-elevation-card-rest dark:shadow-elevation-card-rest-dark",
|
|
49
|
+
className
|
|
50
|
+
)}
|
|
51
|
+
{...props}
|
|
52
|
+
>
|
|
53
|
+
<Suspense fallback={<Loading />}>
|
|
54
|
+
<TypeListItems
|
|
55
|
+
types={types}
|
|
56
|
+
expandUrl={expandUrl}
|
|
57
|
+
sectionTitle={sectionTitle}
|
|
58
|
+
openedLevel={openedLevel}
|
|
59
|
+
/>
|
|
60
|
+
</Suspense>
|
|
61
|
+
</div>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import clsx from "clsx"
|
|
3
|
+
|
|
4
|
+
type WideSectionProps = React.AllHTMLAttributes<HTMLElement> & {
|
|
5
|
+
as?: "div" | "main"
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const WideSection = ({
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
as = "div",
|
|
12
|
+
}: WideSectionProps) => {
|
|
13
|
+
const Component = as
|
|
14
|
+
return (
|
|
15
|
+
<Component
|
|
16
|
+
className={clsx(
|
|
17
|
+
"max-w-inner-content-xs sm:max-w-inner-content-sm md:max-w-inner-content-md",
|
|
18
|
+
"lg:max-w-lg-wide-content xl:max-w-xl-wide-content px-1 lg:px-0 mx-auto",
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
>
|
|
22
|
+
{children}
|
|
23
|
+
</Component>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
import React from "react"
|
|
3
|
+
import Zoom from "react-medium-image-zoom"
|
|
4
|
+
import "react-medium-image-zoom/dist/styles.css"
|
|
5
|
+
|
|
6
|
+
type ZoomImgProps = React.DetailedHTMLProps<
|
|
7
|
+
React.ImgHTMLAttributes<HTMLImageElement>,
|
|
8
|
+
HTMLImageElement
|
|
9
|
+
>
|
|
10
|
+
|
|
11
|
+
export const ZoomImg = (props: ZoomImgProps) => {
|
|
12
|
+
return (
|
|
13
|
+
<Zoom wrapElement="span">
|
|
14
|
+
<img {...props} />
|
|
15
|
+
</Zoom>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export * from "./Badge"
|
|
2
|
+
export * from "./BadgesList"
|
|
3
|
+
export * from "./BetaBadge"
|
|
4
|
+
export * from "./Bordered"
|
|
5
|
+
export * from "./BorderedIcon"
|
|
6
|
+
export * from "./Breadcrumbs"
|
|
7
|
+
export * from "./Button"
|
|
8
|
+
export * from "./Card"
|
|
9
|
+
export * from "./CardList"
|
|
10
|
+
export * from "./ChildDocs"
|
|
11
|
+
export * from "./CodeBlock"
|
|
12
|
+
export * from "./CodeMdx"
|
|
13
|
+
export * from "./CodeTabs"
|
|
14
|
+
export * from "./CodeTabs/Item"
|
|
15
|
+
export * from "./ContentMenu"
|
|
16
|
+
export * from "./CopyButton"
|
|
17
|
+
export * from "./Details"
|
|
18
|
+
export * from "./Details/Summary"
|
|
19
|
+
export * from "./DetailsList"
|
|
20
|
+
export * from "./DottedSeparator"
|
|
21
|
+
export * from "./EditButton"
|
|
22
|
+
export * from "./EditDate"
|
|
23
|
+
export * from "./ErrorPage"
|
|
24
|
+
export * from "./Notices/ExpandableNotice"
|
|
25
|
+
export * from "./Notices/FeatureFlagNotice"
|
|
26
|
+
export * from "./Notices/DeprecatedNotice"
|
|
27
|
+
export * from "./Notices/VersionNotice"
|
|
28
|
+
export * from "./Feedback"
|
|
29
|
+
export * from "./Feedback/Solutions"
|
|
30
|
+
export * from "./Footer"
|
|
31
|
+
export * from "./Heading"
|
|
32
|
+
export * from "./IconHeadline"
|
|
33
|
+
export * from "./Icons"
|
|
34
|
+
export * from "./InlineIcon"
|
|
35
|
+
export * from "./InlineThemeImage"
|
|
36
|
+
export * from "./InlineCode"
|
|
37
|
+
export * from "./Input/Text"
|
|
38
|
+
export * from "./Input/Search"
|
|
39
|
+
export * from "./Kbd"
|
|
40
|
+
export * from "./Label"
|
|
41
|
+
export * from "./Link"
|
|
42
|
+
export * from "./LinkButton"
|
|
43
|
+
export * from "./Loading"
|
|
44
|
+
export * from "./Loading/Dots"
|
|
45
|
+
export * from "./Loading/Spinner"
|
|
46
|
+
export * from "./MainNav"
|
|
47
|
+
export * from "./MarkdownContent"
|
|
48
|
+
export * from "./MDXComponents"
|
|
49
|
+
export * from "./Menu"
|
|
50
|
+
export * from "./Modal"
|
|
51
|
+
export * from "./Modal/Header"
|
|
52
|
+
export * from "./Modal/Footer"
|
|
53
|
+
export * from "./Note"
|
|
54
|
+
export * from "./Notification"
|
|
55
|
+
export * from "./Notification/Item"
|
|
56
|
+
export * from "./Notification/Item/Layout/Default"
|
|
57
|
+
export * from "./Pagination"
|
|
58
|
+
export * from "./Prerequisites"
|
|
59
|
+
export * from "./RadioItem"
|
|
60
|
+
export * from "./Rating"
|
|
61
|
+
export * from "./RootProviders"
|
|
62
|
+
export * from "./Select"
|
|
63
|
+
export * from "./Sidebar"
|
|
64
|
+
export * from "./Sidebar/Item"
|
|
65
|
+
export * from "./SourceCodeLink"
|
|
66
|
+
export * from "./SplitLists"
|
|
67
|
+
export * from "./Table"
|
|
68
|
+
export * from "./Tabs"
|
|
69
|
+
export * from "./TextArea"
|
|
70
|
+
export * from "./ThemeImage"
|
|
71
|
+
export * from "./Toggle"
|
|
72
|
+
export * from "./Tooltip"
|
|
73
|
+
export * from "./TypeList"
|
|
74
|
+
export * from "./WideSection"
|
|
75
|
+
export * from "./ZoomImg"
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { NavigationItem, Product } from "./types"
|
|
2
|
+
|
|
3
|
+
export const GITHUB_ISSUES_LINK =
|
|
4
|
+
"https://github.com/acmekit/acmekit/issues/new/choose"
|
|
5
|
+
|
|
6
|
+
export const navDropdownItems: NavigationItem[] = [
|
|
7
|
+
{
|
|
8
|
+
type: "link",
|
|
9
|
+
link: `/learn`,
|
|
10
|
+
title: "Get Started",
|
|
11
|
+
project: "book",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
type: "dropdown",
|
|
15
|
+
title: "Product",
|
|
16
|
+
children: [
|
|
17
|
+
{
|
|
18
|
+
type: "sub-menu",
|
|
19
|
+
title: "Framework",
|
|
20
|
+
link: "/learn/fundamentals/framework",
|
|
21
|
+
items: [
|
|
22
|
+
{
|
|
23
|
+
type: "link",
|
|
24
|
+
title: "API Routes",
|
|
25
|
+
link: "/learn/fundamentals/api-routes",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: "link",
|
|
29
|
+
title: "Data Models",
|
|
30
|
+
link: "/learn/fundamentals/data-models",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: "link",
|
|
34
|
+
title: "Events and Subscribers",
|
|
35
|
+
link: "/learn/fundamentals/events-and-subscribers",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: "link",
|
|
39
|
+
title: "Index Module",
|
|
40
|
+
link: "/learn/fundamentals/module-links/index-module",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: "link",
|
|
44
|
+
title: "AcmeKit Container",
|
|
45
|
+
link: "/learn/fundamentals/acmekit-container",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
type: "link",
|
|
49
|
+
title: "Modules",
|
|
50
|
+
link: "/learn/fundamentals/modules",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: "link",
|
|
54
|
+
title: "Module Links",
|
|
55
|
+
link: "/learn/fundamentals/module-links",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: "link",
|
|
59
|
+
title: "Plugins",
|
|
60
|
+
link: "/learn/fundamentals/plugins",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: "link",
|
|
64
|
+
title: "Query",
|
|
65
|
+
link: "/learn/fundamentals/module-links/query",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: "link",
|
|
69
|
+
title: "Scheduled Jobs",
|
|
70
|
+
link: "/learn/fundamentals/scheduled-jobs",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: "link",
|
|
74
|
+
title: "Workflows",
|
|
75
|
+
link: "/learn/fundamentals/workflows",
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: "link",
|
|
81
|
+
title: "Admin Extensions",
|
|
82
|
+
link: "/learn/fundamentals/admin",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
type: "sub-menu",
|
|
86
|
+
title: "Infrastructure Modules",
|
|
87
|
+
link: "/resources/infrastructure-modules",
|
|
88
|
+
items: [
|
|
89
|
+
{
|
|
90
|
+
type: "link",
|
|
91
|
+
title: "Analytics",
|
|
92
|
+
link: "/resources/infrastructure-modules/analytics",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: "link",
|
|
96
|
+
title: "Caching",
|
|
97
|
+
link: "/resources/infrastructure-modules/caching",
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: "link",
|
|
101
|
+
title: "Event",
|
|
102
|
+
link: "/resources/infrastructure-modules/event",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: "link",
|
|
106
|
+
title: "File",
|
|
107
|
+
link: "/resources/infrastructure-modules/file",
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
type: "link",
|
|
111
|
+
title: "Locking",
|
|
112
|
+
link: "/resources/infrastructure-modules/locking",
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
type: "link",
|
|
116
|
+
title: "Notification",
|
|
117
|
+
link: "/resources/infrastructure-modules/notification",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: "link",
|
|
121
|
+
title: "Workflow Engine",
|
|
122
|
+
link: "/resources/infrastructure-modules/workflow-engine",
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
type: "dropdown",
|
|
130
|
+
title: "Build",
|
|
131
|
+
project: "resources",
|
|
132
|
+
children: [
|
|
133
|
+
{
|
|
134
|
+
type: "link",
|
|
135
|
+
title: "How-to & Tutorials",
|
|
136
|
+
link: "/resources/how-to-tutorials",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: "link",
|
|
140
|
+
title: "Integrations",
|
|
141
|
+
link: "/resources/integrations",
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
type: "dropdown",
|
|
147
|
+
title: "Tools",
|
|
148
|
+
link: "/resources/tools",
|
|
149
|
+
project: "resources",
|
|
150
|
+
children: [
|
|
151
|
+
{
|
|
152
|
+
type: "sub-menu",
|
|
153
|
+
title: "CLI Tools",
|
|
154
|
+
items: [
|
|
155
|
+
{
|
|
156
|
+
type: "link",
|
|
157
|
+
title: "create-acmekit-app",
|
|
158
|
+
link: "/resources/create-acmekit-app",
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
type: "link",
|
|
162
|
+
title: "AcmeKit CLI",
|
|
163
|
+
link: "/resources/acmekit-cli",
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
type: "link",
|
|
169
|
+
title: "JS SDK",
|
|
170
|
+
link: "/resources/js-sdk",
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
type: "link",
|
|
174
|
+
title: "AcmeKit UI",
|
|
175
|
+
link: "/ui",
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
type: "dropdown",
|
|
181
|
+
title: "Reference",
|
|
182
|
+
project: "resources",
|
|
183
|
+
link: "/resources/references-overview",
|
|
184
|
+
children: [
|
|
185
|
+
{
|
|
186
|
+
type: "link",
|
|
187
|
+
title: "Admin API",
|
|
188
|
+
link: "/api/admin",
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
type: "divider",
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
type: "link",
|
|
195
|
+
title: "Admin Injection Zones",
|
|
196
|
+
link: "/resources/admin-widget-injection-zones",
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
type: "link",
|
|
200
|
+
title: "Container Resources",
|
|
201
|
+
link: "/resources/acmekit-container-resources",
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
type: "link",
|
|
205
|
+
title: "Core Workflows",
|
|
206
|
+
link: "/resources/acmekit-workflows-reference",
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
type: "link",
|
|
210
|
+
title: "Data Model Language",
|
|
211
|
+
link: "/resources/references/data-model",
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
type: "link",
|
|
215
|
+
title: "Data Model Repository",
|
|
216
|
+
link: "/resources/data-model-repository-reference",
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
type: "link",
|
|
220
|
+
title: "Events Reference",
|
|
221
|
+
link: "/resources/references/events",
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
type: "link",
|
|
225
|
+
title: "Helper Steps",
|
|
226
|
+
link: "/resources/references/helper-steps",
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
type: "link",
|
|
230
|
+
title: "Service Factory",
|
|
231
|
+
link: "/resources/service-factory-reference",
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
type: "link",
|
|
235
|
+
title: "Testing Framework",
|
|
236
|
+
link: "/resources/test-tools-reference",
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
type: "link",
|
|
240
|
+
title: "Workflows SDK",
|
|
241
|
+
link: "/resources/references/workflows",
|
|
242
|
+
},
|
|
243
|
+
],
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
type: "link",
|
|
247
|
+
title: "User Guide",
|
|
248
|
+
link: "/user-guide",
|
|
249
|
+
},
|
|
250
|
+
]
|
|
251
|
+
|
|
252
|
+
export const products: Product[] = []
|
|
253
|
+
|
|
254
|
+
export enum DocsTrackingEvents {
|
|
255
|
+
SURVEY = "survey",
|
|
256
|
+
SURVEY_API = "survey_api-ref",
|
|
257
|
+
CODE_BLOCK_COPY = "code_block_copy",
|
|
258
|
+
AI_ASSISTANT_START_CHAT = "ai_assistant_start_chat",
|
|
259
|
+
AI_ASSISTANT_CALLOUT_CLICK = "ai_assistant_callout_click",
|
|
260
|
+
SEARCH_CALLOUT_CLICK = "search_callout_click",
|
|
261
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* eslint-disable comma-dangle */
|
|
2
|
+
/* eslint-disable prettier/prettier */
|
|
3
|
+
import { DocsConfig } from "./types"
|
|
4
|
+
|
|
5
|
+
export const globalConfig: Pick<DocsConfig, "version"> = {
|
|
6
|
+
"version": {
|
|
7
|
+
"number": "2.13.1",
|
|
8
|
+
"releaseUrl": "https://github.com/acmekit/acmekit/releases/tag/v2.13.1",
|
|
9
|
+
"releaseDate": "2026-01-25T16:20:07Z"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./use-active-on-scroll"
|
|
2
|
+
export * from "./use-resize-observer"
|
|
3
|
+
export * from "./use-click-outside"
|
|
4
|
+
export * from "./use-collapsible"
|
|
5
|
+
export * from "./use-collapsible-code-lines"
|
|
6
|
+
export * from "./use-copy"
|
|
7
|
+
export * from "./use-heading-url"
|
|
8
|
+
export * from "./use-is-external-link"
|
|
9
|
+
export * from "./use-mutation-observer"
|
|
10
|
+
export * from "./use-keyboard-shortcut"
|
|
11
|
+
export * from "./use-page-scroll-manager"
|
|
12
|
+
export * from "./use-scroll-utils"
|
|
13
|
+
export * from "./use-select"
|
|
14
|
+
export * from "./use-tabs"
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from "react"
|
|
3
|
+
import { isElmWindow, useIsBrowser, useScrollController } from "../.."
|
|
4
|
+
import { useLocation } from "react-router-dom"
|
|
5
|
+
import { useMutationObserver } from "../use-mutation-observer"
|
|
6
|
+
|
|
7
|
+
export type ActiveOnScrollItem = {
|
|
8
|
+
heading: HTMLHeadingElement
|
|
9
|
+
children?: ActiveOnScrollItem[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type UseActiveOnScrollProps = {
|
|
13
|
+
rootElm?: Document | HTMLElement
|
|
14
|
+
enable?: boolean
|
|
15
|
+
useDefaultIfNoActive?: boolean
|
|
16
|
+
maxLevel?: number
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const useActiveOnScroll = ({
|
|
20
|
+
rootElm,
|
|
21
|
+
enable = true,
|
|
22
|
+
useDefaultIfNoActive = true,
|
|
23
|
+
maxLevel = 3,
|
|
24
|
+
}: UseActiveOnScrollProps) => {
|
|
25
|
+
const [items, setItems] = useState<ActiveOnScrollItem[]>([])
|
|
26
|
+
const [activeItemId, setActiveItemId] = useState("")
|
|
27
|
+
const { scrollableElement } = useScrollController()
|
|
28
|
+
const { isBrowser } = useIsBrowser()
|
|
29
|
+
const { pathname } = useLocation()
|
|
30
|
+
const root = useMemo(() => {
|
|
31
|
+
if (!enable) {
|
|
32
|
+
return
|
|
33
|
+
}
|
|
34
|
+
if (rootElm) {
|
|
35
|
+
return rootElm
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!isBrowser) {
|
|
39
|
+
return
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return document
|
|
43
|
+
}, [rootElm, isBrowser, enable])
|
|
44
|
+
const querySelector = useMemo(() => {
|
|
45
|
+
let selector = ""
|
|
46
|
+
for (let i = 2; i <= maxLevel; i++) {
|
|
47
|
+
if (i > 2) {
|
|
48
|
+
selector += `,`
|
|
49
|
+
}
|
|
50
|
+
selector += `h${i}`
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return selector
|
|
54
|
+
}, [maxLevel])
|
|
55
|
+
const getHeadingsInElm = useCallback(() => {
|
|
56
|
+
if (!isBrowser || !enable) {
|
|
57
|
+
return []
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const filteredHeadings: Element[] = []
|
|
61
|
+
root?.querySelectorAll(querySelector).forEach((heading) => {
|
|
62
|
+
if (heading.id) {
|
|
63
|
+
filteredHeadings.push(heading)
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
return filteredHeadings
|
|
68
|
+
}, [isBrowser, pathname, root, enable])
|
|
69
|
+
const setHeadingItems = useCallback(() => {
|
|
70
|
+
if (!enable) {
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
const headings = getHeadingsInElm()
|
|
74
|
+
const itemsToSet: ActiveOnScrollItem[] = []
|
|
75
|
+
let lastLevel2HeadingIndex = -1
|
|
76
|
+
|
|
77
|
+
headings?.forEach((heading) => {
|
|
78
|
+
const level = parseInt(heading.tagName.replace("H", ""))
|
|
79
|
+
const isLevel2 = level === 2
|
|
80
|
+
const headingItem: ActiveOnScrollItem = {
|
|
81
|
+
heading: heading as HTMLHeadingElement,
|
|
82
|
+
children: [],
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (isLevel2 || lastLevel2HeadingIndex === -1) {
|
|
86
|
+
itemsToSet.push(headingItem)
|
|
87
|
+
if (isLevel2) {
|
|
88
|
+
lastLevel2HeadingIndex = itemsToSet.length - 1
|
|
89
|
+
}
|
|
90
|
+
} else if (lastLevel2HeadingIndex !== -1) {
|
|
91
|
+
itemsToSet[lastLevel2HeadingIndex].children?.push(headingItem)
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
setItems(itemsToSet)
|
|
96
|
+
}, [getHeadingsInElm, enable])
|
|
97
|
+
|
|
98
|
+
useMutationObserver({
|
|
99
|
+
elm: root,
|
|
100
|
+
callback: setHeadingItems,
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
const setActiveToClosest = useCallback(() => {
|
|
104
|
+
if (!enable) {
|
|
105
|
+
return
|
|
106
|
+
}
|
|
107
|
+
const rootBoundingRectElm =
|
|
108
|
+
root && "getBoundingClientRect" in root
|
|
109
|
+
? root.getBoundingClientRect()
|
|
110
|
+
: root?.body.getBoundingClientRect()
|
|
111
|
+
|
|
112
|
+
if (
|
|
113
|
+
rootBoundingRectElm === undefined ||
|
|
114
|
+
(rootBoundingRectElm.top < 0 && rootBoundingRectElm.bottom < 0)
|
|
115
|
+
) {
|
|
116
|
+
setActiveItemId("")
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
const headings = getHeadingsInElm()
|
|
120
|
+
let selectedHeadingByHash: HTMLHeadingElement | undefined = undefined
|
|
121
|
+
const hash = location.hash.replace("#", "")
|
|
122
|
+
let closestPositiveHeading: HTMLHeadingElement | undefined = undefined
|
|
123
|
+
let closestNegativeHeading: HTMLHeadingElement | undefined = undefined
|
|
124
|
+
let closestPositiveDistance = Infinity
|
|
125
|
+
let closestNegativeDistance = -Infinity
|
|
126
|
+
const halfway = isElmWindow(scrollableElement)
|
|
127
|
+
? scrollableElement.innerHeight / 2
|
|
128
|
+
: scrollableElement
|
|
129
|
+
? scrollableElement.scrollHeight / 2
|
|
130
|
+
: 0
|
|
131
|
+
|
|
132
|
+
const scrollEl = scrollableElement as HTMLElement | undefined
|
|
133
|
+
if (scrollEl?.scrollTop === 0) {
|
|
134
|
+
// set the first heading as active if the scrollable element is at the top
|
|
135
|
+
setActiveItemId(
|
|
136
|
+
items.length && useDefaultIfNoActive ? items[0].heading.id : ""
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
return
|
|
140
|
+
} else if (
|
|
141
|
+
(scrollEl?.scrollTop ?? 0) + (scrollEl?.clientHeight ?? 0) >=
|
|
142
|
+
(scrollEl?.scrollHeight ?? 0)
|
|
143
|
+
) {
|
|
144
|
+
// set the last heading as active if the scrollable element is at the bottom
|
|
145
|
+
let lastHeading = items[items.length - 1]
|
|
146
|
+
while (lastHeading?.children?.length) {
|
|
147
|
+
lastHeading = lastHeading.children[lastHeading.children.length - 1]
|
|
148
|
+
}
|
|
149
|
+
setActiveItemId(
|
|
150
|
+
lastHeading && useDefaultIfNoActive ? lastHeading.heading.id : ""
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
return
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
headings?.forEach((heading) => {
|
|
157
|
+
if (heading.id === hash) {
|
|
158
|
+
selectedHeadingByHash = heading as HTMLHeadingElement
|
|
159
|
+
}
|
|
160
|
+
const headingDistance = heading.getBoundingClientRect().top
|
|
161
|
+
|
|
162
|
+
if (headingDistance > 0 && headingDistance < closestPositiveDistance) {
|
|
163
|
+
closestPositiveDistance = headingDistance
|
|
164
|
+
closestPositiveHeading = heading as HTMLHeadingElement
|
|
165
|
+
} else if (
|
|
166
|
+
headingDistance < 0 &&
|
|
167
|
+
headingDistance > closestNegativeDistance
|
|
168
|
+
) {
|
|
169
|
+
closestNegativeDistance = headingDistance
|
|
170
|
+
closestNegativeHeading = heading as HTMLHeadingElement
|
|
171
|
+
}
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
const negativeDistanceToHalfway = closestNegativeDistance
|
|
175
|
+
? Math.abs(halfway + closestNegativeDistance)
|
|
176
|
+
: 0
|
|
177
|
+
const positiveDistanceToHalfway = closestPositiveDistance
|
|
178
|
+
? Math.abs(halfway - closestPositiveDistance)
|
|
179
|
+
: 0
|
|
180
|
+
|
|
181
|
+
const chosenClosest =
|
|
182
|
+
!negativeDistanceToHalfway && !positiveDistanceToHalfway
|
|
183
|
+
? undefined
|
|
184
|
+
: negativeDistanceToHalfway > positiveDistanceToHalfway
|
|
185
|
+
? closestNegativeHeading
|
|
186
|
+
: closestPositiveHeading
|
|
187
|
+
|
|
188
|
+
setActiveItemId(
|
|
189
|
+
chosenClosest
|
|
190
|
+
? (chosenClosest as HTMLHeadingElement).id
|
|
191
|
+
: selectedHeadingByHash
|
|
192
|
+
? (selectedHeadingByHash as HTMLHeadingElement).id
|
|
193
|
+
: items.length
|
|
194
|
+
? useDefaultIfNoActive
|
|
195
|
+
? items[0].heading.id
|
|
196
|
+
: ""
|
|
197
|
+
: ""
|
|
198
|
+
)
|
|
199
|
+
}, [getHeadingsInElm, items, enable, root])
|
|
200
|
+
|
|
201
|
+
useEffect(() => {
|
|
202
|
+
if (!scrollableElement || !enable) {
|
|
203
|
+
return
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
scrollableElement.addEventListener("scroll", setActiveToClosest)
|
|
207
|
+
|
|
208
|
+
return () => {
|
|
209
|
+
scrollableElement.removeEventListener("scroll", setActiveToClosest)
|
|
210
|
+
}
|
|
211
|
+
}, [scrollableElement, setActiveToClosest, enable])
|
|
212
|
+
|
|
213
|
+
useEffect(() => {
|
|
214
|
+
if (items.length && enable) {
|
|
215
|
+
setActiveToClosest()
|
|
216
|
+
}
|
|
217
|
+
}, [items, setActiveToClosest, enable])
|
|
218
|
+
|
|
219
|
+
return {
|
|
220
|
+
items,
|
|
221
|
+
activeItemId,
|
|
222
|
+
}
|
|
223
|
+
}
|