vuepress-plugin-md-power 1.0.0-rc.94 → 1.0.0-rc.96

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.
@@ -5,15 +5,6 @@ function useSize(options, extraHeight = 0) {
5
5
  const el = shallowRef();
6
6
  const width = computed(() => toValue(options.width) || "100%");
7
7
  const height = ref("auto");
8
- const getRadio = (ratio) => {
9
- if (typeof ratio === "string") {
10
- const [width2, height2] = ratio.split(":");
11
- const parsedRadio = Number(width2) / Number(height2);
12
- if (!Number.isNaN(parsedRadio))
13
- return parsedRadio;
14
- }
15
- return typeof ratio === "number" ? ratio : 16 / 9;
16
- };
17
8
  const getHeight = (width2) => {
18
9
  const height2 = toValue(options.height);
19
10
  const ratio = getRadio(toValue(options.ratio));
@@ -32,6 +23,15 @@ function useSize(options, extraHeight = 0) {
32
23
  });
33
24
  return { el, width, height, resize };
34
25
  }
26
+ function getRadio(ratio) {
27
+ if (typeof ratio === "string") {
28
+ const [width, height] = ratio.split(":");
29
+ const parsedRadio = Number(width) / Number(height);
30
+ if (!Number.isNaN(parsedRadio))
31
+ return parsedRadio;
32
+ }
33
+ return typeof ratio === "number" ? ratio : 16 / 9;
34
+ }
35
35
  export {
36
36
  useSize
37
37
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vuepress-plugin-md-power",
3
3
  "type": "module",
4
- "version": "1.0.0-rc.94",
4
+ "version": "1.0.0-rc.96",
5
5
  "description": "The Plugin for VuePress 2 - markdown power",
6
6
  "author": "pengzhanbo <volodymyr@foxmail.com>",
7
7
  "license": "MIT",
@@ -38,10 +38,10 @@
38
38
  "@vueuse/core": "^11.0.3",
39
39
  "markdown-it-container": "^4.0.0",
40
40
  "nanoid": "^5.0.7",
41
- "shiki": "^1.16.1",
42
- "tm-grammars": "^1.17.14",
41
+ "shiki": "^1.16.2",
42
+ "tm-grammars": "^1.17.16",
43
43
  "tm-themes": "^1.8.1",
44
- "vue": "^3.5.0"
44
+ "vue": "^3.5.2"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/markdown-it": "^14.1.2"