@elmethis/core 0.2.8 → 0.2.9

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.
@@ -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.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },