vue-markdown-design 0.3.1 → 0.3.2
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 +5 -1
- package/README.zh-CN.md +4 -0
- 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 -285
- 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 -287
- 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/lib/sticky/Sticky.js
CHANGED
|
@@ -1,100 +1,69 @@
|
|
|
1
|
-
"
|
|
2
|
-
require('./index.css');
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
zIndex
|
|
68
|
-
};
|
|
69
|
-
if (flow) return base;
|
|
70
|
-
const margin = posX === "right" ? "marginLeft" : "marginRight";
|
|
71
|
-
return __spreadProps(__spreadValues({}, base), {
|
|
72
|
-
[margin]: "auto",
|
|
73
|
-
width: format.addUnit(wrapperBounding.width.value)
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
const wrapperStyle = vue.computed(() => {
|
|
77
|
-
const {
|
|
78
|
-
flow,
|
|
79
|
-
posY
|
|
80
|
-
} = props;
|
|
81
|
-
if (flow) return;
|
|
82
|
-
const margin = posY === "bottom" ? "marginTop" : "marginBottom";
|
|
83
|
-
return {
|
|
84
|
-
[margin]: `-${format.addUnit(wrapperBounding.height.value)}`,
|
|
85
|
-
display: "table"
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
|
-
return () => {
|
|
89
|
-
var _a;
|
|
90
|
-
return vue.createVNode("div", {
|
|
91
|
-
"class": name,
|
|
92
|
-
"style": rootStyle.value
|
|
93
|
-
}, [vue.createVNode("div", {
|
|
94
|
-
"ref": wrapper,
|
|
95
|
-
"style": wrapperStyle.value
|
|
96
|
-
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]);
|
|
97
|
-
};
|
|
98
|
-
}
|
|
1
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
2
|
+
require('./index.css');const require_format = require("../utils/format.js");
|
|
3
|
+
;/* empty css */
|
|
4
|
+
let vue = require("vue");
|
|
5
|
+
let _vueuse_core = require("@vueuse/core");
|
|
6
|
+
//#region src/sticky/Sticky.tsx
|
|
7
|
+
var { name } = require_format.createNamespace("sticky");
|
|
8
|
+
var Sticky_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
9
|
+
name,
|
|
10
|
+
props: {
|
|
11
|
+
posY: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "top"
|
|
14
|
+
},
|
|
15
|
+
posX: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "left"
|
|
18
|
+
},
|
|
19
|
+
offset: {
|
|
20
|
+
type: [String, Number],
|
|
21
|
+
default: 0
|
|
22
|
+
},
|
|
23
|
+
flow: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: true
|
|
26
|
+
},
|
|
27
|
+
zIndex: {
|
|
28
|
+
type: [String, Number],
|
|
29
|
+
default: "var(--vmd-base-z-index)"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
setup(props, { slots }) {
|
|
33
|
+
const wrapper = (0, vue.shallowRef)();
|
|
34
|
+
const wrapperBounding = (0, _vueuse_core.useElementBounding)(wrapper);
|
|
35
|
+
const rootStyle = (0, vue.computed)(() => {
|
|
36
|
+
const { flow, posY, posX, zIndex, offset } = props;
|
|
37
|
+
const style = {
|
|
38
|
+
[posY]: require_format.addUnit(Number(offset)),
|
|
39
|
+
zIndex
|
|
40
|
+
};
|
|
41
|
+
if (!flow) {
|
|
42
|
+
style[posX === "right" ? "marginLeft" : "marginRight"] = "auto";
|
|
43
|
+
const width = wrapperBounding.width.value;
|
|
44
|
+
if (width) style.width = require_format.addUnit(width);
|
|
45
|
+
}
|
|
46
|
+
return style;
|
|
47
|
+
});
|
|
48
|
+
const wrapperStyle = (0, vue.computed)(() => {
|
|
49
|
+
const { flow, posY } = props;
|
|
50
|
+
if (flow) return;
|
|
51
|
+
return {
|
|
52
|
+
[posY === "bottom" ? "marginTop" : "marginBottom"]: `-${require_format.addUnit(wrapperBounding.height.value)}`,
|
|
53
|
+
display: "table"
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
return () => {
|
|
57
|
+
var _slots$default;
|
|
58
|
+
return (0, vue.createVNode)("div", {
|
|
59
|
+
"class": name,
|
|
60
|
+
"style": rootStyle.value
|
|
61
|
+
}, [(0, vue.createVNode)("div", {
|
|
62
|
+
"ref": wrapper,
|
|
63
|
+
"style": wrapperStyle.value
|
|
64
|
+
}, [(_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)])]);
|
|
65
|
+
};
|
|
66
|
+
}
|
|
99
67
|
});
|
|
100
|
-
|
|
68
|
+
//#endregion
|
|
69
|
+
exports.default = Sticky_default;
|