@gmb/bitmark-parser-generator 3.34.0 → 3.36.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.
Files changed (904) hide show
  1. package/README.md +4 -4
  2. package/dist/browser/bitmark-parser-generator.min.js +1 -1
  3. package/dist/browser/bundle-report.html +2 -2
  4. package/dist/index.cjs +33650 -0
  5. package/dist/index.cjs.map +1 -0
  6. package/dist/index.d.cts +7733 -0
  7. package/dist/index.d.ts +7733 -0
  8. package/dist/index.js +33590 -0
  9. package/dist/index.js.map +1 -0
  10. package/package.json +106 -90
  11. package/dist/cjs/BitmarkParserGenerator.js +0 -776
  12. package/dist/cjs/BitmarkParserGenerator.js.map +0 -1
  13. package/dist/cjs/ast/Ast.js +0 -220
  14. package/dist/cjs/ast/Ast.js.map +0 -1
  15. package/dist/cjs/ast/BaseBuilder.js +0 -193
  16. package/dist/cjs/ast/BaseBuilder.js.map +0 -1
  17. package/dist/cjs/ast/Builder.js +0 -1781
  18. package/dist/cjs/ast/Builder.js.map +0 -1
  19. package/dist/cjs/ast/ResourceBuilder.js +0 -963
  20. package/dist/cjs/ast/ResourceBuilder.js.map +0 -1
  21. package/dist/cjs/ast/rules/NodeValidator.js +0 -184
  22. package/dist/cjs/ast/rules/NodeValidator.js.map +0 -1
  23. package/dist/cjs/ast/writer/FileWriter.js +0 -119
  24. package/dist/cjs/ast/writer/FileWriter.js.map +0 -1
  25. package/dist/cjs/ast/writer/StreamWriter.js +0 -89
  26. package/dist/cjs/ast/writer/StreamWriter.js.map +0 -1
  27. package/dist/cjs/ast/writer/StringWriter.js +0 -115
  28. package/dist/cjs/ast/writer/StringWriter.js.map +0 -1
  29. package/dist/cjs/ast/writer/Writer.js +0 -3
  30. package/dist/cjs/ast/writer/Writer.js.map +0 -1
  31. package/dist/cjs/breakscaping/Breakscape.js +0 -80
  32. package/dist/cjs/breakscaping/Breakscape.js.map +0 -1
  33. package/dist/cjs/breakscaping/BreakscapeLoop.js +0 -305
  34. package/dist/cjs/breakscaping/BreakscapeLoop.js.map +0 -1
  35. package/dist/cjs/breakscaping/BreakscapeOptions.js +0 -3
  36. package/dist/cjs/breakscaping/BreakscapeOptions.js.map +0 -1
  37. package/dist/cjs/breakscaping/BreakscapeRegex.js +0 -213
  38. package/dist/cjs/breakscaping/BreakscapeRegex.js.map +0 -1
  39. package/dist/cjs/breakscaping/RegexConfigs.js +0 -38
  40. package/dist/cjs/breakscaping/RegexConfigs.js.map +0 -1
  41. package/dist/cjs/config/Config.js +0 -352
  42. package/dist/cjs/config/Config.js.map +0 -1
  43. package/dist/cjs/config/ConfigHydrator.js +0 -161
  44. package/dist/cjs/config/ConfigHydrator.js.map +0 -1
  45. package/dist/cjs/config/raw/bits.js +0 -2615
  46. package/dist/cjs/config/raw/bits.js.map +0 -1
  47. package/dist/cjs/config/raw/cardSets.js +0 -549
  48. package/dist/cjs/config/raw/cardSets.js.map +0 -1
  49. package/dist/cjs/config/raw/groups.js +0 -1182
  50. package/dist/cjs/config/raw/groups.js.map +0 -1
  51. package/dist/cjs/config/raw/properties.js +0 -1006
  52. package/dist/cjs/config/raw/properties.js.map +0 -1
  53. package/dist/cjs/config/raw/resources.js +0 -103
  54. package/dist/cjs/config/raw/resources.js.map +0 -1
  55. package/dist/cjs/config/raw/tags.js +0 -48
  56. package/dist/cjs/config/raw/tags.js.map +0 -1
  57. package/dist/cjs/generated/build-info.js +0 -13
  58. package/dist/cjs/generated/build-info.js.map +0 -1
  59. package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js +0 -3168
  60. package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js.map +0 -1
  61. package/dist/cjs/generated/parser/text/text-peggy-parser.js +0 -9659
  62. package/dist/cjs/generated/parser/text/text-peggy-parser.js.map +0 -1
  63. package/dist/cjs/generator/AstWalkerGenerator.js +0 -86
  64. package/dist/cjs/generator/AstWalkerGenerator.js.map +0 -1
  65. package/dist/cjs/generator/Generator.js +0 -3
  66. package/dist/cjs/generator/Generator.js.map +0 -1
  67. package/dist/cjs/generator/bitmark/BitmarkFileGenerator.js +0 -49
  68. package/dist/cjs/generator/bitmark/BitmarkFileGenerator.js.map +0 -1
  69. package/dist/cjs/generator/bitmark/BitmarkGenerator.js +0 -2601
  70. package/dist/cjs/generator/bitmark/BitmarkGenerator.js.map +0 -1
  71. package/dist/cjs/generator/bitmark/BitmarkStringGenerator.js +0 -51
  72. package/dist/cjs/generator/bitmark/BitmarkStringGenerator.js.map +0 -1
  73. package/dist/cjs/generator/json/JsonFileGenerator.js +0 -53
  74. package/dist/cjs/generator/json/JsonFileGenerator.js.map +0 -1
  75. package/dist/cjs/generator/json/JsonGenerator.js +0 -1584
  76. package/dist/cjs/generator/json/JsonGenerator.js.map +0 -1
  77. package/dist/cjs/generator/json/JsonObjectGenerator.js +0 -51
  78. package/dist/cjs/generator/json/JsonObjectGenerator.js.map +0 -1
  79. package/dist/cjs/generator/json/JsonStringGenerator.js +0 -50
  80. package/dist/cjs/generator/json/JsonStringGenerator.js.map +0 -1
  81. package/dist/cjs/generator/text/TextGenerator.js +0 -1199
  82. package/dist/cjs/generator/text/TextGenerator.js.map +0 -1
  83. package/dist/cjs/index.js +0 -79
  84. package/dist/cjs/index.js.map +0 -1
  85. package/dist/cjs/info/InfoBuilder.js +0 -43
  86. package/dist/cjs/info/InfoBuilder.js.map +0 -1
  87. package/dist/cjs/init/init.js +0 -15
  88. package/dist/cjs/init/init.js.map +0 -1
  89. package/dist/cjs/model/ast/BreakscapedString.js +0 -3
  90. package/dist/cjs/model/ast/BreakscapedString.js.map +0 -1
  91. package/dist/cjs/model/ast/NodeType.js +0 -557
  92. package/dist/cjs/model/ast/NodeType.js.map +0 -1
  93. package/dist/cjs/model/ast/Nodes.js +0 -3
  94. package/dist/cjs/model/ast/Nodes.js.map +0 -1
  95. package/dist/cjs/model/ast/StardardString.js +0 -3
  96. package/dist/cjs/model/ast/StardardString.js.map +0 -1
  97. package/dist/cjs/model/ast/TextNodes.js +0 -3
  98. package/dist/cjs/model/ast/TextNodes.js.map +0 -1
  99. package/dist/cjs/model/config/AbstractTagConfig.js +0 -18
  100. package/dist/cjs/model/config/AbstractTagConfig.js.map +0 -1
  101. package/dist/cjs/model/config/BitConfig.js +0 -72
  102. package/dist/cjs/model/config/BitConfig.js.map +0 -1
  103. package/dist/cjs/model/config/CardSetConfig.js +0 -26
  104. package/dist/cjs/model/config/CardSetConfig.js.map +0 -1
  105. package/dist/cjs/model/config/CardVariantConfig.js +0 -32
  106. package/dist/cjs/model/config/CardVariantConfig.js.map +0 -1
  107. package/dist/cjs/model/config/MarkupTagConfig.js +0 -41
  108. package/dist/cjs/model/config/MarkupTagConfig.js.map +0 -1
  109. package/dist/cjs/model/config/PropertyTagConfig.js +0 -50
  110. package/dist/cjs/model/config/PropertyTagConfig.js.map +0 -1
  111. package/dist/cjs/model/config/ResourceTagConfig.js +0 -42
  112. package/dist/cjs/model/config/ResourceTagConfig.js.map +0 -1
  113. package/dist/cjs/model/config/ResourcesConfig.js +0 -31
  114. package/dist/cjs/model/config/ResourcesConfig.js.map +0 -1
  115. package/dist/cjs/model/config/TagConfig.js +0 -3
  116. package/dist/cjs/model/config/TagConfig.js.map +0 -1
  117. package/dist/cjs/model/config/TagsConfig.js +0 -3
  118. package/dist/cjs/model/config/TagsConfig.js.map +0 -1
  119. package/dist/cjs/model/config/TagsConfigWithInfo.js +0 -3
  120. package/dist/cjs/model/config/TagsConfigWithInfo.js.map +0 -1
  121. package/dist/cjs/model/config/_Config.js +0 -3
  122. package/dist/cjs/model/config/_Config.js.map +0 -1
  123. package/dist/cjs/model/config/enum/CardSetConfigKey.js +0 -28
  124. package/dist/cjs/model/config/enum/CardSetConfigKey.js.map +0 -1
  125. package/dist/cjs/model/config/enum/ConfigKey.js +0 -29
  126. package/dist/cjs/model/config/enum/ConfigKey.js.map +0 -1
  127. package/dist/cjs/model/config/enum/GroupConfigKey.js +0 -57
  128. package/dist/cjs/model/config/enum/GroupConfigKey.js.map +0 -1
  129. package/dist/cjs/model/config/enum/GroupConfigType.js +0 -14
  130. package/dist/cjs/model/config/enum/GroupConfigType.js.map +0 -1
  131. package/dist/cjs/model/config/enum/PropertyConfigKey.js +0 -215
  132. package/dist/cjs/model/config/enum/PropertyConfigKey.js.map +0 -1
  133. package/dist/cjs/model/config/enum/ResourceConfigKey.js +0 -40
  134. package/dist/cjs/model/config/enum/ResourceConfigKey.js.map +0 -1
  135. package/dist/cjs/model/config/enum/TagConfigKey.js +0 -26
  136. package/dist/cjs/model/config/enum/TagConfigKey.js.map +0 -1
  137. package/dist/cjs/model/enum/BitTagType.js +0 -13
  138. package/dist/cjs/model/enum/BitTagType.js.map +0 -1
  139. package/dist/cjs/model/enum/BitType.js +0 -576
  140. package/dist/cjs/model/enum/BitType.js.map +0 -1
  141. package/dist/cjs/model/enum/BitmarkGeneratorOutput.js +0 -2
  142. package/dist/cjs/model/enum/BitmarkGeneratorOutput.js.map +0 -1
  143. package/dist/cjs/model/enum/BitmarkParserType.js +0 -9
  144. package/dist/cjs/model/enum/BitmarkParserType.js.map +0 -1
  145. package/dist/cjs/model/enum/BitmarkVersion.js +0 -12
  146. package/dist/cjs/model/enum/BitmarkVersion.js.map +0 -1
  147. package/dist/cjs/model/enum/BodyBitType.js +0 -14
  148. package/dist/cjs/model/enum/BodyBitType.js.map +0 -1
  149. package/dist/cjs/model/enum/BodyTextFormat.js +0 -14
  150. package/dist/cjs/model/enum/BodyTextFormat.js.map +0 -1
  151. package/dist/cjs/model/enum/CardSetVersion.js +0 -10
  152. package/dist/cjs/model/enum/CardSetVersion.js.map +0 -1
  153. package/dist/cjs/model/enum/Count.js +0 -9
  154. package/dist/cjs/model/enum/Count.js.map +0 -1
  155. package/dist/cjs/model/enum/DeprecatedTextFormat.js +0 -9
  156. package/dist/cjs/model/enum/DeprecatedTextFormat.js.map +0 -1
  157. package/dist/cjs/model/enum/ExampleType.js +0 -11
  158. package/dist/cjs/model/enum/ExampleType.js.map +0 -1
  159. package/dist/cjs/model/enum/PropertyAstKey.js +0 -18
  160. package/dist/cjs/model/enum/PropertyAstKey.js.map +0 -1
  161. package/dist/cjs/model/enum/PropertyFormat.js +0 -14
  162. package/dist/cjs/model/enum/PropertyFormat.js.map +0 -1
  163. package/dist/cjs/model/enum/PropertyJsonKey.js +0 -14
  164. package/dist/cjs/model/enum/PropertyJsonKey.js.map +0 -1
  165. package/dist/cjs/model/enum/PropertyTag.js +0 -8
  166. package/dist/cjs/model/enum/PropertyTag.js.map +0 -1
  167. package/dist/cjs/model/enum/ResourceJsonKey.js +0 -27
  168. package/dist/cjs/model/enum/ResourceJsonKey.js.map +0 -1
  169. package/dist/cjs/model/enum/ResourceTag.js +0 -37
  170. package/dist/cjs/model/enum/ResourceTag.js.map +0 -1
  171. package/dist/cjs/model/enum/Tag.js +0 -21
  172. package/dist/cjs/model/enum/Tag.js.map +0 -1
  173. package/dist/cjs/model/enum/TextFormat.js +0 -16
  174. package/dist/cjs/model/enum/TextFormat.js.map +0 -1
  175. package/dist/cjs/model/enum/TextLocation.js +0 -15
  176. package/dist/cjs/model/enum/TextLocation.js.map +0 -1
  177. package/dist/cjs/model/enum/TextMarkType.js +0 -54
  178. package/dist/cjs/model/enum/TextMarkType.js.map +0 -1
  179. package/dist/cjs/model/enum/TextNodeType.js +0 -35
  180. package/dist/cjs/model/enum/TextNodeType.js.map +0 -1
  181. package/dist/cjs/model/enum/TextSection.js +0 -18
  182. package/dist/cjs/model/enum/TextSection.js.map +0 -1
  183. package/dist/cjs/model/info/enum/InfoFormat.js +0 -11
  184. package/dist/cjs/model/info/enum/InfoFormat.js.map +0 -1
  185. package/dist/cjs/model/info/enum/InfoType.js +0 -12
  186. package/dist/cjs/model/info/enum/InfoType.js.map +0 -1
  187. package/dist/cjs/model/json/BitJson.js +0 -3
  188. package/dist/cjs/model/json/BitJson.js.map +0 -1
  189. package/dist/cjs/model/json/BitWrapperJson.js +0 -3
  190. package/dist/cjs/model/json/BitWrapperJson.js.map +0 -1
  191. package/dist/cjs/model/json/BodyBitJson.js +0 -3
  192. package/dist/cjs/model/json/BodyBitJson.js.map +0 -1
  193. package/dist/cjs/model/json/ParserJson.js +0 -3
  194. package/dist/cjs/model/json/ParserJson.js.map +0 -1
  195. package/dist/cjs/model/json/ResourceJson.js +0 -3
  196. package/dist/cjs/model/json/ResourceJson.js.map +0 -1
  197. package/dist/cjs/model/parser/ParserData.js +0 -3
  198. package/dist/cjs/model/parser/ParserData.js.map +0 -1
  199. package/dist/cjs/model/parser/ParserError.js +0 -3
  200. package/dist/cjs/model/parser/ParserError.js.map +0 -1
  201. package/dist/cjs/model/parser/ParserInfo.js +0 -3
  202. package/dist/cjs/model/parser/ParserInfo.js.map +0 -1
  203. package/dist/cjs/model/parser/ParserLocation.js +0 -3
  204. package/dist/cjs/model/parser/ParserLocation.js.map +0 -1
  205. package/dist/cjs/model/parser/ParserLocationRange.js +0 -3
  206. package/dist/cjs/model/parser/ParserLocationRange.js.map +0 -1
  207. package/dist/cjs/model/parser/TagValidationData.js +0 -3
  208. package/dist/cjs/model/parser/TagValidationData.js.map +0 -1
  209. package/dist/cjs/parser/bitmark/BitmarkParser.js +0 -25
  210. package/dist/cjs/parser/bitmark/BitmarkParser.js.map +0 -1
  211. package/dist/cjs/parser/bitmark/peg/BitmarkPegParser.js +0 -7
  212. package/dist/cjs/parser/bitmark/peg/BitmarkPegParser.js.map +0 -1
  213. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js +0 -614
  214. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js.map +0 -1
  215. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js +0 -716
  216. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +0 -1
  217. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserTypes.js +0 -69
  218. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserTypes.js.map +0 -1
  219. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js +0 -745
  220. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js.map +0 -1
  221. package/dist/cjs/parser/bitmark/peg/PeggyGrammarLocation.js +0 -82
  222. package/dist/cjs/parser/bitmark/peg/PeggyGrammarLocation.js.map +0 -1
  223. package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +0 -260
  224. package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +0 -1
  225. package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +0 -50
  226. package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +0 -1
  227. package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +0 -885
  228. package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +0 -1
  229. package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +0 -27
  230. package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +0 -1
  231. package/dist/cjs/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js +0 -61
  232. package/dist/cjs/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js.map +0 -1
  233. package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +0 -63
  234. package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +0 -1
  235. package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +0 -161
  236. package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +0 -1
  237. package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +0 -55
  238. package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +0 -1
  239. package/dist/cjs/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js +0 -31
  240. package/dist/cjs/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +0 -1
  241. package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +0 -59
  242. package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +0 -1
  243. package/dist/cjs/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js +0 -16
  244. package/dist/cjs/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js.map +0 -1
  245. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.js +0 -29
  246. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.js.map +0 -1
  247. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +0 -20
  248. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +0 -1
  249. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js +0 -45
  250. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +0 -1
  251. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +0 -44
  252. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +0 -1
  253. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js +0 -11
  254. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js.map +0 -1
  255. package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +0 -57
  256. package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +0 -1
  257. package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +0 -158
  258. package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +0 -1
  259. package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +0 -37
  260. package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +0 -1
  261. package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +0 -24
  262. package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +0 -1
  263. package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +0 -163
  264. package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +0 -1
  265. package/dist/cjs/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js +0 -27
  266. package/dist/cjs/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js.map +0 -1
  267. package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +0 -28
  268. package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +0 -1
  269. package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +0 -53
  270. package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +0 -1
  271. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +0 -203
  272. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +0 -1
  273. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +0 -24
  274. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +0 -1
  275. package/dist/cjs/parser/json/JsonParser.js +0 -270
  276. package/dist/cjs/parser/json/JsonParser.js.map +0 -1
  277. package/dist/cjs/parser/text/TextParser.js +0 -148
  278. package/dist/cjs/parser/text/TextParser.js.map +0 -1
  279. package/dist/cjs/parser/text/peg/TextPegParser.js +0 -7
  280. package/dist/cjs/parser/text/peg/TextPegParser.js.map +0 -1
  281. package/dist/cjs/utils/ArrayUtils.js +0 -43
  282. package/dist/cjs/utils/ArrayUtils.js.map +0 -1
  283. package/dist/cjs/utils/BitUtils.js +0 -75
  284. package/dist/cjs/utils/BitUtils.js.map +0 -1
  285. package/dist/cjs/utils/BooleanUtils.js +0 -62
  286. package/dist/cjs/utils/BooleanUtils.js.map +0 -1
  287. package/dist/cjs/utils/FileUtils.js +0 -75
  288. package/dist/cjs/utils/FileUtils.js.map +0 -1
  289. package/dist/cjs/utils/NumberUtils.js +0 -62
  290. package/dist/cjs/utils/NumberUtils.js.map +0 -1
  291. package/dist/cjs/utils/ObjectUtils.js +0 -417
  292. package/dist/cjs/utils/ObjectUtils.js.map +0 -1
  293. package/dist/cjs/utils/StringUtils.js +0 -183
  294. package/dist/cjs/utils/StringUtils.js.map +0 -1
  295. package/dist/cjs/utils/UrlUtils.js +0 -37
  296. package/dist/cjs/utils/UrlUtils.js.map +0 -1
  297. package/dist/cjs/utils/env/Env.js +0 -131
  298. package/dist/cjs/utils/env/Env.js.map +0 -1
  299. package/dist/cjs/utils/env/Environment.js +0 -15
  300. package/dist/cjs/utils/env/Environment.js.map +0 -1
  301. package/dist/cjs/utils/env/Os.js +0 -14
  302. package/dist/cjs/utils/env/Os.js.map +0 -1
  303. package/dist/cjs/utils/env/Version.js +0 -12
  304. package/dist/cjs/utils/env/Version.js.map +0 -1
  305. package/dist/cjs/utils/env/userAgent.js +0 -88
  306. package/dist/cjs/utils/env/userAgent.js.map +0 -1
  307. package/dist/cjs/utils/polyfill/fs.js +0 -14
  308. package/dist/cjs/utils/polyfill/fs.js.map +0 -1
  309. package/dist/esm/BitmarkParserGenerator.js +0 -735
  310. package/dist/esm/BitmarkParserGenerator.js.map +0 -1
  311. package/dist/esm/ast/Ast.js +0 -217
  312. package/dist/esm/ast/Ast.js.map +0 -1
  313. package/dist/esm/ast/BaseBuilder.js +0 -190
  314. package/dist/esm/ast/BaseBuilder.js.map +0 -1
  315. package/dist/esm/ast/Builder.js +0 -1775
  316. package/dist/esm/ast/Builder.js.map +0 -1
  317. package/dist/esm/ast/ResourceBuilder.js +0 -960
  318. package/dist/esm/ast/ResourceBuilder.js.map +0 -1
  319. package/dist/esm/ast/rules/NodeValidator.js +0 -181
  320. package/dist/esm/ast/rules/NodeValidator.js.map +0 -1
  321. package/dist/esm/ast/writer/FileWriter.js +0 -80
  322. package/dist/esm/ast/writer/FileWriter.js.map +0 -1
  323. package/dist/esm/ast/writer/StreamWriter.js +0 -83
  324. package/dist/esm/ast/writer/StreamWriter.js.map +0 -1
  325. package/dist/esm/ast/writer/StringWriter.js +0 -112
  326. package/dist/esm/ast/writer/StringWriter.js.map +0 -1
  327. package/dist/esm/ast/writer/Writer.js +0 -2
  328. package/dist/esm/ast/writer/Writer.js.map +0 -1
  329. package/dist/esm/breakscaping/Breakscape.js +0 -77
  330. package/dist/esm/breakscaping/Breakscape.js.map +0 -1
  331. package/dist/esm/breakscaping/BreakscapeLoop.js +0 -302
  332. package/dist/esm/breakscaping/BreakscapeLoop.js.map +0 -1
  333. package/dist/esm/breakscaping/BreakscapeOptions.js +0 -2
  334. package/dist/esm/breakscaping/BreakscapeOptions.js.map +0 -1
  335. package/dist/esm/breakscaping/BreakscapeRegex.js +0 -177
  336. package/dist/esm/breakscaping/BreakscapeRegex.js.map +0 -1
  337. package/dist/esm/breakscaping/RegexConfigs.js +0 -35
  338. package/dist/esm/breakscaping/RegexConfigs.js.map +0 -1
  339. package/dist/esm/config/Config.js +0 -349
  340. package/dist/esm/config/Config.js.map +0 -1
  341. package/dist/esm/config/ConfigHydrator.js +0 -158
  342. package/dist/esm/config/ConfigHydrator.js.map +0 -1
  343. package/dist/esm/config/raw/bits.js +0 -2612
  344. package/dist/esm/config/raw/bits.js.map +0 -1
  345. package/dist/esm/config/raw/cardSets.js +0 -546
  346. package/dist/esm/config/raw/cardSets.js.map +0 -1
  347. package/dist/esm/config/raw/groups.js +0 -1179
  348. package/dist/esm/config/raw/groups.js.map +0 -1
  349. package/dist/esm/config/raw/properties.js +0 -1003
  350. package/dist/esm/config/raw/properties.js.map +0 -1
  351. package/dist/esm/config/raw/resources.js +0 -100
  352. package/dist/esm/config/raw/resources.js.map +0 -1
  353. package/dist/esm/config/raw/tags.js +0 -45
  354. package/dist/esm/config/raw/tags.js.map +0 -1
  355. package/dist/esm/generated/build-info.js +0 -10
  356. package/dist/esm/generated/build-info.js.map +0 -1
  357. package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js +0 -3163
  358. package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js.map +0 -1
  359. package/dist/esm/generated/parser/text/text-peggy-parser.js +0 -9654
  360. package/dist/esm/generated/parser/text/text-peggy-parser.js.map +0 -1
  361. package/dist/esm/generator/AstWalkerGenerator.js +0 -83
  362. package/dist/esm/generator/AstWalkerGenerator.js.map +0 -1
  363. package/dist/esm/generator/Generator.js +0 -2
  364. package/dist/esm/generator/Generator.js.map +0 -1
  365. package/dist/esm/generator/bitmark/BitmarkFileGenerator.js +0 -46
  366. package/dist/esm/generator/bitmark/BitmarkFileGenerator.js.map +0 -1
  367. package/dist/esm/generator/bitmark/BitmarkGenerator.js +0 -2598
  368. package/dist/esm/generator/bitmark/BitmarkGenerator.js.map +0 -1
  369. package/dist/esm/generator/bitmark/BitmarkStringGenerator.js +0 -48
  370. package/dist/esm/generator/bitmark/BitmarkStringGenerator.js.map +0 -1
  371. package/dist/esm/generator/json/JsonFileGenerator.js +0 -50
  372. package/dist/esm/generator/json/JsonFileGenerator.js.map +0 -1
  373. package/dist/esm/generator/json/JsonGenerator.js +0 -1578
  374. package/dist/esm/generator/json/JsonGenerator.js.map +0 -1
  375. package/dist/esm/generator/json/JsonObjectGenerator.js +0 -48
  376. package/dist/esm/generator/json/JsonObjectGenerator.js.map +0 -1
  377. package/dist/esm/generator/json/JsonStringGenerator.js +0 -47
  378. package/dist/esm/generator/json/JsonStringGenerator.js.map +0 -1
  379. package/dist/esm/generator/text/TextGenerator.js +0 -1196
  380. package/dist/esm/generator/text/TextGenerator.js.map +0 -1
  381. package/dist/esm/index.js +0 -49
  382. package/dist/esm/index.js.map +0 -1
  383. package/dist/esm/info/InfoBuilder.js +0 -40
  384. package/dist/esm/info/InfoBuilder.js.map +0 -1
  385. package/dist/esm/init/init.js +0 -13
  386. package/dist/esm/init/init.js.map +0 -1
  387. package/dist/esm/model/ast/BreakscapedString.js +0 -2
  388. package/dist/esm/model/ast/BreakscapedString.js.map +0 -1
  389. package/dist/esm/model/ast/NodeType.js +0 -554
  390. package/dist/esm/model/ast/NodeType.js.map +0 -1
  391. package/dist/esm/model/ast/Nodes.js +0 -2
  392. package/dist/esm/model/ast/Nodes.js.map +0 -1
  393. package/dist/esm/model/ast/StardardString.js +0 -2
  394. package/dist/esm/model/ast/StardardString.js.map +0 -1
  395. package/dist/esm/model/ast/TextNodes.js +0 -2
  396. package/dist/esm/model/ast/TextNodes.js.map +0 -1
  397. package/dist/esm/model/config/AbstractTagConfig.js +0 -15
  398. package/dist/esm/model/config/AbstractTagConfig.js.map +0 -1
  399. package/dist/esm/model/config/BitConfig.js +0 -69
  400. package/dist/esm/model/config/BitConfig.js.map +0 -1
  401. package/dist/esm/model/config/CardSetConfig.js +0 -23
  402. package/dist/esm/model/config/CardSetConfig.js.map +0 -1
  403. package/dist/esm/model/config/CardVariantConfig.js +0 -29
  404. package/dist/esm/model/config/CardVariantConfig.js.map +0 -1
  405. package/dist/esm/model/config/MarkupTagConfig.js +0 -38
  406. package/dist/esm/model/config/MarkupTagConfig.js.map +0 -1
  407. package/dist/esm/model/config/PropertyTagConfig.js +0 -47
  408. package/dist/esm/model/config/PropertyTagConfig.js.map +0 -1
  409. package/dist/esm/model/config/ResourceTagConfig.js +0 -39
  410. package/dist/esm/model/config/ResourceTagConfig.js.map +0 -1
  411. package/dist/esm/model/config/ResourcesConfig.js +0 -28
  412. package/dist/esm/model/config/ResourcesConfig.js.map +0 -1
  413. package/dist/esm/model/config/TagConfig.js +0 -2
  414. package/dist/esm/model/config/TagConfig.js.map +0 -1
  415. package/dist/esm/model/config/TagsConfig.js +0 -2
  416. package/dist/esm/model/config/TagsConfig.js.map +0 -1
  417. package/dist/esm/model/config/TagsConfigWithInfo.js +0 -2
  418. package/dist/esm/model/config/TagsConfigWithInfo.js.map +0 -1
  419. package/dist/esm/model/config/_Config.js +0 -2
  420. package/dist/esm/model/config/_Config.js.map +0 -1
  421. package/dist/esm/model/config/enum/CardSetConfigKey.js +0 -25
  422. package/dist/esm/model/config/enum/CardSetConfigKey.js.map +0 -1
  423. package/dist/esm/model/config/enum/ConfigKey.js +0 -26
  424. package/dist/esm/model/config/enum/ConfigKey.js.map +0 -1
  425. package/dist/esm/model/config/enum/GroupConfigKey.js +0 -53
  426. package/dist/esm/model/config/enum/GroupConfigKey.js.map +0 -1
  427. package/dist/esm/model/config/enum/GroupConfigType.js +0 -11
  428. package/dist/esm/model/config/enum/GroupConfigType.js.map +0 -1
  429. package/dist/esm/model/config/enum/PropertyConfigKey.js +0 -211
  430. package/dist/esm/model/config/enum/PropertyConfigKey.js.map +0 -1
  431. package/dist/esm/model/config/enum/ResourceConfigKey.js +0 -36
  432. package/dist/esm/model/config/enum/ResourceConfigKey.js.map +0 -1
  433. package/dist/esm/model/config/enum/TagConfigKey.js +0 -22
  434. package/dist/esm/model/config/enum/TagConfigKey.js.map +0 -1
  435. package/dist/esm/model/enum/BitTagType.js +0 -10
  436. package/dist/esm/model/enum/BitTagType.js.map +0 -1
  437. package/dist/esm/model/enum/BitType.js +0 -573
  438. package/dist/esm/model/enum/BitType.js.map +0 -1
  439. package/dist/esm/model/enum/BitmarkGeneratorOutput.js +0 -2
  440. package/dist/esm/model/enum/BitmarkGeneratorOutput.js.map +0 -1
  441. package/dist/esm/model/enum/BitmarkParserType.js +0 -6
  442. package/dist/esm/model/enum/BitmarkParserType.js.map +0 -1
  443. package/dist/esm/model/enum/BitmarkVersion.js +0 -8
  444. package/dist/esm/model/enum/BitmarkVersion.js.map +0 -1
  445. package/dist/esm/model/enum/BodyBitType.js +0 -11
  446. package/dist/esm/model/enum/BodyBitType.js.map +0 -1
  447. package/dist/esm/model/enum/BodyTextFormat.js +0 -11
  448. package/dist/esm/model/enum/BodyTextFormat.js.map +0 -1
  449. package/dist/esm/model/enum/CardSetVersion.js +0 -7
  450. package/dist/esm/model/enum/CardSetVersion.js.map +0 -1
  451. package/dist/esm/model/enum/Count.js +0 -6
  452. package/dist/esm/model/enum/Count.js.map +0 -1
  453. package/dist/esm/model/enum/DeprecatedTextFormat.js +0 -6
  454. package/dist/esm/model/enum/DeprecatedTextFormat.js.map +0 -1
  455. package/dist/esm/model/enum/ExampleType.js +0 -8
  456. package/dist/esm/model/enum/ExampleType.js.map +0 -1
  457. package/dist/esm/model/enum/PropertyAstKey.js +0 -15
  458. package/dist/esm/model/enum/PropertyAstKey.js.map +0 -1
  459. package/dist/esm/model/enum/PropertyFormat.js +0 -11
  460. package/dist/esm/model/enum/PropertyFormat.js.map +0 -1
  461. package/dist/esm/model/enum/PropertyJsonKey.js +0 -11
  462. package/dist/esm/model/enum/PropertyJsonKey.js.map +0 -1
  463. package/dist/esm/model/enum/PropertyTag.js +0 -5
  464. package/dist/esm/model/enum/PropertyTag.js.map +0 -1
  465. package/dist/esm/model/enum/ResourceJsonKey.js +0 -24
  466. package/dist/esm/model/enum/ResourceJsonKey.js.map +0 -1
  467. package/dist/esm/model/enum/ResourceTag.js +0 -34
  468. package/dist/esm/model/enum/ResourceTag.js.map +0 -1
  469. package/dist/esm/model/enum/Tag.js +0 -18
  470. package/dist/esm/model/enum/Tag.js.map +0 -1
  471. package/dist/esm/model/enum/TextFormat.js +0 -13
  472. package/dist/esm/model/enum/TextFormat.js.map +0 -1
  473. package/dist/esm/model/enum/TextLocation.js +0 -12
  474. package/dist/esm/model/enum/TextLocation.js.map +0 -1
  475. package/dist/esm/model/enum/TextMarkType.js +0 -51
  476. package/dist/esm/model/enum/TextMarkType.js.map +0 -1
  477. package/dist/esm/model/enum/TextNodeType.js +0 -32
  478. package/dist/esm/model/enum/TextNodeType.js.map +0 -1
  479. package/dist/esm/model/enum/TextSection.js +0 -15
  480. package/dist/esm/model/enum/TextSection.js.map +0 -1
  481. package/dist/esm/model/info/enum/InfoFormat.js +0 -8
  482. package/dist/esm/model/info/enum/InfoFormat.js.map +0 -1
  483. package/dist/esm/model/info/enum/InfoType.js +0 -9
  484. package/dist/esm/model/info/enum/InfoType.js.map +0 -1
  485. package/dist/esm/model/json/BitJson.js +0 -2
  486. package/dist/esm/model/json/BitJson.js.map +0 -1
  487. package/dist/esm/model/json/BitWrapperJson.js +0 -2
  488. package/dist/esm/model/json/BitWrapperJson.js.map +0 -1
  489. package/dist/esm/model/json/BodyBitJson.js +0 -2
  490. package/dist/esm/model/json/BodyBitJson.js.map +0 -1
  491. package/dist/esm/model/json/ParserJson.js +0 -2
  492. package/dist/esm/model/json/ParserJson.js.map +0 -1
  493. package/dist/esm/model/json/ResourceJson.js +0 -2
  494. package/dist/esm/model/json/ResourceJson.js.map +0 -1
  495. package/dist/esm/model/parser/ParserData.js +0 -2
  496. package/dist/esm/model/parser/ParserData.js.map +0 -1
  497. package/dist/esm/model/parser/ParserError.js +0 -2
  498. package/dist/esm/model/parser/ParserError.js.map +0 -1
  499. package/dist/esm/model/parser/ParserInfo.js +0 -2
  500. package/dist/esm/model/parser/ParserInfo.js.map +0 -1
  501. package/dist/esm/model/parser/ParserLocation.js +0 -2
  502. package/dist/esm/model/parser/ParserLocation.js.map +0 -1
  503. package/dist/esm/model/parser/ParserLocationRange.js +0 -2
  504. package/dist/esm/model/parser/ParserLocationRange.js.map +0 -1
  505. package/dist/esm/model/parser/TagValidationData.js +0 -2
  506. package/dist/esm/model/parser/TagValidationData.js.map +0 -1
  507. package/dist/esm/parser/bitmark/BitmarkParser.js +0 -22
  508. package/dist/esm/parser/bitmark/BitmarkParser.js.map +0 -1
  509. package/dist/esm/parser/bitmark/peg/BitmarkPegParser.js +0 -4
  510. package/dist/esm/parser/bitmark/peg/BitmarkPegParser.js.map +0 -1
  511. package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js +0 -611
  512. package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js.map +0 -1
  513. package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js +0 -713
  514. package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +0 -1
  515. package/dist/esm/parser/bitmark/peg/BitmarkPegParserTypes.js +0 -59
  516. package/dist/esm/parser/bitmark/peg/BitmarkPegParserTypes.js.map +0 -1
  517. package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js +0 -742
  518. package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js.map +0 -1
  519. package/dist/esm/parser/bitmark/peg/PeggyGrammarLocation.js +0 -79
  520. package/dist/esm/parser/bitmark/peg/PeggyGrammarLocation.js.map +0 -1
  521. package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +0 -257
  522. package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +0 -1
  523. package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +0 -48
  524. package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +0 -1
  525. package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +0 -883
  526. package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +0 -1
  527. package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +0 -25
  528. package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +0 -1
  529. package/dist/esm/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js +0 -58
  530. package/dist/esm/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js.map +0 -1
  531. package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +0 -61
  532. package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +0 -1
  533. package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +0 -159
  534. package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +0 -1
  535. package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +0 -52
  536. package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +0 -1
  537. package/dist/esm/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js +0 -29
  538. package/dist/esm/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +0 -1
  539. package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +0 -57
  540. package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +0 -1
  541. package/dist/esm/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js +0 -14
  542. package/dist/esm/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js.map +0 -1
  543. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.js +0 -27
  544. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.js.map +0 -1
  545. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +0 -18
  546. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +0 -1
  547. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js +0 -43
  548. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +0 -1
  549. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +0 -42
  550. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +0 -1
  551. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js +0 -9
  552. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js.map +0 -1
  553. package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +0 -55
  554. package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +0 -1
  555. package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +0 -156
  556. package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +0 -1
  557. package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +0 -35
  558. package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +0 -1
  559. package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +0 -22
  560. package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +0 -1
  561. package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +0 -160
  562. package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +0 -1
  563. package/dist/esm/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js +0 -25
  564. package/dist/esm/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js.map +0 -1
  565. package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +0 -26
  566. package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +0 -1
  567. package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +0 -50
  568. package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +0 -1
  569. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +0 -201
  570. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +0 -1
  571. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +0 -22
  572. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +0 -1
  573. package/dist/esm/parser/json/JsonParser.js +0 -267
  574. package/dist/esm/parser/json/JsonParser.js.map +0 -1
  575. package/dist/esm/parser/text/TextParser.js +0 -145
  576. package/dist/esm/parser/text/TextParser.js.map +0 -1
  577. package/dist/esm/parser/text/peg/TextPegParser.js +0 -4
  578. package/dist/esm/parser/text/peg/TextPegParser.js.map +0 -1
  579. package/dist/esm/utils/ArrayUtils.js +0 -40
  580. package/dist/esm/utils/ArrayUtils.js.map +0 -1
  581. package/dist/esm/utils/BitUtils.js +0 -72
  582. package/dist/esm/utils/BitUtils.js.map +0 -1
  583. package/dist/esm/utils/BooleanUtils.js +0 -59
  584. package/dist/esm/utils/BooleanUtils.js.map +0 -1
  585. package/dist/esm/utils/FileUtils.js +0 -36
  586. package/dist/esm/utils/FileUtils.js.map +0 -1
  587. package/dist/esm/utils/NumberUtils.js +0 -59
  588. package/dist/esm/utils/NumberUtils.js.map +0 -1
  589. package/dist/esm/utils/ObjectUtils.js +0 -411
  590. package/dist/esm/utils/ObjectUtils.js.map +0 -1
  591. package/dist/esm/utils/StringUtils.js +0 -180
  592. package/dist/esm/utils/StringUtils.js.map +0 -1
  593. package/dist/esm/utils/UrlUtils.js +0 -34
  594. package/dist/esm/utils/UrlUtils.js.map +0 -1
  595. package/dist/esm/utils/env/Env.js +0 -127
  596. package/dist/esm/utils/env/Env.js.map +0 -1
  597. package/dist/esm/utils/env/Environment.js +0 -12
  598. package/dist/esm/utils/env/Environment.js.map +0 -1
  599. package/dist/esm/utils/env/Os.js +0 -11
  600. package/dist/esm/utils/env/Os.js.map +0 -1
  601. package/dist/esm/utils/env/Version.js +0 -9
  602. package/dist/esm/utils/env/Version.js.map +0 -1
  603. package/dist/esm/utils/env/userAgent.js +0 -86
  604. package/dist/esm/utils/env/userAgent.js.map +0 -1
  605. package/dist/esm/utils/polyfill/fs.js +0 -10
  606. package/dist/esm/utils/polyfill/fs.js.map +0 -1
  607. package/dist/types/BitmarkParserGenerator.d.ts +0 -478
  608. package/dist/types/BitmarkParserGenerator.d.ts.map +0 -1
  609. package/dist/types/ast/Ast.d.ts +0 -137
  610. package/dist/types/ast/Ast.d.ts.map +0 -1
  611. package/dist/types/ast/BaseBuilder.d.ts +0 -64
  612. package/dist/types/ast/BaseBuilder.d.ts.map +0 -1
  613. package/dist/types/ast/Builder.d.ts +0 -692
  614. package/dist/types/ast/Builder.d.ts.map +0 -1
  615. package/dist/types/ast/ResourceBuilder.d.ts +0 -384
  616. package/dist/types/ast/ResourceBuilder.d.ts.map +0 -1
  617. package/dist/types/ast/rules/NodeValidator.d.ts +0 -28
  618. package/dist/types/ast/rules/NodeValidator.d.ts.map +0 -1
  619. package/dist/types/ast/writer/FileWriter.d.ts +0 -37
  620. package/dist/types/ast/writer/FileWriter.d.ts.map +0 -1
  621. package/dist/types/ast/writer/StreamWriter.d.ts +0 -29
  622. package/dist/types/ast/writer/StreamWriter.d.ts.map +0 -1
  623. package/dist/types/ast/writer/StringWriter.d.ts +0 -30
  624. package/dist/types/ast/writer/StringWriter.d.ts.map +0 -1
  625. package/dist/types/ast/writer/Writer.d.ts +0 -72
  626. package/dist/types/ast/writer/Writer.d.ts.map +0 -1
  627. package/dist/types/breakscaping/Breakscape.d.ts +0 -44
  628. package/dist/types/breakscaping/Breakscape.d.ts.map +0 -1
  629. package/dist/types/breakscaping/BreakscapeLoop.d.ts +0 -142
  630. package/dist/types/breakscaping/BreakscapeLoop.d.ts.map +0 -1
  631. package/dist/types/breakscaping/BreakscapeOptions.d.ts +0 -30
  632. package/dist/types/breakscaping/BreakscapeOptions.d.ts.map +0 -1
  633. package/dist/types/breakscaping/BreakscapeRegex.d.ts +0 -96
  634. package/dist/types/breakscaping/BreakscapeRegex.d.ts.map +0 -1
  635. package/dist/types/breakscaping/RegexConfigs.d.ts +0 -35
  636. package/dist/types/breakscaping/RegexConfigs.d.ts.map +0 -1
  637. package/dist/types/config/Config.d.ts +0 -115
  638. package/dist/types/config/Config.d.ts.map +0 -1
  639. package/dist/types/config/ConfigHydrator.d.ts +0 -16
  640. package/dist/types/config/ConfigHydrator.d.ts.map +0 -1
  641. package/dist/types/config/raw/bits.d.ts +0 -4
  642. package/dist/types/config/raw/bits.d.ts.map +0 -1
  643. package/dist/types/config/raw/cardSets.d.ts +0 -4
  644. package/dist/types/config/raw/cardSets.d.ts.map +0 -1
  645. package/dist/types/config/raw/groups.d.ts +0 -4
  646. package/dist/types/config/raw/groups.d.ts.map +0 -1
  647. package/dist/types/config/raw/properties.d.ts +0 -4
  648. package/dist/types/config/raw/properties.d.ts.map +0 -1
  649. package/dist/types/config/raw/resources.d.ts +0 -4
  650. package/dist/types/config/raw/resources.d.ts.map +0 -1
  651. package/dist/types/config/raw/tags.d.ts +0 -4
  652. package/dist/types/config/raw/tags.d.ts.map +0 -1
  653. package/dist/types/generated/build-info.d.ts +0 -8
  654. package/dist/types/generated/build-info.d.ts.map +0 -1
  655. package/dist/types/generated/parser/bitmark/bitmark-peggy-parser.d.ts +0 -12
  656. package/dist/types/generated/parser/bitmark/bitmark-peggy-parser.d.ts.map +0 -1
  657. package/dist/types/generated/parser/text/text-peggy-parser.d.ts +0 -12
  658. package/dist/types/generated/parser/text/text-peggy-parser.d.ts.map +0 -1
  659. package/dist/types/generator/AstWalkerGenerator.d.ts +0 -32
  660. package/dist/types/generator/AstWalkerGenerator.d.ts.map +0 -1
  661. package/dist/types/generator/Generator.d.ts +0 -6
  662. package/dist/types/generator/Generator.d.ts.map +0 -1
  663. package/dist/types/generator/bitmark/BitmarkFileGenerator.d.ts +0 -41
  664. package/dist/types/generator/bitmark/BitmarkFileGenerator.d.ts.map +0 -1
  665. package/dist/types/generator/bitmark/BitmarkGenerator.d.ts +0 -401
  666. package/dist/types/generator/bitmark/BitmarkGenerator.d.ts.map +0 -1
  667. package/dist/types/generator/bitmark/BitmarkStringGenerator.d.ts +0 -31
  668. package/dist/types/generator/bitmark/BitmarkStringGenerator.d.ts.map +0 -1
  669. package/dist/types/generator/json/JsonFileGenerator.d.ts +0 -45
  670. package/dist/types/generator/json/JsonFileGenerator.d.ts.map +0 -1
  671. package/dist/types/generator/json/JsonGenerator.d.ts +0 -357
  672. package/dist/types/generator/json/JsonGenerator.d.ts.map +0 -1
  673. package/dist/types/generator/json/JsonObjectGenerator.d.ts +0 -32
  674. package/dist/types/generator/json/JsonObjectGenerator.d.ts.map +0 -1
  675. package/dist/types/generator/json/JsonStringGenerator.d.ts +0 -30
  676. package/dist/types/generator/json/JsonStringGenerator.d.ts.map +0 -1
  677. package/dist/types/generator/text/TextGenerator.d.ts +0 -228
  678. package/dist/types/generator/text/TextGenerator.d.ts.map +0 -1
  679. package/dist/types/index.d.ts +0 -50
  680. package/dist/types/index.d.ts.map +0 -1
  681. package/dist/types/info/InfoBuilder.d.ts +0 -18
  682. package/dist/types/info/InfoBuilder.d.ts.map +0 -1
  683. package/dist/types/init/init.d.ts +0 -4
  684. package/dist/types/init/init.d.ts.map +0 -1
  685. package/dist/types/model/ast/BreakscapedString.d.ts +0 -4
  686. package/dist/types/model/ast/BreakscapedString.d.ts.map +0 -1
  687. package/dist/types/model/ast/NodeType.d.ts +0 -1093
  688. package/dist/types/model/ast/NodeType.d.ts.map +0 -1
  689. package/dist/types/model/ast/Nodes.d.ts +0 -268
  690. package/dist/types/model/ast/Nodes.d.ts.map +0 -1
  691. package/dist/types/model/ast/StardardString.d.ts +0 -4
  692. package/dist/types/model/ast/StardardString.d.ts.map +0 -1
  693. package/dist/types/model/ast/TextNodes.d.ts +0 -130
  694. package/dist/types/model/ast/TextNodes.d.ts.map +0 -1
  695. package/dist/types/model/config/AbstractTagConfig.d.ts +0 -24
  696. package/dist/types/model/config/AbstractTagConfig.d.ts.map +0 -1
  697. package/dist/types/model/config/BitConfig.d.ts +0 -48
  698. package/dist/types/model/config/BitConfig.d.ts.map +0 -1
  699. package/dist/types/model/config/CardSetConfig.d.ts +0 -14
  700. package/dist/types/model/config/CardSetConfig.d.ts.map +0 -1
  701. package/dist/types/model/config/CardVariantConfig.d.ts +0 -16
  702. package/dist/types/model/config/CardVariantConfig.d.ts.map +0 -1
  703. package/dist/types/model/config/MarkupTagConfig.d.ts +0 -17
  704. package/dist/types/model/config/MarkupTagConfig.d.ts.map +0 -1
  705. package/dist/types/model/config/PropertyTagConfig.d.ts +0 -23
  706. package/dist/types/model/config/PropertyTagConfig.d.ts.map +0 -1
  707. package/dist/types/model/config/ResourceTagConfig.d.ts +0 -18
  708. package/dist/types/model/config/ResourceTagConfig.d.ts.map +0 -1
  709. package/dist/types/model/config/ResourcesConfig.d.ts +0 -14
  710. package/dist/types/model/config/ResourcesConfig.d.ts.map +0 -1
  711. package/dist/types/model/config/TagConfig.d.ts +0 -5
  712. package/dist/types/model/config/TagConfig.d.ts.map +0 -1
  713. package/dist/types/model/config/TagsConfig.d.ts +0 -5
  714. package/dist/types/model/config/TagsConfig.d.ts.map +0 -1
  715. package/dist/types/model/config/TagsConfigWithInfo.d.ts +0 -9
  716. package/dist/types/model/config/TagsConfigWithInfo.d.ts.map +0 -1
  717. package/dist/types/model/config/_Config.d.ts +0 -119
  718. package/dist/types/model/config/_Config.d.ts.map +0 -1
  719. package/dist/types/model/config/enum/CardSetConfigKey.d.ts +0 -43
  720. package/dist/types/model/config/enum/CardSetConfigKey.d.ts.map +0 -1
  721. package/dist/types/model/config/enum/ConfigKey.d.ts +0 -578
  722. package/dist/types/model/config/enum/ConfigKey.d.ts.map +0 -1
  723. package/dist/types/model/config/enum/GroupConfigKey.d.ts +0 -144
  724. package/dist/types/model/config/enum/GroupConfigKey.d.ts.map +0 -1
  725. package/dist/types/model/config/enum/GroupConfigType.d.ts +0 -16
  726. package/dist/types/model/config/enum/GroupConfigType.d.ts.map +0 -1
  727. package/dist/types/model/config/enum/PropertyConfigKey.d.ts +0 -618
  728. package/dist/types/model/config/enum/PropertyConfigKey.d.ts.map +0 -1
  729. package/dist/types/model/config/enum/ResourceConfigKey.d.ts +0 -87
  730. package/dist/types/model/config/enum/ResourceConfigKey.d.ts.map +0 -1
  731. package/dist/types/model/config/enum/TagConfigKey.d.ts +0 -51
  732. package/dist/types/model/config/enum/TagConfigKey.d.ts.map +0 -1
  733. package/dist/types/model/enum/BitTagType.d.ts +0 -15
  734. package/dist/types/model/enum/BitTagType.d.ts.map +0 -1
  735. package/dist/types/model/enum/BitType.d.ts +0 -1143
  736. package/dist/types/model/enum/BitType.d.ts.map +0 -1
  737. package/dist/types/model/enum/BitmarkGeneratorOutput.d.ts +0 -1
  738. package/dist/types/model/enum/BitmarkGeneratorOutput.d.ts.map +0 -1
  739. package/dist/types/model/enum/BitmarkParserType.d.ts +0 -7
  740. package/dist/types/model/enum/BitmarkParserType.d.ts.map +0 -1
  741. package/dist/types/model/enum/BitmarkVersion.d.ts +0 -12
  742. package/dist/types/model/enum/BitmarkVersion.d.ts.map +0 -1
  743. package/dist/types/model/enum/BodyBitType.d.ts +0 -25
  744. package/dist/types/model/enum/BodyBitType.d.ts.map +0 -1
  745. package/dist/types/model/enum/BodyTextFormat.d.ts +0 -17
  746. package/dist/types/model/enum/BodyTextFormat.d.ts.map +0 -1
  747. package/dist/types/model/enum/CardSetVersion.d.ts +0 -11
  748. package/dist/types/model/enum/CardSetVersion.d.ts.map +0 -1
  749. package/dist/types/model/enum/Count.d.ts +0 -7
  750. package/dist/types/model/enum/Count.d.ts.map +0 -1
  751. package/dist/types/model/enum/DeprecatedTextFormat.d.ts +0 -7
  752. package/dist/types/model/enum/DeprecatedTextFormat.d.ts.map +0 -1
  753. package/dist/types/model/enum/ExampleType.d.ts +0 -13
  754. package/dist/types/model/enum/ExampleType.d.ts.map +0 -1
  755. package/dist/types/model/enum/PropertyAstKey.d.ts +0 -22
  756. package/dist/types/model/enum/PropertyAstKey.d.ts.map +0 -1
  757. package/dist/types/model/enum/PropertyFormat.d.ts +0 -19
  758. package/dist/types/model/enum/PropertyFormat.d.ts.map +0 -1
  759. package/dist/types/model/enum/PropertyJsonKey.d.ts +0 -10
  760. package/dist/types/model/enum/PropertyJsonKey.d.ts.map +0 -1
  761. package/dist/types/model/enum/PropertyTag.d.ts +0 -419
  762. package/dist/types/model/enum/PropertyTag.d.ts.map +0 -1
  763. package/dist/types/model/enum/ResourceJsonKey.d.ts +0 -45
  764. package/dist/types/model/enum/ResourceJsonKey.d.ts.map +0 -1
  765. package/dist/types/model/enum/ResourceTag.d.ts +0 -63
  766. package/dist/types/model/enum/ResourceTag.d.ts.map +0 -1
  767. package/dist/types/model/enum/Tag.d.ts +0 -33
  768. package/dist/types/model/enum/Tag.d.ts.map +0 -1
  769. package/dist/types/model/enum/TextFormat.d.ts +0 -17
  770. package/dist/types/model/enum/TextFormat.d.ts.map +0 -1
  771. package/dist/types/model/enum/TextLocation.d.ts +0 -16
  772. package/dist/types/model/enum/TextLocation.d.ts.map +0 -1
  773. package/dist/types/model/enum/TextMarkType.d.ts +0 -93
  774. package/dist/types/model/enum/TextMarkType.d.ts.map +0 -1
  775. package/dist/types/model/enum/TextNodeType.d.ts +0 -53
  776. package/dist/types/model/enum/TextNodeType.d.ts.map +0 -1
  777. package/dist/types/model/enum/TextSection.d.ts +0 -27
  778. package/dist/types/model/enum/TextSection.d.ts.map +0 -1
  779. package/dist/types/model/info/enum/InfoFormat.d.ts +0 -13
  780. package/dist/types/model/info/enum/InfoFormat.d.ts.map +0 -1
  781. package/dist/types/model/info/enum/InfoType.d.ts +0 -15
  782. package/dist/types/model/info/enum/InfoType.d.ts.map +0 -1
  783. package/dist/types/model/json/BitJson.d.ts +0 -479
  784. package/dist/types/model/json/BitJson.d.ts.map +0 -1
  785. package/dist/types/model/json/BitWrapperJson.d.ts +0 -8
  786. package/dist/types/model/json/BitWrapperJson.d.ts.map +0 -1
  787. package/dist/types/model/json/BodyBitJson.d.ts +0 -81
  788. package/dist/types/model/json/BodyBitJson.d.ts.map +0 -1
  789. package/dist/types/model/json/ParserJson.d.ts +0 -12
  790. package/dist/types/model/json/ParserJson.d.ts.map +0 -1
  791. package/dist/types/model/json/ResourceJson.d.ts +0 -244
  792. package/dist/types/model/json/ResourceJson.d.ts.map +0 -1
  793. package/dist/types/model/parser/ParserData.d.ts +0 -11
  794. package/dist/types/model/parser/ParserData.d.ts.map +0 -1
  795. package/dist/types/model/parser/ParserError.d.ts +0 -17
  796. package/dist/types/model/parser/ParserError.d.ts.map +0 -1
  797. package/dist/types/model/parser/ParserInfo.d.ts +0 -10
  798. package/dist/types/model/parser/ParserInfo.d.ts.map +0 -1
  799. package/dist/types/model/parser/ParserLocation.d.ts +0 -6
  800. package/dist/types/model/parser/ParserLocation.d.ts.map +0 -1
  801. package/dist/types/model/parser/ParserLocationRange.d.ts +0 -10
  802. package/dist/types/model/parser/ParserLocationRange.d.ts.map +0 -1
  803. package/dist/types/model/parser/TagValidationData.d.ts +0 -24
  804. package/dist/types/model/parser/TagValidationData.d.ts.map +0 -1
  805. package/dist/types/parser/bitmark/BitmarkParser.d.ts +0 -21
  806. package/dist/types/parser/bitmark/BitmarkParser.d.ts.map +0 -1
  807. package/dist/types/parser/bitmark/peg/BitmarkPegParser.d.ts +0 -8
  808. package/dist/types/parser/bitmark/peg/BitmarkPegParser.d.ts.map +0 -1
  809. package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts +0 -108
  810. package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts.map +0 -1
  811. package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts +0 -137
  812. package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts.map +0 -1
  813. package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts +0 -333
  814. package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts.map +0 -1
  815. package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts +0 -186
  816. package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts.map +0 -1
  817. package/dist/types/parser/bitmark/peg/PeggyGrammarLocation.d.ts +0 -61
  818. package/dist/types/parser/bitmark/peg/PeggyGrammarLocation.d.ts.map +0 -1
  819. package/dist/types/parser/bitmark/peg/contentProcessors/BodyContentProcessor.d.ts +0 -37
  820. package/dist/types/parser/bitmark/peg/contentProcessors/BodyContentProcessor.d.ts.map +0 -1
  821. package/dist/types/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.d.ts +0 -5
  822. package/dist/types/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.d.ts.map +0 -1
  823. package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts +0 -7
  824. package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts.map +0 -1
  825. package/dist/types/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.d.ts +0 -5
  826. package/dist/types/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.d.ts.map +0 -1
  827. package/dist/types/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.d.ts +0 -15
  828. package/dist/types/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.d.ts.map +0 -1
  829. package/dist/types/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.d.ts +0 -5
  830. package/dist/types/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.d.ts.map +0 -1
  831. package/dist/types/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.d.ts +0 -4
  832. package/dist/types/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.d.ts.map +0 -1
  833. package/dist/types/parser/bitmark/peg/contentProcessors/FooterContentProcessor.d.ts +0 -14
  834. package/dist/types/parser/bitmark/peg/contentProcessors/FooterContentProcessor.d.ts.map +0 -1
  835. package/dist/types/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.d.ts +0 -6
  836. package/dist/types/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.d.ts.map +0 -1
  837. package/dist/types/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.d.ts +0 -5
  838. package/dist/types/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.d.ts.map +0 -1
  839. package/dist/types/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.d.ts +0 -4
  840. package/dist/types/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.d.ts.map +0 -1
  841. package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.d.ts +0 -5
  842. package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.d.ts.map +0 -1
  843. package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.d.ts +0 -5
  844. package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.d.ts.map +0 -1
  845. package/dist/types/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.d.ts +0 -6
  846. package/dist/types/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.d.ts.map +0 -1
  847. package/dist/types/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.d.ts +0 -5
  848. package/dist/types/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.d.ts.map +0 -1
  849. package/dist/types/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.d.ts +0 -4
  850. package/dist/types/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.d.ts.map +0 -1
  851. package/dist/types/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.d.ts +0 -5
  852. package/dist/types/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.d.ts.map +0 -1
  853. package/dist/types/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.d.ts +0 -5
  854. package/dist/types/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.d.ts.map +0 -1
  855. package/dist/types/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.d.ts +0 -5
  856. package/dist/types/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.d.ts.map +0 -1
  857. package/dist/types/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.d.ts +0 -5
  858. package/dist/types/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.d.ts.map +0 -1
  859. package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts +0 -14
  860. package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts.map +0 -1
  861. package/dist/types/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.d.ts +0 -5
  862. package/dist/types/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.d.ts.map +0 -1
  863. package/dist/types/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.d.ts +0 -5
  864. package/dist/types/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.d.ts.map +0 -1
  865. package/dist/types/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.d.ts +0 -11
  866. package/dist/types/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.d.ts.map +0 -1
  867. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts +0 -6
  868. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts.map +0 -1
  869. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.d.ts +0 -4
  870. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.d.ts.map +0 -1
  871. package/dist/types/parser/json/JsonParser.d.ts +0 -59
  872. package/dist/types/parser/json/JsonParser.d.ts.map +0 -1
  873. package/dist/types/parser/text/TextParser.d.ts +0 -55
  874. package/dist/types/parser/text/TextParser.d.ts.map +0 -1
  875. package/dist/types/parser/text/peg/TextPegParser.d.ts +0 -8
  876. package/dist/types/parser/text/peg/TextPegParser.d.ts.map +0 -1
  877. package/dist/types/utils/ArrayUtils.d.ts +0 -25
  878. package/dist/types/utils/ArrayUtils.d.ts.map +0 -1
  879. package/dist/types/utils/BitUtils.d.ts +0 -30
  880. package/dist/types/utils/BitUtils.d.ts.map +0 -1
  881. package/dist/types/utils/BooleanUtils.d.ts +0 -30
  882. package/dist/types/utils/BooleanUtils.d.ts.map +0 -1
  883. package/dist/types/utils/FileUtils.d.ts +0 -12
  884. package/dist/types/utils/FileUtils.d.ts.map +0 -1
  885. package/dist/types/utils/NumberUtils.d.ts +0 -47
  886. package/dist/types/utils/NumberUtils.d.ts.map +0 -1
  887. package/dist/types/utils/ObjectUtils.d.ts +0 -197
  888. package/dist/types/utils/ObjectUtils.d.ts.map +0 -1
  889. package/dist/types/utils/StringUtils.d.ts +0 -77
  890. package/dist/types/utils/StringUtils.d.ts.map +0 -1
  891. package/dist/types/utils/UrlUtils.d.ts +0 -7
  892. package/dist/types/utils/UrlUtils.d.ts.map +0 -1
  893. package/dist/types/utils/env/Env.d.ts +0 -39
  894. package/dist/types/utils/env/Env.d.ts.map +0 -1
  895. package/dist/types/utils/env/Environment.d.ts +0 -21
  896. package/dist/types/utils/env/Environment.d.ts.map +0 -1
  897. package/dist/types/utils/env/Os.d.ts +0 -19
  898. package/dist/types/utils/env/Os.d.ts.map +0 -1
  899. package/dist/types/utils/env/Version.d.ts +0 -10
  900. package/dist/types/utils/env/Version.d.ts.map +0 -1
  901. package/dist/types/utils/env/userAgent.d.ts +0 -11
  902. package/dist/types/utils/env/userAgent.d.ts.map +0 -1
  903. package/dist/types/utils/polyfill/fs.d.ts +0 -6
  904. package/dist/types/utils/polyfill/fs.d.ts.map +0 -1
