@elmethis/core 1.0.0-alpha.184 → 1.0.0-alpha.186

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.
@@ -22,5 +22,6 @@ declare const _default: import('vue').DefineComponent<ElmCodeBlockProps, {}, {},
22
22
  language: string;
23
23
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
24
24
  target: HTMLDivElement;
25
+ tooltipRef: HTMLDivElement;
25
26
  }, HTMLDivElement>;
26
27
  export default _default;
@@ -1,10 +1,23 @@
1
+ (function() {
2
+ "use strict";
3
+ try {
4
+ if (typeof document != "undefined") {
5
+ var elementStyle = document.createElement("style");
6
+ elementStyle.appendChild(document.createTextNode(".v-enter-to[data-v-00081a60],.v-leave-from[data-v-00081a60]{opacity:1}.v-enter-active[data-v-00081a60],.v-leave-active[data-v-00081a60]{transition:opacity .15s}.v-enter-from[data-v-00081a60],.v-leave-to[data-v-00081a60]{opacity:0}"));
7
+ document.head.appendChild(elementStyle);
8
+ }
9
+ } catch (e) {
10
+ console.error("vite-plugin-css-injected-by-js", e);
11
+ }
12
+ })();
1
13
  import _sfc_main from "./ElmCodeBlock.vue2.mjs";
2
14
  import style0 from "./ElmCodeBlock.vue3.mjs";
15
+
3
16
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
17
  const cssModules = {
5
18
  "$style": style0
6
19
  };
7
- const ElmCodeBlock = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
20
+ const ElmCodeBlock = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-00081a60"]]);
8
21
  export {
9
22
  ElmCodeBlock as default
10
23
  };
@@ -1,11 +1,10 @@
1
- import { defineComponent, defineAsyncComponent, ref, createElementBlock, openBlock, normalizeStyle, normalizeClass, createElementVNode, createVNode, withCtx, unref } from "vue";
1
+ import { defineComponent, defineAsyncComponent, ref, useTemplateRef, createElementBlock, openBlock, normalizeStyle, normalizeClass, createElementVNode, createVNode, unref, Transition, withCtx, createCommentVNode } from "vue";
2
2
  import { Icon } from "@iconify/vue";
3
3
  import ElmLanguageIcon from "../icon/ElmLanguageIcon.vue.mjs";
4
4
  import ElmInlineText from "../inline/ElmInlineText.vue.mjs";
5
- import { useClipboard, useIntersectionObserver } from "@vueuse/core";
6
- import ElmTooltip from "../containments/ElmTooltip.vue.mjs";
7
5
  import ElmBlockFallback from "../fallback/ElmBlockFallback.vue.mjs";
8
6
  import ElmDotLoadingIcon from "../icon/ElmDotLoadingIcon.vue.mjs";
