@elmethis/core 0.2.0 → 0.2.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.
@@ -62,7 +62,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
62
62
  class: normalizeClass(_ctx.block ? _ctx.$style["image-block"] : _ctx.$style.image),
63
63
  src: _ctx.src,
64
64
  alt: _ctx.alt,
65
- onClick: _cache[0] || (_cache[0] = ($event) => isModalOpen.value = true),
65
+ onClick: _cache[0] || (_cache[0] = ($event) => {
66
+ if (_ctx.enableModal) isModalOpen.value = true;
67
+ }),
66
68
  style: normalizeStyle({
67
69
  "--cursor": _ctx.enableModal ? "zoom-in" : "inherit",
68
70
  "--margin-block": _ctx.margin
@@ -3,27 +3,27 @@
3
3
  try {
4
4
  if (typeof document != "undefined") {
5
5
  var elementStyle = document.createElement("style");
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%}"));
6
+ elementStyle.appendChild(document.createTextNode("._wrapper_1cv9j_1{width:100%;display:flex;flex-direction:column;align-items:center}._image_1cv9j_8{display:block;margin-block:var(--margin-block);max-width:100%;max-height:100vh;cursor:var(--cursor)}._error_1cv9j_16{display:flex;justify-content:center;align-items:center;gap:1rem;width:100%;height:100%;min-height:10rem;line-height:1.5rem;color:#c56565}._fallback_1cv9j_28{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_1cv9j_41{overflow:hidden;border-radius:.25rem;box-shadow:0 0 .125rem #0000004d;display:block;max-width:100%;max-height:100vh;cursor:zoom-in}._alt-container_1cv9j_51{max-width:80%;margin:1rem;display:flex;justify-content:center;align-items:center;gap:1rem;color:#6987b8;opacity:.8}._modal_1cv9j_62{position:fixed;z-index:10;top:0;left:0;width:100%;height:100vh;display:flex;justify-content:center;align-items:center;background-color:#23262acc}._modal-image_1cv9j_75{display:block;max-width:100%;cursor:zoom-out}"));
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_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";
13
+ const wrapper = "_wrapper_1cv9j_1";
14
+ const image = "_image_1cv9j_8";
15
+ const error = "_error_1cv9j_16";
16
+ const fallback = "_fallback_1cv9j_28";
17
+ const modal = "_modal_1cv9j_62";
18
18
  const style0 = {
19
19
  wrapper,
20
20
  image,
21
21
  error,
22
22
  fallback,
23
- "image-block": "_image-block_nf1kx_40",
24
- "alt-container": "_alt-container_nf1kx_49",
23
+ "image-block": "_image-block_1cv9j_41",
24
+ "alt-container": "_alt-container_1cv9j_51",
25
25
  modal,
26
- "modal-image": "_modal-image_nf1kx_74"
26
+ "modal-image": "_modal-image_1cv9j_75"
27
27
  };
28
28
  export {
29
29
  style0 as default,
@@ -4,5 +4,5 @@ export interface ElmFragmentIdentifierProps {
4
4
  */
5
5
  id: string;
6
6
  }
7
- declare const _default: import('vue').DefineComponent<ElmFragmentIdentifierProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ElmFragmentIdentifierProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
7
+ declare const _default: import('vue').DefineComponent<ElmFragmentIdentifierProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ElmFragmentIdentifierProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
8
8
  export default _default;
@@ -36,7 +36,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36
36
  });
37
37
  });
