vue-stream-markdown 0.1.0 → 0.1.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 (67) hide show
  1. package/README.md +1 -0
  2. package/dist/button-DBgeYAZy.js +5 -0
  3. package/dist/{button-DRLfKbvc.js → button-vKhxUL3C.js} +1 -1
  4. package/dist/{code-D5-TPyJ2.js → code-_dL6Qk0F.js} +7 -7
  5. package/dist/code-block-DGZ48hb0.js +9 -0
  6. package/dist/{code-block-fsdBN3mX.js → code-block-wYeMwBck.js} +5 -5
  7. package/dist/{composables-5Y9QWb9D.js → composables-CZ7YmjNl.js} +33 -34
  8. package/dist/dropdown-DR-uQ215.js +5 -0
  9. package/dist/error-component-CKCT9gXy.js +4 -0
  10. package/dist/{error-component-DftqHZwH.js → error-component-ChEpOmSX.js} +1 -1
  11. package/dist/{image-dNQ1WKcM.js → image-DB-4Sv8R.js} +4 -4
  12. package/dist/index.css +633 -8
  13. package/dist/index.d.ts +32 -30
  14. package/dist/index.js +16 -15
  15. package/dist/{inline-math-D8LY9Xgq.js → inline-math-rChhv_1j.js} +2 -2
  16. package/dist/{link-Dkfv0bTE.js → link-CJk67Kbh.js} +2 -2
  17. package/dist/{math-G8p5HNSV.js → math-ZLxqHT_f.js} +2 -2
  18. package/dist/{mermaid-BAFHxaTS.js → mermaid-CNFU7Pg8.js} +10 -6
  19. package/dist/{previewers-CZxK6T54.js → previewers-CMreQ4TA.js} +1 -1
  20. package/dist/segmented-63wrfRNo.js +6 -0
  21. package/dist/{segmented-CpwUFPie.js → segmented-RoWxDIP3.js} +1 -1
  22. package/dist/{shiki-CxPfBPEr.js → shiki-4529WbJJ.js} +1 -1
  23. package/dist/{table-BSGtENN1.js → table-BmGwZIPR.js} +3 -3
  24. package/dist/tooltip--rusT8LZ.js +4 -0
  25. package/dist/{tooltip-CTUn3Ask.js → tooltip-KcTe6tBF.js} +1 -1
  26. package/dist/zoom-container-C-CB2LTY.js +6 -0
  27. package/dist/{zoom-container-BR9gRA9_.js → zoom-container-D1Mys9gv.js} +8 -10
  28. package/package.json +6 -5
  29. package/dist/blockquote-DFANmQEB.css +0 -13
  30. package/dist/button-C12sn_G5.css +0 -24
  31. package/dist/button-DYIERZf1.js +0 -5
  32. package/dist/code-NAXHb0o2.css +0 -4
  33. package/dist/code-block-Cs17aZ52.js +0 -9
  34. package/dist/code-block-D2zjJAww.css +0 -57
  35. package/dist/delete-Ci7IJDoT.css +0 -4
  36. package/dist/dropdown-BegRJmej.js +0 -5
  37. package/dist/emphasis-BseYvUae.css +0 -4
  38. package/dist/error-component-BIPPxd-M.css +0 -21
  39. package/dist/error-component-BkdZ6n2L.js +0 -4
  40. package/dist/heading-KxpVX3-u.css +0 -30
  41. package/dist/html-C5_wsY4-.css +0 -5
  42. package/dist/image-B77jbMUB.css +0 -46
  43. package/dist/inline-code-Eo65bj3F.css +0 -12
  44. package/dist/inline-math-DgBjIrPT.css +0 -7
  45. package/dist/link-BA_j8di3.css +0 -12
  46. package/dist/list-CcVBNIly.css +0 -11
  47. package/dist/list-item-Y6Cphjrp.css +0 -15
  48. package/dist/math-Cq89zpB6.css +0 -11
  49. package/dist/mermaid-C9ZUejzK.css +0 -8
  50. package/dist/modal-CWdgVkH_.css +0 -48
  51. package/dist/node-list-C9O-A1aZ.css +0 -11
  52. package/dist/paragraph-wRNmMYAI.css +0 -6
  53. package/dist/segmented-DLmggl-e.css +0 -8
  54. package/dist/segmented-DQFlS2_3.js +0 -6
  55. package/dist/shiki-CMgjqKKu.css +0 -20
  56. package/dist/spin-B2FU3Sx6.css +0 -19
  57. package/dist/strong-DpeQmP2J.css +0 -4
  58. package/dist/table-BWn_kG8W.css +0 -19
  59. package/dist/table-CJzlDdmv.css +0 -34
  60. package/dist/text-D098eCyi.css +0 -5
  61. package/dist/thematic-break-C5zxgoE9.css +0 -6
  62. package/dist/tooltip-DAngu9Wp.css +0 -5
  63. package/dist/tooltip-TCy0JVGe.js +0 -4
  64. package/dist/vanilla-BZ8bn5Yz.css +0 -4
  65. package/dist/yaml-McBkYbxI.css +0 -5
  66. package/dist/zoom-container-BENM7TpV.css +0 -28
  67. package/dist/zoom-container-qe4wO3zY.js +0 -6
