@pie-lib/render-ui 8.0.3-next.20261007184841 → 8.0.3-next.20261007201108

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/dist/index.d.ts CHANGED
@@ -17,4 +17,3 @@ import { transformDataHeadings } from './transform-headings.js';
17
17
  export { HtmlAndMath, indicators, withUndoReset, Feedback, UiLayout, PreviewLayout, Collapsible, InputContainer, PreviewPrompt, color, Readable, Purpose, hasText, hasMedia, EnableAudioAutoplayImage, transformDataHeadings, };
18
18
  export { InlineMenu } from './inline-menu.js';
19
19
  export { createUniqueId, useUniqueId } from './unique-id.js';
20
- export { MathName, useMathName } from './math-name.js';
package/dist/index.js CHANGED
@@ -16,5 +16,4 @@ import { hasMedia as h } from "./has-media.js";
16
16
  import g from "./assets/enableAudioAutoplayImage.js";
17
17
  import { transformDataHeadings as _ } from "./transform-headings.js";
18
18
  import { InlineMenu as v } from "./inline-menu.js";
19
- import { MathName as y, useMathName as b } from "./math-name.js";
20
- export { a as Collapsible, g as EnableAudioAutoplayImage, t as Feedback, l as HtmlAndMath, v as InlineMenu, u as InputContainer, y as MathName, c as PreviewLayout, d as PreviewPrompt, p as Purpose, f as Readable, s as UiLayout, e as color, r as createUniqueId, h as hasMedia, m as hasText, n as indicators, _ as transformDataHeadings, b as useMathName, i as useUniqueId, o as withUndoReset };
19
+ export { a as Collapsible, g as EnableAudioAutoplayImage, t as Feedback, l as HtmlAndMath, v as InlineMenu, u as InputContainer, c as PreviewLayout, d as PreviewPrompt, p as Purpose, f as Readable, s as UiLayout, e as color, r as createUniqueId, h as hasMedia, m as hasText, n as indicators, _ as transformDataHeadings, i as useUniqueId, o as withUndoReset };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/render-ui",
3
- "version": "8.0.3-next.20261007184841",
3
+ "version": "8.0.3-next.20261007201108",
4
4
  "description": "Some shared ui elements when rendering - but not worthy of their own package yet.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  "debug": "^4.1.1",
18
18
  "prop-types": "^15.7.2",
19
19
  "react-transition-group": "^4.4.5",
20
- "@pie-element/shared-math-rendering-mathjax": "0.1.4-next.20261007175429",
20
+ "@pie-element/shared-math-rendering-mathjax": "0.1.4-next.20261007201108",
21
21
  "@pie-element/shared-lodash": "0.1.3-next.20261006160832",
22
22
  "@pie-element/shared-utils": "0.1.3-next.20261007184841"
23
23
  },
@@ -1,26 +0,0 @@
1
- import { type ReactNode, type RefObject } from 'react';
2
- import { type MathNameOptions } from '@pie-element/shared-math-rendering-mathjax';
3
- type Speak = MathNameOptions['speak'];
4
- /**
5
- * The accessible name of a control whose content is math, or `undefined` when the content holds
6
- * none and the browser can name the control itself.
7
- *
8
- * Chrome leaves MathML out of a control's name-from-content, so a button, option or input that holds
9
- * only math has no name. The name is spoken from the MathML MathJax keeps beside the glyphs, and it
10
- * follows the content: MathJax typesets after the first render and a host can swap the markup.
11
- *
12
- * `ref` points at the element whose children hold the content. Put the result in `aria-label` on a
13
- * role that takes one (button, option, checkbox, radio, input) or, on a generic element, in a hidden
14
- * span the control references with `aria-labelledby`.
15
- */
16
- export declare function useMathName(ref: RefObject<HTMLElement | null>, speak?: Speak): string | undefined;
17
- interface MathNameProps {
18
- speak?: Speak;
19
- children: (name: string | undefined, ref: RefObject<HTMLElement | null>) => ReactNode;
20
- }
21
- /**
22
- * `useMathName` for a class component: the render prop receives the name and the ref to attach to
23
- * the element that holds the content.
24
- */
25
- export declare function MathName({ speak, children }: MathNameProps): import("react").JSX.Element;
26
- export {};
package/dist/math-name.js DELETED
@@ -1,35 +0,0 @@
1
- import { useLayoutEffect as e, useRef as t, useState as n } from "react";
2
- import { Fragment as r, jsx as i } from "react/jsx-runtime";
3
- import { mathContentName as a } from "@pie-element/shared-math-rendering-mathjax";
4
- //#region src/math-name.tsx
5
- function o(r, i) {
6
- let [o, s] = n(), c = t({
7
- node: null,
8
- observer: null
9
- }), l = t(i);
10
- return l.current = i, e(() => {
11
- let e = c.current, t = r.current;
12
- if (t === e.node) return;
13
- if (e.observer?.disconnect(), e.observer = null, e.node = t, !t) {
14
- s(void 0);
15
- return;
16
- }
17
- let n = () => s(t.querySelector("math") ? a(t, { speak: l.current }) : void 0);
18
- n(), !(typeof MutationObserver > "u") && (e.observer = new MutationObserver(n), e.observer.observe(t, {
19
- childList: !0,
20
- subtree: !0,
21
- characterData: !0
22
- }));
23
- }), e(() => () => {
24
- c.current.observer?.disconnect(), c.current = {
25
- node: null,
26
- observer: null
27
- };
28
- }, []), o;
29
- }
30
- function s({ speak: e, children: n }) {
31
- let a = t(null);
32
- return /* @__PURE__ */ i(r, { children: n(o(a, e), a) });
33
- }
34
- //#endregion
35
- export { s as MathName, o as useMathName };