7
+ import { useClipboard, useIntersectionObserver, useElementHover } from "@vueuse/core";
9
8
  const _sfc_main = /* @__PURE__ */ defineComponent({
10
9
  __name: "ElmCodeBlock",
11
10
  props: {
@@ -27,6 +26,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27
26
  useIntersectionObserver(target, ([{ isIntersecting }], _) => {
28
27
  targetIsVisible.value = isIntersecting;
29
28
  });
29
+ const tooltipElement = useTemplateRef("tooltipRef");
30
+ const isHovered = useElementHover(tooltipElement);
30
31
  return (_ctx, _cache) => {
31
32
  return openBlock(), createElementBlock("div", {
32
33
  ref_key: "target",
@@ -52,24 +53,37 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
52
53
  }, null, 8, ["text"])
53
54
  ], 2),
54
55
  createElementVNode("div", {
56
+ ref: "tooltipRef",
55
57
  class: normalizeClass(_ctx.$style.header__right)
56
58
  }, [
57
- createVNode(ElmTooltip, null, {
58
- original: withCtx(() => [
59
- createVNode(unref(Icon), {
60
- class: normalizeClass(_ctx.$style["copy-icon"]),
61
- onClick: _cache[0] || (_cache[0] = () => {
62
- unref(copy)(_ctx.code);
63
- }),
64
- icon: unref(copied) ? "mdi:clipboard-check-multiple-outline" : "mdi:clipboard-multiple-outline"
65
- }, null, 8, ["class", "icon"])
66
- ]),
67
- tooltip: withCtx(() => [
68
- createElementVNode("div", null, [
69
- createVNode(ElmInlineText, {
70
- text: unref(copied) ? "Copied to Clipboard!" : "Copy to Clipboard"
71
- }, null, 8, ["text"])
72
- ])
59
+ createVNode(unref(Icon), {
60
+ class: normalizeClass(_ctx.$style["copy-icon"]),
61
+ onClick: _cache[0] || (_cache[0] = () => {
62
+ unref(copy)(_ctx.code);
63
+ }),
64
+ icon: unref(copied) ? "mdi:clipboard-check-multiple-outline" : "mdi:clipboard-multiple-outline"
65
+ }, null, 8, ["class", "icon"]),
66
+ createVNode(Transition, null, {
67
+ default: withCtx(() => [
68
+ unref(copied) ? (openBlock(), createElementBlock("div", {
69
+ key: 0,
70
+ class: normalizeClass(_ctx.$style.tooltip)
71
+ }, [
72
+ createVNode(unref(Icon), {
73
+ icon: "mdi:clipboard-check-multiple-outline",
74
+ class: normalizeClass(_ctx.$style["tooltip-check-icon"])
75
+ }, null, 8, ["class"]),
76
+ createVNode(ElmInlineText, { text: "Copied to Clipboard!" })
77
+ ], 2)) : unref(isHovered) && !unref(copied) ? (openBlock(), createElementBlock("div", {
78
+ key: 1,
79
+ class: normalizeClass(_ctx.$style.tooltip)
80
+ }, [
81
+ createVNode(unref(Icon), {
82
+ icon: "mdi:clipboard-multiple-outline",
83
+ class: normalizeClass(_ctx.$style["tooltip-copy-icon"])
84
+ }, null, 8, ["class"]),
85
+ createVNode(ElmInlineText, { text: "Copy to Clipboard" })
86
+ ], 2)) : createCommentVNode("", true)
73
87
  ]),
74
88
  _: 1
75
89
  })
@@ -3,28 +3,32 @@
3
3
  try {
4
4
  if (typeof document != "undefined") {
5
5
  var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode("._wrapper_vcziv_1{margin-block:var(--margin-block);opacity:var(--opacity);display:flex;flex-direction:column;border-radius:.25rem;transition:background-color .4s,opacity .8s;background-color:#fff6;box-shadow:0 0 .25rem #0000001a}[data-theme=dark] ._wrapper_vcziv_1{background-color:#ffffff0d;box-shadow:0 0 .25rem #0000004d}._header_vcziv_16{box-sizing:border-box;padding:.25rem .5rem .5rem;margin:.5rem;display:flex;flex-direction:row;justify-content:space-between;font-family:Source Code Pro,Menlo,Consolas,DejaVu Sans Mono,monospace;border-bottom:solid 1px rgba(0,0,0,.2)}[data-theme=dark] ._header_vcziv_16{border-color:#fff3}._header__left_vcziv_30{display:flex;flex-direction:row;align-items:center;gap:.5rem}._copy-icon_vcziv_37{box-sizing:border-box;padding:.125rem;width:26px;height:26px;border-radius:.125rem;cursor:pointer;transition:background-color .2s;color:#000000b3}[data-theme=dark] ._copy-icon_vcziv_37{color:#ffffffb3}._copy-icon_vcziv_37:hover{background-color:#0000001a}[data-theme=dark] ._copy-icon_vcziv_37:hover{background-color:#ffffff1a}._header__right_vcziv_57{display:flex;flex-direction:row;align-items:center;gap:.5rem}._code_vcziv_64{position:relative;padding:.25rem 1rem 1rem;overflow-x:auto;scrollbar-width:thin;scrollbar-color:rgba(105,135,184,.3) rgba(105,135,184,.15)}._code-body_vcziv_72{transition:opacity .2s}._fallback_vcziv_76{position:absolute;top:0;left:0;height:100%;width:100%;box-sizing:border-box;padding:auto;display:flex;justify-content:center;align-items:center;transition:opacity .2s}"));
6
+ elementStyle.appendChild(document.createTextNode("._wrapper_1a766_1{margin-block:var(--margin-block);opacity:var(--opacity);display:flex;flex-direction:column;border-radius:.25rem;transition:background-color .4s,opacity .8s;background-color:#fff6;box-shadow:0 0 .25rem #0000001a}[data-theme=dark] ._wrapper_1a766_1{background-color:#ffffff0d;box-shadow:0 0 .25rem #0000004d}._header_1a766_16{box-sizing:border-box;padding:.25rem .5rem .5rem;margin:.5rem;display:flex;flex-direction:row;justify-content:space-between;font-family:Source Code Pro,Menlo,Consolas,DejaVu Sans Mono,monospace;border-bottom:solid 1px rgba(0,0,0,.2)}[data-theme=dark] ._header_1a766_16{border-color:#fff3}._header__left_1a766_30{display:flex;flex-direction:row;align-items:center;gap:.5rem}._copy-icon_1a766_37{box-sizing:border-box;padding:.125rem;width:26px;height:26px;border-radius:.125rem;cursor:pointer;transition:background-color .2s;color:#000000b3}[data-theme=dark] ._copy-icon_1a766_37{color:#ffffffb3}._copy-icon_1a766_37:hover{background-color:#0000001a}[data-theme=dark] ._copy-icon_1a766_37:hover{background-color:#ffffff1a}._header__right_1a766_57{position:relative;display:flex;flex-direction:row;align-items:center;gap:.5rem}._code_1a766_65{position:relative;padding:.25rem 1rem 1rem;overflow-x:auto;scrollbar-width:thin;scrollbar-color:rgba(105,135,184,.3) rgba(105,135,184,.15)}._code-body_1a766_73{transition:opacity .2s}._fallback_1a766_77{position:absolute;top:0;left:0;height:100%;width:100%;box-sizing:border-box;padding:auto;display:flex;justify-content:center;align-items:center;transition:opacity .2s}._tooltip_1a766_91{position:absolute;bottom:-2.5rem;right:0;display:flex;flex-wrap:none;justify-content:center;align-items:center;gap:.25rem;height:20px;white-space:nowrap}._tooltip-copy-icon_1a766_104{width:20px;height:20px;color:#4c6da2}._tooltip-check-icon_1a766_110{width:20px;height:20px;color:#449763}"));
7
7
  document.head.appendChild(elementStyle);
8
8
  }
9
9
  } catch (e) {
10
10
  console.error("vite-plugin-css-injected-by-js", e);
11
11
  }
12
12
  })();
13
- const wrapper = "_wrapper_vcziv_1";
14
- const header = "_header_vcziv_16";
15
- const header__left = "_header__left_vcziv_30";
16
- const header__right = "_header__right_vcziv_57";
17
- const code = "_code_vcziv_64";
18
- const fallback = "_fallback_vcziv_76";
13
+ const wrapper = "_wrapper_1a766_1";
14
+ const header = "_header_1a766_16";
15
+ const header__left = "_header__left_1a766_30";
16
+ const header__right = "_header__right_1a766_57";
17
+ const code = "_code_1a766_65";
18
+ const fallback = "_fallback_1a766_77";
19
+ const tooltip = "_tooltip_1a766_91";
19
20
  const style0 = {
20
21
  wrapper,
21
22
  header,
22
23
  header__left,
23
- "copy-icon": "_copy-icon_vcziv_37",
24
+ "copy-icon": "_copy-icon_1a766_37",
24
25
  header__right,
25
26
  code,
26
- "code-body": "_code-body_vcziv_72",
27
- fallback
27
+ "code-body": "_code-body_1a766_73",
28
+ fallback,
29
+ tooltip,
30
+ "tooltip-copy-icon": "_tooltip-copy-icon_1a766_104",
31
+ "tooltip-check-icon": "_tooltip-check-icon_1a766_110"
28
32
  };
29
33
  export {
30
34
  code,
@@ -33,5 +37,6 @@ export {
33
37
  header,
34
38
  header__left,
35
39
  header__right,
40
+ tooltip,
36
41
  wrapper
37
42
  };
@@ -18,18 +18,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
18
18
  const render = async () => {
19
19
  if (!isRendered.value) {
20
20
  const highlighter = await getHighlighterSingleton();
21
- html.value = highlighter.codeToHtml(props.code, {
22
- lang: props.language,
23
- themes: {
24
- dark: "vitesse-dark",
25
- light: "vitesse-light"
26
- },
27
- colorReplacements: {
28
- "#ffffff": "transparent",
29
- "#121212": "transparent"
30
- }
31
- });
32
- isRendered.value = true;
21
+ try {
22
+ html.value = highlighter.codeToHtml(props.code, {
23
+ lang: props.language,
24
+ themes: {
25
+ dark: "vitesse-dark",
26
+ light: "vitesse-light"
27
+ },
28
+ colorReplacements: {
29
+ "#ffffff": "transparent",
30
+ "#121212": "transparent"
31
+ }
32
+ });
33
+ } catch {
34
+ } finally {
35
+ isRendered.value = true;
36
+ }
33
37
  }
34
38
  };
35
39
  onMounted(render);
@@ -12,6 +12,7 @@
12
12
  })();
13
13
  import _sfc_main from "./ElmModal.vue2.mjs";
14
14
  import style0 from "./ElmModal.vue3.mjs";
15
+
15
16
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
16
17
  const cssModules = {
17
18
  "$style": style0
@@ -12,6 +12,7 @@
12
12
  })();
13
13
  import _sfc_main from "./ElmSnackbarContainer.vue2.mjs";
14
14
  import style0 from "./ElmSnackbarContainer.vue3.mjs";
15
+
15
16
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
16
17
  const cssModules = {
17
18
  "$style": style0
@@ -12,6 +12,7 @@
12
12
  })();
13
13
  import _sfc_main from "./ElmToggle.vue2.mjs";
14
14
  import style0 from "./ElmToggle.vue3.mjs";
15
+
15
16
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
16
17
  const cssModules = {
17
18
  "$style": style0
@@ -12,6 +12,7 @@
12
12
  })();
13
13
  import _sfc_main from "./ElmTooltip.vue2.mjs";
14
14
  import style0 from "./ElmTooltip.vue3.mjs";
15
+
15
16
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
16
17
  const cssModules = {
17
18
  "$style": style0
@@ -12,6 +12,7 @@
12
12
  })();
