@art-md/constructs 0.0.3 → 0.0.5

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 (256) hide show
  1. package/README.md +3 -3
  2. package/dist/factories/constructs/Document/factory/createDocument.d.ts +3 -0
  3. package/dist/factories/constructs/Document/factory/types.d.ts +4 -0
  4. package/dist/factories/constructs/Document/index.d.ts +2 -0
  5. package/dist/factories/constructs/FieldBlock/factory/createFieldBlock.d.ts +3 -0
  6. package/dist/factories/constructs/FieldBlock/factory/types.d.ts +7 -0
  7. package/dist/factories/constructs/FieldBlock/index.d.ts +3 -0
  8. package/dist/factories/constructs/FieldBlock/types.d.ts +9 -0
  9. package/dist/factories/constructs/FieldInline/factory/createFieldInline.d.ts +3 -0
  10. package/dist/factories/constructs/FieldInline/factory/types.d.ts +7 -0
  11. package/dist/factories/constructs/FieldInline/index.d.ts +3 -0
  12. package/dist/factories/constructs/FieldInline/types.d.ts +9 -0
  13. package/dist/factories/constructs/NaturalBlock/factory/createNaturalBlock.d.ts +3 -0
  14. package/dist/factories/constructs/NaturalBlock/factory/types.d.ts +11 -0
  15. package/dist/factories/constructs/NaturalBlock/index.d.ts +3 -0
  16. package/dist/factories/constructs/NaturalBlock/types.d.ts +12 -0
  17. package/dist/factories/constructs/NaturalExpression/factory/createNaturalExpression.d.ts +3 -0
  18. package/dist/factories/constructs/NaturalExpression/factory/types.d.ts +7 -0
  19. package/dist/factories/constructs/NaturalExpression/index.d.ts +3 -0
  20. package/dist/factories/constructs/NaturalExpression/types.d.ts +8 -0
  21. package/dist/factories/constructs/SectionBlock/factory/createSectionBlock.d.ts +3 -0
  22. package/dist/factories/constructs/SectionBlock/factory/types.d.ts +8 -0
  23. package/dist/factories/constructs/SectionBlock/index.d.ts +3 -0
  24. package/dist/factories/constructs/SectionBlock/types.d.ts +9 -0
  25. package/dist/factories/constructs/Tag/factory/createTag.d.ts +3 -0
  26. package/dist/factories/constructs/Tag/factory/types.d.ts +3 -0
  27. package/dist/factories/constructs/Tag/index.d.ts +3 -0
  28. package/dist/factories/constructs/Tag/types.d.ts +5 -0
  29. package/dist/factories/index.d.ts +8 -0
  30. package/dist/factories/public.d.ts +36 -0
  31. package/dist/factories/types.d.ts +31 -0
  32. package/dist/index.d.ts +3 -0
  33. package/dist/index.mjs +627 -0
  34. package/dist/index.mjs.map +7 -0
  35. package/dist/parser/constructs/FieldBlock/createFieldBlockParser.d.ts +2 -0
  36. package/dist/parser/constructs/FieldBlock/index.d.ts +1 -0
  37. package/dist/parser/constructs/FieldBlock/private/helpers/createFieldBlockFromNode.d.ts +4 -0
  38. package/dist/parser/constructs/FieldBlock/private/helpers/onBeforeConstruct.d.ts +2 -0
  39. package/dist/parser/constructs/FieldBlock/private/index.d.ts +2 -0
  40. package/dist/parser/constructs/FieldBlock/private/integrator/createFieldBlockIntegrator.d.ts +2 -0
  41. package/dist/parser/constructs/FieldBlock/private/processor/createFieldBlockProcessor.d.ts +2 -0
  42. package/dist/parser/constructs/FieldInline/createFieldInlineParser.d.ts +2 -0
  43. package/dist/parser/constructs/FieldInline/index.d.ts +1 -0
  44. package/dist/parser/constructs/FieldInline/private/helpers/createFieldInlineFromNode.d.ts +4 -0
  45. package/dist/parser/constructs/FieldInline/private/helpers/trimFieldEdges.d.ts +2 -0
  46. package/dist/parser/constructs/FieldInline/private/index.d.ts +1 -0
  47. package/dist/parser/constructs/FieldInline/private/processor/createFieldInlineProcessor.d.ts +2 -0
  48. package/dist/parser/constructs/NaturalBlock/createNaturalBlockParser.d.ts +2 -0
  49. package/dist/parser/constructs/NaturalBlock/index.d.ts +1 -0
  50. package/dist/parser/constructs/NaturalBlock/private/helpers/createNaturalBlockFromNode.d.ts +4 -0
  51. package/dist/parser/constructs/NaturalBlock/private/index.d.ts +1 -0
  52. package/dist/parser/constructs/NaturalBlock/private/processor/createNaturalBlockProcessor.d.ts +2 -0
  53. package/dist/parser/constructs/SectionBlock/createSectionBlockParser.d.ts +2 -0
  54. package/dist/parser/constructs/SectionBlock/index.d.ts +1 -0
  55. package/dist/parser/constructs/SectionBlock/private/helpers/createSectionBlockFromNode.d.ts +4 -0
  56. package/dist/parser/constructs/SectionBlock/private/helpers/findParentSection.d.ts +3 -0
  57. package/dist/parser/constructs/SectionBlock/private/index.d.ts +2 -0
  58. package/dist/parser/constructs/SectionBlock/private/integrator/createSectionBlockIntegrator.d.ts +2 -0
  59. package/dist/parser/constructs/SectionBlock/private/processor/createSectionBlockProcessor.d.ts +2 -0
  60. package/dist/parser/document/createArtDocumentFromNode.d.ts +3 -0
  61. package/dist/parser/document/index.d.ts +1 -0
  62. package/dist/parser/fields/constants.d.ts +1 -0
  63. package/dist/parser/fields/index.d.ts +3 -0
  64. package/dist/parser/fields/isFieldStrong.d.ts +3 -0
  65. package/dist/parser/fields/stripStrong.d.ts +3 -0
  66. package/dist/parser/index.d.ts +6 -0
  67. package/dist/parser/mdast/index.d.ts +1 -0
  68. package/dist/parser/mdast/rawSlice.d.ts +2 -0
  69. package/dist/parser/naturalExpression/createNaturalExpressionFromNode.d.ts +3 -0
  70. package/dist/parser/naturalExpression/index.d.ts +1 -0
  71. package/dist/parser/public.d.ts +5 -0
  72. package/dist/parser/tags/extractTags.d.ts +5 -0
  73. package/dist/parser/tags/index.d.ts +1 -0
  74. package/dist/parser/types.d.ts +14 -0
  75. package/dist/serializer/constructs/Document/createDocumentToMdast.d.ts +2 -0
  76. package/dist/serializer/constructs/Document/index.d.ts +1 -0
  77. package/dist/serializer/constructs/FieldBlock/createFieldBlockToMdast.d.ts +2 -0
  78. package/dist/serializer/constructs/FieldBlock/index.d.ts +1 -0
  79. package/dist/serializer/constructs/FieldInline/createFieldInlineToMdast.d.ts +2 -0
  80. package/dist/serializer/constructs/FieldInline/index.d.ts +1 -0
  81. package/dist/serializer/constructs/NaturalBlock/createNaturalBlockToMdast.d.ts +2 -0
  82. package/dist/serializer/constructs/NaturalBlock/index.d.ts +1 -0
  83. package/dist/serializer/constructs/NaturalExpression/createNaturalExpressionToMdast.d.ts +2 -0
  84. package/dist/serializer/constructs/NaturalExpression/index.d.ts +1 -0
  85. package/dist/serializer/constructs/SectionBlock/createSectionBlockToMdast.d.ts +2 -0
  86. package/dist/serializer/constructs/SectionBlock/index.d.ts +1 -0
  87. package/dist/serializer/index.d.ts +7 -0
  88. package/dist/serializer/public.d.ts +3 -0
  89. package/dist/serializer/tags/index.d.ts +2 -0
  90. package/dist/serializer/tags/tagToMdast.d.ts +3 -0
  91. package/dist/serializer/tags/tagsToMdast.d.ts +3 -0
  92. package/dist/serializer/types.d.ts +7 -0
  93. package/dist/test/helpers/constructs/FieldBlock/createFieldBlockFromNodeMock.d.ts +7 -0
  94. package/dist/test/helpers/constructs/FieldBlock/createFieldBlockMock.d.ts +7 -0
  95. package/dist/test/helpers/constructs/FieldBlock/makeFieldBlockFixture.d.ts +9 -0
  96. package/dist/test/helpers/constructs/FieldBlock/makeFieldBlockMock.d.ts +9 -0
  97. package/dist/test/helpers/constructs/FieldInline/createFieldInlineFromNodeMock.d.ts +7 -0
  98. package/dist/test/helpers/constructs/FieldInline/createFieldInlineMock.d.ts +7 -0
  99. package/dist/test/helpers/constructs/FieldInline/makeFieldInlineFixture.d.ts +9 -0
  100. package/dist/test/helpers/constructs/FieldInline/makeFieldInlineMock.d.ts +9 -0
  101. package/dist/test/helpers/constructs/NaturalBlock/createNaturalBlockFromNodeMock.d.ts +7 -0
  102. package/dist/test/helpers/constructs/NaturalBlock/createNaturalBlockMock.d.ts +7 -0
  103. package/dist/test/helpers/constructs/NaturalBlock/makeNaturalBlockFixture.d.ts +12 -0
  104. package/dist/test/helpers/constructs/NaturalBlock/makeNaturalBlockMock.d.ts +12 -0
  105. package/dist/test/helpers/constructs/NaturalExpression/makeNaturalExpressionFixture.d.ts +10 -0
  106. package/dist/test/helpers/constructs/NaturalExpression/makeNaturalExpressionMock.d.ts +10 -0
  107. package/dist/test/helpers/constructs/SectionBlock/createSectionBlockFromNodeMock.d.ts +7 -0
  108. package/dist/test/helpers/constructs/SectionBlock/createSectionBlockMock.d.ts +7 -0
  109. package/dist/test/helpers/constructs/SectionBlock/makeSectionBlockFixture.d.ts +10 -0
  110. package/dist/test/helpers/constructs/Tag/makeTagFixture.d.ts +7 -0
  111. package/dist/test/helpers/constructs/index.d.ts +14 -0
  112. package/dist/test/helpers/index.d.ts +2 -0
  113. package/dist/test/helpers/parsers/fields/stripStrongMock.d.ts +7 -0
  114. package/dist/test/helpers/parsers/index.d.ts +5 -0
  115. package/dist/test/helpers/parsers/mdast/rawSliceMock.d.ts +7 -0
  116. package/dist/test/helpers/parsers/natural-expression/createNaturalExpressionFromNodeMock.d.ts +7 -0
  117. package/dist/test/helpers/parsers/tags/extractTagsMock.d.ts +7 -0
  118. package/dist/test/helpers/parsers/tags/tagToMdastMock.d.ts +7 -0
  119. package/package.json +22 -4
  120. package/src/factories/constructs/Document/factory/createDocument.test.ts +2 -2
  121. package/src/factories/constructs/Document/factory/createDocument.ts +1 -1
  122. package/src/factories/constructs/Document/factory/types.ts +1 -1
  123. package/src/factories/constructs/Document/index.ts +2 -2
  124. package/src/factories/constructs/FieldBlock/factory/createFieldBlock.test.ts +2 -2
  125. package/src/factories/constructs/FieldBlock/factory/createFieldBlock.ts +2 -2
  126. package/src/factories/constructs/FieldBlock/factory/types.ts +2 -2
  127. package/src/factories/constructs/FieldBlock/index.ts +3 -3
  128. package/src/factories/constructs/FieldBlock/types.ts +2 -2
  129. package/src/factories/constructs/FieldInline/factory/createFieldInline.test.ts +2 -2
  130. package/src/factories/constructs/FieldInline/factory/createFieldInline.ts +2 -2
  131. package/src/factories/constructs/FieldInline/factory/types.ts +2 -2
  132. package/src/factories/constructs/FieldInline/index.ts +3 -3
  133. package/src/factories/constructs/FieldInline/types.ts +2 -2
  134. package/src/factories/constructs/NaturalBlock/factory/createNaturalBlock.test.ts +2 -2
  135. package/src/factories/constructs/NaturalBlock/factory/createNaturalBlock.ts +2 -2
  136. package/src/factories/constructs/NaturalBlock/factory/types.ts +1 -1
  137. package/src/factories/constructs/NaturalBlock/index.ts +3 -3
  138. package/src/factories/constructs/NaturalBlock/types.ts +1 -1
  139. package/src/factories/constructs/NaturalExpression/factory/createNaturalExpression.test.ts +2 -2
  140. package/src/factories/constructs/NaturalExpression/factory/createNaturalExpression.ts +2 -2
  141. package/src/factories/constructs/NaturalExpression/factory/types.ts +1 -1
  142. package/src/factories/constructs/NaturalExpression/index.ts +3 -3
  143. package/src/factories/constructs/SectionBlock/factory/createSectionBlock.test.ts +2 -4
  144. package/src/factories/constructs/SectionBlock/factory/createSectionBlock.ts +2 -3
  145. package/src/factories/constructs/SectionBlock/factory/types.ts +1 -2
  146. package/src/factories/constructs/SectionBlock/index.ts +3 -3
  147. package/src/factories/constructs/SectionBlock/types.ts +1 -2
  148. package/src/factories/constructs/Tag/factory/createTag.test.ts +1 -1
  149. package/src/factories/constructs/Tag/factory/createTag.ts +2 -2
  150. package/src/factories/constructs/Tag/index.ts +3 -3
  151. package/src/factories/index.ts +8 -8
  152. package/src/factories/public.ts +14 -14
  153. package/src/factories/types.ts +6 -6
  154. package/src/index.ts +3 -3
  155. package/src/parser/constructs/FieldBlock/createFieldBlockParser.test.ts +1 -1
  156. package/src/parser/constructs/FieldBlock/createFieldBlockParser.ts +2 -2
  157. package/src/parser/constructs/FieldBlock/index.ts +1 -1
  158. package/src/parser/constructs/FieldBlock/private/helpers/createFieldBlockFromNode.test.ts +4 -4
  159. package/src/parser/constructs/FieldBlock/private/helpers/createFieldBlockFromNode.ts +4 -4
  160. package/src/parser/constructs/FieldBlock/private/helpers/onBeforeConstruct.test.ts +1 -1
  161. package/src/parser/constructs/FieldBlock/private/index.ts +2 -2
  162. package/src/parser/constructs/FieldBlock/private/integrator/createFieldBlockIntegrator.test.ts +4 -4
  163. package/src/parser/constructs/FieldBlock/private/integrator/createFieldBlockIntegrator.ts +3 -3
  164. package/src/parser/constructs/FieldBlock/private/processor/createFieldBlockProcessor.test.ts +4 -4
  165. package/src/parser/constructs/FieldBlock/private/processor/createFieldBlockProcessor.ts +3 -3
  166. package/src/parser/constructs/FieldInline/createFieldInlineParser.test.ts +1 -1
  167. package/src/parser/constructs/FieldInline/createFieldInlineParser.ts +2 -2
  168. package/src/parser/constructs/FieldInline/index.ts +1 -1
  169. package/src/parser/constructs/FieldInline/private/helpers/createFieldInlineFromNode.test.ts +4 -4
  170. package/src/parser/constructs/FieldInline/private/helpers/createFieldInlineFromNode.ts +6 -6
  171. package/src/parser/constructs/FieldInline/private/helpers/trimFieldEdges.test.ts +2 -2
  172. package/src/parser/constructs/FieldInline/private/helpers/trimFieldEdges.ts +1 -1
  173. package/src/parser/constructs/FieldInline/private/index.ts +1 -1
  174. package/src/parser/constructs/FieldInline/private/processor/createFieldInlineProcessor.test.ts +4 -4
  175. package/src/parser/constructs/FieldInline/private/processor/createFieldInlineProcessor.ts +3 -3
  176. package/src/parser/constructs/NaturalBlock/createNaturalBlockParser.test.ts +1 -1
  177. package/src/parser/constructs/NaturalBlock/createNaturalBlockParser.ts +2 -2
  178. package/src/parser/constructs/NaturalBlock/index.ts +1 -1
  179. package/src/parser/constructs/NaturalBlock/private/helpers/createNaturalBlockFromNode.test.ts +4 -4
  180. package/src/parser/constructs/NaturalBlock/private/helpers/createNaturalBlockFromNode.ts +4 -4
  181. package/src/parser/constructs/NaturalBlock/private/index.ts +1 -1
  182. package/src/parser/constructs/NaturalBlock/private/processor/createNaturalBlockProcessor.test.ts +4 -4
  183. package/src/parser/constructs/NaturalBlock/private/processor/createNaturalBlockProcessor.ts +2 -2
  184. package/src/parser/constructs/SectionBlock/createSectionBlockParser.test.ts +1 -1
  185. package/src/parser/constructs/SectionBlock/createSectionBlockParser.ts +2 -2
  186. package/src/parser/constructs/SectionBlock/index.ts +1 -1
  187. package/src/parser/constructs/SectionBlock/private/helpers/createSectionBlockFromNode.test.ts +6 -6
  188. package/src/parser/constructs/SectionBlock/private/helpers/createSectionBlockFromNode.ts +4 -7
  189. package/src/parser/constructs/SectionBlock/private/helpers/findParentSection.test.ts +9 -3
  190. package/src/parser/constructs/SectionBlock/private/helpers/findParentSection.ts +1 -1
  191. package/src/parser/constructs/SectionBlock/private/index.ts +2 -2
  192. package/src/parser/constructs/SectionBlock/private/integrator/createSectionBlockIntegrator.test.ts +6 -3
  193. package/src/parser/constructs/SectionBlock/private/integrator/createSectionBlockIntegrator.ts +3 -3
  194. package/src/parser/constructs/SectionBlock/private/processor/createSectionBlockProcessor.test.ts +4 -4
  195. package/src/parser/constructs/SectionBlock/private/processor/createSectionBlockProcessor.ts +2 -2
  196. package/src/parser/document/createArtDocumentFromNode.test.ts +2 -2
  197. package/src/parser/document/createArtDocumentFromNode.ts +1 -1
  198. package/src/parser/document/index.ts +1 -1
  199. package/src/parser/fields/constants.test.ts +1 -1
  200. package/src/parser/fields/index.ts +3 -3
  201. package/src/parser/fields/isFieldStrong.test.ts +2 -2
  202. package/src/parser/fields/isFieldStrong.ts +2 -2
  203. package/src/parser/fields/stripStrong.test.ts +3 -3
  204. package/src/parser/fields/stripStrong.ts +1 -1
  205. package/src/parser/index.ts +6 -6
  206. package/src/parser/mdast/index.ts +1 -1
  207. package/src/parser/mdast/rawSlice.test.ts +1 -1
  208. package/src/parser/naturalExpression/createNaturalExpressionFromNode.test.ts +2 -7
  209. package/src/parser/naturalExpression/createNaturalExpressionFromNode.ts +2 -3
  210. package/src/parser/naturalExpression/index.ts +1 -1
  211. package/src/parser/public.ts +7 -7
  212. package/src/parser/tags/extractTags.test.ts +1 -1
  213. package/src/parser/tags/extractTags.ts +1 -1
  214. package/src/parser/tags/index.ts +1 -1
  215. package/src/parser/types.ts +1 -1
  216. package/src/serializer/constructs/Document/createDocumentToMdast.test.ts +1 -1
  217. package/src/serializer/constructs/Document/createDocumentToMdast.ts +1 -1
  218. package/src/serializer/constructs/Document/index.ts +1 -1
  219. package/src/serializer/constructs/FieldBlock/createFieldBlockToMdast.test.ts +2 -2
  220. package/src/serializer/constructs/FieldBlock/createFieldBlockToMdast.ts +3 -3
  221. package/src/serializer/constructs/FieldBlock/index.ts +1 -1
  222. package/src/serializer/constructs/FieldInline/createFieldInlineToMdast.test.ts +2 -2
  223. package/src/serializer/constructs/FieldInline/createFieldInlineToMdast.ts +3 -3
  224. package/src/serializer/constructs/FieldInline/index.ts +1 -1
  225. package/src/serializer/constructs/NaturalBlock/createNaturalBlockToMdast.test.ts +2 -2
  226. package/src/serializer/constructs/NaturalBlock/createNaturalBlockToMdast.ts +3 -3
  227. package/src/serializer/constructs/NaturalBlock/index.ts +1 -1
  228. package/src/serializer/constructs/NaturalExpression/createNaturalExpressionToMdast.test.ts +2 -2
  229. package/src/serializer/constructs/NaturalExpression/createNaturalExpressionToMdast.ts +2 -2
  230. package/src/serializer/constructs/NaturalExpression/index.ts +1 -1
  231. package/src/serializer/constructs/SectionBlock/createSectionBlockToMdast.test.ts +2 -2
  232. package/src/serializer/constructs/SectionBlock/createSectionBlockToMdast.ts +3 -3
  233. package/src/serializer/constructs/SectionBlock/index.ts +1 -1
  234. package/src/serializer/index.ts +7 -7
  235. package/src/serializer/public.ts +8 -8
  236. package/src/serializer/tags/index.ts +2 -2
  237. package/src/serializer/tags/tagToMdast.test.ts +1 -1
  238. package/src/serializer/tags/tagToMdast.ts +1 -1
  239. package/src/serializer/tags/tagsToMdast.test.ts +2 -2
  240. package/src/serializer/tags/tagsToMdast.ts +2 -2
  241. package/src/serializer/types.ts +1 -1
  242. package/src/test/helpers/constructs/FieldBlock/makeFieldBlockFixture.ts +1 -1
  243. package/src/test/helpers/constructs/FieldBlock/makeFieldBlockMock.ts +1 -1
  244. package/src/test/helpers/constructs/FieldInline/makeFieldInlineFixture.ts +1 -1
  245. package/src/test/helpers/constructs/FieldInline/makeFieldInlineMock.ts +1 -1
  246. package/src/test/helpers/constructs/NaturalBlock/makeNaturalBlockFixture.ts +1 -1
  247. package/src/test/helpers/constructs/NaturalBlock/makeNaturalBlockMock.ts +1 -1
  248. package/src/test/helpers/constructs/NaturalExpression/makeNaturalExpressionFixture.ts +1 -1
  249. package/src/test/helpers/constructs/NaturalExpression/makeNaturalExpressionMock.ts +1 -1
  250. package/src/test/helpers/constructs/SectionBlock/makeSectionBlockFixture.ts +1 -3
  251. package/src/test/helpers/constructs/Tag/makeTagFixture.ts +1 -1
  252. package/src/test/helpers/constructs/index.ts +14 -14
  253. package/src/test/helpers/index.ts +2 -2
  254. package/src/test/helpers/parsers/index.ts +5 -5
  255. package/src/parser/constructs/SectionBlock/private/constants.test.ts +0 -17
  256. package/src/parser/constructs/SectionBlock/private/constants.ts +0 -1
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # artificial-constructs
1
+ # @art-md/constructs
2
2
 
3
3
  > Construct factories for the Art language.
4
4
 
5
5
  Construct factories and helpers used by the Art parser and serializer.
6
6
 
7
- This package is part of the [Art MD toolkit](../../README.md).
7
+ This package is part of the [Art MD](https://art-md.noodlestan.org) project.
8
8
 
9
9
  ## Development
10
10
 
@@ -12,7 +12,7 @@ Make sure you read the [Art MD README](../../README.md) first.
12
12
 
13
13
  ### Build Targets
14
14
 
15
- This library is packaged for use in bundlers such as Vite and Astro. The main entry point is the TypeScript source code.
15
+ This package is meant for use in Node.js environments. The entry point is built using `esbuild` pre-configured by [Workspace Tooling](https://github.com/noodlestan/workspace-tooling).
16
16
 
17
17
  ### Scripts
18
18
 
@@ -0,0 +1,3 @@
1
+ import { type ArtDocument } from '@art-md/primitives';
2
+ import type { DocumentFactoryData } from './types.js';
3
+ export declare function createDocument(data: DocumentFactoryData): ArtDocument;
@@ -0,0 +1,4 @@
1
+ import type { BlockContent } from '../../../types.js';
2
+ export type DocumentFactoryData = {
3
+ children?: BlockContent[];
4
+ };
@@ -0,0 +1,2 @@
1
+ export { createDocument } from './factory/createDocument.js';
2
+ export type { DocumentFactoryData } from './factory/types.js';
@@ -0,0 +1,3 @@
1
+ import type { FieldBlock } from '../types.js';
2
+ import type { FieldBlockFactoryData } from './types.js';
3
+ export declare function createFieldBlock(data: FieldBlockFactoryData): FieldBlock;
@@ -0,0 +1,7 @@
1
+ import type { BlockContent } from '../../../types.js';
2
+ import type { Tag } from '../../Tag/index.js';
3
+ export type FieldBlockFactoryData = {
4
+ name: string;
5
+ children?: BlockContent[];
6
+ tags?: Tag[];
7
+ };
@@ -0,0 +1,3 @@
1
+ export { createFieldBlock } from './factory/createFieldBlock.js';
2
+ export type { FieldBlock } from './types.js';
3
+ export type { FieldBlockFactoryData } from './factory/types.js';
@@ -0,0 +1,9 @@
1
+ import type { ContainerConstructBase } from '@art-md/primitives';
2
+ import type { BlockContent } from '../../types.js';
3
+ import type { Tag } from '../Tag/index.js';
4
+ export type FieldBlock = ContainerConstructBase & {
5
+ construct: 'FieldBlock';
6
+ name: string;
7
+ children: BlockContent[];
8
+ tags?: Tag[];
9
+ };
@@ -0,0 +1,3 @@
1
+ import type { FieldInline } from '../types.js';
2
+ import type { FieldInlineFactoryData } from './types.js';
3
+ export declare function createFieldInline(data: FieldInlineFactoryData): FieldInline;
@@ -0,0 +1,7 @@
1
+ import type { NaturalExpression } from '../../NaturalExpression/index.js';
2
+ import type { Tag } from '../../Tag/index.js';
3
+ export type FieldInlineFactoryData = {
4
+ name: string;
5
+ children?: NaturalExpression[];
6
+ tags?: Tag[];
7
+ };
@@ -0,0 +1,3 @@
1
+ export { createFieldInline } from './factory/createFieldInline.js';
2
+ export type { FieldInline } from './types.js';
3
+ export type { FieldInlineFactoryData } from './factory/types.js';
@@ -0,0 +1,9 @@
1
+ import type { ContainerConstructBase } from '@art-md/primitives';
2
+ import type { NaturalExpression } from '../NaturalExpression/index.js';
3
+ import type { Tag } from '../Tag/index.js';
4
+ export type FieldInline = ContainerConstructBase & {
5
+ construct: 'FieldInline';
6
+ name: string;
7
+ children: NaturalExpression[];
8
+ tags?: Tag[];
9
+ };
@@ -0,0 +1,3 @@
1
+ import type { NaturalBlock } from '../types.js';
2
+ import type { NaturalBlockFactoryData } from './types.js';
3
+ export declare function createNaturalBlock(data: NaturalBlockFactoryData): NaturalBlock;
@@ -0,0 +1,11 @@
1
+ import type { ContainerConstructBase } from '@art-md/primitives';
2
+ import type { Tag } from '../../Tag/index.js';
3
+ export type NaturalBlockFactoryData = {
4
+ value: string;
5
+ children: ContainerConstructBase[];
6
+ type?: string;
7
+ lang?: string | null;
8
+ meta?: string | null;
9
+ tags?: Tag[];
10
+ attributes?: Record<string, unknown>;
11
+ };
@@ -0,0 +1,3 @@
1
+ export { createNaturalBlock } from './factory/createNaturalBlock.js';
2
+ export type { NaturalBlock } from './types.js';
3
+ export type { NaturalBlockFactoryData } from './factory/types.js';
@@ -0,0 +1,12 @@
1
+ import type { ContainerConstructBase } from '@art-md/primitives';
2
+ import type { Tag } from '../Tag/index.js';
3
+ export type NaturalBlock = ContainerConstructBase & {
4
+ construct: 'NaturalBlock';
5
+ value: string;
6
+ children: ContainerConstructBase[];
7
+ type?: string;
8
+ lang?: string | null;
9
+ meta?: string | null;
10
+ tags?: Tag[];
11
+ [key: string]: unknown;
12
+ };
@@ -0,0 +1,3 @@
1
+ import type { NaturalExpression } from '../types.js';
2
+ import type { NaturalExpressionFactoryData } from './types.js';
3
+ export declare function createNaturalExpression(data: NaturalExpressionFactoryData): NaturalExpression;
@@ -0,0 +1,7 @@
1
+ import type { NaturalExpression } from '../types.js';
2
+ export type NaturalExpressionFactoryData = {
3
+ type: string;
4
+ value?: string;
5
+ attributes?: Record<string, unknown>;
6
+ children?: NaturalExpression[];
7
+ };
@@ -0,0 +1,3 @@
1
+ export { createNaturalExpression } from './factory/createNaturalExpression.js';
2
+ export type { NaturalExpression } from './types.js';
3
+ export type { NaturalExpressionFactoryData } from './factory/types.js';
@@ -0,0 +1,8 @@
1
+ import type { ContainerConstructBase } from '@art-md/primitives';
2
+ export type NaturalExpression = ContainerConstructBase & {
3
+ construct: 'NaturalExpression';
4
+ type: string;
5
+ attributes?: Record<string, unknown>;
6
+ value?: string;
7
+ children: NaturalExpression[];
8
+ };
@@ -0,0 +1,3 @@
1
+ import type { SectionBlock } from '../types.js';
2
+ import type { SectionBlockFactoryData } from './types.js';
3
+ export declare function createSectionBlock(data: SectionBlockFactoryData): SectionBlock;
@@ -0,0 +1,8 @@
1
+ import type { ConstructBase } from '@art-md/primitives';
2
+ import type { Tag } from '../../Tag/index.js';
3
+ export type SectionBlockFactoryData = {
4
+ name: string;
5
+ depth?: number;
6
+ children?: ConstructBase[];
7
+ tags?: Tag[];
8
+ };
@@ -0,0 +1,3 @@
1
+ export { createSectionBlock } from './factory/createSectionBlock.js';
2
+ export type { SectionBlock } from './types.js';
3
+ export type { SectionBlockFactoryData } from './factory/types.js';
@@ -0,0 +1,9 @@
1
+ import type { ConstructBase, ContainerConstructBase } from '@art-md/primitives';
2
+ import type { Tag } from '../Tag/index.js';
3
+ export type SectionBlock = ContainerConstructBase & {
4
+ construct: 'SectionBlock';
5
+ name: string;
6
+ tags?: Tag[];
7
+ children: ConstructBase[];
8
+ depth?: number;
9
+ };
@@ -0,0 +1,3 @@
1
+ import type { Tag } from '../types.js';
2
+ import type { TagFactoryData } from './types.js';
3
+ export declare function createTag(tagData: TagFactoryData): Tag;
@@ -0,0 +1,3 @@
1
+ export type TagFactoryData = {
2
+ name: string;
3
+ };
@@ -0,0 +1,3 @@
1
+ export { createTag } from './factory/createTag.js';
2
+ export type { Tag } from './types.js';
3
+ export type { TagFactoryData } from './factory/types.js';
@@ -0,0 +1,5 @@
1
+ import type { ConstructBase } from '@art-md/primitives';
2
+ export type Tag = ConstructBase & {
3
+ construct: 'Tag';
4
+ name: string;
5
+ };
@@ -0,0 +1,8 @@
1
+ export * from './constructs/Document/index.js';
2
+ export * from './constructs/FieldBlock/index.js';
3
+ export * from './constructs/FieldInline/index.js';
4
+ export * from './constructs/NaturalBlock/index.js';
5
+ export * from './constructs/NaturalExpression/index.js';
6
+ export * from './constructs/SectionBlock/index.js';
7
+ export * from './constructs/Tag/index.js';
8
+ export type * from './types.js';
@@ -0,0 +1,36 @@
1
+ import { createDocument } from './constructs/Document/index.js';
2
+ import { createFieldBlock } from './constructs/FieldBlock/index.js';
3
+ import { createFieldInline } from './constructs/FieldInline/index.js';
4
+ import { createNaturalBlock } from './constructs/NaturalBlock/index.js';
5
+ import { createNaturalExpression } from './constructs/NaturalExpression/index.js';
6
+ import { createSectionBlock } from './constructs/SectionBlock/index.js';
7
+ import { createTag } from './constructs/Tag/index.js';
8
+ export type { FieldBlock } from './constructs/FieldBlock/index.js';
9
+ export type { FieldInline } from './constructs/FieldInline/index.js';
10
+ export type { NaturalBlock } from './constructs/NaturalBlock/index.js';
11
+ export type { NaturalExpression } from './constructs/NaturalExpression/index.js';
12
+ export type { SectionBlock } from './constructs/SectionBlock/index.js';
13
+ export type { Tag } from './constructs/Tag/index.js';
14
+ export type * from './types.js';
15
+ export declare const FACTORIES: ({
16
+ name: string;
17
+ factory: typeof createDocument;
18
+ } | {
19
+ name: string;
20
+ factory: typeof createFieldBlock;
21
+ } | {
22
+ name: string;
23
+ factory: typeof createFieldInline;
24
+ } | {
25
+ name: string;
26
+ factory: typeof createNaturalBlock;
27
+ } | {
28
+ name: string;
29
+ factory: typeof createNaturalExpression;
30
+ } | {
31
+ name: string;
32
+ factory: typeof createSectionBlock;
33
+ } | {
34
+ name: string;
35
+ factory: typeof createTag;
36
+ })[];
@@ -0,0 +1,31 @@
1
+ import type { FieldBlock } from './constructs/FieldBlock/index.js';
2
+ import type { FieldInline } from './constructs/FieldInline/index.js';
3
+ import type { NaturalBlock } from './constructs/NaturalBlock/index.js';
4
+ import type { NaturalExpression } from './constructs/NaturalExpression/index.js';
5
+ import type { SectionBlock } from './constructs/SectionBlock/index.js';
6
+ import type { Tag } from './constructs/Tag/index.js';
7
+ /**
8
+ * Open registry of block-level constructs. Augment via declaration merging when new constructs land.
9
+ *
10
+ * @conventions-ignore Conventions: Typescript / Types / No Interface
11
+ */
12
+ export interface BlockConstructMap {
13
+ SectionBlock: SectionBlock;
14
+ FieldBlock: FieldBlock;
15
+ FieldInline: FieldInline;
16
+ NaturalBlock: NaturalBlock;
17
+ }
18
+ /**
19
+ * Open registry of inline/expression-level constructs. Augment via declaration merging when new constructs land.
20
+ *
21
+ * @conventions-ignore Conventions: Typescript / Types / No Interface
22
+ */
23
+ export interface InlineConstructMap {
24
+ NaturalExpression: NaturalExpression;
25
+ Tag: Tag;
26
+ }
27
+ /** Open registry of all constructs. */
28
+ export type ConstructMap = BlockConstructMap & InlineConstructMap;
29
+ export type BlockContent = BlockConstructMap[keyof BlockConstructMap];
30
+ export type InlineContent = InlineConstructMap[keyof InlineConstructMap];
31
+ export type Construct = ConstructMap[keyof ConstructMap];
@@ -0,0 +1,3 @@
1
+ export * from './factories/public.js';
2
+ export * from './parser/public.js';
3
+ export * from './serializer/public.js';