bireactive 0.2.3 → 0.2.4

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/coll.js CHANGED
@@ -147,7 +147,9 @@ export class GroupView {
147
147
  this.#sort = opts.sort;
148
148
  this.groups = derive(() => {
149
149
  const sort = this.#sort;
150
- const items = sort ? [...parent.items].sort((a, b) => sort(a).value - sort(b).value) : parent.items;
150
+ const items = sort
151
+ ? [...parent.items].sort((a, b) => sort(a).value - sort(b).value)
152
+ : parent.items;
151
153
  return groupItems(items, e => field(e).value, this.#order);
152
154
  });
153
155
  }
package/dist/tex/tex.js CHANGED
@@ -31,15 +31,22 @@ const compileTemplate = (strings, values) => {
31
31
  }
32
32
  return { source, markers };
33
33
  };
34
+ // Temml renders accents (\dot, \hat, \bar, …) as <mover> without an explicit
35
+ // `accent` attribute, leaning on the browser to infer it from the core
36
+ // operator — which Gecko now warns is deprecated. The accent operator's <mo>
37
+ // carries an "…-acc" class, so mark just those scripts explicitly (limits like
38
+ // \sum/\lim are <munder>/<munderover> and stay untouched). Render-neutral: the
39
+ // browser was already inferring accent="true" for these.
40
+ const markAccents = (mathml) => mathml.replace(/<mover>((?:(?!<\/?mover>)[\s\S])*?<mo[^>]*class="[^"]*-acc[^"]*"[^>]*>(?:(?!<\/?mover>)[\s\S])*?)<\/mover>/g, '<mover accent="true">$1</mover>');
34
41
  /** Render LaTeX → MathML via Temml (trust on, lenient errors). */
35
42
  export const renderToMathML = (source, opts = {}) => {
36
43
  try {
37
- return temml.renderToString(source, {
44
+ return markAccents(temml.renderToString(source, {
38
45
  trust: true,
39
46
  displayMode: opts.displayMode ?? false,
40
47
  strict: false,
41
48
  throwOnError: false,
42
- });
49
+ }));
43
50
  }
44
51
  catch (e) {
45
52
  return `<span style="color:#c33;font:13px monospace">${e.message}</span>`;
package/package.json CHANGED
@@ -1,27 +1,17 @@
1
1
  {
2
2
  "name": "bireactive",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Bi-directional reactive programming.",
5
5
  "type": "module",
6
- "main": "./src/index.ts",
7
- "module": "./src/index.ts",
8
- "types": "./src/index.ts",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "types": "./src/index.ts",
12
- "import": "./src/index.ts"
13
- }
14
- },
15
- "publishConfig": {
16
- "main": "./dist/index.js",
17
- "module": "./dist/index.js",
18
- "types": "./dist/index.d.ts",
19
- "exports": {
20
- ".": {
21
- "types": "./dist/index.d.ts",
22
- "import": "./dist/index.js"
23
- }
24
- }
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ },
14
+ "./package.json": "./package.json"
25
15
  },
26
16
  "sideEffects": false,
27
17
  "files": [
@@ -31,7 +21,7 @@
31
21
  ],
32
22
  "scripts": {
33
23
  "dev": "vite --host",
34
- "site": "vite-node site/build.ts && vite build && vite-node site/build.ts && typedoc",
24
+ "site": "vite build && typedoc",
35
25
  "preview": "vite preview",
36
26
  "prebuild": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
37
27
  "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json --resolve-full-paths",