13
13
  import _sfc_main from "./ElmStatusMessage.vue2.mjs";
14
14
  import style0 from "./ElmStatusMessage.vue3.mjs";
15
+
15
16
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
16
17
  const cssModules = {
17
18
  "$style": style0
@@ -12,6 +12,7 @@
12
12
  })();
13
13
  import _sfc_main from "./ElmButton.vue2.mjs";
14
14
  import style0 from "./ElmButton.vue3.mjs";
15
+
15
16
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
16
17
  const cssModules = {
17
18
  "$style": style0
@@ -12,6 +12,7 @@
12
12
  })();
13
13
  import _sfc_main from "./ElmLanguageIcon.vue2.mjs";
14
14
  import style0 from "./ElmLanguageIcon.vue3.mjs";
15
+
15
16
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
16
17
  const cssModules = {
17
18
  "$style": style0
@@ -3,7 +3,7 @@
3
3
  try {
4
4
  if (typeof document != "undefined") {
5
5
  var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode(".v-enter-to[data-v-67c5b662],.v-leave-from[data-v-67c5b662]{opacity:1}.v-enter-active[data-v-67c5b662],.v-leave-active[data-v-67c5b662]{transition:opacity .3s}.v-enter-from[data-v-67c5b662],.v-leave-to[data-v-67c5b662]{opacity:0}"));
6
+ elementStyle.appendChild(document.createTextNode(".v-enter-to[data-v-0a4181a9],.v-leave-from[data-v-0a4181a9]{opacity:1}.v-enter-active[data-v-0a4181a9],.v-leave-active[data-v-0a4181a9]{transition:opacity .3s}.v-enter-from[data-v-0a4181a9],.v-leave-to[data-v-0a4181a9]{opacity:0}"));
7
7
  document.head.appendChild(elementStyle);
8
8
  }
9
9
  } catch (e) {
@@ -12,11 +12,12 @@
12
12
  })();
