reactive-md 0.5.3 → 0.6.0

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.
Files changed (95) hide show
  1. package/CHANGELOG-ch.md +45 -24
  2. package/CHANGELOG.md +45 -24
  3. package/CONTRIBUTING-ch.md +10 -5
  4. package/CONTRIBUTING.md +10 -5
  5. package/README-ch.md +38 -36
  6. package/README-en.md +45 -42
  7. package/README.md +45 -42
  8. package/SECURITY-ch.md +1 -1
  9. package/SECURITY.md +1 -1
  10. package/THIRD_PARTY_NOTICES.md +481 -1
  11. package/dist-library/{authoring-DJJjKYg9.js → authoring-DSC0VsNK.js} +58 -58
  12. package/dist-library/{compiler-UyPwGzJZ.js → compiler-CRD88BMt.js} +6218 -3363
  13. package/dist-library/react-Dk94rcOp.js +59658 -0
  14. package/dist-library/reactive-md-authoring.js +2 -2
  15. package/dist-library/reactive-md-editor.js +13 -0
  16. package/dist-library/reactive-md-react-unstyled.js +1 -1
  17. package/dist-library/reactive-md-react.js +1 -1
  18. package/dist-library/reactive-md.css +1 -1
  19. package/dist-library/reactive-md.js +123 -123
  20. package/dist-library/{runtime-DXtle_6c.js → runtime-D8KbnCd0.js} +151 -151
  21. package/dist-library/types/editor/types.d.ts +2 -0
  22. package/dist-library/types/local/code-block.d.ts +3 -1
  23. package/dist-library/types/local/code-languages.d.ts +7 -0
  24. package/dist-library/types/local/compiled-data.d.ts +6 -0
  25. package/dist-library/types/local/compiler.d.ts +1 -0
  26. package/dist-library/types/local/diagnostics.d.ts +31 -0
  27. package/dist-library/types/local/diagram-layout.d.ts +69 -0
  28. package/dist-library/types/local/html-names.d.ts +6 -0
  29. package/dist-library/types/local/html-table.d.ts +25 -0
  30. package/dist-library/types/local/math-display.d.ts +1 -0
  31. package/dist-library/types/local/table-surface.d.ts +10 -0
  32. package/dist-library/types/local/types.d.ts +2 -0
  33. package/dist-library/types/local/visuals.d.ts +9 -0
  34. package/dist-standalone/reactive-md-standalone.css +1 -1
  35. package/dist-standalone/reactive-md-standalone.js +75 -51
  36. package/docs/README.md +84 -0
  37. package/docs/{compatibility-ch.md → compatibility/compatibility-ch.md} +28 -18
  38. package/docs/{compatibility-en.md → compatibility/compatibility-en.md} +28 -18
  39. package/docs/{source-versioning-ch.md → compatibility/source-versioning-ch.md} +2 -2
  40. package/docs/{source-versioning-en.md → compatibility/source-versioning-en.md} +2 -2
  41. package/docs/{component-development-ch.md → development/component-development-ch.md} +7 -7
  42. package/docs/{component-development-en.md → development/component-development-en.md} +7 -7
  43. package/docs/{component-protocol-ch.md → development/component-protocol-ch.md} +17 -17
  44. package/docs/{component-protocol-en.md → development/component-protocol-en.md} +17 -17
  45. package/docs/{performance-ch.md → development/performance-ch.md} +2 -2
  46. package/docs/{performance-en.md → development/performance-en.md} +2 -2
  47. package/docs/{releasing-ch.md → development/releasing-ch.md} +12 -12
  48. package/docs/{releasing-en.md → development/releasing-en.md} +12 -12
  49. package/docs/guides/local-guide-ch.md +513 -0
  50. package/docs/guides/local-guide-en.md +513 -0
  51. package/docs/{author-tools-ch.md → integration/author-tools-ch.md} +8 -8
  52. package/docs/{author-tools-en.md → integration/author-tools-en.md} +8 -8
  53. package/docs/{editor-ch.md → integration/editor-ch.md} +7 -6
  54. package/docs/{editor-en.md → integration/editor-en.md} +7 -6
  55. package/docs/{local-integration-ch.md → integration/local-integration-ch.md} +33 -15
  56. package/docs/{local-integration-en.md → integration/local-integration-en.md} +33 -15
  57. package/docs/{shareable-export-ch.md → integration/shareable-export-ch.md} +16 -4
  58. package/docs/{shareable-export-en.md → integration/shareable-export-en.md} +16 -4
  59. package/docs/{computations-formatting-ch.md → reference/computations-formatting-ch.md} +2 -2
  60. package/docs/{computations-formatting-en.md → reference/computations-formatting-en.md} +2 -2
  61. package/docs/{constraints-collections-ch.md → reference/constraints-collections-ch.md} +2 -2
  62. package/docs/{constraints-collections-en.md → reference/constraints-collections-en.md} +2 -2
  63. package/docs/{diagnostics-counting-ch.md → reference/diagnostics-counting-ch.md} +22 -2
  64. package/docs/{diagnostics-counting-en.md → reference/diagnostics-counting-en.md} +22 -2
  65. package/docs/{html-compatibility-ch.md → reference/html-compatibility-ch.md} +42 -4
  66. package/docs/{html-compatibility-en.md → reference/html-compatibility-en.md} +42 -4
  67. package/docs/{local-components-v2-ch.md → reference/local-components-v2-ch.md} +2 -2
  68. package/docs/{local-components-v2-en.md → reference/local-components-v2-en.md} +2 -2
  69. package/docs/{local-interaction-syntax-ch.md → reference/local-interaction-syntax-ch.md} +26 -7
  70. package/docs/{local-interaction-syntax-en.md → reference/local-interaction-syntax-en.md} +26 -7
  71. package/docs/{theme-protocol-ch.md → reference/theme-protocol-ch.md} +1 -1
  72. package/docs/{theme-protocol-en.md → reference/theme-protocol-en.md} +1 -1
  73. package/docs/{release-0.4.0-ch.md → releases/release-0.4.0-ch.md} +6 -6
  74. package/docs/{release-0.4.0-en.md → releases/release-0.4.0-en.md} +6 -6
  75. package/docs/{release-0.4.1-ch.md → releases/release-0.4.1-ch.md} +2 -2
  76. package/docs/{release-0.4.1-en.md → releases/release-0.4.1-en.md} +2 -2
  77. package/docs/{release-0.5.0-ch.md → releases/release-0.5.0-ch.md} +4 -4
  78. package/docs/{release-0.5.0-en.md → releases/release-0.5.0-en.md} +4 -4
  79. package/docs/{release-0.5.1-ch.md → releases/release-0.5.1-ch.md} +4 -4
  80. package/docs/{release-0.5.1-en.md → releases/release-0.5.1-en.md} +4 -4
  81. package/docs/{release-0.5.2-ch.md → releases/release-0.5.2-ch.md} +3 -3
  82. package/docs/{release-0.5.2-en.md → releases/release-0.5.2-en.md} +3 -3
  83. package/docs/{release-0.5.3-ch.md → releases/release-0.5.3-ch.md} +1 -1
  84. package/docs/{release-0.5.3-en.md → releases/release-0.5.3-en.md} +1 -1
  85. package/docs/releases/release-0.6.0-ch.md +57 -0
  86. package/docs/releases/release-0.6.0-en.md +57 -0
  87. package/examples/conformance/README.md +4 -4
  88. package/examples/integration/README.md +10 -8
  89. package/examples/integration/worker/package.json +1 -1
  90. package/examples/local/README.md +5 -5
  91. package/examples/local/html-compat.reactive.md +19 -0
  92. package/package.json +9 -2
  93. package/dist-library/react-fizgU3i8.js +0 -12764
  94. package/docs/local-guide-ch.md +0 -967
  95. package/docs/local-guide-en.md +0 -967
