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.
- package/CHANGELOG-ch.md +45 -24
- package/CHANGELOG.md +45 -24
- package/CONTRIBUTING-ch.md +10 -5
- package/CONTRIBUTING.md +10 -5
- package/README-ch.md +38 -36
- package/README-en.md +45 -42
- package/README.md +45 -42
- package/SECURITY-ch.md +1 -1
- package/SECURITY.md +1 -1
- package/THIRD_PARTY_NOTICES.md +481 -1
- package/dist-library/{authoring-DJJjKYg9.js → authoring-DSC0VsNK.js} +58 -58
- package/dist-library/{compiler-UyPwGzJZ.js → compiler-CRD88BMt.js} +6218 -3363
- package/dist-library/react-Dk94rcOp.js +59658 -0
- package/dist-library/reactive-md-authoring.js +2 -2
- package/dist-library/reactive-md-editor.js +13 -0
- package/dist-library/reactive-md-react-unstyled.js +1 -1
- package/dist-library/reactive-md-react.js +1 -1
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +123 -123
- package/dist-library/{runtime-DXtle_6c.js → runtime-D8KbnCd0.js} +151 -151
- package/dist-library/types/editor/types.d.ts +2 -0
- package/dist-library/types/local/code-block.d.ts +3 -1
- package/dist-library/types/local/code-languages.d.ts +7 -0
- package/dist-library/types/local/compiled-data.d.ts +6 -0
- package/dist-library/types/local/compiler.d.ts +1 -0
- package/dist-library/types/local/diagnostics.d.ts +31 -0
- package/dist-library/types/local/diagram-layout.d.ts +69 -0
- package/dist-library/types/local/html-names.d.ts +6 -0
- package/dist-library/types/local/html-table.d.ts +25 -0
- package/dist-library/types/local/math-display.d.ts +1 -0
- package/dist-library/types/local/table-surface.d.ts +10 -0
- package/dist-library/types/local/types.d.ts +2 -0
- package/dist-library/types/local/visuals.d.ts +9 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +75 -51
- package/docs/README.md +84 -0
- package/docs/{compatibility-ch.md → compatibility/compatibility-ch.md} +28 -18
- package/docs/{compatibility-en.md → compatibility/compatibility-en.md} +28 -18
- package/docs/{source-versioning-ch.md → compatibility/source-versioning-ch.md} +2 -2
- package/docs/{source-versioning-en.md → compatibility/source-versioning-en.md} +2 -2
- package/docs/{component-development-ch.md → development/component-development-ch.md} +7 -7
- package/docs/{component-development-en.md → development/component-development-en.md} +7 -7
- package/docs/{component-protocol-ch.md → development/component-protocol-ch.md} +17 -17
- package/docs/{component-protocol-en.md → development/component-protocol-en.md} +17 -17
- package/docs/{performance-ch.md → development/performance-ch.md} +2 -2
- package/docs/{performance-en.md → development/performance-en.md} +2 -2
- package/docs/{releasing-ch.md → development/releasing-ch.md} +12 -12
- package/docs/{releasing-en.md → development/releasing-en.md} +12 -12
- package/docs/guides/local-guide-ch.md +513 -0
- package/docs/guides/local-guide-en.md +513 -0
- package/docs/{author-tools-ch.md → integration/author-tools-ch.md} +8 -8
- package/docs/{author-tools-en.md → integration/author-tools-en.md} +8 -8
- package/docs/{editor-ch.md → integration/editor-ch.md} +7 -6
- package/docs/{editor-en.md → integration/editor-en.md} +7 -6
- package/docs/{local-integration-ch.md → integration/local-integration-ch.md} +33 -15
- package/docs/{local-integration-en.md → integration/local-integration-en.md} +33 -15
- package/docs/{shareable-export-ch.md → integration/shareable-export-ch.md} +16 -4
- package/docs/{shareable-export-en.md → integration/shareable-export-en.md} +16 -4
- package/docs/{computations-formatting-ch.md → reference/computations-formatting-ch.md} +2 -2
- package/docs/{computations-formatting-en.md → reference/computations-formatting-en.md} +2 -2
- package/docs/{constraints-collections-ch.md → reference/constraints-collections-ch.md} +2 -2
- package/docs/{constraints-collections-en.md → reference/constraints-collections-en.md} +2 -2
- package/docs/{diagnostics-counting-ch.md → reference/diagnostics-counting-ch.md} +22 -2
- package/docs/{diagnostics-counting-en.md → reference/diagnostics-counting-en.md} +22 -2
- package/docs/{html-compatibility-ch.md → reference/html-compatibility-ch.md} +42 -4
- package/docs/{html-compatibility-en.md → reference/html-compatibility-en.md} +42 -4
- package/docs/{local-components-v2-ch.md → reference/local-components-v2-ch.md} +2 -2
- package/docs/{local-components-v2-en.md → reference/local-components-v2-en.md} +2 -2
- package/docs/{local-interaction-syntax-ch.md → reference/local-interaction-syntax-ch.md} +26 -7
- package/docs/{local-interaction-syntax-en.md → reference/local-interaction-syntax-en.md} +26 -7
- package/docs/{theme-protocol-ch.md → reference/theme-protocol-ch.md} +1 -1
- package/docs/{theme-protocol-en.md → reference/theme-protocol-en.md} +1 -1
- package/docs/{release-0.4.0-ch.md → releases/release-0.4.0-ch.md} +6 -6
- package/docs/{release-0.4.0-en.md → releases/release-0.4.0-en.md} +6 -6
- package/docs/{release-0.4.1-ch.md → releases/release-0.4.1-ch.md} +2 -2
- package/docs/{release-0.4.1-en.md → releases/release-0.4.1-en.md} +2 -2
- package/docs/{release-0.5.0-ch.md → releases/release-0.5.0-ch.md} +4 -4
- package/docs/{release-0.5.0-en.md → releases/release-0.5.0-en.md} +4 -4
- package/docs/{release-0.5.1-ch.md → releases/release-0.5.1-ch.md} +4 -4
- package/docs/{release-0.5.1-en.md → releases/release-0.5.1-en.md} +4 -4
- package/docs/{release-0.5.2-ch.md → releases/release-0.5.2-ch.md} +3 -3
- package/docs/{release-0.5.2-en.md → releases/release-0.5.2-en.md} +3 -3
- package/docs/{release-0.5.3-ch.md → releases/release-0.5.3-ch.md} +1 -1
- package/docs/{release-0.5.3-en.md → releases/release-0.5.3-en.md} +1 -1
- package/docs/releases/release-0.6.0-ch.md +57 -0
- package/docs/releases/release-0.6.0-en.md +57 -0
- package/examples/conformance/README.md +4 -4
- package/examples/integration/README.md +10 -8
- package/examples/integration/worker/package.json +1 -1
- package/examples/local/README.md +5 -5
- package/examples/local/html-compat.reactive.md +19 -0
- package/package.json +9 -2
- package/dist-library/react-fizgU3i8.js +0 -12764
- package/docs/local-guide-ch.md +0 -967
- package/docs/local-guide-en.md +0 -967
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as e,
|
|
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) && !
|
|
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,
|
|
225
|
-
let
|
|
226
|
-
for (let a =
|
|
227
|
-
let
|
|
228
|
-
if (
|
|
229
|
-
let
|
|
230
|
-
for (a += 1; a <
|
|
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] ===
|
|
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(
|
|
240
|
-
let t = /^(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?/.exec(e.slice(a,
|
|
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(
|
|
247
|
-
let
|
|
248
|
-
for (a += 1; a <
|
|
249
|
-
let o = e.slice(
|
|
250
|
-
for (; s <
|
|
251
|
-
if (e[s] === "(" || o === "true" || o === "false" || o === "null" || o === "pi" || o === "e" ||
|
|
252
|
-
|
|
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:
|
|
255
|
+
start: n,
|
|
256
256
|
end: a
|
|
257
257
|
}
|
|
258
258
|
});
|
|
259
259
|
} else a += 1;
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
return
|
|
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,
|
|
313
|
-
let
|
|
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,
|
|
318
|
+
}, d = (t, i) => {
|
|
319
319
|
let a = y(e, t.range.start);
|
|
320
320
|
if (!a || a.closing) return;
|
|
321
|
-
|
|
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 (
|
|
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 ?? "",
|
|
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
|
-
}),
|
|
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
|
|
353
|
-
|
|
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[
|
|
357
|
+
end: g.offsets[n.start]
|
|
358
358
|
}
|
|
359
|
-
}),
|
|
359
|
+
}), r.push({
|
|
360
360
|
kind: "expression",
|
|
361
361
|
range: {
|
|
362
|
-
start: g.offsets[
|
|
363
|
-
end: g.offsets[
|
|
362
|
+
start: g.offsets[n.start],
|
|
363
|
+
end: g.offsets[n.end]
|
|
364
364
|
}
|
|
365
365
|
});
|
|
366
|
-
for (let e of C(g.text,
|
|
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 =
|
|
373
|
+
e = n.end;
|
|
374
374
|
}
|
|
375
|
-
e < g.text.length &&
|
|
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) ? (
|
|
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 &&
|
|
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 &&
|
|
391
|
+
d && r.push({
|
|
392
392
|
kind: "tag",
|
|
393
393
|
range: h(d.nameRange)
|
|
394
394
|
});
|
|
395
|
-
}, f = (
|
|
396
|
-
for (let a of
|
|
397
|
-
if ((a.type === "component" || a.type === "hostComponent") && a.name) d(a,
|
|
398
|
-
else if (a.type === "interpolation")
|
|
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 (
|
|
403
|
+
if (r.push({
|
|
404
404
|
kind: "math",
|
|
405
405
|
range: h(a.range)
|
|
406
|
-
}),
|
|
407
|
-
let
|
|
406
|
+
}), n === "plot" && a.type === "math") {
|
|
407
|
+
let t = a.range.start + 2;
|
|
408
408
|
try {
|
|
409
|
-
for (let
|
|
409
|
+
for (let n of i(e.slice(t, a.range.end - 2))) {
|
|
410
410
|
let e = {
|
|
411
|
-
name:
|
|
411
|
+
name: n.name,
|
|
412
412
|
range: {
|
|
413
|
-
start:
|
|
414
|
-
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" ?
|
|
421
|
+
} else a.type === "code" || a.type === "inlineCode" ? r.push({
|
|
422
422
|
kind: "code",
|
|
423
423
|
range: h(a.range)
|
|
424
|
-
}) : a.type === "comment" &&
|
|
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(
|
|
432
|
-
for (let
|
|
431
|
+
f(t);
|
|
432
|
+
for (let n of E(e, t)) r.push({
|
|
433
433
|
kind: "comment",
|
|
434
|
-
range:
|
|
434
|
+
range: n
|
|
435
435
|
});
|
|
436
|
-
|
|
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
|
|
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);
|