docus 2.1.0 → 3.0.0-beta.1
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/README.md +6 -4
- package/app/router.options.ts +18 -0
- package/assets/css/fonts.css +84 -0
- package/assets/css/main.css +11 -0
- package/assets/css/tailwind.css +282 -0
- package/components/app/Container.vue +23 -0
- package/components/app/Footer.vue +38 -0
- package/components/app/Navbar.vue +26 -0
- package/components/app/NavbarLogo.vue +31 -0
- package/components/app/Page.vue +7 -0
- package/components/app/PoweredByDocus.vue +11 -0
- package/components/content/Alert.vue +124 -0
- package/components/content/BlockHero.vue +54 -0
- package/components/content/ButtonLink.vue +44 -0
- package/components/content/Card.vue +46 -0
- package/components/content/CardGrid.vue +23 -0
- package/components/content/CodeBlock.vue +47 -0
- package/components/content/CodeGroup.vue +134 -0
- package/components/content/CopyButton.vue +48 -0
- package/{dist/runtime/app/components/prose/ProseOl.vue → components/content/List.vue} +2 -2
- package/components/content/NeedContribution.vue +23 -0
- package/components/content/ReadMore.vue +24 -0
- package/components/content/Sandbox.vue +100 -0
- package/components/content/TabsHeader.vue +44 -0
- package/components/content/Terminal.vue +70 -0
- package/components/content/VideoPlayer.vue +113 -0
- package/components/docs/DocsAside.vue +19 -0
- package/components/docs/DocsAsideTree.vue +101 -0
- package/components/docs/DocsHero.vue +39 -0
- package/components/docs/DocsPage.vue +22 -0
- package/components/docs/DocsPageContent.vue +29 -0
- package/components/docs/DocsToc.vue +72 -0
- package/components/globals/Icon.vue +24 -0
- package/{dist/runtime/app/components/prose/ProseHr.vue → components/globals/Logo.vue} +1 -1
- package/components/globals/NuxtImg.vue +43 -0
- package/components/globals/SocialIcons.vue +43 -0
- package/components/globals/ThemeSelect.vue +35 -0
- package/components/icons/IconAlgolia.vue +8 -0
- package/components/icons/IconArrowLeft.vue +10 -0
- package/components/icons/IconArrowRight.vue +10 -0
- package/components/icons/IconBadgeCheck.vue +14 -0
- package/components/icons/IconCheck.vue +10 -0
- package/components/icons/IconCheckCircle.vue +10 -0
- package/components/icons/IconChevronRight.vue +12 -0
- package/components/icons/IconClipboardCheck.vue +14 -0
- package/components/icons/IconClipboardCopy.vue +14 -0
- package/components/icons/IconCodeSandbox.vue +8 -0
- package/components/icons/IconCopy.vue +17 -0
- package/components/icons/IconDots.vue +10 -0
- package/components/icons/IconEdit.vue +18 -0
- package/components/icons/IconExclamationCircle.vue +12 -0
- package/components/icons/IconExclamationTriangle.vue +10 -0
- package/components/icons/IconExternalLink.vue +12 -0
- package/components/icons/IconGit.vue +7 -0
- package/components/icons/IconGitHub.vue +10 -0
- package/components/icons/IconHeart.vue +9 -0
- package/components/icons/IconInformationCircle.vue +10 -0
- package/components/icons/IconLighthouse.vue +83 -0
- package/components/icons/IconLine.vue +10 -0
- package/components/icons/IconMarkdown.vue +13 -0
- package/components/icons/IconMenu.vue +12 -0
- package/components/icons/IconMenuAlt.vue +10 -0
- package/components/icons/IconMinus.vue +10 -0
- package/components/icons/IconMoon.vue +10 -0
- package/components/icons/IconNuxt.vue +14 -0
- package/components/icons/IconNuxtContent.vue +20 -0
- package/components/icons/IconNuxtLabs.vue +21 -0
- package/components/icons/IconPlus.vue +10 -0
- package/components/icons/IconPuzzle.vue +8 -0
- package/components/icons/IconSSG.vue +7 -0
- package/components/icons/IconSearch.vue +12 -0
- package/components/icons/IconSun.vue +10 -0
- package/components/icons/IconTocBack.vue +21 -0
- package/components/icons/IconTocCurrent.vue +21 -0
- package/components/icons/IconTocNext.vue +8 -0
- package/components/icons/IconTranslate.vue +14 -0
- package/components/icons/IconTwitter.vue +8 -0
- package/components/icons/IconVite.vue +30 -0
- package/components/icons/IconVue.vue +6 -0
- package/components/icons/IconVueTelescope.vue +11 -0
- package/components/icons/IconWindi.vue +17 -0
- package/components/icons/IconX.vue +12 -0
- package/components/icons/IconXCircle.vue +10 -0
- package/components/icons/IconZap.vue +8 -0
- package/components/prose/ProseA.vue +66 -0
- package/components/prose/ProseBlockquote.vue +21 -0
- package/components/prose/ProseCode.vue +68 -0
- package/components/prose/ProseCodeInline.vue +38 -0
- package/components/prose/ProseEm.vue +11 -0
- package/components/prose/ProseH1.vue +22 -0
- package/components/prose/ProseH2.vue +22 -0
- package/components/prose/ProseH3.vue +24 -0
- package/components/prose/ProseH4.vue +24 -0
- package/components/prose/ProseHr.vue +13 -0
- package/components/prose/ProseImg.vue +32 -0
- package/components/prose/ProseLi.vue +31 -0
- package/components/prose/ProseOl.vue +16 -0
- package/components/prose/ProseP.vue +14 -0
- package/components/prose/ProseStrong.vue +14 -0
- package/components/prose/ProseTable.vue +13 -0
- package/{dist/runtime/app/components → components}/prose/ProseTbody.vue +0 -0
- package/components/prose/ProseTd.vue +11 -0
- package/components/prose/ProseTh.vue +11 -0
- package/components/prose/ProseThead.vue +11 -0
- package/components/prose/ProseTr.vue +11 -0
- package/components/prose/ProseUl.vue +15 -0
- package/composables/useContent.ts +155 -0
- package/composables/useMenu.ts +20 -0
- package/composables/useScrollToHeading.ts +35 -0
- package/composables/useScrollspy.ts +45 -0
- package/composables/useTheme.ts +10 -0
- package/layouts/default.vue +27 -0
- package/layouts/page.vue +11 -0
- package/nuxt.config.ts +151 -0
- package/package.json +46 -83
- package/pages/[...slug].vue +24 -0
- package/public/android-chrome-192x192.png +0 -0
- package/public/android-chrome-512x512.png +0 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/site.webmanifest +1 -0
- package/LICENSE +0 -21
- package/dist/index.cjs +0 -549
- package/dist/index.d.ts +0 -25
- package/dist/index.mjs +0 -523
- package/dist/runtime/app/components/DocusContent.vue +0 -215
- package/dist/runtime/app/components/DocusContent.vue.d.ts +0 -25
- package/dist/runtime/app/components/Error.vue +0 -19
- package/dist/runtime/app/components/Error.vue.d.ts +0 -9
- package/dist/runtime/app/components/Markdown.vue +0 -56
- package/dist/runtime/app/components/Markdown.vue.d.ts +0 -25
- package/dist/runtime/app/components/Page.vue +0 -29
- package/dist/runtime/app/components/Page.vue.d.ts +0 -2
- package/dist/runtime/app/components/Props.vue +0 -130
- package/dist/runtime/app/components/Props.vue.d.ts +0 -80
- package/dist/runtime/app/components/prose/ProseA.vue +0 -41
- package/dist/runtime/app/components/prose/ProseA.vue.d.ts +0 -23
- package/dist/runtime/app/components/prose/ProseBlockquote.vue +0 -5
- package/dist/runtime/app/components/prose/ProseCode.vue +0 -5
- package/dist/runtime/app/components/prose/ProseCodeInline.vue +0 -5
- package/dist/runtime/app/components/prose/ProseEm.vue +0 -5
- package/dist/runtime/app/components/prose/ProseH1.vue +0 -3
- package/dist/runtime/app/components/prose/ProseH2.vue +0 -3
- package/dist/runtime/app/components/prose/ProseH3.vue +0 -3
- package/dist/runtime/app/components/prose/ProseH4.vue +0 -3
- package/dist/runtime/app/components/prose/ProseH5.vue +0 -3
- package/dist/runtime/app/components/prose/ProseH6.vue +0 -3
- package/dist/runtime/app/components/prose/ProseImg.vue +0 -32
- package/dist/runtime/app/components/prose/ProseImg.vue.d.ts +0 -21
- package/dist/runtime/app/components/prose/ProseLi.vue +0 -3
- package/dist/runtime/app/components/prose/ProseParagraph.vue +0 -3
- package/dist/runtime/app/components/prose/ProseStrong.vue +0 -5
- package/dist/runtime/app/components/prose/ProseTable.vue +0 -5
- package/dist/runtime/app/components/prose/ProseTd.vue +0 -5
- package/dist/runtime/app/components/prose/ProseTh.vue +0 -5
- package/dist/runtime/app/components/prose/ProseThead.vue +0 -5
- package/dist/runtime/app/components/prose/ProseTr.vue +0 -5
- package/dist/runtime/app/components/prose/ProseUl.vue +0 -5
- package/dist/runtime/app/composables/helpers.d.ts +0 -4
- package/dist/runtime/app/composables/helpers.js +0 -66
- package/dist/runtime/app/composables/helpers.mjs +0 -40
- package/dist/runtime/app/composables/index.d.ts +0 -90
- package/dist/runtime/app/composables/index.js +0 -108
- package/dist/runtime/app/composables/index.mjs +0 -63
- package/dist/runtime/app/composables/navigation.d.ts +0 -37
- package/dist/runtime/app/composables/navigation.js +0 -227
- package/dist/runtime/app/composables/navigation.mjs +0 -148
- package/dist/runtime/app/composables/store.d.ts +0 -7
- package/dist/runtime/app/composables/store.js +0 -52
- package/dist/runtime/app/composables/store.mjs +0 -35
- package/dist/runtime/app/composables/style.d.ts +0 -11
- package/dist/runtime/app/composables/style.js +0 -117
- package/dist/runtime/app/composables/style.mjs +0 -71
- package/dist/runtime/app/composables/theme-colors.d.ts +0 -30
- package/dist/runtime/app/composables/theme-colors.js +0 -80
- package/dist/runtime/app/composables/theme-colors.mjs +0 -48
- package/dist/runtime/app/composables/websocket.d.ts +0 -3
- package/dist/runtime/app/composables/websocket.js +0 -79
- package/dist/runtime/app/composables/websocket.mjs +0 -63
- package/dist/runtime/app/layouts/default.vue +0 -5
- package/dist/runtime/app/layouts/error.vue +0 -33
- package/dist/runtime/app/layouts/error.vue.d.ts +0 -21
- package/dist/runtime/app/pages/_.vue +0 -222
- package/dist/runtime/app/pages/_.vue.d.ts +0 -2
- package/dist/runtime/context.d.ts +0 -1
- package/dist/runtime/context.js +0 -17
- package/dist/runtime/context.mjs +0 -5
- package/dist/runtime/database/Query.d.ts +0 -18
- package/dist/runtime/database/Query.js +0 -68
- package/dist/runtime/database/Query.mjs +0 -49
- package/dist/runtime/database/index.d.ts +0 -4
- package/dist/runtime/database/index.js +0 -45
- package/dist/runtime/database/index.mjs +0 -25
- package/dist/runtime/database/providers/local/Query.d.ts +0 -14
- package/dist/runtime/database/providers/local/Query.js +0 -85
- package/dist/runtime/database/providers/local/Query.mjs +0 -60
- package/dist/runtime/database/providers/local/index.d.ts +0 -3
- package/dist/runtime/database/providers/local/index.js +0 -63
- package/dist/runtime/database/providers/local/index.mjs +0 -39
- package/dist/runtime/database/providers/local/operations.d.ts +0 -2
- package/dist/runtime/database/providers/local/operations.js +0 -83
- package/dist/runtime/database/providers/local/operations.mjs +0 -53
- package/dist/runtime/database/providers/local/utils.d.ts +0 -8
- package/dist/runtime/database/providers/local/utils.js +0 -28
- package/dist/runtime/database/providers/local/utils.mjs +0 -17
- package/dist/runtime/index.d.ts +0 -3
- package/dist/runtime/index.js +0 -44
- package/dist/runtime/index.mjs +0 -3
- package/dist/runtime/navigation.d.ts +0 -4
- package/dist/runtime/navigation.js +0 -176
- package/dist/runtime/navigation.mjs +0 -137
- package/dist/runtime/server/api/get.d.ts +0 -10
- package/dist/runtime/server/api/get.js +0 -24
- package/dist/runtime/server/api/get.mjs +0 -13
- package/dist/runtime/server/api/list.d.ts +0 -9
- package/dist/runtime/server/api/list.js +0 -34
- package/dist/runtime/server/api/list.mjs +0 -18
- package/dist/runtime/server/api/navigation.d.ts +0 -7
- package/dist/runtime/server/api/navigation.js +0 -20
- package/dist/runtime/server/api/navigation.mjs +0 -10
- package/dist/runtime/server/api/preview.d.ts +0 -3
- package/dist/runtime/server/api/preview.js +0 -54
- package/dist/runtime/server/api/preview.mjs +0 -31
- package/dist/runtime/server/api/reload.d.ts +0 -6
- package/dist/runtime/server/api/reload.js +0 -27
- package/dist/runtime/server/api/reload.mjs +0 -11
- package/dist/runtime/server/api/search.d.ts +0 -6
- package/dist/runtime/server/api/search.js +0 -27
- package/dist/runtime/server/api/search.mjs +0 -13
- package/dist/runtime/server/content.d.ts +0 -46
- package/dist/runtime/server/content.js +0 -175
- package/dist/runtime/server/content.mjs +0 -114
- package/dist/runtime/server/socket.d.ts +0 -9
- package/dist/runtime/server/socket.js +0 -33
- package/dist/runtime/server/socket.mjs +0 -20
- package/dist/runtime/server/utils/cache.d.ts +0 -19
- package/dist/runtime/server/utils/cache.js +0 -110
- package/dist/runtime/server/utils/cache.mjs +0 -75
- package/dist/runtime/server/utils/index.d.ts +0 -4
- package/dist/runtime/server/utils/index.js +0 -18
- package/dist/runtime/server/utils/index.mjs +0 -8
- package/dist/runtime/transformers/index.d.ts +0 -1
- package/dist/runtime/transformers/index.js +0 -26
- package/dist/runtime/transformers/index.mjs +0 -11
- package/dist/runtime/transformers/json.d.ts +0 -3
- package/dist/runtime/transformers/json.js +0 -15
- package/dist/runtime/transformers/json.mjs +0 -5
- package/dist/runtime/transformers/markdown/index.d.ts +0 -8
- package/dist/runtime/transformers/markdown/index.js +0 -25
- package/dist/runtime/transformers/markdown/index.mjs +0 -16
- package/dist/runtime/transformers/utils/index.d.ts +0 -1
- package/dist/runtime/transformers/utils/index.js +0 -18
- package/dist/runtime/transformers/utils/index.mjs +0 -1
- package/dist/runtime/transformers/utils/path.d.ts +0 -26
- package/dist/runtime/transformers/utils/path.js +0 -88
- package/dist/runtime/transformers/utils/path.mjs +0 -56
- package/dist/runtime/utils/index.d.ts +0 -1
- package/dist/runtime/utils/index.js +0 -18
- package/dist/runtime/utils/index.mjs +0 -1
- package/dist/runtime/utils/log.d.ts +0 -1
- package/dist/runtime/utils/log.js +0 -14
- package/dist/runtime/utils/log.mjs +0 -2
- package/dist/runtime/utils/object.d.ts +0 -9
- package/dist/runtime/utils/object.js +0 -22
- package/dist/runtime/utils/object.mjs +0 -4
- package/dist/templates/content.mjs +0 -50
- package/dist/templates/docus.mjs +0 -13
- package/dist/templates/hot.mjs +0 -16
- package/dist/templates/i18n.mjs +0 -23
- package/dist/templates/options.mjs +0 -46
- package/shims.d.ts +0 -24
- package/types.d.ts +0 -397
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useDocusNavigationState = exports.useDocusNavigation = exports.useDocusCurrentPath = exports.useDocusCurrentNav = exports.createDocusNavigation = void 0;
|
|
7
|
-
|
|
8
|
-
var _ufo = require("ufo");
|
|
9
|
-
|
|
10
|
-
var _vue = _interopRequireDefault(require("vue"));
|
|
11
|
-
|
|
12
|
-
var _scule = require("scule");
|
|
13
|
-
|
|
14
|
-
var _ = require(".");
|
|
15
|
-
|
|
16
|
-
var _app = require("#app");
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
let _get;
|
|
21
|
-
|
|
22
|
-
let _fetchNavigation;
|
|
23
|
-
|
|
24
|
-
let _filterLinks;
|
|
25
|
-
|
|
26
|
-
let _isLinkActive;
|
|
27
|
-
|
|
28
|
-
let _getPageTemplate;
|
|
29
|
-
|
|
30
|
-
let _getPreviousAndNextLink;
|
|
31
|
-
|
|
32
|
-
let _updateCurrentNav;
|
|
33
|
-
|
|
34
|
-
let _refresh;
|
|
35
|
-
|
|
36
|
-
const createDocusNavigation = (context, config, content) => {
|
|
37
|
-
const _contentLocalePath = context.$contentLocalePath;
|
|
38
|
-
const {
|
|
39
|
-
route
|
|
40
|
-
} = context;
|
|
41
|
-
|
|
42
|
-
const _route = (0, _app.unref)(route);
|
|
43
|
-
|
|
44
|
-
const docusNavigation = (0, _app.useState)(_.StateTypes.Navigation, () => ({}));
|
|
45
|
-
const docusCurrentPath = (0, _app.useState)(_.StateTypes.CurrentPath, () => `/${_route.params.pathMatch}`);
|
|
46
|
-
|
|
47
|
-
_fetchNavigation = async locale => {
|
|
48
|
-
const __locale = locale || context.i18n.locale;
|
|
49
|
-
|
|
50
|
-
const data = await content.fetch("navigation/" + __locale);
|
|
51
|
-
docusNavigation.value[__locale] = data;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
_get = ({
|
|
55
|
-
depth,
|
|
56
|
-
locale = context.i18n.locale,
|
|
57
|
-
from,
|
|
58
|
-
all
|
|
59
|
-
} = {}) => {
|
|
60
|
-
const nav = docusNavigation.value[locale] || [];
|
|
61
|
-
let items = nav;
|
|
62
|
-
let match;
|
|
63
|
-
let exclusiveContent;
|
|
64
|
-
let parent;
|
|
65
|
-
|
|
66
|
-
if (from) {
|
|
67
|
-
let lastMatch;
|
|
68
|
-
const paths = from.split("/");
|
|
69
|
-
items = paths.reduce((links, path, index) => {
|
|
70
|
-
if (!path) return links;
|
|
71
|
-
|
|
72
|
-
if (match && match.page) {
|
|
73
|
-
lastMatch = match;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
match = links.find(item => item.to.split("/")[index] === path);
|
|
77
|
-
|
|
78
|
-
if (match) {
|
|
79
|
-
if (match && match.exclusive) {
|
|
80
|
-
parent = lastMatch || parent;
|
|
81
|
-
exclusiveContent = match;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return match.children;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return links;
|
|
88
|
-
}, items);
|
|
89
|
-
|
|
90
|
-
if (exclusiveContent) {
|
|
91
|
-
items = exclusiveContent.children;
|
|
92
|
-
} else {
|
|
93
|
-
items = nav;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return {
|
|
98
|
-
title: exclusiveContent && exclusiveContent.title,
|
|
99
|
-
to: exclusiveContent && exclusiveContent.to,
|
|
100
|
-
parent,
|
|
101
|
-
links: all ? items : _filterLinks(items, depth || 1, 1)
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
_filterLinks = (nodes, maxDepth, currentDepth) => {
|
|
106
|
-
return nodes.filter(node => {
|
|
107
|
-
if (node.hidden) return false;
|
|
108
|
-
if (node.draft === true) return false;
|
|
109
|
-
if (currentDepth && maxDepth > currentDepth) return false;
|
|
110
|
-
if (node.nested === false) node.children = [];
|
|
111
|
-
node.children = node.children && node.children.length > 0 ? _filterLinks(node.children, maxDepth, currentDepth + 1) : [];
|
|
112
|
-
return node;
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
_isLinkActive = to => {
|
|
117
|
-
return (0, _ufo.withTrailingSlash)(docusCurrentPath.value) === (0, _ufo.withTrailingSlash)(_contentLocalePath(to));
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
_getPageTemplate = page => {
|
|
121
|
-
let template = typeof page.template === "string" ? page.template : page.template?.self;
|
|
122
|
-
|
|
123
|
-
if (!template) {
|
|
124
|
-
const slugs = page.to.split("/").filter(Boolean).slice(0, -1);
|
|
125
|
-
let {
|
|
126
|
-
links
|
|
127
|
-
} = docusCurrentNav.value || {};
|
|
128
|
-
slugs.forEach((_slug, index) => {
|
|
129
|
-
const to = "/" + slugs.slice(0, index + 1).join("/");
|
|
130
|
-
const link = links.find(link2 => link2.to === to);
|
|
131
|
-
|
|
132
|
-
if (link?.template) {
|
|
133
|
-
template = link.template || template;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (!link?.children) return;
|
|
137
|
-
links = link.children;
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (!template) template = config.value?.template || "Page";
|
|
142
|
-
template = (0, _scule.pascalCase)(template);
|
|
143
|
-
|
|
144
|
-
if (!_vue.default.component(template)) {
|
|
145
|
-
console.error(`Template ${template} does not exists, fallback to Page template.`);
|
|
146
|
-
template = "Page";
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return template;
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
_getPreviousAndNextLink = page => {
|
|
153
|
-
return content.search({
|
|
154
|
-
deep: true
|
|
155
|
-
}).where({
|
|
156
|
-
language: context.i18n.locale,
|
|
157
|
-
parent: page.parent,
|
|
158
|
-
page: {
|
|
159
|
-
$ne: false
|
|
160
|
-
},
|
|
161
|
-
hidden: {
|
|
162
|
-
$ne: true
|
|
163
|
-
},
|
|
164
|
-
redirect: {
|
|
165
|
-
$type: "undefined"
|
|
166
|
-
}
|
|
167
|
-
}).only(["title", "slug", "to"]).sortBy("position", "asc").surround(page.to, {
|
|
168
|
-
before: 1,
|
|
169
|
-
after: 1
|
|
170
|
-
}).fetch();
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
_updateCurrentNav = () => {
|
|
174
|
-
docusCurrentNav.value = _get({
|
|
175
|
-
from: docusCurrentPath.value
|
|
176
|
-
});
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
_refresh = async locale => {
|
|
180
|
-
await _fetchNavigation(locale);
|
|
181
|
-
|
|
182
|
-
_updateCurrentNav();
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
const docusCurrentNav = (0, _app.useState)(_.StateTypes.CurrentNav, () => {
|
|
186
|
-
return _get({
|
|
187
|
-
from: `/${_route.params.pathMatch}`
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
if (process.client) {
|
|
192
|
-
window.onNuxtReady(() => {
|
|
193
|
-
window.$nuxt.$on("docus:content:preview", () => _refresh(context.i18n.locale));
|
|
194
|
-
window.$nuxt.$on("content:update", () => _refresh(context.i18n.locale));
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
exports.createDocusNavigation = createDocusNavigation;
|
|
200
|
-
|
|
201
|
-
const useDocusNavigation = () => {
|
|
202
|
-
return {
|
|
203
|
-
state: useDocusNavigationState(),
|
|
204
|
-
currentNav: useDocusCurrentNav(),
|
|
205
|
-
currentPath: useDocusCurrentPath(),
|
|
206
|
-
getPageTemplate: _getPageTemplate,
|
|
207
|
-
fetchNavigation: _fetchNavigation,
|
|
208
|
-
isLinkActive: _isLinkActive,
|
|
209
|
-
updateCurrentNav: _updateCurrentNav,
|
|
210
|
-
getPreviousAndNextLink: _getPreviousAndNextLink,
|
|
211
|
-
get: _get
|
|
212
|
-
};
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
exports.useDocusNavigation = useDocusNavigation;
|
|
216
|
-
|
|
217
|
-
const useDocusNavigationState = () => (0, _app.useState)(_.StateTypes.Navigation);
|
|
218
|
-
|
|
219
|
-
exports.useDocusNavigationState = useDocusNavigationState;
|
|
220
|
-
|
|
221
|
-
const useDocusCurrentNav = () => (0, _app.useState)(_.StateTypes.CurrentNav);
|
|
222
|
-
|
|
223
|
-
exports.useDocusCurrentNav = useDocusCurrentNav;
|
|
224
|
-
|
|
225
|
-
const useDocusCurrentPath = () => (0, _app.useState)(_.StateTypes.CurrentPath);
|
|
226
|
-
|
|
227
|
-
exports.useDocusCurrentPath = useDocusCurrentPath;
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { withTrailingSlash } from "ufo";
|
|
2
|
-
import Vue from "vue";
|
|
3
|
-
import { pascalCase } from "scule";
|
|
4
|
-
import { StateTypes } from "./index.mjs";
|
|
5
|
-
import { unref, useState } from "#app";
|
|
6
|
-
let _get;
|
|
7
|
-
let _fetchNavigation;
|
|
8
|
-
let _filterLinks;
|
|
9
|
-
let _isLinkActive;
|
|
10
|
-
let _getPageTemplate;
|
|
11
|
-
let _getPreviousAndNextLink;
|
|
12
|
-
let _updateCurrentNav;
|
|
13
|
-
let _refresh;
|
|
14
|
-
export const createDocusNavigation = (context, config, content) => {
|
|
15
|
-
const _contentLocalePath = context.$contentLocalePath;
|
|
16
|
-
const { route } = context;
|
|
17
|
-
const _route = unref(route);
|
|
18
|
-
const docusNavigation = useState(StateTypes.Navigation, () => ({}));
|
|
19
|
-
const docusCurrentPath = useState(StateTypes.CurrentPath, () => `/${_route.params.pathMatch}`);
|
|
20
|
-
_fetchNavigation = async (locale) => {
|
|
21
|
-
const __locale = locale || context.i18n.locale;
|
|
22
|
-
const data = await content.fetch("navigation/" + __locale);
|
|
23
|
-
docusNavigation.value[__locale] = data;
|
|
24
|
-
};
|
|
25
|
-
_get = ({ depth, locale = context.i18n.locale, from, all } = {}) => {
|
|
26
|
-
const nav = docusNavigation.value[locale] || [];
|
|
27
|
-
let items = nav;
|
|
28
|
-
let match;
|
|
29
|
-
let exclusiveContent;
|
|
30
|
-
let parent;
|
|
31
|
-
if (from) {
|
|
32
|
-
let lastMatch;
|
|
33
|
-
const paths = from.split("/");
|
|
34
|
-
items = paths.reduce((links, path, index) => {
|
|
35
|
-
if (!path)
|
|
36
|
-
return links;
|
|
37
|
-
if (match && match.page) {
|
|
38
|
-
lastMatch = match;
|
|
39
|
-
}
|
|
40
|
-
match = links.find((item) => item.to.split("/")[index] === path);
|
|
41
|
-
if (match) {
|
|
42
|
-
if (match && match.exclusive) {
|
|
43
|
-
parent = lastMatch || parent;
|
|
44
|
-
exclusiveContent = match;
|
|
45
|
-
}
|
|
46
|
-
return match.children;
|
|
47
|
-
}
|
|
48
|
-
return links;
|
|
49
|
-
}, items);
|
|
50
|
-
if (exclusiveContent) {
|
|
51
|
-
items = exclusiveContent.children;
|
|
52
|
-
} else {
|
|
53
|
-
items = nav;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
title: exclusiveContent && exclusiveContent.title,
|
|
58
|
-
to: exclusiveContent && exclusiveContent.to,
|
|
59
|
-
parent,
|
|
60
|
-
links: all ? items : _filterLinks(items, depth || 1, 1)
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
_filterLinks = (nodes, maxDepth, currentDepth) => {
|
|
64
|
-
return nodes.filter((node) => {
|
|
65
|
-
if (node.hidden)
|
|
66
|
-
return false;
|
|
67
|
-
if (node.draft === true)
|
|
68
|
-
return false;
|
|
69
|
-
if (currentDepth && maxDepth > currentDepth)
|
|
70
|
-
return false;
|
|
71
|
-
if (node.nested === false)
|
|
72
|
-
node.children = [];
|
|
73
|
-
node.children = node.children && node.children.length > 0 ? _filterLinks(node.children, maxDepth, currentDepth + 1) : [];
|
|
74
|
-
return node;
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
_isLinkActive = (to) => {
|
|
78
|
-
return withTrailingSlash(docusCurrentPath.value) === withTrailingSlash(_contentLocalePath(to));
|
|
79
|
-
};
|
|
80
|
-
_getPageTemplate = (page) => {
|
|
81
|
-
let template = typeof page.template === "string" ? page.template : page.template?.self;
|
|
82
|
-
if (!template) {
|
|
83
|
-
const slugs = page.to.split("/").filter(Boolean).slice(0, -1);
|
|
84
|
-
let { links } = docusCurrentNav.value || {};
|
|
85
|
-
slugs.forEach((_slug, index) => {
|
|
86
|
-
const to = "/" + slugs.slice(0, index + 1).join("/");
|
|
87
|
-
const link = links.find((link2) => link2.to === to);
|
|
88
|
-
if (link?.template) {
|
|
89
|
-
template = link.template || template;
|
|
90
|
-
}
|
|
91
|
-
if (!link?.children)
|
|
92
|
-
return;
|
|
93
|
-
links = link.children;
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
if (!template)
|
|
97
|
-
template = config.value?.template || "Page";
|
|
98
|
-
template = pascalCase(template);
|
|
99
|
-
if (!Vue.component(template)) {
|
|
100
|
-
console.error(`Template ${template} does not exists, fallback to Page template.`);
|
|
101
|
-
template = "Page";
|
|
102
|
-
}
|
|
103
|
-
return template;
|
|
104
|
-
};
|
|
105
|
-
_getPreviousAndNextLink = (page) => {
|
|
106
|
-
return content.search({ deep: true }).where({
|
|
107
|
-
language: context.i18n.locale,
|
|
108
|
-
parent: page.parent,
|
|
109
|
-
page: { $ne: false },
|
|
110
|
-
hidden: { $ne: true },
|
|
111
|
-
redirect: { $type: "undefined" }
|
|
112
|
-
}).only(["title", "slug", "to"]).sortBy("position", "asc").surround(page.to, { before: 1, after: 1 }).fetch();
|
|
113
|
-
};
|
|
114
|
-
_updateCurrentNav = () => {
|
|
115
|
-
docusCurrentNav.value = _get({
|
|
116
|
-
from: docusCurrentPath.value
|
|
117
|
-
});
|
|
118
|
-
};
|
|
119
|
-
_refresh = async (locale) => {
|
|
120
|
-
await _fetchNavigation(locale);
|
|
121
|
-
_updateCurrentNav();
|
|
122
|
-
};
|
|
123
|
-
const docusCurrentNav = useState(StateTypes.CurrentNav, () => {
|
|
124
|
-
return _get({ from: `/${_route.params.pathMatch}` });
|
|
125
|
-
});
|
|
126
|
-
if (process.client) {
|
|
127
|
-
window.onNuxtReady(() => {
|
|
128
|
-
window.$nuxt.$on("docus:content:preview", () => _refresh(context.i18n.locale));
|
|
129
|
-
window.$nuxt.$on("content:update", () => _refresh(context.i18n.locale));
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
export const useDocusNavigation = () => {
|
|
134
|
-
return {
|
|
135
|
-
state: useDocusNavigationState(),
|
|
136
|
-
currentNav: useDocusCurrentNav(),
|
|
137
|
-
currentPath: useDocusCurrentPath(),
|
|
138
|
-
getPageTemplate: _getPageTemplate,
|
|
139
|
-
fetchNavigation: _fetchNavigation,
|
|
140
|
-
isLinkActive: _isLinkActive,
|
|
141
|
-
updateCurrentNav: _updateCurrentNav,
|
|
142
|
-
getPreviousAndNextLink: _getPreviousAndNextLink,
|
|
143
|
-
get: _get
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
export const useDocusNavigationState = () => useState(StateTypes.Navigation);
|
|
147
|
-
export const useDocusCurrentNav = () => useState(StateTypes.CurrentNav);
|
|
148
|
-
export const useDocusCurrentPath = () => useState(StateTypes.CurrentPath);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import Vue from 'vue';
|
|
2
|
-
import type { CombinedVueInstance } from 'vue/types/vue';
|
|
3
|
-
import { Context } from '@nuxt/types';
|
|
4
|
-
export declare function createStore<T>(key: string, defaultValue: T): {
|
|
5
|
-
plugin: ({ ssrContext, nuxtState }: Context) => void;
|
|
6
|
-
useStore: (context?: CombinedVueInstance<Vue, object, object, object, Record<never, any>> | Context) => Ref<T>;
|
|
7
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createStore = createStore;
|
|
7
|
-
|
|
8
|
-
var _app = require("#app");
|
|
9
|
-
|
|
10
|
-
const createPlugin = (key, defaultValue) => {
|
|
11
|
-
const store = (0, _app.ref)(defaultValue || {});
|
|
12
|
-
return ({
|
|
13
|
-
ssrContext,
|
|
14
|
-
nuxtState
|
|
15
|
-
}) => {
|
|
16
|
-
const state = process.server ? ssrContext.nuxt : nuxtState;
|
|
17
|
-
state.stores = state.stores || {};
|
|
18
|
-
|
|
19
|
-
if (process.server) {
|
|
20
|
-
state.stores[key] = store;
|
|
21
|
-
} else {
|
|
22
|
-
Object.assign(store, state.stores?.[key] || {});
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
function createStore(key, defaultValue) {
|
|
28
|
-
const plugin = createPlugin(key, defaultValue);
|
|
29
|
-
|
|
30
|
-
function useStore(context) {
|
|
31
|
-
if (!context) {
|
|
32
|
-
const vm = (0, _app.getCurrentInstance)();
|
|
33
|
-
if (!vm) throw new Error("useStore must be called in setup() or a context provided");
|
|
34
|
-
context = vm.proxy;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
let state;
|
|
38
|
-
|
|
39
|
-
if (process.server) {
|
|
40
|
-
state = "$ssrContext" in context ? context.$ssrContext.nuxt : context.ssrContext?.nuxt;
|
|
41
|
-
} else {
|
|
42
|
-
state = window.__NUXT__;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return state.stores[key];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return {
|
|
49
|
-
plugin,
|
|
50
|
-
useStore
|
|
51
|
-
};
|
|
52
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { getCurrentInstance, ref } from "#app";
|
|
2
|
-
const createPlugin = (key, defaultValue) => {
|
|
3
|
-
const store = ref(defaultValue || {});
|
|
4
|
-
return ({ ssrContext, nuxtState }) => {
|
|
5
|
-
const state = process.server ? ssrContext.nuxt : nuxtState;
|
|
6
|
-
state.stores = state.stores || {};
|
|
7
|
-
if (process.server) {
|
|
8
|
-
state.stores[key] = store;
|
|
9
|
-
} else {
|
|
10
|
-
Object.assign(store, state.stores?.[key] || {});
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export function createStore(key, defaultValue) {
|
|
15
|
-
const plugin = createPlugin(key, defaultValue);
|
|
16
|
-
function useStore(context) {
|
|
17
|
-
if (!context) {
|
|
18
|
-
const vm = getCurrentInstance();
|
|
19
|
-
if (!vm)
|
|
20
|
-
throw new Error("useStore must be called in setup() or a context provided");
|
|
21
|
-
context = vm.proxy;
|
|
22
|
-
}
|
|
23
|
-
let state;
|
|
24
|
-
if (process.server) {
|
|
25
|
-
state = "$ssrContext" in context ? context.$ssrContext.nuxt : context.ssrContext?.nuxt;
|
|
26
|
-
} else {
|
|
27
|
-
state = window.__NUXT__;
|
|
28
|
-
}
|
|
29
|
-
return state.stores[key];
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
plugin,
|
|
33
|
-
useStore
|
|
34
|
-
};
|
|
35
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Context } from '@nuxt/types';
|
|
2
|
-
declare function updateHead(): void;
|
|
3
|
-
export declare const createDocusStyles: (context: Context) => void;
|
|
4
|
-
/**
|
|
5
|
-
* Access the styling state and helpers.
|
|
6
|
-
*/
|
|
7
|
-
export declare const useDocusStyles: () => {
|
|
8
|
-
styles: any;
|
|
9
|
-
updateHead: typeof updateHead;
|
|
10
|
-
};
|
|
11
|
-
export {};
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useDocusStyles = exports.createDocusStyles = void 0;
|
|
7
|
-
|
|
8
|
-
var _themeColors = require("./theme-colors");
|
|
9
|
-
|
|
10
|
-
var _ = require("./");
|
|
11
|
-
|
|
12
|
-
var _app = require("#app");
|
|
13
|
-
|
|
14
|
-
let _head;
|
|
15
|
-
|
|
16
|
-
function useColors(colors) {
|
|
17
|
-
try {
|
|
18
|
-
return Object.entries(colors).map(([key, color]) => [key, typeof color === "string" ? (0, _themeColors.getColors)(color) : color]);
|
|
19
|
-
} catch (e) {
|
|
20
|
-
console.warn("Could not parse custom colors:", e && e.message ? e.message : e);
|
|
21
|
-
return [];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function useCssVariableStore(scopes = ["dark"]) {
|
|
26
|
-
scopes = ["default", ...scopes];
|
|
27
|
-
|
|
28
|
-
const _store = scopes.reduce((obj, scope) => ({
|
|
29
|
-
[scope]: {},
|
|
30
|
-
...obj
|
|
31
|
-
}), {});
|
|
32
|
-
|
|
33
|
-
const getScope = scope => _store[scope] || null;
|
|
34
|
-
|
|
35
|
-
const putSingle = key => value => {
|
|
36
|
-
const _arr = value.split(":");
|
|
37
|
-
|
|
38
|
-
const _value = _arr.pop();
|
|
39
|
-
|
|
40
|
-
const _scope = getScope(_arr.pop() || "default");
|
|
41
|
-
|
|
42
|
-
if (_scope) {
|
|
43
|
-
_scope[key] = _value;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const put = (key, value) => {
|
|
48
|
-
value.split(" ").map(putSingle(key));
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const generateVar = ([key, value]) => `--${key}: ${value}`;
|
|
52
|
-
|
|
53
|
-
const generateScope = scope => {
|
|
54
|
-
const vars = Object.entries(getScope(scope)).map(generateVar).join(";");
|
|
55
|
-
return scope === "default" ? `html:root {${vars}}` : `html.${scope} {${vars}}`;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const generate = () => scopes.map(generateScope).join(" ");
|
|
59
|
-
|
|
60
|
-
return {
|
|
61
|
-
put,
|
|
62
|
-
generate
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function useCSSVariables(colors) {
|
|
67
|
-
const {
|
|
68
|
-
put,
|
|
69
|
-
generate
|
|
70
|
-
} = useCssVariableStore(["dark"]);
|
|
71
|
-
const colorsList = useColors(colors);
|
|
72
|
-
colorsList.forEach(([color, map]) => Object.entries(map).forEach(([variant, value]) => put(`${color}-${variant}`, value)));
|
|
73
|
-
return generate();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function updateHead() {
|
|
77
|
-
const head = typeof _head === "function" ? _head() : _head;
|
|
78
|
-
|
|
79
|
-
if (!Array.isArray(head.style)) {
|
|
80
|
-
head.style = [];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (!Array.isArray(head.meta)) {
|
|
84
|
-
head.meta = [];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
head.style.push({
|
|
88
|
-
hid: "docus-theme",
|
|
89
|
-
cssText: styles.value,
|
|
90
|
-
type: "text/css"
|
|
91
|
-
});
|
|
92
|
-
head.meta = head.meta.filter(s => s.hid !== "theme-color");
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const styles = (0, _app.computed)(() => {
|
|
96
|
-
const theme = (0, _.useDocusTheme)();
|
|
97
|
-
return useCSSVariables(theme.value?.colors ? theme.value.colors : {});
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
const createDocusStyles = context => {
|
|
101
|
-
const {
|
|
102
|
-
app
|
|
103
|
-
} = context;
|
|
104
|
-
_head = app.head;
|
|
105
|
-
updateHead();
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
exports.createDocusStyles = createDocusStyles;
|
|
109
|
-
|
|
110
|
-
const useDocusStyles = () => {
|
|
111
|
-
return {
|
|
112
|
-
styles,
|
|
113
|
-
updateHead
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
exports.useDocusStyles = useDocusStyles;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { getColors } from "./theme-colors.mjs";
|
|
2
|
-
import { useDocusTheme } from ".//index.mjs";
|
|
3
|
-
import { computed } from "#app";
|
|
4
|
-
let _head;
|
|
5
|
-
function useColors(colors) {
|
|
6
|
-
try {
|
|
7
|
-
return Object.entries(colors).map(([key, color]) => [key, typeof color === "string" ? getColors(color) : color]);
|
|
8
|
-
} catch (e) {
|
|
9
|
-
console.warn("Could not parse custom colors:", e && e.message ? e.message : e);
|
|
10
|
-
return [];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
function useCssVariableStore(scopes = ["dark"]) {
|
|
14
|
-
scopes = ["default", ...scopes];
|
|
15
|
-
const _store = scopes.reduce((obj, scope) => ({ [scope]: {}, ...obj }), {});
|
|
16
|
-
const getScope = (scope) => _store[scope] || null;
|
|
17
|
-
const putSingle = (key) => (value) => {
|
|
18
|
-
const _arr = value.split(":");
|
|
19
|
-
const _value = _arr.pop();
|
|
20
|
-
const _scope = getScope(_arr.pop() || "default");
|
|
21
|
-
if (_scope) {
|
|
22
|
-
_scope[key] = _value;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const put = (key, value) => {
|
|
26
|
-
value.split(" ").map(putSingle(key));
|
|
27
|
-
};
|
|
28
|
-
const generateVar = ([key, value]) => `--${key}: ${value}`;
|
|
29
|
-
const generateScope = (scope) => {
|
|
30
|
-
const vars = Object.entries(getScope(scope)).map(generateVar).join(";");
|
|
31
|
-
return scope === "default" ? `html:root {${vars}}` : `html.${scope} {${vars}}`;
|
|
32
|
-
};
|
|
33
|
-
const generate = () => scopes.map(generateScope).join(" ");
|
|
34
|
-
return { put, generate };
|
|
35
|
-
}
|
|
36
|
-
function useCSSVariables(colors) {
|
|
37
|
-
const { put, generate } = useCssVariableStore(["dark"]);
|
|
38
|
-
const colorsList = useColors(colors);
|
|
39
|
-
colorsList.forEach(([color, map]) => Object.entries(map).forEach(([variant, value]) => put(`${color}-${variant}`, value)));
|
|
40
|
-
return generate();
|
|
41
|
-
}
|
|
42
|
-
function updateHead() {
|
|
43
|
-
const head = typeof _head === "function" ? _head() : _head;
|
|
44
|
-
if (!Array.isArray(head.style)) {
|
|
45
|
-
head.style = [];
|
|
46
|
-
}
|
|
47
|
-
if (!Array.isArray(head.meta)) {
|
|
48
|
-
head.meta = [];
|
|
49
|
-
}
|
|
50
|
-
head.style.push({
|
|
51
|
-
hid: "docus-theme",
|
|
52
|
-
cssText: styles.value,
|
|
53
|
-
type: "text/css"
|
|
54
|
-
});
|
|
55
|
-
head.meta = head.meta.filter((s) => s.hid !== "theme-color");
|
|
56
|
-
}
|
|
57
|
-
const styles = computed(() => {
|
|
58
|
-
const theme = useDocusTheme();
|
|
59
|
-
return useCSSVariables(theme.value?.colors ? theme.value.colors : {});
|
|
60
|
-
});
|
|
61
|
-
export const createDocusStyles = (context) => {
|
|
62
|
-
const { app } = context;
|
|
63
|
-
_head = app.head;
|
|
64
|
-
updateHead();
|
|
65
|
-
};
|
|
66
|
-
export const useDocusStyles = () => {
|
|
67
|
-
return {
|
|
68
|
-
styles,
|
|
69
|
-
updateHead
|
|
70
|
-
};
|
|
71
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export declare function parseColor(color?: string): number[];
|
|
2
|
-
export declare function hexValue(components: any): string;
|
|
3
|
-
export declare function tint(components: any, intensity: any): any;
|
|
4
|
-
export declare function shade(components: any, intensity: any): any;
|
|
5
|
-
export declare const withTint: (intensity: any) => (hex: any) => any;
|
|
6
|
-
export declare const withShade: (intensity: any) => (hex: any) => any;
|
|
7
|
-
export declare const _variants: {
|
|
8
|
-
50: (hex: any) => any;
|
|
9
|
-
100: (hex: any) => any;
|
|
10
|
-
200: (hex: any) => any;
|
|
11
|
-
300: (hex: any) => any;
|
|
12
|
-
400: (hex: any) => any;
|
|
13
|
-
500: (c: any) => any;
|
|
14
|
-
600: (hex: any) => any;
|
|
15
|
-
700: (hex: any) => any;
|
|
16
|
-
800: (hex: any) => any;
|
|
17
|
-
900: (hex: any) => any;
|
|
18
|
-
};
|
|
19
|
-
export declare function getColors(color: any, variants?: {
|
|
20
|
-
50: (hex: any) => any;
|
|
21
|
-
100: (hex: any) => any;
|
|
22
|
-
200: (hex: any) => any;
|
|
23
|
-
300: (hex: any) => any;
|
|
24
|
-
400: (hex: any) => any;
|
|
25
|
-
500: (c: any) => any;
|
|
26
|
-
600: (hex: any) => any;
|
|
27
|
-
700: (hex: any) => any;
|
|
28
|
-
800: (hex: any) => any;
|
|
29
|
-
900: (hex: any) => any;
|
|
30
|
-
}): {};
|