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.
Files changed (72) hide show
  1. package/README.md +26 -4
  2. package/README.zh-CN.md +5 -1
  3. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/asyncToGenerator.mjs +27 -0
  4. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.mjs +12 -0
  5. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectSpread2.mjs +25 -0
  6. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutProperties.mjs +13 -0
  7. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutPropertiesLoose.mjs +12 -0
  8. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPrimitive.mjs +14 -0
  9. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPropertyKey.mjs +9 -0
  10. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/typeof.mjs +11 -0
  11. package/es/hooks/use-element/index.mjs +21 -18
  12. package/es/hooks/use-scroll-element/index.mjs +44 -45
  13. package/es/index.mjs +7 -18
  14. package/es/markdown/Markdown.mjs +221 -316
  15. package/es/markdown/index.css +3 -0
  16. package/es/markdown/index2.mjs +6 -0
  17. package/es/render/Render.mjs +143 -173
  18. package/es/render/index.css +37 -21
  19. package/es/render/index2.mjs +6 -0
  20. package/es/search/Search.mjs +236 -284
  21. package/es/search/index.css +4 -0
  22. package/es/search/index2.mjs +6 -0
  23. package/es/sticky/Sticky.mjs +66 -99
  24. package/es/sticky/index2.mjs +6 -0
  25. package/es/toc/Toc.mjs +253 -347
  26. package/es/toc/index2.mjs +6 -0
  27. package/es/utils/constant.mjs +4 -4
  28. package/es/utils/dom.mjs +44 -68
  29. package/es/utils/format.mjs +33 -39
  30. package/es/utils/functions.mjs +5 -5
  31. package/es/utils/vue.mjs +10 -32
  32. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/asyncToGenerator.js +27 -0
  33. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.js +12 -0
  34. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectSpread2.js +25 -0
  35. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutProperties.js +13 -0
  36. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutPropertiesLoose.js +12 -0
  37. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPrimitive.js +14 -0
  38. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPropertyKey.js +9 -0
  39. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/typeof.js +16 -0
  40. package/lib/_virtual/_rolldown/runtime.js +23 -0
  41. package/lib/hooks/use-element/index.js +23 -19
  42. package/lib/hooks/use-scroll-element/index.js +45 -45
  43. package/lib/index.js +24 -22
  44. package/lib/markdown/Markdown.js +224 -317
  45. package/lib/markdown/index.css +3 -0
  46. package/lib/markdown/index2.js +6 -0
  47. package/lib/render/Render.js +152 -176
  48. package/lib/render/index.css +37 -21
  49. package/lib/render/index2.js +6 -0
  50. package/lib/search/Search.js +242 -286
  51. package/lib/search/index.css +4 -0
  52. package/lib/search/index2.js +6 -0
  53. package/lib/sticky/Sticky.js +68 -99
  54. package/lib/sticky/index2.js +6 -0
  55. package/lib/toc/Toc.js +259 -349
  56. package/lib/toc/index2.js +6 -0
  57. package/lib/utils/constant.js +3 -3
  58. package/lib/utils/dom.js +46 -69
  59. package/lib/utils/format.js +33 -33
  60. package/lib/utils/functions.js +4 -4
  61. package/lib/utils/vue.js +10 -31
  62. package/package.json +4 -9
  63. package/es/markdown/index.mjs +0 -9
  64. package/es/render/index.mjs +0 -9
  65. package/es/search/index.mjs +0 -9
  66. package/es/sticky/index.mjs +0 -7
  67. package/es/toc/index.mjs +0 -9
  68. package/lib/markdown/index.js +0 -8
  69. package/lib/render/index.js +0 -8
  70. package/lib/search/index.js +0 -8
  71. package/lib/sticky/index.js +0 -7
  72. package/lib/toc/index.js +0 -8
@@ -1,100 +1,69 @@
1
- "use strict";
2
- require('./index.css');var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
- const vue = require("vue");
22
- ;/* empty css */
23
- const format = require("../utils/format.js");
24
- const core = require("@vueuse/core");
25
- const {
26
- name
27
- } = format.createNamespace("sticky");
28
- const _Sticky = /* @__PURE__ */ vue.defineComponent({
29
- name,
30
- props: {
31
- posY: {
32
- type: String,
33
- default: "top"
34
- },
35
- posX: {
36
- type: String,
37
- default: "left"
38
- },
39
- offset: {
40
- type: [String, Number],
41
- default: 0
42
- },
43
- flow: {
44
- type: Boolean,
45
- default: true
46
- },
47
- zIndex: {
48
- type: [String, Number],
49
- default: "var(--vmd-base-z-index)"
50
- }
51
- },
52
- setup(props, {
53
- slots
54
- }) {
55
- const wrapper = vue.shallowRef();
56
- const wrapperBounding = core.useElementBounding(wrapper);
57
- const rootStyle = vue.computed(() => {
58
- const {
59
- flow,
60
- posY,
61
- posX,
62
- zIndex,
63
- offset
64
- } = props;
65
- const base = {
66
- [posY]: format.addUnit(Number(offset)),
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
- module.exports = _Sticky;
68
+ //#endregion
69
+ exports.default = Sticky_default;
@@ -0,0 +1,6 @@
1
+ const require_vue = require("../utils/vue.js");
2
+ const require_Sticky = require("./Sticky.js");
3
+ //#region src/sticky/index.ts
4
+ var VmdSticky = require_vue.withInstall(require_Sticky.default);
5
+ //#endregion
6
+ exports.default = VmdSticky;