@elmethis/core 0.2.8 → 0.2.10

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.
@@ -114,13 +114,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
114
114
  default: withCtx(() => [
115
115
  isModalOpen.value ? (openBlock(), createElementBlock("div", {
116
116
  key: 0,
117
- class: normalizeClass(_ctx.$style.modal)
117
+ class: normalizeClass(_ctx.$style.modal),
118
+ onClick: _cache[1] || (_cache[1] = ($event) => isModalOpen.value = false)
118
119
  }, [
119
120
  createElementVNode("img", {
120
121
  class: normalizeClass(_ctx.$style["modal-image"]),
121
122
  src: _ctx.src,
122
- alt: _ctx.alt,
123
- onClick: _cache[1] || (_cache[1] = ($event) => isModalOpen.value = false)
123
+ alt: _ctx.alt
124
124
  }, null, 10, _hoisted_2)
125
125
  ], 2)) : createCommentVNode("", true)
126
126
  ]),
@@ -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_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}"));
6
+ elementStyle.appendChild(document.createTextNode("._wrapper_1w3gk_1{width:100%;display:flex;flex-direction:column;align-items:center}._image_1w3gk_8{display:block;margin-block:var(--margin-block);max-width:100%;max-height:100vh;cursor:var(--cursor)}._error_1w3gk_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_1w3gk_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_1w3gk_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_1w3gk_51{max-width:80%;margin:1rem;display:flex;justify-content:center;align-items:center;gap:1rem;color:#6987b8;opacity:.8}._modal_1w3gk_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;cursor:zoom-out}._modal-image_1w3gk_76{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_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";
13
+ const wrapper = "_wrapper_1w3gk_1";
14
+ const image = "_image_1w3gk_8";
15
+ const error = "_error_1w3gk_16";
16
+ const fallback = "_fallback_1w3gk_28";
17
+ const modal = "_modal_1w3gk_62";
18
18
  const style0 = {
19
19
  wrapper,
20
20
  image,
21
21
  error,
22
22
  fallback,
23
- "image-block": "_image-block_1cv9j_41",
24
- "alt-container": "_alt-container_1cv9j_51",
23
+ "image-block": "_image-block_1w3gk_41",
24
+ "alt-container": "_alt-container_1w3gk_51",
25
25
  modal,
26
- "modal-image": "_modal-image_1cv9j_75"
26
+ "modal-image": "_modal-image_1w3gk_76"
27
27
  };
28
28
  export {
29
29
  style0 as default,
@@ -18,7 +18,7 @@ import "@vueuse/core";
18
18
  import ElmBlockFallback from "../fallback/ElmBlockFallback.vue.mjs";
19
19
 
20
20
 
21
- import "lodash-es";
21
+ import { kebabCase } from "lodash-es";
22
22
 
23
23
 
24
24
  import "nanoid";
@@ -109,6 +109,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
109
109
  loader: () => import("../fallback/ElmUnsupportedBlock.vue.mjs"),
110
110
  loadingComponent: ElmBlockFallback
111
111
  });
112
+ const convertInlineComponentsToPlainText = (inlineComponents) => {
113
+ return inlineComponents.map((component) => {
114
+ if (component.type === "Text") {
115
+ return component.props.text;
116
+ } else {
117
+ return "";
118
+ }
119
+ }).join("");
120
+ };
112
121
  const defaultRenderFunctionMap = (render2) => {
113
122
  return {
114
123
  Text: ({ props: props2 }) => {
@@ -134,7 +143,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
134
143
  Heading: ({ props: props2, slots }) => h(
135
144
  AsyncElmHeading,
136
145
  {
137
- level: props2.level
146
+ level: props2.level,
147
+ id: kebabCase(convertInlineComponentsToPlainText(slots.default))
138
148
  },
139
149
  { default: () => render2(slots.default) }
140
150
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmethis/core",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },