@agentshouse/mdmodel 0.1.0-alpha.17 → 0.1.0-alpha.19

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 (59) hide show
  1. package/API.md +13 -11
  2. package/dist/links.d.ts.map +1 -1
  3. package/dist/links.js +529 -148
  4. package/dist/links.js.map +1 -1
  5. package/dist/project.d.ts.map +1 -1
  6. package/dist/project.js +10 -2
  7. package/dist/project.js.map +1 -1
  8. package/dist/schema.d.ts +2 -1
  9. package/dist/schema.d.ts.map +1 -1
  10. package/dist/schema.js +5 -0
  11. package/dist/schema.js.map +1 -1
  12. package/dist/sections.d.ts +2 -1
  13. package/dist/sections.d.ts.map +1 -1
  14. package/dist/sections.js +33 -15
  15. package/dist/sections.js.map +1 -1
  16. package/dist/validate.d.ts.map +1 -1
  17. package/dist/validate.js +49 -22
  18. package/dist/validate.js.map +1 -1
  19. package/dist/version.d.ts +1 -1
  20. package/dist/version.js +1 -1
  21. package/dist/version.js.map +1 -1
  22. package/dist/yaml.d.ts +1 -0
  23. package/dist/yaml.d.ts.map +1 -1
  24. package/dist/yaml.js +1 -1
  25. package/dist/yaml.js.map +1 -1
  26. package/fixtures/README.md +11 -5
  27. package/fixtures/cases/section-item-enum/context.json +1 -0
  28. package/fixtures/cases/section-item-enum/expected.json +7 -0
  29. package/fixtures/cases/section-item-enum/library/task.md +8 -0
  30. package/fixtures/cases/section-item-enum/schema.yaml +4 -0
  31. package/fixtures/cases/section-item-kind/context.json +1 -0
  32. package/fixtures/cases/section-item-kind/expected.json +7 -0
  33. package/fixtures/cases/section-item-kind/library/task.md +8 -0
  34. package/fixtures/cases/section-item-kind/schema.yaml +4 -0
  35. package/fixtures/cases/section-items/context.json +1 -0
  36. package/fixtures/cases/section-items/expected.json +1 -0
  37. package/fixtures/cases/section-items/library/other.md +3 -0
  38. package/fixtures/cases/section-items/library/page.md +28 -0
  39. package/fixtures/cases/section-items/schema.yaml +8 -0
  40. package/fixtures/cases/section-reference-path/context.json +1 -0
  41. package/fixtures/cases/section-reference-path/expected.json +7 -0
  42. package/fixtures/cases/section-reference-path/library/other.md +3 -0
  43. package/fixtures/cases/section-reference-path/library/page.md +7 -0
  44. package/fixtures/cases/section-reference-path/schema.yaml +4 -0
  45. package/fixtures/cases/section-reference-type/context.json +1 -0
  46. package/fixtures/cases/section-reference-type/expected.json +7 -0
  47. package/fixtures/cases/section-reference-type/library/note.md +1 -0
  48. package/fixtures/cases/section-reference-type/library/page.md +7 -0
  49. package/fixtures/cases/section-reference-type/schema.yaml +4 -0
  50. package/fixtures/cases/shortcut-reference-link/context.json +1 -0
  51. package/fixtures/cases/shortcut-reference-link/expected.json +6 -0
  52. package/fixtures/cases/shortcut-reference-link/library/item.md +10 -0
  53. package/fixtures/cases/shortcut-reference-link/schema.yaml +6 -0
  54. package/fixtures/cases/text-field-kind/context.json +1 -0
  55. package/fixtures/cases/text-field-kind/expected.json +7 -0
  56. package/fixtures/cases/text-field-kind/library/page.md +4 -0
  57. package/fixtures/cases/text-field-kind/schema.yaml +4 -0
  58. package/fixtures/projection.json +61 -0
  59. package/package.json +1 -1
package/API.md CHANGED
@@ -93,9 +93,11 @@ A typed Document carries the frontmatter fields its MD type declares, plus
93
93
  `member_document` also carries `member`, a string, unless that type declares
94
94
  it. Any other field is refused as `undeclared-field` at that field name. A field
95
95
  name YAML carries to a record prototype, `__proto__` among them, is an ordinary
96
- undeclared field and is refused as one. A declared list section is validated as
97
- a list; its declared item kind governs projection eligibility rather than the
98
- value of each item, which validation reads no further than that list form.
96
+ undeclared field and is refused as one. Every occurrence of a declared list section is a list
97
+ whose every item is one value of its declared item kind, or it is refused as `structured-section`.
98
+ A free-text or string item is any text; a number, date, or enum item is that value alone, such
99
+ as `- 3`; a reference item is one ordinary link alone, such as `- [Ada](ada.md)`, refused as
100
+ `unresolved-reference` where it reaches a binary target, a URL, or another MD type's Document.
99
101
  Validation returns acceptance or one refusal naming the file, the field or
100
102
  section, the violated rule, and `VERSION`. `parse`, `apply`, and `serialize` operate on a single text
101
103
  Document; they do not validate collection membership or consume binary bytes.
@@ -220,14 +222,14 @@ the model reads no bytes, resolves no authority, and classifies nothing it was
220
222
  not given.
221
223
 
222
224
  An internal link contributes its visible label and no destination, fragment, or
223
- title, in the inline `[label](path)`, full `[label][id]`, and collapsed
224
- `[label][]` forms, and the link reference definition an enumerated use resolves
225
- through leaves the projection with it. An image at a supplied document target
226
- contributes its alt text the same way, because a move rewrites that destination
227
- too. External URLs, retained binary targets, unsupplied destinations, bare
228
- fragments, code spans, fenced code, and escaped syntax stay exactly as authored,
229
- read through the same syntax profile `links` and `validate` read. `project`
230
- returns text and never rewrites the Document.
225
+ title, in the inline `[label](path)`, full `[label][id]`, collapsed
226
+ `[label][]`, and shortcut `[label]` forms, and the link reference definition an
227
+ enumerated use resolves through leaves the projection with it. An image at a
228
+ supplied document target contributes its alt text the same way, because a move
229
+ rewrites that destination too. External URLs, retained binary targets,
230
+ unsupplied destinations, bare fragments, code spans, fenced code, and escaped
231
+ syntax stay exactly as authored, read through the same syntax profile `links`
232
+ and `validate` read. `project` returns text and never rewrites the Document.
231
233
 
232
234
  Because a moved Path changes destinations alone, applying a `link` change leaves
233
235
  the projection of every Document it rewrites byte-identical, while a changed
@@ -1 +1 @@
1
- {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AA8WA,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,M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