package/README.md CHANGED
@@ -42,6 +42,7 @@ For detailed usage and API documentation, please refer to the [Documentation](ht
42
42
  <script setup lang="ts">
43
43
  import { ref } from 'vue'
44
44
  import { Markdown } from 'vue-stream-markdown'
45
+ import 'vue-stream-markdown/index.css'
45
46
  // If you don't have shadcn CSS variables globally, import the theme
46
47
  import 'vue-stream-markdown/theme.css'
47
48
 
@@ -0,0 +1,5 @@
1
+ import "./composables-CZ7YmjNl.js";
2
+ import "./tooltip-KcTe6tBF.js";
3
+ import { t as button_default } from "./button-vKhxUL3C.js";
4
+
5
+ export { button_default as default };
@@ -1,4 +1,4 @@
1
- import { t as tooltip_default } from "./tooltip-CTUn3Ask.js";
1
+ import { t as tooltip_default } from "./tooltip-KcTe6tBF.js";
2
2
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, h, normalizeClass, normalizeStyle, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, withCtx } from "vue";
3
3
 
4
4
  //#region src/components/dropdown.vue?vue&type=script&setup=true&lang.ts
@@ -1,10 +1,10 @@
1
- import "./previewers-CZxK6T54.js";
2
- import { i as useShiki } from "./composables-5Y9QWb9D.js";
3
- import "./tooltip-CTUn3Ask.js";
4
- import "./button-DRLfKbvc.js";
1
+ import "./previewers-CMreQ4TA.js";
2
+ import { i as useShiki } from "./composables-CZ7YmjNl.js";
3
+ import "./tooltip-KcTe6tBF.js";
4
+ import "./button-vKhxUL3C.js";
5
5
  import "./modal-CuQR21UD.js";
6
- import { t as code_block_default } from "./code-block-fsdBN3mX.js";
7
- import "./segmented-CpwUFPie.js";
6
+ import { t as code_block_default } from "./code-block-wYeMwBck.js";
7
+ import "./segmented-RoWxDIP3.js";
8
8
  import { computed, createBlock, createCommentVNode, defineAsyncComponent, defineComponent, mergeProps, normalizeProps, openBlock, resolveDynamicComponent, withCtx } from "vue";
9
9
 
10
10
  //#region src/components/renderers/code/index.vue?vue&type=script&setup=true&lang.ts
@@ -83,7 +83,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
83
83
  const { installed: hasShiki } = useShiki();
84
84
  const components = {
85
85
  vanilla: defineAsyncComponent(() => import("./vanilla-CA9QO96X.js")),
86
- shiki: defineAsyncComponent(() => import("./shiki-CxPfBPEr.js"))
86
+ shiki: defineAsyncComponent(() => import("./shiki-4529WbJJ.js"))
87
87
  };
