@scalar/components 0.19.8 → 0.19.9
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/dist/components/ScalarMarkdown/ScalarMarkdown.vue.d.ts.map +1 -1
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.js +13 -11
- package/dist/components/ScalarMarkdown/types.d.ts +3 -2
- package/dist/components/ScalarMarkdown/types.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarMarkdown.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarMarkdown/ScalarMarkdown.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarMarkdown.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarMarkdown/ScalarMarkdown.vue"],"names":[],"mappings":"AAkqBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AA2FlD,QAAA,MAAM,YAAY;;4PAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { htmlFromMarkdown as x } from "@scalar/code-highlight";
|
|
3
|
-
import { useBindCx as
|
|
4
|
-
const v = ["innerHTML"],
|
|
1
|
+
import { defineComponent as f, useTemplateRef as l, computed as u, createElementBlock as h, openBlock as d, mergeProps as g, unref as w } from "vue";
|
|
2
|
+
import { htmlFromMarkdown as x, isHeading as T, textFromNode as y } from "@scalar/code-highlight";
|
|
3
|
+
import { useBindCx as k } from "@scalar/use-hooks/useBindCx";
|
|
4
|
+
const v = ["innerHTML"], A = /* @__PURE__ */ f({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "ScalarMarkdown",
|
|
7
7
|
props: {
|
|
@@ -13,16 +13,18 @@ const v = ["innerHTML"], B = /* @__PURE__ */ s({
|
|
|
13
13
|
clamp: {},
|
|
14
14
|
anchorPrefix: {}
|
|
15
15
|
},
|
|
16
|
-
setup(e, { expose:
|
|
17
|
-
const { cx:
|
|
18
|
-
|
|
16
|
+
setup(e, { expose: a }) {
|
|
17
|
+
const { cx: n } = k(), m = l("div");
|
|
18
|
+
a({ el: m });
|
|
19
19
|
const o = (t) => {
|
|
20
20
|
if (!e.withAnchors)
|
|
21
21
|
return e.transform?.(t) || t;
|
|
22
|
-
|
|
22
|
+
if (!T(t))
|
|
23
|
+
return t;
|
|
24
|
+
const r = y(t).toLowerCase().replace(/\s+/g, "-"), s = e.anchorPrefix ? `${e.anchorPrefix}/description/${r}` : r;
|
|
23
25
|
return t.data = {
|
|
24
26
|
hProperties: {
|
|
25
|
-
id:
|
|
27
|
+
id: s
|
|
26
28
|
}
|
|
27
29
|
}, e.transform ? e.transform(t) : t;
|
|
28
30
|
}, i = u(() => x(e.value ?? "", {
|
|
@@ -30,12 +32,12 @@ const v = ["innerHTML"], B = /* @__PURE__ */ s({
|
|
|
30
32
|
transform: e.withAnchors && e.transformType === "heading" ? o : e.transform,
|
|
31
33
|
transformType: e.transformType
|
|
32
34
|
}));
|
|
33
|
-
return (t, c) => (d(), h("div", g({ ref: "div" }, w(
|
|
35
|
+
return (t, c) => (d(), h("div", g({ ref: "div" }, w(n)("markdown", { "line-clamp-(--markdown-clamp)": !!e.clamp }), {
|
|
34
36
|
style: { "--markdown-clamp": e.clamp },
|
|
35
37
|
innerHTML: i.value
|
|
36
38
|
}), null, 16, v));
|
|
37
39
|
}
|
|
38
40
|
});
|
|
39
41
|
export {
|
|
40
|
-
|
|
42
|
+
A as default
|
|
41
43
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Node } from '@scalar/code-highlight';
|
|
1
2
|
export type ScalarMarkdownProps = {
|
|
2
3
|
/**
|
|
3
4
|
* The markdown content to render.
|
|
@@ -16,11 +17,11 @@ export type ScalarMarkdownProps = {
|
|
|
16
17
|
*/
|
|
17
18
|
withAnchors?: boolean;
|
|
18
19
|
/**
|
|
19
|
-
* A function to transform the
|
|
20
|
+
* A function to transform the Markdown content.
|
|
20
21
|
*
|
|
21
22
|
* @see https://github.com/remarkjs/remark-rehype
|
|
22
23
|
*/
|
|
23
|
-
transform?: (node:
|
|
24
|
+
transform?: (node: Node) => Node;
|
|
24
25
|
/**
|
|
25
26
|
* The type of transform to apply.
|
|
26
27
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarMarkdown/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarMarkdown/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAElD,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAChC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,GAAG;IAC7D;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"AAkLA,OAAO,KAAK,EAA2B,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAI/E;;;;;;;;;;;;;;;;;;;;;;GAsBG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;;;;WAwDT,OAAO;;;;;;;;;;WAAP,OAAO;;;;;4GAyNZ,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"url": "git+https://github.com/scalar/scalar.git",
|
|
11
11
|
"directory": "packages/components"
|
|
12
12
|
},
|
|
13
|
-
"version": "0.19.
|
|
13
|
+
"version": "0.19.9",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=20"
|
|
16
16
|
},
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"radix-vue": "^1.9.17",
|
|
40
40
|
"vue": "^3.5.26",
|
|
41
41
|
"vue-component-type-helpers": "^3.2.2",
|
|
42
|
-
"@scalar/code-highlight": "0.2.
|
|
43
|
-
"@scalar/
|
|
44
|
-
"@scalar/helpers": "0.2.15",
|
|
45
|
-
"@scalar/themes": "0.14.0",
|
|
42
|
+
"@scalar/code-highlight": "0.2.4",
|
|
43
|
+
"@scalar/helpers": "0.2.16",
|
|
46
44
|
"@scalar/icons": "0.5.3",
|
|
45
|
+
"@scalar/oas-utils": "0.6.47",
|
|
46
|
+
"@scalar/themes": "0.14.0",
|
|
47
47
|
"@scalar/use-hooks": "0.3.7"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|