@@ -1,1775 +0,0 @@
1
- import structuredClone from '@ungap/structured-clone';
2
- import { Breakscape } from '../breakscaping/Breakscape';
3
- import { Config } from '../config/Config';
4
- import { PropertyConfigKey } from '../model/config/enum/PropertyConfigKey';
5
- import { BitType } from '../model/enum/BitType';
6
- import { BodyBitType } from '../model/enum/BodyBitType';
7
- import { DeprecatedTextFormat } from '../model/enum/DeprecatedTextFormat';
8
- import { ResourceTag } from '../model/enum/ResourceTag';
9
- import { TextFormat } from '../model/enum/TextFormat';
10
- import { TextLocation } from '../model/enum/TextLocation';
11
- import { ArrayUtils } from '../utils/ArrayUtils';
12
- import { BitUtils } from '../utils/BitUtils';
13
- import { BooleanUtils } from '../utils/BooleanUtils';
14
- import { NumberUtils } from '../utils/NumberUtils';
15
- import { ObjectUtils } from '../utils/ObjectUtils';
16
- import { StringUtils } from '../utils/StringUtils';
17
- import { env } from '../utils/env/Env';
18
- import { BaseBuilder } from './BaseBuilder';
19
- import { ResourceBuilder } from './ResourceBuilder';
20
- import { NodeValidator } from './rules/NodeValidator';
21
- /**
22
- * Builder to build bitmark AST node programmatically
23
- */
24
- class Builder extends BaseBuilder {
25
- constructor() {
26
- super(...arguments);
27
- this.resourceBuilder = new ResourceBuilder();
28
- }
29
- /**
30
- * Build bitmark node
31
- *
32
- * @param data - data for the node
33
- * @returns
34
- */
35
- buildBitmark(data) {
36
- const { bits, errors } = data;
37
- const node = {
38
- bits,
39
- errors,
40
- };
41
- // Remove Unset Optionals
42
- ObjectUtils.removeUnwantedProperties(node);
43
- return node;
44
- }
45
- /**
46
- * Build bit node
47
- *
48
- * @param data - data for the node
49
- * @returns
50
- */
51
- buildBit(data) {
52
- var _a, _b, _c, _d, _e, _f;
53
- const bitConfig = Config.getBitConfig(data.bitType);
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);
57
- let textFormat = (_a = TextFormat.fromValue(data.textFormat)) !== null && _a !== void 0 ? _a : bitConfig.textFormatDefault;
58
- if (deprecatedTextFormat === DeprecatedTextFormat.bitmarkMinusMinus) {
59
- textFormat = TextFormat.bitmarkText;
60
- }
61
- const context = {
62
- bitConfig,
63
- bitType,
64
- textFormat,
65
- };
66
- // Validate and convert resources, and ensure it is an array
67
- // const resources = ArrayUtils.asArray(resourcesIn);
68
- // Set the card node data
69
- const cardNode = this.buildCardNode(context, data);
70
- // Add reasonableNumOfChars to the bit only for essay bits (in other cases it will be pushed down the tree)
71
- const reasonableNumOfCharsProperty = Config.isOfBitType(data.bitType, BitType.essay)
72
- ? this.toAstProperty(PropertyConfigKey.reasonableNumOfChars, data.reasonableNumOfChars)
73
- : undefined;
74
- const convertedExample = Object.assign({}, this.toExample(data.__isDefaultExample, data.example));
75
- // NOTE: Node order is important and is defined here
76
- const node = Object.assign(Object.assign({ bitType, bitLevel: data.bitLevel, textFormat, resourceType: ResourceTag.fromValue(data.resourceType), isCommented: data.isCommented,
77
- // Properties
78
- 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), isTemplate: this.toAstProperty(PropertyConfigKey.isTemplate, data.isTemplate), isTemplateStripTheme: this.toAstProperty(PropertyConfigKey.isTemplateStripTheme, data.isTemplateStripTheme), 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), processHandInLocation: this.toAstProperty(PropertyConfigKey.processHandInLocation, data.processHandInLocation), 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), tableHeaderWhitespaceNoWrap: this.toAstProperty(PropertyConfigKey.tableHeaderWhitespaceNoWrap, data.tableHeaderWhitespaceNoWrap), 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.toImageResource(context, 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), tocResource: this.toAstProperty(PropertyConfigKey.tocResource, data.tocResource), tocContent: this.toAstProperty(PropertyConfigKey.tocContent, data.tocContent), 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
- // Book data
80
- 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),
81
- // Item, Lead, Hint, Instruction
82
- 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)), {
83
- // Person
84
- imagePlaceholder: this.toImageResource(context, data.imagePlaceholder), resources: ArrayUtils.asArray(this.resourceBuilder.resourceFromResourceJson(context, data.resources)),
85
- // Body, Card, Footer, must be after all other properties except the extraProperties and markup / parser
86
- body: this.buildBody(context, data.body), cardNode, footer: this.buildFooter(context, data.footer),
87
- // Must be after other properties/tags in the AST so key clashes are avoided correctly
88
- extraProperties: this.parseExtraProperties(data.extraProperties), markup: data.markup, parser: data.parser,
89
- // Private properties
90
- __isDefaultExample: (_b = data.__isDefaultExample) !== null && _b !== void 0 ? _b : false });
91
- // Push reasonableNumOfChars down the tree for the interview bits
92
- if (Config.isOfBitType(node.bitType, BitType.interview)) {
93
- this.pushDownTree(context, undefined, undefined, cardNode, 'questions', PropertyConfigKey.reasonableNumOfChars, data.reasonableNumOfChars);
94
- }
95
- // Push reasonableNumOfChars down the tree for the feedback bits
96
- if (Config.isOfBitType(node.bitType, BitType.feedback)) {
97
- this.pushDownTree(context, undefined, undefined, cardNode, ['feedbacks', 'reason'], PropertyConfigKey.reasonableNumOfChars, data.reasonableNumOfChars);
98
- }
99
- // Push isCaseSensitive down the tree for the cloze, match and match-matrix bits
100
- this.pushDownTree(context, [node.body, ...(((_c = cardNode === null || cardNode === void 0 ? void 0 : cardNode.cardBits) === null || _c === void 0 ? void 0 : _c.map((cardBit) => cardBit.body)) || [])], [BodyBitType.gap], undefined, undefined, //'isCaseSensitive',
101
- PropertyConfigKey.isCaseSensitive, (_d = data.isCaseSensitive) !== null && _d !== void 0 ? _d : true);
102
- this.pushDownTree(context, undefined, undefined, cardNode, 'pairs', PropertyConfigKey.isCaseSensitive, (_e = data.isCaseSensitive) !== null && _e !== void 0 ? _e : true);
103
- this.pushDownTree(context, undefined, undefined, cardNode, ['matrix', 'cells'], PropertyConfigKey.isCaseSensitive, (_f = data.isCaseSensitive) !== null && _f !== void 0 ? _f : true);
104
- // If __isDefaultExample is set at the bit level, push the default example down the tree to the relevant nodes
105
- this.pushExampleDownTree(context, node.body, cardNode, node.__isDefaultExample, convertedExample.example);
106
- // Set default values
107
- this.setDefaultBitValues(node);
108
- // Set the 'isExample' flags
109
- this.setIsExampleFlags(node);
110
- // Add the version to the parser info
111
- this.addVersionToParserInfo(node);
112
- // Remove Unset Optionals
113
- ObjectUtils.removeUnwantedProperties(node, {
114
- ignoreAllFalse: true,
115
- ignoreUndefined: ['example'],
116
- ignoreEmptyArrays: ['item', 'lead', 'pageNumber', 'marginNumber', 'hint', 'instruction'],
117
- });
118
- // Validate and correct invalid bits as much as possible
119
- return NodeValidator.validateBit(node);
120
- }
121
- /**
122
- * Build books[] node
123
- *
124
- * @param data - data for the node
125
- * @returns
126
- */
127
- buildBooks(context, data) {
128
- if (StringUtils.isString(data))
129
- return data;
130
- if (!Array.isArray(data))
131
- return undefined;
132
- const nodes = data.map((d) => this.buildBook(context, d)).filter((d) => d != null);
133
- return nodes.length > 0 ? nodes : undefined;
134
- }
135
- /**
136
- * Build choice node
137
- *
138
- * @param data - data for the node
139
- * @returns
140
- */
141
- buildBook(_context, data) {
142
- var _a, _b, _c;
143
- if (!data)
144
- return undefined;
145
- // NOTE: Node order is important and is defined here
146
- const node = {
147
- book: (_a = data.book) !== null && _a !== void 0 ? _a : '',
148
- reference: (_b = data.reference) !== null && _b !== void 0 ? _b : '',
149
- referenceEnd: ((_c = data.referenceEnd) !== null && _c !== void 0 ? _c : undefined),
150
- };
151
- // Remove Unset Optionals
152
- ObjectUtils.removeUnwantedProperties(node, {
153
- ignoreAllFalse: true,
154
- ignoreEmptyString: ['book', 'reference'],
155
- });
156
- return node;
157
- }
158
- /**
159
- * Build feedbackChoices[] node
160
- *
161
- * @param data - data for the node
162
- * @returns
163
- */
164
- buildFeedbackChoices(context, data) {
165
- if (!Array.isArray(data))
166
- return undefined;
167
- const nodes = data.map((d) => this.buildFeedbackChoice(context, d)).filter((d) => d != null);
168
- return nodes.length > 0 ? nodes : undefined;
169
- }
170
- /**
171
- * Build feedbackChoice node
172
- *
173
- * @param data - data for the node
174
- * @returns
175
- */
176
- buildFeedbackChoice(context, data) {
177
- var _a;
178
- if (!data)
179
- return undefined;
180
- // NOTE: Node order is important and is defined here
181
- 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));
182
- // Remove Unset Optionals
183
- ObjectUtils.removeUnwantedProperties(node, {
184
- ignoreAllFalse: true,
185
- ignoreEmptyArrays: ['item', 'hint', 'instruction'],
186
- ignoreUndefined: ['example'],
187
- });
188
- return node;
189
- }
190
- /**
191
- * Build feedbackReason node
192
- *
193
- * @param data - data for the node
194
- * @returns
195
- */
196
- buildFeedbackReason(context, data) {
197
- var _a, _b;
198
- if (!data)
199
- return undefined;
200
- // Set default example
201
- // Not __testAst - there is no default example
202
- const defaultExample = this.handleJsonText(context, TextLocation.tag, 'true');
203
- // NOTE: Node order is important and is defined here
204
- 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 });
205
- // Remove Unset Optionals
206
- ObjectUtils.removeUnwantedProperties(node, {
207
- ignoreAllFalse: true,
208
- ignoreEmptyArrays: ['item', 'hint', 'instruction'],
209
- ignoreUndefined: ['example', 'reasonableNumOfChars'],
210
- });
211
- return node;
212
- }
213
- /**
214
- * Build choice[] node
215
- *
216
- * @param data - data for the node
217
- * @returns
218
- */
219
- buildChoices(context, data) {
220
- if (!Array.isArray(data))
221
- return undefined;
222
- const nodes = data.map((d) => this.buildChoice(context, d)).filter((d) => d != null);
223
- return nodes.length > 0 ? nodes : undefined;
224
- }
225
- /**
226
- * Build choice node
227
- *
228
- * @param data - data for the node
229
- * @returns
230
- */
231
- buildChoice(context, data) {
232
- var _a;
233
- if (!data)
234
- return undefined;
235
- // NOTE: Node order is important and is defined here
236
- 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));
237
- // Remove Unset Optionals
238
- ObjectUtils.removeUnwantedProperties(node, {
239
- ignoreAllFalse: true,
240
- ignoreEmptyArrays: ['item', 'hint', 'instruction'],
241
- ignoreUndefined: ['example'],
242
- });
243
- return node;
244
- }
245
- /**
246
- * Build response[] node
247
- *
248
- * @param data - data for the node
249
- * @returns
250
- */
251
- buildResponses(context, data) {
252
- if (!Array.isArray(data))
253
- return undefined;
254
- const nodes = data.map((d) => this.buildResponse(context, d)).filter((d) => d != null);
255
- return nodes.length > 0 ? nodes : undefined;
256
- }
257
- /**
258
- * Build response node
259
- *
260
- * @param data - data for the node
261
- * @returns
262
- */
263
- buildResponse(context, data) {
264
- var _a;
265
- if (!data)
266
- return undefined;
267
- // NOTE: Node order is important and is defined here
268
- 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));
269
- // Remove Unset Optionals
270
- ObjectUtils.removeUnwantedProperties(node, {
271
- ignoreAllFalse: true,
272
- ignoreEmptyArrays: ['item', 'hint', 'instruction'],
273
- ignoreUndefined: ['example'],
274
- });
275
- return node;
276
- }
277
- /**
278
- * Build bot response[] node
279
- *
280
- * @param data - data for the node
281
- * @returns
282
- */
283
- buildBotResponses(context, data) {
284
- if (!Array.isArray(data))
285
- return undefined;
286
- const nodes = data.map((d) => this.botResponse(context, d)).filter((d) => d != null);
287
- return nodes.length > 0 ? nodes : undefined;
288
- }
289
- /**
290
- * Build bot response node
291
- *
292
- * @param data - data for the node
293
- * @returns
294
- */
295
- botResponse(context, data) {
296
- var _a, _b, _c;
297
- if (!data)
298
- return undefined;
299
- // NOTE: Node order is important and is defined here
300
- const node = {
301
- response: (_a = data.response) !== null && _a !== void 0 ? _a : '',
302
- reaction: (_b = data.reaction) !== null && _b !== void 0 ? _b : '',
303
- feedback: (_c = data.feedback) !== null && _c !== void 0 ? _c : '',
304
- item: this.handleJsonText(context, TextLocation.tag, data.item),
305
- lead: this.handleJsonText(context, TextLocation.tag, data.lead),
306
- hint: this.handleJsonText(context, TextLocation.tag, data.hint),
307
- };
308
- // Remove Unset Optionals
309
- ObjectUtils.removeUnwantedProperties(node, {
310
- ignoreEmptyString: ['response', 'reaction', 'feedback'],
311
- ignoreAllFalse: true,
312
- ignoreEmptyArrays: ['item'],
313
- ignoreUndefined: ['example'],
314
- });
315
- return node;
316
- }
317
- /**
318
- * Build feedbacks[] node
319
- *
320
- * @param data - data for the node
321
- * @returns
322
- */
323
- buildFeedbacks(context, data) {
324
- if (!Array.isArray(data))
325
- return undefined;
326
- const nodes = data.map((d) => this.buildFeedback(context, d)).filter((d) => d != null);
327
- return nodes.length > 0 ? nodes : undefined;
328
- }
329
- /**
330
- * Build feedback node
331
- *
332
- * @param data - data for the node
333
- * @returns
334
- */
335
- buildFeedback(context, data) {
336
- if (!data)
337
- return undefined;
338
- let choices;
339
- let reason;
340
- if (data.choices) {
341
- choices = this.buildFeedbackChoices(context, data.choices);
342
- // Push __isDefaultExample down the tree
343
- // this.pushExampleDownTreeBoolean(context, data.__isDefaultExample, convertedExample.example, true, choices);
344
- }
345
- else {
346
- // No choices, not a valid feedback
347
- return undefined;
348
- }
349
- if (data.reason) {
350
- reason = this.buildFeedbackReason(context, data.reason);
351
- }
352
- // NOTE: Node order is important and is defined here
353
- const node = {
354
- item: this.handleJsonText(context, TextLocation.tag, data.item),
355
- lead: this.handleJsonText(context, TextLocation.tag, data.lead),
356
- hint: this.handleJsonText(context, TextLocation.tag, data.hint),
357
- instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),
358
- // isExample: !!data.__defaultExample,
359
- choices: choices,
360
- reason: reason, // Might be undefined
361
- };
362
- // Remove Unset Optionals
363
- ObjectUtils.removeUnwantedProperties(node, {
364
- ignoreAllFalse: true,
365
- ignoreEmptyArrays: ['item', 'hint', 'instruction'],
366
- });
367
- return node;
368
- }
369
- /**
370
- * Build quizzes[] node
371
- *
372
- * @param data - data for the node
373
- * @returns
374
- */
375
- buildQuizzes(context, data) {
376
- if (!Array.isArray(data))
377
- return undefined;
378
- const nodes = data.map((d) => this.buildQuiz(context, d)).filter((d) => d != null);
379
- return nodes.length > 0 ? nodes : undefined;
380
- }
381
- /**
382
- * Build quiz node
383
- *
384
- * @param data - data for the node
385
- * @returns
386
- */
387
- buildQuiz(context, data) {
388
- if (!data)
389
- return undefined;
390
- const convertedExample = Object.assign({}, this.toExample(data.__isDefaultExample, data.__defaultExample));
391
- let choices;
392
- let responses;
393
- if (data.choices) {
394
- choices = this.buildChoices(context, data.choices);
395
- // Push __isDefaultExample down the tree
396
- this.pushExampleDownTreeBoolean(context, data.__isDefaultExample, convertedExample.example, true, choices);
397
- }
398
- else if (data.responses) {
399
- responses = this.buildResponses(context, data.responses);
400
- // Push __isDefaultExample down the tree
401
- this.pushExampleDownTreeBoolean(context, data.__isDefaultExample, convertedExample.example, false, responses);
402
- }
403
- else {
404
- // No choices or responses, not a valid quiz
405
- return undefined;
406
- }
407
- // NOTE: Node order is important and is defined here
408
- const node = {
409
- item: this.handleJsonText(context, TextLocation.tag, data.item),
410
- lead: this.handleJsonText(context, TextLocation.tag, data.lead),
411
- hint: this.handleJsonText(context, TextLocation.tag, data.hint),
412
- instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),
413
- isExample: !!data.__defaultExample,
414
- choices: choices,
415
- responses: responses,
416
- };
417
- // Remove Unset Optionals
418
- ObjectUtils.removeUnwantedProperties(node, {
419
- ignoreAllFalse: true,
420
- ignoreEmptyArrays: ['item', 'hint', 'instruction'],
421
- });
422
- return node;
423
- }
424
- /**
425
- * Build heading node
426
- *
427
- * @param data - data for the node
428
- * @returns
429
- */
430
- buildHeading(_context, data) {
431
- var _a, _b, _c;
432
- if (!data)
433
- return undefined;
434
- if (data.forKeys == null)
435
- return undefined;
436
- // NOTE: Node order is important and is defined here
437
- const node = {
438
- forKeys: (_a = data.forKeys) !== null && _a !== void 0 ? _a : '',
439
- forValues: (_c = (_b = data.forValues) !== null && _b !== void 0 ? _b : data.__forValuesDefault) !== null && _c !== void 0 ? _c : '',
440
- };
441
- // Remove Unset Optionals
442
- ObjectUtils.removeUnwantedProperties(node, {
443
- ignoreAllFalse: true,
444
- ignoreEmptyString: ['forKeys', 'forValues'],
445
- ignoreEmptyArrays: ['forValues'],
446
- });
447
- return node;
448
- }
449
- /**
450
- * Build pair[] node
451
- *
452
- * @param data - data for the node
453
- * @returns
454
- */
455
- buildPairs(context, data) {
456
- if (!Array.isArray(data))
457
- return undefined;
458
- const nodes = data.map((d) => this.buildPair(context, d)).filter((d) => d != null);
459
- return nodes.length > 0 ? nodes : undefined;
460
- }
461
- /**
462
- * Build pair node
463
- *
464
- * @param data - data for the node
465
- * @returns
466
- */
467
- buildPair(context, data) {
468
- var _a;
469
- if (!data)
470
- return undefined;
471
- // Set default example
472
- const defaultExample = Array.isArray(data.__valuesAst) && data.__valuesAst.length > 0 ? data.__valuesAst[0] : null;
473
- // Process the keyAudio and keyImage resources
474
- const keyAudio = this.resourceBuilder.resourceFromResourceJson(context, data.keyAudio);
475
- const keyImage = this.resourceBuilder.resourceFromResourceJson(context, data.keyImage);
476
- // NOTE: Node order is important and is defined here
477
- const node = Object.assign(Object.assign({ key: (_a = data.key) !== null && _a !== void 0 ? _a : '', keyAudio,
478
- 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: data.values || [], __valuesAst: data.__valuesAst });
479
- // Remove Unset Optionals
480
- ObjectUtils.removeUnwantedProperties(node, {
481
- ignoreAllFalse: true,
482
- ignoreEmptyArrays: ['item', 'hint', 'instruction', 'values'],
483
- ignoreUndefined: ['example', 'isCaseSensitive'],
484
- });
485
- // if (node.key) {
486
- // delete node.keyAudio;
487
- // delete node.keyImage;
488
- // }
489
- // if (node.keyAudio != null) {
490
- // delete node.key;
491
- // delete node.keyImage;
492
- // }
493
- // if (node.keyImage != null) {
494
- // delete node.key;
495
- // delete node.keyAudio;
496
- // }
497
- return node;
498
- }
499
- /**
500
- * Build matrix[] node
501
- *
502
- * @param data - data for the node
503
- * @returns
504
- */
505
- buildMatricies(context, data) {
506
- if (!Array.isArray(data))
507
- return undefined;
508
- const nodes = data.map((d) => this.buildMatrix(context, d)).filter((d) => d != null);
509
- return nodes.length > 0 ? nodes : undefined;
510
- }
511
- /**
512
- * Build matrix node
513
- *
514
- * @param data - data for the node
515
- * @returns
516
- */
517
- buildMatrix(context, data) {
518
- var _a;
519
- if (!data)
520
- return undefined;
521
- // const convertedExample = {
522
- // ...this.toExample(__isDefaultExample, example),
523
- // };
524
- // // Push __isDefaultExample down the tree
525
- // this.pushExampleDownTreeBoolean(__isDefaultExample, convertedExample.example, true, choices);
526
- // this.pushExampleDownTreeBoolean(__isDefaultExample, convertedExample.example, false, responses);
527
- let isExample = false;
528
- // Set isExample for matrix based on isExample for cells
529
- for (const c of data.cells || []) {
530
- if (data.__isDefaultExample && !c.isExample) {
531
- c.isExample = true;
532
- }
533
- isExample = c.isExample ? true : isExample;
534
- }
535
- // NOTE: Node order is important and is defined here
536
- const node = {
537
- key: (_a = data.key) !== null && _a !== void 0 ? _a : '',
538
- item: this.handleJsonText(context, TextLocation.tag, data.item),
539
- lead: this.handleJsonText(context, TextLocation.tag, data.lead),
540
- hint: this.handleJsonText(context, TextLocation.tag, data.hint),
541
- instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),
542
- isExample,
543
- cells: (data.cells || []).map((c) => this.buildMatrixCell(context, c)).filter((c) => c != null),
544
- };
545
- // Remove Unset Optionals
546
- ObjectUtils.removeUnwantedProperties(node, {
547
- ignoreAllFalse: true,
548
- ignoreEmptyArrays: ['hint', 'item', 'cells'],
549
- ignoreUndefined: ['isCaseSensitive'],
550
- });
551
- return node;
552
- }
553
- /**
554
- * Build matrixCell node
555
- *
556
- * @param data - data for the node
557
- * @returns
558
- */
559
- buildMatrixCell(context, data) {
560
- if (!data)
561
- return undefined;
562
- // Set default example
563
- const defaultExample = Array.isArray(data.__valuesAst) && data.__valuesAst.length > 0 ? data.__valuesAst[0] : null;
564
- // NOTE: Node order is important and is defined here
565
- const node = Object.assign(Object.assign({ values: data.values || [], 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 });
566
- // Remove Unset Optionals
567
- ObjectUtils.removeUnwantedProperties(node, {
568
- ignoreAllFalse: true,
569
- ignoreEmptyArrays: ['instruction', 'item', 'values'],
570
- ignoreUndefined: ['example', 'isCaseSensitive'],
571
- });
572
- return node;
573
- }
574
- /**
575
- * Build pronunciation table node
576
- *
577
- * @param data - data for the node
578
- * @returns
579
- */
580
- buildPronunciationTable(context, dataIn) {
581
- if (!dataIn)
582
- return undefined;
583
- // NOTE: Node order is important and is defined here
584
- const node = {
585
- data: (dataIn.data || []).map((row) => (row || []).map((cell) => {
586
- // Process the audio resource
587
- const audio = this.resourceBuilder.resourceFromResourceJson(context, cell.audio);
588
- return {
589
- title: this.handleJsonText(context, TextLocation.tag, cell.title),
590
- body: this.handleJsonText(context, TextLocation.tag, cell.body),
591
- audio,
592
- };
593
- })),
594
- };
595
- // Remove Unset Optionals
596
- // ObjectUtils.removeUnwantedProperties(node, {
597
- // ignoreAllFalse: true,
598
- // });
599
- return node;
600
- }
601
- /**
602
- * Build table node
603
- *
604
- * @param data - data for the node
605
- * @returns
606
- */
607
- buildTable(context, dataIn) {
608
- if (!dataIn)
609
- return undefined;
610
- // NOTE: Node order is important and is defined here
611
- const node = {
612
- columns: (dataIn.columns || []).map((col) => this.handleJsonText(context, TextLocation.tag, col)),
613
- data: (dataIn.data || []).map((row) => (row || []).map((cell) => this.handleJsonText(context, TextLocation.tag, cell))),
614
- };
615
- // Remove Unset Optionals
616
- // ObjectUtils.removeUnwantedProperties(node, {
617
- // ignoreAllFalse: true,
618
- // });
619
- return node;
620
- }
621
- /**
622
- * Build question[] node
623
- *
624
- * @param data - data for the node
625
- * @returns
626
- */
627
- buildQuestions(context, data) {
628
- if (!Array.isArray(data))
629
- return undefined;
630
- const nodes = data.map((d) => this.buildQuestion(context, d)).filter((d) => d != null);
631
- return nodes.length > 0 ? nodes : undefined;
632
- }
633
- /**
634
- * Build question node
635
- *
636
- * @param data - data for the node
637
- * @returns
638
- */
639
- buildQuestion(context, data) {
640
- var _a, _b, _c, _d, _e;
641
- if (!data)
642
- return undefined;
643
- // Set default example
644
- const defaultExample = data.__sampleSolutionAst;
645
- // NOTE: Node order is important and is defined here
646
- 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 });
647
- // Remove Unset Optionals
648
- ObjectUtils.removeUnwantedProperties(node, {
649
- ignoreAllFalse: true,
650
- ignoreEmptyArrays: ['item', 'hint', 'instruction'],
651
- ignoreUndefined: ['example'],
652
- ignoreEmptyString: ['question', 'partialAnswer', 'sampleSolution'],
653
- });
654
- return node;
655
- }
656
- /**
657
- * Build ingredient[] node
658
- *
659
- * @param data - data for the node
660
- * @returns
661
- */
662
- buildIngredients(context, data) {
663
- if (!Array.isArray(data))
664
- return undefined;
665
- const nodes = data.map((d) => this.buildIngredient(context, d)).filter((d) => d != null);
666
- return nodes.length > 0 ? nodes : undefined;
667
- }
668
- /**
669
- * Build ingredient node
670
- *
671
- * @param data - data for the node
672
- * @returns
673
- */
674
- buildIngredient(context, data) {
675
- var _a, _b, _c, _d, _e, _f;
676
- if (!data)
677
- return undefined;
678
- // NOTE: Node order is important and is defined here
679
- const node = {
680
- title: this.handleJsonText(context, TextLocation.tag, data.title),
681
- checked: (_a = data.checked) !== null && _a !== void 0 ? _a : false,
682
- ingredient: this.handleJsonText(context, TextLocation.tag, data.ingredient),
683
- quantity: (_b = data.quantity) !== null && _b !== void 0 ? _b : 0,
684
- unit: (_c = data.unit) !== null && _c !== void 0 ? _c : '',
685
- unitAbbr: (_d = data.unitAbbr) !== null && _d !== void 0 ? _d : '',
686
- decimalPlaces: (_e = data.decimalPlaces) !== null && _e !== void 0 ? _e : 1,
687
- disableCalculation: (_f = data.disableCalculation) !== null && _f !== void 0 ? _f : false,
688
- item: this.handleJsonText(context, TextLocation.tag, data.item),
689
- lead: this.handleJsonText(context, TextLocation.tag, data.lead),
690
- hint: this.handleJsonText(context, TextLocation.tag, data.hint),
691
- };
692
- // Remove Unset Optionals
693
- ObjectUtils.removeUnwantedProperties(node, {
694
- ignoreAllFalse: true,
695
- // ignoreAllEmptyArrays: true,
696
- // ignoreUndefined: ['example'],
697
- ignoreEmptyString: ['item', 'unit'],
698
- });
699
- return node;
700
- }
701
- /**
702
- * Build body node
703
- * - Handles JSON, Bitmark text, and plain text
704
- * - body: set to either string, TextAst, or JSON
705
- * - bodyBits: set to array of BodyBitJson (will be validated and merged into body if it is a string)
706
- * - placeholders: set to placeholders from v2 JSON when body is a v2 JSON string
707
- * - bodyString: set to the original string if body is a string (only used for card body)
708
- *
709
- * @param data - data for the node
710
- * @returns
711
- */
712
- buildBody(context, data) {
713
- if (!data)
714
- return undefined;
715
- let body;
716
- const bodyBits = [];
717
- const placeholders = data.placeholders;
718
- const bodyString = data.bodyString;
719
- const { textFormat } = context;
720
- // Handle JSON type body
721
- const handleJsonBody = () => {
722
- // Attempt to parse a string body as JSON to support the legacy format
723
- if (typeof data.body === 'string') {
724
- try {
725
- body = JSON.parse(data.body);
726
- }
727
- catch (e) {
728
- // Could not parse JSON - set body to null
729
- body = null;
730
- }
731
- }
732
- else {
733
- body = data.body;
734
- }
735
- };
736
- // Handle Bitmark text type body (both AST v3 and plain text v2)
737
- const handleBitmarkTextBody = () => {
738
- var _a;
739
- let rawBody = data.body;
740
- let bodyStr;
741
- const placeholderNodes = {};
742
- // TODO - process body bits through the correct builders.
743
- if (StringUtils.isString(data.body)) {
744
- // Body is a string (legacy bitmark v2, or not bitmarkText)
745
- bodyStr = ((_a = data.body) !== null && _a !== void 0 ? _a : '').trim();
746
- rawBody = [];
747
- }
748
- else if (Array.isArray(data.body)) {
749
- // Body is an array (prosemirror like JSON)
750
- // Already in the correct format
751
- }
752
- else {
753
- // body is invalid
754
- rawBody = [];
755
- }
756
- if (placeholders) {
757
- for (const [key, val] of Object.entries(placeholders)) {
758
- // const bit = this.bodyBitToAst(val);
759
- // placeholderNodes[key] = bit as BodyBit;
760
- placeholderNodes[key] = val;
761
- }
762
- }
763
- if (bodyStr) {
764
- // Bug #7141: Use textFormat for textParser, not always bitmarkText if it is a v2 string body
765
- // However, only use plain text breakscaping the text from the v2 JSON body
766
- // Special v2 Breakscaping
767
- bodyStr = Breakscape.breakscape(bodyStr, {
768
- format: textFormat,
769
- location: TextLocation.body,
770
- v2: true,
771
- });
772
- // Convert placeholders {1} to [!1], etc.
773
- let index = 0;
774
- const newPlaceholderNodes = [];
775
- for (const [key, val] of Object.entries(placeholderNodes)) {
776
- if (bodyStr) {
777
- const newKey = `[!${index}]`;
778
- bodyStr = bodyStr.replace(`${key}`, newKey);
779
- newPlaceholderNodes.push(val);
780
- index++;
781
- }
782
- }
783
- // Convert the body string to AST
784
- rawBody = this.textParser.toAst(bodyStr, {
785
- format: textFormat,
786
- location: TextLocation.body,
787
- });
788
- const replaceBitsRecursive = (bodyText) => {
789
- for (let i = 0, len = bodyText.length; i < len; i++) {
790
- const bodyPart = bodyText[i];
791
- if (bodyPart.type === 'bit') {
792
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
793
- const index = bodyPart.index;
794
- if (newPlaceholderNodes[index] != null) {
795
- bodyText[i] = newPlaceholderNodes[index];
796
- }
797
- }
798
- else {
799
- if (bodyPart.content)
800
- replaceBitsRecursive(bodyPart.content);
801
- }
802
- }
803
- };
804
- // Replace the placeholders with the AST
805
- replaceBitsRecursive(rawBody);
806
- }
807
- // Process the body bits to ensure they are valid
808
- // Walking the body bits will change them, so we should make a copy before processing
809
- rawBody = structuredClone(rawBody);
810
- this.textParser.walkBodyBits(rawBody, (parent, index, bodyBit) => {
811
- // Ensure the body bit is valid
812
- let parsedBit;
813
- switch (bodyBit.type) {
814
- case BodyBitType.gap:
815
- parsedBit = this.buildGap(context, bodyBit);
816
- break;
817
- case BodyBitType.mark:
818
- parsedBit = this.buildMark(context, bodyBit);
819
- break;
820
- case BodyBitType.select:
821
- parsedBit = this.buildSelect(context, bodyBit);
822
- break;
823
- case BodyBitType.highlight:
824
- parsedBit = this.buildHighlight(context, bodyBit);
825
- break;
826
- default:
827
- // TODO?? Ensure other parts are valid
828
- }
829
- if (parsedBit != undefined) {
830
- parent[index] = parsedBit;
831
- bodyBits.push(parsedBit);
832
- }
833
- });
834
- // Set the body
835
- body = rawBody;
836
- // Mark the body as text
837
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
838
- body.__tag = 'text';
839
- };
840
- const handlePlainTextBody = () => {
841
- body = data.body;
842
- };
843
- const isBitmarkText = textFormat === TextFormat.bitmarkText;
844
- if (textFormat === TextFormat.json) {
845
- // JSON
846
- handleJsonBody();
847
- }
848
- else if (isBitmarkText) {
849
- // Bitmark text (either ast or string)
850
- handleBitmarkTextBody();
851
- }
852
- else {
853
- // Text but not bitmark (plain text)
854
- handlePlainTextBody();
855
- }
856
- const node = {
857
- body,
858
- bodyBits,
859
- bodyString,
860
- // Placeholders are only ever parsed into AST, never stored directly
861
- };
862
- return node;
863
- }
864
- /**
865
- * Build footer node
866
- *
867
- * @param data - data for the node
868
- * @returns
869
- */
870
- buildFooter(context, data) {
871
- if (!data)
872
- return undefined;
873
- const node = {
874
- footer: this.handleJsonText(context, TextLocation.body, data.footer),
875
- };
876
- return node;
877
- }
878
- /**
879
- * Build gap node
880
- *
881
- * @param data - data for the node
882
- * @returns
883
- */
884
- buildGap(context, data) {
885
- if (!data)
886
- return undefined;
887
- // Set default example
888
- const defaultExample = Array.isArray(data.__solutionsAst) && data.__solutionsAst.length > 0 ? data.__solutionsAst[0] : null;
889
- // Copy any attributes from 'attrs' to the body bit (data is in 'attrs' when coming from JSON)
890
- data = this.bodyBitCopyFromAttrs(data);
891
- // NOTE: Node order is important and is defined here
892
- const node = Object.assign(Object.assign({ type: BodyBitType.gap, solutions: data.solutions || [], 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: {} });
893
- // Remove Unset Optionals
894
- ObjectUtils.removeUnwantedProperties(node, {
895
- ignoreAllFalse: true,
896
- ignoreAllEmptyArrays: true,
897
- ignoreUndefined: ['example', 'isCaseSensitive'],
898
- });
899
- return node;
900
- }
901
- /**
902
- * Build mark configs node
903
- *
904
- * @param data - data for the node
905
- * @returns
906
- */
907
- buildMarkConfigs(context, data) {
908
- if (!Array.isArray(data))
909
- return undefined;
910
- const nodes = data.map((d) => this.buildMarkConfig(context, d)).filter((d) => d != null);
911
- return nodes.length > 0 ? nodes : undefined;
912
- }
913
- /**
914
- * Build mark config node
915
- *
916
- * @param data - data for the node
917
- * @returns
918
- */
919
- buildMarkConfig(_context, data) {
920
- var _a, _b, _c;
921
- if (!data)
922
- return undefined;
923
- // NOTE: Node order is important and is defined here
924
- const node = {
925
- mark: (_a = data.mark) !== null && _a !== void 0 ? _a : 'unknown',
926
- color: (_b = data.color) !== null && _b !== void 0 ? _b : '',
927
- emphasis: (_c = data.emphasis) !== null && _c !== void 0 ? _c : '',
928
- };
929
- // Remove Unset Optionals
930
- ObjectUtils.removeUnwantedProperties(node, {
931
- ignoreAllEmptyString: true,
932
- });
933
- return node;
934
- }
935
- /**
936
- * Build mark node
937
- *
938
- * @param data - data for the node
939
- * @returns
940
- */
941
- buildMark(context, data) {
942
- var _a, _b;
943
- if (!data)
944
- return undefined;
945
- // Copy any attributes from 'attrs' to the body bit (data is in 'attrs' when coming from JSON)
946
- data = this.bodyBitCopyFromAttrs(data);
947
- // NOTE: Node order is important and is defined here
948
- 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: {} });
949
- // Remove Unset Optionals
950
- ObjectUtils.removeUnwantedProperties(node, {
951
- ignoreAllFalse: true,
952
- ignoreAllEmptyArrays: true,
953
- ignoreUndefined: ['example'],
954
- ignoreEmptyString: ['solution', 'mark'],
955
- });
956
- return node;
957
- }
958
- /**
959
- * Build select node
960
- *
961
- * @param data - data for the node
962
- * @returns
963
- */
964
- buildSelect(context, data) {
965
- var _a, _b;
966
- if (!data)
967
- return undefined;
968
- // Copy any attributes from 'attrs' to the body bit (data is in 'attrs' when coming from JSON)
969
- data = this.bodyBitCopyFromAttrs(data);
970
- // NOTE: Node order is important and is defined here
971
- const node = Object.assign(Object.assign({ type: BodyBitType.select, options: this.buildSelectOptions(context, data.options) || [], prefix: (_a = data.prefix) !== null && _a !== void 0 ? _a : '', postfix: (_b = data.postfix) !== 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(false, undefined, undefined)), { __hintString: data.__hintString, __instructionString: data.__instructionString, attrs: {} });
972
- // Remove Unset Optionals
973
- ObjectUtils.removeUnwantedProperties(node, {
974
- ignoreAllFalse: true,
975
- ignoreAllEmptyArrays: true,
976
- ignoreEmptyString: ['prefix', 'postfix'],
977
- });
978
- return node;
979
- }
980
- /**
981
- * Build selectOption[] node
982
- *
983
- * @param data - data for the node
984
- * @returns
985
- */
986
- buildSelectOptions(context, data) {
987
- if (!Array.isArray(data))
988
- return undefined;
989
- const nodes = data.map((d) => this.buildSelectOption(context, d)).filter((d) => d != null);
990
- return nodes.length > 0 ? nodes : undefined;
991
- }
992
- /**
993
- * Build selectOption node
994
- *
995
- * @param data - data for the node
996
- * @returns
997
- */
998
- buildSelectOption(context, data) {
999
- var _a;
1000
- if (!data)
1001
- return undefined;
1002
- // NOTE: Node order is important and is defined here
1003
- 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));
1004
- // Remove Unset Optionals
1005
- ObjectUtils.removeUnwantedProperties(node, {
1006
- ignoreAllFalse: true,
1007
- ignoreAllEmptyArrays: true,
1008
- ignoreUndefined: ['example'],
1009
- });
1010
- return node;
1011
- }
1012
- /**
1013
- * Build highlight node
1014
- *
1015
- * @param data - data for the node
1016
- * @returns
1017
- */
1018
- buildHighlight(context, data) {
1019
- var _a, _b;
1020
- if (!data)
1021
- return undefined;
1022
- // Copy any attributes from 'attrs' to the body bit (data is in 'attrs' when coming from JSON)
1023
- data = this.bodyBitCopyFromAttrs(data);
1024
- // NOTE: Node order is important and is defined here
1025
- const node = Object.assign(Object.assign({ type: BodyBitType.highlight, texts: this.buildHighlightTexts(context, data.texts) || [], prefix: (_a = data.prefix) !== null && _a !== void 0 ? _a : '', postfix: (_b = data.postfix) !== 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(false, undefined, undefined)), { attrs: {} });
1026
- // Remove Unset Optionals
1027
- ObjectUtils.removeUnwantedProperties(node, {
1028
- ignoreAllFalse: true,
1029
- ignoreAllEmptyArrays: true,
1030
- ignoreEmptyString: ['prefix', 'postfix'],
1031
- });
1032
- return node;
1033
- }
1034
- /**
1035
- * Build highlightText[] node
1036
- *
1037
- * @param data - data for the node
1038
- * @returns
1039
- */
1040
- buildHighlightTexts(context, data) {
1041
- if (!Array.isArray(data))
1042
- return undefined;
1043
- const nodes = data.map((d) => this.buildHighlightText(context, d)).filter((d) => d != null);
1044
- return nodes.length > 0 ? nodes : undefined;
1045
- }
1046
- /**
1047
- * Build highlightText node
1048
- *
1049
- * @param data - data for the node
1050
- * @returns
1051
- */
1052
- buildHighlightText(context, data) {
1053
- var _a;
1054
- if (!data)
1055
- return undefined;
1056
- // NOTE: Node order is important and is defined here
1057
- 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));
1058
- // Remove Unset Optionals
1059
- ObjectUtils.removeUnwantedProperties(node, {
1060
- ignoreAllFalse: true,
1061
- ignoreAllEmptyArrays: true,
1062
- ignoreUndefined: ['example'],
1063
- });
1064
- return node;
1065
- }
1066
- /**
1067
- * Build flashcards node
1068
- *
1069
- * @param data - data for the node
1070
- * @returns
1071
- */
1072
- buildFlashcards(context, data) {
1073
- if (!Array.isArray(data))
1074
- return undefined;
1075
- const nodes = data.map((d) => this.buildFlashcard(context, d)).filter((d) => d != null);
1076
- return nodes.length > 0 ? nodes : undefined;
1077
- }
1078
- /**
1079
- * Build flashcard node
1080
- *
1081
- * @param data - data for the node
1082
- * @returns
1083
- */
1084
- buildFlashcard(context, data) {
1085
- if (!data)
1086
- return undefined;
1087
- // NOTE: Node order is important and is defined here
1088
- const node = Object.assign({ question: this.buildTextAndIcon(context, data.question), answer: this.buildTextAndIcon(context, data.answer), alternativeAnswers: (data.alternativeAnswers || [])
1089
- .map((d) => this.buildTextAndIcon(context, d))
1090
- .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
- // Remove Unset Optionals
1092
- ObjectUtils.removeUnwantedProperties(node, {
1093
- ignoreAllFalse: true,
1094
- ignoreEmptyArrays: ['question', 'answer', 'alternativeAnswers', 'item', 'hint', 'instruction'],
1095
- ignoreUndefined: ['example'],
1096
- });
1097
- return node;
1098
- }
1099
- /**
1100
- * Build definitionListItem[] node
1101
- *
1102
- * @param data - data for the node
1103
- * @returns
1104
- */
1105
- buildDefinitionList(context, data) {
1106
- if (!Array.isArray(data))
1107
- return undefined;
1108
- const nodes = data.map((d) => this.buildDefinitionListItem(context, d)).filter((d) => d != null);
1109
- return nodes.length > 0 ? nodes : undefined;
1110
- }
1111
- /**
1112
- * Build definitionListItem node
1113
- *
1114
- * @param data - data for the node
1115
- * @returns
1116
- */
1117
- buildDefinitionListItem(context, data) {
1118
- if (!data)
1119
- return undefined;
1120
- const { bitType } = context;
1121
- const textAsStrings = Config.isOfBitType(bitType, [BitType.metaSearchDefaultTerms]);
1122
- // NOTE: Node order is important and is defined here
1123
- const node = Object.assign({ term: this.buildTextAndIcon(context, data.term, textAsStrings), definition: this.buildTextAndIcon(context, data.definition, textAsStrings), alternativeDefinitions: (data.alternativeDefinitions || [])
1124
- .map((d) => this.buildTextAndIcon(context, d, textAsStrings))
1125
- .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));
1126
- // Remove Unset Optionals
1127
- ObjectUtils.removeUnwantedProperties(node, {
1128
- ignoreAllFalse: true,
1129
- ignoreEmptyArrays: ['question', 'answer', 'alternativeDefinitions', 'item', 'hint', 'instruction'],
1130
- ignoreUndefined: ['example'],
1131
- });
1132
- return node;
1133
- }
1134
- buildTextAndIcon(context, data, textAsStrings = false) {
1135
- const icon = this.resourceBuilder.resourceFromResourceJson(context, data === null || data === void 0 ? void 0 : data.icon);
1136
- // Ensure text is bitmark text
1137
- let text = this.handleJsonText(context, TextLocation.tag, (data === null || data === void 0 ? void 0 : data.text) || data);
1138
- if (textAsStrings) {
1139
- // Convert the bitmark text to plain text (without breakscaping, as that will happen in the Bitmark Generator)
1140
- text = this.textGenerator
1141
- .generateSync(text, TextFormat.plainText, TextLocation.body, {
1142
- noBreakscaping: true,
1143
- })
1144
- .trim();
1145
- }
1146
- // NOTE: Node order is important and is defined here
1147
- const node = {
1148
- text,
1149
- icon,
1150
- };
1151
- // Remove Unset Optionals
1152
- ObjectUtils.removeUnwantedProperties(node, {
1153
- ignoreEmptyArrays: ['text'],
1154
- ignoreUndefined: ['icon'],
1155
- });
1156
- return node;
1157
- }
1158
- /**
1159
- * Build statement[] node
1160
- *
1161
- * @param data - data for the node
1162
- * @returns
1163
- */
1164
- buildStatements(context, data) {
1165
- if (!Array.isArray(data))
1166
- return undefined;
1167
- const nodes = data.map((d) => this.buildStatement(context, d)).filter((d) => d != null);
1168
- return nodes.length > 0 ? nodes : undefined;
1169
- }
1170
- /**
1171
- * Build statement node
1172
- *
1173
- * @param data - data for the node
1174
- * @returns
1175
- */
1176
- buildStatement(context, data) {
1177
- var _a;
1178
- if (!data)
1179
- return undefined;
1180
- // NOTE: Node order is important and is defined here
1181
- 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));
1182
- // Remove Unset Optionals
1183
- ObjectUtils.removeUnwantedProperties(node, {
1184
- ignoreAllFalse: true,
1185
- // ignoreAllEmptyArrays: true,
1186
- ignoreUndefined: ['example'],
1187
- });
1188
- return node;
1189
- }
1190
- /**
1191
- * Build (image-on-device) imageSource node
1192
- *
1193
- * @param data - data for the node
1194
- * @returns
1195
- */
1196
- buildImageSource(_context, data) {
1197
- if (!data)
1198
- return undefined;
1199
- const { url, mockupId, size, format, trim } = data;
1200
- // NOTE: Node order is important and is defined here
1201
- const node = {
1202
- url: url !== null && url !== void 0 ? url : '',
1203
- mockupId: mockupId !== null && mockupId !== void 0 ? mockupId : '',
1204
- size: (size !== null && size !== void 0 ? size : null),
1205
- format: (format !== null && format !== void 0 ? format : null),
1206
- trim: (BooleanUtils.isBoolean(trim) ? trim : null),
1207
- };
1208
- // Remove Unset Optionals
1209
- ObjectUtils.removeUnwantedProperties(node, {
1210
- ignoreFalse: ['trim'],
1211
- ignoreEmptyString: ['url', 'mockupId'],
1212
- ignoreAllUndefined: true,
1213
- });
1214
- return node;
1215
- }
1216
- /**
1217
- * Build (chat) person node
1218
- *
1219
- * @param data - data for the node
1220
- * @returns
1221
- */
1222
- buildPerson(context, data) {
1223
- if (!data)
1224
- return undefined;
1225
- const { name, title, avatarImage } = data;
1226
- // { name: string; title?: string; avatarImage?: ImageResourceJson }
1227
- // NOTE: Node order is important and is defined here
1228
- const node = {
1229
- name: name !== null && name !== void 0 ? name : '',
1230
- title: (title !== null && title !== void 0 ? title : undefined),
1231
- avatarImage: this.resourceBuilder.resourceFromResourceJson(context, avatarImage),
1232
- };
1233
- // Remove Unset Optionals
1234
- ObjectUtils.removeUnwantedProperties(node, {
1235
- ignoreEmptyString: ['name'],
1236
- ignoreAllUndefined: true,
1237
- });
1238
- return node;
1239
- }
1240
- /**
1241
- * Build (cook-ingredients) technicalTerm node
1242
- *
1243
- * @param data - data for the node
1244
- * @returns
1245
- */
1246
- buildTechnicalTerm(_context, data) {
1247
- if (!data)
1248
- return undefined;
1249
- const { technicalTerm, lang } = data;
1250
- // NOTE: Node order is important and is defined here
1251
- const node = {
1252
- technicalTerm: technicalTerm !== null && technicalTerm !== void 0 ? technicalTerm : '',
1253
- lang: lang !== null && lang !== void 0 ? lang : '',
1254
- };
1255
- // Remove Unset Optionals
1256
- ObjectUtils.removeUnwantedProperties(node, {
1257
- ignoreEmptyString: ['technicalTerm'],
1258
- // ignoreAllUndefined: true,
1259
- });
1260
- return node;
1261
- }
1262
- /**
1263
- * Build (cook-ingredients) servings node
1264
- *
1265
- * @param data - data for the node
1266
- * @returns
1267
- */
1268
- buildServings(_context, data) {
1269
- if (!data)
1270
- return undefined;
1271
- const { servings, unit, unitAbbr, decimalPlaces, disableCalculation, hint } = data;
1272
- // NOTE: Node order is important and is defined here
1273
- const node = {
1274
- servings: servings !== null && servings !== void 0 ? servings : 0,
1275
- unit: unit !== null && unit !== void 0 ? unit : '',
1276
- unitAbbr: unitAbbr !== null && unitAbbr !== void 0 ? unitAbbr : '',
1277
- decimalPlaces: decimalPlaces !== null && decimalPlaces !== void 0 ? decimalPlaces : 1,
1278
- disableCalculation: disableCalculation !== null && disableCalculation !== void 0 ? disableCalculation : false,
1279
- hint: hint !== null && hint !== void 0 ? hint : '',
1280
- };
1281
- // Remove Unset Optionals
1282
- ObjectUtils.removeUnwantedProperties(node, {
1283
- ignoreEmptyString: ['servings', 'unit'],
1284
- // ignoreAllUndefined: true,
1285
- });
1286
- return node;
1287
- }
1288
- /**
1289
- * Build (survey-rating) ratingLevelStart / ratingLevelEnd node
1290
- *
1291
- * @param data - data for the node
1292
- * @returns
1293
- */
1294
- buildRatingLevelStartEnd(context, data) {
1295
- if (!data)
1296
- return undefined;
1297
- const { level, label } = data;
1298
- // NOTE: Node order is important and is defined here
1299
- const node = {
1300
- level: level !== null && level !== void 0 ? level : 0,
1301
- label: this.handleJsonText(context, TextLocation.tag, label),
1302
- };
1303
- // Remove Unset Optionals
1304
- ObjectUtils.removeUnwantedProperties(node, {
1305
- // ignoreEmptyArrays: ['servings', 'unit'],
1306
- // ignoreAllUndefined: true,
1307
- });
1308
- return node;
1309
- }
1310
- // DEPRECATED - TO BE REMOVED IN FUTURE
1311
- // /**
1312
- // * Build captionDefinition node
1313
- // *
1314
- // * @param data - data for the node
1315
- // * @returns
1316
- // */
1317
- // protected buildCaptionDefinition(
1318
- // _context: BuildContext,
1319
- // data: Partial<CaptionDefinitionJson> | undefined,
1320
- // ): CaptionDefinitionJson | undefined {
1321
- // if (!data) return undefined;
1322
- // // NOTE: Node order is important and is defined here
1323
- // const node: CaptionDefinitionJson = {
1324
- // // term: this.convertJsonTextToAstText(data.term),
1325
- // // description: this.convertJsonTextToAstText(data.description),
1326
- // term: data.term ?? '',
1327
- // definition: data.definition ?? '',
1328
- // };
1329
- // // Remove Unset Optionals
1330
- // ObjectUtils.removeUnwantedProperties(node, {
1331
- // ignoreEmptyString: ['term', 'description'],
1332
- // // ignoreAllUndefined: true,
1333
- // });
1334
- // return node;
1335
- // }
1336
- // /**
1337
- // * Build captionDefinitionList node
1338
- // *
1339
- // * @param data - data for the node
1340
- // * @returns
1341
- // */
1342
- // protected buildCaptionDefinitionList(
1343
- // context: BuildContext,
1344
- // data: Partial<CaptionDefinitionListJson> | undefined,
1345
- // ): CaptionDefinitionListJson | undefined {
1346
- // if (!data) return undefined;
1347
- // // NOTE: Node order is important and is defined here
1348
- // const node: CaptionDefinitionListJson = {
1349
- // columns: data.columns || [],
1350
- // definitions: (data.definitions || [])
1351
- // .map((d) => {
1352
- // return this.buildCaptionDefinition(context, {
1353
- // term: d.term,
1354
- // definition: d.definition,
1355
- // });
1356
- // })
1357
- // .filter((d) => d != null),
1358
- // };
1359
- // // Remove Unset Optionals
1360
- // ObjectUtils.removeUnwantedProperties(node, {
1361
- // ignoreAllEmptyArrays: true,
1362
- // });
1363
- // return node;
1364
- // }
1365
- /**
1366
- * Build card bit[] node
1367
- *
1368
- * @param data - data for the node
1369
- * @returns
1370
- */
1371
- buildCardBits(context, data) {
1372
- if (!Array.isArray(data))
1373
- return undefined;
1374
- const nodes = data.map((d) => this.buildCardBit(context, d)).filter((d) => d != null);
1375
- return nodes.length > 0 ? nodes : undefined;
1376
- }
1377
- /**
1378
- * Build card bit node
1379
- *
1380
- * @param data - data for the node
1381
- * @returns
1382
- */
1383
- buildCardBit(context, data) {
1384
- if (!data)
1385
- return undefined;
1386
- const { bitType, textFormat } = context;
1387
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1388
- const node = this.buildBit(Object.assign(Object.assign({}, data), { bitType, textFormat }));
1389
- // // NOTE: Node order is important and is defined here
1390
- // const node: CardBit = {
1391
- // item: this.handleJsonText(data.item),
1392
- // lead: this.handleJsonText(data.lead),
1393
- // hint: this.handleJsonText(data.hint),
1394
- // instruction: this.handleJsonText(data.instruction),
1395
- // ...this.toExample(data.__isDefaultExample, data.example),
1396
- // __isDefaultExample: data.__isDefaultExample ?? false,
1397
- // body: this.buildBody(textFormat, data.body),
1398
- // // Must always be last in the AST so key clashes are avoided correctly with other properties
1399
- // extraProperties: this.parseExtraProperties(data.extraProperties),
1400
- // };
1401
- // Remove Unset Optionals
1402
- ObjectUtils.removeUnwantedProperties(node, {
1403
- ignoreAllFalse: true,
1404
- // ignoreEmptyArrays: ['example'],
1405
- ignoreUndefined: ['example'],
1406
- });
1407
- // Validate and correct invalid bits as much as possible
1408
- return NodeValidator.validateCardBit(node);
1409
- }
1410
- toImageResource(context, data) {
1411
- return ArrayUtils.asSingle(this.resourceBuilder.resourceFromResourceDataJson(context, ResourceTag.image, data === null || data === void 0 ? void 0 : data.image));
1412
- }
1413
- //
1414
- // Private
1415
- //
1416
- buildCardNode(context, data) {
1417
- var _a;
1418
- const node = {
1419
- heading: this.buildHeading(context, data.heading),
1420
- questions: this.buildQuestions(context, data.questions),
1421
- elements: data.elements,
1422
- flashcards: this.buildFlashcards(context, data.flashcards),
1423
- definitions: this.buildDefinitionList(context, (_a = data.definitions) !== null && _a !== void 0 ? _a : data.legend),
1424
- statement: this.buildStatement(context, data.statement),
1425
- statements: this.buildStatements(context, data.statements),
1426
- choices: this.buildChoices(context, data.choices),
1427
- responses: this.buildResponses(context, data.responses),
1428
- feedbacks: this.buildFeedbacks(context, data.feedbacks),
1429
- quizzes: this.buildQuizzes(context, data.quizzes),
1430
- pairs: this.buildPairs(context, data.pairs),
1431
- matrix: this.buildMatricies(context, data.matrix),
1432
- pronunciationTable: this.buildPronunciationTable(context, data.pronunciationTable),
1433
- table: this.buildTable(context, data.table),
1434
- botResponses: this.buildBotResponses(context, data.botResponses),
1435
- ingredients: this.buildIngredients(context, data.ingredients),
1436
- // DEPRECATED - TO BE REMOVED IN FUTURE
1437
- // captionDefinitionList: this.buildCaptionDefinitionList(context, data.captionDefinitionList),
1438
- cardBits: this.buildCardBits(context, data.cardBits),
1439
- };
1440
- // Remove Unset Optionals
1441
- ObjectUtils.removeUnwantedProperties(node);
1442
- return Object.keys(node).length > 0 ? node : undefined;
1443
- }
1444
- /**
1445
- * Copy any attributes from 'attrs' property to the root node (necessary when the input if from JSON)
1446
- * The values in 'attrs' will overwrite any existing values in the node
1447
- *
1448
- * The original object is not modified, a new object is returned
1449
- *
1450
- * @param data
1451
- */
1452
- bodyBitCopyFromAttrs(data) {
1453
- const copy = Object.assign({}, data);
1454
- // Copy any attributes from 'attrs' to the node (necessary when the input if from JSON)
1455
- if (data.attrs) {
1456
- for (const [key, value] of Object.entries(data.attrs)) {
1457
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1458
- copy[key] = value;
1459
- }
1460
- }
1461
- return copy;
1462
- }
1463
- /**
1464
- * Set examples down the tree
1465
- *
1466
- * @param body
1467
- * @param cardNode
1468
- * @param __isDefaultExample
1469
- * @param example
1470
- * @returns true if any of the answers has an example, otherwise undefined
1471
- */
1472
- pushExampleDownTree(context, body, cardNode, __isDefaultExample, example) {
1473
- if (__isDefaultExample || example != null) {
1474
- if (cardNode) {
1475
- this.pushExampleDownTreeString(context, __isDefaultExample, example, cardNode.pairs);
1476
- this.pushExampleDownTreeBoolean(context, __isDefaultExample, example, false, cardNode.flashcards);
1477
- this.pushExampleDownTreeBoolean(context, __isDefaultExample, example, false, cardNode.definitions);
1478
- this.pushExampleDownTreeBoolean(context, __isDefaultExample, example, true, cardNode.choices);
1479
- this.pushExampleDownTreeBoolean(context, __isDefaultExample, example, false, cardNode.responses, cardNode.statements, cardNode.statement);
1480
- if (cardNode.quizzes) {
1481
- for (const quiz of cardNode.quizzes) {
1482
- this.pushExampleDownTreeBoolean(context, __isDefaultExample, example, true, quiz.choices);
1483
- this.pushExampleDownTreeBoolean(context, __isDefaultExample, example, false, quiz.responses);
1484
- }
1485
- }
1486
- if (cardNode.matrix) {
1487
- for (const m of cardNode.matrix) {
1488
- this.pushExampleDownTreeString(context, __isDefaultExample, example, m.cells);
1489
- }
1490
- }
1491
- }
1492
- if (body) {
1493
- this.pushExampleDownTreeBodyBits(context, __isDefaultExample, example, body);
1494
- }
1495
- }
1496
- }
1497
- /**
1498
- * Set examples for boolean nodes
1499
- *
1500
- * @param __isDefaultExample
1501
- * @param example
1502
- * @param onlyCorrect
1503
- * @param nodes
1504
- * @returns true if any of the answers has an example, otherwise undefined
1505
- */
1506
- pushExampleDownTreeBoolean(_context, __isDefaultExample, example, onlyCorrect, ...nodes) {
1507
- if (!__isDefaultExample && example == null)
1508
- return;
1509
- if (Array.isArray(nodes)) {
1510
- for (const ds of nodes) {
1511
- if (ds) {
1512
- const exampleNodes = Array.isArray(ds) ? ds : [ds];
1513
- BitUtils.fillBooleanExample(exampleNodes, __isDefaultExample, example, onlyCorrect);
1514
- }
1515
- }
1516
- }
1517
- }
1518
- /**
1519
- * Set examples for string nodes
1520
- *
1521
- * @param __isDefaultExample
1522
- * @param example
1523
- * @param nodes
1524
- * @returns true if any of the answers has an example, otherwise undefined
1525
- */
1526
- pushExampleDownTreeString(context, __isDefaultExample, example, ...nodes) {
1527
- if (!__isDefaultExample && !example)
1528
- return;
1529
- if (Array.isArray(nodes)) {
1530
- for (const ds of nodes) {
1531
- if (ds) {
1532
- const exampleNodes = Array.isArray(ds) ? ds : [ds];
1533
- BitUtils.fillStringExample(context.textFormat, exampleNodes, __isDefaultExample, example, false);
1534
- }
1535
- }
1536
- }
1537
- }
1538
- pushExampleDownTreeBodyBits(context, __isDefaultExample, example, body) {
1539
- if (!__isDefaultExample && !example)
1540
- return;
1541
- const bodyBitsJson = this.textParser.extractBodyBits(body === null || body === void 0 ? void 0 : body.body);
1542
- for (const part of bodyBitsJson) {
1543
- if (part) {
1544
- switch (part.type) {
1545
- case BodyBitType.gap: {
1546
- const gap = part;
1547
- BitUtils.fillStringExample(context.textFormat, [gap], __isDefaultExample, example, false);
1548
- break;
1549
- }
1550
- case BodyBitType.mark: {
1551
- const mark = part;
1552
- BitUtils.fillBooleanExample([mark], __isDefaultExample, example, false);
1553
- break;
1554
- }
1555
- case BodyBitType.select: {
1556
- const select = part;
1557
- BitUtils.fillBooleanExample(select.options, __isDefaultExample, example, true);
1558
- break;
1559
- }
1560
- case BodyBitType.highlight: {
1561
- const highlight = part;
1562
- BitUtils.fillBooleanExample(highlight.texts, __isDefaultExample, example, true);
1563
- break;
1564
- }
1565
- }
1566
- }
1567
- }
1568
- }
1569
- /**
1570
- * Push a value down the tree, without overriding existing values
1571
- *
1572
- * This function is not type safe and should be used with care
1573
- *
1574
- * @param body/body[] set if the value should be passed down the body to the body bits / card body bits
1575
- * @param bodyBitTypes body bit types to push the value down to
1576
- * @param cardNode set if the value should be passed down the card node
1577
- * @param path path for the value
1578
- * @param value the value to push down
1579
- */
1580
- pushDownTree(_context, body, bodyBitTypes, cardNode, cardNodePath, path, value) {
1581
- if (value === undefined)
1582
- return;
1583
- // Add value to card nodes if required
1584
- if (cardNode && cardNodePath) {
1585
- if (!Array.isArray(cardNodePath))
1586
- cardNodePath = [cardNodePath];
1587
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1588
- const data = ObjectUtils.flatMapPath(cardNode, cardNodePath);
1589
- for (const d of data) {
1590
- if (d[path] == null) {
1591
- d[path] = value;
1592
- }
1593
- }
1594
- }
1595
- // Add value to body bit types if required
1596
- if (body) {
1597
- const bodyArray = (Array.isArray(body) ? body : [body]);
1598
- for (const b of bodyArray) {
1599
- if (b && b.body && bodyBitTypes) {
1600
- const bodyBitsJson = this.textParser.extractBodyBits(b.body);
1601
- if (bodyBitTypes && bodyBitsJson && bodyBitsJson.length > 0) {
1602
- for (const part of bodyBitsJson) {
1603
- if (part) {
1604
- if (bodyBitTypes.indexOf(part.type) !== -1) {
1605
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1606
- const data = part;
1607
- if (data[path] == null) {
1608
- data[path] = value;
1609
- }
1610
- }
1611
- }
1612
- }
1613
- }
1614
- }
1615
- }
1616
- }
1617
- }
1618
- parseExtraProperties(extraProperties) {
1619
- if (!extraProperties)
1620
- return undefined;
1621
- const entries = Object.entries(extraProperties);
1622
- if (entries.length === 0)
1623
- return undefined;
1624
- const res = {};
1625
- for (const [key, value] of entries) {
1626
- res[key] = ArrayUtils.asArray(value) || [value];
1627
- }
1628
- return res;
1629
- }
1630
- /**
1631
- * Set the 'isExample' flags on the bit
1632
- *
1633
- * The flag is set if the bit has an example. The flag is set at each branch level up the tree from
1634
- * where the 'example' exists.
1635
- *
1636
- * @param bit
1637
- */
1638
- setIsExampleFlags(bit) {
1639
- // bit.isExample = false;
1640
- const checkIsExample = (example) => {
1641
- if (!example)
1642
- return false;
1643
- if ( /*example.__isDefaultExample ||*/example.isExample || example.example != undefined) {
1644
- example.isExample = true;
1645
- bit.isExample = true;
1646
- }
1647
- else {
1648
- if (example === bit) {
1649
- example.isExample = !!bit.isExample;
1650
- }
1651
- else {
1652
- example.isExample = false;
1653
- }
1654
- }
1655
- return example.isExample;
1656
- };
1657
- const { body, cardNode } = bit;
1658
- // Body bit level
1659
- const bodyBitsJson = this.textParser.extractBodyBits(body === null || body === void 0 ? void 0 : body.body);
1660
- for (const bodyPart of bodyBitsJson) {
1661
- switch (bodyPart.type) {
1662
- case BodyBitType.gap:
1663
- case BodyBitType.mark: {
1664
- checkIsExample(bodyPart);
1665
- break;
1666
- }
1667
- case BodyBitType.select: {
1668
- const select = bodyPart;
1669
- let hasExample = false;
1670
- for (const option of select.options) {
1671
- hasExample = checkIsExample(option) ? true : hasExample;
1672
- }
1673
- select.isExample = hasExample;
1674
- break;
1675
- }
1676
- case BodyBitType.highlight: {
1677
- const highlight = bodyPart;
1678
- let hasExample = false;
1679
- for (const text of highlight.texts) {
1680
- hasExample = checkIsExample(text) ? true : hasExample;
1681
- }
1682
- highlight.isExample = hasExample;
1683
- break;
1684
- }
1685
- }
1686
- }
1687
- // Card level
1688
- if (cardNode) {
1689
- // flashcards
1690
- for (const v of cardNode.flashcards || []) {
1691
- checkIsExample(v);
1692
- }
1693
- // definitions
1694
- for (const v of cardNode.definitions || []) {
1695
- checkIsExample(v);
1696
- }
1697
- // pairs
1698
- for (const v of cardNode.pairs || []) {
1699
- checkIsExample(v);
1700
- }
1701
- // matrix
1702
- for (const mx of cardNode.matrix || []) {
1703
- let hasExample = false;
1704
- // matrix cell
1705
- for (const v of mx.cells || []) {
1706
- hasExample = checkIsExample(v) ? true : hasExample;
1707
- }
1708
- mx.isExample = hasExample;
1709
- }
1710
- // quizzes
1711
- for (const quiz of cardNode.quizzes || []) {
1712
- let hasExample = false;
1713
- // responses
1714
- for (const v of quiz.responses || []) {
1715
- hasExample = checkIsExample(v) ? true : hasExample;
1716
- }
1717
- // choices
1718
- for (const v of quiz.choices || []) {
1719
- hasExample = checkIsExample(v) ? true : hasExample;
1720
- }
1721
- quiz.isExample = hasExample;
1722
- }
1723
- // responses
1724
- for (const v of cardNode.responses || []) {
1725
- checkIsExample(v);
1726
- }
1727
- // choices
1728
- for (const v of cardNode.choices || []) {
1729
- checkIsExample(v);
1730
- }
1731
- // statements
1732
- for (const v of cardNode.statements || []) {
1733
- checkIsExample(v);
1734
- }
1735
- // statement
1736
- checkIsExample(cardNode.statement);
1737
- // NO: elements
1738
- // questions
1739
- for (const v of cardNode.questions || []) {
1740
- checkIsExample(v);
1741
- }
1742
- }
1743
- // Bit level
1744
- // statement
1745
- checkIsExample(bit.statement);
1746
- // responses
1747
- for (const v of bit.responses || []) {
1748
- checkIsExample(v);
1749
- }
1750
- // choices
1751
- for (const v of bit.choices || []) {
1752
- checkIsExample(v);
1753
- }
1754
- // Bit itself
1755
- checkIsExample(bit);
1756
- }
1757
- setDefaultBitValues(bit) {
1758
- // Set aiGenerated == true for all AI generated bits
1759
- switch (bit.bitType) {
1760
- case BitType.articleAi:
1761
- case BitType.noteAi:
1762
- case BitType.summaryAi:
1763
- bit.aiGenerated = this.toAstProperty(PropertyConfigKey.aiGenerated, true);
1764
- break;
1765
- }
1766
- }
1767
- addVersionToParserInfo(bit) {
1768
- var _a;
1769
- const parser = (_a = bit.parser) !== null && _a !== void 0 ? _a : {};
1770
- parser.version = env.appVersion.full;
1771
- bit.parser = parser;
1772
- }
1773
- }
1774
- export { Builder };
1775
- //# sourceMappingURL=Builder.js.map