docus 2.1.0 → 3.0.0-beta.11
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/package.json +39 -83
- package/theme/app/router.options.ts +18 -0
- package/theme/assets/css/fonts.css +84 -0
- package/theme/assets/css/main.css +104 -0
- package/theme/components/app/Container.vue +25 -0
- package/theme/components/app/Footer.vue +40 -0
- package/theme/components/app/MobileNav.vue +85 -0
- package/theme/components/app/Navbar.vue +37 -0
- package/theme/components/app/NavbarLogo.vue +33 -0
- package/theme/components/app/Page.vue +7 -0
- package/theme/components/app/PoweredByDocus.vue +11 -0
- package/theme/components/content/Alert.vue +124 -0
- package/theme/components/content/BlockHero.vue +54 -0
- package/theme/components/content/ButtonLink.vue +45 -0
- package/theme/components/content/Card.vue +46 -0
- package/theme/components/content/CardGrid.vue +23 -0
- package/theme/components/content/CodeBlock.vue +47 -0
- package/theme/components/content/CodeGroup.vue +135 -0
- package/theme/components/content/CopyButton.vue +49 -0
- package/{dist/runtime/app/components/prose/ProseOl.vue → theme/components/content/List.vue} +2 -2
- package/theme/components/content/NeedContribution.vue +23 -0
- package/theme/components/content/ReadMore.vue +25 -0
- package/theme/components/content/Sandbox.vue +102 -0
- package/theme/components/content/TabsHeader.vue +44 -0
- package/theme/components/content/Terminal.vue +64 -0
- package/theme/components/content/VideoPlayer.vue +115 -0
- package/theme/components/dev/Debug.vue +65 -0
- package/theme/components/docs/DocsAside.vue +21 -0
- package/theme/components/docs/DocsAsideTree.vue +104 -0
- package/theme/components/docs/DocsHero.vue +39 -0
- package/theme/components/docs/DocsPage.vue +21 -0
- package/theme/components/docs/DocsPageContent.vue +32 -0
- package/theme/components/docs/DocsToc.vue +77 -0
- package/theme/components/globals/Icon.vue +24 -0
- package/{dist/runtime/app/components/prose/ProseHr.vue → theme/components/globals/Logo.vue} +1 -1
- package/theme/components/globals/NuxtImg.vue +45 -0
- package/theme/components/globals/SocialIcons.vue +45 -0
- package/theme/components/globals/ThemeSelect.vue +35 -0
- package/theme/components/icons/IconAlgolia.vue +8 -0
- package/theme/components/icons/IconArrowLeft.vue +10 -0
- package/theme/components/icons/IconArrowRight.vue +10 -0
- package/theme/components/icons/IconBadgeCheck.vue +14 -0
- package/theme/components/icons/IconCheck.vue +10 -0
- package/theme/components/icons/IconCheckCircle.vue +10 -0
- package/theme/components/icons/IconChevronRight.vue +12 -0
- package/theme/components/icons/IconClipboardCheck.vue +14 -0
- package/theme/components/icons/IconClipboardCopy.vue +14 -0
- package/theme/components/icons/IconCodeSandbox.vue +8 -0
- package/theme/components/icons/IconCopy.vue +17 -0
- package/theme/components/icons/IconDots.vue +10 -0
- package/theme/components/icons/IconEdit.vue +18 -0
- package/theme/components/icons/IconExclamationCircle.vue +12 -0
- package/theme/components/icons/IconExclamationTriangle.vue +10 -0
- package/theme/components/icons/IconExternalLink.vue +12 -0
- package/theme/components/icons/IconGit.vue +7 -0
- package/theme/components/icons/IconGitHub.vue +10 -0
- package/theme/components/icons/IconHeart.vue +9 -0
- package/theme/components/icons/IconInformationCircle.vue +10 -0
- package/theme/components/icons/IconLighthouse.vue +83 -0
- package/theme/components/icons/IconLine.vue +10 -0
- package/theme/components/icons/IconMarkdown.vue +13 -0
- package/theme/components/icons/IconMenu.vue +12 -0
- package/theme/components/icons/IconMenuAlt.vue +10 -0
- package/theme/components/icons/IconMinus.vue +10 -0
- package/theme/components/icons/IconMoon.vue +10 -0
- package/theme/components/icons/IconNuxt.vue +14 -0
- package/theme/components/icons/IconNuxtContent.vue +20 -0
- package/theme/components/icons/IconNuxtLabs.vue +21 -0
- package/theme/components/icons/IconPlus.vue +10 -0
- package/theme/components/icons/IconPuzzle.vue +8 -0
- package/theme/components/icons/IconSSG.vue +7 -0
- package/theme/components/icons/IconSearch.vue +12 -0
- package/theme/components/icons/IconSun.vue +10 -0
- package/theme/components/icons/IconTailwind.vue +3 -0
- package/theme/components/icons/IconTocBack.vue +21 -0
- package/theme/components/icons/IconTocCurrent.vue +21 -0
- package/theme/components/icons/IconTocNext.vue +8 -0
- package/theme/components/icons/IconTranslate.vue +14 -0
- package/theme/components/icons/IconTwitter.vue +8 -0
- package/theme/components/icons/IconVite.vue +30 -0
- package/theme/components/icons/IconVue.vue +6 -0
- package/theme/components/icons/IconVueTelescope.vue +11 -0
- package/theme/components/icons/IconWindi.vue +17 -0
- package/theme/components/icons/IconX.vue +12 -0
- package/theme/components/icons/IconXCircle.vue +10 -0
- package/theme/components/icons/IconZap.vue +8 -0
- package/theme/components/prose/ProseA.vue +66 -0
- package/theme/components/prose/ProseBlockquote.vue +21 -0
- package/theme/components/prose/ProseCode.vue +67 -0
- package/theme/components/prose/ProseCodeInline.vue +38 -0
- package/theme/components/prose/ProseEm.vue +11 -0
- package/theme/components/prose/ProseH1.vue +22 -0
- package/theme/components/prose/ProseH2.vue +22 -0
- package/theme/components/prose/ProseH3.vue +24 -0
- package/theme/components/prose/ProseH4.vue +24 -0
- package/theme/components/prose/ProseHr.vue +13 -0
- package/theme/components/prose/ProseImg.vue +30 -0
- package/theme/components/prose/ProseLi.vue +31 -0
- package/theme/components/prose/ProseOl.vue +16 -0
- package/theme/components/prose/ProseP.vue +14 -0
- package/theme/components/prose/ProseStrong.vue +14 -0
- package/theme/components/prose/ProseTable.vue +13 -0
- package/{dist/runtime/app → theme}/components/prose/ProseTbody.vue +0 -0
- package/theme/components/prose/ProseTd.vue +11 -0
- package/theme/components/prose/ProseTh.vue +11 -0
- package/theme/components/prose/ProseThead.vue +11 -0
- package/theme/components/prose/ProseTr.vue +11 -0
- package/theme/components/prose/ProseUl.vue +15 -0
- package/theme/composables/useDocus.ts +43 -0
- package/theme/composables/useMenu.ts +7 -0
- package/theme/composables/useScrollToHeading.ts +35 -0
- package/theme/composables/useScrollspy.ts +46 -0
- package/theme/composables/useUserAgent.ts +7 -0
- package/theme/composables/utils.ts +4 -0
- package/theme/layouts/default.vue +29 -0
- package/theme/layouts/page.vue +19 -0
- package/theme/middleware/components.ts +26 -0
- package/theme/middleware/navigation.global.ts +12 -0
- package/theme/middleware/page.ts +8 -0
- package/theme/middleware/theme.global.ts +12 -0
- package/theme/nuxt.config.ts +171 -0
- package/theme/pages/[...slug].vue +64 -0
- package/theme/plugins/menu.ts +67 -0
- package/theme/plugins/user-agent.ts +27 -0
- package/theme/utils/components.ts +25 -0
- package/theme/utils/navigation.ts +49 -0
- package/theme/utils/plugin.ts +21 -0
- package/theme/utils/queries.ts +68 -0
- package/theme/utils/state.ts +33 -0
- package/theme/utils/theme.ts +66 -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,215 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
module.exports = void 0;
|
|
8
|
-
|
|
9
|
-
var _vue = _interopRequireDefault(require("vue"));
|
|
10
|
-
|
|
11
|
-
var _scule = require("scule");
|
|
12
|
-
|
|
13
|
-
var _propertyInformation = require("property-information");
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
const rootKeys = ["class-name", "class", "className", "style"];
|
|
18
|
-
const rxOn = /^@|^v-on:/;
|
|
19
|
-
const rxBind = /^:|^v-bind:/;
|
|
20
|
-
const rxModel = /^v-model/;
|
|
21
|
-
const nativeInputs = ["select", "textarea", "input"];
|
|
22
|
-
|
|
23
|
-
const number = d => +d;
|
|
24
|
-
|
|
25
|
-
const trim = d => d.trim();
|
|
26
|
-
|
|
27
|
-
const noop = d => d;
|
|
28
|
-
|
|
29
|
-
const lazyComponents = new Set();
|
|
30
|
-
|
|
31
|
-
function valueInContext(code, context) {
|
|
32
|
-
return code.split(".").reduce((o, k) => o && o[k], context);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function evalInContext(code, context) {
|
|
36
|
-
let result = valueInContext(code, context);
|
|
37
|
-
|
|
38
|
-
if (typeof result === "undefined") {
|
|
39
|
-
try {
|
|
40
|
-
result = JSON.parse(code);
|
|
41
|
-
} catch (e) {
|
|
42
|
-
console.error(`Error evaluating ${code}`, e);
|
|
43
|
-
result = code;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return result;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function propsToData(node, doc) {
|
|
51
|
-
const {
|
|
52
|
-
tag = "",
|
|
53
|
-
props = {}
|
|
54
|
-
} = node;
|
|
55
|
-
return Object.keys(props).reduce(function (data, key) {
|
|
56
|
-
const k = key.replace(/.*:/, "");
|
|
57
|
-
let obj = rootKeys.includes(k) ? data : data.attrs;
|
|
58
|
-
const value = props[key];
|
|
59
|
-
const {
|
|
60
|
-
attribute
|
|
61
|
-
} = (0, _propertyInformation.find)(_propertyInformation.html, key);
|
|
62
|
-
const native = nativeInputs.includes(tag);
|
|
63
|
-
|
|
64
|
-
if (rxModel.test(key) && value in doc && !native) {
|
|
65
|
-
const mods = key.replace(rxModel, "").split(".").filter(d => d).reduce((d, k2) => {
|
|
66
|
-
d[k2] = true;
|
|
67
|
-
return d;
|
|
68
|
-
}, {});
|
|
69
|
-
const field = "value";
|
|
70
|
-
const event = mods.lazy ? "change" : "input";
|
|
71
|
-
const processor = mods.number ? number : mods.trim ? trim : noop;
|
|
72
|
-
obj[field] = evalInContext(value, doc);
|
|
73
|
-
data.on = data.on || {};
|
|
74
|
-
|
|
75
|
-
data.on[event] = e => doc[value] = processor(e);
|
|
76
|
-
} else if (key === "v-bind") {
|
|
77
|
-
const val = evalInContext(value, doc);
|
|
78
|
-
obj = Object.assign(obj, val);
|
|
79
|
-
} else if (rxOn.test(key)) {
|
|
80
|
-
key = key.replace(rxOn, "");
|
|
81
|
-
data.on = data.on || {};
|
|
82
|
-
|
|
83
|
-
data.on[key] = () => evalInContext(value, doc);
|
|
84
|
-
} else if (rxBind.test(key)) {
|
|
85
|
-
key = key.replace(rxBind, "");
|
|
86
|
-
obj[key] = evalInContext(value, doc);
|
|
87
|
-
} else if (Array.isArray(value)) {
|
|
88
|
-
obj[attribute] = value.join(" ");
|
|
89
|
-
} else if (typeof value === "string") {
|
|
90
|
-
obj[attribute] = valueInContext(value, doc) || value;
|
|
91
|
-
} else {
|
|
92
|
-
obj[attribute] = value;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return data;
|
|
96
|
-
}, {
|
|
97
|
-
attrs: {}
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function slotsToData(node, h, doc) {
|
|
102
|
-
const data = {};
|
|
103
|
-
const children = node.children || [];
|
|
104
|
-
children.forEach(child => {
|
|
105
|
-
if (!isTemplate(child) || isDefaultTemplate(child)) return;
|
|
106
|
-
data.scopedSlots = data.scopedSlots || {};
|
|
107
|
-
const template = child;
|
|
108
|
-
const name = getSlotName(template);
|
|
109
|
-
const vDomTree = template.content.map(tmplNode => processNode(tmplNode, h, doc));
|
|
110
|
-
|
|
111
|
-
data.scopedSlots[name] = function () {
|
|
112
|
-
return vDomTree;
|
|
113
|
-
};
|
|
114
|
-
});
|
|
115
|
-
return data;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function processNode(node, h, doc) {
|
|
119
|
-
if (node.type === "text") return node.value;
|
|
120
|
-
const slotData = slotsToData(node || {}, h, doc);
|
|
121
|
-
const propData = propsToData(node || {}, doc);
|
|
122
|
-
const data = Object.assign({}, slotData, propData);
|
|
123
|
-
const children = [];
|
|
124
|
-
|
|
125
|
-
for (const child of node.children) {
|
|
126
|
-
if (isTemplate(child) && !isDefaultTemplate(child)) continue;
|
|
127
|
-
const processQueue = isDefaultTemplate(child) ? child.content : [child];
|
|
128
|
-
children.push(...processQueue.map(node2 => processNode(node2, h, doc)));
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (process.server && typeof _vue.default.component((0, _scule.pascalCase)(node.tag)) === "function") {
|
|
132
|
-
lazyComponents.add((0, _scule.pascalCase)(node.tag));
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return h(node.tag, data, children);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const DEFAULT_SLOT = "default";
|
|
139
|
-
|
|
140
|
-
function isDefaultTemplate(node) {
|
|
141
|
-
return isTemplate(node) && getSlotName(node) === DEFAULT_SLOT;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function isTemplate(node) {
|
|
145
|
-
return node.tag === "template";
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function getSlotName(node) {
|
|
149
|
-
let name = "";
|
|
150
|
-
|
|
151
|
-
for (const propName of Object.keys(node.props || {})) {
|
|
152
|
-
if (!propName.startsWith("#") && !propName.startsWith("v-slot:")) continue;
|
|
153
|
-
name = propName.split(/[:#]/, 2)[1];
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
return name || DEFAULT_SLOT;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
var _default = {
|
|
161
|
-
name: "DocusContent",
|
|
162
|
-
functional: true,
|
|
163
|
-
props: {
|
|
164
|
-
document: {
|
|
165
|
-
type: [Object, String],
|
|
166
|
-
required: true
|
|
167
|
-
},
|
|
168
|
-
tag: {
|
|
169
|
-
type: String,
|
|
170
|
-
default: void 0
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
render(h, {
|
|
175
|
-
data,
|
|
176
|
-
props,
|
|
177
|
-
parent,
|
|
178
|
-
_v
|
|
179
|
-
}) {
|
|
180
|
-
const {
|
|
181
|
-
tag,
|
|
182
|
-
document
|
|
183
|
-
} = props;
|
|
184
|
-
if (!document) return;
|
|
185
|
-
if (typeof document === "string") return _v(document);
|
|
186
|
-
let body = document.body || document;
|
|
187
|
-
body = body.ast || body;
|
|
188
|
-
let classes = [];
|
|
189
|
-
|
|
190
|
-
if (Array.isArray(data.class)) {
|
|
191
|
-
classes = data.class;
|
|
192
|
-
} else if (typeof data.class === "object") {
|
|
193
|
-
const keys = Object.keys(data.class);
|
|
194
|
-
classes = keys.filter(key => data.class[key]);
|
|
195
|
-
} else {
|
|
196
|
-
classes = [data.class];
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
data.class = classes;
|
|
200
|
-
data.props = Object.assign({ ...body.props
|
|
201
|
-
}, data.props);
|
|
202
|
-
const children = (body.children || []).map(child => processNode(child, h, document));
|
|
203
|
-
|
|
204
|
-
if (process.server) {
|
|
205
|
-
;
|
|
206
|
-
parent.$root.context.beforeSerialize(nuxtState => {
|
|
207
|
-
if (nuxtState.fetch._lazyComponents) lazyComponents.forEach(name => nuxtState.fetch._lazyComponents.add(name));else nuxtState.fetch._lazyComponents = lazyComponents;
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
return h(tag || body.tag || "div", data, children);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
};
|
|
215
|
-
module.exports = _default;</script>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { CreateElement, RenderContext } from 'vue';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
name: string;
|
|
4
|
-
functional: boolean;
|
|
5
|
-
props: {
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
document: {
|
|
10
|
-
type: (StringConstructor | ObjectConstructor)[];
|
|
11
|
-
required: boolean;
|
|
12
|
-
};
|
|
13
|
-
tag: {
|
|
14
|
-
type: StringConstructor;
|
|
15
|
-
default: any;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
render(h: CreateElement, { data, props, parent, _v }: RenderContext<import("vue/types/options").DefaultProps> & {
|
|
19
|
-
_v: any;
|
|
20
|
-
}): any;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* DocusContent component
|
|
24
|
-
*/
|
|
25
|
-
export default _default;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>{{ error.message }}</div>
|
|
3
|
-
</template>
|
|
4
|
-
<script>
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
module.exports = void 0;
|
|
11
|
-
var _default = {
|
|
12
|
-
props: {
|
|
13
|
-
error: {
|
|
14
|
-
type: Object,
|
|
15
|
-
required: true
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
module.exports = _default;</script>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
module.exports = void 0;
|
|
8
|
-
|
|
9
|
-
var _utils = require("@docus/mdc/utils");
|
|
10
|
-
|
|
11
|
-
var _default = {
|
|
12
|
-
name: "Markdown",
|
|
13
|
-
functional: true,
|
|
14
|
-
props: {
|
|
15
|
-
use: {
|
|
16
|
-
type: [String, Object, Function, Array],
|
|
17
|
-
default: "default"
|
|
18
|
-
},
|
|
19
|
-
unwrap: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: ""
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
render: (_, ctx) => {
|
|
25
|
-
const slot = ctx.props.use || "default";
|
|
26
|
-
let node = typeof slot === "string" ? ctx.parent.$scopedSlots[slot] || ctx.parent.$slots[slot] || ctx.parent.$parent?.$scopedSlots[slot] || ctx.parent.$parent?.$slots[slot] : slot;
|
|
27
|
-
if (typeof node === "function") node = node();
|
|
28
|
-
if (typeof node === "string") return [node];
|
|
29
|
-
|
|
30
|
-
if (node && ctx.props.unwrap) {
|
|
31
|
-
const tags = (0, _utils.expandTags)(ctx.props.unwrap.split(/[,\s]/), ctx.parent.$config.$docus.tagMap);
|
|
32
|
-
const first = Array.isArray(node) && node[0];
|
|
33
|
-
const requireSplitor = ctx.scopedSlots.between && first && !first.text && !["span", "strong", "em", "a", "code"].some(tag => (0, _utils.isTag)(first, tag));
|
|
34
|
-
|
|
35
|
-
if (requireSplitor) {
|
|
36
|
-
node = node.flatMap((n, i) => i === 0 ? (0, _utils.unwrap)(n, tags) : [ctx.scopedSlots.between(), (0, _utils.unwrap)(n, tags)]);
|
|
37
|
-
} else {
|
|
38
|
-
node = (0, _utils.flatUnwrap)(node, tags);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (Array.isArray(node) && node.length > 1 && (ctx.data.staticClass || ctx.data.class)) {
|
|
43
|
-
console.warn("Markdown: `class` prop is ignored because there is multiple elements on component root.");
|
|
44
|
-
console.warn("Markdown: This is likely to happen when you use `unwrap` attribute.");
|
|
45
|
-
} else {
|
|
46
|
-
const tmpNode = Array.isArray(node) ? node[0] : node;
|
|
47
|
-
|
|
48
|
-
if (tmpNode?.data) {
|
|
49
|
-
Object.assign(tmpNode.data, ctx.data);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return node;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
module.exports = _default;</script>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
name: string;
|
|
3
|
-
functional: boolean;
|
|
4
|
-
props: {
|
|
5
|
-
/**
|
|
6
|
-
* A slot name or function
|
|
7
|
-
*/
|
|
8
|
-
use: {
|
|
9
|
-
type: (StringConstructor | ArrayConstructor | ObjectConstructor | FunctionConstructor)[];
|
|
10
|
-
default: string;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
unwrap: {
|
|
16
|
-
type: StringConstructor;
|
|
17
|
-
default: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
render: (_: any, ctx: any) => any;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Markdown component
|
|
24
|
-
*/
|
|
25
|
-
export default _default;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<DocusContent :document="page" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script>
|
|
6
|
-
"use strict";
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "__esModule", {
|
|
9
|
-
value: true
|
|
10
|
-
});
|
|
11
|
-
module.exports = void 0;
|
|
12
|
-
|
|
13
|
-
var _app = require("#app");
|
|
14
|
-
|
|
15
|
-
var _default = (0, _app.defineComponent)({
|
|
16
|
-
props: {
|
|
17
|
-
page: {
|
|
18
|
-
type: Object,
|
|
19
|
-
required: true
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
templateOptions: {
|
|
23
|
-
aside: false,
|
|
24
|
-
asideClass: "",
|
|
25
|
-
fluid: false
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
module.exports = _default;</script>
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ProseTable v-if="component">
|
|
3
|
-
<ProseThead>
|
|
4
|
-
<ProseTr>
|
|
5
|
-
<ProseTh>Prop</ProseTh>
|
|
6
|
-
<ProseTh>Type</ProseTh>
|
|
7
|
-
<ProseTh v-if="showRequired">Required</ProseTh>
|
|
8
|
-
<ProseTh v-if="showDefault">Default</ProseTh>
|
|
9
|
-
<ProseTh v-if="showValues">Values</ProseTh>
|
|
10
|
-
<ProseTh v-if="showDescription">Description</ProseTh>
|
|
11
|
-
</ProseTr>
|
|
12
|
-
</ProseThead>
|
|
13
|
-
<ProseTbody>
|
|
14
|
-
<ProseTr v-for="prop in properties" :key="prop.name">
|
|
15
|
-
<ProseTd>
|
|
16
|
-
<ProseCodeInline>{{ prop.name }}</ProseCodeInline>
|
|
17
|
-
</ProseTd>
|
|
18
|
-
<ProseTd>
|
|
19
|
-
<ProseCodeInline>{{ prop.type.join(' | ') }}</ProseCodeInline>
|
|
20
|
-
</ProseTd>
|
|
21
|
-
<ProseTd v-if="showRequired">{{ prop.required ? 'Yes' : 'No' }}</ProseTd>
|
|
22
|
-
<ProseTd v-if="showDefault">
|
|
23
|
-
<ProseCodeInline v-if="prop.default">{{ prop.default }}</ProseCodeInline>
|
|
24
|
-
</ProseTd>
|
|
25
|
-
<ProseTd v-if="showValues">
|
|
26
|
-
<ProseCodeInline v-if="prop.values">{{
|
|
27
|
-
prop.values && JSON.stringify(prop.values).replace(/,/g, ', ')
|
|
28
|
-
}}</ProseCodeInline>
|
|
29
|
-
<span v-else>-</span>
|
|
30
|
-
</ProseTd>
|
|
31
|
-
<ProseTd v-if="showDescription">
|
|
32
|
-
<div v-html="prop.description"></div>
|
|
33
|
-
</ProseTd>
|
|
34
|
-
</ProseTr>
|
|
35
|
-
</ProseTbody>
|
|
36
|
-
</ProseTable>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<script>
|
|
40
|
-
"use strict";
|
|
41
|
-
|
|
42
|
-
Object.defineProperty(exports, "__esModule", {
|
|
43
|
-
value: true
|
|
44
|
-
});
|
|
45
|
-
module.exports = void 0;
|
|
46
|
-
|
|
47
|
-
var _compositionApi = require("@vue/composition-api");
|
|
48
|
-
|
|
49
|
-
var _nuxtComponentMeta = require("nuxt-component-meta");
|
|
50
|
-
|
|
51
|
-
var _default = (0, _compositionApi.defineComponent)({
|
|
52
|
-
props: {
|
|
53
|
-
of: {
|
|
54
|
-
type: String,
|
|
55
|
-
required: true
|
|
56
|
-
},
|
|
57
|
-
required: {
|
|
58
|
-
type: Boolean,
|
|
59
|
-
default: undefined,
|
|
60
|
-
description: 'Toggle required column.'
|
|
61
|
-
},
|
|
62
|
-
values: {
|
|
63
|
-
type: Boolean,
|
|
64
|
-
default: undefined,
|
|
65
|
-
description: 'Toggle values column.'
|
|
66
|
-
},
|
|
67
|
-
description: {
|
|
68
|
-
type: Boolean,
|
|
69
|
-
default: undefined,
|
|
70
|
-
description: 'Toggle description column.'
|
|
71
|
-
},
|
|
72
|
-
default: {
|
|
73
|
-
type: Boolean,
|
|
74
|
-
default: undefined,
|
|
75
|
-
description: 'Toggle default column.'
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
setup(props) {
|
|
80
|
-
const component = (0, _compositionApi.computed)(() => (0, _nuxtComponentMeta.getComponent)(props.of));
|
|
81
|
-
const properties = (0, _compositionApi.computed)(() => component.value.props.map(prop => ({
|
|
82
|
-
name: prop.name,
|
|
83
|
-
type: prop.type,
|
|
84
|
-
default: prop.default,
|
|
85
|
-
required: prop.required,
|
|
86
|
-
values: prop.values,
|
|
87
|
-
description: prop.description,
|
|
88
|
-
internal: prop.internal
|
|
89
|
-
})).filter(prop => prop.internal !== true));
|
|
90
|
-
const showRequired = (0, _compositionApi.computed)(() => {
|
|
91
|
-
if (props.required !== undefined) {
|
|
92
|
-
return props.required;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return properties.value?.find(prop => prop.required !== undefined);
|
|
96
|
-
});
|
|
97
|
-
const showValues = (0, _compositionApi.computed)(() => {
|
|
98
|
-
if (props.values !== undefined) {
|
|
99
|
-
return props.values;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return properties.value?.find(prop => prop.values);
|
|
103
|
-
});
|
|
104
|
-
const showDescription = (0, _compositionApi.computed)(() => {
|
|
105
|
-
if (props.description !== undefined) {
|
|
106
|
-
return props.description;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return properties.value?.find(prop => prop.description);
|
|
110
|
-
});
|
|
111
|
-
const showDefault = (0, _compositionApi.computed)(() => {
|
|
112
|
-
if (props.default !== undefined) {
|
|
113
|
-
return props.default;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return properties.value?.find(prop => prop.default);
|
|
117
|
-
});
|
|
118
|
-
return {
|
|
119
|
-
component,
|
|
120
|
-
properties,
|
|
121
|
-
showRequired,
|
|
122
|
-
showValues,
|
|
123
|
-
showDescription,
|
|
124
|
-
showDefault
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
module.exports = _default;</script>
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
declare var _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
2
|
-
component: import("@vue/composition-api").ComputedRef<import("nuxt-component-meta").ComponentMeta>;
|
|
3
|
-
properties: import("@vue/composition-api").ComputedRef<{
|
|
4
|
-
name: string;
|
|
5
|
-
type: string[];
|
|
6
|
-
default: string;
|
|
7
|
-
required: boolean;
|
|
8
|
-
values: string[];
|
|
9
|
-
description: string;
|
|
10
|
-
internal: any;
|
|
11
|
-
}[]>;
|
|
12
|
-
showRequired: import("@vue/composition-api").ComputedRef<any>;
|
|
13
|
-
showValues: import("@vue/composition-api").ComputedRef<any>;
|
|
14
|
-
showDescription: import("@vue/composition-api").ComputedRef<any>;
|
|
15
|
-
showDefault: import("@vue/composition-api").ComputedRef<any>;
|
|
16
|
-
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
17
|
-
of: {
|
|
18
|
-
type: StringConstructor;
|
|
19
|
-
required: true;
|
|
20
|
-
};
|
|
21
|
-
required: {
|
|
22
|
-
type: BooleanConstructor;
|
|
23
|
-
default: any;
|
|
24
|
-
description: string;
|
|
25
|
-
};
|
|
26
|
-
values: {
|
|
27
|
-
type: BooleanConstructor;
|
|
28
|
-
default: any;
|
|
29
|
-
description: string;
|
|
30
|
-
};
|
|
31
|
-
description: {
|
|
32
|
-
type: BooleanConstructor;
|
|
33
|
-
default: any;
|
|
34
|
-
description: string;
|
|
35
|
-
};
|
|
36
|
-
default: {
|
|
37
|
-
type: BooleanConstructor;
|
|
38
|
-
default: any;
|
|
39
|
-
description: string;
|
|
40
|
-
};
|
|
41
|
-
}, {
|
|
42
|
-
default: boolean;
|
|
43
|
-
of: string;
|
|
44
|
-
required: boolean;
|
|
45
|
-
description: boolean;
|
|
46
|
-
values: boolean;
|
|
47
|
-
} & {}> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
48
|
-
default: boolean;
|
|
49
|
-
of: string;
|
|
50
|
-
required: boolean;
|
|
51
|
-
description: boolean;
|
|
52
|
-
values: boolean;
|
|
53
|
-
} & {}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
54
|
-
component: import("@vue/composition-api").ComputedRef<import("nuxt-component-meta").ComponentMeta>;
|
|
55
|
-
properties: import("@vue/composition-api").ComputedRef<{
|
|
56
|
-
name: string;
|
|
57
|
-
type: string[];
|
|
58
|
-
default: string;
|
|
59
|
-
required: boolean;
|
|
60
|
-
values: string[];
|
|
61
|
-
description: string;
|
|
62
|
-
internal: any;
|
|
63
|
-
}[]>;
|
|
64
|
-
showRequired: import("@vue/composition-api").ComputedRef<any>;
|
|
65
|
-
showValues: import("@vue/composition-api").ComputedRef<any>;
|
|
66
|
-
showDescription: import("@vue/composition-api").ComputedRef<any>;
|
|
67
|
-
showDefault: import("@vue/composition-api").ComputedRef<any>;
|
|
68
|
-
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
|
|
69
|
-
default: boolean;
|
|
70
|
-
of: string;
|
|
71
|
-
required: boolean;
|
|
72
|
-
description: boolean;
|
|
73
|
-
values: boolean;
|
|
74
|
-
} & {}, {
|
|
75
|
-
default: boolean;
|
|
76
|
-
required: boolean;
|
|
77
|
-
description: boolean;
|
|
78
|
-
values: boolean;
|
|
79
|
-
}, true>);
|
|
80
|
-
export default _default;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a v-if="remote || static" target="blank" :href="href"><slot /></a>
|
|
3
|
-
<NuxtLink v-else :to="href" :target="blank" :static="static">
|
|
4
|
-
<!-- TODO: implement static & remote logic -->
|
|
5
|
-
<slot />
|
|
6
|
-
</NuxtLink>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
"use strict";
|
|
11
|
-
|
|
12
|
-
Object.defineProperty(exports, "__esModule", {
|
|
13
|
-
value: true
|
|
14
|
-
});
|
|
15
|
-
module.exports = void 0;
|
|
16
|
-
|
|
17
|
-
var _ufo = require("ufo");
|
|
18
|
-
|
|
19
|
-
var _default = {
|
|
20
|
-
props: {
|
|
21
|
-
href: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: ""
|
|
24
|
-
},
|
|
25
|
-
blank: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
default: false
|
|
28
|
-
},
|
|
29
|
-
static: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: false
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
computed: {
|
|
35
|
-
remote() {
|
|
36
|
-
return (0, _ufo.hasProtocol)(this.href, true);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
module.exports = _default;</script>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
props: {
|
|
3
|
-
href: {
|
|
4
|
-
type: StringConstructor;
|
|
5
|
-
default: string;
|
|
6
|
-
};
|
|
7
|
-
blank: {
|
|
8
|
-
type: BooleanConstructor;
|
|
9
|
-
default: boolean;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* `true` if `href` points to a static file
|
|
13
|
-
*/
|
|
14
|
-
static: {
|
|
15
|
-
type: BooleanConstructor;
|
|
16
|
-
default: boolean;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
computed: {
|
|
20
|
-
remote(): boolean;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export default _default;
|