38
38
  return (_ctx, _cache) => {
39
- return openBlock(), createElementBlock("div", {
39
+ return openBlock(), createElementBlock("span", {
40
40
  class: normalizeClass(_ctx.$style.fragment)
41
41
  }, [
42
42
  createVNode(ElmMdiIcon, {
@@ -3,15 +3,15 @@
3
3
  try {
4
4
  if (typeof document != "undefined") {
5
5
  var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode("._fragment_e7xfw_1{display:flex;justify-content:flex-end;align-items:center}._icon_e7xfw_7{padding:.25rem;border-radius:.25rem;transition:background-color .2s;cursor:pointer}._icon_e7xfw_7:hover{background-color:#0000001a}[data-theme=dark] ._icon_e7xfw_7:hover{background-color:#ffffff1a}"));
6
+ elementStyle.appendChild(document.createTextNode("._fragment_qey7q_1{position:absolute;right:0;bottom:-2.5rem;display:flex;justify-content:flex-end;align-items:center}._icon_qey7q_10{padding:.25rem;border-radius:.25rem;transition:background-color .2s;cursor:pointer}._icon_qey7q_10:hover{background-color:#0000001a}[data-theme=dark] ._icon_qey7q_10:hover{background-color:#ffffff1a}"));
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 fragment = "_fragment_e7xfw_1";
14
- const icon = "_icon_e7xfw_7";
13
+ const fragment = "_fragment_qey7q_1";
14
+ const icon = "_icon_qey7q_10";
15
15
  const style0 = {
16
16
  fragment,
17
17
  icon
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, useSlots, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, resolveDynamicComponent, normalizeStyle, unref, normalizeClass, withCtx, h } from "vue";
1
+ import { defineComponent, ref, useSlots, createBlock, openBlock, resolveDynamicComponent, normalizeStyle, unref, normalizeClass, withCtx, createElementBlock, createCommentVNode, h } from "vue";
2
2
  import { useIntersectionObserver } from "@vueuse/core";
3
3
  import { kebabCase } from "lodash-es";
4
4
  import ElmFragmentIdentifier from "./ElmFragmentIdentifier.vue.mjs";
@@ -38,37 +38,35 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
38
  }
39
39
  };
40
40
  return (_ctx, _cache) => {
41
- return openBlock(), createElementBlock(Fragment, null, [
42
- (openBlock(), createBlock(resolveDynamicComponent(`h${_ctx.level}`), {
43
- ref_key: "target",
44
- ref: target,
45
- class: normalizeClass([
46
- _ctx.$style[`h${_ctx.level}`],
47
- _ctx.$style["heading-common"],
48
- unref(headingStyle).heading
49
- ]),
50
- id: _ctx.id ?? unref(kebabCase)(_ctx.text),
51
- style: normalizeStyle({
52
- "--font-size": _ctx.size ?? `${unref(SIZE_MAP)[_ctx.level]}rem`,
53
- "--scale": targetIsVisible.value ? 1 : 0,
54
- "--opacity": targetIsVisible.value ? 1 : 0
55
- })
56
- }, {
57
- default: withCtx(() => [
58
- (openBlock(), createBlock(resolveDynamicComponent(() => renderSlots()))),
59
- _ctx.level === 2 ? (openBlock(), createElementBlock("span", {
60
- key: 0,
61
- class: normalizeClass(_ctx.$style["h2__underline"]),
62
- "aria-hidden": ""
63
- }, null, 2)) : createCommentVNode("", true)
64
- ]),
65
- _: 1
66
- }, 8, ["class", "id", "style"])),
67
- !_ctx.disableFragmentIdentifier ? (openBlock(), createBlock(ElmFragmentIdentifier, {
68
- key: 0,
69
- id: _ctx.id ?? unref(kebabCase)(_ctx.text)
70
- }, null, 8, ["id"])) : createCommentVNode("", true)
71
- ], 64);
41
+ return openBlock(), createBlock(resolveDynamicComponent(`h${_ctx.level}`), {
42
+ ref_key: "target",
43
+ ref: target,
44
+ class: normalizeClass([
45
+ _ctx.$style[`h${_ctx.level}`],
46
+ _ctx.$style["heading-common"],
47
+ unref(headingStyle).heading
48
+ ]),
49
+ id: _ctx.id ?? unref(kebabCase)(_ctx.text),
50
+ style: normalizeStyle({
51
+ "--font-size": _ctx.size ?? `${unref(SIZE_MAP)[_ctx.level]}rem`,
52
+ "--scale": targetIsVisible.value ? 1 : 0,
53
+ "--opacity": targetIsVisible.value ? 1 : 0
54
+ })
55
+ }, {
56
+ default: withCtx(() => [
57
+ (openBlock(), createBlock(resolveDynamicComponent(() => renderSlots()))),
58
+ _ctx.level === 2 ? (openBlock(), createElementBlock("span", {
59
+ key: 0,
60
+ class: normalizeClass(_ctx.$style["h2__underline"]),
61
+ "aria-hidden": ""
62
+ }, null, 2)) : createCommentVNode("", true),
63
+ !_ctx.disableFragmentIdentifier ? (openBlock(), createBlock(ElmFragmentIdentifier, {
64
+ key: 1,
65
+ id: _ctx.id ?? unref(kebabCase)(_ctx.text)
66
+ }, null, 8, ["id"])) : createCommentVNode("", true)
67
+ ]),
68
+ _: 1
69
+ }, 8, ["class", "id", "style"]);
72
70
  };
73
71
  }
74
72
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmethis/core",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },