@gmb/bitmark-parser-generator 1.35.0 → 2.0.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/dist/browser/bitmark-parser-generator.min.js +1 -1
- package/dist/browser/bundle-report.html +2 -2
- package/dist/cjs/BitmarkParserGenerator.js +8 -3
- package/dist/cjs/BitmarkParserGenerator.js.map +1 -1
- package/dist/cjs/ast/Ast.js +1 -0
- package/dist/cjs/ast/Ast.js.map +1 -1
- package/dist/cjs/ast/BaseBuilder.js +91 -54
- package/dist/cjs/ast/BaseBuilder.js.map +1 -1
- package/dist/cjs/ast/Builder.js +776 -389
- package/dist/cjs/ast/Builder.js.map +1 -1
- package/dist/cjs/ast/ResourceBuilder.js +516 -252
- package/dist/cjs/ast/ResourceBuilder.js.map +1 -1
- package/dist/cjs/ast/rules/NodeValidator.js +61 -22
- package/dist/cjs/ast/rules/NodeValidator.js.map +1 -1
- package/dist/cjs/breakscaping/Breakscape.js +96 -71
- package/dist/cjs/breakscaping/Breakscape.js.map +1 -1
- package/dist/cjs/config/raw/bits.js +14 -5
- package/dist/cjs/config/raw/bits.js.map +1 -1
- package/dist/cjs/config/raw/properties.js +7 -2
- package/dist/cjs/config/raw/properties.js.map +1 -1
- package/dist/cjs/generated/build-info.js +1 -1
- package/dist/cjs/generated/build-info.js.map +1 -1
- package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js +1 -0
- package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js.map +1 -1
- package/dist/cjs/generator/AstWalkerGenerator.js +4 -1
- package/dist/cjs/generator/AstWalkerGenerator.js.map +1 -1
- package/dist/cjs/generator/bitmark/BitmarkGenerator.js +959 -338
- package/dist/cjs/generator/bitmark/BitmarkGenerator.js.map +1 -1
- package/dist/cjs/generator/json/JsonGenerator.js +308 -1982
- package/dist/cjs/generator/json/JsonGenerator.js.map +1 -1
- package/dist/cjs/generator/text/TextGenerator.js +26 -8
- package/dist/cjs/generator/text/TextGenerator.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/model/ast/NodeType.js +27 -8
- package/dist/cjs/model/ast/NodeType.js.map +1 -1
- package/dist/cjs/model/config/enum/PropertyConfigKey.js +1 -0
- package/dist/cjs/model/config/enum/PropertyConfigKey.js.map +1 -1
- package/dist/cjs/model/enum/BitType.js +1 -2
- package/dist/cjs/model/enum/BitType.js.map +1 -1
- package/dist/cjs/model/enum/PropertyFormat.js +3 -1
- package/dist/cjs/model/enum/PropertyFormat.js.map +1 -1
- package/dist/cjs/model/enum/TextFormat.js +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js +9 -3
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js +49 -131
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserTypes.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js +7 -31
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +255 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +1 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +2 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +175 -129
- package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +8 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js +61 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js.map +1 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +11 -5
- package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +21 -17
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +50 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +1 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js +2 -15
- package/dist/cjs/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +2 -4
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +4 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js +2 -4
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +5 -5
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +5 -6
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +23 -7
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +5 -5
- package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +3 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +19 -8
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js +4 -6
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +4 -5
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +14 -5
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +37 -21
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +3 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/json/JsonParser.js +73 -765
- package/dist/cjs/parser/json/JsonParser.js.map +1 -1
- package/dist/cjs/parser/text/TextParser.js +61 -2
- package/dist/cjs/parser/text/TextParser.js.map +1 -1
- package/dist/cjs/utils/BitUtils.js +15 -13
- package/dist/cjs/utils/BitUtils.js.map +1 -1
- package/dist/esm/BitmarkParserGenerator.js +8 -3
- package/dist/esm/BitmarkParserGenerator.js.map +1 -1
- package/dist/esm/ast/Ast.js +1 -0
- package/dist/esm/ast/Ast.js.map +1 -1
- package/dist/esm/ast/BaseBuilder.js +91 -54
- package/dist/esm/ast/BaseBuilder.js.map +1 -1
- package/dist/esm/ast/Builder.js +776 -389
- package/dist/esm/ast/Builder.js.map +1 -1
- package/dist/esm/ast/ResourceBuilder.js +516 -252
- package/dist/esm/ast/ResourceBuilder.js.map +1 -1
- package/dist/esm/ast/rules/NodeValidator.js +61 -22
- package/dist/esm/ast/rules/NodeValidator.js.map +1 -1
- package/dist/esm/breakscaping/Breakscape.js +96 -71
- package/dist/esm/breakscaping/Breakscape.js.map +1 -1
- package/dist/esm/config/raw/bits.js +14 -5
- package/dist/esm/config/raw/bits.js.map +1 -1
- package/dist/esm/config/raw/properties.js +7 -2
- package/dist/esm/config/raw/properties.js.map +1 -1
- package/dist/esm/generated/build-info.js +1 -1
- package/dist/esm/generated/build-info.js.map +1 -1
- package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js +1 -0
- package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js.map +1 -1
- package/dist/esm/generator/AstWalkerGenerator.js +4 -1
- package/dist/esm/generator/AstWalkerGenerator.js.map +1 -1
- package/dist/esm/generator/bitmark/BitmarkGenerator.js +959 -338
- package/dist/esm/generator/bitmark/BitmarkGenerator.js.map +1 -1
- package/dist/esm/generator/json/JsonGenerator.js +308 -1982
- package/dist/esm/generator/json/JsonGenerator.js.map +1 -1
- package/dist/esm/generator/text/TextGenerator.js +26 -8
- package/dist/esm/generator/text/TextGenerator.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/model/ast/NodeType.js +27 -8
- package/dist/esm/model/ast/NodeType.js.map +1 -1
- package/dist/esm/model/config/enum/PropertyConfigKey.js +1 -0
- package/dist/esm/model/config/enum/PropertyConfigKey.js.map +1 -1
- package/dist/esm/model/enum/BitType.js +1 -2
- package/dist/esm/model/enum/BitType.js.map +1 -1
- package/dist/esm/model/enum/PropertyFormat.js +3 -1
- package/dist/esm/model/enum/PropertyFormat.js.map +1 -1
- package/dist/esm/model/enum/TextFormat.js +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js +9 -3
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js +49 -131
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserTypes.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js +7 -31
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +252 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +1 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +2 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +175 -129
- package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +8 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js +58 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js.map +1 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +11 -5
- package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +21 -17
- package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +47 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +1 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js +2 -15
- package/dist/esm/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +2 -4
- package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +4 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js +2 -4
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +5 -5
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +5 -6
- package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +23 -7
- package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +5 -5
- package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +3 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +19 -8
- package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js +4 -6
- package/dist/esm/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +4 -5
- package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +14 -5
- package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +37 -21
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +3 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/json/JsonParser.js +73 -765
- package/dist/esm/parser/json/JsonParser.js.map +1 -1
- package/dist/esm/parser/text/TextParser.js +61 -2
- package/dist/esm/parser/text/TextParser.js.map +1 -1
- package/dist/esm/utils/BitUtils.js +15 -13
- package/dist/esm/utils/BitUtils.js.map +1 -1
- package/dist/types/BitmarkParserGenerator.d.ts +8 -0
- package/dist/types/BitmarkParserGenerator.d.ts.map +1 -1
- package/dist/types/ast/Ast.d.ts.map +1 -1
- package/dist/types/ast/BaseBuilder.d.ts +31 -21
- package/dist/types/ast/BaseBuilder.d.ts.map +1 -1
- package/dist/types/ast/Builder.d.ts +279 -441
- package/dist/types/ast/Builder.d.ts.map +1 -1
- package/dist/types/ast/ResourceBuilder.d.ts +177 -164
- package/dist/types/ast/ResourceBuilder.d.ts.map +1 -1
- package/dist/types/ast/rules/NodeValidator.d.ts +3 -2
- package/dist/types/ast/rules/NodeValidator.d.ts.map +1 -1
- package/dist/types/breakscaping/Breakscape.d.ts +6 -5
- package/dist/types/breakscaping/Breakscape.d.ts.map +1 -1
- package/dist/types/config/raw/bits.d.ts.map +1 -1
- package/dist/types/config/raw/properties.d.ts.map +1 -1
- package/dist/types/generated/parser/bitmark/bitmark-peggy-parser.d.ts.map +1 -1
- package/dist/types/generator/AstWalkerGenerator.d.ts.map +1 -1
- package/dist/types/generator/bitmark/BitmarkGenerator.d.ts +89 -55
- package/dist/types/generator/bitmark/BitmarkGenerator.d.ts.map +1 -1
- package/dist/types/generator/json/JsonGenerator.d.ts +88 -108
- package/dist/types/generator/json/JsonGenerator.d.ts.map +1 -1
- package/dist/types/generator/text/TextGenerator.d.ts +14 -2
- package/dist/types/generator/text/TextGenerator.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/model/ast/NodeType.d.ts +48 -16
- package/dist/types/model/ast/NodeType.d.ts.map +1 -1
- package/dist/types/model/ast/Nodes.d.ts +64 -440
- package/dist/types/model/ast/Nodes.d.ts.map +1 -1
- package/dist/types/model/config/enum/ConfigKey.d.ts +2 -0
- package/dist/types/model/config/enum/ConfigKey.d.ts.map +1 -1
- package/dist/types/model/config/enum/PropertyConfigKey.d.ts +3 -0
- package/dist/types/model/config/enum/PropertyConfigKey.d.ts.map +1 -1
- package/dist/types/model/enum/BitType.d.ts +2 -4
- package/dist/types/model/enum/BitType.d.ts.map +1 -1
- package/dist/types/model/enum/PropertyFormat.d.ts +4 -2
- package/dist/types/model/enum/PropertyFormat.d.ts.map +1 -1
- package/dist/types/model/enum/PropertyTag.d.ts +2 -0
- package/dist/types/model/enum/PropertyTag.d.ts.map +1 -1
- package/dist/types/model/json/BitJson.d.ts +32 -20
- package/dist/types/model/json/BitJson.d.ts.map +1 -1
- package/dist/types/model/json/BodyBitJson.d.ts +16 -12
- package/dist/types/model/json/BodyBitJson.d.ts.map +1 -1
- package/dist/types/model/json/ResourceJson.d.ts +2 -22
- package/dist/types/model/json/ResourceJson.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts +3 -2
- package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts +2 -15
- package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts +83 -71
- package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/BodyContentProcessor.d.ts +37 -0
- package/dist/types/parser/bitmark/peg/contentProcessors/BodyContentProcessor.d.ts.map +1 -0
- package/dist/types/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.d.ts +15 -0
- package/dist/types/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.d.ts.map +1 -0
- package/dist/types/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/FooterContentProcessor.d.ts +16 -0
- package/dist/types/parser/bitmark/peg/contentProcessors/FooterContentProcessor.d.ts.map +1 -0
- package/dist/types/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.d.ts +5 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/json/JsonParser.d.ts +9 -72
- package/dist/types/parser/json/JsonParser.d.ts.map +1 -1
- package/dist/types/parser/text/TextParser.d.ts +16 -1
- package/dist/types/parser/text/TextParser.d.ts.map +1 -1
- package/dist/types/utils/BitUtils.d.ts +8 -8
- package/dist/types/utils/BitUtils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"MarkChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAiFS,8DAAyB;AAjFlC,sDAAmD;AAInD,oEAAiE;AACjE,oDAAiD;AAGjD,6DAA0D;AAE1D,uEAAoE;AAEpE,oEAMkC;AAElC,SAAS,yBAAyB,CAChC,OAAgC,EAChC,YAA8B,EAC9B,OAAoB,EACpB,UAA0B,EAC1B,UAAkC,EAClC,OAAmB,EACnB,MAAiC,EACjC,SAAqB;IAErB,IAAI,YAAY,KAAK,uCAAe,CAAC,KAAK,EAAE,CAAC;QAC3C,IAAA,iDAAuB,EAAC,OAAO,EAAE,uCAAe,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACpF,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,GAAkC,SAAS,CACnD,OAAO,EACP,YAAY,EACZ,OAAO,EACP,UAAU,EACV,UAAU,EACV,OAAO,CACR,CAAC;QACF,IAAI,IAAI;YAAE,SAAS,CAAC,IAAI,CAAC,IAAgB,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAChB,OAAgC,EAChC,aAA+B,EAC/B,OAAoB,EACpB,UAA0B,EAC1B,UAAkC,EAClC,OAAmB;;IAEnB,IAAI,OAAO,CAAC,mBAAmB;QAAE,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAE7E,MAAM,UAAU,GAAG,eAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,SAAG,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAEtF,MAAM,IAAI,GAAG,OAAO,CAAC,mBAAmB,CAAC,uCAAe,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5G,MAAM,SAAS,GAAG,OAAO,CAAC,mBAAmB,CAC3C,uCAAe,CAAC,KAAK,EACrB,OAAO,EACP,UAAU,EACV,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,EACjB,OAAO,CAAC,KAAK,CACd,CAAC;IAEF,IAAI,OAAO,CAAC,gBAAgB;QAAE,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAEzE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAc,SAAS,EAAlB,IAAI,UAAK,SAAS,EAAvC,QAA2B,CAAY,CAAC;IAE9C,MAAM,IAAI,mBACR,IAAI,EAAE,yBAAW,CAAC,IAAI,EACtB,QAAQ,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,EACxB,IAAI,EAAE,MAAA,uBAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,mCAAI,EAAE,IACtC,IAAI,CACR,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -12,12 +12,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.markConfigChainContentProcessor = markConfigChainContentProcessor;
|
|
15
|
-
const
|
|
15
|
+
const Breakscape_1 = require("../../../../breakscaping/Breakscape");
|
|
16
16
|
const Config_1 = require("../../../../config/Config");
|
|
17
17
|
const PropertyTag_1 = require("../../../../model/enum/PropertyTag");
|
|
18
18
|
const StringUtils_1 = require("../../../../utils/StringUtils");
|
|
19
19
|
const BitmarkPegParserTypes_1 = require("../BitmarkPegParserTypes");
|
|
20
|
-
const builder = new Builder_1.Builder();
|
|
21
20
|
function markConfigChainContentProcessor(context, _contentDepth, bitType, textFormat, tagsConfig, content, target) {
|
|
22
21
|
var _a;
|
|
23
22
|
const { key: tag } = content;
|
|
@@ -32,8 +31,9 @@ function markConfigChainContentProcessor(context, _contentDepth, bitType, textFo
|
|
|
32
31
|
if (context.DEBUG_CHAIN_TAGS)
|
|
33
32
|
context.debugPrint('mark TAGS', tags);
|
|
34
33
|
// Extract the name from the content tag
|
|
35
|
-
const mark = ((_a = StringUtils_1.StringUtils.trimmedString(content.value)) !== null && _a !== void 0 ? _a : 'unknown');
|
|
36
|
-
const config =
|
|
37
|
-
|
|
34
|
+
const mark = Breakscape_1.Breakscape.unbreakscape(((_a = StringUtils_1.StringUtils.trimmedString(content.value)) !== null && _a !== void 0 ? _a : 'unknown'));
|
|
35
|
+
const config = Object.assign({ mark, emphasis: 'underline' }, tags);
|
|
36
|
+
if (config)
|
|
37
|
+
markConfig.push(config);
|
|
38
38
|
}
|
|
39
39
|
//# sourceMappingURL=MarkConfigChainContentProcessor.js.map
|
package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkConfigChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"MarkConfigChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;;AA+DS,0EAA+B;AA/DxC,oEAAiE;AACjE,sDAAmD;AAInD,oEAAiE;AAGjE,+DAA4D;AAE5D,oEAOkC;AAElC,SAAS,+BAA+B,CACtC,OAAgC,EAChC,aAA+B,EAC/B,OAAoB,EACpB,UAA0B,EAC1B,UAAkC,EAClC,OAAmB,EACnB,MAAiC;;IAEjC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,OAAuB,CAAC;IAE7C,IAAI,OAAO,CAAC,mBAAmB;QAAE,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAE7E,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAErC,IAAI,CAAC,UAAU;QAAE,OAAO;IAExB,MAAM,aAAa,GAAG,eAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,yBAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAExF,6DAA6D;IAC7D,MAAM,KAAiC,OAAO,CAAC,mBAAmB,CAChE,uCAAe,CAAC,KAAK,EACrB,OAAO,EACP,UAAU,EACV,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,EACpB,OAAO,CAAC,KAAK,CACd,EANK,EAAE,IAAI,EAAE,WAAW,OAMxB,EAN6B,IAAI,cAA5B,QAA8B,CAMnC,CAAC;IAEF,IAAI,OAAO,CAAC,gBAAgB;QAAE,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAEpE,wCAAwC;IACxC,MAAM,IAAI,GAAW,uBAAU,CAAC,YAAY,CAC1C,CAAC,MAAA,yBAAW,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,mCAAI,SAAS,CAAsB,CAC7E,CAAC;IAEF,MAAM,MAAM,mBACV,IAAI,EACJ,QAAQ,EAAE,WAAqB,IAC5B,IAAI,CACR,CAAC;IAEF,IAAI,MAAM;QAAE,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.personChainContentProcessor = personChainContentProcessor;
|
|
4
|
-
const
|
|
4
|
+
const Breakscape_1 = require("../../../../breakscaping/Breakscape");
|
|
5
5
|
const ResourceTag_1 = require("../../../../model/enum/ResourceTag");
|
|
6
6
|
const StringUtils_1 = require("../../../../utils/StringUtils");
|
|
7
7
|
const BitmarkPegParserTypes_1 = require("../BitmarkPegParserTypes");
|
|
8
|
-
const builder = new Builder_1.Builder();
|
|
9
8
|
function personChainContentProcessor(context, _contentDepth, bitType, textFormat, tagsConfig, content, target) {
|
|
10
9
|
// const { value } = content as TypeValue;
|
|
11
10
|
if (context.DEBUG_CHAIN_CONTENT)
|
|
@@ -15,16 +14,16 @@ function personChainContentProcessor(context, _contentDepth, bitType, textFormat
|
|
|
15
14
|
context.debugPrint('person TAGS', tags);
|
|
16
15
|
const { propertyTitle, resources } = tags;
|
|
17
16
|
// Extract the name from the content tag
|
|
18
|
-
const name = StringUtils_1.StringUtils.trimmedString(content.value);
|
|
17
|
+
const name = Breakscape_1.Breakscape.unbreakscape(StringUtils_1.StringUtils.trimmedString(content.value));
|
|
19
18
|
// Extract the title from the propertyTitle tag
|
|
20
19
|
const title = StringUtils_1.StringUtils.trimmedString(propertyTitle);
|
|
21
20
|
// Extract avatarImage from the resources
|
|
22
21
|
const avatarImage = extractAvatarImage(context, resources);
|
|
23
|
-
const person =
|
|
22
|
+
const person = {
|
|
24
23
|
name,
|
|
25
24
|
title,
|
|
26
25
|
avatarImage,
|
|
27
|
-
}
|
|
26
|
+
};
|
|
28
27
|
target.person = person;
|
|
29
28
|
}
|
|
30
29
|
function extractAvatarImage(context, resources) {
|
|
@@ -35,7 +34,7 @@ function extractAvatarImage(context, resources) {
|
|
|
35
34
|
if (resources) {
|
|
36
35
|
for (const r of resources.reverse()) {
|
|
37
36
|
if (!avatarImage && ResourceTag_1.ResourceTag.image === r.type) {
|
|
38
|
-
avatarImage = r;
|
|
37
|
+
avatarImage = r.image;
|
|
39
38
|
}
|
|
40
39
|
else {
|
|
41
40
|
excessResources.push(r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersonChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"PersonChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.ts"],"names":[],"mappings":";;AAqFS,kEAA2B;AArFpC,oEAAiE;AAIjE,oEAAiE;AAIjE,+DAA4D;AAE5D,oEAMkC;AAElC,SAAS,2BAA2B,CAClC,OAAgC,EAChC,aAA+B,EAC/B,OAAoB,EACpB,UAA0B,EAC1B,UAAkC,EAClC,OAAmB,EACnB,MAAiC;IAEjC,0CAA0C;IAE1C,IAAI,OAAO,CAAC,mBAAmB;QAAE,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAE/E,MAAM,IAAI,GAAG,OAAO,CAAC,mBAAmB,CAAC,uCAAe,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAEhH,IAAI,OAAO,CAAC,gBAAgB;QAAE,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAEtE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAE1C,wCAAwC;IACxC,MAAM,IAAI,GAAG,uBAAU,CAAC,YAAY,CAAC,yBAAW,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAsB,CAAC,CAAC;IAEpG,+CAA+C;IAC/C,MAAM,KAAK,GAAG,yBAAW,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;IAEvD,yCAAyC;IACzC,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAE3D,MAAM,MAAM,GAAwB;QAClC,IAAI;QACJ,KAAK;QACL,WAAW;KACZ,CAAC;IAEF,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;AACzB,CAAC;AAED,SAAS,kBAAkB,CACzB,OAAgC,EAChC,SAAqC;IAErC,yCAAyC;IACzC,8EAA8E;IAC9E,IAAI,WAA0C,CAAC;IAC/C,MAAM,eAAe,GAAmB,EAAE,CAAC;IAE3C,IAAI,SAAS,EAAE,CAAC;QACd,KAAK,MAAM,CAAC,IAAI,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC;YACpC,IAAI,CAAC,WAAW,IAAI,yBAAW,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;gBACjD,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC;YACxB,CAAC;iBAAM,CAAC;gBACN,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,8CAA8C;QAC9C,OAAO,CAAC,MAAM,CAAC,eAAe,GAAG,eAAe,CAAC;QAEjD,oDAAoD;QACpD,OAAO,CAAC,UAAU,CAAC,GAAG,eAAe,CAAC,MAAM,qDAAqD,CAAC,CAAC;IACrG,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.propertyContentProcessor = propertyContentProcessor;
|
|
4
|
+
const Breakscape_1 = require("../../../../breakscaping/Breakscape");
|
|
4
5
|
const Config_1 = require("../../../../config/Config");
|
|
6
|
+
const PropertyTagConfig_1 = require("../../../../model/config/PropertyTagConfig");
|
|
7
|
+
const ConfigKey_1 = require("../../../../model/config/enum/ConfigKey");
|
|
5
8
|
const PropertyConfigKey_1 = require("../../../../model/config/enum/PropertyConfigKey");
|
|
6
9
|
const PropertyFormat_1 = require("../../../../model/enum/PropertyFormat");
|
|
7
10
|
const PropertyTag_1 = require("../../../../model/enum/PropertyTag");
|
|
8
11
|
const ResourceTag_1 = require("../../../../model/enum/ResourceTag");
|
|
12
|
+
const TextFormat_1 = require("../../../../model/enum/TextFormat");
|
|
9
13
|
const BooleanUtils_1 = require("../../../../utils/BooleanUtils");
|
|
10
14
|
const NumberUtils_1 = require("../../../../utils/NumberUtils");
|
|
11
15
|
const StringUtils_1 = require("../../../../utils/StringUtils");
|
|
16
|
+
const TextParser_1 = require("../../../text/TextParser");
|
|
12
17
|
const BookChainContentProcessor_1 = require("./BookChainContentProcessor");
|
|
13
18
|
const ExampleTagContentProcessor_1 = require("./ExampleTagContentProcessor");
|
|
14
19
|
const ImageSourceChainContentProcessor_1 = require("./ImageSourceChainContentProcessor");
|
|
@@ -20,6 +25,7 @@ const ResourceContentProcessor_1 = require("./ResourceContentProcessor");
|
|
|
20
25
|
const ServingsChainContentProcessor_1 = require("./ServingsChainContentProcessor");
|
|
21
26
|
const TechnicalTermChainContentProcessor_1 = require("./TechnicalTermChainContentProcessor");
|
|
22
27
|
const BitmarkPegParserTypes_1 = require("../BitmarkPegParserTypes");
|
|
28
|
+
const textParser = new TextParser_1.TextParser();
|
|
23
29
|
function propertyContentProcessor(context, contentDepth, bitType, textFormat, tagsConfig, content, target) {
|
|
24
30
|
const { value } = content;
|
|
25
31
|
let { key: tag } = content;
|
|
@@ -87,19 +93,23 @@ function propertyContentProcessor(context, contentDepth, bitType, textFormat, ta
|
|
|
87
93
|
return undefined;
|
|
88
94
|
if (c) {
|
|
89
95
|
switch (c.format) {
|
|
90
|
-
case
|
|
91
|
-
|
|
96
|
+
// case PropertyFormat.string:
|
|
97
|
+
// return StringUtils.isString(v) ? StringUtils.string(v) : undefined;
|
|
92
98
|
case PropertyFormat_1.PropertyFormat.trimmedString:
|
|
93
|
-
return StringUtils_1.StringUtils.isString(v) ? StringUtils_1.StringUtils.trimmedString(v) : undefined;
|
|
99
|
+
return Breakscape_1.Breakscape.unbreakscape(StringUtils_1.StringUtils.isString(v) ? StringUtils_1.StringUtils.trimmedString(v) : undefined);
|
|
94
100
|
case PropertyFormat_1.PropertyFormat.number:
|
|
95
|
-
return NumberUtils_1.NumberUtils.asNumber(v);
|
|
101
|
+
return NumberUtils_1.NumberUtils.asNumber(Breakscape_1.Breakscape.unbreakscape(v));
|
|
96
102
|
case PropertyFormat_1.PropertyFormat.boolean:
|
|
97
|
-
return BooleanUtils_1.BooleanUtils.toBoolean(v, true);
|
|
103
|
+
return BooleanUtils_1.BooleanUtils.toBoolean(Breakscape_1.Breakscape.unbreakscape(v), true);
|
|
98
104
|
case PropertyFormat_1.PropertyFormat.invertedBoolean:
|
|
99
|
-
return !BooleanUtils_1.BooleanUtils.toBoolean(v, true);
|
|
105
|
+
return !BooleanUtils_1.BooleanUtils.toBoolean(Breakscape_1.Breakscape.unbreakscape(v), true);
|
|
106
|
+
case PropertyFormat_1.PropertyFormat.bitmarkMinusMinus:
|
|
107
|
+
return textParser.toAst(v, { textFormat: TextFormat_1.TextFormat.bitmarkMinusMinus });
|
|
108
|
+
case PropertyFormat_1.PropertyFormat.bitmarkPlusPlus:
|
|
109
|
+
return textParser.toAst(v, { textFormat: TextFormat_1.TextFormat.bitmarkMinusMinus });
|
|
100
110
|
}
|
|
101
111
|
}
|
|
102
|
-
return v;
|
|
112
|
+
return Breakscape_1.Breakscape.unbreakscape(v);
|
|
103
113
|
};
|
|
104
114
|
// Convert property and key as needed
|
|
105
115
|
v = processValue(v);
|
|
@@ -126,5 +136,11 @@ function propertyContentProcessor(context, contentDepth, bitType, textFormat, ta
|
|
|
126
136
|
// Unknown (extra) property
|
|
127
137
|
addProperty(target.extraProperties, tag, value, propertyConfig);
|
|
128
138
|
}
|
|
139
|
+
// HACKS: Need to allow properties for different bits and in chains to have different/multiple formats!
|
|
140
|
+
// This is not currently supported by the config system; it would need to be extended to support this.
|
|
141
|
+
// That is a bit job, so instead there are just some hacks here for the few cases where it is currently needed :(
|
|
142
|
+
if (tag === PropertyTag_1.PropertyTag.tag_sampleSolution) {
|
|
143
|
+
addProperty(target, '__sampleSolutionAst', value, new PropertyTagConfig_1.PropertyTagConfig(ConfigKey_1.ConfigKey.sampleSolution, PropertyTag_1.PropertyTag.tag_sampleSolution, 1, 1, undefined, undefined, undefined, true, PropertyFormat_1.PropertyFormat.bitmarkMinusMinus, undefined, undefined));
|
|
144
|
+
}
|
|
129
145
|
}
|
|
130
146
|
//# sourceMappingURL=PropertyContentProcessor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"PropertyContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.ts"],"names":[],"mappings":";;AAmNS,4DAAwB;AAnNjC,oEAAiE;AACjE,sDAAmD;AAEnD,kFAA+E;AAE/E,uEAAoE;AACpE,uFAAoF;AAEpF,0EAAuE;AACvE,oEAAiE;AACjE,oEAAiE;AACjE,kEAA+E;AAC/E,iEAA8D;AAC9D,+DAA4D;AAC5D,+DAA4D;AAC5D,yDAAsD;AAEtD,2EAAwE;AACxE,6EAA0E;AAC1E,yFAAsF;AACtF,6FAAwH;AACxH,uFAAoF;AACpF,+EAA4E;AAC5E,yFAAsF;AACtF,yEAAmF;AACnF,mFAAgF;AAChF,6FAA0F;AAE1F,oEAOkC;AAElC,MAAM,UAAU,GAAG,IAAI,uBAAU,EAAE,CAAC;AAEpC,SAAS,wBAAwB,CAC/B,OAAgC,EAChC,YAA8B,EAC9B,OAAoB,EACpB,UAA0B,EAC1B,UAAkC,EAClC,OAAmB,EACnB,MAAiC;IAEjC,MAAM,EAAE,KAAK,EAAE,GAAG,OAAuB,CAAC;IAC1C,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,OAAuB,CAAC;IAC3C,MAAM,OAAO,GAAG,YAAY,KAAK,uCAAe,CAAC,KAAK,CAAC;IAEvD,qDAAqD;IACrD,MAAM,cAAc,GAAG,eAAM,CAAC,kBAAkB,CAAC,UAAU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yBAAW,CAAC,kBAAkB,EAC9B,CAAC,EACD,CAAC,EACD,SAAS,EACT,SAAS,EACT,SAAS,EACT,IAAI,EACJ,+BAAc,CAAC,iBAAiB,EAChC,SAAS,EACT,SAAS,CACV,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ratingLevelChainContentProcessor = ratingLevelChainContentProcessor;
|
|
4
|
-
const Builder_1 = require("../../../../ast/Builder");
|
|
5
4
|
const PropertyTag_1 = require("../../../../model/enum/PropertyTag");
|
|
6
5
|
const NumberUtils_1 = require("../../../../utils/NumberUtils");
|
|
6
|
+
const TextParser_1 = require("../../../text/TextParser");
|
|
7
7
|
const BitmarkPegParserTypes_1 = require("../BitmarkPegParserTypes");
|
|
8
|
-
const
|
|
8
|
+
const textParser = new TextParser_1.TextParser();
|
|
9
9
|
function ratingLevelChainContentProcessor(context, _contentDepth, bitType, textFormat, tagsConfig, content, target) {
|
|
10
10
|
var _a;
|
|
11
11
|
const { key, value } = content;
|
|
@@ -17,10 +17,10 @@ function ratingLevelChainContentProcessor(context, _contentDepth, bitType, textF
|
|
|
17
17
|
const { label } = tags;
|
|
18
18
|
// Extract the technicalTerm from the content tag
|
|
19
19
|
const level = (_a = NumberUtils_1.NumberUtils.asNumber(value)) !== null && _a !== void 0 ? _a : 0;
|
|
20
|
-
const node =
|
|
20
|
+
const node = {
|
|
21
21
|
level,
|
|
22
|
-
label,
|
|
23
|
-
}
|
|
22
|
+
label: label ? textParser.toAst(label) : undefined,
|
|
23
|
+
};
|
|
24
24
|
switch (key) {
|
|
25
25
|
case PropertyTag_1.PropertyTag.ratingLevelStart:
|
|
26
26
|
target.ratingLevelStart = node;
|
package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RatingLevelChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"RatingLevelChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.ts"],"names":[],"mappings":";;AA4DS,4EAAgC;AA1DzC,oEAAiE;AAGjE,+DAA4D;AAC5D,yDAAsD;AAEtD,oEAOkC;AAElC,MAAM,UAAU,GAAG,IAAI,uBAAU,EAAE,CAAC;AAEpC,SAAS,gCAAgC,CACvC,OAAgC,EAChC,aAA+B,EAC/B,OAAoB,EACpB,UAA0B,EAC1B,UAAkC,EAClC,OAAmB,EACnB,MAAiC;;IAEjC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,OAAuB,CAAC;IAE/C,IAAI,OAAO,CAAC,mBAAmB;QAAE,OAAO,CAAC,UAAU,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IAEpF,MAAM,IAAI,GAAG,OAAO,CAAC,mBAAmB,CAAC,uCAAe,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAEhH,IAAI,OAAO,CAAC,gBAAgB;QAAE,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;IAE3E,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEvB,iDAAiD;IACjD,MAAM,KAAK,GAAG,MAAA,yBAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,mCAAI,CAAC,CAAC;IAE/C,MAAM,IAAI,GAAqC;QAC7C,KAAK;QACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;KACnD,CAAC;IAEF,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,yBAAW,CAAC,gBAAgB;YAC/B,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAE/B,MAAM;QACR,KAAK,yBAAW,CAAC,cAAc;YAC7B,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;YAE7B,MAAM;QACR,QAAQ;QACR,aAAa;IACf,CAAC;AACH,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.referenceTagContentProcessor = referenceTagContentProcessor;
|
|
4
|
+
const Breakscape_1 = require("../../../../breakscaping/Breakscape");
|
|
4
5
|
const StringUtils_1 = require("../../../../utils/StringUtils");
|
|
5
6
|
function referenceTagContentProcessor(_context, _contentDepth, _bitType, _textFormat, _tagsConfig, content, target, isReferenceEnd) {
|
|
6
7
|
const { value } = content;
|
|
7
8
|
const trimmedStringValue = StringUtils_1.StringUtils.trimmedString(value);
|
|
8
9
|
if (isReferenceEnd) {
|
|
9
|
-
target.referenceEnd = trimmedStringValue;
|
|
10
|
+
target.referenceEnd = Breakscape_1.Breakscape.unbreakscape(trimmedStringValue);
|
|
10
11
|
}
|
|
11
12
|
else {
|
|
12
|
-
target.reference = trimmedStringValue;
|
|
13
|
+
target.reference = Breakscape_1.Breakscape.unbreakscape(trimmedStringValue);
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=ReferenceTagContentProcessor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferenceTagContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ReferenceTagContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.ts"],"names":[],"mappings":";;AAmCS,oEAA4B;AAnCrC,oEAAiE;AAKjE,+DAA4D;AAU5D,SAAS,4BAA4B,CACnC,QAAiC,EACjC,aAA+B,EAC/B,QAAqB,EACrB,WAA2B,EAC3B,WAAmC,EACnC,OAAmB,EACnB,MAAiC,EACjC,cAAuB;IAEvB,MAAM,EAAE,KAAK,EAAE,GAAG,OAAoB,CAAC;IAEvC,MAAM,kBAAkB,GAAG,yBAAW,CAAC,aAAa,CAAC,KAAK,CAAsB,CAAC;IAEjF,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,CAAC,YAAY,GAAG,uBAAU,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACpE,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,SAAS,GAAG,uBAAU,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACjE,CAAC;AACH,CAAC"}
|
|
@@ -15,6 +15,7 @@ exports.buildResources = buildResources;
|
|
|
15
15
|
exports.resourceContentProcessor = resourceContentProcessor;
|
|
16
16
|
exports.propertyStyleResourceContentProcessor = propertyStyleResourceContentProcessor;
|
|
17
17
|
const ResourceBuilder_1 = require("../../../../ast/ResourceBuilder");
|
|
18
|
+
const Breakscape_1 = require("../../../../breakscaping/Breakscape");
|
|
18
19
|
const Config_1 = require("../../../../config/Config");
|
|
19
20
|
const Count_1 = require("../../../../model/enum/Count");
|
|
20
21
|
const ResourceTag_1 = require("../../../../model/enum/ResourceTag");
|
|
@@ -41,8 +42,8 @@ function buildResources(context, bitType, resourceTypeAttachment, resources) {
|
|
|
41
42
|
// Find the excess resources and ensure we have the minimum resources
|
|
42
43
|
if (resources) {
|
|
43
44
|
for (const r of resources.reverse()) {
|
|
44
|
-
let countMin = (_a = countsMin.get(r.
|
|
45
|
-
let countMax = (_b = countsMax.get(r.
|
|
45
|
+
let countMin = (_a = countsMin.get(r.__typeAlias)) !== null && _a !== void 0 ? _a : 0;
|
|
46
|
+
let countMax = (_b = countsMax.get(r.__typeAlias)) !== null && _b !== void 0 ? _b : 0;
|
|
46
47
|
// Decrement the minimum count and later ensure it is 0
|
|
47
48
|
countMin = Math.max(0, countMin - 1);
|
|
48
49
|
if (countMax === Count_1.Count.infinity) {
|
|
@@ -57,8 +58,8 @@ function buildResources(context, bitType, resourceTypeAttachment, resources) {
|
|
|
57
58
|
excessResources.unshift(r);
|
|
58
59
|
}
|
|
59
60
|
// Set the new counts
|
|
60
|
-
countsMin.set(r.
|
|
61
|
-
countsMax.set(r.
|
|
61
|
+
countsMin.set(r.__typeAlias, countMin);
|
|
62
|
+
countsMax.set(r.__typeAlias, countMax);
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
// Raise a warning if the resource type is specified in the bit header, but no extra resource attachment is allowed
|
|
@@ -86,8 +87,13 @@ function resourceContentProcessor(context, _contentDepth, bitType, textFormat, t
|
|
|
86
87
|
// Parse the resource chain
|
|
87
88
|
const resourceConfig = Config_1.Config.getTagConfigForTag(tagsConfig, type);
|
|
88
89
|
const _a = context.bitContentProcessor(BitmarkPegParserTypes_1.BitContentLevel.Chain, bitType, textFormat, resourceConfig === null || resourceConfig === void 0 ? void 0 : resourceConfig.chain, chain), { posterImage } = _a, tags = __rest(_a, ["posterImage"]);
|
|
89
|
-
const
|
|
90
|
-
|
|
90
|
+
const posterImageResource = posterImage
|
|
91
|
+
? resourceBuilder.resource(bitType, {
|
|
92
|
+
type: ResourceTag_1.ResourceTag.image,
|
|
93
|
+
value: posterImage,
|
|
94
|
+
}).image
|
|
95
|
+
: undefined;
|
|
96
|
+
const resource = resourceBuilder.resource(bitType, Object.assign({ type, value: Breakscape_1.Breakscape.unbreakscape(value), posterImage: posterImageResource }, tags));
|
|
91
97
|
if (resource)
|
|
92
98
|
resources.push(resource);
|
|
93
99
|
}
|
|
@@ -101,8 +107,13 @@ function propertyStyleResourceContentProcessor(context, _contentDepth, bitType,
|
|
|
101
107
|
// Parse the resource chain
|
|
102
108
|
const resourceConfig = Config_1.Config.getTagConfigForTag(tagsConfig, type);
|
|
103
109
|
const _b = context.bitContentProcessor(BitmarkPegParserTypes_1.BitContentLevel.Chain, bitType, textFormat, resourceConfig === null || resourceConfig === void 0 ? void 0 : resourceConfig.chain, chain), { posterImage } = _b, tags = __rest(_b, ["posterImage"]);
|
|
104
|
-
const
|
|
105
|
-
|
|
110
|
+
const posterImageResource = posterImage
|
|
111
|
+
? resourceBuilder.resource(bitType, {
|
|
112
|
+
type: ResourceTag_1.ResourceTag.image,
|
|
113
|
+
value: posterImage,
|
|
114
|
+
}).image
|
|
115
|
+
: undefined;
|
|
116
|
+
const resource = resourceBuilder.resource(bitType, Object.assign({ type, value: Breakscape_1.Breakscape.unbreakscape(value), posterImage: posterImageResource }, tags));
|
|
106
117
|
if (resource)
|
|
107
118
|
target.propertyStyleResources[key] = resource;
|
|
108
119
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ResourceContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAwLS,wCAAc;AAAE,4DAAwB;AAAE,sFAAqC;AAxLxF,qEAAkE;AAClE,oEAAiE;AACjE,sDAAmD;AAInD,wDAAqD;AACrD,oEAAkF;AAIlF,oEAOkC;AAElC,iCAAiC;AACjC,MAAM,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;AAE9C;;;;;;GAMG;AACH,SAAS,cAAc,CACrB,OAAgC,EAChC,OAAoB,EACpB,sBAA0C,EAC1C,SAAqC;;IAErC,MAAM,iBAAiB,GAAmB,EAAE,CAAC;IAC7C,MAAM,eAAe,GAAmB,EAAE,CAAC;IAE3C,MAAM,+BAA+B,GAAG,yBAAW,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;IAEtF,wCAAwC;IACxC,MAAM,eAAe,GAAG,eAAM,CAAC,qBAA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WAAW;aACnB,CACF,CAAC,KAAK;YACT,CAAC,CAAC,SAAS,CAAC;QAEd,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,OAAO,kBAC/C,IAAI,EACJ,KAAK,EAAE,uBAAU,CAAC,YAAY,CAAC,KAAK,CAAC,EACrC,WAAW,EAAE,mBAAmB,IAC7B,IAAI,EACP,CAAC;QACH,IAAI,QAAQ;YAAE,MAAM,CAAC,sBAAsB,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;IAC9D,CAAC;AACH,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.servingsChainContentProcessor = servingsChainContentProcessor;
|
|
4
|
-
const Builder_1 = require("../../../../ast/Builder");
|
|
5
4
|
const NumberUtils_1 = require("../../../../utils/NumberUtils");
|
|
6
5
|
const BitmarkPegParserTypes_1 = require("../BitmarkPegParserTypes");
|
|
7
|
-
const builder = new Builder_1.Builder();
|
|
8
6
|
function servingsChainContentProcessor(context, _contentDepth, bitType, textFormat, tagsConfig, content, target) {
|
|
9
7
|
// const { value } = content as TypeValue;
|
|
10
8
|
var _a;
|
|
@@ -13,17 +11,17 @@ function servingsChainContentProcessor(context, _contentDepth, bitType, textForm
|
|
|
13
11
|
const tags = context.bitContentProcessor(BitmarkPegParserTypes_1.BitContentLevel.Chain, bitType, textFormat, tagsConfig, content.chain);
|
|
14
12
|
if (context.DEBUG_CHAIN_TAGS)
|
|
15
13
|
context.debugPrint('servings TAGS', tags);
|
|
16
|
-
const { unit, unitAbbr, decimalPlaces, disableCalculation,
|
|
14
|
+
const { unit, unitAbbr, decimalPlaces, disableCalculation, __hintString } = tags;
|
|
17
15
|
// Extract the servings from the content tag
|
|
18
16
|
const servings = (_a = NumberUtils_1.NumberUtils.asNumber(content.value)) !== null && _a !== void 0 ? _a : 1;
|
|
19
|
-
const node =
|
|
17
|
+
const node = {
|
|
20
18
|
servings,
|
|
21
19
|
unit,
|
|
22
20
|
unitAbbr,
|
|
23
21
|
decimalPlaces: decimalPlaces !== null && decimalPlaces !== void 0 ? decimalPlaces : 1,
|
|
24
22
|
disableCalculation,
|
|
25
|
-
hint,
|
|
26
|
-
}
|
|
23
|
+
hint: __hintString,
|
|
24
|
+
};
|
|
27
25
|
target.servings = node;
|
|
28
26
|
}
|
|
29
27
|
//# sourceMappingURL=ServingsChainContentProcessor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServingsChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ServingsChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.ts"],"names":[],"mappings":";;AAgDS,sEAA6B;AA5CtC,+DAA4D;AAE5D,oEAMkC;AAElC,SAAS,6BAA6B,CACpC,OAAgC,EAChC,aAA+B,EAC/B,OAAoB,EACpB,UAA0B,EAC1B,UAAkC,EAClC,OAAmB,EACnB,MAAiC;IAEjC,0CAA0C;;IAE1C,IAAI,OAAO,CAAC,mBAAmB;QAAE,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAEjF,MAAM,IAAI,GAAG,OAAO,CAAC,mBAAmB,CAAC,uCAAe,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAEhH,IAAI,OAAO,CAAC,gBAAgB;QAAE,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;IAExE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,kBAAkB,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAEjF,4CAA4C;IAC5C,MAAM,QAAQ,GAAG,MAAA,yBAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,mCAAI,CAAC,CAAC;IAE1D,MAAM,IAAI,GAA0B;QAClC,QAAQ;QACR,IAAI;QACJ,QAAQ;QACR,aAAa,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,CAAC;QACjC,kBAAkB;QAClB,IAAI,EAAE,YAAY;KACnB,CAAC;IAEF,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;AACzB,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.technicalTermChainContentProcessor = technicalTermChainContentProcessor;
|
|
4
|
-
const
|
|
4
|
+
const Breakscape_1 = require("../../../../breakscaping/Breakscape");
|
|
5
5
|
const StringUtils_1 = require("../../../../utils/StringUtils");
|
|
6
6
|
const BitmarkPegParserTypes_1 = require("../BitmarkPegParserTypes");
|
|
7
|
-
const builder = new Builder_1.Builder();
|
|
8
7
|
function technicalTermChainContentProcessor(context, _contentDepth, bitType, textFormat, tagsConfig, content, target) {
|
|
9
8
|
// const { value } = content as TypeValue;
|
|
10
9
|
if (context.DEBUG_CHAIN_CONTENT)
|
|
@@ -14,11 +13,11 @@ function technicalTermChainContentProcessor(context, _contentDepth, bitType, tex
|
|
|
14
13
|
context.debugPrint('technicalTerm TAGS', tags);
|
|
15
14
|
const { lang } = tags;
|
|
16
15
|
// Extract the technicalTerm from the content tag
|
|
17
|
-
const technicalTerm = StringUtils_1.StringUtils.trimmedString(content.value);
|
|
18
|
-
const node =
|
|
16
|
+
const technicalTerm = Breakscape_1.Breakscape.unbreakscape(StringUtils_1.StringUtils.trimmedString(content.value));
|
|
17
|
+
const node = {
|
|
19
18
|
technicalTerm,
|
|
20
19
|
lang,
|
|
21
|
-
}
|
|
20
|
+
};
|
|
22
21
|
target.technicalTerm = node;
|
|
23
22
|
}
|
|
24
23
|
//# sourceMappingURL=TechnicalTermChainContentProcessor.js.map
|
package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TechnicalTermChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"TechnicalTermChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.ts"],"names":[],"mappings":";;AA8CS,gFAAkC;AA9C3C,oEAAiE;AAMjE,+DAA4D;AAE5D,oEAMkC;AAElC,SAAS,kCAAkC,CACzC,OAAgC,EAChC,aAA+B,EAC/B,OAAoB,EACpB,UAA0B,EAC1B,UAAkC,EAClC,OAAmB,EACnB,MAAiC;IAEjC,0CAA0C;IAE1C,IAAI,OAAO,CAAC,mBAAmB;QAAE,OAAO,CAAC,UAAU,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAEtF,MAAM,IAAI,GAAG,OAAO,CAAC,mBAAmB,CAAC,uCAAe,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAEhH,IAAI,OAAO,CAAC,gBAAgB;QAAE,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;IAE7E,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEtB,iDAAiD;IACjD,MAAM,aAAa,GAAG,uBAAU,CAAC,YAAY,CAAC,yBAAW,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAsB,CAAC,CAAC;IAE7G,MAAM,IAAI,GAA+B;QACvC,aAAa;QACb,IAAI;KACL,CAAC;IAEF,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC;AAC9B,CAAC"}
|
|
@@ -5,6 +5,8 @@ exports.buildTitles = buildTitles;
|
|
|
5
5
|
const Config_1 = require("../../../../config/Config");
|
|
6
6
|
const BitType_1 = require("../../../../model/enum/BitType");
|
|
7
7
|
const StringUtils_1 = require("../../../../utils/StringUtils");
|
|
8
|
+
const TextParser_1 = require("../../../text/TextParser");
|
|
9
|
+
const textParser = new TextParser_1.TextParser();
|
|
8
10
|
function titleTagContentProcessor(_context, _contentDepth, _bitType, _textFormat, _tagsConfig, content, target) {
|
|
9
11
|
const { value } = content;
|
|
10
12
|
const title = target.title;
|
|
@@ -15,24 +17,31 @@ function titleTagContentProcessor(_context, _contentDepth, _bitType, _textFormat
|
|
|
15
17
|
const titleValue = value;
|
|
16
18
|
const titleText = StringUtils_1.StringUtils.trimmedString(titleValue.title);
|
|
17
19
|
const level = titleValue.level.length;
|
|
18
|
-
title[level] =
|
|
20
|
+
title[level] = {
|
|
21
|
+
//
|
|
22
|
+
titleAst: textParser.toAst(titleText !== null && titleText !== void 0 ? titleText : ''),
|
|
23
|
+
titleString: titleText !== null && titleText !== void 0 ? titleText : '',
|
|
24
|
+
};
|
|
19
25
|
}
|
|
20
26
|
function buildTitles(_context, bitType, title) {
|
|
21
|
-
var _a, _b;
|
|
27
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
22
28
|
title = title !== null && title !== void 0 ? title : [];
|
|
23
29
|
if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.chapter)) {
|
|
24
30
|
let t;
|
|
25
31
|
if (title.length > 0)
|
|
26
32
|
t = title[title.length - 1];
|
|
27
33
|
return {
|
|
28
|
-
title: t,
|
|
34
|
+
title: (_a = t === null || t === void 0 ? void 0 : t.titleAst) !== null && _a !== void 0 ? _a : [],
|
|
35
|
+
titleString: (_b = t === null || t === void 0 ? void 0 : t.titleString) !== null && _b !== void 0 ? _b : '',
|
|
29
36
|
level: title.length > 0 ? title.length - 1 : undefined,
|
|
30
37
|
};
|
|
31
38
|
}
|
|
32
39
|
else {
|
|
33
40
|
return {
|
|
34
|
-
title: (
|
|
35
|
-
|
|
41
|
+
title: (_d = (_c = title[1]) === null || _c === void 0 ? void 0 : _c.titleAst) !== null && _d !== void 0 ? _d : undefined,
|
|
42
|
+
titleString: (_f = (_e = title[1]) === null || _e === void 0 ? void 0 : _e.titleString) !== null && _f !== void 0 ? _f : undefined,
|
|
43
|
+
subtitle: (_h = (_g = title[2]) === null || _g === void 0 ? void 0 : _g.titleAst) !== null && _h !== void 0 ? _h : undefined,
|
|
44
|
+
subtitleString: (_k = (_j = title[2]) === null || _j === void 0 ? void 0 : _j.titleString) !== null && _k !== void 0 ? _k : undefined,
|
|
36
45
|
};
|
|
37
46
|
}
|
|
38
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleTagContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"TitleTagContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.ts"],"names":[],"mappings":";;AAyES,4DAAwB;AAAE,kCAAW;AAzE9C,sDAAmD;AAInD,4DAAsE;AAEtE,+DAA4D;AAC5D,yDAAsD;AAWtD,MAAM,UAAU,GAAG,IAAI,uBAAU,EAAE,CAAC;AAEpC,SAAS,wBAAwB,CAC/B,QAAiC,EACjC,aAA+B,EAC/B,QAAqB,EACrB,WAA2B,EAC3B,WAAmC,EACnC,OAAmB,EACnB,MAAiC;IAEjC,MAAM,EAAE,KAAK,EAAE,GAAG,OAAoB,CAAC;IAEvC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAE3B,IAAI,CAAC,KAAK;QAAE,OAAO;IAEnB,gCAAgC;IAChC,8DAA8D;IAC9D,MAAM,UAAU,GAAuC,KAAY,CAAC;IACpE,MAAM,SAAS,GAAG,yBAAW,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,CAAsB,CAAC;IACnF,MAAM,KAAK,GAAG,UA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CAAC,CAAC,CAAC,0CAAE,WAAW,mCAAI,SAAS;SACnD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -12,12 +12,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.trueFalseChainContentProcessor = trueFalseChainContentProcessor;
|
|
15
|
-
const Builder_1 = require("../../../../ast/Builder");
|
|
16
15
|
const Config_1 = require("../../../../config/Config");
|
|
17
16
|
const BitType_1 = require("../../../../model/enum/BitType");
|
|
17
|
+
const BodyBitType_1 = require("../../../../model/enum/BodyBitType");
|
|
18
18
|
const TrueFalseTagContentProcessor_1 = require("./TrueFalseTagContentProcessor");
|
|
19
19
|
const BitmarkPegParserTypes_1 = require("../BitmarkPegParserTypes");
|
|
20
|
-
const builder = new Builder_1.Builder();
|
|
21
20
|
function trueFalseChainContentProcessor(context, contentDepth, bitType, textFormat, tagsConfig, content, target, bodyParts) {
|
|
22
21
|
if (contentDepth === BitmarkPegParserTypes_1.BitContentLevel.Chain) {
|
|
23
22
|
(0, TrueFalseTagContentProcessor_1.trueFalseTagContentProcessor)(context, BitmarkPegParserTypes_1.BitContentLevel.Chain, bitType, textFormat, content, target);
|
|
@@ -84,8 +83,15 @@ function buildStatement(context, bitType, textFormat, tagsConfig, trueFalseConte
|
|
|
84
83
|
if (context.DEBUG_CHAIN_TAGS)
|
|
85
84
|
context.debugPrint('trueFalse V1 tags (statement)', tags);
|
|
86
85
|
let statement;
|
|
86
|
+
let firstTrueFalse;
|
|
87
87
|
if (trueFalse && trueFalse.length > 0) {
|
|
88
|
-
|
|
88
|
+
firstTrueFalse = trueFalse[0];
|
|
89
|
+
}
|
|
90
|
+
if (firstTrueFalse) {
|
|
91
|
+
// Have to remove the statement JSON tag to keep typescript happy
|
|
92
|
+
const { statement: _ignore } = tags, tagsRest = __rest(tags, ["statement"]);
|
|
93
|
+
_ignore;
|
|
94
|
+
statement = Object.assign(Object.assign(Object.assign({}, firstTrueFalse), { statement: firstTrueFalse.text }), tagsRest);
|
|
89
95
|
}
|
|
90
96
|
return statement;
|
|
91
97
|
}
|
|
@@ -115,22 +121,28 @@ function buildStatementsChoicesResponses(context, bitType, textFormat, tagsConfi
|
|
|
115
121
|
const _a = context.bitContentProcessor(BitmarkPegParserTypes_1.BitContentLevel.Chain, bitType, textFormat, tagsConfig, contents), { trueFalse } = _a, tags = __rest(_a, ["trueFalse"]);
|
|
116
122
|
if (context.DEBUG_CHAIN_TAGS)
|
|
117
123
|
context.debugPrint('trueFalse V1 tags (choices/responses)', tags);
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
statements.push(statement);
|
|
122
|
-
}
|
|
124
|
+
let firstTrueFalse;
|
|
125
|
+
if (trueFalse && trueFalse.length > 0) {
|
|
126
|
+
firstTrueFalse = trueFalse[0];
|
|
123
127
|
}
|
|
124
|
-
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
+
if (firstTrueFalse) {
|
|
129
|
+
if (insertStatements) {
|
|
130
|
+
// Have to remove the statement JSON tag to keep typescript happy
|
|
131
|
+
const { statement: _ignore } = tags, tagsRest = __rest(tags, ["statement"]);
|
|
132
|
+
_ignore;
|
|
133
|
+
const statement = Object.assign(Object.assign(Object.assign({}, firstTrueFalse), { statement: firstTrueFalse.text }), tagsRest);
|
|
134
|
+
if (statement)
|
|
135
|
+
statements.push(statement);
|
|
128
136
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
137
|
+
else if (insertChoices) {
|
|
138
|
+
const choice = Object.assign(Object.assign(Object.assign({}, firstTrueFalse), { choice: firstTrueFalse.text }), tags);
|
|
139
|
+
if (choice)
|
|
140
|
+
choices.push(choice);
|
|
141
|
+
}
|
|
142
|
+
else if (insertResponses) {
|
|
143
|
+
const response = Object.assign(Object.assign(Object.assign({}, firstTrueFalse), { response: firstTrueFalse.text }), tags);
|
|
144
|
+
if (response)
|
|
145
|
+
responses.push(response);
|
|
134
146
|
}
|
|
135
147
|
}
|
|
136
148
|
}
|
|
@@ -155,10 +167,12 @@ function buildHighlight(context, bitType, textFormat, tagsConfig, highlightConte
|
|
|
155
167
|
const texts = [];
|
|
156
168
|
if (trueFalse) {
|
|
157
169
|
for (const tf of trueFalse) {
|
|
158
|
-
|
|
170
|
+
const ht = Object.assign(Object.assign({}, tf), { isHighlighted: false });
|
|
171
|
+
if (ht)
|
|
172
|
+
texts.push(ht);
|
|
159
173
|
}
|
|
160
174
|
}
|
|
161
|
-
const highlight =
|
|
175
|
+
const highlight = Object.assign({ type: BodyBitType_1.BodyBitType.highlight, texts: texts }, tags);
|
|
162
176
|
return highlight;
|
|
163
177
|
}
|
|
164
178
|
function buildSelect(context, bitType, textFormat, tagsConfig, selectContent) {
|
|
@@ -170,10 +184,12 @@ function buildSelect(context, bitType, textFormat, tagsConfig, selectContent) {
|
|
|
170
184
|
const options = [];
|
|
171
185
|
if (trueFalse) {
|
|
172
186
|
for (const tf of trueFalse) {
|
|
173
|
-
|
|
187
|
+
const so = tf;
|
|
188
|
+
if (so)
|
|
189
|
+
options.push(so);
|
|
174
190
|
}
|
|
175
191
|
}
|
|
176
|
-
const select =
|
|
192
|
+
const select = Object.assign({ type: BodyBitType_1.BodyBitType.select, options: options }, tags);
|
|
177
193
|
return select;
|
|
178
194
|
}
|
|
179
195
|
//# sourceMappingURL=TrueFalseChainContentProcessor.js.map
|