@scalar/components 0.19.7 → 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.
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarMarkdown.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarMarkdown/ScalarMarkdown.vue"],"names":[],"mappings":"AAopBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAuFlD,QAAA,MAAM,YAAY;;4PAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
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 s, useTemplateRef as f, computed as u, createElementBlock as h, openBlock as d, mergeProps as g, unref as w } from "vue";
2
- import { htmlFromMarkdown as x } from "@scalar/code-highlight";
3
- import { useBindCx as T } from "@scalar/use-hooks/useBindCx";
4
- const v = ["innerHTML"], B = /* @__PURE__ */ s({
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: n }) {
17
- const { cx: a } = T(), m = f("div");
18
- n({ el: m });
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
- const r = (t.children?.[0]?.value || "").toLowerCase().replace(/\s+/g, "-"), l = e.anchorPrefix ? `${e.anchorPrefix}/description/${r}` : r;
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: l
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(a)("markdown", { "line-clamp-(--markdown-clamp)": !!e.clamp }), {
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
- B as default
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 markdown content.
20
+ * A function to transform the Markdown content.
20
21
  *
21
22
  * @see https://github.com/remarkjs/remark-rehype
22
23
  */
23
- transform?: (node: Record<string, any>) => Record<string, any>;
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,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9D;;;;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
+ {"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":"AAiLA,OAAO,KAAK,EAA2B,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAI/E;;;;;;;;;;;;;;;;;;;;;;GAsBG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;;;;WAuDT,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"}
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.7",
13
+ "version": "0.19.9",
14
14
  "engines": {
15
15
  "node": ">=20"
16
16
  },
@@ -39,12 +39,12 @@
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.3",
42
+ "@scalar/code-highlight": "0.2.4",
43
+ "@scalar/helpers": "0.2.16",
43
44
  "@scalar/icons": "0.5.3",
44
- "@scalar/oas-utils": "0.6.45",
45
+ "@scalar/oas-utils": "0.6.47",
45
46
  "@scalar/themes": "0.14.0",
46
- "@scalar/use-hooks": "0.3.7",
47
- "@scalar/helpers": "0.2.15"
47
+ "@scalar/use-hooks": "0.3.7"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@headlessui/tailwindcss": "^0.2.2",