@elmethis/core 1.0.0-alpha.164 → 1.0.0-alpha.166

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.
@@ -9,8 +9,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
9
9
  },
10
10
  setup(__props) {
11
11
  const props = __props;
12
- const isRendered = ref(false);
13
- const html = ref(props.expression);
12
+ const html = ref();
14
13
  let katexRenderToString = null;
15
14
  const loadKatex = async () => {
16
15
  if (!katexRenderToString) {
@@ -23,12 +22,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
22
  };
24
23
  const render = async () => {
25
24
  await loadKatex();
26
- if (!isRendered.value && katexRenderToString) {
25
+ if (!html.value && katexRenderToString) {
27
26
  try {
28
27
  html.value = katexRenderToString(props.expression, {
29
28
  displayMode: props.block
30
29
  });
31
- isRendered.value = true;
32
30
  } catch (err) {
33
31
  console.error("KaTeX rendering error:", err);
34
32
  }
@@ -47,7 +45,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
47
45
  })
48
46
  }, {
49
47
  default: withCtx(() => [
50
- isRendered.value ? (openBlock(), createElementBlock("span", {
48
+ html.value ? (openBlock(), createElementBlock("span", {
51
49
  key: 0,
52
50
  innerHTML: html.value
53
51
  }, null, 8, _hoisted_1)) : (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(_ctx.expression), 1))
@@ -9,7 +9,7 @@ export interface ElmInlineLinkProps {
9
9
  *
10
10
  * e.g. `https://example.com`
11
11
  */
12
- href?: string;
12
+ href: string;
13
13
  /**
14
14
  * Specifies the font size of the text.
15
15
  */
@@ -20,7 +20,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20
20
  props.onClick();
21
21
  }
22
22
  }
23
- const src = ref(`https://logo.clearbit.com/${props.href}`);
23
+ const src = ref(`https://logo.clearbit.com/${new URL(props.href).hostname}`);
24
24
  const handleError = () => {
25
25
  src.value = `data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="gray" d="M17.9 17.39c-.26-.8-1.01-1.39-1.9-1.39h-1v-3a1 1 0 0 0-1-1H8v-2h2a1 1 0 0 0 1-1V7h2a2 2 0 0 0 2-2v-.41a7.984 7.984 0 0 1 2.9 12.8M11 19.93c-3.95-.49-7-3.85-7-7.93c0-.62.08-1.22.21-1.79L9 15v1a2 2 0 0 0 2 2m1-16A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2"/></svg>`;
26
26
  };
@@ -39,7 +39,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
39
  onError: handleError,
40
40
  class: normalizeClass(_ctx.$style.icon)
41
41
  }, null, 42, _hoisted_2),
42
- createTextVNode(" " + toDisplayString(_ctx.text) + " ", 1),
42
+ createTextVNode(" " + toDisplayString(_ctx.text ?? _ctx.href) + " ", 1),
43
43
  createVNode(unref(Icon), {
44
44
  icon: _ctx.iconType != null ? _ctx.iconType === "internal" ? "mdi:chevron-right" : "mdi:external-link" : _ctx.openInNewTab ? "mdi:external-link" : "mdi:chevron-right",
45
45
  class: normalizeClass(_ctx.$style.icon)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmethis/core",
3
- "version": "1.0.0-alpha.164",
3
+ "version": "1.0.0-alpha.166",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },