@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,1578 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __rest = (this && this.__rest) || function (s, e) {
11
- var t = {};
12
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
- t[p] = s[p];
14
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
- t[p[i]] = s[p[i]];
18
- }
19
- return t;
20
- };
21
- import structuredClone from '@ungap/structured-clone';
22
- import { Ast } from '../../ast/Ast';
23
- import { Breakscape } from '../../breakscaping/Breakscape';
24
- import { Config } from '../../config/Config';
25
- import { NodeType } from '../../model/ast/NodeType';
26
- import { BitType } from '../../model/enum/BitType';
27
- import { BitmarkVersion, DEFAULT_BITMARK_VERSION } from '../../model/enum/BitmarkVersion';
28
- import { BodyBitType } from '../../model/enum/BodyBitType';
29
- import { ExampleType } from '../../model/enum/ExampleType';
30
- import { ResourceTag } from '../../model/enum/ResourceTag';
31
- import { TextFormat } from '../../model/enum/TextFormat';
32
- import { TextLocation } from '../../model/enum/TextLocation';
33
- import { TextNodeType } from '../../model/enum/TextNodeType';
34
- import { TextParser } from '../../parser/text/TextParser';
35
- import { BooleanUtils } from '../../utils/BooleanUtils';
36
- import { NumberUtils } from '../../utils/NumberUtils';
37
- import { AstWalkerGenerator } from '../AstWalkerGenerator';
38
- import { TextGenerator } from '../text/TextGenerator';
39
- const MOVE_BODY_RECURSION_LIMIT = 5000;
40
- const DEFAULT_OPTIONS = {
41
- // debugGenerationInline: true,
42
- };
43
- /**
44
- * Generate bitmark JSON from a bitmark AST
45
- *
46
- *
47
- */
48
- class JsonGenerator extends AstWalkerGenerator {
49
- /**
50
- * Generate bitmark JSON from a bitmark AST
51
- *
52
- * @param writer - destination for the output
53
- * @param options - JSON generation options
54
- */
55
- constructor(writer, options) {
56
- var _a, _b;
57
- super();
58
- this.ast = new Ast();
59
- this.textParser = new TextParser();
60
- // State
61
- this.json = [];
62
- this.bitWrapperJson = {};
63
- this.bitJson = {};
64
- this.textDefault = Breakscape.EMPTY_STRING;
65
- this.bodyDefault = Breakscape.EMPTY_STRING;
66
- this.bodyJson = this.bodyDefault;
67
- this.placeholderIndex = 0;
68
- // Bind callbacks
69
- this.enter = this.enter.bind(this);
70
- this.between = this.between.bind(this);
71
- this.exit = this.exit.bind(this);
72
- this.leaf = this.leaf.bind(this);
73
- this.bodyBitCallback = this.bodyBitCallback.bind(this);
74
- this.bitmarkVersion = (_a = BitmarkVersion.fromValue(options === null || options === void 0 ? void 0 : options.bitmarkVersion)) !== null && _a !== void 0 ? _a : DEFAULT_BITMARK_VERSION;
75
- this.textParserVersion = this.textParser.version();
76
- this.options = Object.assign(Object.assign({}, DEFAULT_OPTIONS), options === null || options === void 0 ? void 0 : options.jsonOptions);
77
- this.debugGenerationInline = (_b = this.options.debugGenerationInline) !== null && _b !== void 0 ? _b : false;
78
- this.jsonPrettifySpace = this.options.prettify === true ? 2 : this.options.prettify || undefined;
79
- // Set defaults according to bitmark version
80
- if (this.bitmarkVersion === BitmarkVersion.v2) {
81
- if (this.options.textAsPlainText === undefined) {
82
- this.options.textAsPlainText = true;
83
- }
84
- }
85
- else {
86
- if (this.options.textAsPlainText === undefined) {
87
- this.options.textAsPlainText = false;
88
- }
89
- }
90
- // Create the text generator for generating v2 texts
91
- this.textGenerator = new TextGenerator(BitmarkVersion.v2, {
92
- // writeCallback: this.write,
93
- bodyBitCallback: this.bodyBitCallback,
94
- debugGenerationInline: this.debugGenerationInline,
95
- });
96
- this.writer = writer;
97
- this.generatePropertyHandlers();
98
- }
99
- /**
100
- * Generate bitmark markup from bitmark AST
101
- *
102
- * @param ast bitmark AST
103
- */
104
- generate(ast) {
105
- return __awaiter(this, void 0, void 0, function* () {
106
- // Reset the state
107
- this.resetState();
108
- // Open the writer
109
- yield this.writer.open();
110
- // Walk the bitmark AST
111
- this.walkAndWrite(ast);
112
- // Write the JSON object to file
113
- this.write(JSON.stringify(this.json, null, this.jsonPrettifySpace));
114
- // Close the writer
115
- yield this.writer.close();
116
- });
117
- }
118
- /**
119
- * Generate text from a bitmark text AST synchronously
120
- *
121
- * @param ast bitmark text AST
122
- */
123
- generateSync(ast) {
124
- // Reset the state
125
- this.resetState();
126
- // Open the writer
127
- this.writer.openSync();
128
- // Walk the bitmark AST
129
- this.walkAndWrite(ast);
130
- // Close the writer
131
- this.writer.closeSync();
132
- }
133
- resetState() {
134
- this.json = [];
135
- this.bitWrapperJson = {};
136
- this.bitJson = {};
137
- this.textDefault = this.options.textAsPlainText ? Breakscape.EMPTY_STRING : [];
138
- this.bodyDefault = this.options.textAsPlainText ? Breakscape.EMPTY_STRING : [];
139
- this.bodyJson = this.bodyDefault;
140
- this.listItem = undefined;
141
- this.placeholderIndex = 0;
142
- this.printed = false;
143
- }
144
- walkAndWrite(ast) {
145
- // Walk the bitmark AST
146
- this.ast.walk(ast, NodeType.bitmarkAst, this, undefined);
147
- }
148
- //
149
- // NODE HANDLERS
150
- //
151
- //
152
- // Non-Terminal nodes (branches)
153
- //
154
- // bitmark
155
- enter_bitmarkAst(_node, _route) {
156
- // Reset the JSON
157
- this.json = [];
158
- }
159
- exit_bitmarkAst(_node, _route) {
160
- // Convert all bitmark text to plain text if required
161
- if (this.options.textAsPlainText) {
162
- // Convert all bitmark text to plain text
163
- this.convertAllBitmarkTextsToStringsForPlainText(this.json);
164
- }
165
- // Walk the entire json object and remove all' '_xxx' properties
166
- // (which are used to store temporary data during the generation process)
167
- this.removeTemporaryProperties(this.json);
168
- }
169
- // bitmarkAst -> bits
170
- // bitmarkAst -> bits -> bitsValue
171
- enter_bitsValue(node, _route) {
172
- var _a, _b;
173
- const bit = node.value;
174
- // Reset
175
- this.bitWrapperJson = {
176
- //
177
- };
178
- this.json.push(this.bitWrapperJson);
179
- this.bitJson = this.createBitJson(bit);
180
- this.bitWrapperJson.bit = this.bitJson;
181
- // Handle example at the root level - this is bit dependent; configuration is in the bit metadata
182
- // There is same logic here to select the correct default value of the example is the default is
183
- // required, and this is bit depenedent.
184
- // This is ugly, but it is even uglier if the defaults at set in the AST.
185
- const bitConfig = Config.getBitConfig(bit.bitType);
186
- const textFormat = this.getTextFormat(_route);
187
- const hasRootExample = !!bitConfig.rootExampleType;
188
- const isBoolean = bitConfig.rootExampleType === ExampleType.boolean;
189
- if (hasRootExample) {
190
- // Calculate the value of the default example
191
- let defaultExample;
192
- if (isBoolean) {
193
- // Boolean example
194
- defaultExample = true;
195
- if (Config.isOfBitType(bit.bitType, BitType.trueFalse1)) {
196
- if (((_b = (_a = bit.cardNode) === null || _a === void 0 ? void 0 : _a.statement) === null || _b === void 0 ? void 0 : _b.isCorrect) !== undefined) {
197
- defaultExample = bit.cardNode.statement.isCorrect;
198
- }
199
- }
200
- }
201
- else {
202
- // String example
203
- // Don't use sampleSolution as the default example for conversation bits
204
- // See: https://github.com/getMoreBrain/cosmic/issues/7293
205
- // defaultExample = (ArrayUtils.asSingle(bit.sampleSolution) as string) ?? '';
206
- defaultExample = 'true';
207
- }
208
- const exampleRes = this.toExample(bit, {
209
- defaultExample,
210
- isBoolean,
211
- textFormat,
212
- });
213
- this.bitJson.isExample = exampleRes.isExample;
214
- this.bitJson.example = exampleRes.example;
215
- }
216
- else if (bit.isExample) {
217
- this.bitJson.isExample = true;
218
- }
219
- // Reset the placeholder index
220
- this.placeholderIndex = 0;
221
- }
222
- exit_bitsValue(_node, _route) {
223
- // Move isExample / example to end of bit JSON from beginning
224
- const isExample = this.bitJson.isExample;
225
- const example = this.bitJson.example;
226
- delete this.bitJson.isExample;
227
- delete this.bitJson.example;
228
- this.bitJson.isExample = isExample;
229
- this.bitJson.example = example;
230
- // Clean up the bit JSON, removing any unwanted values
231
- this.cleanBitJson(this.bitJson);
232
- }
233
- // bitmarkAst -> bits -> bitsValue -> imageSource
234
- enter_imageSource(node, route) {
235
- return this.standardHandler(node, route, NodeType.bitsValue, { array: false });
236
- }
237
- // bitmarkAst -> bits -> bitsValue -> person
238
- enter_person(node, route) {
239
- const bitType = this.getBitType(route);
240
- let keyOverride = 'person';
241
- if (Config.isOfBitType(bitType, BitType.conversationLeft1)) {
242
- // Use the legacy partner property in the JSON for conversation bits, so change to person is backwards compatible
243
- keyOverride = 'partner';
244
- }
245
- return this.standardHandler(node, route, NodeType.bitsValue, { array: false, keyOverride });
246
- }
247
- // bitmarkAst -> bits -> bitsValue -> ratingLevelStart
248
- enter_ratingLevelStart(node, route) {
249
- return this.standardHandler(node, route, NodeType.bitsValue, { array: false });
250
- }
251
- // bitmarkAst -> bits -> bitsValue -> ratingLevelEnd
252
- enter_ratingLevelEnd(node, route) {
253
- return this.standardHandler(node, route, NodeType.bitsValue, { array: false });
254
- }
255
- // bitmarkAst -> bits -> bitsValue -> productId
256
- enter_productId(node, route) {
257
- const productIds = node.value;
258
- // Ignore item that is not at the correct level
259
- const parent = this.getParentNode(route);
260
- if ((parent === null || parent === void 0 ? void 0 : parent.key) !== NodeType.bitsValue)
261
- return true;
262
- const bitType = this.getBitType(route);
263
- if (bitType === BitType.module) {
264
- this.addProperty(this.bitJson, 'productId', productIds, { array: true });
265
- }
266
- else if (productIds.length > 0) {
267
- this.addProperty(this.bitJson, 'productId', productIds[productIds.length - 1], { array: false });
268
- }
269
- // Stop traversal of this branch
270
- return false;
271
- }
272
- // bitmarkAst -> bits -> bitsValue -> markConfig
273
- enter_markConfig(_node, _route) {
274
- // Handler so markConfig is not processed by the default property handler
275
- // Continue traversal
276
- return true;
277
- }
278
- // bitmarkAst -> bits -> bitsValue -> markConfig -> markConfigValue
279
- enter_markConfigValue(node, route) {
280
- const markJson = node.value;
281
- // Ignore item that is not at the correct level
282
- const parent = this.getParentNode(route);
283
- if ((parent === null || parent === void 0 ? void 0 : parent.key) !== NodeType.markConfig)
284
- return true;
285
- if (!this.bitJson.marks)
286
- this.bitJson.marks = [];
287
- this.bitJson.marks.push(markJson);
288
- // Stop traversal of this branch
289
- return false;
290
- }
291
- // bitmarkAst -> bits -> bitsValue -> item
292
- enter_item(node, route) {
293
- return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
294
- }
295
- // bitmarkAst -> bits -> bitsValue -> lead
296
- enter_lead(node, route) {
297
- return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
298
- }
299
- // bitmarkAst -> bits -> bitsValue -> pageNumber
300
- enter_pageNumber(node, route) {
301
- return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
302
- }
303
- // bitmarkAst -> bits -> bitsValue -> marginNumber
304
- enter_marginNumber(node, route) {
305
- return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
306
- }
307
- // bitmarkAst -> bits -> bitsValue -> hint
308
- enter_hint(node, route) {
309
- return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
310
- }
311
- // bitmarkAst -> bits -> bitsValue -> instruction
312
- enter_instruction(node, route) {
313
- return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
314
- }
315
- // bitmarkAst -> bits -> bitsValue -> title
316
- enter_title(node, route) {
317
- // // Ignore title that are not at the bit or card node level as they are handled elsewhere
318
- // const parent = this.getParentNode(route);
319
- // if (parent?.key !== NodeType.bitsValue && parent?.key !== NodeType.cardNode) return;
320
- // this.bitJson.title = node.value;
321
- return this.standardHandler(node, route, [NodeType.bitsValue, NodeType.cardNode], { array: true });
322
- }
323
- // bitmarkAst -> bits -> bitsValue -> subtitle
324
- enter_subtitle(node, route) {
325
- // this.bitJson.subtitle = node.value;
326
- return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
327
- }
328
- // bitmarkAst -> bits -> bitsValue -> caption
329
- enter_caption(node, route) {
330
- return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
331
- }
332
- // bitmarkAst -> bits -> bitsValue -> width
333
- enter_width(node, route) {
334
- var _a;
335
- let value = node.value;
336
- const bitType = this.getBitType(route);
337
- const parent = this.getParentNode(route);
338
- if ((parent === null || parent === void 0 ? void 0 : parent.key) === NodeType.bitsValue && Config.isOfBitType(bitType, BitType.extractorBlock)) {
339
- value = (_a = NumberUtils.asNumber(value, 0)) !== null && _a !== void 0 ? _a : 0;
340
- }
341
- // Add the property
342
- return this.standardHandler(node, route, undefined, { array: false, valueOverride: value });
343
- }
344
- // bitmarkAst -> bits -> bitsValue -> height
345
- enter_height(node, route) {
346
- var _a;
347
- let value = node.value;
348
- const bitType = this.getBitType(route);
349
- const parent = this.getParentNode(route);
350
- if ((parent === null || parent === void 0 ? void 0 : parent.key) === NodeType.bitsValue && Config.isOfBitType(bitType, BitType.extractorBlock)) {
351
- value = (_a = NumberUtils.asNumber(value, 0)) !== null && _a !== void 0 ? _a : 0;
352
- }
353
- // Add the property
354
- return this.standardHandler(node, route, undefined, { array: false, valueOverride: value });
355
- }
356
- // bitmarkAst -> bits -> bitsValue -> extraProperties
357
- enter_extraProperties(node, _route) {
358
- const extraProperties = node.value;
359
- if (!this.options.excludeUnknownProperties && extraProperties) {
360
- for (const [key, values] of Object.entries(extraProperties)) {
361
- let k = key;
362
- if (Object.prototype.hasOwnProperty.call(this.bitJson, key)) {
363
- k = `_${key}`;
364
- }
365
- this.addProperty(this.bitJson, k, values, { array: true });
366
- }
367
- }
368
- }
369
- // bitmarkAst -> bits -> bitsValue -> cardNode -> cardBits -> cardBitsValue
370
- enter_cardBitsValue(node, route) {
371
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
372
- const cardBit = node.value;
373
- // How cardBits are handled depends on the bit type
374
- const bitType = this.getBitType(route);
375
- if (!bitType)
376
- return;
377
- let listItems;
378
- if (bitType === BitType.bookReferenceList) {
379
- if (!this.bitJson.bookReferences)
380
- this.bitJson.bookReferences = [];
381
- const bookReference = {};
382
- this.addProperty(bookReference, 'lang', cardBit.lang, { array: false });
383
- this.addProperty(bookReference, 'refAuthor', (_a = cardBit.refAuthor) !== null && _a !== void 0 ? _a : [], { array: true });
384
- this.addProperty(bookReference, 'refBookTitle', (_b = cardBit.refBookTitle) !== null && _b !== void 0 ? _b : [], { array: false });
385
- this.addProperty(bookReference, 'refPublisher', (_c = cardBit.refPublisher) !== null && _c !== void 0 ? _c : [], { array: true });
386
- this.addProperty(bookReference, 'refPublicationYear', (_d = cardBit.refPublicationYear) !== null && _d !== void 0 ? _d : [], { array: false });
387
- this.addProperty(bookReference, 'citationStyle', (_e = cardBit.citationStyle) !== null && _e !== void 0 ? _e : [], { array: false });
388
- this.bitJson.bookReferences.push(bookReference);
389
- }
390
- else {
391
- // Create the listItems / sections if not already created
392
- if (bitType === BitType.pageFooter) {
393
- if (!this.bitJson.sections)
394
- this.bitJson.sections = [];
395
- listItems = this.bitJson.sections;
396
- }
397
- else {
398
- if (!this.bitJson.listItems)
399
- this.bitJson.listItems = [];
400
- listItems = this.bitJson.listItems;
401
- }
402
- // Create this list item
403
- this.listItem = {
404
- item: ((_f = cardBit.item) !== null && _f !== void 0 ? _f : []),
405
- lead: ((_g = cardBit.lead) !== null && _g !== void 0 ? _g : []),
406
- hint: ((_h = cardBit.hint) !== null && _h !== void 0 ? _h : []),
407
- instruction: ((_j = cardBit.instruction) !== null && _j !== void 0 ? _j : []),
408
- // ...this.toItemLeadHintInstruction(node.value),
409
- body: this.bodyDefault,
410
- };
411
- // Delete unwanted properties
412
- // const nv = node.value;
413
- // const li: Partial<ListItemJson> = this.listItem;
414
- listItems.push(this.listItem);
415
- }
416
- }
417
- exit_cardBitsValue(_node, _route) {
418
- this.listItem = undefined;
419
- }
420
- // bitmarkAst -> bits -> bitsValue -> body
421
- enter_body(node, route) {
422
- const value = node.value;
423
- const parent = this.getParentNode(route);
424
- if (!parent)
425
- return false;
426
- const textFormat = this.getTextFormat(route);
427
- const isBitmarkText = textFormat === TextFormat.bitmarkText;
428
- this.bodyJson = value.body;
429
- // Set the correct body property
430
- if (parent.key === NodeType.bitsValue) {
431
- // Body is at the bit level
432
- this.bitJson.body = this.bodyJson;
433
- const bodyIsBitmarkText = isBitmarkText && this.isBitmarkText(this.bodyJson);
434
- // Convert the body to plain text if required
435
- if (this.options.textAsPlainText && bodyIsBitmarkText) {
436
- const textBody = this.textGenerator.generateSync(this.bodyJson, textFormat, TextLocation.body, {
437
- noBreakscaping: true,
438
- });
439
- this.bitJson.body = (textBody !== null && textBody !== void 0 ? textBody : '').trim();
440
- }
441
- else if (bodyIsBitmarkText) {
442
- // If the body is bitmark text, convert the body bits to move their attributes to the attrs property
443
- this.bitJson.body = this.moveBodyBitPropertiesToAttrs(this.bodyJson);
444
- }
445
- }
446
- else if (parent.key === NodeType.cardBitsValue) {
447
- // Body is at the list item (card bit) level
448
- if (this.listItem)
449
- this.listItem.body = this.bodyJson;
450
- }
451
- // Stop traversal of this branch
452
- return false;
453
- }
454
- bodyBitCallback(bodyBit, _index, _route) {
455
- // console.log('bodyBitCallback', bodyBit, index, route);
456
- var _a;
457
- const placeholder = `{${this.placeholderIndex}}`;
458
- this.placeholderIndex++;
459
- this.bitJson.placeholders = (_a = this.bitJson.placeholders) !== null && _a !== void 0 ? _a : {};
460
- this.bitJson.placeholders[placeholder] = bodyBit;
461
- return placeholder;
462
- }
463
- /**
464
- * Move all properties of body bits to the attrs property.
465
- * This function is called recursively to process all body bits in the body tree.
466
- *
467
- * NOTE: Internally, the body bit is stored as it appears in bitmark v2, but in v3 all the properties
468
- * should be in the `attrs` property. The properies are only moved to 'attrs' for the JSON output
469
- *
470
- * The original body bit is not modified.
471
- * The function returns a new body bit with the properties moved.
472
- *
473
- * @param nodes the body to process, or the subtree to process
474
- * @param recursion leave as default, used for recursion only
475
- * @returns
476
- */
477
- moveBodyBitPropertiesToAttrs(nodes, recursion = 0) {
478
- if (recursion === 0) {
479
- nodes = structuredClone(nodes);
480
- }
481
- else if (recursion > MOVE_BODY_RECURSION_LIMIT) {
482
- throw new Error('Recursion limit exceeded');
483
- }
484
- for (const node of nodes) {
485
- if (node.type !== BodyBitType.text && BodyBitType.values().includes(node.type)) {
486
- const bodyBit = node;
487
- bodyBit.attrs = {};
488
- // Move all properties except type to the attrs property
489
- for (const [key, value] of Object.entries(bodyBit)) {
490
- if (key === 'type' || key === 'attrs')
491
- continue;
492
- bodyBit.attrs[key] = value;
493
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
494
- delete bodyBit[key];
495
- }
496
- }
497
- else if (Array.isArray(node.content)) {
498
- recursion++;
499
- this.moveBodyBitPropertiesToAttrs(node.content, recursion);
500
- }
501
- }
502
- return nodes;
503
- }
504
- // bitmarkAst -> bits -> bitsValue -> footer
505
- enter_footer(node, route) {
506
- return this.standardHandler(node, route, undefined, { array: true, valueOverride: node.value.footer });
507
- }
508
- // bitmarkAst -> bits -> bitsValue -> cardNode -> elements
509
- enter_elements(node, route) {
510
- return this.standardHandler(node, route, undefined, { array: true });
511
- }
512
- // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards
513
- enter_flashcards(node, route) {
514
- return this.standardHandler(node, route, NodeType.cardNode, { array: true, keyOverride: 'cards' });
515
- }
516
- // bitmarkAst -> bits -> bitsValue -> cardNode -> definitions
517
- enter_definitions(node, route) {
518
- return this.standardHandler(node, route, NodeType.cardNode, { array: true });
519
- }
520
- // bitmarkAst -> bits -> bitsValue -> statement
521
- enter_statement(node, route) {
522
- var _a, _b;
523
- const statement = node.value;
524
- // Ignore statement that is not at the cardNode level as it is handled elsewhere
525
- const parent = this.getParentNode(route);
526
- if ((parent === null || parent === void 0 ? void 0 : parent.key) !== NodeType.cardNode)
527
- return;
528
- if (statement) {
529
- this.bitJson.statement = (_a = statement.statement) !== null && _a !== void 0 ? _a : '';
530
- this.bitJson.isCorrect = (_b = statement.isCorrect) !== null && _b !== void 0 ? _b : false;
531
- this.bitJson.example = statement.example;
532
- this.bitJson.isExample = statement.isExample;
533
- }
534
- }
535
- // bitmarkAst -> bits -> bitsValue -> cardNode -> statements -> statementsValue
536
- enter_statements(node, route) {
537
- return this.standardHandler(node, route, NodeType.cardNode, { array: true });
538
- }
539
- // bitmarkAst -> bits -> bitsValue -> choices
540
- // X bitmarkAst -> bits -> bitsValue -> cardNode -> quizzes -> quizzesValue -> choices
541
- // X bitmarkAst -> bits -> bitsValue -> cardNode -> feedbacks -> feedbacksValue -> choices
542
- enter_choices(node, route) {
543
- return this.standardHandler(node, route, NodeType.cardNode, { array: true });
544
- }
545
- // bitmarkAst -> bits -> bitsValue -> responses
546
- // X bitmarkAst -> bits -> bitsValue -> cardNode -> quizzes -> quizzesValue -> responses
547
- enter_responses(node, route) {
548
- return this.standardHandler(node, route, NodeType.cardNode, { array: true });
549
- }
550
- // bitmarkAst -> bits -> bitsValue -> cardNode -> feedbacks
551
- enter_feedbacks(node, route) {
552
- return this.standardHandler(node, route, NodeType.cardNode, { array: true });
553
- }
554
- // bitmarkAst -> bits -> bitsValue -> cardNode -> quizzes
555
- enter_quizzes(node, route) {
556
- return this.standardHandler(node, route, NodeType.cardNode, { array: true });
557
- }
558
- // bitmarkAst -> bits -> bitsValue -> cardNode -> heading
559
- enter_heading(node, route) {
560
- return this.standardHandler(node, route, undefined, { array: false });
561
- }
562
- // bitmarkAst -> bits -> bitsValue -> cardNode -> pairs
563
- enter_pairs(node, route) {
564
- return this.standardHandler(node, route, NodeType.cardNode, { array: true });
565
- }
566
- // bitmarkAst -> bits -> bitsValue -> cardNode -> matrix
567
- enter_matrix(node, route) {
568
- return this.standardHandler(node, route, NodeType.cardNode, { array: true });
569
- }
570
- // bitmarkAst -> bits -> bitsValue -> cardNode -> pronunciationTable
571
- enter_pronunciationTable(node, route) {
572
- return this.standardHandler(node, route, NodeType.cardNode, { array: false });
573
- }
574
- // bitmarkAst -> bits -> bitsValue -> cardNode -> table
575
- enter_table(node, route) {
576
- return this.standardHandler(node, route, NodeType.cardNode, { array: false });
577
- }
578
- // bitmarkAst -> bits -> bitsValue -> cardNode -> questions
579
- enter_questions(node, route) {
580
- return this.standardHandler(node, route, NodeType.cardNode, { array: true });
581
- }
582
- // bitmarkAst -> bits -> bitsValue -> cardNode -> botResponses
583
- enter_botResponses(node, route) {
584
- return this.standardHandler(node, route, NodeType.cardNode, { array: true, keyOverride: 'responses' });
585
- }
586
- // bitmarkAst -> bits -> bitsValue -> cardNode -> ingredients -> ingredientsValue
587
- enter_ingredients(node, route) {
588
- return this.standardHandler(node, route, NodeType.cardNode, { array: true });
589
- }
590
- // bitmarkAst -> bits -> bitsValue -> cardNode -> captionDefinitionList
591
- enter_captionDefinitionList(node, route) {
592
- return this.standardHandler(node, route, NodeType.cardNode, { array: false });
593
- }
594
- // bitmarkAst -> bits -> bitsValue -> backgroundWallpaper
595
- enter_backgroundWallpaper(node, route) {
596
- return this.standardHandler(node, route, NodeType.bitsValue, { array: false });
597
- }
598
- // bitmarkAst -> bits -> bitsValue -> imagePlaceholder
599
- enter_imagePlaceholder(node, route) {
600
- return this.standardHandler(node, route, NodeType.bitsValue, { array: false });
601
- }
602
- // bitmarkAst -> bits -> bitsValue -> resources
603
- enter_resources(node, route) {
604
- var _a, _b;
605
- const resources = node.value;
606
- const bitType = this.getBitType(route);
607
- const resourceType = this.getResourceType(route);
608
- if (!resources || !bitType)
609
- return true;
610
- let resourceJson;
611
- const bitConfig = Config.getBitConfig(bitType);
612
- const bitResourcesConfig = Config.getBitResourcesConfig(bitType, resourceType);
613
- const comboMap = bitResourcesConfig.comboResourceTagTypesMap;
614
- if (bitResourcesConfig.comboResourceTagTypesMap.size > 0) {
615
- // The resource is a combo resource
616
- // Extract the resource types from the combo resource
617
- // NOTE: There should only ever be one combo resource per bit, but the code can handle multiple
618
- // except for overwriting resourceJson
619
- for (const [comboTagType, resourceTags] of comboMap.entries()) {
620
- // Create the combo resource wrapper
621
- const wrapper = {
622
- type: comboTagType,
623
- __typeAlias: comboTagType,
624
- };
625
- // For each of the resources in this combo resource, find the actual resource and add it to the JSON
626
- for (const rt of resourceTags) {
627
- const r = resources.find((r) => r.__typeAlias === rt);
628
- // Extract everything except the type from the resource
629
- if (r) {
630
- const tagConfig = Config.getTagConfigForTag(bitConfig.tags, r.__typeAlias);
631
- const key = (_a = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.jsonKey) !== null && _a !== void 0 ? _a : r.__typeAlias;
632
- const tag = (_b = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.tag) !== null && _b !== void 0 ? _b : r.__typeAlias;
633
- const json = r.__typeAlias === tag ? r : undefined;
634
- if (json) {
635
- for (const [k, v] of Object.entries(json)) {
636
- if (k !== 'type') {
637
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
638
- wrapper[key] = v;
639
- }
640
- }
641
- }
642
- }
643
- }
644
- resourceJson = wrapper;
645
- }
646
- }
647
- else if (Config.isOfBitType(bitType, [BitType.imagesLogoGrave, BitType.prototypeImages])) {
648
- // The resource is a logo-grave / prototpye-images resource
649
- const images = [];
650
- for (const r of resources) {
651
- if (r.type === ResourceTag.image) {
652
- images.push(r);
653
- }
654
- }
655
- if (bitType === BitType.imagesLogoGrave) {
656
- this.bitJson.logos = images;
657
- }
658
- else {
659
- this.bitJson.images = images;
660
- }
661
- }
662
- else {
663
- // This is a standard resource. If there is more than one resource, use the first one.
664
- // There should not be more than one because of validation
665
- if (resources.length >= 1) {
666
- resourceJson = resources[0]; // this.parseResourceToJson(bitType, resources[0]);
667
- }
668
- }
669
- this.bitJson.resource = resourceJson;
670
- return false;
671
- }
672
- // bitmarkAst -> bits -> bitsValue -> level
673
- leaf_level(node, route) {
674
- return this.standardHandler(node, route, NodeType.bitsValue, { array: false });
675
- }
676
- // bitmarkAst -> bits -> bitsValue -> book (array)
677
- enter_book(node, route) {
678
- return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
679
- }
680
- // bitmarkAst -> bits -> bitsValue -> book (single)
681
- leaf_book(node, route) {
682
- return this.standardHandler(node, route, NodeType.bitsValue, { array: false });
683
- }
684
- // bitmarkAst -> bits -> bitsValue -> anchor
685
- leaf_anchor(node, route) {
686
- return this.standardHandler(node, route, NodeType.bitsValue, { array: false });
687
- }
688
- // bitmarkAst -> bits -> bitsValue -> reference
689
- leaf_reference(node, route) {
690
- return this.standardHandler(node, route, NodeType.bitsValue, { array: false });
691
- }
692
- // bitmarkAst -> bits -> bitsValue -> referenceEnd
693
- leaf_referenceEnd(node, route) {
694
- return this.standardHandler(node, route, NodeType.bitsValue, { array: false });
695
- }
696
- // bitmarkAst -> bits -> bitsValue -> markup
697
- leaf_markup(node, _route) {
698
- const bitmark = node.value;
699
- if (bitmark)
700
- this.bitWrapperJson.bitmark = bitmark;
701
- // Stop traversal of this branch
702
- return false;
703
- }
704
- // bitmarkAst -> bits -> bitsValue -> * -> internalComment
705
- enter_internalComment(_node, _route) {
706
- // Stop traversal of this branch, handled in enter_parser()
707
- return false;
708
- }
709
- // bitmarkAst -> bits -> bitsValue -> parser
710
- enter_parser(node, route) {
711
- const parser = node.value;
712
- const bitType = this.getBitType(route);
713
- const parent = this.getParentNode(route);
714
- if (parser && bitType) {
715
- const { version, excessResources: parserExcessResources, warnings, errors } = parser, parserRest = __rest(parser, ["version", "excessResources", "warnings", "errors"]);
716
- const bitmarkVersion = `${this.bitmarkVersion}`;
717
- const textParserVersion = this.textParserVersion;
718
- // Parse resources to JSON from AST
719
- let excessResources;
720
- if (Array.isArray(parserExcessResources) && parserExcessResources.length > 0) {
721
- excessResources = [];
722
- for (const r of parserExcessResources) {
723
- excessResources.push(r);
724
- }
725
- }
726
- // Extract internal comments from the AST and add to the parser
727
- const internalComments = this.getInternalComments(route);
728
- if ((parent === null || parent === void 0 ? void 0 : parent.key) === NodeType.bitsValue) {
729
- // Bit level parser information
730
- this.bitWrapperJson.parser = Object.assign(Object.assign({ version,
731
- bitmarkVersion,
732
- textParserVersion,
733
- internalComments }, parserRest), { warnings,
734
- errors,
735
- excessResources });
736
- if (!this.options.enableWarnings) {
737
- // Remove warnings if not enabled
738
- delete this.bitWrapperJson.parser.warnings;
739
- }
740
- }
741
- else {
742
- // Top level parser information (not specific to a bit)
743
- // TODO - not sure where this error can be written
744
- // this.bitWrapperJson.parser = {
745
- // errors,
746
- // };
747
- }
748
- }
749
- }
750
- // bitmarkAst -> errors
751
- // protected enter_errors(node: NodeInfo, _route: NodeInfo[],
752
- // context: Context): void {
753
- // const errors = node.value as ParserError[] | undefined;
754
- // if (errors && errors.length > 0) {
755
- // // Complete bit is invalid
756
- // // TODO - not sure where this error can be written
757
- // // this.bitWrapperJson.parser = {
758
- // // errors,
759
- // // };
760
- // }
761
- // }
762
- //
763
- // Generated Node Handlers
764
- //
765
- /**
766
- * Generate the handlers for properties, as they are mostly the same, but not quite
767
- */
768
- generatePropertyHandlers() {
769
- var _a;
770
- const propertiesConfig = Config.getRawPropertiesConfig();
771
- for (const propertyConfig of Object.values(propertiesConfig)) {
772
- const astKey = (_a = propertyConfig.astKey) !== null && _a !== void 0 ? _a : propertyConfig.tag;
773
- const funcName = `enter_${astKey}`;
774
- // Skip if the function already exists, allows for custom handlers
775
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
776
- if (typeof this[funcName] === 'function') {
777
- continue;
778
- }
779
- // Skip 'example' property as it is non-standard and handled elsewhere
780
- if (astKey === 'example')
781
- continue;
782
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
783
- this[funcName] = (node, route) => {
784
- var _a;
785
- const value = node.value;
786
- if (value == null)
787
- return;
788
- // if (key === 'progress') debugger;
789
- // Ignore any property that is not at the bit level as that will be handled by a different handler
790
- const parent = this.getParentNode(route);
791
- if ((parent === null || parent === void 0 ? void 0 : parent.key) !== NodeType.bitsValue)
792
- return;
793
- // Convert key as needed
794
- const jsonKey = (_a = propertyConfig.jsonKey) !== null && _a !== void 0 ? _a : propertyConfig.tag;
795
- // Add the property
796
- this.addProperty(this.bitJson, jsonKey, value, { array: !propertyConfig.single });
797
- };
798
- // Bind this
799
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
800
- this[funcName] = this[funcName].bind(this);
801
- }
802
- }
803
- // // END NODE HANDLERS
804
- //
805
- // HELPER FUNCTIONS
806
- //
807
- /**
808
- * Default handler for properties.
809
- *
810
- * @param node the node
811
- * @param route the route to the node
812
- * @param parentNodeTypes the parent node types for which to handle the node
813
- * @returns
814
- */
815
- standardHandler(node, route, parentNodeTypes, options) {
816
- var _a, _b;
817
- // Ignore items not at the nodeType level
818
- if (parentNodeTypes) {
819
- const nodeTypeArray = Array.isArray(parentNodeTypes) ? parentNodeTypes : [parentNodeTypes];
820
- const parent = this.getParentNode(route);
821
- if (!(parent === null || parent === void 0 ? void 0 : parent.key) || !nodeTypeArray.includes(parent === null || parent === void 0 ? void 0 : parent.key))
822
- return true;
823
- }
824
- // Add the property
825
- this.addProperty(this.bitJson, (_a = options.keyOverride) !== null && _a !== void 0 ? _a : node.key, (_b = options.valueOverride) !== null && _b !== void 0 ? _b : node.value, options);
826
- // Stop traversal of this branch
827
- return false;
828
- }
829
- addProperty(
830
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
831
- target, name, values, options) {
832
- if (values !== undefined) {
833
- let finalValue;
834
- if (!Array.isArray(values))
835
- values = [values];
836
- const valuesArr = values;
837
- // if (valuesArr.length > 0) {
838
- if (!options.array && valuesArr.length >= 1) {
839
- finalValue = valuesArr[valuesArr.length - 1];
840
- }
841
- else {
842
- finalValue = valuesArr;
843
- }
844
- // }
845
- if (options.allowNull || finalValue != null) {
846
- target[name] = finalValue;
847
- }
848
- }
849
- }
850
- toExample(node, options) {
851
- const { isExample, example, __isDefaultExample } = node;
852
- const { defaultExample, isBoolean } = options;
853
- if (!isExample) {
854
- return {
855
- isExample: false,
856
- example: null,
857
- };
858
- }
859
- let exampleValue;
860
- if (__isDefaultExample) {
861
- exampleValue = isBoolean
862
- ? BooleanUtils.toBoolean(defaultExample)
863
- : this.convertBreakscapedStringToJsonText(defaultExample, options.textFormat, TextLocation.tag);
864
- }
865
- else {
866
- exampleValue = isBoolean
867
- ? BooleanUtils.toBoolean(example)
868
- : this.convertBreakscapedStringToJsonText(example, options.textFormat, TextLocation.tag);
869
- }
870
- return {
871
- isExample: true,
872
- example: exampleValue,
873
- };
874
- }
875
- /**
876
- * Get the bit type from any node
877
- *
878
- * @param route the route to the current node
879
- * @returns the bit type
880
- */
881
- getBitType(route) {
882
- for (const node of route) {
883
- if (node.key === NodeType.bitsValue) {
884
- const n = node.value;
885
- return n === null || n === void 0 ? void 0 : n.bitType;
886
- }
887
- }
888
- return undefined;
889
- }
890
- /**
891
- * Get the text format from any node
892
- *
893
- * @param route the route to the current node
894
- * @returns the text format
895
- */
896
- getTextFormat(route) {
897
- var _a;
898
- const bitType = this.getBitType(route);
899
- if (bitType) {
900
- const bitConfig = Config.getBitConfig(bitType);
901
- for (const node of route) {
902
- if (node.key === NodeType.bitsValue) {
903
- const n = node.value;
904
- return (_a = TextFormat.fromValue(n === null || n === void 0 ? void 0 : n.textFormat)) !== null && _a !== void 0 ? _a : bitConfig.textFormatDefault;
905
- }
906
- }
907
- }
908
- return TextFormat.bitmarkText;
909
- }
910
- /**
911
- * Get the bit resourceType atttachment from any node
912
- *
913
- * @param route the route to the current node
914
- * @returns the bit type
915
- */
916
- getResourceType(route) {
917
- for (const node of route) {
918
- if (node.key === NodeType.bitsValue) {
919
- const n = node.value;
920
- return n === null || n === void 0 ? void 0 : n.resourceType;
921
- }
922
- }
923
- return undefined;
924
- }
925
- /**
926
- * Get the internal comments from any node
927
- *
928
- * @param route the route to the current node
929
- * @returns the text format
930
- */
931
- getInternalComments(route) {
932
- const bitType = this.getBitType(route);
933
- if (bitType) {
934
- for (const node of route) {
935
- if (node.key === NodeType.bitsValue) {
936
- const n = node.value;
937
- return n.internalComment;
938
- }
939
- }
940
- }
941
- return undefined;
942
- }
943
- /**
944
- * Convert the text from the AST to the JSON format:
945
- * Input:
946
- * - breakscaped string
947
- * Output:
948
- * - text: plain text
949
- * - json: bitmark text JSON
950
- * - Bitmark v2: breakscaped string
951
- * - Bitmark v3: bitmark text JSON (TextAst)
952
- *
953
- * In the case of Bitmark v2 type texts, there is nothing to do but cast the type.
954
- *
955
- * @param text
956
- * @returns
957
- */
958
- convertBreakscapedStringToJsonText(text, format, textLocation) {
959
- if (!text)
960
- undefined;
961
- const isBitmarkText = format === TextFormat.bitmarkText;
962
- if (!isBitmarkText) {
963
- // Not bitmark text, so plain text, so unbreakscape only the start of bit tags
964
- return text || '';
965
- }
966
- const asPlainText = this.options.textAsPlainText;
967
- if (asPlainText) {
968
- return text || '';
969
- }
970
- // Use the text parser to parse the text
971
- const textAst = this.textParser.toAst(text, {
972
- format,
973
- location: textLocation,
974
- });
975
- return textAst;
976
- }
977
- /**
978
- * Concatenates a plain JSON text with a JsonText that may be plain (v2) or BitmarkText (v3)
979
- * Returns the combined text.
980
- *
981
- * @param text the text to concatenate
982
- * @param textPlain the plain text to concatenate
983
- */
984
- concatenatePlainTextWithJsonTexts(text, extraBreaks, textPlain) {
985
- var _a;
986
- if (Array.isArray(text)) {
987
- textPlain = textPlain.trim();
988
- if (textPlain) {
989
- const splitText = textPlain.split('\n');
990
- const content = [];
991
- for (let i = 0; i < extraBreaks; i++) {
992
- content.push({
993
- type: TextNodeType.hardBreak,
994
- });
995
- }
996
- for (let i = 0; i < splitText.length; i++) {
997
- const t = splitText[i];
998
- if (t) {
999
- content.push({
1000
- text: t,
1001
- type: TextNodeType.text,
1002
- });
1003
- }
1004
- // Add a hard break after each paragraph, except the last one
1005
- if (i < splitText.length - 1) {
1006
- content.push({
1007
- type: TextNodeType.hardBreak,
1008
- });
1009
- }
1010
- }
1011
- // Add the content to the final paragraph, or create a new one if there none
1012
- const lastNode = text[text.length - 1];
1013
- if (lastNode && lastNode.type === TextNodeType.paragraph) {
1014
- lastNode.content = [...((_a = lastNode.content) !== null && _a !== void 0 ? _a : []), ...content];
1015
- }
1016
- else {
1017
- text.push({
1018
- type: TextNodeType.paragraph,
1019
- content,
1020
- attrs: {},
1021
- });
1022
- }
1023
- }
1024
- return text;
1025
- }
1026
- return `${text !== null && text !== void 0 ? text : ''}${'\n'.repeat(extraBreaks)}${textPlain !== null && textPlain !== void 0 ? textPlain : ''}`;
1027
- }
1028
- /**
1029
- * Check if an object is bitmark text
1030
- * The check looks for a special tag on the array (__tag: 'text')
1031
- *
1032
- * @param obj object that might be bitmark text
1033
- * @returns
1034
- */
1035
- isBitmarkText(obj) {
1036
- if (obj == null)
1037
- return false;
1038
- if (!Array.isArray(obj))
1039
- return false;
1040
- // Check for the hidden text tag
1041
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1042
- if (obj.__tag === 'text')
1043
- return true;
1044
- return false;
1045
- }
1046
- //
1047
- // WRITE FUNCTIONS
1048
- //
1049
- writeInlineDebug(key, state) {
1050
- let tag = key;
1051
- if (state.open) {
1052
- tag = `<${key}>`;
1053
- }
1054
- else if (state.close) {
1055
- tag = `</${key}>`;
1056
- }
1057
- else if (state.single) {
1058
- tag = `<${key} />`;
1059
- }
1060
- this.writeString(tag);
1061
- }
1062
- writeString(s) {
1063
- if (s != null)
1064
- this.write(`${s}`);
1065
- }
1066
- /**
1067
- * Create a new bit json object.
1068
- * - This function defines the order of the properties in the json.
1069
- *
1070
- * @param bit
1071
- * @returns
1072
- */
1073
- createBitJson(bit) {
1074
- const format = bit.textFormat;
1075
- const bitJson = {
1076
- type: bit.isCommented ? BitType._comment : bit.bitType,
1077
- originalType: bit.isCommented ? bit.bitType : undefined,
1078
- format,
1079
- bitLevel: bit.bitLevel,
1080
- };
1081
- return bitJson;
1082
- }
1083
- /**
1084
- * Remove wanted properties from bit json object.
1085
- * - This function defines the defaults for properties in the json.
1086
- *
1087
- * TODO: All these defaults should come from the config and be set in the Builder.
1088
- *
1089
- * @param bit
1090
- * @returns
1091
- */
1092
- cleanBitJson(bitJson) {
1093
- var _a, _b, _c, _d, _e, _f;
1094
- const bitType = Config.getBitType(bitJson.type);
1095
- const bitConfig = Config.getBitConfig(bitType);
1096
- // const textFormat = bitJson.format;
1097
- // const plainText = this.options.textAsPlainText;
1098
- // Clear 'originalType' if not set
1099
- if (bitJson.originalType == null)
1100
- bitJson.originalType = undefined;
1101
- // Clear 'item' which may be an empty string if 'lead' was set but item not
1102
- // Only necessary because '.article' does not include a default value for 'item'
1103
- // which is totally inconsistent, but maybe is wanted.
1104
- if (!bitJson.item)
1105
- bitJson.item = undefined;
1106
- // Add default properties to the bit.
1107
- // NOTE: Not all bits have the same default properties.
1108
- // The properties used are a bit random sometimes?
1109
- // It would be better if this functionality was generated from the bit config
1110
- if (Config.isOfBitType(bitType, [BitType._error, BitType._comment])) {
1111
- // Special case for _error and _comment bits
1112
- delete bitJson.format;
1113
- delete bitJson.item;
1114
- delete bitJson.lead;
1115
- delete bitJson.pageNumber;
1116
- delete bitJson.marginNumber;
1117
- delete bitJson.hint;
1118
- delete bitJson.instruction;
1119
- //
1120
- }
1121
- else {
1122
- let isTopLevelExample = false;
1123
- let isTopLevelExampleValue = false;
1124
- // Most bits have these defaults, but there are special cases (not sure if that is by error or design)
1125
- if (Config.isOfBitType(bitType, [BitType.page])) {
1126
- // Bits without item, lead, etc
1127
- if (bitJson.item == null || ((_a = bitJson.item) === null || _a === void 0 ? void 0 : _a.length) === 0)
1128
- delete bitJson.item;
1129
- if (bitJson.lead == null || ((_b = bitJson.lead) === null || _b === void 0 ? void 0 : _b.length) === 0)
1130
- delete bitJson.lead;
1131
- if (bitJson.pageNumber == null || ((_c = bitJson.pageNumber) === null || _c === void 0 ? void 0 : _c.length) === 0)
1132
- delete bitJson.pageNumber;
1133
- if (bitJson.marginNumber == null || ((_d = bitJson.marginNumber) === null || _d === void 0 ? void 0 : _d.length) === 0)
1134
- delete bitJson.marginNumber;
1135
- if (bitJson.hint == null || ((_e = bitJson.hint) === null || _e === void 0 ? void 0 : _e.length) === 0)
1136
- delete bitJson.hint;
1137
- if (bitJson.instruction == null || ((_f = bitJson.instruction) === null || _f === void 0 ? void 0 : _f.length) === 0)
1138
- delete bitJson.instruction;
1139
- }
1140
- else {
1141
- // Majority of bits
1142
- if (bitJson.item == null)
1143
- bitJson.item = this.textDefault;
1144
- if (bitJson.lead == null)
1145
- bitJson.lead = this.textDefault;
1146
- if (bitJson.hint == null)
1147
- bitJson.hint = this.textDefault;
1148
- if (bitJson.instruction == null)
1149
- bitJson.instruction = this.textDefault;
1150
- if (bitJson.pageNumber == null)
1151
- bitJson.pageNumber = this.textDefault;
1152
- if (bitJson.marginNumber == null)
1153
- bitJson.marginNumber = this.textDefault;
1154
- }
1155
- if (bitJson.body == null)
1156
- bitJson.body = this.bodyDefault;
1157
- if (Config.isOfBitType(bitType, [BitType.article])) {
1158
- //
1159
- }
1160
- if (Config.isOfBitType(bitType, [BitType.example])) {
1161
- // With 'example' value at the bit level.
1162
- isTopLevelExample = true;
1163
- isTopLevelExampleValue = true;
1164
- }
1165
- if (Config.isOfBitType(bitType, [
1166
- BitType.multipleChoice1,
1167
- BitType.multipleResponse1,
1168
- BitType.multipleChoiceText,
1169
- BitType.highlightText,
1170
- BitType.gapText,
1171
- BitType.gapTextInstructionGrouped,
1172
- BitType.clozeAndMultipleChoiceText,
1173
- BitType.sequence,
1174
- BitType.mark,
1175
- BitType.flashcard,
1176
- BitType.definitionList,
1177
- ])) {
1178
- // With no 'example' value at the bit level.
1179
- isTopLevelExample = true;
1180
- if (bitJson.body == null)
1181
- bitJson.body = this.bodyDefault;
1182
- }
1183
- if (Config.isOfBitType(bitType, [BitType.sequence])) {
1184
- // With 'example' value at the bit level.
1185
- isTopLevelExample = true;
1186
- isTopLevelExampleValue = true;
1187
- if (bitJson.body == null)
1188
- bitJson.body = this.bodyDefault;
1189
- }
1190
- if (Config.isOfBitType(bitType, BitType.cloze)) {
1191
- // With no 'example' value at the bit level.
1192
- isTopLevelExample = true;
1193
- if (Config.isOfBitType(bitType, BitType.clozeSolutionGrouped)) {
1194
- // Solution grouped
1195
- if (bitJson.quizCountItems == null)
1196
- bitJson.quizCountItems = true;
1197
- if (bitJson.quizStrikethroughSolutions == null)
1198
- bitJson.quizStrikethroughSolutions = true;
1199
- }
1200
- else if (Config.isOfBitType(bitType, BitType.clozeInstructionGrouped)) {
1201
- // Instruction grouped
1202
- if (bitJson.quizCountItems == null)
1203
- bitJson.quizCountItems = true;
1204
- if (bitJson.quizStrikethroughSolutions == null)
1205
- bitJson.quizStrikethroughSolutions = false;
1206
- }
1207
- }
1208
- if (Config.isOfBitType(bitType, [BitType.multipleChoice, BitType.multipleResponse])) {
1209
- // Default with a card (and hence a footer possibility)
1210
- isTopLevelExample = true;
1211
- if (bitJson.body == null)
1212
- bitJson.body = this.bodyDefault;
1213
- if (bitJson.footer == null)
1214
- bitJson.footer = this.textDefault;
1215
- }
1216
- if (Config.isOfBitType(bitType, BitType.essay)) {
1217
- // With 'example' value at the bit level.
1218
- isTopLevelExample = true;
1219
- isTopLevelExampleValue = true;
1220
- if (bitJson.body == null)
1221
- bitJson.body = this.bodyDefault;
1222
- if (bitJson.partialAnswer == null)
1223
- bitJson.partialAnswer = '';
1224
- // if (bitJson.sampleSolution == null) bitJson.sampleSolution = '';
1225
- }
1226
- if (Config.isOfBitType(bitType, BitType.trueFalse1)) {
1227
- // With 'example' value at the bit level.
1228
- isTopLevelExample = true;
1229
- isTopLevelExampleValue = true;
1230
- if (bitJson.isCorrect == null)
1231
- bitJson.isCorrect = false;
1232
- if (bitJson.body == null)
1233
- bitJson.body = this.bodyDefault;
1234
- }
1235
- if (Config.isOfBitType(bitType, BitType.trueFalse)) {
1236
- // With no 'example' value at the bit level.
1237
- isTopLevelExample = true;
1238
- if (bitJson.labelFalse == null)
1239
- bitJson.labelFalse = '';
1240
- if (bitJson.labelTrue == null)
1241
- bitJson.labelTrue = '';
1242
- if (bitJson.body == null)
1243
- bitJson.body = this.bodyDefault;
1244
- }
1245
- if (Config.isOfBitType(bitType, BitType.chapter)) {
1246
- //
1247
- if (bitJson.toc == null)
1248
- bitJson.toc = true; // Always set on chapter bits?
1249
- if (bitJson.progress == null)
1250
- bitJson.progress = true; // Always set on chapter bits
1251
- if (bitJson.level == null)
1252
- bitJson.level = 1; // Set level 1 if none set (makes no sense, but in ANTLR parser)
1253
- if (bitJson.body == null)
1254
- bitJson.body = this.bodyDefault;
1255
- //
1256
- }
1257
- if (Config.isOfBitType(bitType, BitType.interview)) {
1258
- // With no 'example' value at the bit level.
1259
- isTopLevelExample = true;
1260
- if (bitJson.body == null)
1261
- bitJson.body = this.bodyDefault;
1262
- if (bitJson.footer == null)
1263
- bitJson.footer = this.textDefault;
1264
- if (bitJson.questions == null)
1265
- bitJson.questions = [];
1266
- }
1267
- if (bitType === BitType.matchMatrix) {
1268
- // With no 'example' value at the bit level.
1269
- isTopLevelExample = true;
1270
- }
1271
- if (Config.isOfBitType(bitType, BitType.match)) {
1272
- // With no 'example' value at the bit level.
1273
- isTopLevelExample = true;
1274
- if (bitJson.heading == null)
1275
- bitJson.heading = {};
1276
- }
1277
- if (Config.isOfBitType(bitType, BitType.learningPathBook)) {
1278
- //
1279
- if (bitJson.isTracked == null)
1280
- bitJson.isTracked = true;
1281
- if (bitJson.isInfoOnly == null)
1282
- bitJson.isInfoOnly = false;
1283
- //
1284
- }
1285
- if (Config.isOfBitType(bitType, BitType.table)) {
1286
- //
1287
- // if (bitJson.content2Buy == null) bitJson.content2Buy = '';
1288
- if (bitJson.tableFixedHeader == null)
1289
- bitJson.tableFixedHeader = false;
1290
- if (bitJson.tableHeaderWhitespaceNoWrap == null)
1291
- bitJson.tableHeaderWhitespaceNoWrap = true;
1292
- if (bitJson.tableSearch == null)
1293
- bitJson.tableSearch = false;
1294
- if (bitJson.tableSort == null)
1295
- bitJson.tableSort = false;
1296
- if (bitJson.tablePagination == null)
1297
- bitJson.tablePagination = false;
1298
- if (bitJson.tablePaginationLimit == null)
1299
- bitJson.tablePaginationLimit = 0;
1300
- if (bitJson.tableHeight == null)
1301
- bitJson.tableHeight = 0;
1302
- if (bitJson.tableWhitespaceNoWrap == null)
1303
- bitJson.tableWhitespaceNoWrap = false;
1304
- if (bitJson.tableAutoWidth == null)
1305
- bitJson.tableAutoWidth = true;
1306
- if (bitJson.tableResizableColumns == null)
1307
- bitJson.tableResizableColumns = false;
1308
- if (bitJson.tableColumnMinWidth == null)
1309
- bitJson.tableColumnMinWidth = 0;
1310
- //
1311
- }
1312
- if (Config.isOfBitType(bitType, BitType.bookReference)) {
1313
- //
1314
- if (bitJson.refAuthor == null)
1315
- bitJson.refAuthor = [];
1316
- if (bitJson.refBookTitle == null)
1317
- bitJson.refBookTitle = '';
1318
- if (bitJson.refPublisher == null)
1319
- bitJson.refPublisher = [];
1320
- if (bitJson.refPublicationYear == null)
1321
- bitJson.refPublicationYear = '';
1322
- //
1323
- }
1324
- // Page bits
1325
- if (Config.isOfBitType(bitType, [
1326
- BitType.pageBanner,
1327
- BitType.pageBuyButton,
1328
- BitType.pageBuyButtonAlt,
1329
- BitType.pageBuyButtonPromotion,
1330
- BitType.pageFooter,
1331
- BitType.pageOpenBook,
1332
- BitType.pagePerson,
1333
- BitType.pageProduct,
1334
- BitType.pageProductList,
1335
- BitType.pageProductVideo,
1336
- BitType.pageProductVideoList,
1337
- BitType.pageSectionFolder,
1338
- BitType.pageSubscribe,
1339
- BitType.pageSubpage,
1340
- ])) {
1341
- //
1342
- if (bitJson.slug == null)
1343
- bitJson.slug = '';
1344
- if (bitJson.body == null)
1345
- bitJson.body = this.bodyDefault;
1346
- if (Config.isOfBitType(bitType, BitType.pageBuyButton)) {
1347
- if (bitJson.content2Buy == null)
1348
- bitJson.content2Buy = '';
1349
- }
1350
- }
1351
- // Special case for 'toc-resource' bits
1352
- if (Config.isOfBitType(bitType, BitType.tocResource)) {
1353
- if (bitJson.tocResource == null)
1354
- bitJson.tocResource = [];
1355
- }
1356
- // Special case for 'toc-content' bits
1357
- if (Config.isOfBitType(bitType, BitType.tocContent)) {
1358
- if (bitJson.tocContent == null)
1359
- bitJson.tocContent = [];
1360
- }
1361
- // Special case for 'book' bits
1362
- if (Config.isOfBitType(bitType, BitType.book)) {
1363
- if (bitJson.maxTocChapterLevel == null)
1364
- bitJson.maxTocChapterLevel = -1;
1365
- if (bitJson.hasMarkAsDone == null)
1366
- bitJson.hasMarkAsDone = false;
1367
- if (bitJson.processHandIn == null)
1368
- bitJson.processHandIn = false;
1369
- if (bitJson.isPublic == null)
1370
- bitJson.isPublic = false;
1371
- if (bitJson.chatWithBook == null)
1372
- bitJson.chatWithBook = false;
1373
- if (bitJson.chatWithBookBrainKey == null)
1374
- bitJson.chatWithBookBrainKey = '';
1375
- }
1376
- // Special case for 'ai' bits
1377
- if (bitType === BitType.articleAi || bitType === BitType.noteAi || bitType === BitType.summaryAi) {
1378
- if (bitJson.aiGenerated == null)
1379
- bitJson.aiGenerated = true;
1380
- }
1381
- // Special case for '-responsive...' bits
1382
- if (Config.isOfBitType(bitType, [BitType.articleResponsive, BitType.pageArticleResponsive])) {
1383
- if (bitJson.imageFirst == null)
1384
- bitJson.imageFirst = true;
1385
- }
1386
- // Special case for 'review-...' bits
1387
- if (Config.isOfBitType(bitType, BitType.reviewNote)) {
1388
- if (bitJson.resolved == null)
1389
- bitJson.resolved = false;
1390
- if (bitJson.resolvedDate == null)
1391
- bitJson.resolvedDate = '';
1392
- if (bitJson.resolvedBy == null)
1393
- bitJson.resolvedBy = '';
1394
- }
1395
- // Special case for 'images-logos-grave' / 'prototype-images' / etc bits
1396
- if (Config.isOfBitType(bitType, [BitType.imagesLogoGrave, BitType.prototypeImages])) {
1397
- if (bitType === BitType.imagesLogoGrave) {
1398
- if (bitJson.logos == null) {
1399
- bitJson.logos = [];
1400
- }
1401
- }
1402
- else {
1403
- if (bitJson.images == null)
1404
- bitJson.images = [];
1405
- }
1406
- }
1407
- // Special case for 'stepImageScreenshotWithPointer' / surveyMatrix / etc bits
1408
- if (Config.isOfBitType(bitType, [BitType.stepImageScreenshotWithPointer, BitType.surveyMatrix])) {
1409
- if (bitJson.pointerTop == null)
1410
- bitJson.pointerTop = '';
1411
- if (bitJson.pointerLeft == null)
1412
- bitJson.pointerLeft = '';
1413
- if (Config.isOfBitType(bitType, [BitType.surveyMatrix])) {
1414
- if (bitJson.buttonCaption == null)
1415
- bitJson.buttonCaption = '';
1416
- }
1417
- }
1418
- if (Config.isOfBitType(bitType, [BitType.listItem])) {
1419
- if (bitJson.listItemIndent == null)
1420
- bitJson.listItemIndent = 0;
1421
- }
1422
- // Special case for 'survey-rating-*' bits
1423
- if (Config.isOfBitType(bitType, BitType.surveyRating)) {
1424
- //
1425
- if (bitJson.ratingLevelStart == null) {
1426
- bitJson.ratingLevelStart = {
1427
- level: 0,
1428
- };
1429
- }
1430
- if (bitJson.ratingLevelEnd == null) {
1431
- bitJson.ratingLevelEnd = {
1432
- level: 0,
1433
- };
1434
- }
1435
- }
1436
- // Special case for 'vendor-stripe-pricing-table' bits
1437
- if (Config.isOfBitType(bitType, BitType.vendorStripePricingTable)) {
1438
- if (bitJson.stripePricingTableId == null)
1439
- bitJson.stripePricingTableId = '';
1440
- if (bitJson.stripePublishableKey == null)
1441
- bitJson.stripePublishableKey = '';
1442
- }
1443
- // Special case for 'call-to-action' bits
1444
- if (Config.isOfBitType(bitType, BitType.callToAction)) {
1445
- if (bitJson.buttonCaption == null)
1446
- bitJson.buttonCaption = '';
1447
- if (bitJson.callToActionUrl == null)
1448
- bitJson.callToActionUrl = '';
1449
- }
1450
- // Special case for 'hand-in-file' bits
1451
- if (Config.isOfBitType(bitType, BitType.handInFile)) {
1452
- if (bitJson.handInAcceptFileType == null)
1453
- bitJson.handInAcceptFileType = [];
1454
- }
1455
- // Special case for 'hand-in-submit' bits
1456
- if (Config.isOfBitType(bitType, BitType.handInSubmit)) {
1457
- if (bitJson.handInRequirement == null)
1458
- bitJson.handInRequirement = [];
1459
- if (bitJson.handInInstruction == null)
1460
- bitJson.handInInstruction = '';
1461
- if (bitJson.buttonCaption == null)
1462
- bitJson.buttonCaption = '';
1463
- }
1464
- // Special case for 'module' bits
1465
- if (Config.isOfBitType(bitType, BitType.module)) {
1466
- if (bitJson.hasBookNavigation == null)
1467
- bitJson.hasBookNavigation = true;
1468
- }
1469
- // Special case for 'container' bits
1470
- if (Config.isOfBitType(bitType, BitType.container)) {
1471
- if (bitJson.allowedBit == null)
1472
- bitJson.allowedBit = [];
1473
- }
1474
- // Special case for 'quiz' bits
1475
- if (bitConfig.quizBit) {
1476
- if (bitJson.revealSolutions == null)
1477
- bitJson.revealSolutions = false;
1478
- }
1479
- // Special case for 'platform-path' bits
1480
- if (Config.isOfBitType(bitType, BitType.platformPath)) {
1481
- if (bitJson.path == null)
1482
- bitJson.path = '';
1483
- }
1484
- // Remove top level example if it is not required
1485
- if (isTopLevelExample) {
1486
- if (bitJson.isExample == null)
1487
- bitJson.isExample = false;
1488
- }
1489
- else {
1490
- // Remove example
1491
- delete bitJson.isExample;
1492
- delete bitJson.example;
1493
- }
1494
- if (isTopLevelExampleValue) {
1495
- if (bitJson.example == null)
1496
- bitJson.example = null;
1497
- }
1498
- else {
1499
- // Remove example value
1500
- delete bitJson.example;
1501
- }
1502
- }
1503
- return bitJson;
1504
- }
1505
- /**
1506
- * Convert any bitmark texts to strings.
1507
- */
1508
- convertAllBitmarkTextsToStringsForPlainText(json) {
1509
- if (!this.options.textAsPlainText)
1510
- return;
1511
- const obj = json;
1512
- for (const key in obj) {
1513
- const val = obj[key];
1514
- if (this.isBitmarkText(val)) {
1515
- const s = this.textGenerator.generateSync(val, TextFormat.bitmarkText, TextLocation.tag, {
1516
- noBreakscaping: true,
1517
- });
1518
- obj[key] = (s !== null && s !== void 0 ? s : '').trim();
1519
- }
1520
- else if (typeof obj[key] === 'object') {
1521
- this.convertAllBitmarkTextsToStringsForPlainText(obj[key]);
1522
- }
1523
- }
1524
- }
1525
- /**
1526
- * Remove any property with a key starting with an double underscore.
1527
- *
1528
- * @param json
1529
- */
1530
- removeTemporaryProperties(json) {
1531
- const obj = json;
1532
- for (const key in obj) {
1533
- if (key.startsWith('__')) {
1534
- delete obj[key];
1535
- }
1536
- else if (typeof obj[key] === 'object') {
1537
- this.removeTemporaryProperties(obj[key]);
1538
- }
1539
- }
1540
- }
1541
- //
1542
- // Writer interface
1543
- //
1544
- /**
1545
- * Writes a string value to the output.
1546
- * @param value - The string value to be written.
1547
- */
1548
- write(value) {
1549
- this.writer.write(value);
1550
- return this;
1551
- }
1552
- /**
1553
- * Writes a new line to the output. The line is indented automatically. The line is ended with the endOfLineString.
1554
- * @param value - The line to write. When omitted, only the endOfLineString is written.
1555
- */
1556
- writeLine(value) {
1557
- this.writer.writeLine(value);
1558
- return this;
1559
- }
1560
- /**
1561
- * Writes a collection of lines to the output. Each line is indented automatically and ended with the endOfLineString.
1562
- * @param values - The lines to write.
1563
- * @param delimiter - An optional delimiter to be written at the end of each line, except for the last one.
1564
- */
1565
- writeLines(values, delimiter) {
1566
- this.writer.writeLines(values, delimiter);
1567
- return this;
1568
- }
1569
- /**
1570
- * Writes a single whitespace character to the output.
1571
- */
1572
- writeWhiteSpace() {
1573
- this.writer.writeWhiteSpace();
1574
- return this;
1575
- }
1576
- }
1577
- export { JsonGenerator };
1578
- //# sourceMappingURL=JsonGenerator.js.map