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.
Files changed (72) hide show
  1. package/README.md +5 -1
  2. package/README.zh-CN.md +4 -0
  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 -285
  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 -287
  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,101 +1,68 @@
1
- import './index.css';var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
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
- const {
25
- name
26
- } = createNamespace("sticky");
27
- const _Sticky = /* @__PURE__ */ defineComponent({
28
- name,
29
- props: {
30
- posY: {
31
- type: String,
32
- default: "top"
33
- },
34
- posX: {
35
- type: String,
36
- default: "left"
37
- },
38
- offset: {
39
- type: [String, Number],
40
- default: 0
41
- },
42
- flow: {
43
- type: Boolean,
44
- default: true
45
- },
46
- zIndex: {
47
- type: [String, Number],
48
- default: "var(--vmd-base-z-index)"
49
- }
50
- },
51
- setup(props, {
52
- slots
53
- }) {
54
- const wrapper = shallowRef();
55
- const wrapperBounding = useElementBounding(wrapper);
56
- const rootStyle = computed(() => {
57
- const {
58
- flow,
59
- posY,
60
- posX,
61
- zIndex,
62
- offset
63
- } = props;
64
- const base = {
65
- [posY]: addUnit(Number(offset)),
66
- zIndex
67
- };
68
- if (flow) return base;
69
- const margin = posX === "right" ? "marginLeft" : "marginRight";
70
- return __spreadProps(__spreadValues({}, base), {
71
- [margin]: "auto",
72
- width: addUnit(wrapperBounding.width.value)
73
- });
74
- });
75
- const wrapperStyle = computed(() => {
76
- const {
77
- flow,
78
- posY
79
- } = props;
80
- if (flow) return;
81
- const margin = posY === "bottom" ? "marginTop" : "marginBottom";
82
- return {
83
- [margin]: `-${addUnit(wrapperBounding.height.value)}`,
84
- display: "table"
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
- export {
100
- _Sticky as default
101
- };
67
+ //#endregion
68
+ export { Sticky_default as default };
@@ -0,0 +1,6 @@
1
+ import { withInstall } from "../utils/vue.mjs";
2
+ import Sticky_default from "./Sticky.mjs";
3
+ //#region src/sticky/index.ts
4
+ var VmdSticky = withInstall(Sticky_default);
5
+ //#endregion
6
+ export { VmdSticky as default };