@elmethis/core 0.1.9 → 0.2.0

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.
@@ -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-ea96c386],.v-leave-from[data-v-ea96c386]{opacity:1}.v-enter-active[data-v-ea96c386],.v-leave-active[data-v-ea96c386]{transition:opacity .15s}.v-enter-from[data-v-ea96c386],.v-leave-to[data-v-ea96c386]{opacity:0}"));
6
+ elementStyle.appendChild(document.createTextNode(".v-enter-to[data-v-fd68c0a3],.v-leave-from[data-v-fd68c0a3]{opacity:1}.v-enter-active[data-v-fd68c0a3],.v-leave-active[data-v-fd68c0a3]{transition:opacity .15s}.v-enter-from[data-v-fd68c0a3],.v-leave-to[data-v-fd68c0a3]{opacity:0}"));
7
7
  document.head.appendChild(elementStyle);
8
8
  }
9
9
  } catch (e) {
@@ -17,7 +17,7 @@ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
17
17
  const cssModules = {
18
18
  "$style": style0
19
19
  };
20
- const ElmCodeBlock = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-ea96c386"]]);
20
+ const ElmCodeBlock = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-fd68c0a3"]]);
21
21
  export {
22
22
  ElmCodeBlock as default
23
23
  };
@@ -59,7 +59,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
59
59
  language: _ctx.language,
60
60
  size: 20
61
61
  }, null, 8, ["language"]),
62
- (openBlock(), createBlock(resolveDynamicComponent(() => renderCaption())))
62
+ createElementVNode("span", {
63
+ class: normalizeClass(_ctx.$style.caption)
64
+ }, [
65
+ (openBlock(), createBlock(resolveDynamicComponent(() => renderCaption())))
66
+ ], 2)
63
67
  ], 2),
64
68
  createElementVNode("div", {
65
69
  ref: "tooltipRef",
@@ -3,32 +3,35 @@
3
3
  try {
4
4
  if (typeof document != "undefined") {
5
5
  var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode("._wrapper_11asa_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 .125rem #3e434b4d}[data-theme=dark] ._wrapper_11asa_1{background-color:#2c3037e6;box-shadow:0 0 .125rem #0006}._header_11asa_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(62,67,75,.3)}[data-theme=dark] ._header_11asa_16{border-color:#bec2ca4d}._header__left_11asa_30{display:flex;flex-direction:row;align-items:center;gap:.5rem}._copy-icon_11asa_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_11asa_37{color:#ffffffb3}._copy-icon_11asa_37:hover{background-color:#0000001a}[data-theme=dark] ._copy-icon_11asa_37:hover{background-color:#ffffff1a}._header__right_11asa_57{position:relative;display:flex;flex-direction:row;align-items:center;gap:.5rem}._code_11asa_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_11asa_73{transition:opacity .2s}._fallback_11asa_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;pointer-events:none}._tooltip_11asa_92{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}"));
6
+ elementStyle.appendChild(document.createTextNode("._wrapper_1ysrf_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 .125rem #3e434b4d}[data-theme=dark] ._wrapper_1ysrf_1{background-color:#2c3037e6;box-shadow:0 0 .125rem #0006}._header_1ysrf_16{box-sizing:border-box;width:calc(100% - 1rem);padding:.25rem .5rem .5rem;margin:.5rem;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;font-family:Source Code Pro,Menlo,Consolas,DejaVu Sans Mono,monospace;border-bottom:solid 1px rgba(62,67,75,.3)}[data-theme=dark] ._header_1ysrf_16{border-color:#bec2ca4d}._header__left_1ysrf_32{width:calc(100% - 2rem);display:flex;flex-direction:row;align-items:center;gap:.5rem}._caption_1ysrf_40{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}._copy-icon_1ysrf_46{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_1ysrf_46{color:#ffffffb3}._copy-icon_1ysrf_46:hover{background-color:#0000001a}[data-theme=dark] ._copy-icon_1ysrf_46:hover{background-color:#ffffff1a}._header__right_1ysrf_66{position:relative;display:flex;flex-direction:row;align-items:center;gap:.5rem}._code_1ysrf_74{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_1ysrf_82{transition:opacity .2s}._fallback_1ysrf_86{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;pointer-events:none}._tooltip_1ysrf_101{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}"));
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_11asa_1";
14
- const header = "_header_11asa_16";
15
- const header__left = "_header__left_11asa_30";
16
- const header__right = "_header__right_11asa_57";
17
- const code = "_code_11asa_65";
18
- const fallback = "_fallback_11asa_77";
19
- const tooltip = "_tooltip_11asa_92";
13
+ const wrapper = "_wrapper_1ysrf_1";
14
+ const header = "_header_1ysrf_16";
15
+ const header__left = "_header__left_1ysrf_32";
16
+ const caption = "_caption_1ysrf_40";
17
+ const header__right = "_header__right_1ysrf_66";
18
+ const code = "_code_1ysrf_74";
19
+ const fallback = "_fallback_1ysrf_86";
20
+ const tooltip = "_tooltip_1ysrf_101";
20
21
  const style0 = {
21
22
  wrapper,
22
23
  header,
23
24
  header__left,
24
- "copy-icon": "_copy-icon_11asa_37",
25
+ caption,
26
+ "copy-icon": "_copy-icon_1ysrf_46",
25
27
  header__right,
26
28
  code,
27
- "code-body": "_code-body_11asa_73",
29
+ "code-body": "_code-body_1ysrf_82",
28
30
  fallback,
29
31
  tooltip
30
32
  };
31
33
  export {
34
+ caption,
32
35
  code,
33
36
  style0 as default,
34
37
  fallback,
@@ -5,5 +5,5 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Primary: Story;
7
7
  export declare const Svg: Story;
8
- export declare const Modal: Story;
8
+ export declare const LongAlt: Story;
9
9
  export declare const Invalid: Story;
@@ -8,6 +8,7 @@ export interface ElmImageProps {
8
8
  * Image alt text
9
9
  */
10
10
  alt?: string;
11
+ block?: boolean;
11
12
  /**
12
13
  * Enable modal on image click. Default: `false`
13
14
  */
@@ -18,6 +19,7 @@ export interface ElmImageProps {
18
19
  margin?: Property.MarginBlock;
19
20
  }
20
21
  declare const _default: import('vue').DefineComponent<ElmImageProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ElmImageProps> & Readonly<{}>, {
22
+ block: boolean;
21
23
  enableModal: boolean;
22
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
24
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
23
25
  export default _default;
@@ -1,23 +1,10 @@
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-a6508d78],.v-leave-from[data-v-a6508d78]{opacity:1}.v-enter-active[data-v-a6508d78],.v-leave-active[data-v-a6508d78]{transition:opacity .3s}.v-enter-from[data-v-a6508d78],.v-leave-to[data-v-a6508d78]{opacity:0}"));
7
- document.head.appendChild(elementStyle);
8
- }
9
- } catch (e) {
10
- console.error("vite-plugin-css-injected-by-js", e);
11
- }
12
- })();
13
1
  import _sfc_main from "./ElmImage.vue2.mjs";
14
2
  import style0 from "./ElmImage.vue3.mjs";
15
-
16
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
17
4
  const cssModules = {
18
5
  "$style": style0
19
6
  };
20
- const ElmImage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-a6508d78"]]);
7
+ const ElmImage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
21
8
  export {
22
9
  ElmImage as default
23
10
  };
@@ -1,8 +1,11 @@
1
- import { defineComponent, ref, createElementBlock, openBlock, Fragment, createVNode, Transition, withCtx, unref, normalizeClass, normalizeStyle, createElementVNode, createCommentVNode } from "vue";
1
+ import { defineComponent, ref, createElementBlock, openBlock, normalizeClass, createVNode, Transition, unref, withCtx, normalizeStyle, createElementVNode, createCommentVNode } from "vue";
2
2
  import ElmRectangleWave from "../fallback/ElmRectangleWave.vue.mjs";
3
3
  import ElmDotLoadingIcon from "../icon/ElmDotLoadingIcon.vue.mjs";
4
4
  import { useImage, onKeyStroke } from "@vueuse/core";
5
5
  import ElmInlineText from "../typography/ElmInlineText.vue.mjs";
6
+ import fadeStyle from "../../styles/transition-fade.module.scss.mjs";
7
+ import { mdiMessageImageOutline } from "@mdi/js";
8
+ import ElmMdiIcon from "../icon/ElmMdiIcon.vue.mjs";
6
9
  const _hoisted_1 = ["src", "alt"];
7
10
  const _hoisted_2 = ["src", "alt"];
8
11
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -10,6 +13,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10
13
  props: {
11
14
  src: {},
12
15
  alt: {},
16
+ block: { type: Boolean, default: false },
13
17
  enableModal: { type: Boolean, default: false },
14
18
  margin: {}
15
19
  },
@@ -22,8 +26,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
22
26
  isModalOpen.value = false;
23
27
  });
