@gmb/bitmark-parser-generator 3.26.0 → 3.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/browser/bitmark-parser-generator.min.js +1 -1
- package/dist/browser/bundle-report.html +2 -2
- package/dist/cjs/BitmarkParserGenerator.js +9 -5
- package/dist/cjs/BitmarkParserGenerator.js.map +1 -1
- package/dist/cjs/ast/BaseBuilder.js +8 -8
- package/dist/cjs/ast/BaseBuilder.js.map +1 -1
- package/dist/cjs/ast/Builder.js +51 -48
- package/dist/cjs/ast/Builder.js.map +1 -1
- package/dist/cjs/ast/ResourceBuilder.js +19 -18
- package/dist/cjs/ast/ResourceBuilder.js.map +1 -1
- package/dist/cjs/breakscaping/Breakscape.js +59 -72
- package/dist/cjs/breakscaping/Breakscape.js.map +1 -1
- package/dist/cjs/config/Config.js +1 -1
- package/dist/cjs/config/Config.js.map +1 -1
- package/dist/cjs/config/raw/bits.js +26 -9
- package/dist/cjs/config/raw/bits.js.map +1 -1
- package/dist/cjs/config/raw/groups.js +5 -0
- package/dist/cjs/config/raw/groups.js.map +1 -1
- package/dist/cjs/config/raw/properties.js +145 -141
- package/dist/cjs/config/raw/properties.js.map +1 -1
- package/dist/cjs/generated/build-info.js +1 -1
- package/dist/cjs/generator/bitmark/BitmarkGenerator.js +116 -128
- package/dist/cjs/generator/bitmark/BitmarkGenerator.js.map +1 -1
- package/dist/cjs/generator/json/JsonGenerator.js +15 -10
- package/dist/cjs/generator/json/JsonGenerator.js.map +1 -1
- package/dist/cjs/generator/text/TextGenerator.js +14 -14
- package/dist/cjs/generator/text/TextGenerator.js.map +1 -1
- package/dist/cjs/model/ast/NodeType.js +2 -0
- 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 +3 -0
- package/dist/cjs/model/enum/BitType.js.map +1 -1
- package/dist/cjs/model/enum/DeprecatedTextFormat.js +10 -0
- package/dist/cjs/model/enum/DeprecatedTextFormat.js.map +1 -0
- package/dist/cjs/model/enum/PropertyFormat.js +2 -4
- package/dist/cjs/model/enum/PropertyFormat.js.map +1 -1
- package/dist/cjs/model/enum/TextFormat.js +4 -15
- package/dist/cjs/model/enum/TextFormat.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js +2 -2
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js +10 -8
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +4 -4
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +2 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +8 -8
- package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +3 -3
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +4 -4
- package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +2 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +10 -16
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +2 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +2 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +2 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +2 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/json/JsonParser.js +5 -3
- package/dist/cjs/parser/json/JsonParser.js.map +1 -1
- package/dist/cjs/parser/text/TextParser.js +4 -4
- package/dist/cjs/parser/text/TextParser.js.map +1 -1
- package/dist/cjs/utils/BitUtils.js +2 -1
- package/dist/cjs/utils/BitUtils.js.map +1 -1
- package/dist/esm/BitmarkParserGenerator.js +9 -5
- package/dist/esm/BitmarkParserGenerator.js.map +1 -1
- package/dist/esm/ast/BaseBuilder.js +8 -8
- package/dist/esm/ast/BaseBuilder.js.map +1 -1
- package/dist/esm/ast/Builder.js +51 -48
- package/dist/esm/ast/Builder.js.map +1 -1
- package/dist/esm/ast/ResourceBuilder.js +19 -18
- package/dist/esm/ast/ResourceBuilder.js.map +1 -1
- package/dist/esm/breakscaping/Breakscape.js +59 -72
- package/dist/esm/breakscaping/Breakscape.js.map +1 -1
- package/dist/esm/config/Config.js +1 -1
- package/dist/esm/config/Config.js.map +1 -1
- package/dist/esm/config/raw/bits.js +26 -9
- package/dist/esm/config/raw/bits.js.map +1 -1
- package/dist/esm/config/raw/groups.js +5 -0
- package/dist/esm/config/raw/groups.js.map +1 -1
- package/dist/esm/config/raw/properties.js +145 -141
- package/dist/esm/config/raw/properties.js.map +1 -1
- package/dist/esm/generated/build-info.js +1 -1
- package/dist/esm/generator/bitmark/BitmarkGenerator.js +116 -128
- package/dist/esm/generator/bitmark/BitmarkGenerator.js.map +1 -1
- package/dist/esm/generator/json/JsonGenerator.js +15 -10
- package/dist/esm/generator/json/JsonGenerator.js.map +1 -1
- package/dist/esm/generator/text/TextGenerator.js +14 -14
- package/dist/esm/generator/text/TextGenerator.js.map +1 -1
- package/dist/esm/model/ast/NodeType.js +2 -0
- 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 +3 -0
- package/dist/esm/model/enum/BitType.js.map +1 -1
- package/dist/esm/model/enum/DeprecatedTextFormat.js +7 -0
- package/dist/esm/model/enum/DeprecatedTextFormat.js.map +1 -0
- package/dist/esm/model/enum/PropertyFormat.js +2 -4
- package/dist/esm/model/enum/PropertyFormat.js.map +1 -1
- package/dist/esm/model/enum/TextFormat.js +4 -15
- package/dist/esm/model/enum/TextFormat.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js +2 -2
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js +10 -8
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +4 -4
- package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +2 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +8 -8
- package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +3 -3
- package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +4 -4
- package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +2 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +10 -16
- package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +2 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +2 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +2 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +2 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/json/JsonParser.js +5 -3
- package/dist/esm/parser/json/JsonParser.js.map +1 -1
- package/dist/esm/parser/text/TextParser.js +4 -4
- package/dist/esm/parser/text/TextParser.js.map +1 -1
- package/dist/esm/utils/BitUtils.js +2 -1
- package/dist/esm/utils/BitUtils.js.map +1 -1
- package/dist/types/BitmarkParserGenerator.d.ts +5 -1
- package/dist/types/BitmarkParserGenerator.d.ts.map +1 -1
- package/dist/types/ast/BaseBuilder.d.ts +5 -3
- package/dist/types/ast/BaseBuilder.d.ts.map +1 -1
- package/dist/types/ast/Builder.d.ts +1 -0
- package/dist/types/ast/Builder.d.ts.map +1 -1
- package/dist/types/ast/ResourceBuilder.d.ts.map +1 -1
- package/dist/types/breakscaping/Breakscape.d.ts +2 -2
- 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/groups.d.ts.map +1 -1
- package/dist/types/config/raw/properties.d.ts.map +1 -1
- package/dist/types/generator/bitmark/BitmarkGenerator.d.ts +0 -1
- package/dist/types/generator/bitmark/BitmarkGenerator.d.ts.map +1 -1
- package/dist/types/generator/json/JsonGenerator.d.ts +2 -2
- package/dist/types/generator/json/JsonGenerator.d.ts.map +1 -1
- package/dist/types/generator/text/TextGenerator.d.ts.map +1 -1
- package/dist/types/model/ast/NodeType.d.ts +4 -0
- package/dist/types/model/ast/NodeType.d.ts.map +1 -1
- package/dist/types/model/ast/Nodes.d.ts +1 -0
- 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 +6 -0
- package/dist/types/model/enum/BitType.d.ts.map +1 -1
- package/dist/types/model/enum/DeprecatedTextFormat.d.ts +11 -0
- package/dist/types/model/enum/DeprecatedTextFormat.d.ts.map +1 -0
- package/dist/types/model/enum/PropertyFormat.d.ts +4 -6
- 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/enum/TextFormat.d.ts +4 -6
- package/dist/types/model/enum/TextFormat.d.ts.map +1 -1
- package/dist/types/model/json/BitJson.d.ts +1 -0
- package/dist/types/model/json/BitJson.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.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/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/TitleTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/json/JsonParser.d.ts.map +1 -1
- package/dist/types/parser/text/TextParser.d.ts +2 -1
- package/dist/types/parser/text/TextParser.d.ts.map +1 -1
- package/dist/types/utils/BitUtils.d.ts.map +1 -1
- package/package.json +25 -21
package/dist/esm/ast/Builder.js
CHANGED
|
@@ -4,6 +4,7 @@ import { Config } from '../config/Config';
|
|
|
4
4
|
import { PropertyConfigKey } from '../model/config/enum/PropertyConfigKey';
|
|
5
5
|
import { BitType } from '../model/enum/BitType';
|
|
6
6
|
import { BodyBitType } from '../model/enum/BodyBitType';
|
|
7
|
+
import { DeprecatedTextFormat } from '../model/enum/DeprecatedTextFormat';
|
|
7
8
|
import { ResourceTag } from '../model/enum/ResourceTag';
|
|
8
9
|
import { TextFormat } from '../model/enum/TextFormat';
|
|
9
10
|
import { TextLocation } from '../model/enum/TextLocation';
|
|
@@ -51,10 +52,12 @@ class Builder extends BaseBuilder {
|
|
|
51
52
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
52
53
|
const bitConfig = Config.getBitConfig(data.bitType);
|
|
53
54
|
const bitType = data.bitType;
|
|
55
|
+
// Text Format (accepts deprecated values, and converts them to the new format)
|
|
56
|
+
const deprecatedTextFormat = DeprecatedTextFormat.fromValue(data.textFormat);
|
|
54
57
|
let textFormat = (_a = TextFormat.fromValue(data.textFormat)) !== null && _a !== void 0 ? _a : bitConfig.textFormatDefault;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
textFormat = TextFormat.
|
|
58
|
+
if (deprecatedTextFormat === DeprecatedTextFormat.bitmarkMinusMinus ||
|
|
59
|
+
deprecatedTextFormat === DeprecatedTextFormat.bitmarkPlusPlus) {
|
|
60
|
+
textFormat = TextFormat.bitmarkText;
|
|
58
61
|
}
|
|
59
62
|
const context = {
|
|
60
63
|
bitConfig,
|
|
@@ -73,11 +76,11 @@ class Builder extends BaseBuilder {
|
|
|
73
76
|
// NOTE: Node order is important and is defined here
|
|
74
77
|
const node = Object.assign(Object.assign({ bitType, bitLevel: data.bitLevel, textFormat, resourceType: ResourceTag.fromValue(data.resourceType), isCommented: data.isCommented,
|
|
75
78
|
// Properties
|
|
76
|
-
id: this.toAstProperty(PropertyConfigKey.id, data.id), internalComment: this.toAstProperty(PropertyConfigKey.internalComment, data.internalComment), customerId: this.toAstProperty(PropertyConfigKey.customerId, data.customerId), customerExternalId: this.toAstProperty(PropertyConfigKey.customerExternalId, data.customerExternalId), externalId: this.toAstProperty(PropertyConfigKey.externalId, data.externalId), spaceId: this.toAstProperty(PropertyConfigKey.spaceId, data.spaceId), padletId: this.toAstProperty(PropertyConfigKey.padletId, data.padletId), jupyterId: this.toAstProperty(PropertyConfigKey.jupyterId, data.jupyterId), jupyterExecutionCount: this.toAstProperty(PropertyConfigKey.jupyterExecutionCount, data.jupyterExecutionCount), isPublic: this.toAstProperty(PropertyConfigKey.isPublic, data.isPublic), aiGenerated: this.toAstProperty(PropertyConfigKey.aiGenerated, data.aiGenerated), machineTranslated: this.toAstProperty(PropertyConfigKey.machineTranslated, data.machineTranslated), searchIndex: this.toAstProperty(PropertyConfigKey.searchIndex, data.searchIndex), analyticsTag: this.toAstProperty(PropertyConfigKey.analyticsTag, data.analyticsTag), categoryTag: this.toAstProperty(PropertyConfigKey.categoryTag, data.categoryTag), topicTag: this.toAstProperty(PropertyConfigKey.topicTag, data.topicTag), altLangTag: this.toAstProperty(PropertyConfigKey.altLangTag, data.altLangTag), feedbackEngine: this.toAstProperty(PropertyConfigKey.feedbackEngine, data.feedbackEngine), feedbackType: this.toAstProperty(PropertyConfigKey.feedbackType, data.feedbackType), disableFeedback: this.toAstProperty(PropertyConfigKey.disableFeedback, data.disableFeedback), diffTo: this.toAstProperty(PropertyConfigKey.diffTo, data.diffTo), diffOp: this.toAstProperty(PropertyConfigKey.diffOp, data.diffOp), diffRef: this.toAstProperty(PropertyConfigKey.diffRef, data.diffRef), diffContext: this.toAstProperty(PropertyConfigKey.diffContext, data.diffContext), diffTime: this.toAstProperty(PropertyConfigKey.diffTime, data.diffTime), path: this.toAstProperty(PropertyConfigKey.path, data.path), releaseVersion: this.toAstProperty(PropertyConfigKey.releaseVersion, data.releaseVersion), releaseKind: this.toAstProperty(PropertyConfigKey.releaseKind, data.releaseKind), releaseDate: this.toAstProperty(PropertyConfigKey.releaseDate, data.releaseDate), book: this.buildBooks(context, data.book), ageRange: this.toAstProperty(PropertyConfigKey.ageRange, data.ageRange), lang: this.toAstProperty(PropertyConfigKey.lang, data.lang), language: this.toAstProperty(PropertyConfigKey.language, data.language), publisher: this.toAstProperty(PropertyConfigKey.publisher, data.publisher), publisherName: this.toAstProperty(PropertyConfigKey.publisherName, data.publisherName), theme: this.toAstProperty(PropertyConfigKey.theme, data.theme), computerLanguage: this.toAstProperty(PropertyConfigKey.computerLanguage, data.computerLanguage), target: this.toAstProperty(PropertyConfigKey.target, data.target), slug: this.toAstProperty(PropertyConfigKey.slug, data.slug), tag: this.toAstProperty(PropertyConfigKey.tag, data.tag), reductionTag: this.toAstProperty(PropertyConfigKey.reductionTag, data.reductionTag), bubbleTag: this.toAstProperty(PropertyConfigKey.bubbleTag, data.bubbleTag), levelCEFRp: this.toAstProperty(PropertyConfigKey.levelCEFRp, data.levelCEFRp), levelCEFR: this.toAstProperty(PropertyConfigKey.levelCEFR, data.levelCEFR), levelILR: this.toAstProperty(PropertyConfigKey.levelILR, data.levelILR), levelACTFL: this.toAstProperty(PropertyConfigKey.levelACTFL, data.levelACTFL), icon: this.toAstProperty(PropertyConfigKey.icon, data.icon), iconTag: this.toAstProperty(PropertyConfigKey.iconTag, data.iconTag), colorTag: this.toAstProperty(PropertyConfigKey.colorTag, data.colorTag), flashcardSet: this.toAstProperty(PropertyConfigKey.flashcardSet, data.flashcardSet), subtype: this.toAstProperty(PropertyConfigKey.subtype, data.subtype), bookAlias: this.toAstProperty(PropertyConfigKey.bookAlias, data.bookAlias), bookDiff: this.toAstProperty(PropertyConfigKey.bookDiff, data.bookDiff), coverImage: this.toAstProperty(PropertyConfigKey.coverImage, data.coverImage), coverColor: this.toAstProperty(PropertyConfigKey.coverColor, data.coverColor), publications: this.toAstProperty(PropertyConfigKey.publications, data.publications), author: this.toAstProperty(PropertyConfigKey.author, data.author), subject: this.toAstProperty(PropertyConfigKey.subject, data.subject), date: this.toAstProperty(PropertyConfigKey.date, data.date), dateEnd: this.toAstProperty(PropertyConfigKey.dateEnd, data.dateEnd), location: this.toAstProperty(PropertyConfigKey.location, data.location), kind: this.toAstProperty(PropertyConfigKey.kind, data.kind), hasMarkAsDone: this.toAstProperty(PropertyConfigKey.hasMarkAsDone, data.hasMarkAsDone), processHandIn: this.toAstProperty(PropertyConfigKey.processHandIn, data.processHandIn), chatWithBook: this.toAstProperty(PropertyConfigKey.chatWithBook, data.chatWithBook), chatWithBookBrainKey: this.toAstProperty(PropertyConfigKey.chatWithBookBrainKey, data.chatWithBookBrainKey), action: this.toAstProperty(PropertyConfigKey.action, data.action), showInIndex: this.toAstProperty(PropertyConfigKey.showInIndex, data.showInIndex), refAuthor: this.toAstProperty(PropertyConfigKey.refAuthor, data.refAuthor), refBookTitle: this.toAstProperty(PropertyConfigKey.refBookTitle, data.refBookTitle), refPublisher: this.toAstProperty(PropertyConfigKey.refPublisher, data.refPublisher), refPublicationYear: this.toAstProperty(PropertyConfigKey.refPublicationYear, data.refPublicationYear), citationStyle: this.toAstProperty(PropertyConfigKey.citationStyle, data.citationStyle), blockId: this.toAstProperty(PropertyConfigKey.blockId, data.blockId), pageNo: this.toAstProperty(PropertyConfigKey.pageNo, data.pageNo), x: this.toAstProperty(PropertyConfigKey.x, data.x), y: this.toAstProperty(PropertyConfigKey.y, data.y), width: this.toAstProperty(PropertyConfigKey.width, data.width), height: this.toAstProperty(PropertyConfigKey.height, data.height), index: this.toAstProperty(PropertyConfigKey.index, data.index), classification: this.toAstProperty(PropertyConfigKey.classification, data.classification), availableClassifications: this.toAstProperty(PropertyConfigKey.availableClassifications, data.availableClassifications), allowedBit: this.toAstProperty(PropertyConfigKey.allowedBit, data.allowedBit), tableFixedHeader: this.toAstProperty(PropertyConfigKey.tableFixedHeader, data.tableFixedHeader), tableSearch: this.toAstProperty(PropertyConfigKey.tableSearch, data.tableSearch), tableSort: this.toAstProperty(PropertyConfigKey.tableSort, data.tableSort), tablePagination: this.toAstProperty(PropertyConfigKey.tablePagination, data.tablePagination), tablePaginationLimit: this.toAstProperty(PropertyConfigKey.tablePaginationLimit, data.tablePaginationLimit), tableHeight: this.toAstProperty(PropertyConfigKey.tableHeight, data.tableHeight), tableWhitespaceNoWrap: this.toAstProperty(PropertyConfigKey.tableWhitespaceNoWrap, data.tableWhitespaceNoWrap), tableAutoWidth: this.toAstProperty(PropertyConfigKey.tableAutoWidth, data.tableAutoWidth), tableResizableColumns: this.toAstProperty(PropertyConfigKey.tableResizableColumns, data.tableResizableColumns), tableColumnMinWidth: this.toAstProperty(PropertyConfigKey.tableColumnMinWidth, data.tableColumnMinWidth), quizCountItems: this.toAstProperty(PropertyConfigKey.quizCountItems, data.quizCountItems), quizStrikethroughSolutions: this.toAstProperty(PropertyConfigKey.quizStrikethroughSolutions, data.quizStrikethroughSolutions), codeLineNumbers: this.toAstProperty(PropertyConfigKey.codeLineNumbers, data.codeLineNumbers), codeMinimap: this.toAstProperty(PropertyConfigKey.codeMinimap, data.codeMinimap), stripePricingTableId: this.toAstProperty(PropertyConfigKey.stripePricingTableId, data.stripePricingTableId), stripePublishableKey: this.toAstProperty(PropertyConfigKey.stripePublishableKey, data.stripePublishableKey), thumbImage: this.toAstProperty(PropertyConfigKey.thumbImage, data.thumbImage), scormSource: this.toAstProperty(PropertyConfigKey.scormSource, data.scormSource), posterImage: this.toAstProperty(PropertyConfigKey.posterImage, data.posterImage), focusX: this.toAstProperty(PropertyConfigKey.focusX, data.focusX), focusY: this.toAstProperty(PropertyConfigKey.focusY, data.focusY), pointerLeft: this.toAstProperty(PropertyConfigKey.pointerLeft, data.pointerLeft), pointerTop: this.toAstProperty(PropertyConfigKey.pointerTop, data.pointerTop), listItemIndent: this.toAstProperty(PropertyConfigKey.listItemIndent, data.listItemIndent), backgroundWallpaper: this.toAstProperty(PropertyConfigKey.backgroundWallpaper, data.backgroundWallpaper), hasBookNavigation: this.toAstProperty(PropertyConfigKey.hasBookNavigation, data.hasBookNavigation), duration: this.toAstProperty(PropertyConfigKey.duration, data.duration), deeplink: this.toAstProperty(PropertyConfigKey.deeplink, data.deeplink), externalLink: this.toAstProperty(PropertyConfigKey.externalLink, data.externalLink), externalLinkText: this.toAstProperty(PropertyConfigKey.externalLinkText, data.externalLinkText), videoCallLink: this.toAstProperty(PropertyConfigKey.videoCallLink, data.videoCallLink), vendorDashboardId: this.toAstProperty(PropertyConfigKey.vendorDashboardId, data.vendorDashboardId), vendorSurveyId: this.toAstProperty(PropertyConfigKey.vendorSurveyId, data.vendorSurveyId), vendorUrl: this.toAstProperty(PropertyConfigKey.vendorUrl, data.vendorUrl), search: this.toAstProperty(PropertyConfigKey.search, data.search), list: this.toAstProperty(PropertyConfigKey.list, data.list), layer: this.toAstProperty(PropertyConfigKey.layer, data.layer), textReference: this.toAstProperty(PropertyConfigKey.textReference, data.textReference), isTracked: this.toAstProperty(PropertyConfigKey.isTracked, data.isTracked), isInfoOnly: this.toAstProperty(PropertyConfigKey.isInfoOnly, data.isInfoOnly), imageFirst: this.toAstProperty(PropertyConfigKey.imageFirst, data.imageFirst), activityType: this.toAstProperty(PropertyConfigKey.activityType, data.activityType), labelTrue: this.toAstProperty(PropertyConfigKey.labelTrue, data.labelTrue), labelFalse: this.toAstProperty(PropertyConfigKey.labelFalse, data.labelFalse), content2Buy: this.toAstProperty(PropertyConfigKey.content2Buy, data.content2Buy), mailingList: this.toAstProperty(PropertyConfigKey.mailingList, data.mailingList), buttonCaption: this.toAstProperty(PropertyConfigKey.buttonCaption, data.buttonCaption), callToActionUrl: this.toAstProperty(PropertyConfigKey.callToActionUrl, data.callToActionUrl), caption: this.handleJsonText(context, true, data.caption), quotedPerson: this.toAstProperty(PropertyConfigKey.quotedPerson, data.quotedPerson), reasonableNumOfChars: reasonableNumOfCharsProperty, resolved: this.toAstProperty(PropertyConfigKey.resolved, data.resolved), resolvedDate: this.toAstProperty(PropertyConfigKey.resolvedDate, data.resolvedDate), resolvedBy: this.toAstProperty(PropertyConfigKey.resolvedBy, data.resolvedBy), handInAcceptFileType: this.toAstProperty(PropertyConfigKey.handInAcceptFileType, data.handInAcceptFileType), handInRequirement: this.toAstProperty(PropertyConfigKey.handInRequirement, data.handInRequirement), handInInstruction: this.toAstProperty(PropertyConfigKey.handInInstruction, data.handInInstruction), maxCreatedBits: this.toAstProperty(PropertyConfigKey.maxCreatedBits, data.maxCreatedBits), maxDisplayLevel: this.toAstProperty(PropertyConfigKey.maxDisplayLevel, data.maxDisplayLevel), maxTocChapterLevel: this.toAstProperty(PropertyConfigKey.maxTocChapterLevel, data.maxTocChapterLevel), page: this.toAstProperty(PropertyConfigKey.page, data.page), productId: this.toAstProperty(PropertyConfigKey.productId, data.productId), product: this.toAstProperty(PropertyConfigKey.product, data.product), productList: this.toAstProperty(PropertyConfigKey.productList, data.productList), productVideo: this.toAstProperty(PropertyConfigKey.productVideo, data.productVideo), productVideoList: this.toAstProperty(PropertyConfigKey.productVideoList, data.productVideoList), productFolder: this.toAstProperty(PropertyConfigKey.productFolder, data.productFolder), technicalTerm: this.buildTechnicalTerm(context, data.technicalTerm), servings: this.buildServings(context, data.servings), ratingLevelStart: this.buildRatingLevelStartEnd(context, data.ratingLevelStart), ratingLevelEnd: this.buildRatingLevelStartEnd(context, data.ratingLevelEnd), ratingLevelSelected: this.toAstProperty(PropertyConfigKey.ratingLevelSelected, data.ratingLevelSelected), markConfig: this.buildMarkConfigs(context, data.markConfig), imageSource: this.buildImageSource(context, data.imageSource), person: this.buildPerson(context, data.person), bot: this.toAstProperty(PropertyConfigKey.bot, data.bot), referenceProperty: this.toAstProperty(PropertyConfigKey.property_reference, data.referenceProperty),
|
|
79
|
+
id: this.toAstProperty(PropertyConfigKey.id, data.id), internalComment: this.toAstProperty(PropertyConfigKey.internalComment, data.internalComment), customerId: this.toAstProperty(PropertyConfigKey.customerId, data.customerId), customerExternalId: this.toAstProperty(PropertyConfigKey.customerExternalId, data.customerExternalId), externalId: this.toAstProperty(PropertyConfigKey.externalId, data.externalId), spaceId: this.toAstProperty(PropertyConfigKey.spaceId, data.spaceId), padletId: this.toAstProperty(PropertyConfigKey.padletId, data.padletId), jupyterId: this.toAstProperty(PropertyConfigKey.jupyterId, data.jupyterId), jupyterExecutionCount: this.toAstProperty(PropertyConfigKey.jupyterExecutionCount, data.jupyterExecutionCount), isPublic: this.toAstProperty(PropertyConfigKey.isPublic, data.isPublic), aiGenerated: this.toAstProperty(PropertyConfigKey.aiGenerated, data.aiGenerated), machineTranslated: this.toAstProperty(PropertyConfigKey.machineTranslated, data.machineTranslated), searchIndex: this.toAstProperty(PropertyConfigKey.searchIndex, data.searchIndex), analyticsTag: this.toAstProperty(PropertyConfigKey.analyticsTag, data.analyticsTag), categoryTag: this.toAstProperty(PropertyConfigKey.categoryTag, data.categoryTag), topicTag: this.toAstProperty(PropertyConfigKey.topicTag, data.topicTag), altLangTag: this.toAstProperty(PropertyConfigKey.altLangTag, data.altLangTag), feedbackEngine: this.toAstProperty(PropertyConfigKey.feedbackEngine, data.feedbackEngine), feedbackType: this.toAstProperty(PropertyConfigKey.feedbackType, data.feedbackType), disableFeedback: this.toAstProperty(PropertyConfigKey.disableFeedback, data.disableFeedback), diffTo: this.toAstProperty(PropertyConfigKey.diffTo, data.diffTo), diffOp: this.toAstProperty(PropertyConfigKey.diffOp, data.diffOp), diffRef: this.toAstProperty(PropertyConfigKey.diffRef, data.diffRef), diffContext: this.toAstProperty(PropertyConfigKey.diffContext, data.diffContext), diffTime: this.toAstProperty(PropertyConfigKey.diffTime, data.diffTime), path: this.toAstProperty(PropertyConfigKey.path, data.path), releaseVersion: this.toAstProperty(PropertyConfigKey.releaseVersion, data.releaseVersion), releaseKind: this.toAstProperty(PropertyConfigKey.releaseKind, data.releaseKind), releaseDate: this.toAstProperty(PropertyConfigKey.releaseDate, data.releaseDate), book: this.buildBooks(context, data.book), ageRange: this.toAstProperty(PropertyConfigKey.ageRange, data.ageRange), lang: this.toAstProperty(PropertyConfigKey.lang, data.lang), language: this.toAstProperty(PropertyConfigKey.language, data.language), publisher: this.toAstProperty(PropertyConfigKey.publisher, data.publisher), publisherName: this.toAstProperty(PropertyConfigKey.publisherName, data.publisherName), theme: this.toAstProperty(PropertyConfigKey.theme, data.theme), computerLanguage: this.toAstProperty(PropertyConfigKey.computerLanguage, data.computerLanguage), target: this.toAstProperty(PropertyConfigKey.target, data.target), slug: this.toAstProperty(PropertyConfigKey.slug, data.slug), tag: this.toAstProperty(PropertyConfigKey.tag, data.tag), reductionTag: this.toAstProperty(PropertyConfigKey.reductionTag, data.reductionTag), bubbleTag: this.toAstProperty(PropertyConfigKey.bubbleTag, data.bubbleTag), levelCEFRp: this.toAstProperty(PropertyConfigKey.levelCEFRp, data.levelCEFRp), levelCEFR: this.toAstProperty(PropertyConfigKey.levelCEFR, data.levelCEFR), levelILR: this.toAstProperty(PropertyConfigKey.levelILR, data.levelILR), levelACTFL: this.toAstProperty(PropertyConfigKey.levelACTFL, data.levelACTFL), icon: this.toAstProperty(PropertyConfigKey.icon, data.icon), iconTag: this.toAstProperty(PropertyConfigKey.iconTag, data.iconTag), colorTag: this.toAstProperty(PropertyConfigKey.colorTag, data.colorTag), flashcardSet: this.toAstProperty(PropertyConfigKey.flashcardSet, data.flashcardSet), subtype: this.toAstProperty(PropertyConfigKey.subtype, data.subtype), bookAlias: this.toAstProperty(PropertyConfigKey.bookAlias, data.bookAlias), bookDiff: this.toAstProperty(PropertyConfigKey.bookDiff, data.bookDiff), coverImage: this.toAstProperty(PropertyConfigKey.coverImage, data.coverImage), coverColor: this.toAstProperty(PropertyConfigKey.coverColor, data.coverColor), publications: this.toAstProperty(PropertyConfigKey.publications, data.publications), author: this.toAstProperty(PropertyConfigKey.author, data.author), subject: this.toAstProperty(PropertyConfigKey.subject, data.subject), date: this.toAstProperty(PropertyConfigKey.date, data.date), dateEnd: this.toAstProperty(PropertyConfigKey.dateEnd, data.dateEnd), location: this.toAstProperty(PropertyConfigKey.location, data.location), kind: this.toAstProperty(PropertyConfigKey.kind, data.kind), hasMarkAsDone: this.toAstProperty(PropertyConfigKey.hasMarkAsDone, data.hasMarkAsDone), processHandIn: this.toAstProperty(PropertyConfigKey.processHandIn, data.processHandIn), chatWithBook: this.toAstProperty(PropertyConfigKey.chatWithBook, data.chatWithBook), chatWithBookBrainKey: this.toAstProperty(PropertyConfigKey.chatWithBookBrainKey, data.chatWithBookBrainKey), action: this.toAstProperty(PropertyConfigKey.action, data.action), showInIndex: this.toAstProperty(PropertyConfigKey.showInIndex, data.showInIndex), refAuthor: this.toAstProperty(PropertyConfigKey.refAuthor, data.refAuthor), refBookTitle: this.toAstProperty(PropertyConfigKey.refBookTitle, data.refBookTitle), refPublisher: this.toAstProperty(PropertyConfigKey.refPublisher, data.refPublisher), refPublicationYear: this.toAstProperty(PropertyConfigKey.refPublicationYear, data.refPublicationYear), citationStyle: this.toAstProperty(PropertyConfigKey.citationStyle, data.citationStyle), blockId: this.toAstProperty(PropertyConfigKey.blockId, data.blockId), pageNo: this.toAstProperty(PropertyConfigKey.pageNo, data.pageNo), x: this.toAstProperty(PropertyConfigKey.x, data.x), y: this.toAstProperty(PropertyConfigKey.y, data.y), width: this.toAstProperty(PropertyConfigKey.width, data.width), height: this.toAstProperty(PropertyConfigKey.height, data.height), index: this.toAstProperty(PropertyConfigKey.index, data.index), classification: this.toAstProperty(PropertyConfigKey.classification, data.classification), availableClassifications: this.toAstProperty(PropertyConfigKey.availableClassifications, data.availableClassifications), allowedBit: this.toAstProperty(PropertyConfigKey.allowedBit, data.allowedBit), tableFixedHeader: this.toAstProperty(PropertyConfigKey.tableFixedHeader, data.tableFixedHeader), tableSearch: this.toAstProperty(PropertyConfigKey.tableSearch, data.tableSearch), tableSort: this.toAstProperty(PropertyConfigKey.tableSort, data.tableSort), tablePagination: this.toAstProperty(PropertyConfigKey.tablePagination, data.tablePagination), tablePaginationLimit: this.toAstProperty(PropertyConfigKey.tablePaginationLimit, data.tablePaginationLimit), tableHeight: this.toAstProperty(PropertyConfigKey.tableHeight, data.tableHeight), tableWhitespaceNoWrap: this.toAstProperty(PropertyConfigKey.tableWhitespaceNoWrap, data.tableWhitespaceNoWrap), tableAutoWidth: this.toAstProperty(PropertyConfigKey.tableAutoWidth, data.tableAutoWidth), tableResizableColumns: this.toAstProperty(PropertyConfigKey.tableResizableColumns, data.tableResizableColumns), tableColumnMinWidth: this.toAstProperty(PropertyConfigKey.tableColumnMinWidth, data.tableColumnMinWidth), quizCountItems: this.toAstProperty(PropertyConfigKey.quizCountItems, data.quizCountItems), quizStrikethroughSolutions: this.toAstProperty(PropertyConfigKey.quizStrikethroughSolutions, data.quizStrikethroughSolutions), codeLineNumbers: this.toAstProperty(PropertyConfigKey.codeLineNumbers, data.codeLineNumbers), codeMinimap: this.toAstProperty(PropertyConfigKey.codeMinimap, data.codeMinimap), stripePricingTableId: this.toAstProperty(PropertyConfigKey.stripePricingTableId, data.stripePricingTableId), stripePublishableKey: this.toAstProperty(PropertyConfigKey.stripePublishableKey, data.stripePublishableKey), thumbImage: this.toAstProperty(PropertyConfigKey.thumbImage, data.thumbImage), scormSource: this.toAstProperty(PropertyConfigKey.scormSource, data.scormSource), posterImage: this.toAstProperty(PropertyConfigKey.posterImage, data.posterImage), focusX: this.toAstProperty(PropertyConfigKey.focusX, data.focusX), focusY: this.toAstProperty(PropertyConfigKey.focusY, data.focusY), pointerLeft: this.toAstProperty(PropertyConfigKey.pointerLeft, data.pointerLeft), pointerTop: this.toAstProperty(PropertyConfigKey.pointerTop, data.pointerTop), listItemIndent: this.toAstProperty(PropertyConfigKey.listItemIndent, data.listItemIndent), backgroundWallpaper: this.toAstProperty(PropertyConfigKey.backgroundWallpaper, data.backgroundWallpaper), hasBookNavigation: this.toAstProperty(PropertyConfigKey.hasBookNavigation, data.hasBookNavigation), duration: this.toAstProperty(PropertyConfigKey.duration, data.duration), deeplink: this.toAstProperty(PropertyConfigKey.deeplink, data.deeplink), externalLink: this.toAstProperty(PropertyConfigKey.externalLink, data.externalLink), externalLinkText: this.toAstProperty(PropertyConfigKey.externalLinkText, data.externalLinkText), videoCallLink: this.toAstProperty(PropertyConfigKey.videoCallLink, data.videoCallLink), vendorDashboardId: this.toAstProperty(PropertyConfigKey.vendorDashboardId, data.vendorDashboardId), vendorSurveyId: this.toAstProperty(PropertyConfigKey.vendorSurveyId, data.vendorSurveyId), vendorUrl: this.toAstProperty(PropertyConfigKey.vendorUrl, data.vendorUrl), search: this.toAstProperty(PropertyConfigKey.search, data.search), list: this.toAstProperty(PropertyConfigKey.list, data.list), layer: this.toAstProperty(PropertyConfigKey.layer, data.layer), layerRole: this.toAstProperty(PropertyConfigKey.layerRole, data.layerRole), textReference: this.toAstProperty(PropertyConfigKey.textReference, data.textReference), isTracked: this.toAstProperty(PropertyConfigKey.isTracked, data.isTracked), isInfoOnly: this.toAstProperty(PropertyConfigKey.isInfoOnly, data.isInfoOnly), imageFirst: this.toAstProperty(PropertyConfigKey.imageFirst, data.imageFirst), activityType: this.toAstProperty(PropertyConfigKey.activityType, data.activityType), labelTrue: this.toAstProperty(PropertyConfigKey.labelTrue, data.labelTrue), labelFalse: this.toAstProperty(PropertyConfigKey.labelFalse, data.labelFalse), content2Buy: this.toAstProperty(PropertyConfigKey.content2Buy, data.content2Buy), mailingList: this.toAstProperty(PropertyConfigKey.mailingList, data.mailingList), buttonCaption: this.toAstProperty(PropertyConfigKey.buttonCaption, data.buttonCaption), callToActionUrl: this.toAstProperty(PropertyConfigKey.callToActionUrl, data.callToActionUrl), caption: this.handleJsonText(context, TextLocation.tag, data.caption), quotedPerson: this.toAstProperty(PropertyConfigKey.quotedPerson, data.quotedPerson), reasonableNumOfChars: reasonableNumOfCharsProperty, resolved: this.toAstProperty(PropertyConfigKey.resolved, data.resolved), resolvedDate: this.toAstProperty(PropertyConfigKey.resolvedDate, data.resolvedDate), resolvedBy: this.toAstProperty(PropertyConfigKey.resolvedBy, data.resolvedBy), handInAcceptFileType: this.toAstProperty(PropertyConfigKey.handInAcceptFileType, data.handInAcceptFileType), handInRequirement: this.toAstProperty(PropertyConfigKey.handInRequirement, data.handInRequirement), handInInstruction: this.toAstProperty(PropertyConfigKey.handInInstruction, data.handInInstruction), maxCreatedBits: this.toAstProperty(PropertyConfigKey.maxCreatedBits, data.maxCreatedBits), maxDisplayLevel: this.toAstProperty(PropertyConfigKey.maxDisplayLevel, data.maxDisplayLevel), maxTocChapterLevel: this.toAstProperty(PropertyConfigKey.maxTocChapterLevel, data.maxTocChapterLevel), page: this.toAstProperty(PropertyConfigKey.page, data.page), productId: this.toAstProperty(PropertyConfigKey.productId, data.productId), product: this.toAstProperty(PropertyConfigKey.product, data.product), productList: this.toAstProperty(PropertyConfigKey.productList, data.productList), productVideo: this.toAstProperty(PropertyConfigKey.productVideo, data.productVideo), productVideoList: this.toAstProperty(PropertyConfigKey.productVideoList, data.productVideoList), productFolder: this.toAstProperty(PropertyConfigKey.productFolder, data.productFolder), technicalTerm: this.buildTechnicalTerm(context, data.technicalTerm), servings: this.buildServings(context, data.servings), ratingLevelStart: this.buildRatingLevelStartEnd(context, data.ratingLevelStart), ratingLevelEnd: this.buildRatingLevelStartEnd(context, data.ratingLevelEnd), ratingLevelSelected: this.toAstProperty(PropertyConfigKey.ratingLevelSelected, data.ratingLevelSelected), markConfig: this.buildMarkConfigs(context, data.markConfig), imageSource: this.buildImageSource(context, data.imageSource), person: this.buildPerson(context, data.person), bot: this.toAstProperty(PropertyConfigKey.bot, data.bot), referenceProperty: this.toAstProperty(PropertyConfigKey.property_reference, data.referenceProperty),
|
|
77
80
|
// Book data
|
|
78
|
-
title: this.handleJsonText(context,
|
|
81
|
+
title: this.handleJsonText(context, TextLocation.tag, data.title), subtitle: this.handleJsonText(context, TextLocation.tag, data.subtitle), level: NumberUtils.asNumber(data.level), toc: this.toAstProperty(PropertyConfigKey.toc, data.toc), progress: this.toAstProperty(PropertyConfigKey.progress, data.progress), anchor: data.anchor, reference: data.reference, referenceEnd: data.referenceEnd, revealSolutions: this.toAstProperty(PropertyConfigKey.revealSolutions, data.revealSolutions),
|
|
79
82
|
// Item, Lead, Hint, Instruction
|
|
80
|
-
item: this.handleJsonText(context,
|
|
83
|
+
item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), pageNumber: this.handleJsonText(context, TextLocation.tag, data.pageNumber), marginNumber: this.handleJsonText(context, TextLocation.tag, data.marginNumber), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction), partialAnswer: this.toAstProperty(PropertyConfigKey.partialAnswer, data.partialAnswer), sampleSolution: this.toAstProperty(PropertyConfigKey.property_sampleSolution, data.sampleSolution), additionalSolutions: this.toAstProperty(PropertyConfigKey.additionalSolutions, data.additionalSolutions) }, this.toExample(data.__isDefaultExample, data.example)), {
|
|
81
84
|
// Person
|
|
82
85
|
imagePlaceholder: ArrayUtils.asSingle(this.resourceBuilder.resourceFromResourceDataJson(context, ResourceTag.image, (_b = data.imagePlaceholder) === null || _b === void 0 ? void 0 : _b.image)), resources: ArrayUtils.asArray(this.resourceBuilder.resourceFromResourceJson(context, data.resources)),
|
|
83
86
|
// Body, Card, Footer, must be after all other properties except the extraProperties and markup / parser
|
|
@@ -176,7 +179,7 @@ class Builder extends BaseBuilder {
|
|
|
176
179
|
if (!data)
|
|
177
180
|
return undefined;
|
|
178
181
|
// NOTE: Node order is important and is defined here
|
|
179
|
-
const node = Object.assign({ choice: (_a = data.choice) !== null && _a !== void 0 ? _a : '', requireReason: !!data.requireReason, item: this.handleJsonText(context,
|
|
182
|
+
const node = Object.assign({ choice: (_a = data.choice) !== null && _a !== void 0 ? _a : '', requireReason: !!data.requireReason, item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction) }, this.toExample(data.__isDefaultExample, data.example, true));
|
|
180
183
|
// Remove Unset Optionals
|
|
181
184
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
182
185
|
ignoreAllFalse: true,
|
|
@@ -197,9 +200,9 @@ class Builder extends BaseBuilder {
|
|
|
197
200
|
return undefined;
|
|
198
201
|
// Set default example
|
|
199
202
|
// Not __testAst - there is no default example
|
|
200
|
-
const defaultExample = this.handleJsonText(context,
|
|
203
|
+
const defaultExample = this.handleJsonText(context, TextLocation.tag, 'true');
|
|
201
204
|
// NOTE: Node order is important and is defined here
|
|
202
|
-
const node = Object.assign(Object.assign({ text: (_a = data.text) !== null && _a !== void 0 ? _a : '', reasonableNumOfChars: ((_b = data.reasonableNumOfChars) !== null && _b !== void 0 ? _b : undefined), item: this.handleJsonText(context,
|
|
205
|
+
const node = Object.assign(Object.assign({ text: (_a = data.text) !== null && _a !== void 0 ? _a : '', reasonableNumOfChars: ((_b = data.reasonableNumOfChars) !== null && _b !== void 0 ? _b : undefined), item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction) }, this.toExample(data.__isDefaultExample, data.example, defaultExample)), { __textAst: data.__textAst });
|
|
203
206
|
// Remove Unset Optionals
|
|
204
207
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
205
208
|
ignoreAllFalse: true,
|
|
@@ -231,7 +234,7 @@ class Builder extends BaseBuilder {
|
|
|
231
234
|
if (!data)
|
|
232
235
|
return undefined;
|
|
233
236
|
// NOTE: Node order is important and is defined here
|
|
234
|
-
const node = Object.assign({ choice: (_a = data.choice) !== null && _a !== void 0 ? _a : '', isCorrect: !!data.isCorrect, item: this.handleJsonText(context,
|
|
237
|
+
const node = Object.assign({ choice: (_a = data.choice) !== null && _a !== void 0 ? _a : '', isCorrect: !!data.isCorrect, item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction) }, this.toExample(data.__isDefaultExample, data.example, !!data.isCorrect));
|
|
235
238
|
// Remove Unset Optionals
|
|
236
239
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
237
240
|
ignoreAllFalse: true,
|
|
@@ -263,7 +266,7 @@ class Builder extends BaseBuilder {
|
|
|
263
266
|
if (!data)
|
|
264
267
|
return undefined;
|
|
265
268
|
// NOTE: Node order is important and is defined here
|
|
266
|
-
const node = Object.assign({ response: (_a = data.response) !== null && _a !== void 0 ? _a : '', isCorrect: !!data.isCorrect, item: this.handleJsonText(context,
|
|
269
|
+
const node = Object.assign({ response: (_a = data.response) !== null && _a !== void 0 ? _a : '', isCorrect: !!data.isCorrect, item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction) }, this.toExample(data.__isDefaultExample, data.example, !!data.isCorrect));
|
|
267
270
|
// Remove Unset Optionals
|
|
268
271
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
269
272
|
ignoreAllFalse: true,
|
|
@@ -299,9 +302,9 @@ class Builder extends BaseBuilder {
|
|
|
299
302
|
response: (_a = data.response) !== null && _a !== void 0 ? _a : '',
|
|
300
303
|
reaction: (_b = data.reaction) !== null && _b !== void 0 ? _b : '',
|
|
301
304
|
feedback: (_c = data.feedback) !== null && _c !== void 0 ? _c : '',
|
|
302
|
-
item: this.handleJsonText(context,
|
|
303
|
-
lead: this.handleJsonText(context,
|
|
304
|
-
hint: this.handleJsonText(context,
|
|
305
|
+
item: this.handleJsonText(context, TextLocation.tag, data.item),
|
|
306
|
+
lead: this.handleJsonText(context, TextLocation.tag, data.lead),
|
|
307
|
+
hint: this.handleJsonText(context, TextLocation.tag, data.hint),
|
|
305
308
|
};
|
|
306
309
|
// Remove Unset Optionals
|
|
307
310
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
@@ -349,10 +352,10 @@ class Builder extends BaseBuilder {
|
|
|
349
352
|
}
|
|
350
353
|
// NOTE: Node order is important and is defined here
|
|
351
354
|
const node = {
|
|
352
|
-
item: this.handleJsonText(context,
|
|
353
|
-
lead: this.handleJsonText(context,
|
|
354
|
-
hint: this.handleJsonText(context,
|
|
355
|
-
instruction: this.handleJsonText(context,
|
|
355
|
+
item: this.handleJsonText(context, TextLocation.tag, data.item),
|
|
356
|
+
lead: this.handleJsonText(context, TextLocation.tag, data.lead),
|
|
357
|
+
hint: this.handleJsonText(context, TextLocation.tag, data.hint),
|
|
358
|
+
instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),
|
|
356
359
|
// isExample: !!data.__defaultExample,
|
|
357
360
|
choices: choices,
|
|
358
361
|
reason: reason, // Might be undefined
|
|
@@ -404,10 +407,10 @@ class Builder extends BaseBuilder {
|
|
|
404
407
|
}
|
|
405
408
|
// NOTE: Node order is important and is defined here
|
|
406
409
|
const node = {
|
|
407
|
-
item: this.handleJsonText(context,
|
|
408
|
-
lead: this.handleJsonText(context,
|
|
409
|
-
hint: this.handleJsonText(context,
|
|
410
|
-
instruction: this.handleJsonText(context,
|
|
410
|
+
item: this.handleJsonText(context, TextLocation.tag, data.item),
|
|
411
|
+
lead: this.handleJsonText(context, TextLocation.tag, data.lead),
|
|
412
|
+
hint: this.handleJsonText(context, TextLocation.tag, data.hint),
|
|
413
|
+
instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),
|
|
411
414
|
isExample: !!data.__defaultExample,
|
|
412
415
|
choices: choices,
|
|
413
416
|
responses: responses,
|
|
@@ -473,7 +476,7 @@ class Builder extends BaseBuilder {
|
|
|
473
476
|
const keyImage = this.resourceBuilder.resourceFromResourceJson(context, data.keyImage);
|
|
474
477
|
// NOTE: Node order is important and is defined here
|
|
475
478
|
const node = Object.assign(Object.assign({ key: (_a = data.key) !== null && _a !== void 0 ? _a : '', keyAudio,
|
|
476
|
-
keyImage, item: this.handleJsonText(context,
|
|
479
|
+
keyImage, item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction), isCaseSensitive: data.isCaseSensitive }, this.toExample(data.__isDefaultExample, data.example, defaultExample)), { values: (_b = data.values) !== null && _b !== void 0 ? _b : [], __valuesAst: data.__valuesAst });
|
|
477
480
|
// Remove Unset Optionals
|
|
478
481
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
479
482
|
ignoreAllFalse: true,
|
|
@@ -533,10 +536,10 @@ class Builder extends BaseBuilder {
|
|
|
533
536
|
// NOTE: Node order is important and is defined here
|
|
534
537
|
const node = {
|
|
535
538
|
key: (_b = data.key) !== null && _b !== void 0 ? _b : '',
|
|
536
|
-
item: this.handleJsonText(context,
|
|
537
|
-
lead: this.handleJsonText(context,
|
|
538
|
-
hint: this.handleJsonText(context,
|
|
539
|
-
instruction: this.handleJsonText(context,
|
|
539
|
+
item: this.handleJsonText(context, TextLocation.tag, data.item),
|
|
540
|
+
lead: this.handleJsonText(context, TextLocation.tag, data.lead),
|
|
541
|
+
hint: this.handleJsonText(context, TextLocation.tag, data.hint),
|
|
542
|
+
instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),
|
|
540
543
|
isExample,
|
|
541
544
|
cells: ((_c = data.cells) !== null && _c !== void 0 ? _c : []).map((c) => this.buildMatrixCell(context, c)).filter((c) => c != null),
|
|
542
545
|
};
|
|
@@ -561,7 +564,7 @@ class Builder extends BaseBuilder {
|
|
|
561
564
|
// Set default example
|
|
562
565
|
const defaultExample = Array.isArray(data.__valuesAst) && data.__valuesAst.length > 0 ? data.__valuesAst[0] : null;
|
|
563
566
|
// NOTE: Node order is important and is defined here
|
|
564
|
-
const node = Object.assign(Object.assign({ values: (_a = data.values) !== null && _a !== void 0 ? _a : [], item: this.handleJsonText(context,
|
|
567
|
+
const node = Object.assign(Object.assign({ values: (_a = data.values) !== null && _a !== void 0 ? _a : [], item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction), isCaseSensitive: data.isCaseSensitive }, this.toExample(data.__isDefaultExample, data.example, defaultExample)), { __valuesAst: data.__valuesAst });
|
|
565
568
|
// Remove Unset Optionals
|
|
566
569
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
567
570
|
ignoreAllFalse: true,
|
|
@@ -586,8 +589,8 @@ class Builder extends BaseBuilder {
|
|
|
586
589
|
// Process the audio resource
|
|
587
590
|
const audio = this.resourceBuilder.resourceFromResourceJson(context, cell.audio);
|
|
588
591
|
return {
|
|
589
|
-
title: this.handleJsonText(context,
|
|
590
|
-
body: this.handleJsonText(context,
|
|
592
|
+
title: this.handleJsonText(context, TextLocation.tag, cell.title),
|
|
593
|
+
body: this.handleJsonText(context, TextLocation.tag, cell.body),
|
|
591
594
|
audio,
|
|
592
595
|
};
|
|
593
596
|
})),
|
|
@@ -610,8 +613,8 @@ class Builder extends BaseBuilder {
|
|
|
610
613
|
return undefined;
|
|
611
614
|
// NOTE: Node order is important and is defined here
|
|
612
615
|
const node = {
|
|
613
|
-
columns: ((_a = dataIn.columns) !== null && _a !== void 0 ? _a : []).map((col) => this.handleJsonText(context,
|
|
614
|
-
data: ((_b = dataIn.data) !== null && _b !== void 0 ? _b : []).map((row) => (row !== null && row !== void 0 ? row : []).map((cell) => this.handleJsonText(context,
|
|
616
|
+
columns: ((_a = dataIn.columns) !== null && _a !== void 0 ? _a : []).map((col) => this.handleJsonText(context, TextLocation.tag, col)),
|
|
617
|
+
data: ((_b = dataIn.data) !== null && _b !== void 0 ? _b : []).map((row) => (row !== null && row !== void 0 ? row : []).map((cell) => this.handleJsonText(context, TextLocation.tag, cell))),
|
|
615
618
|
};
|
|
616
619
|
// Remove Unset Optionals
|
|
617
620
|
// ObjectUtils.removeUnwantedProperties(node, {
|
|
@@ -644,7 +647,7 @@ class Builder extends BaseBuilder {
|
|
|
644
647
|
// Set default example
|
|
645
648
|
const defaultExample = data.__sampleSolutionAst;
|
|
646
649
|
// NOTE: Node order is important and is defined here
|
|
647
|
-
const node = Object.assign(Object.assign({ question: (_a = data.question) !== null && _a !== void 0 ? _a : '', partialAnswer: (_b = data.partialAnswer) !== null && _b !== void 0 ? _b : '', sampleSolution: (_c = data.sampleSolution) !== null && _c !== void 0 ? _c : '', additionalSolutions: ((_d = data.additionalSolutions) !== null && _d !== void 0 ? _d : undefined), reasonableNumOfChars: ((_e = data.reasonableNumOfChars) !== null && _e !== void 0 ? _e : undefined), item: this.handleJsonText(context,
|
|
650
|
+
const node = Object.assign(Object.assign({ question: (_a = data.question) !== null && _a !== void 0 ? _a : '', partialAnswer: (_b = data.partialAnswer) !== null && _b !== void 0 ? _b : '', sampleSolution: (_c = data.sampleSolution) !== null && _c !== void 0 ? _c : '', additionalSolutions: ((_d = data.additionalSolutions) !== null && _d !== void 0 ? _d : undefined), reasonableNumOfChars: ((_e = data.reasonableNumOfChars) !== null && _e !== void 0 ? _e : undefined), item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction) }, this.toExample(data.__isDefaultExample, data.example, defaultExample)), { __sampleSolutionAst: data.__sampleSolutionAst });
|
|
648
651
|
// Remove Unset Optionals
|
|
649
652
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
650
653
|
ignoreAllFalse: true,
|
|
@@ -781,7 +784,7 @@ class Builder extends BaseBuilder {
|
|
|
781
784
|
// Convert the body string to AST
|
|
782
785
|
rawBody = this.textParser.toAst(bodyStr, {
|
|
783
786
|
textFormat,
|
|
784
|
-
|
|
787
|
+
textLocation: TextLocation.body,
|
|
785
788
|
});
|
|
786
789
|
const replaceBitsRecursive = (bodyText) => {
|
|
787
790
|
for (let i = 0, len = bodyText.length; i < len; i++) {
|
|
@@ -838,7 +841,7 @@ class Builder extends BaseBuilder {
|
|
|
838
841
|
const handlePlainTextBody = () => {
|
|
839
842
|
body = data.body;
|
|
840
843
|
};
|
|
841
|
-
const isBitmarkText = textFormat === TextFormat.
|
|
844
|
+
const isBitmarkText = textFormat === TextFormat.bitmarkText;
|
|
842
845
|
if (textFormat === TextFormat.json) {
|
|
843
846
|
// JSON
|
|
844
847
|
handleJsonBody();
|
|
@@ -869,7 +872,7 @@ class Builder extends BaseBuilder {
|
|
|
869
872
|
if (!data)
|
|
870
873
|
return undefined;
|
|
871
874
|
const node = {
|
|
872
|
-
footer: this.handleJsonText(context,
|
|
875
|
+
footer: this.handleJsonText(context, TextLocation.body, data.footer),
|
|
873
876
|
};
|
|
874
877
|
return node;
|
|
875
878
|
}
|
|
@@ -888,7 +891,7 @@ class Builder extends BaseBuilder {
|
|
|
888
891
|
// Copy any attributes from 'attrs' to the body bit (data is in 'attrs' when coming from JSON)
|
|
889
892
|
data = this.bodyBitCopyFromAttrs(data);
|
|
890
893
|
// NOTE: Node order is important and is defined here
|
|
891
|
-
const node = Object.assign(Object.assign({ type: BodyBitType.gap, solutions: (_a = data.solutions) !== null && _a !== void 0 ? _a : [], item: this.handleJsonText(context,
|
|
894
|
+
const node = Object.assign(Object.assign({ type: BodyBitType.gap, solutions: (_a = data.solutions) !== null && _a !== void 0 ? _a : [], item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction), isCaseSensitive: data.isCaseSensitive }, this.toExample(data.__isDefaultExample, data.example, defaultExample)), { __solutionsAst: data.__solutionsAst, attrs: {} });
|
|
892
895
|
// Remove Unset Optionals
|
|
893
896
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
894
897
|
ignoreAllFalse: true,
|
|
@@ -944,7 +947,7 @@ class Builder extends BaseBuilder {
|
|
|
944
947
|
// Copy any attributes from 'attrs' to the body bit (data is in 'attrs' when coming from JSON)
|
|
945
948
|
data = this.bodyBitCopyFromAttrs(data);
|
|
946
949
|
// NOTE: Node order is important and is defined here
|
|
947
|
-
const node = Object.assign(Object.assign({ type: BodyBitType.mark, solution: (_a = data.solution) !== null && _a !== void 0 ? _a : '', mark: (_b = data.mark) !== null && _b !== void 0 ? _b : '', item: this.handleJsonText(context,
|
|
950
|
+
const node = Object.assign(Object.assign({ type: BodyBitType.mark, solution: (_a = data.solution) !== null && _a !== void 0 ? _a : '', mark: (_b = data.mark) !== null && _b !== void 0 ? _b : '', item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction) }, this.toExample(data.__isDefaultExample, data.example, true)), { attrs: {} });
|
|
948
951
|
// Remove Unset Optionals
|
|
949
952
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
950
953
|
ignoreAllFalse: true,
|
|
@@ -967,7 +970,7 @@ class Builder extends BaseBuilder {
|
|
|
967
970
|
// Copy any attributes from 'attrs' to the body bit (data is in 'attrs' when coming from JSON)
|
|
968
971
|
data = this.bodyBitCopyFromAttrs(data);
|
|
969
972
|
// NOTE: Node order is important and is defined here
|
|
970
|
-
const node = Object.assign(Object.assign({ type: BodyBitType.select, options: (_a = this.buildSelectOptions(context, data.options)) !== null && _a !== void 0 ? _a : [], prefix: (_b = data.prefix) !== null && _b !== void 0 ? _b : '', postfix: (_c = data.postfix) !== null && _c !== void 0 ? _c : '', item: this.handleJsonText(context,
|
|
973
|
+
const node = Object.assign(Object.assign({ type: BodyBitType.select, options: (_a = this.buildSelectOptions(context, data.options)) !== null && _a !== void 0 ? _a : [], prefix: (_b = data.prefix) !== null && _b !== void 0 ? _b : '', postfix: (_c = data.postfix) !== null && _c !== void 0 ? _c : '', item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction) }, this.toExample(false, undefined, undefined)), { __hintString: data.__hintString, __instructionString: data.__instructionString, attrs: {} });
|
|
971
974
|
// Remove Unset Optionals
|
|
972
975
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
973
976
|
ignoreAllFalse: true,
|
|
@@ -999,7 +1002,7 @@ class Builder extends BaseBuilder {
|
|
|
999
1002
|
if (!data)
|
|
1000
1003
|
return undefined;
|
|
1001
1004
|
// NOTE: Node order is important and is defined here
|
|
1002
|
-
const node = Object.assign({ text: (_a = data.text) !== null && _a !== void 0 ? _a : '', isCorrect: !!data.isCorrect, item: this.handleJsonText(context,
|
|
1005
|
+
const node = Object.assign({ text: (_a = data.text) !== null && _a !== void 0 ? _a : '', isCorrect: !!data.isCorrect, item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction) }, this.toExample(data.__isDefaultExample, data.example, !!data.isCorrect));
|
|
1003
1006
|
// Remove Unset Optionals
|
|
1004
1007
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
1005
1008
|
ignoreAllFalse: true,
|
|
@@ -1021,7 +1024,7 @@ class Builder extends BaseBuilder {
|
|
|
1021
1024
|
// Copy any attributes from 'attrs' to the body bit (data is in 'attrs' when coming from JSON)
|
|
1022
1025
|
data = this.bodyBitCopyFromAttrs(data);
|
|
1023
1026
|
// NOTE: Node order is important and is defined here
|
|
1024
|
-
const node = Object.assign(Object.assign({ type: BodyBitType.highlight, texts: (_a = this.buildHighlightTexts(context, data.texts)) !== null && _a !== void 0 ? _a : [], prefix: (_b = data.prefix) !== null && _b !== void 0 ? _b : '', postfix: (_c = data.postfix) !== null && _c !== void 0 ? _c : '', item: this.handleJsonText(context,
|
|
1027
|
+
const node = Object.assign(Object.assign({ type: BodyBitType.highlight, texts: (_a = this.buildHighlightTexts(context, data.texts)) !== null && _a !== void 0 ? _a : [], prefix: (_b = data.prefix) !== null && _b !== void 0 ? _b : '', postfix: (_c = data.postfix) !== null && _c !== void 0 ? _c : '', item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction) }, this.toExample(false, undefined, undefined)), { attrs: {} });
|
|
1025
1028
|
// Remove Unset Optionals
|
|
1026
1029
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
1027
1030
|
ignoreAllFalse: true,
|
|
@@ -1053,7 +1056,7 @@ class Builder extends BaseBuilder {
|
|
|
1053
1056
|
if (!data)
|
|
1054
1057
|
return undefined;
|
|
1055
1058
|
// NOTE: Node order is important and is defined here
|
|
1056
|
-
const node = Object.assign({ text: (_a = data.text) !== null && _a !== void 0 ? _a : '', isCorrect: !!data.isCorrect, isHighlighted: !!data.isHighlighted, item: this.handleJsonText(context,
|
|
1059
|
+
const node = Object.assign({ text: (_a = data.text) !== null && _a !== void 0 ? _a : '', isCorrect: !!data.isCorrect, isHighlighted: !!data.isHighlighted, item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction) }, this.toExample(data.__isDefaultExample, data.example, !!data.isCorrect));
|
|
1057
1060
|
// Remove Unset Optionals
|
|
1058
1061
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
1059
1062
|
ignoreAllFalse: true,
|
|
@@ -1087,7 +1090,7 @@ class Builder extends BaseBuilder {
|
|
|
1087
1090
|
// NOTE: Node order is important and is defined here
|
|
1088
1091
|
const node = Object.assign({ question: this.buildTextAndIcon(context, data.question), answer: this.buildTextAndIcon(context, data.answer), alternativeAnswers: ((_a = data.alternativeAnswers) !== null && _a !== void 0 ? _a : [])
|
|
1089
1092
|
.map((d) => this.buildTextAndIcon(context, d))
|
|
1090
|
-
.filter((d) => d != null), item: this.handleJsonText(context,
|
|
1093
|
+
.filter((d) => d != null), item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction) }, this.toExample(data.__isDefaultExample, data.example, true));
|
|
1091
1094
|
// Remove Unset Optionals
|
|
1092
1095
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
1093
1096
|
ignoreAllFalse: true,
|
|
@@ -1123,7 +1126,7 @@ class Builder extends BaseBuilder {
|
|
|
1123
1126
|
// NOTE: Node order is important and is defined here
|
|
1124
1127
|
const node = Object.assign({ term: this.buildTextAndIcon(context, data.term, textAsStrings), definition: this.buildTextAndIcon(context, data.definition, textAsStrings), alternativeDefinitions: ((_a = data.alternativeDefinitions) !== null && _a !== void 0 ? _a : [])
|
|
1125
1128
|
.map((d) => this.buildTextAndIcon(context, d, textAsStrings))
|
|
1126
|
-
.filter((d) => d != null), item: this.handleJsonText(context,
|
|
1129
|
+
.filter((d) => d != null), item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction) }, this.toExample(data.__isDefaultExample, data.example, true));
|
|
1127
1130
|
// Remove Unset Optionals
|
|
1128
1131
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
1129
1132
|
ignoreAllFalse: true,
|
|
@@ -1135,11 +1138,11 @@ class Builder extends BaseBuilder {
|
|
|
1135
1138
|
buildTextAndIcon(context, data, textAsStrings = false) {
|
|
1136
1139
|
const icon = this.resourceBuilder.resourceFromResourceJson(context, data === null || data === void 0 ? void 0 : data.icon);
|
|
1137
1140
|
// Ensure text is bitmark text
|
|
1138
|
-
let text = this.handleJsonText(context,
|
|
1141
|
+
let text = this.handleJsonText(context, TextLocation.tag, data === null || data === void 0 ? void 0 : data.text);
|
|
1139
1142
|
if (textAsStrings) {
|
|
1140
1143
|
// Convert the bitmark text to plain text (without breakscaping, as that will happen in the Bitmark Generator)
|
|
1141
1144
|
text = this.textGenerator
|
|
1142
|
-
.generateSync(text, TextFormat.
|
|
1145
|
+
.generateSync(text, TextFormat.plainText, TextLocation.body, {
|
|
1143
1146
|
noBreakscaping: true,
|
|
1144
1147
|
})
|
|
1145
1148
|
.trim();
|
|
@@ -1179,7 +1182,7 @@ class Builder extends BaseBuilder {
|
|
|
1179
1182
|
if (!data)
|
|
1180
1183
|
return undefined;
|
|
1181
1184
|
// NOTE: Node order is important and is defined here
|
|
1182
|
-
const node = Object.assign({ statement: (_a = data.statement) !== null && _a !== void 0 ? _a : '', isCorrect: !!data.isCorrect, item: this.handleJsonText(context,
|
|
1185
|
+
const node = Object.assign({ statement: (_a = data.statement) !== null && _a !== void 0 ? _a : '', isCorrect: !!data.isCorrect, item: this.handleJsonText(context, TextLocation.tag, data.item), lead: this.handleJsonText(context, TextLocation.tag, data.lead), hint: this.handleJsonText(context, TextLocation.tag, data.hint), instruction: this.handleJsonText(context, TextLocation.tag, data.instruction) }, this.toExample(data.__isDefaultExample, data.example, !!data.isCorrect));
|
|
1183
1186
|
// Remove Unset Optionals
|
|
1184
1187
|
ObjectUtils.removeUnwantedProperties(node, {
|
|
1185
1188
|
ignoreAllFalse: true,
|
|
@@ -1299,7 +1302,7 @@ class Builder extends BaseBuilder {
|
|
|
1299
1302
|
// NOTE: Node order is important and is defined here
|
|
1300
1303
|
const node = {
|
|
1301
1304
|
level: level !== null && level !== void 0 ? level : 0,
|
|
1302
|
-
label: this.handleJsonText(context,
|
|
1305
|
+
label: this.handleJsonText(context, TextLocation.tag, label),
|
|
1303
1306
|
};
|
|
1304
1307
|
// Remove Unset Optionals
|
|
1305
1308
|
ObjectUtils.removeUnwantedProperties(node, {
|