@@ -1,4 +1,4 @@
1
- import { S as e, W as t, d as n, m as r, q as i, t as a, w as o } from "./compiler-UyPwGzJZ.js";
1
+ import { S as e, X as t, d as n, m as r, q as i, t as a, w as o } from "./compiler-CRD88BMt.js";
2
2
  // src/local/authoring.ts
3
3
  var s = /^[A-Za-z_][A-Za-z0-9_]*$/, c = 128, l = /* @__PURE__ */ new Set([
4
4
  "code",
@@ -32,7 +32,7 @@ function p(e) {
32
32
  return e !== void 0 && /\s/.test(e);
33
33
  }
34
34
  function m(e) {
35
- return e.length > 0 && e.length <= c && s.test(e) && !i.has(e);
35
+ return e.length > 0 && e.length <= c && s.test(e) && !t.has(e);
36
36
  }
37
37
  function h(e) {
38
38
  return {
@@ -221,45 +221,45 @@ function S(e, t) {
221
221
  offsets: r
222
222
  };
223
223
  }
224
- function C(e, t, n) {
225
- let r = [];
226
- for (let a = t; a < n;) {
227
- let t = e[a];
228
- if (t === "\"" || t === "'") {
229
- let r = t;
230
- for (a += 1; a < n;) if (e[a] === "\\") a += 2;
224
+ function C(e, n, r) {
225
+ let i = [];
226
+ for (let a = n; a < r;) {
227
+ let n = e[a];
228
+ if (n === "\"" || n === "'") {
229
+ let t = n;
230
+ for (a += 1; a < r;) if (e[a] === "\\") a += 2;
231
231
  else {
232
- if (e[a] === r) {
232
+ if (e[a] === t) {
233
233
  a += 1;
234
234
  break;
235
235
  }
236
236
  a += 1;
237
237
  }
238
238
  } else {
239
- if (/[0-9]/.test(t) || t === "." && e[a + 1] !== void 0 && /[0-9]/.test(e[a + 1])) {
240
- let t = /^(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?/.exec(e.slice(a, n));
239
+ if (/[0-9]/.test(n) || n === "." && e[a + 1] !== void 0 && /[0-9]/.test(e[a + 1])) {
240
+ let t = /^(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?/.exec(e.slice(a, r));
241
241
  if (t) {
242
242
  a += t[0].length;
243
243
  continue;
244
244
  }
245
245
  }
246
- if (d(t)) {
247
- let t = a;
248
- for (a += 1; a < n && f(e[a]);) a += 1;
249
- let o = e.slice(t, a), s = a;
250
- for (; s < n && p(e[s]);) s += 1;
251
- if (e[s] === "(" || o === "true" || o === "false" || o === "null" || o === "pi" || o === "e" || i.has(o)) continue;
252
- r.push({
246
+ if (d(n)) {
247
+ let n = a;
248
+ for (a += 1; a < r && f(e[a]);) a += 1;
249
+ let o = e.slice(n, a), s = a;
250
+ for (; s < r && p(e[s]);) s += 1;
251
+ if (e[s] === "(" || o === "true" || o === "false" || o === "null" || o === "pi" || o === "e" || t.has(o)) continue;
252
+ i.push({
253
253
  name: o,
254
254
  range: {
255
- start: t,
255
+ start: n,
256
256
  end: a
257
257
  }
258
258
  });
259
259
  } else a += 1;
260
260
  }
261
261
  }
262
- return r;
262
+ return i;
263
263
  }
264
264
  function w(e, t) {
265
265
  return Object.hasOwn(e.props, t) ? t === "bind" || !!e.slots?.some((e) => e.bind === t) : !1;
@@ -309,26 +309,26 @@ function D(e, t) {
309
309
  values: t.enum
310
310
  }])) : void 0;
311
311
  }
312
- function O(e, n, r) {
313
- let i = [], a = /* @__PURE__ */ new Map(), s = [], c = [], l = (t, n) => {
312
+ function O(e, t, n) {
313
+ let r = [], a = /* @__PURE__ */ new Map(), s = [], c = [], l = (t, n) => {
314
314
  for (let r of C(e, t, n)) s.push(r);
315
315
  }, u = (e, t) => {
316
316
  let n = a.get(e);
317
317
  n ? n.push(h(t)) : a.set(e, [h(t)]);
318
- }, d = (t, n) => {
318
+ }, d = (t, i) => {
319
319
  let a = y(e, t.range.start);
320
320
  if (!a || a.closing) return;
321
- i.push({
321
+ r.push({
322
322
  kind: "tag",
323
323
  range: h(a.nameRange)
324
324
  });
325
325
  let c = o(t.name ?? ""), l = a.attrs.some((e) => e.name === "key");
326
326
  for (let o of a.attrs) {
327
- if (i.push({
327
+ if (r.push({
328
328
  kind: "attribute",
329
329
  range: h(o.nameRange)
330
330
  }), !o.valueRange) continue;
331
- let a = D(t.name ?? "", r)?.[o.name], d = c !== void 0 && w(c, o.name) && (t.name !== "table" && t.name !== "chart" || !!l), f = (t.name === "computed" || t.name === "const") && o.name === "name", p = e.slice(o.valueRange.start, o.valueRange.end), g = S(e, o.valueRange);
331
+ let a = D(t.name ?? "", n)?.[o.name], d = c !== void 0 && w(c, o.name) && (t.name !== "table" && t.name !== "chart" || !!l), f = (t.name === "computed" || t.name === "const") && o.name === "name", p = e.slice(o.valueRange.start, o.valueRange.end), g = S(e, o.valueRange);
332
332
  if (t.name === "validation" && o.name === "fields") {
333
333
  for (let e of g.text.matchAll(/\S+/g)) {
334
334
  if (!m(e[0])) continue;
@@ -339,7 +339,7 @@ function O(e, n, r) {
339
339
  s.push({
340
340
  name: e[0],
341
341
  range: t
342
- }), i.push({
342
+ }), r.push({
343
343
  kind: "binding",
344
344
  range: t
345
345
  });
@@ -349,93 +349,93 @@ function O(e, n, r) {
349
349
  let _ = a && !a.static ? x(g.text, 0, g.text.length) : [];
350
350
  if (_.length > 0) {
351
351
  let e = 0;
352
- for (let r of _) {
353
- r.start > e && i.push({
352
+ for (let n of _) {
353
+ n.start > e && r.push({
354
354
  kind: "string",
355
355
  range: {
356
356
  start: g.offsets[e],
357
- end: g.offsets[r.start]
357
+ end: g.offsets[n.start]
358
358
  }
359
- }), i.push({
359
+ }), r.push({
360
360
  kind: "expression",
361
361
  range: {
362
- start: g.offsets[r.start],
363
- end: g.offsets[r.end]
362
+ start: g.offsets[n.start],
363
+ end: g.offsets[n.end]
364
364
  }
365
365
  });
366
- for (let e of C(g.text, r.innerStart, r.innerEnd)) ((n !== "data-table" || t.name !== "column") && (t.name !== "data-table" || o.name !== "key") || e.name !== "item" && e.name !== "index") && s.push({
366
+ for (let e of C(g.text, n.innerStart, n.innerEnd)) ((i !== "data-table" || t.name !== "column") && (t.name !== "data-table" || o.name !== "key") || e.name !== "item" && e.name !== "index") && s.push({
367
367
  name: e.name,
368
368
  range: {
369
369
  start: g.offsets[e.range.start],
370
370
  end: g.offsets[e.range.end]
371
371
  }
372
372
  });
373
- e = r.end;
373
+ e = n.end;
374
374
  }
375
- e < g.text.length && i.push({
375
+ e < g.text.length && r.push({
376
376
  kind: "string",
377
377
  range: {
378
378
  start: g.offsets[e],
379
379
  end: o.valueRange.end
380
380
  }
381
381
  });
382
- } else (d || f) && m(p) ? (i.push({
382
+ } else (d || f) && m(p) ? (r.push({
383
383
  kind: "binding",
384
384
  range: h(o.valueRange)
385
- }), u(p, o.valueRange)) : o.valueRange.end > o.valueRange.start && i.push({
385
+ }), u(p, o.valueRange)) : o.valueRange.end > o.valueRange.start && r.push({
386
386
  kind: "string",
387
387
  range: h(o.valueRange)
388
388
  });
389
389
  }
390
390
  let d = b(e, t, a.end);
391
- d && i.push({
391
+ d && r.push({
392
392
  kind: "tag",
393
393
  range: h(d.nameRange)
394
394
  });
395
- }, f = (n, r) => {
396
- for (let a of n) {
397
- if ((a.type === "component" || a.type === "hostComponent") && a.name) d(a, r);
398
- else if (a.type === "interpolation") i.push({
395
+ }, f = (t, n) => {
396
+ for (let a of t) {
397
+ if ((a.type === "component" || a.type === "hostComponent") && a.name) d(a, n);
398
+ else if (a.type === "interpolation") r.push({
399
399
  kind: "expression",
400
400
  range: h(a.range)
401
401
  }), l(a.range.start + 2, Math.max(a.range.start + 2, a.range.end - 2));
402
402
  else if (a.type === "math" || a.type === "inlineMath") {
403
- if (i.push({
403
+ if (r.push({
404
404
  kind: "math",
405
405
  range: h(a.range)
406
- }), r === "plot" && a.type === "math") {
407
- let n = a.range.start + 2;
406
+ }), n === "plot" && a.type === "math") {
407
+ let t = a.range.start + 2;
408
408
  try {
409
- for (let r of t(e.slice(n, a.range.end - 2))) {
409
+ for (let n of i(e.slice(t, a.range.end - 2))) {
410
410
  let e = {
411
- name: r.name,
411
+ name: n.name,
412
412
  range: {
413
- start: n + r.range.start,
414
- end: n + r.range.end
413
+ start: t + n.range.start,
414
+ end: t + n.range.end
415
415
  }
416
416
  };
417
417
  s.push(e), c.push(e);
418
418
  }
419
419
  } catch {}
420
420
  }
421
- } else a.type === "code" || a.type === "inlineCode" ? i.push({
421
+ } else a.type === "code" || a.type === "inlineCode" ? r.push({
422
422
  kind: "code",
423
423
  range: h(a.range)
424
- }) : a.type === "comment" && i.push({
424
+ }) : a.type === "comment" && r.push({
425
425
  kind: "comment",
426
426
  range: h(a.range)
427
427
  });
428
428
  a.type !== "fallback" && a.children && f(a.children, a.name);
429
429
  }
430
430
  };
431
- f(n);
432
- for (let t of E(e, n)) i.push({
431
+ f(t);
432
+ for (let n of E(e, t)) r.push({
433
433
  kind: "comment",
434
- range: t
434
+ range: n
435
435
  });
436
- i.sort((e, t) => e.range.start - t.range.start || e.range.end - t.range.end);
436
+ r.sort((e, t) => e.range.start - t.range.start || e.range.end - t.range.end);
437
437
  let p = [];
438
- for (let e of i) {
438
+ for (let e of r) {
439
439
  if (e.range.end <= e.range.start) continue;
440
440
  let t = p[p.length - 1];
441
441
  t && e.range.start < t.range.end || p.push(e);