24
28
  return (_ctx, _cache) => {
25
- return openBlock(), createElementBlock(Fragment, null, [
26
- createVNode(Transition, { mode: "out-in" }, {
29
+ return openBlock(), createElementBlock("div", {
30
+ class: normalizeClass(_ctx.$style.wrapper)
31
+ }, [
32
+ createVNode(Transition, {
33
+ mode: "out-in",
34
+ "enter-from-class": unref(fadeStyle)["fade-enter-from"],
35
+ "enter-active-class": unref(fadeStyle)["fade-enter-active"],
36
+ "enter-to-class": unref(fadeStyle)["fade-fast-enter-to"],
37
+ "leave-from-class": unref(fadeStyle)["fade-fast-leave-from"],
38
+ "leave-active-class": unref(fadeStyle)["fade-fast-leave-active"],
39
+ "leave-to-class": unref(fadeStyle)["fade-fast-leave-to"]
40
+ }, {
27
41
  default: withCtx(() => [
28
42
  unref(error) ? (openBlock(), createElementBlock("div", {
29
43
  key: 0,
@@ -45,26 +59,56 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
45
59
  ])
46
60
  ], 6)) : (openBlock(), createElementBlock("img", {
47
61
  key: 2,
48
- class: normalizeClass(_ctx.$style.image),
62
+ class: normalizeClass(_ctx.block ? _ctx.$style["image-block"] : _ctx.$style.image),
49
63
  src: _ctx.src,
50
64
  alt: _ctx.alt,
51
- onClick: _cache[0] || (_cache[0] = () => {
52
- if (_ctx.enableModal) {
53
- isModalOpen.value = true;
54
- }
55
- }),
65
+ onClick: _cache[0] || (_cache[0] = ($event) => isModalOpen.value = true),
56
66
  style: normalizeStyle({
57
- "--height": unref(isLoading) ? "0" : "auto",
58
- "--opacity": unref(isLoading) ? 0 : 1,
59
67
  "--cursor": _ctx.enableModal ? "zoom-in" : "inherit",
60
- "--margin-block": _ctx.margin,
61
- display: unref(isLoading) ? "none" : "block"
68
+ "--margin-block": _ctx.margin
62
69
  })
63
70
  }, null, 14, _hoisted_1))
64
71
  ]),
65
72
  _: 1
66
- }),
67
- createVNode(Transition, null, {
73
+ }, 8, ["enter-from-class", "enter-active-class", "enter-to-class", "leave-from-class", "leave-active-class", "leave-to-class"]),
74
+ createVNode(Transition, {
75
+ "enter-from-class": unref(fadeStyle)["fade-enter-from"],
76
+ "enter-active-class": unref(fadeStyle)["fade-enter-active"],
77
+ "enter-to-class": unref(fadeStyle)["fade-enter-to"],
78
+ "leave-from-class": unref(fadeStyle)["fade-leave-from"],
79
+ "leave-active-class": unref(fadeStyle)["fade-leave-active"],
80
+ "leave-to-class": unref(fadeStyle)["fade-leave-to"]
81
+ }, {
82
+ default: withCtx(() => [
83
+ _ctx.block && !unref(isLoading) && _ctx.alt != null && _ctx.alt.trim() !== "" ? (openBlock(), createElementBlock("div", {
84
+ key: 0,
85
+ class: normalizeClass(_ctx.$style["alt-container"])
86
+ }, [
87
+ createVNode(ElmMdiIcon, {
88
+ d: unref(mdiMessageImageOutline),
89
+ color: "#6987b8",
90
+ style: { "flex-shrink": "0" }
91
+ }, null, 8, ["d"]),
92
+ createElementVNode("div", {
93
+ class: normalizeClass(_ctx.$style["alt-text"])
94
+ }, [
95
+ createVNode(ElmInlineText, {
96
+ text: _ctx.alt,
97
+ size: "0.8rem"
98
+ }, null, 8, ["text"])
99
+ ], 2)
100
+ ], 2)) : createCommentVNode("", true)
101
+ ]),
102
+ _: 1
103
+ }, 8, ["enter-from-class", "enter-active-class", "enter-to-class", "leave-from-class", "leave-active-class", "leave-to-class"]),
104
+ createVNode(Transition, {
105
+ "enter-from-class": unref(fadeStyle)["fade-enter-from"],
106
+ "enter-active-class": unref(fadeStyle)["fade-enter-active"],
107
+ "enter-to-class": unref(fadeStyle)["fade-enter-to"],
108
+ "leave-from-class": unref(fadeStyle)["fade-leave-from"],
109
+ "leave-active-class": unref(fadeStyle)["fade-leave-active"],
110
+ "leave-to-class": unref(fadeStyle)["fade-leave-to"]
111
+ }, {
68
112
  default: withCtx(() => [
69
113
  isModalOpen.value ? (openBlock(), createElementBlock("div", {
70
114
  key: 0,
@@ -74,15 +118,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
74
118
  class: normalizeClass(_ctx.$style["modal-image"]),
75
119
  src: _ctx.src,
76
120
  alt: _ctx.alt,
77
- onClick: _cache[1] || (_cache[1] = () => {
78
- isModalOpen.value = false;
79
- })
121
+ onClick: _cache[1] || (_cache[1] = ($event) => isModalOpen.value = false)
80
122
  }, null, 10, _hoisted_2)
81
123
  ], 2)) : createCommentVNode("", true)
82
124
  ]),
83
125
  _: 1
84
- })
85
- ], 64);
126
+ }, 8, ["enter-from-class", "enter-active-class", "enter-to-class", "leave-from-class", "leave-active-class", "leave-to-class"])
127
+ ], 2);
86
128
  };
