@monowind/ascii 0.2.4 → 0.2.5

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.
package/README.md CHANGED
@@ -9,8 +9,9 @@ the `<mono-ascii>` element plus a library of 44 clearly-licensed fonts.
9
9
 
10
10
  The banner renders as art on the monowind grid while the light DOM
11
11
  keeps the semantic string — screen readers hear `monowind`, never
12
- glyph soup, while selecting over the banner selects the art itself
13
- (a transparent transcript in the element's shadow; the string never
12
+ glyph soup, while selecting over the banner a drag in text mode, a
13
+ double- or triple-click in grid mode selects the art itself (a
14
+ transparent transcript in the element's shadow; the string never
14
15
  leaks into copied text). Utilities style
15
16
  the whole banner (colors, transitions, `hover:` — everything monowind
16
17
  supports); it behaves like a replaced element (shrink-wrapped to the
package/dist/cdn.js CHANGED
@@ -30163,5 +30163,5 @@ of new full-width/kern/smush alternatives, but default output is NOT changed.
30163
30163
  #mirror::selection { color: var(--mw-bg, canvas); text-shadow: 0 0 0 var(--mw-bg, canvas); background: var(--mw-fg, canvastext); }
30164
30164
  .alt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; user-select: none; -webkit-user-select: none; }
30165
30165
  </style><pre id="mirror" aria-hidden="true"></pre><span class="alt"><slot></slot></span>`,j=class extends k{#e=null;#t=null;constructor(){super();let e=this.attachShadow({mode:`open`});e.innerHTML=A,this.#t=e.getElementById(`mirror`)}get font(){return this.#e}set font(t){this.#e=t,(0,e.invalidateLeaves)()}syncMirror(e){let t=e.join(`
30166
- `);this.#t&&this.#t.textContent!==t&&(this.#t.textContent=t)}};function M(e){let t=N(e);return e.syncMirror?.(t.lines),t}function N(e){let t=(e.textContent??``).replace(/\s+/g,` `).trim();e.children.length>0&&!E.has(e)&&(E.add(e),console.warn(`[monowind] <mono-ascii> takes text only; element children are ignored.`,e));let n=e.getAttribute(`font`)??`standard`,r=e.font??m(n);if(!r)return T.has(`font:${n}`)||(T.add(`font:${n}`),D?D(n):console.warn(`[monowind] <mono-ascii>: no registered font "${n}"; rendering plain text.`,e)),{lines:t?[t]:[]};if(!t)return{lines:[]};let i=h(t,r),a=e.getAttribute(`effect`);return a&&C(a)?{lines:i.lines,runs:w(a,i.lines)}:{lines:i.lines,runs:i.runs}}function P(){typeof customElements>`u`||customElements.get(`mono-ascii`)||(customElements.define(`mono-ascii`,j),(0,e.registerLeafRenderer)({tag:`mono-ascii`,observedAttributes:[`font`,`effect`],render:M}))}P();var F=`@layer base{mono-ascii{display:block}}`,I=document.createElement(`style`);I.setAttribute(`data-monowind-ascii`,``),I.textContent=F,document.head.appendChild(I);var L=new Map;function R(e){let t=e.toLowerCase().replace(/\.(flf|tlf)$/,``),n=L.get(t);if(n)return n;let r=z(t).finally(()=>L.delete(t));return L.set(t,r),r}async function z(e){let t=m(e);if(t)return t;for(let t of[`fonts/`,`https://cdn.jsdelivr.net/npm/@monowind/ascii@0.2.4/fonts/`])for(let n of[`flf`,`tlf`])try{let r=await fetch(`${t}${e}.${n}`);if(r.ok)return p(e,await r.text())}catch{}return console.warn(`[monowind] loadFont("${e}"): no such bundled font.`),null}O(e=>void R(e));var B=globalThis.monowind;Object.assign(globalThis,{monowind:{...B,ascii:{...B?.ascii,asciiFont:m,loadFont:R,registerAsciiFont:p,version:`0.2.4`}}})})(monowind);
30166
+ `);this.#t&&this.#t.textContent!==t&&(this.#t.textContent=t)}};function M(e){let t=N(e);return e.syncMirror?.(t.lines),t}function N(e){let t=(e.textContent??``).replace(/\s+/g,` `).trim();e.children.length>0&&!E.has(e)&&(E.add(e),console.warn(`[monowind] <mono-ascii> takes text only; element children are ignored.`,e));let n=e.getAttribute(`font`)??`standard`,r=e.font??m(n);if(!r)return T.has(`font:${n}`)||(T.add(`font:${n}`),D?D(n):console.warn(`[monowind] <mono-ascii>: no registered font "${n}"; rendering plain text.`,e)),{lines:t?[t]:[]};if(!t)return{lines:[]};let i=h(t,r),a=e.getAttribute(`effect`);return a&&C(a)?{lines:i.lines,runs:w(a,i.lines)}:{lines:i.lines,runs:i.runs}}function P(){typeof customElements>`u`||customElements.get(`mono-ascii`)||(customElements.define(`mono-ascii`,j),(0,e.registerLeafRenderer)({tag:`mono-ascii`,observedAttributes:[`font`,`effect`],render:M,selectionTarget:e=>e.shadowRoot?.getElementById(`mirror`)??null}))}P();var F=`@layer base{mono-ascii{display:block}}`,I=document.createElement(`style`);I.setAttribute(`data-monowind-ascii`,``),I.textContent=F,document.head.appendChild(I);var L=new Map;function R(e){let t=e.toLowerCase().replace(/\.(flf|tlf)$/,``),n=L.get(t);if(n)return n;let r=z(t).finally(()=>L.delete(t));return L.set(t,r),r}async function z(e){let t=m(e);if(t)return t;for(let t of[`fonts/`,`https://cdn.jsdelivr.net/npm/@monowind/ascii@0.2.5/fonts/`])for(let n of[`flf`,`tlf`])try{let r=await fetch(`${t}${e}.${n}`);if(r.ok)return p(e,await r.text())}catch{}return console.warn(`[monowind] loadFont("${e}"): no such bundled font.`),null}O(e=>void R(e));var B=globalThis.monowind;Object.assign(globalThis,{monowind:{...B,ascii:{...B?.ascii,asciiFont:m,loadFont:R,registerAsciiFont:p,version:`0.2.5`}}})})(monowind);
30167
30167
  //# sourceMappingURL=cdn.js.map