@driftsys/markspec 0.10.2 → 0.11.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/README.md +2 -2
- package/esm/compiler/deserialize.d.ts +49 -0
- package/esm/compiler/deserialize.d.ts.map +1 -0
- package/esm/compiler/deserialize.js +139 -0
- package/esm/compiler/manifest.d.ts +3 -0
- package/esm/compiler/manifest.d.ts.map +1 -1
- package/esm/compiler/manifest.js +9 -3
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +16 -7
- package/esm/config/markspec.d.ts +38 -1
- package/esm/config/markspec.d.ts.map +1 -1
- package/esm/config/markspec.js +127 -2
- package/esm/config/mod.d.ts.map +1 -1
- package/esm/config/mod.js +143 -147
- package/esm/decl/duplicates.d.ts +29 -0
- package/esm/decl/duplicates.d.ts.map +1 -0
- package/esm/decl/duplicates.js +28 -0
- package/esm/decl/mod.d.ts +20 -0
- package/esm/decl/mod.d.ts.map +1 -0
- package/esm/decl/mod.js +15 -0
- package/esm/decl/resolve.d.ts +104 -0
- package/esm/decl/resolve.d.ts.map +1 -0
- package/esm/decl/resolve.js +66 -0
- package/esm/decl/surfaces.d.ts +118 -0
- package/esm/decl/surfaces.d.ts.map +1 -0
- package/esm/decl/surfaces.js +135 -0
- package/esm/decl/table.d.ts +50 -0
- package/esm/decl/table.d.ts.map +1 -0
- package/esm/decl/table.js +124 -0
- package/esm/gates/mod.d.ts +13 -2
- package/esm/gates/mod.d.ts.map +1 -1
- package/esm/gates/mod.js +38 -11
- package/esm/lint/runner.d.ts.map +1 -1
- package/esm/lint/runner.js +3 -1
- package/esm/lock/acquire_compile.d.ts +31 -0
- package/esm/lock/acquire_compile.d.ts.map +1 -0
- package/esm/lock/acquire_compile.js +83 -0
- package/esm/lock/cache_check.d.ts +28 -0
- package/esm/lock/cache_check.d.ts.map +1 -0
- package/esm/lock/cache_check.js +51 -0
- package/esm/lock/check.d.ts +14 -3
- package/esm/lock/check.d.ts.map +1 -1
- package/esm/lock/check.js +41 -3
- package/esm/lock/git_intent.d.ts +46 -0
- package/esm/lock/git_intent.d.ts.map +1 -0
- package/esm/lock/git_intent.js +111 -0
- package/esm/lock/mod.d.ts +10 -3
- package/esm/lock/mod.d.ts.map +1 -1
- package/esm/lock/mod.js +7 -1
- package/esm/lock/model.d.ts +24 -1
- package/esm/lock/model.d.ts.map +1 -1
- package/esm/lock/parser.d.ts.map +1 -1
- package/esm/lock/parser.js +32 -0
- package/esm/lock/pin_assurance.d.ts +20 -0
- package/esm/lock/pin_assurance.d.ts.map +1 -0
- package/esm/lock/pin_assurance.js +34 -0
- package/esm/lock/resolve.d.ts +8 -17
- package/esm/lock/resolve.d.ts.map +1 -1
- package/esm/lock/resolve.js +7 -67
- package/esm/lock/serializer.d.ts.map +1 -1
- package/esm/lock/serializer.js +23 -0
- package/esm/lock/upstream_common.d.ts +29 -0
- package/esm/lock/upstream_common.d.ts.map +1 -0
- package/esm/lock/upstream_common.js +38 -0
- package/esm/lock/upstream_deps.d.ts +63 -0
- package/esm/lock/upstream_deps.d.ts.map +1 -0
- package/esm/lock/upstream_deps.js +172 -0
- package/esm/lock/upstream_refs.d.ts +69 -0
- package/esm/lock/upstream_refs.d.ts.map +1 -0
- package/esm/lock/upstream_refs.js +238 -0
- package/esm/mod.d.ts +16 -8
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +15 -5
- package/esm/model/mod.d.ts +93 -28
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +66 -13
- package/esm/model/profile.d.ts +13 -0
- package/esm/model/profile.d.ts.map +1 -1
- package/esm/parser/directives.d.ts +6 -0
- package/esm/parser/directives.d.ts.map +1 -1
- package/esm/parser/directives.js +17 -0
- package/esm/parser/markdown.d.ts.map +1 -1
- package/esm/parser/markdown.js +16 -51
- package/esm/profile/manifest.d.ts.map +1 -1
- package/esm/profile/manifest.js +20 -3
- package/esm/profile/merge.js +7 -0
- package/esm/reporter/mod.d.ts +11 -0
- package/esm/reporter/mod.d.ts.map +1 -1
- package/esm/reporter/mod.js +19 -8
- package/esm/typl/assemble.d.ts +53 -0
- package/esm/typl/assemble.d.ts.map +1 -0
- package/esm/typl/assemble.js +238 -0
- package/esm/typl/ast.d.ts +7 -1
- package/esm/typl/ast.d.ts.map +1 -1
- package/esm/typl/ast.js +3 -0
- package/esm/typl/bullet.d.ts +16 -24
- package/esm/typl/bullet.d.ts.map +1 -1
- package/esm/typl/bullet.js +9 -41
- package/esm/typl/citations.d.ts +27 -0
- package/esm/typl/citations.d.ts.map +1 -0
- package/esm/typl/citations.js +16 -0
- package/esm/typl/diagnostics.d.ts +2 -2
- package/esm/typl/diagnostics.d.ts.map +1 -1
- package/esm/typl/diagnostics.js +18 -0
- package/esm/typl/fence.d.ts +12 -21
- package/esm/typl/fence.d.ts.map +1 -1
- package/esm/typl/fence.js +5 -20
- package/esm/typl/grammar.d.ts.map +1 -1
- package/esm/typl/grammar.js +6 -0
- package/esm/typl/inline.d.ts +15 -24
- package/esm/typl/inline.d.ts.map +1 -1
- package/esm/typl/inline.js +6 -44
- package/esm/typl/lexer.d.ts.map +1 -1
- package/esm/typl/lexer.js +25 -4
- package/esm/typl/mod.d.ts +8 -2
- package/esm/typl/mod.d.ts.map +1 -1
- package/esm/typl/mod.js +5 -1
- package/esm/typl/recognize.d.ts +14 -0
- package/esm/typl/recognize.d.ts.map +1 -0
- package/esm/typl/recognize.js +19 -0
- package/esm/typl/registry.d.ts +1 -1
- package/esm/typl/resolve.d.ts +31 -0
- package/esm/typl/resolve.d.ts.map +1 -0
- package/esm/typl/resolve.js +27 -0
- package/esm/typl/table.d.ts +52 -0
- package/esm/typl/table.d.ts.map +1 -0
- package/esm/typl/table.js +69 -0
- package/esm/typl/validator.d.ts +24 -5
- package/esm/typl/validator.d.ts.map +1 -1
- package/esm/typl/validator.js +55 -75
- package/esm/upstream/mod.d.ts +45 -0
- package/esm/upstream/mod.d.ts.map +1 -0
- package/esm/upstream/mod.js +98 -0
- package/esm/upstream/project.d.ts +33 -0
- package/esm/upstream/project.d.ts.map +1 -0
- package/esm/upstream/project.js +38 -0
- package/esm/upstream/refs.d.ts +23 -0
- package/esm/upstream/refs.d.ts.map +1 -0
- package/esm/upstream/refs.js +71 -0
- package/esm/util/paths.d.ts +14 -0
- package/esm/util/paths.d.ts.map +1 -0
- package/esm/util/paths.js +22 -0
- package/esm/uxil/assemble.d.ts +38 -0
- package/esm/uxil/assemble.d.ts.map +1 -0
- package/esm/uxil/assemble.js +268 -0
- package/esm/uxil/ast.d.ts +63 -0
- package/esm/uxil/ast.d.ts.map +1 -0
- package/esm/uxil/ast.js +9 -0
- package/esm/uxil/citations.d.ts +27 -0
- package/esm/uxil/citations.d.ts.map +1 -0
- package/esm/uxil/citations.js +25 -0
- package/esm/uxil/diagnostics.d.ts +39 -0
- package/esm/uxil/diagnostics.d.ts.map +1 -0
- package/esm/uxil/diagnostics.js +135 -0
- package/esm/uxil/grammar.d.ts +72 -0
- package/esm/uxil/grammar.d.ts.map +1 -0
- package/esm/uxil/grammar.js +505 -0
- package/esm/uxil/lexer.d.ts +23 -0
- package/esm/uxil/lexer.d.ts.map +1 -0
- package/esm/uxil/lexer.js +58 -0
- package/esm/uxil/mod.d.ts +32 -0
- package/esm/uxil/mod.d.ts.map +1 -0
- package/esm/uxil/mod.js +11 -0
- package/esm/uxil/projection.d.ts +40 -0
- package/esm/uxil/projection.d.ts.map +1 -0
- package/esm/uxil/projection.js +41 -0
- package/esm/uxil/recognize.d.ts +16 -0
- package/esm/uxil/recognize.d.ts.map +1 -0
- package/esm/uxil/recognize.js +28 -0
- package/esm/uxil/registry.d.ts +37 -0
- package/esm/uxil/registry.d.ts.map +1 -0
- package/esm/uxil/registry.js +29 -0
- package/esm/uxil/surfaces.d.ts +36 -0
- package/esm/uxil/surfaces.d.ts.map +1 -0
- package/esm/uxil/surfaces.js +34 -0
- package/esm/uxil/validator.d.ts +36 -0
- package/esm/uxil/validator.d.ts.map +1 -0
- package/esm/uxil/validator.js +139 -0
- package/esm/uxil/vocab.d.ts +33 -0
- package/esm/uxil/vocab.d.ts.map +1 -0
- package/esm/uxil/vocab.js +36 -0
- package/esm/validator/body_blocks.d.ts.map +1 -1
- package/esm/validator/body_blocks.js +3 -9
- package/esm/validator/caption_convention.d.ts +2 -1
- package/esm/validator/caption_convention.d.ts.map +1 -1
- package/esm/validator/caption_convention.js +2 -1
- package/esm/validator/corpus.d.ts.map +1 -1
- package/esm/validator/corpus.js +40 -17
- package/esm/validator/discipline.d.ts +6 -4
- package/esm/validator/discipline.d.ts.map +1 -1
- package/esm/validator/discipline.js +6 -4
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +28 -15
- package/esm/validator/pipeline.d.ts +11 -1
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +68 -18
- package/esm/validator/trace_types.d.ts +9 -2
- package/esm/validator/trace_types.d.ts.map +1 -1
- package/esm/validator/trace_types.js +21 -5
- package/esm/validator/traceability.d.ts +15 -3
- package/esm/validator/traceability.d.ts.map +1 -1
- package/esm/validator/traceability.js +39 -4
- package/esm/validator/types.d.ts.map +1 -1
- package/esm/validator/types.js +11 -1
- package/esm/validator/uxil_family.d.ts +43 -0
- package/esm/validator/uxil_family.d.ts.map +1 -0
- package/esm/validator/uxil_family.js +52 -0
- package/package.json +1 -1
- package/script/compiler/deserialize.d.ts +49 -0
- package/script/compiler/deserialize.d.ts.map +1 -0
- package/script/compiler/deserialize.js +144 -0
- package/script/compiler/manifest.d.ts +3 -0
- package/script/compiler/manifest.d.ts.map +1 -1
- package/script/compiler/manifest.js +10 -3
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +15 -6
- package/script/config/markspec.d.ts +38 -1
- package/script/config/markspec.d.ts.map +1 -1
- package/script/config/markspec.js +129 -3
- package/script/config/mod.d.ts.map +1 -1
- package/script/config/mod.js +143 -147
- package/script/decl/duplicates.d.ts +29 -0
- package/script/decl/duplicates.d.ts.map +1 -0
- package/script/decl/duplicates.js +31 -0
- package/script/decl/mod.d.ts +20 -0
- package/script/decl/mod.d.ts.map +1 -0
- package/script/decl/mod.js +26 -0
- package/script/decl/resolve.d.ts +104 -0
- package/script/decl/resolve.d.ts.map +1 -0
- package/script/decl/resolve.js +70 -0
- package/script/decl/surfaces.d.ts +118 -0
- package/script/decl/surfaces.d.ts.map +1 -0
- package/script/decl/surfaces.js +141 -0
- package/script/decl/table.d.ts +50 -0
- package/script/decl/table.d.ts.map +1 -0
- package/script/decl/table.js +127 -0
- package/script/gates/mod.d.ts +13 -2
- package/script/gates/mod.d.ts.map +1 -1
- package/script/gates/mod.js +37 -10
- package/script/lint/runner.d.ts.map +1 -1
- package/script/lint/runner.js +3 -1
- package/script/lock/acquire_compile.d.ts +31 -0
- package/script/lock/acquire_compile.d.ts.map +1 -0
- package/script/lock/acquire_compile.js +86 -0
- package/script/lock/cache_check.d.ts +28 -0
- package/script/lock/cache_check.d.ts.map +1 -0
- package/script/lock/cache_check.js +54 -0
- package/script/lock/check.d.ts +14 -3
- package/script/lock/check.d.ts.map +1 -1
- package/script/lock/check.js +41 -3
- package/script/lock/git_intent.d.ts +46 -0
- package/script/lock/git_intent.d.ts.map +1 -0
- package/script/lock/git_intent.js +115 -0
- package/script/lock/mod.d.ts +10 -3
- package/script/lock/mod.d.ts.map +1 -1
- package/script/lock/mod.js +16 -2
- package/script/lock/model.d.ts +24 -1
- package/script/lock/model.d.ts.map +1 -1
- package/script/lock/parser.d.ts.map +1 -1
- package/script/lock/parser.js +32 -0
- package/script/lock/pin_assurance.d.ts +20 -0
- package/script/lock/pin_assurance.d.ts.map +1 -0
- package/script/lock/pin_assurance.js +37 -0
- package/script/lock/resolve.d.ts +8 -17
- package/script/lock/resolve.d.ts.map +1 -1
- package/script/lock/resolve.js +7 -68
- package/script/lock/serializer.d.ts.map +1 -1
- package/script/lock/serializer.js +23 -0
- package/script/lock/upstream_common.d.ts +29 -0
- package/script/lock/upstream_common.d.ts.map +1 -0
- package/script/lock/upstream_common.js +42 -0
- package/script/lock/upstream_deps.d.ts +63 -0
- package/script/lock/upstream_deps.d.ts.map +1 -0
- package/script/lock/upstream_deps.js +175 -0
- package/script/lock/upstream_refs.d.ts +69 -0
- package/script/lock/upstream_refs.d.ts.map +1 -0
- package/script/lock/upstream_refs.js +244 -0
- package/script/mod.d.ts +16 -8
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +40 -7
- package/script/model/mod.d.ts +93 -28
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +70 -14
- package/script/model/profile.d.ts +13 -0
- package/script/model/profile.d.ts.map +1 -1
- package/script/parser/directives.d.ts +6 -0
- package/script/parser/directives.d.ts.map +1 -1
- package/script/parser/directives.js +18 -0
- package/script/parser/markdown.d.ts.map +1 -1
- package/script/parser/markdown.js +15 -50
- package/script/profile/manifest.d.ts.map +1 -1
- package/script/profile/manifest.js +20 -3
- package/script/profile/merge.js +7 -0
- package/script/reporter/mod.d.ts +11 -0
- package/script/reporter/mod.d.ts.map +1 -1
- package/script/reporter/mod.js +18 -7
- package/script/typl/assemble.d.ts +53 -0
- package/script/typl/assemble.d.ts.map +1 -0
- package/script/typl/assemble.js +241 -0
- package/script/typl/ast.d.ts +7 -1
- package/script/typl/ast.d.ts.map +1 -1
- package/script/typl/ast.js +3 -0
- package/script/typl/bullet.d.ts +16 -24
- package/script/typl/bullet.d.ts.map +1 -1
- package/script/typl/bullet.js +10 -42
- package/script/typl/citations.d.ts +27 -0
- package/script/typl/citations.d.ts.map +1 -0
- package/script/typl/citations.js +20 -0
- package/script/typl/diagnostics.d.ts +2 -2
- package/script/typl/diagnostics.d.ts.map +1 -1
- package/script/typl/diagnostics.js +18 -0
- package/script/typl/fence.d.ts +12 -21
- package/script/typl/fence.d.ts.map +1 -1
- package/script/typl/fence.js +5 -20
- package/script/typl/grammar.d.ts.map +1 -1
- package/script/typl/grammar.js +6 -0
- package/script/typl/inline.d.ts +15 -24
- package/script/typl/inline.d.ts.map +1 -1
- package/script/typl/inline.js +6 -44
- package/script/typl/lexer.d.ts.map +1 -1
- package/script/typl/lexer.js +25 -4
- package/script/typl/mod.d.ts +8 -2
- package/script/typl/mod.d.ts.map +1 -1
- package/script/typl/mod.js +14 -2
- package/script/typl/recognize.d.ts +14 -0
- package/script/typl/recognize.d.ts.map +1 -0
- package/script/typl/recognize.js +22 -0
- package/script/typl/registry.d.ts +1 -1
- package/script/typl/resolve.d.ts +31 -0
- package/script/typl/resolve.d.ts.map +1 -0
- package/script/typl/resolve.js +33 -0
- package/script/typl/table.d.ts +52 -0
- package/script/typl/table.d.ts.map +1 -0
- package/script/typl/table.js +75 -0
- package/script/typl/validator.d.ts +24 -5
- package/script/typl/validator.d.ts.map +1 -1
- package/script/typl/validator.js +55 -75
- package/script/upstream/mod.d.ts +45 -0
- package/script/upstream/mod.d.ts.map +1 -0
- package/script/upstream/mod.js +101 -0
- package/script/upstream/project.d.ts +33 -0
- package/script/upstream/project.d.ts.map +1 -0
- package/script/upstream/project.js +41 -0
- package/script/upstream/refs.d.ts +23 -0
- package/script/upstream/refs.d.ts.map +1 -0
- package/script/upstream/refs.js +74 -0
- package/script/util/paths.d.ts +14 -0
- package/script/util/paths.d.ts.map +1 -0
- package/script/util/paths.js +25 -0
- package/script/uxil/assemble.d.ts +38 -0
- package/script/uxil/assemble.d.ts.map +1 -0
- package/script/uxil/assemble.js +272 -0
- package/script/uxil/ast.d.ts +63 -0
- package/script/uxil/ast.d.ts.map +1 -0
- package/script/uxil/ast.js +10 -0
- package/script/uxil/citations.d.ts +27 -0
- package/script/uxil/citations.d.ts.map +1 -0
- package/script/uxil/citations.js +29 -0
- package/script/uxil/diagnostics.d.ts +39 -0
- package/script/uxil/diagnostics.d.ts.map +1 -0
- package/script/uxil/diagnostics.js +140 -0
- package/script/uxil/grammar.d.ts +72 -0
- package/script/uxil/grammar.d.ts.map +1 -0
- package/script/uxil/grammar.js +511 -0
- package/script/uxil/lexer.d.ts +23 -0
- package/script/uxil/lexer.d.ts.map +1 -0
- package/script/uxil/lexer.js +61 -0
- package/script/uxil/mod.d.ts +32 -0
- package/script/uxil/mod.d.ts.map +1 -0
- package/script/uxil/mod.js +37 -0
- package/script/uxil/projection.d.ts +40 -0
- package/script/uxil/projection.d.ts.map +1 -0
- package/script/uxil/projection.js +44 -0
- package/script/uxil/recognize.d.ts +16 -0
- package/script/uxil/recognize.d.ts.map +1 -0
- package/script/uxil/recognize.js +31 -0
- package/script/uxil/registry.d.ts +37 -0
- package/script/uxil/registry.d.ts.map +1 -0
- package/script/uxil/registry.js +32 -0
- package/script/uxil/surfaces.d.ts +36 -0
- package/script/uxil/surfaces.d.ts.map +1 -0
- package/script/uxil/surfaces.js +39 -0
- package/script/uxil/validator.d.ts +36 -0
- package/script/uxil/validator.d.ts.map +1 -0
- package/script/uxil/validator.js +142 -0
- package/script/uxil/vocab.d.ts +33 -0
- package/script/uxil/vocab.d.ts.map +1 -0
- package/script/uxil/vocab.js +41 -0
- package/script/validator/body_blocks.d.ts.map +1 -1
- package/script/validator/body_blocks.js +3 -9
- package/script/validator/caption_convention.d.ts +2 -1
- package/script/validator/caption_convention.d.ts.map +1 -1
- package/script/validator/caption_convention.js +2 -1
- package/script/validator/corpus.d.ts.map +1 -1
- package/script/validator/corpus.js +39 -16
- package/script/validator/discipline.d.ts +6 -4
- package/script/validator/discipline.d.ts.map +1 -1
- package/script/validator/discipline.js +6 -4
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +27 -14
- package/script/validator/pipeline.d.ts +11 -1
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +67 -17
- package/script/validator/trace_types.d.ts +9 -2
- package/script/validator/trace_types.d.ts.map +1 -1
- package/script/validator/trace_types.js +20 -4
- package/script/validator/traceability.d.ts +15 -3
- package/script/validator/traceability.d.ts.map +1 -1
- package/script/validator/traceability.js +38 -3
- package/script/validator/types.d.ts.map +1 -1
- package/script/validator/types.js +10 -0
- package/script/validator/uxil_family.d.ts +43 -0
- package/script/validator/uxil_family.d.ts.map +1 -0
- package/script/validator/uxil_family.js +56 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../src/uxil/projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAiB,UAAU,EAAE,MAAM,eAAe,CAAC;AAE/D,yCAAyC;AACzC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,6BAA6B;AAC7B,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAChD;AAED,yCAAyC;AACzC,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAChD;AAmBD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,UAAU,GAAG,YAAY,CAoBpE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function projectElement(element) {
|
|
2
|
+
return {
|
|
3
|
+
name: element.name,
|
|
4
|
+
verbs: element.verbs,
|
|
5
|
+
// keyTemplate is always the "template" form — parseElementBullet only
|
|
6
|
+
// ever assigns a UxKey here when it parsed as `{name}` (grammar.ts's K1
|
|
7
|
+
// clause), never a concrete key.
|
|
8
|
+
keyTemplate: element.keyTemplate?.kind === "template"
|
|
9
|
+
? element.keyTemplate.name
|
|
10
|
+
: null,
|
|
11
|
+
nav: element.navTarget ?? null,
|
|
12
|
+
states: [...element.states].sort(),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Project a {@linkcode UxRegistry} into a deterministic, JSON-serialisable
|
|
17
|
+
* manifest. Surfaces sorted by id; elements within a surface sorted by
|
|
18
|
+
* name; states sorted; verbs kept in declaration order (still
|
|
19
|
+
* deterministic — load-bearing for compound controls).
|
|
20
|
+
*/
|
|
21
|
+
export function projectUxRegistry(registry) {
|
|
22
|
+
const paths = [...registry.surfaces.keys()].sort();
|
|
23
|
+
const surfaces = paths.map((path) => {
|
|
24
|
+
const record = registry.surfaces.get(path)[0]; // first declaration wins
|
|
25
|
+
const dot = path.lastIndexOf(".");
|
|
26
|
+
const parentPath = dot < 0 ? undefined : path.slice(0, dot);
|
|
27
|
+
const parent = parentPath !== undefined && registry.surfaces.has(parentPath)
|
|
28
|
+
? parentPath
|
|
29
|
+
: null;
|
|
30
|
+
return {
|
|
31
|
+
id: path,
|
|
32
|
+
kind: record.kind,
|
|
33
|
+
states: [...record.states].sort(),
|
|
34
|
+
parent,
|
|
35
|
+
elements: [...record.elements]
|
|
36
|
+
.sort((a, b) => a.name.localeCompare(b.name))
|
|
37
|
+
.map(projectElement),
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
return { surfaces };
|
|
41
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module uxil/recognize
|
|
3
|
+
*
|
|
4
|
+
* Form-classification predicate — the DSL-specific routing S8's surface walk
|
|
5
|
+
* uses to send a code span to the right parser. Pure string inspection on the
|
|
6
|
+
* span-inner text (the caller strips backticks). A citation ref
|
|
7
|
+
* (`ux:surface/element…`) or non-uxil text returns `undefined`.
|
|
8
|
+
*/
|
|
9
|
+
export type UxilForm = "root" | "element" | "child";
|
|
10
|
+
/**
|
|
11
|
+
* Classify a uxil code span. `/`-led → element; `.`-led → child surface; a
|
|
12
|
+
* surface followed by a `:` kind *before* any `/` → root declaration.
|
|
13
|
+
* Everything else (a citation ref, plain prose) → `undefined`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function classifyUxilForm(spanText: string): UxilForm | undefined;
|
|
16
|
+
//# sourceMappingURL=recognize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recognize.d.ts","sourceRoot":"","sources":["../../src/uxil/recognize.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAWvE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module uxil/recognize
|
|
3
|
+
*
|
|
4
|
+
* Form-classification predicate — the DSL-specific routing S8's surface walk
|
|
5
|
+
* uses to send a code span to the right parser. Pure string inspection on the
|
|
6
|
+
* span-inner text (the caller strips backticks). A citation ref
|
|
7
|
+
* (`ux:surface/element…`) or non-uxil text returns `undefined`.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Classify a uxil code span. `/`-led → element; `.`-led → child surface; a
|
|
11
|
+
* surface followed by a `:` kind *before* any `/` → root declaration.
|
|
12
|
+
* Everything else (a citation ref, plain prose) → `undefined`.
|
|
13
|
+
*/
|
|
14
|
+
export function classifyUxilForm(spanText) {
|
|
15
|
+
const t = spanText.trim();
|
|
16
|
+
if (t.startsWith("/"))
|
|
17
|
+
return "element";
|
|
18
|
+
if (t.startsWith("."))
|
|
19
|
+
return "child";
|
|
20
|
+
const body = t.startsWith("ux:") ? t.slice(3) : t;
|
|
21
|
+
const slash = body.indexOf("/");
|
|
22
|
+
const colon = body.indexOf(":");
|
|
23
|
+
// A `:` before any `/` is the kind clause of a root declaration; a `:` after
|
|
24
|
+
// a `/` is a ref key (a citation), and no `:` at all is a bare citation.
|
|
25
|
+
if (colon >= 0 && (slash < 0 || colon < slash))
|
|
26
|
+
return "root";
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module uxil/registry
|
|
3
|
+
*
|
|
4
|
+
* Corpus-level index of every declared uxil surface across all entries.
|
|
5
|
+
* Built by {@linkcode buildUxRegistry}; consumed by validateUxil
|
|
6
|
+
* (declared-once / dangling-parent / navigate-resolution checks) and
|
|
7
|
+
* projectUxRegistry (machine projection). Mirrors typl/registry.ts,
|
|
8
|
+
* keyed by absolute surface path instead of `$Name`.
|
|
9
|
+
*/
|
|
10
|
+
import type { Entry, SourceLocation } from "../model/mod.js";
|
|
11
|
+
import { type UxElement } from "./assemble.js";
|
|
12
|
+
/** One surface declaration record, with backref to its host entry. */
|
|
13
|
+
export interface SurfaceRecord {
|
|
14
|
+
readonly path: string;
|
|
15
|
+
readonly kind: string;
|
|
16
|
+
readonly states: readonly string[];
|
|
17
|
+
readonly owningEntryDisplayId: string;
|
|
18
|
+
readonly owningEntryFile: string;
|
|
19
|
+
readonly elements: readonly UxElement[];
|
|
20
|
+
readonly location: SourceLocation;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Corpus-wide index. Each surface path maps to ALL declarations found —
|
|
24
|
+
* collisions are NOT collapsed; the validator surfaces duplicate
|
|
25
|
+
* declarations via UXIL-015 (mirrors typl's TYPL-009 treatment).
|
|
26
|
+
*/
|
|
27
|
+
export interface UxRegistry {
|
|
28
|
+
/** Keyed by absolute surface path (no `ux:` scheme). */
|
|
29
|
+
readonly surfaces: ReadonlyMap<string, readonly SurfaceRecord[]>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Build the corpus uxil registry from the entries. Entries whose assembly
|
|
33
|
+
* yields no surfaces are skipped. Source order is preserved within each
|
|
34
|
+
* path's list (first declaration first).
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildUxRegistry(entries: readonly Entry[]): UxRegistry;
|
|
37
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/uxil/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAElE,sEAAsE;AACtE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,wDAAwD;IACxD,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC,CAAC;CAClE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,GAAG,UAAU,CAsBrE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { assembleUxSurface } from "./assemble.js";
|
|
2
|
+
/**
|
|
3
|
+
* Build the corpus uxil registry from the entries. Entries whose assembly
|
|
4
|
+
* yields no surfaces are skipped. Source order is preserved within each
|
|
5
|
+
* path's list (first declaration first).
|
|
6
|
+
*/
|
|
7
|
+
export function buildUxRegistry(entries) {
|
|
8
|
+
const surfaces = new Map();
|
|
9
|
+
for (const entry of entries) {
|
|
10
|
+
const tree = assembleUxSurface(entry);
|
|
11
|
+
for (const surface of tree.surfaces) {
|
|
12
|
+
const record = {
|
|
13
|
+
path: surface.path,
|
|
14
|
+
kind: surface.kind,
|
|
15
|
+
states: surface.states,
|
|
16
|
+
owningEntryDisplayId: entry.displayId,
|
|
17
|
+
owningEntryFile: entry.location.file,
|
|
18
|
+
elements: surface.elements,
|
|
19
|
+
location: surface.location,
|
|
20
|
+
};
|
|
21
|
+
const list = surfaces.get(surface.path);
|
|
22
|
+
if (list)
|
|
23
|
+
list.push(record);
|
|
24
|
+
else
|
|
25
|
+
surfaces.set(surface.path, [record]);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return { surfaces };
|
|
29
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module uxil/surfaces
|
|
3
|
+
*
|
|
4
|
+
* Thin uxil adapters over the shared declaration-surface machinery
|
|
5
|
+
* (core/decl). Each supplies a `classifyUxilForm`-based recognizer and
|
|
6
|
+
* re-uses the DSL-agnostic walkers — mirrors typl/bullet.ts + the inline
|
|
7
|
+
* half of typl/citations.ts.
|
|
8
|
+
*
|
|
9
|
+
* Bullet paragraphs keep their literal backtick delimiters and any
|
|
10
|
+
* trailing prose in one string (e.g. `` `/play : activate` — starts
|
|
11
|
+
* playback. ``) — {@linkcode extractNestedBulletDeclarations} hands the
|
|
12
|
+
* whole paragraph to the recognizer, unlike the inline surface (whose
|
|
13
|
+
* tokens are span-only, already backtick-stripped by
|
|
14
|
+
* {@linkcode extractInlineDeclarations}). Classification therefore needs
|
|
15
|
+
* the *leading span* extracted first; {@linkcode stripUxilLeadingSpan}
|
|
16
|
+
* does that (mirroring grammar.ts's private `splitLeadingCodeSpan`,
|
|
17
|
+
* span-only). The declaration's `source` field stays the raw paragraph —
|
|
18
|
+
* `parseElementBullet` wants exactly that (it splits the span itself);
|
|
19
|
+
* assembly strips the span again for `parseChildSurfaceDecl`, which
|
|
20
|
+
* expects bare span text.
|
|
21
|
+
*/
|
|
22
|
+
import type { BodyBlock } from "../ast/nodes.js";
|
|
23
|
+
import type { BodyToken } from "../model/mod.js";
|
|
24
|
+
import { type InlineDeclaration, type NestedBlockDeclaration } from "../decl/mod.js";
|
|
25
|
+
/**
|
|
26
|
+
* Extract the leading inline-code span's inner text from a bullet
|
|
27
|
+
* paragraph, backticks stripped, ignoring any trailing prose. Returns
|
|
28
|
+
* `undefined` when the paragraph does not begin with a (closed) code
|
|
29
|
+
* span. Handles both single- and double-backtick delimiters.
|
|
30
|
+
*/
|
|
31
|
+
export declare function stripUxilLeadingSpan(text: string): string | undefined;
|
|
32
|
+
/** Inline code spans whose text is a uxil root declaration. */
|
|
33
|
+
export declare function extractUxRootSpans(bodyTokens: readonly BodyToken[]): readonly InlineDeclaration[];
|
|
34
|
+
/** Bullet declarations (element or child surface), with parent links. */
|
|
35
|
+
export declare function extractUxBullets(blocks: readonly BodyBlock[]): readonly NestedBlockDeclaration[];
|
|
36
|
+
//# sourceMappingURL=surfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../../src/uxil/surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC5B,MAAM,gBAAgB,CAAC;AAGxB;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAWrE;AAED,+DAA+D;AAC/D,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,SAAS,iBAAiB,EAAE,CAK9B;AAED,yEAAyE;AACzE,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,SAAS,EAAE,GAC3B,SAAS,sBAAsB,EAAE,CAOnC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { extractInlineDeclarations, extractNestedBulletDeclarations, } from "../decl/mod.js";
|
|
2
|
+
import { classifyUxilForm } from "./recognize.js";
|
|
3
|
+
/**
|
|
4
|
+
* Extract the leading inline-code span's inner text from a bullet
|
|
5
|
+
* paragraph, backticks stripped, ignoring any trailing prose. Returns
|
|
6
|
+
* `undefined` when the paragraph does not begin with a (closed) code
|
|
7
|
+
* span. Handles both single- and double-backtick delimiters.
|
|
8
|
+
*/
|
|
9
|
+
export function stripUxilLeadingSpan(text) {
|
|
10
|
+
const t = text.replace(/^\s+/, "");
|
|
11
|
+
if (t.startsWith("``")) {
|
|
12
|
+
const end = t.indexOf("``", 2);
|
|
13
|
+
return end < 0 ? undefined : t.slice(2, end);
|
|
14
|
+
}
|
|
15
|
+
if (t.startsWith("`")) {
|
|
16
|
+
const end = t.indexOf("`", 1);
|
|
17
|
+
return end < 0 ? undefined : t.slice(1, end);
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
/** Inline code spans whose text is a uxil root declaration. */
|
|
22
|
+
export function extractUxRootSpans(bodyTokens) {
|
|
23
|
+
return extractInlineDeclarations(bodyTokens, (text) => classifyUxilForm(text) === "root");
|
|
24
|
+
}
|
|
25
|
+
/** Bullet declarations (element or child surface), with parent links. */
|
|
26
|
+
export function extractUxBullets(blocks) {
|
|
27
|
+
return extractNestedBulletDeclarations(blocks, (text) => {
|
|
28
|
+
const span = stripUxilLeadingSpan(text);
|
|
29
|
+
if (span === undefined)
|
|
30
|
+
return false;
|
|
31
|
+
const form = classifyUxilForm(span);
|
|
32
|
+
return form === "element" || form === "child";
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module uxil/validator
|
|
3
|
+
*
|
|
4
|
+
* Enforced uxil semantics (S8 #726): closed-vocabulary checks, corpus
|
|
5
|
+
* structural rules (declared-once, dangling namespace parent, navigate
|
|
6
|
+
* resolution), and citation resolution (Pass 3, added alongside Task 9).
|
|
7
|
+
* Mirrors typl/validator.ts's shape. Diagnostics are file-anchored as of
|
|
8
|
+
* S9 (#727).
|
|
9
|
+
*/
|
|
10
|
+
import type { Diagnostic, Entry } from "../model/mod.js";
|
|
11
|
+
import { type UxRegistry } from "./registry.js";
|
|
12
|
+
/** Result of {@linkcode validateUxil}: the corpus registry plus diagnostics. */
|
|
13
|
+
export interface UxilValidation {
|
|
14
|
+
readonly registry: UxRegistry;
|
|
15
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
16
|
+
}
|
|
17
|
+
/** Options for {@linkcode validateUxil}. */
|
|
18
|
+
export interface UxilValidateOptions {
|
|
19
|
+
/**
|
|
20
|
+
* Entries whose `ux:` citations resolve against the registry (Pass 3).
|
|
21
|
+
* Defaults to `entries`. The family orchestrator (S9 #727) passes every
|
|
22
|
+
* non-upstream project entry here while `entries` carries only the
|
|
23
|
+
* declaring-type entries — citations are legal from any entry type;
|
|
24
|
+
* declarations are not.
|
|
25
|
+
*/
|
|
26
|
+
readonly citationEntries?: readonly Entry[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Validate the uxil declarations across all entries: per-entry structural
|
|
30
|
+
* and vocabulary checks (Pass 1), corpus structural checks over the
|
|
31
|
+
* registry (Pass 2), and citation resolution (Pass 3). Returns the built
|
|
32
|
+
* registry even when diagnostics are present, so callers can still use it
|
|
33
|
+
* for navigation/projection.
|
|
34
|
+
*/
|
|
35
|
+
export declare function validateUxil(entries: readonly Entry[], opts?: UxilValidateOptions): UxilValidation;
|
|
36
|
+
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/uxil/validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAKzD,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAGjE,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,IAAI,GAAE,mBAAwB,GAC7B,cAAc,CA6MhB"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { assembleUxSurface } from "./assemble.js";
|
|
2
|
+
import { extractUxCitations } from "./citations.js";
|
|
3
|
+
import { findDuplicateDeclarations } from "../decl/mod.js";
|
|
4
|
+
import { uxilDiagnosticAt } from "./diagnostics.js";
|
|
5
|
+
import { buildUxRegistry } from "./registry.js";
|
|
6
|
+
import { isKnownKind, isKnownVerb, UX_KINDS } from "./vocab.js";
|
|
7
|
+
/**
|
|
8
|
+
* Validate the uxil declarations across all entries: per-entry structural
|
|
9
|
+
* and vocabulary checks (Pass 1), corpus structural checks over the
|
|
10
|
+
* registry (Pass 2), and citation resolution (Pass 3). Returns the built
|
|
11
|
+
* registry even when diagnostics are present, so callers can still use it
|
|
12
|
+
* for navigation/projection.
|
|
13
|
+
*/
|
|
14
|
+
export function validateUxil(entries, opts = {}) {
|
|
15
|
+
const diagnostics = [];
|
|
16
|
+
// ── Pass 1: per-entry structural + vocabulary ────────────────────────────
|
|
17
|
+
for (const entry of entries) {
|
|
18
|
+
const tree = assembleUxSurface(entry);
|
|
19
|
+
diagnostics.push(...tree.diagnostics);
|
|
20
|
+
for (const surface of tree.surfaces) {
|
|
21
|
+
const kindInfo = isKnownKind(surface.kind)
|
|
22
|
+
? UX_KINDS.get(surface.kind)
|
|
23
|
+
: undefined;
|
|
24
|
+
if (kindInfo === undefined) {
|
|
25
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-009", { kind: surface.kind }, surface.location));
|
|
26
|
+
}
|
|
27
|
+
else if (!kindInfo.stateful && surface.states.length > 0) {
|
|
28
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-013", { kind: surface.kind }, surface.location));
|
|
29
|
+
}
|
|
30
|
+
for (const element of surface.elements) {
|
|
31
|
+
for (const verb of element.verbs) {
|
|
32
|
+
if (!isKnownVerb(verb)) {
|
|
33
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-010", { verb }, element.location));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (element.verbs.includes("observe") && element.verbs.length > 1) {
|
|
37
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-014", { element: element.name }, element.location));
|
|
38
|
+
}
|
|
39
|
+
// UXIL-025 (#727): 'observe' anchors a visibility assertion — the
|
|
40
|
+
// issue's "visibility of a non-screen". Only when the kind is known
|
|
41
|
+
// (an unknown kind is already UXIL-009; don't cascade).
|
|
42
|
+
if (kindInfo !== undefined && !kindInfo.visual &&
|
|
43
|
+
element.verbs.includes("observe")) {
|
|
44
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-025", {
|
|
45
|
+
element: element.name,
|
|
46
|
+
surface: surface.path,
|
|
47
|
+
kind: surface.kind,
|
|
48
|
+
}, element.location));
|
|
49
|
+
}
|
|
50
|
+
// UXIL-026 (#727): vocab's requiresNavTarget, previously unenforced.
|
|
51
|
+
if (element.verbs.includes("navigate") && element.navTarget === undefined) {
|
|
52
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-026", { element: element.name }, element.location));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// ── Pass 2: corpus structural, over the registry ─────────────────────────
|
|
58
|
+
const registry = buildUxRegistry(entries);
|
|
59
|
+
for (const { first, duplicates } of findDuplicateDeclarations(registry.surfaces)) {
|
|
60
|
+
for (const dup of duplicates) {
|
|
61
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-015", {
|
|
62
|
+
surface: dup.path,
|
|
63
|
+
otherFile: first.owningEntryFile,
|
|
64
|
+
otherLine: first.location.line,
|
|
65
|
+
}, dup.location));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
for (const [path, records] of registry.surfaces) {
|
|
69
|
+
const dot = path.lastIndexOf(".");
|
|
70
|
+
if (dot < 0)
|
|
71
|
+
continue;
|
|
72
|
+
const parent = path.slice(0, dot);
|
|
73
|
+
// A single-segment parent (e.g. "media" in "media.home") is an
|
|
74
|
+
// ordinary namespace prefix a root can use freely — it is never
|
|
75
|
+
// itself required to be a separately declared surface (the design's
|
|
76
|
+
// own worked examples name roots this way: "media.home",
|
|
77
|
+
// "controls.hvac"). Only a surface nested 2+ levels deep, whose
|
|
78
|
+
// parent is itself dotted, plausibly represents a promoted child
|
|
79
|
+
// surface (design §6) whose intermediate ancestor is expected to
|
|
80
|
+
// exist somewhere in the corpus. A genuinely-nested same-entry child
|
|
81
|
+
// never reaches this branch — assembleUxSurface always registers its
|
|
82
|
+
// resolved ancestor alongside it — so this only ever fires across
|
|
83
|
+
// entries, exactly the promoted-surface scenario it targets.
|
|
84
|
+
if (!parent.includes("."))
|
|
85
|
+
continue;
|
|
86
|
+
if (registry.surfaces.has(parent))
|
|
87
|
+
continue;
|
|
88
|
+
for (const record of records) {
|
|
89
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-016", { surface: path, parent }, record.location));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
for (const records of registry.surfaces.values()) {
|
|
93
|
+
for (const record of records) {
|
|
94
|
+
for (const element of record.elements) {
|
|
95
|
+
if (element.navTarget === undefined)
|
|
96
|
+
continue;
|
|
97
|
+
const targets = registry.surfaces.get(element.navTarget);
|
|
98
|
+
const targetKind = targets?.[0]?.kind;
|
|
99
|
+
const navigable = targetKind !== undefined &&
|
|
100
|
+
UX_KINDS.get(targetKind)?.navigable === true;
|
|
101
|
+
if (!navigable) {
|
|
102
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-017", { target: element.navTarget }, element.location));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// ── Pass 3: citation resolution ──────────────────────────────────────────
|
|
108
|
+
for (const entry of opts.citationEntries ?? entries) {
|
|
109
|
+
for (const citation of extractUxCitations(entry.bodyTokens)) {
|
|
110
|
+
const { ref, location } = citation;
|
|
111
|
+
const surfacePath = ref.surface.join(".");
|
|
112
|
+
const records = registry.surfaces.get(surfacePath);
|
|
113
|
+
if (!records || records.length === 0) {
|
|
114
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-018", { surface: surfacePath }, location));
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
// First-declaration-wins, matching the navigate-resolution check above.
|
|
118
|
+
const surface = records[0];
|
|
119
|
+
if (ref.state !== undefined && !surface.states.includes(ref.state)) {
|
|
120
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-021", { state: ref.state, surface: surfacePath }, location));
|
|
121
|
+
}
|
|
122
|
+
if (ref.element !== undefined) {
|
|
123
|
+
const element = surface.elements.find((e) => e.name === ref.element);
|
|
124
|
+
if (!element) {
|
|
125
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-019", { element: ref.element, surface: surfacePath }, location));
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
if (ref.verb !== undefined && !element.verbs.includes(ref.verb)) {
|
|
129
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-020", { verb: ref.verb, element: element.name }, location));
|
|
130
|
+
}
|
|
131
|
+
if (ref.key?.kind === "concrete" && element.keyTemplate !== undefined) {
|
|
132
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-022", { element: element.name }, location));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return { registry, diagnostics };
|
|
139
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module uxil/vocab
|
|
3
|
+
*
|
|
4
|
+
* The two closed, core-owned uxil vocabularies (design §2/§3): three surface
|
|
5
|
+
* kinds and eleven interaction verbs, each with the semantics diagnostics and
|
|
6
|
+
* codegen rely on. Extension is a markspec release decision — not a profile
|
|
7
|
+
* concern (ADR-009).
|
|
8
|
+
*/
|
|
9
|
+
/** Semantics carried by a surface kind. */
|
|
10
|
+
export interface KindInfo {
|
|
11
|
+
/** A valid `navigate ->` target (only `screen`). */
|
|
12
|
+
readonly navigable: boolean;
|
|
13
|
+
/** May declare `@` states. */
|
|
14
|
+
readonly stateful: boolean;
|
|
15
|
+
/** Subject of visibility assertions / `observe` anchors. */
|
|
16
|
+
readonly visual: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Semantics carried by an interaction verb. */
|
|
19
|
+
export interface VerbInfo {
|
|
20
|
+
/** Requires a declared `-> target` (only `navigate`). */
|
|
21
|
+
readonly requiresNavTarget: boolean;
|
|
22
|
+
/** Exclusive on an element — interactive or anchor, never both (only `observe`). */
|
|
23
|
+
readonly exclusive: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** The three closed, core-owned surface kinds. */
|
|
26
|
+
export declare const UX_KINDS: ReadonlyMap<string, KindInfo>;
|
|
27
|
+
/** The eleven closed, core-owned interaction verbs. */
|
|
28
|
+
export declare const UX_VERBS: ReadonlyMap<string, VerbInfo>;
|
|
29
|
+
/** True when `kind` is one of the three closed surface kinds. */
|
|
30
|
+
export declare function isKnownKind(kind: string): boolean;
|
|
31
|
+
/** True when `verb` is one of the eleven closed interaction verbs. */
|
|
32
|
+
export declare function isKnownVerb(verb: string): boolean;
|
|
33
|
+
//# sourceMappingURL=vocab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocab.d.ts","sourceRoot":"","sources":["../../src/uxil/vocab.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,2CAA2C;AAC3C,MAAM,WAAW,QAAQ;IACvB,oDAAoD;IACpD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,8BAA8B;IAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,gDAAgD;AAChD,MAAM,WAAW,QAAQ;IACvB,yDAAyD;IACzD,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,oFAAoF;IACpF,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED,kDAAkD;AAClD,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAIjD,CAAC;AAEH,uDAAuD;AACvD,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAYjD,CAAC;AAEH,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module uxil/vocab
|
|
3
|
+
*
|
|
4
|
+
* The two closed, core-owned uxil vocabularies (design §2/§3): three surface
|
|
5
|
+
* kinds and eleven interaction verbs, each with the semantics diagnostics and
|
|
6
|
+
* codegen rely on. Extension is a markspec release decision — not a profile
|
|
7
|
+
* concern (ADR-009).
|
|
8
|
+
*/
|
|
9
|
+
/** The three closed, core-owned surface kinds. */
|
|
10
|
+
export const UX_KINDS = new Map([
|
|
11
|
+
["screen", { navigable: true, stateful: true, visual: true }],
|
|
12
|
+
["panel", { navigable: false, stateful: false, visual: true }],
|
|
13
|
+
["agent", { navigable: false, stateful: true, visual: false }],
|
|
14
|
+
]);
|
|
15
|
+
/** The eleven closed, core-owned interaction verbs. */
|
|
16
|
+
export const UX_VERBS = new Map([
|
|
17
|
+
["activate", { requiresNavTarget: false, exclusive: false }],
|
|
18
|
+
["toggle", { requiresNavTarget: false, exclusive: false }],
|
|
19
|
+
["select", { requiresNavTarget: false, exclusive: false }],
|
|
20
|
+
["adjust", { requiresNavTarget: false, exclusive: false }],
|
|
21
|
+
["input", { requiresNavTarget: false, exclusive: false }],
|
|
22
|
+
["scroll", { requiresNavTarget: false, exclusive: false }],
|
|
23
|
+
["drag", { requiresNavTarget: false, exclusive: false }],
|
|
24
|
+
["navigate", { requiresNavTarget: true, exclusive: false }],
|
|
25
|
+
["dismiss", { requiresNavTarget: false, exclusive: false }],
|
|
26
|
+
["ask", { requiresNavTarget: false, exclusive: false }],
|
|
27
|
+
["observe", { requiresNavTarget: false, exclusive: true }],
|
|
28
|
+
]);
|
|
29
|
+
/** True when `kind` is one of the three closed surface kinds. */
|
|
30
|
+
export function isKnownKind(kind) {
|
|
31
|
+
return UX_KINDS.has(kind);
|
|
32
|
+
}
|
|
33
|
+
/** True when `verb` is one of the eleven closed interaction verbs. */
|
|
34
|
+
export function isKnownVerb(verb) {
|
|
35
|
+
return UX_VERBS.has(verb);
|
|
36
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body_blocks.d.ts","sourceRoot":"","sources":["../../src/validator/body_blocks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"body_blocks.d.ts","sourceRoot":"","sources":["../../src/validator/body_blocks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AA2LzD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,UAAU,EAAE,CAsBtE"}
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
* Code, Feature, and Math blocks are automatically excluded because the
|
|
28
28
|
* builder emits opaque nodes for verbatim content — no prose text to scan.
|
|
29
29
|
*/
|
|
30
|
+
import { isMarkspecDirectiveComment } from "../parser/directives.js";
|
|
30
31
|
/**
|
|
31
32
|
* HTML tag detection. Matches an opening, closing, or self-closing tag
|
|
32
33
|
* (`<tag>`, `</tag>`, `<tag/>`). Doesn't match HTML comments — those
|
|
@@ -37,13 +38,6 @@
|
|
|
37
38
|
const HTML_TAG_RE = /<\/?[A-Za-z][A-Za-z0-9]*(\s[^>]*)?\/?>/;
|
|
38
39
|
/** Any HTML comment, `<!--…-->`. */
|
|
39
40
|
const HTML_COMMENT_RE = /<!--[\s\S]*?-->/;
|
|
40
|
-
/**
|
|
41
|
-
* A whole-line markspec directive comment: `<!-- markspec:<rest> -->`
|
|
42
|
-
* occupying the line on its own (optional leading/trailing
|
|
43
|
-
* whitespace). The directive form is the one exception spec §2.4.1
|
|
44
|
-
* carves out from the "no raw HTML" rule.
|
|
45
|
-
*/
|
|
46
|
-
const MARKSPEC_DIRECTIVE_LINE_RE = /^\s*<!--\s*markspec:[\s\S]*?-->\s*$/;
|
|
47
41
|
/**
|
|
48
42
|
* Return `true` when `line` contains raw HTML the body model forbids:
|
|
49
43
|
* any tag, or any comment that isn't a standalone markspec directive.
|
|
@@ -51,7 +45,7 @@ const MARKSPEC_DIRECTIVE_LINE_RE = /^\s*<!--\s*markspec:[\s\S]*?-->\s*$/;
|
|
|
51
45
|
function hasForbiddenHtml(line) {
|
|
52
46
|
if (HTML_TAG_RE.test(line))
|
|
53
47
|
return true;
|
|
54
|
-
if (HTML_COMMENT_RE.test(line) && !
|
|
48
|
+
if (HTML_COMMENT_RE.test(line) && !isMarkspecDirectiveComment(line)) {
|
|
55
49
|
return true;
|
|
56
50
|
}
|
|
57
51
|
return false;
|
|
@@ -123,7 +117,7 @@ function violationsFromBlock(block) {
|
|
|
123
117
|
else if (block.subkind === "html") {
|
|
124
118
|
// Block-level HTML: check if it is a markspec directive (exempt)
|
|
125
119
|
// or forbidden HTML. The `raw` field carries the verbatim source.
|
|
126
|
-
if (!
|
|
120
|
+
if (!isMarkspecDirectiveComment(block.raw)) {
|
|
127
121
|
out.push({ diag: RAW_HTML_DIAG, bodyLine });
|
|
128
122
|
}
|
|
129
123
|
}
|
|
@@ -22,7 +22,8 @@ import type { CaptionConventions, Diagnostic, Entry } from "../model/mod.js";
|
|
|
22
22
|
*
|
|
23
23
|
* @param entry - The entry whose body AST is scanned for captions.
|
|
24
24
|
* @param conventions - The configured position conventions from
|
|
25
|
-
* `
|
|
25
|
+
* `.markspec.yaml` `caption-conventions:` (`ToolConfig.captionConventions`).
|
|
26
|
+
* An empty record means no
|
|
26
27
|
* conventions are set and the function returns immediately.
|
|
27
28
|
*/
|
|
28
29
|
export declare function validateCaptionConvention(entry: Entry, conventions: CaptionConventions): readonly Diagnostic[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caption_convention.d.ts","sourceRoot":"","sources":["../../src/validator/caption_convention.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7E
|
|
1
|
+
{"version":3,"file":"caption_convention.d.ts","sourceRoot":"","sources":["../../src/validator/caption_convention.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7E;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,kBAAkB,GAC9B,SAAS,UAAU,EAAE,CAmCvB"}
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
*
|
|
22
22
|
* @param entry - The entry whose body AST is scanned for captions.
|
|
23
23
|
* @param conventions - The configured position conventions from
|
|
24
|
-
* `
|
|
24
|
+
* `.markspec.yaml` `caption-conventions:` (`ToolConfig.captionConventions`).
|
|
25
|
+
* An empty record means no
|
|
25
26
|
* conventions are set and the function returns immediately.
|
|
26
27
|
*/
|
|
27
28
|
export function validateCaptionConvention(entry, conventions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corpus.d.ts","sourceRoot":"","sources":["../../src/validator/corpus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"corpus.d.ts","sourceRoot":"","sources":["../../src/validator/corpus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAe,MAAM,iBAAiB,CAAC;AA4BtE,oDAAoD;AACpD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,qEAAqE;IACrE,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC9C;AAED,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,SAAS,KAAK,EAAE,GAC3B,qBAAqB,CAsFvB;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,SAAS,UAAU,EAAE,EAClC,UAAU,EAAE,SAAS,KAAK,EAAE,EAC5B,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,GAClC,UAAU,EAAE,CAyCd"}
|