87
129
  }
88
130
  });
@@ -3,28 +3,33 @@
3
3
  try {
4
4
  if (typeof document != "undefined") {
5
5
  var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode("._image_151nq_1{display:block;margin-block:var(--margin-block);max-width:100%;height:var(--height);opacity:var(--opacity);transition:opacity .4s;cursor:var(--cursor)}._error_151nq_11{display:flex;justify-content:center;align-items:center;gap:1rem;width:100%;height:100%;min-height:10rem;line-height:1.5rem;color:#c56565}._fallback_151nq_23{margin-block:var(--margin-block);margin:0;padding:0;position:relative;width:100%;z-index:1;display:flex;justify-content:center;align-items:center;aspect-ratio:1200/630}._modal_151nq_36{z-index:1000;position:fixed;width:100%;height:100vh;top:0;left:0;background-color:#000000b3;display:flex;justify-content:center;align-items:center;cursor:zoom-out}._modal_151nq_36 ._modal-image_151nq_49{width:100vw;height:100vh;-o-object-fit:contain;object-fit:contain}"));
6
+ elementStyle.appendChild(document.createTextNode("._wrapper_nf1kx_1{width:100%;display:flex;flex-direction:column;align-items:center}._image_nf1kx_8{display:block;margin-block:var(--margin-block);max-width:100%;cursor:var(--cursor)}._error_nf1kx_15{display:flex;justify-content:center;align-items:center;gap:1rem;width:100%;height:100%;min-height:10rem;line-height:1.5rem;color:#c56565}._fallback_nf1kx_27{margin-block:var(--margin-block);margin:0;padding:0;position:relative;width:100%;z-index:1;display:flex;justify-content:center;align-items:center;aspect-ratio:1200/630}._image-block_nf1kx_40{overflow:hidden;border-radius:.25rem;box-shadow:0 0 .125rem #0000004d;display:block;max-width:100%;cursor:zoom-in}._alt-container_nf1kx_49{max-width:80%;margin:1rem;display:flex;justify-content:center;align-items:center;gap:1rem;color:#6987b8;opacity:.8}._modal_nf1kx_60{position:fixed;z-index:10;top:0;left:0;width:100%;height:100vh;display:flex;justify-content:center;align-items:center;background-color:#23262acc;cursor:zoom-out}._modal-image_nf1kx_74{display:block;max-width:100%}"));
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 image = "_image_151nq_1";
14
- const error = "_error_151nq_11";
15
- const fallback = "_fallback_151nq_23";
16
- const modal = "_modal_151nq_36";
13
+ const wrapper = "_wrapper_nf1kx_1";
14
+ const image = "_image_nf1kx_8";
15
+ const error = "_error_nf1kx_15";
16
+ const fallback = "_fallback_nf1kx_27";
17
+ const modal = "_modal_nf1kx_60";
17
18
  const style0 = {
19
+ wrapper,
18
20
  image,
19
21
  error,
20
22
  fallback,
23
+ "image-block": "_image-block_nf1kx_40",
24
+ "alt-container": "_alt-container_nf1kx_49",
21
25
  modal,
22
- "modal-image": "_modal-image_151nq_49"
26
+ "modal-image": "_modal-image_nf1kx_74"
23
27
  };
24
28
  export {
25
29
  style0 as default,
26
30
  error,
27
31
  fallback,
28
32
  image,
29
- modal
33
+ modal,
34
+ wrapper
30
35
  };
@@ -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-610548e5],.v-leave-from[data-v-610548e5]{opacity:1}.v-enter-active[data-v-610548e5],.v-leave-active[data-v-610548e5]{transition:opacity .1s}.v-enter-from[data-v-610548e5],.v-leave-to[data-v-610548e5]{opacity:0}\n.v-enter-to[data-v-a6508d78],.v-leave-from[data-v-a6508d78]{opacity:1}.v-enter-active[data-v-a6508d78],.v-leave-active[data-v-a6508d78]{transition:opacity .3s}.v-enter-from[data-v-a6508d78],.v-leave-to[data-v-a6508d78]{opacity:0}\n.v-enter-to[data-v-ea96c386],.v-leave-from[data-v-ea96c386]{opacity:1}.v-enter-active[data-v-ea96c386],.v-leave-active[data-v-ea96c386]{transition:opacity .15s}.v-enter-from[data-v-ea96c386],.v-leave-to[data-v-ea96c386]{opacity:0}\n.v-enter-to[data-v-83a74154],.v-leave-from[data-v-83a74154]{opacity:1}.v-enter-active[data-v-83a74154],.v-leave-active[data-v-83a74154]{transition:opacity .2s}.v-enter-from[data-v-83a74154],.v-leave-to[data-v-83a74154]{opacity:0}\n.fade-enter-active[data-v-12f55baa],.fade-leave-active[data-v-12f55baa]{transition:all .3s ease}.fade-enter-from[data-v-12f55baa],.fade-leave-to[data-v-12f55baa]{opacity:0;transform:translate(30px)}\n.v-enter-to[data-v-84bc9c5d],.v-leave-from[data-v-84bc9c5d]{opacity:1}.v-enter-active[data-v-84bc9c5d],.v-leave-active[data-v-84bc9c5d]{transition:opacity .15s}.v-enter-from[data-v-84bc9c5d],.v-leave-to[data-v-84bc9c5d]{opacity:0}\n.v-enter-to[data-v-f6774eea],.v-leave-from[data-v-f6774eea]{opacity:1}.v-enter-active[data-v-f6774eea],.v-leave-active[data-v-f6774eea]{transition:opacity .1s}.v-enter-from[data-v-f6774eea],.v-leave-to[data-v-f6774eea]{opacity:0}\n.v-enter-to[data-v-4e995755],.v-leave-from[data-v-4e995755]{opacity:1}.v-enter-active[data-v-4e995755],.v-leave-active[data-v-4e995755]{transition:opacity .3s}.v-enter-from[data-v-4e995755],.v-leave-to[data-v-4e995755]{opacity:0}\n.elmethis-list-common{margin-block:1rem;opacity:var(--opacity);transition:opacity .8s;box-sizing:border-box;padding-left:1.25rem}.elmethis-bulleted-list li{box-sizing:border-box;padding-left:.5rem;margin-block:.75rem}.elmethis-bulleted-list li::marker{content:url(data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMTYgMTYnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICA+CiAgICA8cGF0aAogICAgICBmaWxsPScjNDQ5NzYzJwogICAgICBvcGFjaXR5PScwLjgnCiAgICAgIGQ9J00zIDMuNzMyYTEuNSAxLjUgMCAwIDEgMi4zMDUtMS4yNjVsNi43MDYgNC4yNjdhMS41IDEuNSAwIDAgMSAwIDIuNTMxbC02LjcwNiA0LjI2OEExLjUgMS41IDAgMCAxIDMgMTIuMjY3VjMuNzMyWicKICAgIC8+CiAgPC9zdmc+)}.elmethis-bulleted-list li ul li::marker{content:url(data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMjQgMjQnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICAgIHN0cm9rZT0nIzQ0OTc2MycKICAgIGZpbGw9J3RyYW5zcGFyZW50JwogID4KICAgIDxwYXRoCiAgICAgIHN0cm9rZUxpbmVjYXA9J3JvdW5kJwogICAgICBzdHJva2VMaW5lam9pbj0ncm91bmQnCiAgICAgIGQ9J001LjI1IDUuNjUzYzAtLjg1Ni45MTctMS4zOTggMS42NjctLjk4NmwxMS41NCA2LjM0N2ExLjEyNSAxLjEyNSAwIDAgMSAwIDEuOTcybC0xMS41NCA2LjM0N2ExLjEyNSAxLjEyNSAwIDAgMS0xLjY2Ny0uOTg2VjUuNjUzWicKICAgIC8+CiAgPC9zdmc+)}.elmethis-bulleted-list li ul li ul li::marker{content:url(data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMjAgMjAnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICAgIHN0cm9rZT0nIzQ0OTc2MycKICAgIGZpbGw9JyM0NDk3NjMnCiAgPgogICAgPHBhdGgKICAgICAgZmlsbFJ1bGU9J2V2ZW5vZGQnCiAgICAgIGQ9J004LjIyIDUuMjJhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0LjI1IDQuMjVhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNC4yNSA0LjI1YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTEuOTQgMTAgOC4yMiA2LjI4YS43NS43NSAwIDAgMSAwLTEuMDZaJwogICAgICBjbGlwUnVsZT0nZXZlbm9kZCcKICAgIC8+CiAgPC9zdmc+)}.elmethis-numbered-list li{box-sizing:border-box;padding-left:.25rem;margin-block:.75rem;margin-left:.25rem;list-style-type:decimal}.elmethis-numbered-list li::marker{font-weight:700;color:#9771bd}.elmethis-numbered-list li ol li{list-style-type:lower-alpha}.elmethis-numbered-list li ol li ol li{list-style-type:lower-roman}.elmethis-numbered-list li ol li ol li ol li{list-style-type:lower-greek}"));
6
+ elementStyle.appendChild(document.createTextNode(".v-enter-to[data-v-610548e5],.v-leave-from[data-v-610548e5]{opacity:1}.v-enter-active[data-v-610548e5],.v-leave-active[data-v-610548e5]{transition:opacity .1s}.v-enter-from[data-v-610548e5],.v-leave-to[data-v-610548e5]{opacity:0}\n.v-enter-to[data-v-fd68c0a3],.v-leave-from[data-v-fd68c0a3]{opacity:1}.v-enter-active[data-v-fd68c0a3],.v-leave-active[data-v-fd68c0a3]{transition:opacity .15s}.v-enter-from[data-v-fd68c0a3],.v-leave-to[data-v-fd68c0a3]{opacity:0}\n.v-enter-to[data-v-83a74154],.v-leave-from[data-v-83a74154]{opacity:1}.v-enter-active[data-v-83a74154],.v-leave-active[data-v-83a74154]{transition:opacity .2s}.v-enter-from[data-v-83a74154],.v-leave-to[data-v-83a74154]{opacity:0}\n.fade-enter-active[data-v-12f55baa],.fade-leave-active[data-v-12f55baa]{transition:all .3s ease}.fade-enter-from[data-v-12f55baa],.fade-leave-to[data-v-12f55baa]{opacity:0;transform:translate(30px)}\n.v-enter-to[data-v-84bc9c5d],.v-leave-from[data-v-84bc9c5d]{opacity:1}.v-enter-active[data-v-84bc9c5d],.v-leave-active[data-v-84bc9c5d]{transition:opacity .15s}.v-enter-from[data-v-84bc9c5d],.v-leave-to[data-v-84bc9c5d]{opacity:0}\n.v-enter-to[data-v-f6774eea],.v-leave-from[data-v-f6774eea]{opacity:1}.v-enter-active[data-v-f6774eea],.v-leave-active[data-v-f6774eea]{transition:opacity .1s}.v-enter-from[data-v-f6774eea],.v-leave-to[data-v-f6774eea]{opacity:0}\n.v-enter-to[data-v-4e995755],.v-leave-from[data-v-4e995755]{opacity:1}.v-enter-active[data-v-4e995755],.v-leave-active[data-v-4e995755]{transition:opacity .3s}.v-enter-from[data-v-4e995755],.v-leave-to[data-v-4e995755]{opacity:0}\n.elmethis-list-common{margin-block:1rem;opacity:var(--opacity);transition:opacity .8s;box-sizing:border-box;padding-left:1.25rem}.elmethis-bulleted-list li{box-sizing:border-box;padding-left:.5rem;margin-block:.75rem}.elmethis-bulleted-list li::marker{content:url(data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMTYgMTYnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICA+CiAgICA8cGF0aAogICAgICBmaWxsPScjNDQ5NzYzJwogICAgICBvcGFjaXR5PScwLjgnCiAgICAgIGQ9J00zIDMuNzMyYTEuNSAxLjUgMCAwIDEgMi4zMDUtMS4yNjVsNi43MDYgNC4yNjdhMS41IDEuNSAwIDAgMSAwIDIuNTMxbC02LjcwNiA0LjI2OEExLjUgMS41IDAgMCAxIDMgMTIuMjY3VjMuNzMyWicKICAgIC8+CiAgPC9zdmc+)}.elmethis-bulleted-list li ul li::marker{content:url(data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMjQgMjQnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICAgIHN0cm9rZT0nIzQ0OTc2MycKICAgIGZpbGw9J3RyYW5zcGFyZW50JwogID4KICAgIDxwYXRoCiAgICAgIHN0cm9rZUxpbmVjYXA9J3JvdW5kJwogICAgICBzdHJva2VMaW5lam9pbj0ncm91bmQnCiAgICAgIGQ9J001LjI1IDUuNjUzYzAtLjg1Ni45MTctMS4zOTggMS42NjctLjk4NmwxMS41NCA2LjM0N2ExLjEyNSAxLjEyNSAwIDAgMSAwIDEuOTcybC0xMS41NCA2LjM0N2ExLjEyNSAxLjEyNSAwIDAgMS0xLjY2Ny0uOTg2VjUuNjUzWicKICAgIC8+CiAgPC9zdmc+)}.elmethis-bulleted-list li ul li ul li::marker{content:url(data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMjAgMjAnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICAgIHN0cm9rZT0nIzQ0OTc2MycKICAgIGZpbGw9JyM0NDk3NjMnCiAgPgogICAgPHBhdGgKICAgICAgZmlsbFJ1bGU9J2V2ZW5vZGQnCiAgICAgIGQ9J004LjIyIDUuMjJhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0LjI1IDQuMjVhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNC4yNSA0LjI1YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTEuOTQgMTAgOC4yMiA2LjI4YS43NS43NSAwIDAgMSAwLTEuMDZaJwogICAgICBjbGlwUnVsZT0nZXZlbm9kZCcKICAgIC8+CiAgPC9zdmc+)}.elmethis-numbered-list li{box-sizing:border-box;padding-left:.25rem;margin-block:.75rem;margin-left:.25rem;list-style-type:decimal}.elmethis-numbered-list li::marker{font-weight:700;color:#9771bd}.elmethis-numbered-list li ol li{list-style-type:lower-alpha}.elmethis-numbered-list li ol li ol li{list-style-type:lower-roman}.elmethis-numbered-list li ol li ol li ol li{list-style-type:lower-greek}"));
7
7
  document.head.appendChild(elementStyle);
8
8
  }
