vue-markdown-design 0.3.0 → 0.3.2-beta
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 +26 -4
- package/README.zh-CN.md +5 -1
- package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/asyncToGenerator.mjs +27 -0
- package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.mjs +12 -0
- package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectSpread2.mjs +25 -0
- package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutProperties.mjs +13 -0
- package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutPropertiesLoose.mjs +12 -0
- package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPrimitive.mjs +14 -0
- package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPropertyKey.mjs +9 -0
- package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/typeof.mjs +11 -0
- package/es/hooks/use-element/index.mjs +21 -18
- package/es/hooks/use-scroll-element/index.mjs +44 -45
- package/es/index.mjs +7 -18
- package/es/markdown/Markdown.mjs +221 -316
- package/es/markdown/index.css +3 -0
- package/es/markdown/index2.mjs +6 -0
- package/es/render/Render.mjs +143 -173
- package/es/render/index.css +37 -21
- package/es/render/index2.mjs +6 -0
- package/es/search/Search.mjs +236 -284
- package/es/search/index.css +4 -0
- package/es/search/index2.mjs +6 -0
- package/es/sticky/Sticky.mjs +66 -99
- package/es/sticky/index2.mjs +6 -0
- package/es/toc/Toc.mjs +253 -347
- package/es/toc/index2.mjs +6 -0
- package/es/utils/constant.mjs +4 -4
- package/es/utils/dom.mjs +44 -68
- package/es/utils/format.mjs +33 -39
- package/es/utils/functions.mjs +5 -5
- package/es/utils/vue.mjs +10 -32
- package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/asyncToGenerator.js +27 -0
- package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.js +12 -0
- package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectSpread2.js +25 -0
- package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutProperties.js +13 -0
- package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutPropertiesLoose.js +12 -0
- package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPrimitive.js +14 -0
- package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPropertyKey.js +9 -0
- package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/typeof.js +16 -0
- package/lib/_virtual/_rolldown/runtime.js +23 -0
- package/lib/hooks/use-element/index.js +23 -19
- package/lib/hooks/use-scroll-element/index.js +45 -45
- package/lib/index.js +24 -22
- package/lib/markdown/Markdown.js +224 -317
- package/lib/markdown/index.css +3 -0
- package/lib/markdown/index2.js +6 -0
- package/lib/render/Render.js +152 -176
- package/lib/render/index.css +37 -21
- package/lib/render/index2.js +6 -0
- package/lib/search/Search.js +242 -286
- package/lib/search/index.css +4 -0
- package/lib/search/index2.js +6 -0
- package/lib/sticky/Sticky.js +68 -99
- package/lib/sticky/index2.js +6 -0
- package/lib/toc/Toc.js +259 -349
- package/lib/toc/index2.js +6 -0
- package/lib/utils/constant.js +3 -3
- package/lib/utils/dom.js +46 -69
- package/lib/utils/format.js +33 -33
- package/lib/utils/functions.js +4 -4
- package/lib/utils/vue.js +10 -31
- package/package.json +4 -9
- package/es/markdown/index.mjs +0 -9
- package/es/render/index.mjs +0 -9
- package/es/search/index.mjs +0 -9
- package/es/sticky/index.mjs +0 -7
- package/es/toc/index.mjs +0 -9
- package/lib/markdown/index.js +0 -8
- package/lib/render/index.js +0 -8
- package/lib/search/index.js +0 -8
- package/lib/sticky/index.js +0 -7
- package/lib/toc/index.js +0 -8
package/es/sticky/Sticky.mjs
CHANGED
|
@@ -1,101 +1,68 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, shallowRef, computed, createVNode } from "vue";
|
|
21
|
-
/* empty css */
|
|
22
|
-
import { createNamespace, addUnit } from "../utils/format.mjs";
|
|
1
|
+
import { addUnit, createNamespace } from "../utils/format.mjs";
|
|
2
|
+
import './index.css';/* empty css */
|
|
3
|
+
import { computed, createVNode, defineComponent, shallowRef } from "vue";
|
|
23
4
|
import { useElementBounding } from "@vueuse/core";
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
return () => {
|
|
88
|
-
var _a;
|
|
89
|
-
return createVNode("div", {
|
|
90
|
-
"class": name,
|
|
91
|
-
"style": rootStyle.value
|
|
92
|
-
}, [createVNode("div", {
|
|
93
|
-
"ref": wrapper,
|
|
94
|
-
"style": wrapperStyle.value
|
|
95
|
-
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]);
|
|
96
|
-
};
|
|
97
|
-
}
|
|
5
|
+
//#region src/sticky/Sticky.tsx
|
|
6
|
+
var { name } = createNamespace("sticky");
|
|
7
|
+
var Sticky_default = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name,
|
|
9
|
+
props: {
|
|
10
|
+
posY: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: "top"
|
|
13
|
+
},
|
|
14
|
+
posX: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "left"
|
|
17
|
+
},
|
|
18
|
+
offset: {
|
|
19
|
+
type: [String, Number],
|
|
20
|
+
default: 0
|
|
21
|
+
},
|
|
22
|
+
flow: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
25
|
+
},
|
|
26
|
+
zIndex: {
|
|
27
|
+
type: [String, Number],
|
|
28
|
+
default: "var(--vmd-base-z-index)"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
setup(props, { slots }) {
|
|
32
|
+
const wrapper = shallowRef();
|
|
33
|
+
const wrapperBounding = useElementBounding(wrapper);
|
|
34
|
+
const rootStyle = computed(() => {
|
|
35
|
+
const { flow, posY, posX, zIndex, offset } = props;
|
|
36
|
+
const style = {
|
|
37
|
+
[posY]: addUnit(Number(offset)),
|
|
38
|
+
zIndex
|
|
39
|
+
};
|
|
40
|
+
if (!flow) {
|
|
41
|
+
style[posX === "right" ? "marginLeft" : "marginRight"] = "auto";
|
|
42
|
+
const width = wrapperBounding.width.value;
|
|
43
|
+
if (width) style.width = addUnit(width);
|
|
44
|
+
}
|
|
45
|
+
return style;
|
|
46
|
+
});
|
|
47
|
+
const wrapperStyle = computed(() => {
|
|
48
|
+
const { flow, posY } = props;
|
|
49
|
+
if (flow) return;
|
|
50
|
+
return {
|
|
51
|
+
[posY === "bottom" ? "marginTop" : "marginBottom"]: `-${addUnit(wrapperBounding.height.value)}`,
|
|
52
|
+
display: "table"
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
return () => {
|
|
56
|
+
var _slots$default;
|
|
57
|
+
return createVNode("div", {
|
|
58
|
+
"class": name,
|
|
59
|
+
"style": rootStyle.value
|
|
60
|
+
}, [createVNode("div", {
|
|
61
|
+
"ref": wrapper,
|
|
62
|
+
"style": wrapperStyle.value
|
|
63
|
+
}, [(_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)])]);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
98
66
|
});
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
};
|
|
67
|
+
//#endregion
|
|
68
|
+
export { Sticky_default as default };
|