@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
|
@@ -9,12 +9,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
12
|
+
import { Breakscape } from '../../../../breakscaping/Breakscape';
|
|
13
13
|
import { Config } from '../../../../config/Config';
|
|
14
14
|
import { PropertyTag } from '../../../../model/enum/PropertyTag';
|
|
15
15
|
import { StringUtils } from '../../../../utils/StringUtils';
|
|
16
16
|
import { BitContentLevel, } from '../BitmarkPegParserTypes';
|
|
17
|
-
const builder = new Builder();
|
|
18
17
|
function markConfigChainContentProcessor(context, _contentDepth, bitType, textFormat, tagsConfig, content, target) {
|
|
19
18
|
var _a;
|
|
20
19
|
const { key: tag } = content;
|
|
@@ -29,9 +28,10 @@ function markConfigChainContentProcessor(context, _contentDepth, bitType, textFo
|
|
|
29
28
|
if (context.DEBUG_CHAIN_TAGS)
|
|
30
29
|
context.debugPrint('mark TAGS', tags);
|
|
31
30
|
// Extract the name from the content tag
|
|
32
|
-
const mark = ((_a = StringUtils.trimmedString(content.value)) !== null && _a !== void 0 ? _a : 'unknown');
|
|
33
|
-
const config =
|
|
34
|
-
|
|
31
|
+
const mark = Breakscape.unbreakscape(((_a = StringUtils.trimmedString(content.value)) !== null && _a !== void 0 ? _a : 'unknown'));
|
|
32
|
+
const config = Object.assign({ mark, emphasis: 'underline' }, tags);
|
|
33
|
+
if (config)
|
|
34
|
+
markConfig.push(config);
|
|
35
35
|
}
|
|
36
36
|
export { markConfigChainContentProcessor };
|
|
37
37
|
//# sourceMappingURL=MarkConfigChainContentProcessor.js.map
|
package/dist/esm/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":";;;;;;;;;;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"MarkConfigChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAInD,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAEL,eAAe,GAKhB,MAAM,0BAA0B,CAAC;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,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAExF,6DAA6D;IAC7D,MAAM,KAAiC,OAAO,CAAC,mBAAmB,CAChE,eAAe,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,UAAU,CAAC,YAAY,CAC1C,CAAC,MAAA,WAAW,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;AAED,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Breakscape } from '../../../../breakscaping/Breakscape';
|
|
2
2
|
import { ResourceTag } from '../../../../model/enum/ResourceTag';
|
|
3
3
|
import { StringUtils } from '../../../../utils/StringUtils';
|
|
4
4
|
import { BitContentLevel, } from '../BitmarkPegParserTypes';
|
|
5
|
-
const builder = new Builder();
|
|
6
5
|
function personChainContentProcessor(context, _contentDepth, bitType, textFormat, tagsConfig, content, target) {
|
|
7
6
|
// const { value } = content as TypeValue;
|
|
8
7
|
if (context.DEBUG_CHAIN_CONTENT)
|
|
@@ -12,16 +11,16 @@ function personChainContentProcessor(context, _contentDepth, bitType, textFormat
|
|
|
12
11
|
context.debugPrint('person TAGS', tags);
|
|
13
12
|
const { propertyTitle, resources } = tags;
|
|
14
13
|
// Extract the name from the content tag
|
|
15
|
-
const name = StringUtils.trimmedString(content.value);
|
|
14
|
+
const name = Breakscape.unbreakscape(StringUtils.trimmedString(content.value));
|
|
16
15
|
// Extract the title from the propertyTitle tag
|
|
17
16
|
const title = StringUtils.trimmedString(propertyTitle);
|
|
18
17
|
// Extract avatarImage from the resources
|
|
19
18
|
const avatarImage = extractAvatarImage(context, resources);
|
|
20
|
-
const person =
|
|
19
|
+
const person = {
|
|
21
20
|
name,
|
|
22
21
|
title,
|
|
23
22
|
avatarImage,
|
|
24
|
-
}
|
|
23
|
+
};
|
|
25
24
|
target.person = person;
|
|
26
25
|
}
|
|
27
26
|
function extractAvatarImage(context, resources) {
|
|
@@ -32,7 +31,7 @@ function extractAvatarImage(context, resources) {
|
|
|
32
31
|
if (resources) {
|
|
33
32
|
for (const r of resources.reverse()) {
|
|
34
33
|
if (!avatarImage && ResourceTag.image === r.type) {
|
|
35
|
-
avatarImage = r;
|
|
34
|
+
avatarImage = r.image;
|
|
36
35
|
}
|
|
37
36
|
else {
|
|
38
37
|
excessResources.push(r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersonChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PersonChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAIjE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAIjE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAEL,eAAe,GAIhB,MAAM,0BAA0B,CAAC;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,eAAe,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,aA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|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { Breakscape } from '../../../../breakscaping/Breakscape';
|
|
1
2
|
import { Config } from '../../../../config/Config';
|
|
3
|
+
import { PropertyTagConfig } from '../../../../model/config/PropertyTagConfig';
|
|
4
|
+
import { ConfigKey } from '../../../../model/config/enum/ConfigKey';
|
|
2
5
|
import { PropertyConfigKey } from '../../../../model/config/enum/PropertyConfigKey';
|
|
3
6
|
import { PropertyFormat } from '../../../../model/enum/PropertyFormat';
|
|
4
7
|
import { PropertyTag } from '../../../../model/enum/PropertyTag';
|
|
5
8
|
import { ResourceTag } from '../../../../model/enum/ResourceTag';
|
|
9
|
+
import { TextFormat } from '../../../../model/enum/TextFormat';
|
|
6
10
|
import { BooleanUtils } from '../../../../utils/BooleanUtils';
|
|
7
11
|
import { NumberUtils } from '../../../../utils/NumberUtils';
|
|
8
12
|
import { StringUtils } from '../../../../utils/StringUtils';
|
|
13
|
+
import { TextParser } from '../../../text/TextParser';
|
|
9
14
|
import { bookChainContentProcessor } from './BookChainContentProcessor';
|
|
10
15
|
import { exampleTagContentProcessor } from './ExampleTagContentProcessor';
|
|
11
16
|
import { imageSourceChainContentProcessor } from './ImageSourceChainContentProcessor';
|
|
@@ -17,6 +22,7 @@ import { propertyStyleResourceContentProcessor } from './ResourceContentProcesso
|
|
|
17
22
|
import { servingsChainContentProcessor } from './ServingsChainContentProcessor';
|
|
18
23
|
import { technicalTermChainContentProcessor } from './TechnicalTermChainContentProcessor';
|
|
19
24
|
import { BitContentLevel, } from '../BitmarkPegParserTypes';
|
|
25
|
+
const textParser = new TextParser();
|
|
20
26
|
function propertyContentProcessor(context, contentDepth, bitType, textFormat, tagsConfig, content, target) {
|
|
21
27
|
const { value } = content;
|
|
22
28
|
let { key: tag } = content;
|
|
@@ -84,19 +90,23 @@ function propertyContentProcessor(context, contentDepth, bitType, textFormat, ta
|
|
|
84
90
|
return undefined;
|
|
85
91
|
if (c) {
|
|
86
92
|
switch (c.format) {
|
|
87
|
-
case PropertyFormat.string:
|
|
88
|
-
|
|
93
|
+
// case PropertyFormat.string:
|
|
94
|
+
// return StringUtils.isString(v) ? StringUtils.string(v) : undefined;
|
|
89
95
|
case PropertyFormat.trimmedString:
|
|
90
|
-
return StringUtils.isString(v) ? StringUtils.trimmedString(v) : undefined;
|
|
96
|
+
return Breakscape.unbreakscape(StringUtils.isString(v) ? StringUtils.trimmedString(v) : undefined);
|
|
91
97
|
case PropertyFormat.number:
|
|
92
|
-
return NumberUtils.asNumber(v);
|
|
98
|
+
return NumberUtils.asNumber(Breakscape.unbreakscape(v));
|
|
93
99
|
case PropertyFormat.boolean:
|
|
94
|
-
return BooleanUtils.toBoolean(v, true);
|
|
100
|
+
return BooleanUtils.toBoolean(Breakscape.unbreakscape(v), true);
|
|
95
101
|
case PropertyFormat.invertedBoolean:
|
|
96
|
-
return !BooleanUtils.toBoolean(v, true);
|
|
102
|
+
return !BooleanUtils.toBoolean(Breakscape.unbreakscape(v), true);
|
|
103
|
+
case PropertyFormat.bitmarkMinusMinus:
|
|
104
|
+
return textParser.toAst(v, { textFormat: TextFormat.bitmarkMinusMinus });
|
|
105
|
+
case PropertyFormat.bitmarkPlusPlus:
|
|
106
|
+
return textParser.toAst(v, { textFormat: TextFormat.bitmarkMinusMinus });
|
|
97
107
|
}
|
|
98
108
|
}
|
|
99
|
-
return v;
|
|
109
|
+
return Breakscape.unbreakscape(v);
|
|
100
110
|
};
|
|
101
111
|
// Convert property and key as needed
|
|
102
112
|
v = processValue(v);
|
|
@@ -123,6 +133,12 @@ function propertyContentProcessor(context, contentDepth, bitType, textFormat, ta
|
|
|
123
133
|
// Unknown (extra) property
|
|
124
134
|
addProperty(target.extraProperties, tag, value, propertyConfig);
|
|
125
135
|
}
|
|
136
|
+
// HACKS: Need to allow properties for different bits and in chains to have different/multiple formats!
|
|
137
|
+
// This is not currently supported by the config system; it would need to be extended to support this.
|
|
138
|
+
// That is a bit job, so instead there are just some hacks here for the few cases where it is currently needed :(
|
|
139
|
+
if (tag === PropertyTag.tag_sampleSolution) {
|
|
140
|
+
addProperty(target, '__sampleSolutionAst', value, new PropertyTagConfig(ConfigKey.sampleSolution, PropertyTag.tag_sampleSolution, 1, 1, undefined, undefined, undefined, true, PropertyFormat.bitmarkMinusMinus, undefined, undefined));
|
|
141
|
+
}
|
|
126
142
|
}
|
|
127
143
|
export { propertyContentProcessor };
|
|
128
144
|
//# sourceMappingURL=PropertyContentProcessor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"PropertyContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAEpF,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAkB,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,U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
|
|
2
1
|
import { PropertyTag } from '../../../../model/enum/PropertyTag';
|
|
3
2
|
import { NumberUtils } from '../../../../utils/NumberUtils';
|
|
3
|
+
import { TextParser } from '../../../text/TextParser';
|
|
4
4
|
import { BitContentLevel, } from '../BitmarkPegParserTypes';
|
|
5
|
-
const
|
|
5
|
+
const textParser = new TextParser();
|
|
6
6
|
function ratingLevelChainContentProcessor(context, _contentDepth, bitType, textFormat, tagsConfig, content, target) {
|
|
7
7
|
var _a;
|
|
8
8
|
const { key, value } = content;
|
|
@@ -14,10 +14,10 @@ function ratingLevelChainContentProcessor(context, _contentDepth, bitType, textF
|
|
|
14
14
|
const { label } = tags;
|
|
15
15
|
// Extract the technicalTerm from the content tag
|
|
16
16
|
const level = (_a = NumberUtils.asNumber(value)) !== null && _a !== void 0 ? _a : 0;
|
|
17
|
-
const node =
|
|
17
|
+
const node = {
|
|
18
18
|
level,
|
|
19
|
-
label,
|
|
20
|
-
}
|
|
19
|
+
label: label ? textParser.toAst(label) : undefined,
|
|
20
|
+
};
|
|
21
21
|
switch (key) {
|
|
22
22
|
case PropertyTag.ratingLevelStart:
|
|
23
23
|
target.ratingLevelStart = node;
|
package/dist/esm/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":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EA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
+
import { Breakscape } from '../../../../breakscaping/Breakscape';
|
|
1
2
|
import { StringUtils } from '../../../../utils/StringUtils';
|
|
2
3
|
function referenceTagContentProcessor(_context, _contentDepth, _bitType, _textFormat, _tagsConfig, content, target, isReferenceEnd) {
|
|
3
4
|
const { value } = content;
|
|
4
5
|
const trimmedStringValue = StringUtils.trimmedString(value);
|
|
5
6
|
if (isReferenceEnd) {
|
|
6
|
-
target.referenceEnd = trimmedStringValue;
|
|
7
|
+
target.referenceEnd = Breakscape.unbreakscape(trimmedStringValue);
|
|
7
8
|
}
|
|
8
9
|
else {
|
|
9
|
-
target.reference = trimmedStringValue;
|
|
10
|
+
target.reference = Breakscape.unbreakscape(trimmedStringValue);
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
export { referenceTagContentProcessor };
|
|
@@ -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":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAKjE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;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,WAAW,CAAC,aAAa,CAAC,KAAK,CAAsB,CAAC;IAEjF,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACpE,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,SAAS,GAAG,UAAU,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACjE,CAAC;AACH,CAAC;AACD,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
|
|
@@ -10,6 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { ResourceBuilder } from '../../../../ast/ResourceBuilder';
|
|
13
|
+
import { Breakscape } from '../../../../breakscaping/Breakscape';
|
|
13
14
|
import { Config } from '../../../../config/Config';
|
|
14
15
|
import { Count } from '../../../../model/enum/Count';
|
|
15
16
|
import { ResourceTag } from '../../../../model/enum/ResourceTag';
|
|
@@ -36,8 +37,8 @@ function buildResources(context, bitType, resourceTypeAttachment, resources) {
|
|
|
36
37
|
// Find the excess resources and ensure we have the minimum resources
|
|
37
38
|
if (resources) {
|
|
38
39
|
for (const r of resources.reverse()) {
|
|
39
|
-
let countMin = (_a = countsMin.get(r.
|
|
40
|
-
let countMax = (_b = countsMax.get(r.
|
|
40
|
+
let countMin = (_a = countsMin.get(r.__typeAlias)) !== null && _a !== void 0 ? _a : 0;
|
|
41
|
+
let countMax = (_b = countsMax.get(r.__typeAlias)) !== null && _b !== void 0 ? _b : 0;
|
|
41
42
|
// Decrement the minimum count and later ensure it is 0
|
|
42
43
|
countMin = Math.max(0, countMin - 1);
|
|
43
44
|
if (countMax === Count.infinity) {
|
|
@@ -52,8 +53,8 @@ function buildResources(context, bitType, resourceTypeAttachment, resources) {
|
|
|
52
53
|
excessResources.unshift(r);
|
|
53
54
|
}
|
|
54
55
|
// Set the new counts
|
|
55
|
-
countsMin.set(r.
|
|
56
|
-
countsMax.set(r.
|
|
56
|
+
countsMin.set(r.__typeAlias, countMin);
|
|
57
|
+
countsMax.set(r.__typeAlias, countMax);
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
// Raise a warning if the resource type is specified in the bit header, but no extra resource attachment is allowed
|
|
@@ -81,8 +82,13 @@ function resourceContentProcessor(context, _contentDepth, bitType, textFormat, t
|
|
|
81
82
|
// Parse the resource chain
|
|
82
83
|
const resourceConfig = Config.getTagConfigForTag(tagsConfig, type);
|
|
83
84
|
const _a = context.bitContentProcessor(BitContentLevel.Chain, bitType, textFormat, resourceConfig === null || resourceConfig === void 0 ? void 0 : resourceConfig.chain, chain), { posterImage } = _a, tags = __rest(_a, ["posterImage"]);
|
|
84
|
-
const
|
|
85
|
-
|
|
85
|
+
const posterImageResource = posterImage
|
|
86
|
+
? resourceBuilder.resource(bitType, {
|
|
87
|
+
type: ResourceTag.image,
|
|
88
|
+
value: posterImage,
|
|
89
|
+
}).image
|
|
90
|
+
: undefined;
|
|
91
|
+
const resource = resourceBuilder.resource(bitType, Object.assign({ type, value: Breakscape.unbreakscape(value), posterImage: posterImageResource }, tags));
|
|
86
92
|
if (resource)
|
|
87
93
|
resources.push(resource);
|
|
88
94
|
}
|
|
@@ -96,8 +102,13 @@ function propertyStyleResourceContentProcessor(context, _contentDepth, bitType,
|
|
|
96
102
|
// Parse the resource chain
|
|
97
103
|
const resourceConfig = Config.getTagConfigForTag(tagsConfig, type);
|
|
98
104
|
const _b = context.bitContentProcessor(BitContentLevel.Chain, bitType, textFormat, resourceConfig === null || resourceConfig === void 0 ? void 0 : resourceConfig.chain, chain), { posterImage } = _b, tags = __rest(_b, ["posterImage"]);
|
|
99
|
-
const
|
|
100
|
-
|
|
105
|
+
const posterImageResource = posterImage
|
|
106
|
+
? resourceBuilder.resource(bitType, {
|
|
107
|
+
type: ResourceTag.image,
|
|
108
|
+
value: posterImage,
|
|
109
|
+
}).image
|
|
110
|
+
: undefined;
|
|
111
|
+
const resource = resourceBuilder.resource(bitType, Object.assign({ type, value: Breakscape.unbreakscape(value), posterImage: posterImageResource }, tags));
|
|
101
112
|
if (resource)
|
|
102
113
|
target.propertyStyleResources[key] = resource;
|
|
103
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"ResourceContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAInD,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,WAAW,EAAmB,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAEL,eAAe,GAKhB,MAAM,0BAA0B,CAAC;AAElC,iCAAiC;AACjC,MAAM,eAAe,GAAG,IAAI,eAAe,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,WAAW,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;IAEtF,wCAAwC;IACxC,MAAM,eAAe,GAAG,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,+BAA+B,CAAC,CAAC;IAC/F,MAAM,yBAAyB,GAAG,eAAe,CAAC,yBAAyB,CAAC;IAC5E,MAAM,SAAS,GAAG,eAAe,CAAC,YAAY,EAAE,CAAC,CAAC,wCAAwC;IAC1F,MAAM,SAAS,GAAG,eAAe,CAAC,YAAY,EA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AI,EACP,CAAC;QACH,IAAI,QAAQ;YAAE,MAAM,CAAC,sBAAsB,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;IAC9D,CAAC;AACH,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,qCAAqC,EAAE,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { Builder } from '../../../../ast/Builder';
|
|
2
1
|
import { NumberUtils } from '../../../../utils/NumberUtils';
|
|
3
2
|
import { BitContentLevel, } from '../BitmarkPegParserTypes';
|
|
4
|
-
const builder = new Builder();
|
|
5
3
|
function servingsChainContentProcessor(context, _contentDepth, bitType, textFormat, tagsConfig, content, target) {
|
|
6
4
|
// const { value } = content as TypeValue;
|
|
7
5
|
var _a;
|
|
@@ -10,17 +8,17 @@ function servingsChainContentProcessor(context, _contentDepth, bitType, textForm
|
|
|
10
8
|
const tags = context.bitContentProcessor(BitContentLevel.Chain, bitType, textFormat, tagsConfig, content.chain);
|
|
11
9
|
if (context.DEBUG_CHAIN_TAGS)
|
|
12
10
|
context.debugPrint('servings TAGS', tags);
|
|
13
|
-
const { unit, unitAbbr, decimalPlaces, disableCalculation,
|
|
11
|
+
const { unit, unitAbbr, decimalPlaces, disableCalculation, __hintString } = tags;
|
|
14
12
|
// Extract the servings from the content tag
|
|
15
13
|
const servings = (_a = NumberUtils.asNumber(content.value)) !== null && _a !== void 0 ? _a : 1;
|
|
16
|
-
const node =
|
|
14
|
+
const node = {
|
|
17
15
|
servings,
|
|
18
16
|
unit,
|
|
19
17
|
unitAbbr,
|
|
20
18
|
decimalPlaces: decimalPlaces !== null && decimalPlaces !== void 0 ? decimalPlaces : 1,
|
|
21
19
|
disableCalculation,
|
|
22
|
-
hint,
|
|
23
|
-
}
|
|
20
|
+
hint: __hintString,
|
|
21
|
+
};
|
|
24
22
|
target.servings = node;
|
|
25
23
|
}
|
|
26
24
|
export { servingsChainContentProcessor };
|
|
@@ -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":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAEL,eAAe,GAIhB,MAAM,0BAA0B,CAAC;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,eAAe,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,WAAW,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;AAED,OAAO,EAAE,6BAA6B,EAAE,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Breakscape } from '../../../../breakscaping/Breakscape';
|
|
2
2
|
import { StringUtils } from '../../../../utils/StringUtils';
|
|
3
3
|
import { BitContentLevel, } from '../BitmarkPegParserTypes';
|
|
4
|
-
const builder = new Builder();
|
|
5
4
|
function technicalTermChainContentProcessor(context, _contentDepth, bitType, textFormat, tagsConfig, content, target) {
|
|
6
5
|
// const { value } = content as TypeValue;
|
|
7
6
|
if (context.DEBUG_CHAIN_CONTENT)
|
|
@@ -11,11 +10,11 @@ function technicalTermChainContentProcessor(context, _contentDepth, bitType, tex
|
|
|
11
10
|
context.debugPrint('technicalTerm TAGS', tags);
|
|
12
11
|
const { lang } = tags;
|
|
13
12
|
// Extract the technicalTerm from the content tag
|
|
14
|
-
const technicalTerm = StringUtils.trimmedString(content.value);
|
|
15
|
-
const node =
|
|
13
|
+
const technicalTerm = Breakscape.unbreakscape(StringUtils.trimmedString(content.value));
|
|
14
|
+
const node = {
|
|
16
15
|
technicalTerm,
|
|
17
16
|
lang,
|
|
18
|
-
}
|
|
17
|
+
};
|
|
19
18
|
target.technicalTerm = node;
|
|
20
19
|
}
|
|
21
20
|
export { technicalTermChainContentProcessor };
|
package/dist/esm/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":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"TechnicalTermChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAMjE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAEL,eAAe,GAIhB,MAAM,0BAA0B,CAAC;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,eAAe,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,UAAU,CAAC,YAAY,CAAC,WAAW,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;AAED,OAAO,EAAE,kCAAkC,EAAE,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Config } from '../../../../config/Config';
|
|
2
2
|
import { BitType } from '../../../../model/enum/BitType';
|
|
3
3
|
import { StringUtils } from '../../../../utils/StringUtils';
|
|
4
|
+
import { TextParser } from '../../../text/TextParser';
|
|
5
|
+
const textParser = new TextParser();
|
|
4
6
|
function titleTagContentProcessor(_context, _contentDepth, _bitType, _textFormat, _tagsConfig, content, target) {
|
|
5
7
|
const { value } = content;
|
|
6
8
|
const title = target.title;
|
|
@@ -11,24 +13,31 @@ function titleTagContentProcessor(_context, _contentDepth, _bitType, _textFormat
|
|
|
11
13
|
const titleValue = value;
|
|
12
14
|
const titleText = StringUtils.trimmedString(titleValue.title);
|
|
13
15
|
const level = titleValue.level.length;
|
|
14
|
-
title[level] =
|
|
16
|
+
title[level] = {
|
|
17
|
+
//
|
|
18
|
+
titleAst: textParser.toAst(titleText !== null && titleText !== void 0 ? titleText : ''),
|
|
19
|
+
titleString: titleText !== null && titleText !== void 0 ? titleText : '',
|
|
20
|
+
};
|
|
15
21
|
}
|
|
16
22
|
function buildTitles(_context, bitType, title) {
|
|
17
|
-
var _a, _b;
|
|
23
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
18
24
|
title = title !== null && title !== void 0 ? title : [];
|
|
19
25
|
if (Config.isOfBitType(bitType, BitType.chapter)) {
|
|
20
26
|
let t;
|
|
21
27
|
if (title.length > 0)
|
|
22
28
|
t = title[title.length - 1];
|
|
23
29
|
return {
|
|
24
|
-
title: t,
|
|
30
|
+
title: (_a = t === null || t === void 0 ? void 0 : t.titleAst) !== null && _a !== void 0 ? _a : [],
|
|
31
|
+
titleString: (_b = t === null || t === void 0 ? void 0 : t.titleString) !== null && _b !== void 0 ? _b : '',
|
|
25
32
|
level: title.length > 0 ? title.length - 1 : undefined,
|
|
26
33
|
};
|
|
27
34
|
}
|
|
28
35
|
else {
|
|
29
36
|
return {
|
|
30
|
-
title: (
|
|
31
|
-
|
|
37
|
+
title: (_d = (_c = title[1]) === null || _c === void 0 ? void 0 : _c.titleAst) !== null && _d !== void 0 ? _d : undefined,
|
|
38
|
+
titleString: (_f = (_e = title[1]) === null || _e === void 0 ? void 0 : _e.titleString) !== null && _f !== void 0 ? _f : undefined,
|
|
39
|
+
subtitle: (_h = (_g = title[2]) === null || _g === void 0 ? void 0 : _g.titleAst) !== null && _h !== void 0 ? _h : undefined,
|
|
40
|
+
subtitleString: (_k = (_j = title[2]) === null || _j === void 0 ? void 0 : _j.titleString) !== null && _k !== void 0 ? _k : undefined,
|
|
32
41
|
};
|
|
33
42
|
}
|
|
34
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleTagContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"TitleTagContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAInD,OAAO,EAAE,OAAO,EAAe,MAAM,gCAAgC,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAWtD,MAAM,UAAU,GAAG,IAAI,UAAU,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,WAAW,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,CAAsB,CAAC;IACnF,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC;IACtC,KAAK,CAAC,KAAK,CAAC,GAAG;QACb,EAAE;QACF,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAC;QA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(s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { Builder } from '../../../../ast/Builder';
|
|
13
12
|
import { Config } from '../../../../config/Config';
|
|
14
13
|
import { BitType } from '../../../../model/enum/BitType';
|
|
14
|
+
import { BodyBitType } from '../../../../model/enum/BodyBitType';
|
|
15
15
|
import { trueFalseTagContentProcessor } from './TrueFalseTagContentProcessor';
|
|
16
16
|
import { BitContentLevel, TypeKey, } from '../BitmarkPegParserTypes';
|
|
17
|
-
const builder = new Builder();
|
|
18
17
|
function trueFalseChainContentProcessor(context, contentDepth, bitType, textFormat, tagsConfig, content, target, bodyParts) {
|
|
19
18
|
if (contentDepth === BitContentLevel.Chain) {
|
|
20
19
|
trueFalseTagContentProcessor(context, BitContentLevel.Chain, bitType, textFormat, content, target);
|
|
@@ -81,8 +80,15 @@ function buildStatement(context, bitType, textFormat, tagsConfig, trueFalseConte
|
|
|
81
80
|
if (context.DEBUG_CHAIN_TAGS)
|
|
82
81
|
context.debugPrint('trueFalse V1 tags (statement)', tags);
|
|
83
82
|
let statement;
|
|
83
|
+
let firstTrueFalse;
|
|
84
84
|
if (trueFalse && trueFalse.length > 0) {
|
|
85
|
-
|
|
85
|
+
firstTrueFalse = trueFalse[0];
|
|
86
|
+
}
|
|
87
|
+
if (firstTrueFalse) {
|
|
88
|
+
// Have to remove the statement JSON tag to keep typescript happy
|
|
89
|
+
const { statement: _ignore } = tags, tagsRest = __rest(tags, ["statement"]);
|
|
90
|
+
_ignore;
|
|
91
|
+
statement = Object.assign(Object.assign(Object.assign({}, firstTrueFalse), { statement: firstTrueFalse.text }), tagsRest);
|
|
86
92
|
}
|
|
87
93
|
return statement;
|
|
88
94
|
}
|
|
@@ -112,22 +118,28 @@ function buildStatementsChoicesResponses(context, bitType, textFormat, tagsConfi
|
|
|
112
118
|
const _a = context.bitContentProcessor(BitContentLevel.Chain, bitType, textFormat, tagsConfig, contents), { trueFalse } = _a, tags = __rest(_a, ["trueFalse"]);
|
|
113
119
|
if (context.DEBUG_CHAIN_TAGS)
|
|
114
120
|
context.debugPrint('trueFalse V1 tags (choices/responses)', tags);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
statements.push(statement);
|
|
119
|
-
}
|
|
121
|
+
let firstTrueFalse;
|
|
122
|
+
if (trueFalse && trueFalse.length > 0) {
|
|
123
|
+
firstTrueFalse = trueFalse[0];
|
|
120
124
|
}
|
|
121
|
-
|
|
122
|
-
if (
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
if (firstTrueFalse) {
|
|
126
|
+
if (insertStatements) {
|
|
127
|
+
// Have to remove the statement JSON tag to keep typescript happy
|
|
128
|
+
const { statement: _ignore } = tags, tagsRest = __rest(tags, ["statement"]);
|
|
129
|
+
_ignore;
|
|
130
|
+
const statement = Object.assign(Object.assign(Object.assign({}, firstTrueFalse), { statement: firstTrueFalse.text }), tagsRest);
|
|
131
|
+
if (statement)
|
|
132
|
+
statements.push(statement);
|
|
125
133
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
134
|
+
else if (insertChoices) {
|
|
135
|
+
const choice = Object.assign(Object.assign(Object.assign({}, firstTrueFalse), { choice: firstTrueFalse.text }), tags);
|
|
136
|
+
if (choice)
|
|
137
|
+
choices.push(choice);
|
|
138
|
+
}
|
|
139
|
+
else if (insertResponses) {
|
|
140
|
+
const response = Object.assign(Object.assign(Object.assign({}, firstTrueFalse), { response: firstTrueFalse.text }), tags);
|
|
141
|
+
if (response)
|
|
142
|
+
responses.push(response);
|
|
131
143
|
}
|
|
132
144
|
}
|
|
133
145
|
}
|
|
@@ -152,10 +164,12 @@ function buildHighlight(context, bitType, textFormat, tagsConfig, highlightConte
|
|
|
152
164
|
const texts = [];
|
|
153
165
|
if (trueFalse) {
|
|
154
166
|
for (const tf of trueFalse) {
|
|
155
|
-
|
|
167
|
+
const ht = Object.assign(Object.assign({}, tf), { isHighlighted: false });
|
|
168
|
+
if (ht)
|
|
169
|
+
texts.push(ht);
|
|
156
170
|
}
|
|
157
171
|
}
|
|
158
|
-
const highlight =
|
|
172
|
+
const highlight = Object.assign({ type: BodyBitType.highlight, texts: texts }, tags);
|
|
159
173
|
return highlight;
|
|
160
174
|
}
|
|
161
175
|
function buildSelect(context, bitType, textFormat, tagsConfig, selectContent) {
|
|
@@ -167,10 +181,12 @@ function buildSelect(context, bitType, textFormat, tagsConfig, selectContent) {
|
|
|
167
181
|
const options = [];
|
|
168
182
|
if (trueFalse) {
|
|
169
183
|
for (const tf of trueFalse) {
|
|
170
|
-
|
|
184
|
+
const so = tf;
|
|
185
|
+
if (so)
|
|
186
|
+
options.push(so);
|
|
171
187
|
}
|
|
172
188
|
}
|
|
173
|
-
const select =
|
|
189
|
+
const select = Object.assign({ type: BodyBitType.select, options: options }, tags);
|
|
174
190
|
return select;
|
|
175
191
|
}
|
|
176
192
|
export { trueFalseChainContentProcessor };
|