88
88
  const component = computed(() => {
89
89
  if (hasShiki.value) return components.shiki;
@@ -0,0 +1,9 @@
1
+ import "./previewers-CMreQ4TA.js";
2
+ import "./composables-CZ7YmjNl.js";
3
+ import "./tooltip-KcTe6tBF.js";
4
+ import "./button-vKhxUL3C.js";
5
+ import "./modal-CuQR21UD.js";
6
+ import { t as code_block_default } from "./code-block-wYeMwBck.js";
7
+ import "./segmented-RoWxDIP3.js";
8
+
9
+ export { code_block_default as default };
@@ -1,8 +1,8 @@
1
- import { t as CODE_PREVIEWERS } from "./previewers-CZxK6T54.js";
2
- import { B as useContext, I as LANGUAGE_ALIAS, L as LANGUAGE_EXTENSIONS, M as ICONS, O as save, R as LANGUAGE_ICONS, a as useMermaid, u as useI18n, z as useControls } from "./composables-5Y9QWb9D.js";
3
- import { t as button_default } from "./button-DRLfKbvc.js";
1
+ import { t as CODE_PREVIEWERS } from "./previewers-CMreQ4TA.js";
2
+ import { B as useContext, I as LANGUAGE_ALIAS, L as LANGUAGE_EXTENSIONS, M as ICONS, O as save, R as LANGUAGE_ICONS, a as useMermaid, u as useI18n, z as useControls } from "./composables-CZ7YmjNl.js";
3
+ import { t as button_default } from "./button-vKhxUL3C.js";
4
4
  import { t as modal_default } from "./modal-CuQR21UD.js";
5
- import { t as segmented_default } from "./segmented-CpwUFPie.js";
5
+ import { t as segmented_default } from "./segmented-RoWxDIP3.js";
6
6
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineAsyncComponent, defineComponent, mergeProps, normalizeClass, normalizeProps, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toRefs, unref, useModel, vShow, watch, withCtx, withDirectives } from "vue";
7
7
  import { useClipboard } from "@vueuse/core";
8
8
 
@@ -208,7 +208,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
208
208
  const { t } = useI18n();
209
209
  const { isControlEnabled } = useControls({ controls });
210
210
  const { installed: hasMermaid } = useMermaid();
211
- const CodeNode = defineAsyncComponent(() => import("./code-D5-TPyJ2.js"));
211
+ const CodeNode = defineAsyncComponent(() => import("./code-_dL6Qk0F.js"));
212
212
  const { onCopied } = useContext();
213
213
  const { copy, copied } = useClipboard({ legacy: true });
214
214
  const { saveMermaid } = useMermaid();
@@ -1041,7 +1041,7 @@ function useKatex() {
1041
1041
  }
1042
1042
 
1043
1043
  //#endregion
1044
- //#region \0@oxc-project+runtime@0.99.0/helpers/typeof.js
1044
+ //#region \0@oxc-project+runtime@0.101.0/helpers/typeof.js
1045
1045
  function _typeof(o) {
1046
1046
  "@babel/helpers - typeof";
1047
1047
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
@@ -1052,7 +1052,7 @@ function _typeof(o) {
1052
1052
  }
1053
1053
 
1054
1054
  //#endregion
1055
- //#region \0@oxc-project+runtime@0.99.0/helpers/toPrimitive.js
1055
+ //#region \0@oxc-project+runtime@0.101.0/helpers/toPrimitive.js
1056
1056
  function toPrimitive(t, r) {
1057
1057
  if ("object" != _typeof(t) || !t) return t;
1058
1058
  var e = t[Symbol.toPrimitive];
@@ -1065,14 +1065,14 @@ function toPrimitive(t, r) {
1065
1065
  }
1066
1066
 
1067
1067
  //#endregion
1068
- //#region \0@oxc-project+runtime@0.99.0/helpers/toPropertyKey.js
1068
+ //#region \0@oxc-project+runtime@0.101.0/helpers/toPropertyKey.js
1069
1069
  function toPropertyKey(t) {
1070
1070
  var i = toPrimitive(t, "string");
1071
1071
  return "symbol" == _typeof(i) ? i : i + "";
1072
1072
  }
1073
1073
 
1074
1074
  //#endregion
1075
- //#region \0@oxc-project+runtime@0.99.0/helpers/defineProperty.js
1075
+ //#region \0@oxc-project+runtime@0.101.0/helpers/defineProperty.js
1076
1076
  function _defineProperty(e, r, t) {
1077
1077
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
1078
1078
  value: t,
@@ -1083,32 +1083,32 @@ function _defineProperty(e, r, t) {
1083
1083
  }
1084
1084
 
1085
1085
  //#endregion
1086
- //#region \0@oxc-project+runtime@0.99.0/helpers/checkPrivateRedeclaration.js
1086
+ //#region \0@oxc-project+runtime@0.101.0/helpers/checkPrivateRedeclaration.js
1087
1087
  function _checkPrivateRedeclaration(e, t) {
1088
1088
  if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
1089
1089
  }
1090
1090
 
1091
1091
  //#endregion
1092
- //#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldInitSpec.js
1092
+ //#region \0@oxc-project+runtime@0.101.0/helpers/classPrivateFieldInitSpec.js
1093
1093
  function _classPrivateFieldInitSpec(e, t, a) {
1094
1094
  _checkPrivateRedeclaration(e, t), t.set(e, a);
1095
1095
  }
1096
1096
 
1097
1097
  //#endregion
1098
- //#region \0@oxc-project+runtime@0.99.0/helpers/assertClassBrand.js
1098
+ //#region \0@oxc-project+runtime@0.101.0/helpers/assertClassBrand.js
1099
1099
  function _assertClassBrand(e, t, n) {
1100
1100
  if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
1101
1101
  throw new TypeError("Private element is not present on this object");
1102
1102
  }
1103
1103
 
1104
1104
  //#endregion
1105
- //#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldGet2.js
1105
+ //#region \0@oxc-project+runtime@0.101.0/helpers/classPrivateFieldGet2.js
1106
1106
  function _classPrivateFieldGet2(s, a) {
1107
1107
  return s.get(_assertClassBrand(s, a));
1108
1108
  }
1109
1109
 
1110
1110
  //#endregion
1111
- //#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldSet2.js
1111
+ //#region \0@oxc-project+runtime@0.101.0/helpers/classPrivateFieldSet2.js
1112
1112
  function _classPrivateFieldSet2(s, a, r) {
1113
1113
  return s.set(_assertClassBrand(s, a), r), r;
1114
1114
  }
@@ -1385,6 +1385,7 @@ function useMermaid(options) {
1385
1385
  //#endregion
1386
1386
  //#region src/composables/use-shiki.ts
1387
1387
  let highlighter = null;
1388
+ let createHighlighterPromise = null;
1388
1389
  function useShiki(options) {
1389
1390
  const installed = ref(false);
1390
1391
  const lang = computed(() => unref(options === null || options === void 0 ? void 0 : options.lang) ?? "plaintext");
@@ -1424,6 +1425,10 @@ function useShiki(options) {
1424
1425
  return "plaintext";
1425
1426
  }
1426
1427
  async function getHighlighter() {
1428
+ if (createHighlighterPromise) {
1429
+ highlighter = await createHighlighterPromise;
1430
+ createHighlighterPromise = null;
1431
+ }
1427
1432
  if (highlighter) {
1428
1433
  const loadedLangs = highlighter.getLoadedLanguages();
1429
1434
  const loadedThemes = highlighter.getLoadedThemes();
@@ -1433,15 +1438,19 @@ function useShiki(options) {
1433
1438
  for (const theme of themes) if (!loadedThemes.includes(theme)) await highlighter.loadTheme(theme);
1434
1439
  return highlighter;
1435
1440
  }
1436
- const { createHighlighter } = await import("shiki");
1437
- highlighter = await createHighlighter({
1438
- themes: [await getTheme()],
1439
- langs: [await getLanguage()],
1440
- langAlias: {
1441
- ...LANGUAGE_ALIAS,
1442
- ...langAlias.value
1443
- }
1444
- });
1441
+ createHighlighterPromise = (async () => {
1442
+ const { createHighlighter } = await import("shiki");
1443
+ return createHighlighter({
1444
+ themes: [await getTheme()],
1445
+ langs: [await getLanguage()],
1446
+ langAlias: {
1447
+ ...LANGUAGE_ALIAS,
1448
+ ...langAlias.value
1449
+ }
1450
+ });
1451
+ })();
1452
+ highlighter = await createHighlighterPromise;
1453
+ createHighlighterPromise = null;
1445
1454
  return highlighter;
1446
1455
  }
1447
1456
  async function codeToTokens(code) {
@@ -1569,28 +1578,18 @@ function useZoom(options = {}) {
1569
1578
  }
1570
1579
  function startDrag(e) {
1571
1580
  isDragging.value = true;
1572
- if (e instanceof MouseEvent) dragStart.value = {
1581
+ dragStart.value = {
1573
1582
  x: e.clientX - translateX.value,
1574
1583
  y: e.clientY - translateY.value
1575
1584
  };
1576
- else dragStart.value = {
1577
- x: e.touches[0].clientX - translateX.value,
1578
- y: e.touches[0].clientY - translateY.value
1579
- };
1585
+ if (e.pointerType !== "mouse") {
1586
+ if (e.target instanceof HTMLElement) e.target.setPointerCapture(e.pointerId);
1587
+ }
1580
1588
  }
1581
1589
  function onDrag(e) {
1582
1590
  if (!isDragging.value) return;
1583
- let clientX;
1584
- let clientY;
1585
- if (e instanceof MouseEvent) {
1586
- clientX = e.clientX;
1587
- clientY = e.clientY;
1588
- } else {
1589
- clientX = e.touches[0].clientX;
1590
- clientY = e.touches[0].clientY;
1591
- }
1592
- translateX.value = clientX - dragStart.value.x;
1593
- translateY.value = clientY - dragStart.value.y;
1591
+ translateX.value = e.clientX - dragStart.value.x;
1592
+ translateY.value = e.clientY - dragStart.value.y;
1594
1593
  }
1595
1594
  function stopDrag() {
1596
1595
  isDragging.value = false;
@@ -0,0 +1,5 @@
1
+ import "./composables-CZ7YmjNl.js";
2
+ import "./tooltip-KcTe6tBF.js";
3
+ import { n as dropdown_default } from "./button-vKhxUL3C.js";
4
+
5
+ export { dropdown_default as default };
@@ -0,0 +1,4 @@
1
+ import "./composables-CZ7YmjNl.js";
2
+ import { t as error_component_default } from "./error-component-ChEpOmSX.js";
3
+
4
+ export { error_component_default as default };
@@ -1,4 +1,4 @@
1
- import { M as ICONS, u as useI18n } from "./composables-5Y9QWb9D.js";
1
+ import { M as ICONS, u as useI18n } from "./composables-CZ7YmjNl.js";
2
2
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, openBlock, renderSlot, resolveDynamicComponent, toDisplayString } from "vue";
3
3
 
4
4
  //#region src/components/error-component.vue?vue&type=script&setup=true&lang.ts
@@ -1,7 +1,7 @@
1
- import { M as ICONS, O as save, g as useHardenSanitizers, u as useI18n, z as useControls } from "./composables-5Y9QWb9D.js";
2
- import "./tooltip-CTUn3Ask.js";
3
- import { t as button_default } from "./button-DRLfKbvc.js";
4
- import { t as error_component_default } from "./error-component-DftqHZwH.js";
1
+ import { M as ICONS, O as save, g as useHardenSanitizers, u as useI18n, z as useControls } from "./composables-CZ7YmjNl.js";
2
+ import "./tooltip-KcTe6tBF.js";
3
+ import { t as button_default } from "./button-vKhxUL3C.js";
4
+ import { t as error_component_default } from "./error-component-ChEpOmSX.js";
5
5
  import { t as spin_default } from "./spin-Ds5W7qC_.js";
6
6
  import { Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeStyle, openBlock, ref, resolveDynamicComponent, toDisplayString, toRefs, unref, withCtx } from "vue";
7
7