9
9
  } catch (e) {
@@ -15,7 +15,6 @@ import "@mdi/js";
15
15
 
16
16
  import "polished";
17
17
  import "@vueuse/core";
18
-
19
18
  import ElmBlockFallback from "../fallback/ElmBlockFallback.vue.mjs";
20
19
 
21
20
 
@@ -79,8 +78,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
79
78
  loader: () => import("../media/ElmFile.vue.mjs"),
80
79
  loadingComponent: ElmBlockFallback
81
80
  });
82
- const AsyncElmBlockImage = defineAsyncComponent({
83
- loader: () => import("../media/ElmBlockImage.vue.mjs"),
81
+ const AsyncElmImage = defineAsyncComponent({
82
+ loader: () => import("../media/ElmImage.vue.mjs"),
84
83
  loadingComponent: ElmBlockFallback
85
84
  });
86
85
  const AsyncElmCodeBlock = defineAsyncComponent({
@@ -175,9 +174,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
175
174
  image: props2.image
176
175
  }),
177
176
  File: ({ props: props2 }) => h(AsyncElmFile, { src: props2.src, name: props2.name }),
178
- Image: ({ props: props2 }) => h(AsyncElmBlockImage, {
177
+ Image: ({ props: props2 }) => h(AsyncElmImage, {
179
178
  src: props2.src,
180
- alt: props2.alt
179
+ alt: props2.alt,
180
+ block: true,
181
+ enableModal: true
181
182
  }),
182
183
  CodeBlock: ({ props: props2, slots }) => slots != null ? h(
183
184
  AsyncElmCodeBlock,
package/dist/index.d.ts CHANGED
@@ -58,8 +58,6 @@ export type { ElmMdiIconProps } from './components/icon/ElmMdiIcon.vue';
58
58
  export { default as ElmMdiIcon } from './components/icon/ElmMdiIcon.vue';
59
59
  export type { ElmToggleThemeProps } from './components/icon/ElmToggleTheme.vue';
60
60
  export { default as ElmToggleTheme } from './components/icon/ElmToggleTheme.vue';
61
- export type { ElmBlockImageProps } from './components/media/ElmBlockImage.vue';
62
- export { default as ElmBlockImage } from './components/media/ElmImage.vue';
63
61
  export type { ElmFileProps } from './components/media/ElmFile.vue';
64
62
  export { default as ElmFile } from './components/media/ElmFile.vue';
65
63
  export type { ElmImageProps } from './components/media/ElmImage.vue';
package/dist/index.mjs CHANGED
@@ -40,64 +40,63 @@ import { default as default28 } from "./components/icon/ElmLanguageIcon.vue.mjs"
40
40
  import { default as default29 } from "./components/icon/ElmLoginIcon.vue.mjs";
41
41
  import { default as default30 } from "./components/icon/ElmMdiIcon.vue.mjs";
42
42
  import { default as default31 } from "./components/icon/ElmToggleTheme.vue.mjs";
43
- import { default as default32, default as default33 } from "./components/media/ElmImage.vue.mjs";
44
- import { default as default34 } from "./components/media/ElmFile.vue.mjs";
45
- import { default as default35 } from "./components/navigation/ElmBookmark.vue.mjs";
46
- import { default as default36 } from "./components/navigation/ElmBreadcrumb.vue.mjs";
47
- import { default as default37 } from "./components/navigation/ElmPagetop.vue.mjs";
48
- import { default as default38 } from "./components/navigation/ElmTableOfContents.vue.mjs";
49
- import { default as default39 } from "./components/others/ElmColorSample.vue.mjs";
50
- import { default as default40 } from "./components/others/ElmColorTable.vue.mjs";
51
- import { default as default41 } from "./components/others/ElmJsonComponentRenderer.vue.mjs";
52
- import { default as default42 } from "./components/table/ElmTable.vue.mjs";
53
- import { default as default43 } from "./components/table/ElmTableHeader.vue.mjs";
54
- import { default as default44 } from "./components/table/ElmTableBody.vue.mjs";
55
- import { default as default45 } from "./components/table/ElmTableRow.vue.mjs";
56
- import { default as default46 } from "./components/table/ElmTableCell.vue.mjs";
57
- import { default as default47 } from "./components/typography/ElmBlockQuote.vue.mjs";
58
- import { default as default48 } from "./components/typography/ElmCallout.vue.mjs";
59
- import { default as default49 } from "./components/typography/ElmDivider.vue.mjs";
60
- import { default as default50 } from "./components/typography/ElmFragmentIdentifier.vue.mjs";
61
- import { default as default51 } from "./components/typography/ElmHeading.vue.mjs";
62
- import { default as default52 } from "./components/typography/ElmInlineText.vue.mjs";
63
- import { default as default53 } from "./components/typography/ElmParagraph.vue.mjs";
64
- import { default as default54 } from "./components/typography/ElmList.vue.mjs";
43
+ import { default as default32 } from "./components/media/ElmFile.vue.mjs";
44
+ import { default as default33 } from "./components/media/ElmImage.vue.mjs";
45
+ import { default as default34 } from "./components/navigation/ElmBookmark.vue.mjs";
46
+ import { default as default35 } from "./components/navigation/ElmBreadcrumb.vue.mjs";
47
+ import { default as default36 } from "./components/navigation/ElmPagetop.vue.mjs";
48
+ import { default as default37 } from "./components/navigation/ElmTableOfContents.vue.mjs";
49
+ import { default as default38 } from "./components/others/ElmColorSample.vue.mjs";
50
+ import { default as default39 } from "./components/others/ElmColorTable.vue.mjs";
51
+ import { default as default40 } from "./components/others/ElmJsonComponentRenderer.vue.mjs";
52
+ import { default as default41 } from "./components/table/ElmTable.vue.mjs";
53
+ import { default as default42 } from "./components/table/ElmTableHeader.vue.mjs";
54
+ import { default as default43 } from "./components/table/ElmTableBody.vue.mjs";
55
+ import { default as default44 } from "./components/table/ElmTableRow.vue.mjs";
56
+ import { default as default45 } from "./components/table/ElmTableCell.vue.mjs";
57
+ import { default as default46 } from "./components/typography/ElmBlockQuote.vue.mjs";
58
+ import { default as default47 } from "./components/typography/ElmCallout.vue.mjs";
59
+ import { default as default48 } from "./components/typography/ElmDivider.vue.mjs";
60
+ import { default as default49 } from "./components/typography/ElmFragmentIdentifier.vue.mjs";
61
+ import { default as default50 } from "./components/typography/ElmHeading.vue.mjs";
62
+ import { default as default51 } from "./components/typography/ElmInlineText.vue.mjs";
63
+ import { default as default52 } from "./components/typography/ElmParagraph.vue.mjs";
64
+ import { default as default53 } from "./components/typography/ElmList.vue.mjs";
65
65
 
66
66
  import { useElmethisTheme } from "./hooks/useElmethisTheme.mjs";
67
67
  import { useTyping } from "./hooks/useTyping.mjs";
68
68
  export {
69
69
  default24 as ElmArrowIcon,
70
70
  default16 as ElmBlockFallback,
71
- default32 as ElmBlockImage,
72
- default47 as ElmBlockQuote,
73
- default35 as ElmBookmark,
71
+ default46 as ElmBlockQuote,
72
+ default34 as ElmBookmark,
74
73
  default25 as ElmBookmarkIcon,
75
- default36 as ElmBreadcrumb,
74
+ default35 as ElmBreadcrumb,
76
75
  default19 as ElmButton,
77
- default48 as ElmCallout,
76
+ default47 as ElmCallout,
78
77
  default20 as ElmCheckbox,
79
78
  default2 as ElmCodeBlock,
80
- default39 as ElmColorSample,
81
- default40 as ElmColorTable,
79
+ default38 as ElmColorSample,
80
+ default39 as ElmColorTable,
82
81
  default26 as ElmCubeIcon,
83
82
  default4 as ElmDesktopWindow,
84
- default49 as ElmDivider,
83
+ default48 as ElmDivider,
85
84
  default27 as ElmDotLoadingIcon,
86
- default34 as ElmFile,
87
- default50 as ElmFragmentIdentifier,
88
- default51 as ElmHeading,
85
+ default32 as ElmFile,
86
+ default49 as ElmFragmentIdentifier,
87
+ default50 as ElmHeading,
89
88
  default33 as ElmImage,
90
- default52 as ElmInlineText,
91
- default41 as ElmJsonComponentRenderer,
89
+ default51 as ElmInlineText,
90
+ default40 as ElmJsonComponentRenderer,
92
91
  default3 as ElmKatex,
93
92
  default28 as ElmLanguageIcon,
94
- default54 as ElmList,
93
+ default53 as ElmList,
95
94
  default29 as ElmLoginIcon,
96
95
  default30 as ElmMdiIcon,
97
96
  default5 as ElmModal,
98
97
  default13 as ElmMultiProgress,
99
- default37 as ElmPagetop,
100
- default53 as ElmParagraph,
98
+ default36 as ElmPagetop,
99
+ default52 as ElmParagraph,
101
100
  default6 as ElmParallax,
102
101
  default12 as ElmProgress,
103
102
  default15 as ElmRectangleWave,
@@ -108,12 +107,12 @@ export {
108
107
  default17 as ElmSpinner,
109
108
  default14 as ElmStatusMessage,
110
109
  default22 as ElmSwitch,
111
- default42 as ElmTable,
112
- default44 as ElmTableBody,
113
- default46 as ElmTableCell,
114
- default43 as ElmTableHeader,
115
- default38 as ElmTableOfContents,
116
- default45 as ElmTableRow,
110
+ default41 as ElmTable,
111
+ default43 as ElmTableBody,
112
+ default45 as ElmTableCell,
113
+ default42 as ElmTableHeader,
114
+ default37 as ElmTableOfContents,
115
+ default44 as ElmTableRow,
117
116
  default23 as ElmTextField,
118
117
  default10 as ElmToggle,
119
118
  default31 as ElmToggleTheme,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmethis/core",
3
- "version": "0.1.9",
3
+ "version": "0.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -24,30 +24,30 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@mdi/js": "^7.4.47",
27
- "@vueuse/core": "^13.1.0",
27
+ "@vueuse/core": "^13.2.0",
28
28
  "katex": "^0.16.22",
29
29
  "lodash-es": "^4.17.21",
30
30
  "nanoid": "^5.1.5",
31
31
  "polished": "^4.3.1",
32
- "shiki": "^3.4.0"
32
+ "shiki": "^3.4.2"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@notionhq/client": "^3.0.1",
36
- "@storybook/vue3": "^8.6.12",
36
+ "@storybook/vue3": "^8.6.14",
37
37
  "@types/json-schema": "^7.0.15",
38
38
  "@types/katex": "^0.16.7",
39
39
  "@types/lodash-es": "^4.17.12",
40
40
  "@types/prismjs": "^1.26.5",
41
- "@vitejs/plugin-vue": "^5.2.3",
41
+ "@vitejs/plugin-vue": "^5.2.4",
42
42
  "csstype": "^3.1.3",
43
43
  "jarkup-ts": "^0.4.1",
44
44
  "openapi-types": "^12.1.3",
45
45
  "postcss": "^8.5.3",
46
46
  "postcss-preset-env": "^10.1.6",
47
- "sass": "^1.87.0",
47
+ "sass": "^1.89.0",
48
48
  "vite": "^6.3.5",
49
49
  "vite-plugin-css-injected-by-js": "^3.5.2",
50
- "vite-plugin-dts": "^4.5.3",
50
+ "vite-plugin-dts": "^4.5.4",
51
51
  "vue-tsc": "^2.2.10"
52
52
  },
53
53
  "peerDependencies": {
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/vue3';
2
- import { default as ElmBlockImage } from './ElmBlockImage.vue';
3
- declare const meta: Meta<typeof ElmBlockImage>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const Primary: Story;
7
- export declare const Svg: Story;
8
- export declare const LongAlt: Story;
9
- export declare const Invalid: Story;
@@ -1,12 +0,0 @@
1
- export interface ElmBlockImageProps {
2
- /**
3
- * Image source URL
4
- */
5
- src: string;
6
- /**
7
- * Image alt text
8
- */
9
- alt?: string;
10
- }
11
- declare const _default: import('vue').DefineComponent<ElmBlockImageProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ElmBlockImageProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
- export default _default;
@@ -1,23 +0,0 @@
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-42e56906],.v-leave-from[data-v-42e56906]{opacity:1}.v-enter-active[data-v-42e56906],.v-leave-active[data-v-42e56906]{transition:opacity .3s}.v-enter-from[data-v-42e56906],.v-leave-to[data-v-42e56906]{opacity:0}"));
7
- document.head.appendChild(elementStyle);
8
- }
9
- } catch (e) {
10
- console.error("vite-plugin-css-injected-by-js", e);
11
- }
12
- })();
13
- import _sfc_main from "./ElmBlockImage.vue2.mjs";
14
- import style0 from "./ElmBlockImage.vue3.mjs";
15
-
16
- import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
17
- const cssModules = {
18
- "$style": style0
19
- };
20
- const ElmBlockImage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-42e56906"]]);
21
- export {
22
- ElmBlockImage as default
23
- };
@@ -1,117 +0,0 @@
1
- import { defineComponent, ref, createElementBlock, openBlock, Fragment, createElementVNode, createVNode, normalizeClass, Transition, withCtx, unref, normalizeStyle, createCommentVNode } from "vue";
2
- import ElmRectangleWave from "../fallback/ElmRectangleWave.vue.mjs";
3
- import ElmDotLoadingIcon from "../icon/ElmDotLoadingIcon.vue.mjs";
4
- import { useImage, onKeyStroke } from "@vueuse/core";
5
- import ElmInlineText from "../typography/ElmInlineText.vue.mjs";
6
- import { mdiMessageImageOutline } from "@mdi/js";
7
- const _hoisted_1 = ["src", "alt"];
8
- const _hoisted_2 = ["d"];
9
- const _hoisted_3 = ["src", "alt"];
10
- const _sfc_main = /* @__PURE__ */ defineComponent({
11
- __name: "ElmBlockImage",
12
- props: {
13
- src: {},
14
- alt: {}
15
- },
16
- setup(__props) {
17
- const props = __props;
18
- const { isLoading, error } = useImage({ src: props.src });
19
- const isModalOpen = ref(false);
20
- onKeyStroke("Escape", (e) => {
21
- e.preventDefault();
22
- isModalOpen.value = false;
23
- });
24
- return (_ctx, _cache) => {
25
- return openBlock(), createElementBlock(Fragment, null, [
26
- createElementVNode("div", {
27
- class: normalizeClass(_ctx.$style.container)
28
- }, [
29
- createVNode(Transition, { mode: "out-in" }, {
30
- default: withCtx(() => [
31
- unref(error) ? (openBlock(), createElementBlock("div", {
32
- key: 0,
33
- class: normalizeClass(_ctx.$style.error)
34
- }, [
35
- createVNode(ElmInlineText, {
36
- text: "Error loading image",
37
- color: "#c56565",
38
- size: "1.5rem"
39
- })
40
- ], 2)) : unref(isLoading) ? (openBlock(), createElementBlock("div", {
41
- key: 1,
42
- class: normalizeClass(_ctx.$style.fallback)
43
- }, [
44
- createVNode(ElmRectangleWave),
45
- createElementVNode("div", null, [
46
- createVNode(ElmDotLoadingIcon)
47
- ])
48
- ], 2)) : (openBlock(), createElementBlock("img", {
49
- key: 2,
50
- class: normalizeClass(_ctx.$style.image),
51
- src: _ctx.src,
52
- alt: _ctx.alt,
53
- onClick: _cache[0] || (_cache[0] = () => {
54
- isModalOpen.value = true;
55
- }),
56
- style: normalizeStyle({
57
- "--height": unref(isLoading) ? "0" : "auto",
58
- "--opacity": unref(isLoading) ? 0 : 1,
59
- display: unref(isLoading) ? "none" : "block"
60
- })
61
- }, null, 14, _hoisted_1))
62
- ]),
63
- _: 1
64
- })
65
- ], 2),
66
- createVNode(Transition, null, {
67
- default: withCtx(() => [
68
- !unref(isLoading) && _ctx.alt != null && _ctx.alt.trim() !== "" ? (openBlock(), createElementBlock("div", {
69
- key: 0,
70
- class: normalizeClass(_ctx.$style["alt-container"])
71
- }, [
72
- (openBlock(), createElementBlock("svg", {
73
- class: normalizeClass(_ctx.$style["alt-icon"]),
74
- viewBox: "0 0 24 24",
75
- width: "1rem",
76
- height: "1rem",
77
- fill: "currentColor"
78
- }, [
79
- createElementVNode("path", { d: unref(mdiMessageImageOutline) }, null, 8, _hoisted_2)
80
- ], 2)),
81
- createElementVNode("div", {
82
- class: normalizeClass(_ctx.$style["alt-text"])
83
- }, [
84
- createVNode(ElmInlineText, {
85
- text: _ctx.alt,
86
- size: "0.8rem"
87
- }, null, 8, ["text"])
88
- ], 2)
89
- ], 2)) : createCommentVNode("", true)
90
- ]),
91
- _: 1
92
- }),
93
- createVNode(Transition, null, {
94
- default: withCtx(() => [
95
- isModalOpen.value ? (openBlock(), createElementBlock("div", {
96
- key: 0,
97
- class: normalizeClass(_ctx.$style.modal)
98
- }, [
99
- createElementVNode("img", {
100
- class: normalizeClass(_ctx.$style["modal-image"]),
101
- src: _ctx.src,
102
- alt: _ctx.alt,
103
- onClick: _cache[1] || (_cache[1] = () => {
104
- isModalOpen.value = false;
105
- })
106
- }, null, 10, _hoisted_3)
107
- ], 2)) : createCommentVNode("", true)
108
- ]),
109
- _: 1
110
- })
111
- ], 64);
112
- };
113
- }
114
- });
115
- export {
116
- _sfc_main as default
117
- };
@@ -1,36 +0,0 @@
1
- (function() {
2
- "use strict";
3
- try {
4
- if (typeof document != "undefined") {
5
- var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode("._container_1n578_1{margin-block:1rem;width:100%;display:flex;justify-content:center;align-items:center}._image_1n578_9{overflow:hidden;border-radius:.25rem;box-shadow:0 0 .125rem #0000004d;display:block;max-width:100%;height:var(--height);opacity:var(--opacity);transition:opacity .4s;cursor:zoom-in}._alt-container_1n578_21{margin:1rem;display:flex;justify-content:center;align-items:flex-end;gap:.5rem;color:#6987b8;opacity:.8}._alt-icon_1n578_31{fill:#6987b8}._alt-text_1n578_35{width:-moz-fit-content;width:fit-content}._error_1n578_39{display:flex;justify-content:center;align-items:center;gap:1rem;width:100%;height:100%;min-height:10rem;line-height:1.5rem;color:#c56565}._fallback_1n578_51{margin-block:1rem;margin:0;padding:0;position:relative;width:100%;z-index:1;display:flex;justify-content:center;align-items:center;aspect-ratio:1200/630}._modal_1n578_64{z-index:1000;position:fixed;width:100%;height:100vh;top:0;left:0;background-color:#000000b3;display:flex;justify-content:center;align-items:center;cursor:zoom-out}._modal_1n578_64 ._modal-image_1n578_77{width:100vw;height:100vh;-o-object-fit:contain;object-fit:contain}"));
7
- document.head.appendChild(elementStyle);
8
- }
9
- } catch (e) {
10
- console.error("vite-plugin-css-injected-by-js", e);
11
- }
12
- })();
13
- const container = "_container_1n578_1";
14
- const image = "_image_1n578_9";
15
- const error = "_error_1n578_39";
16
- const fallback = "_fallback_1n578_51";
17
- const modal = "_modal_1n578_64";
18
- const style0 = {
19
- container,
20
- image,
21
- "alt-container": "_alt-container_1n578_21",
22
- "alt-icon": "_alt-icon_1n578_31",
23
- "alt-text": "_alt-text_1n578_35",
24
- error,
25
- fallback,
26
- modal,
27
- "modal-image": "_modal-image_1n578_77"
28
- };
29
- export {
30
- container,
31
- style0 as default,
32
- error,
33
- fallback,
34
- image,
35
- modal
36
- };