@pie-lib/render-ui 8.0.8-next.20261110055344 → 8.0.8-next.20261110063142

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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Whether markup can name a control for assistive technology: it holds text, or an image with a
3
+ * non-blank `alt`. An image whose `alt` is empty or absent is decorative and names nothing.
4
+ * Parses with the browser's `DOMParser`, so it runs only where a DOM exists.
5
+ */
6
+ export declare const hasTextAlternative: (html: string | null | undefined) => boolean;
@@ -0,0 +1,7 @@
1
+ // src/has-text-alternative.ts
2
+ var e = (e) => {
3
+ if (!e) return !1;
4
+ let { body: t } = new DOMParser().parseFromString(e, "text/html");
5
+ return !!t.textContent?.trim() || Array.from(t.querySelectorAll("img")).some((e) => !!e.getAttribute("alt")?.trim());
6
+ };
7
+ export { e as hasTextAlternative };
package/dist/index.d.ts CHANGED
@@ -12,8 +12,9 @@ import Purpose from './purpose.js';
12
12
  import * as color from './color.js';
13
13
  import { hasText } from './has-text.js';
14
14
  import { hasMedia } from './has-media.js';
15
+ import { hasTextAlternative } from './has-text-alternative.js';
15
16
  import EnableAudioAutoplayImage from './assets/enableAudioAutoplayImage.js';
16
17
  import { transformDataHeadings } from './transform-headings.js';
17
- export { HtmlAndMath, indicators, withUndoReset, Feedback, UiLayout, PreviewLayout, Collapsible, InputContainer, PreviewPrompt, color, Readable, Purpose, hasText, hasMedia, EnableAudioAutoplayImage, transformDataHeadings, };
18
+ export { HtmlAndMath, indicators, withUndoReset, Feedback, UiLayout, PreviewLayout, Collapsible, InputContainer, PreviewPrompt, color, Readable, Purpose, hasText, hasMedia, hasTextAlternative, EnableAudioAutoplayImage, transformDataHeadings, };
18
19
  export { InlineMenu } from './inline-menu.js';
19
20
  export { createUniqueId, useUniqueId } from './unique-id.js';
package/dist/index.js CHANGED
@@ -12,8 +12,9 @@ import u from "./purpose.js";
12
12
  import { color_exports as d } from "./color.js";
13
13
  import { hasText as f } from "./has-text.js";
14
14
  import { hasMedia as p } from "./has-media.js";
15
- import m from "./assets/enableAudioAutoplayImage.js";
16
- import { transformDataHeadings as h } from "./transform-headings.js";
17
- import { InlineMenu as g } from "./inline-menu.js";
18
- import { createUniqueId as _, useUniqueId as v } from "./unique-id.js";
19
- export { n as Collapsible, m as EnableAudioAutoplayImage, t as Feedback, o as HtmlAndMath, g as InlineMenu, s as InputContainer, i as PreviewLayout, c as PreviewPrompt, u as Purpose, l as Readable, a as UiLayout, d as color, _ as createUniqueId, p as hasMedia, f as hasText, e as indicators, h as transformDataHeadings, v as useUniqueId, r as withUndoReset };
15
+ import { hasTextAlternative as m } from "./has-text-alternative.js";
16
+ import h from "./assets/enableAudioAutoplayImage.js";
17
+ import { transformDataHeadings as g } from "./transform-headings.js";
18
+ import { InlineMenu as _ } from "./inline-menu.js";
19
+ import { createUniqueId as v, useUniqueId as y } from "./unique-id.js";
20
+ export { n as Collapsible, h as EnableAudioAutoplayImage, t as Feedback, o as HtmlAndMath, _ as InlineMenu, s as InputContainer, i as PreviewLayout, c as PreviewPrompt, u as Purpose, l as Readable, a as UiLayout, d as color, v as createUniqueId, p as hasMedia, f as hasText, m as hasTextAlternative, e as indicators, g as transformDataHeadings, y as useUniqueId, r as withUndoReset };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/render-ui",
3
- "version": "8.0.8-next.20261110055344",
3
+ "version": "8.0.8-next.20261110063142",
4
4
  "description": "Some shared ui elements when rendering - but not worthy of their own package yet.",
5
5
  "license": "MIT",
6
6
  "repository": {