@lvl99dotcom/edaha-editor 0.4.1 → 0.4.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.
@@ -695,20 +695,20 @@ img.ProseMirror-separator {
695
695
  >
696
696
  Add${tN(` to ${this.fieldTitle}`)}
697
697
  </button>
698
- </fieldset>`}renderSelect(e,t){let n=AM(this.schema.$edahaField),r=UM(this.schema),i=n.multiple===!0,a=i?(this.value??[]).map(String):[String(this.value??``)];return E`<select
698
+ </fieldset>`}renderSelect(e,t){let n=AM(this.schema.$edahaField),r=UM(this.schema),i=n.multiple===!0,a=!i&&!r.some(e=>e.value===``),o=i?(this.value??[]).map(String):[String(this.value??``)];return E`<select
699
699
  id=${e}
700
700
  ?multiple=${i}
701
- size=${n.list===!0?r.length+ +!i:D}
701
+ size=${n.list===!0?r.length+ +!!a:D}
702
702
  ?required=${this.required}
703
703
  aria-invalid=${eN(this.problems,this.path).length?`true`:`false`}
704
704
  aria-describedby=${this.describedBy(e)||D}
705
705
  @change=${e=>{let n=[...e.target.selectedOptions].map(e=>r[Number(e.dataset.index)]?.value??void 0);this.change(this.path,i?n:n[0]??YM(t,``))}}
706
706
  >
707
- ${i?D:E`<option value="">—</option>`}
707
+ ${a?E`<option value="">—</option>`:D}
708
708
  ${r.map((e,t)=>E`<option
709
709
  data-index=${t}
710
710
  value=${String(e.value)}
711
- ?selected=${a.includes(String(e.value))}
711
+ ?selected=${o.includes(String(e.value))}
712
712
  >
713
713
  ${e.title??String(e.value)}
714
714
  </option>`)}
@@ -12,7 +12,7 @@
12
12
  document.documentElement.dataset.theme = theme;
13
13
  } catch {}
14
14
  </script>
15
- <script type="module" crossorigin src="/_editor/assets/index-owkKXGfS.js"></script>
15
+ <script type="module" crossorigin src="/_editor/assets/index-B1Dz4z4H.js"></script>
16
16
  <link rel="stylesheet" crossorigin href="/_editor/assets/index--k7n6Qb8.css">
17
17
  </head>
18
18
  <body>
@@ -1958,11 +1958,11 @@ var jt = (e, t) => t.$edahaField?.title ?? t.title ?? e, Mt = (e) => e.$edahaFie
1958
1958
  </fieldset>`;
1959
1959
  }
1960
1960
  renderSelect(e, r) {
1961
- let i = g(this.schema.$edahaField), a = Pt(this.schema), o = i.multiple === !0, s = o ? (this.value ?? []).map(String) : [String(this.value ?? "")];
1961
+ let i = g(this.schema.$edahaField), a = Pt(this.schema), o = i.multiple === !0, s = !o && !a.some((e) => e.value === ""), c = o ? (this.value ?? []).map(String) : [String(this.value ?? "")];
1962
1962
  return t`<select
1963
1963
  id=${e}
1964
1964
  ?multiple=${o}
1965
- size=${i.list === !0 ? a.length + +!o : n}
1965
+ size=${i.list === !0 ? a.length + +!!s : n}
1966
1966
  ?required=${this.required}
1967
1967
  aria-invalid=${K(this.problems, this.path).length ? "true" : "false"}
1968
1968
  aria-describedby=${this.describedBy(e) || n}
@@ -1971,11 +1971,11 @@ var jt = (e, t) => t.$edahaField?.title ?? t.title ?? e, Mt = (e) => e.$edahaFie
1971
1971
  this.change(this.path, o ? t : t[0] ?? Rt(r, ""));
1972
1972
  }}
1973
1973
  >
1974
- ${o ? n : t`<option value="">—</option>`}
1974
+ ${s ? t`<option value="">—</option>` : n}
1975
1975
  ${a.map((e, n) => t`<option
1976
1976
  data-index=${n}
1977
1977
  value=${String(e.value)}
1978
- ?selected=${s.includes(String(e.value))}
1978
+ ?selected=${c.includes(String(e.value))}
1979
1979
  >
1980
1980
  ${e.title ?? String(e.value)}
1981
1981
  </option>`)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvl99dotcom/edaha-editor",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Local WYSIWYG article editor for edaha.md sites.",
5
5
  "keywords": [
6
6
  "blog",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@hono/node-server": "^2.1.5",
47
- "@lvl99dotcom/edaha.md": "^0.4.1",
47
+ "@lvl99dotcom/edaha.md": "^0.4.2",
48
48
  "@tiptap/core": "^3.32.0",
49
49
  "@tiptap/extension-bubble-menu": "^3.34.0",
50
50
  "@tiptap/extension-details": "3.32.0",