13
13
  import _sfc_main from "./ElmBlockImage.vue2.mjs";
14
14
  import style0 from "./ElmBlockImage.vue3.mjs";
15
+
15
16
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
16
17
  const cssModules = {
17
18
  "$style": style0
18
19
  };
19
- const ElmBlockImage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-67c5b662"]]);
20
+ const ElmBlockImage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-0a4181a9"]]);
20
21
  export {
21
22
  ElmBlockImage as default
22
23
  };
@@ -64,7 +64,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
64
64
  ], 2),
65
65
  createVNode(Transition, null, {
66
66
  default: withCtx(() => [
67
- !unref(isLoading) && _ctx.alt != null ? (openBlock(), createElementBlock("div", {
67
+ !unref(isLoading) && _ctx.alt != null && _ctx.alt.trim() !== "" ? (openBlock(), createElementBlock("div", {
68
68
  key: 0,
69
69
  class: normalizeClass(_ctx.$style["alt-container"])
70
70
  }, [
@@ -12,6 +12,7 @@
12
12
  })();
13
13
  import _sfc_main from "./ElmImage.vue2.mjs";
14
14
  import style0 from "./ElmImage.vue3.mjs";
15
+
15
16
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
16
17
  const cssModules = {
17
18
  "$style": style0
@@ -12,6 +12,7 @@
12
12
  })();
13
13
  import _sfc_main from "./ElmColorSample.vue2.mjs";
14
14
  import style0 from "./ElmColorSample.vue3.mjs";
15
+
15
16
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
16
17
  const cssModules = {
17
18
  "$style": style0
@@ -11,6 +11,7 @@
11
11
  }
12
12
  })();
13
13
  import _sfc_main from "./ElmTable.vue2.mjs";
14
+
14
15
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
15
16
  const ElmTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6ed1a868"]]);
16
17
  export {
@@ -11,6 +11,7 @@
11
11
  }
12
12
  })();
13
13
  import _sfc_main from "./ElmTableCell.vue2.mjs";
14
+
14
15
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
15
16
  const ElmTableCell = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7bedd3ac"]]);
16
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmethis/core",
3
- "version": "1.0.0-alpha.184",
3
+ "version": "1.0.0-alpha.186",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -25,12 +25,12 @@
25
25
  "dependencies": {
26
26
  "@heroicons/vue": "^2.2.0",
27
27
  "@iconify/vue": "^4.3.0",
28
- "@vueuse/core": "^13.0.0",
29
- "katex": "^0.16.21",
28
+ "@vueuse/core": "^13.1.0",
29
+ "katex": "^0.16.22",
30
30
  "lodash-es": "^4.17.21",
31
31
  "nanoid": "^5.1.5",
32
32
  "polished": "^4.3.1",
33
- "shiki": "^3.2.1"
33
+ "shiki": "^3.2.2"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@chromatic-com/storybook": "^3.2.6",
@@ -55,7 +55,7 @@
55
55
  "postcss-preset-env": "^10.1.5",
56
56
  "sass": "^1.86.3",
57
57
  "storybook": "^8.6.12",
58
- "vite": "^6.2.5",
58
+ "vite": "^6.3.2",
59
59
  "vite-plugin-css-injected-by-js": "^3.5.2",
60
60
  "vite-plugin-dts": "^4.5.3",
61
61
  "vue-tsc": "^2.2.8"