@lblod/ember-rdfa-editor-lblod-plugins 0.4.1 → 1.0.0-alpha.2

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 (316) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/addon/components/article-structure-plugin/article-structure-card.hbs +10 -0
  3. package/addon/components/article-structure-plugin/article-structure-card.ts +33 -0
  4. package/addon/components/article-structure-plugin/structure-card.hbs +46 -0
  5. package/addon/components/article-structure-plugin/structure-card.ts +124 -0
  6. package/addon/components/au-native-input.hbs +30 -0
  7. package/addon/components/au-native-input.ts +47 -0
  8. package/addon/components/besluit-plugin/besluit-context-card.hbs +44 -0
  9. package/addon/components/besluit-plugin/besluit-context-card.ts +138 -0
  10. package/addon/components/besluit-plugin/besluit-plugin-card.hbs +20 -0
  11. package/addon/components/besluit-plugin/besluit-plugin-card.ts +40 -0
  12. package/addon/components/besluit-type-plugin/{besluit-type-select.js → besluit-type-select.ts} +8 -4
  13. package/addon/components/besluit-type-plugin/toolbar-dropdown.hbs +2 -0
  14. package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +218 -0
  15. package/addon/components/citation-plugin/citation-card.hbs +118 -0
  16. package/addon/components/citation-plugin/citation-card.ts +230 -0
  17. package/addon/components/citation-plugin/citation-insert.hbs +20 -0
  18. package/addon/components/citation-plugin/citation-insert.ts +102 -0
  19. package/addon/components/{citaten-plugin → citation-plugin}/citations/article-list.hbs +2 -2
  20. package/addon/components/{citaten-plugin → citation-plugin}/citations/article-preview.hbs +0 -0
  21. package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-detail.hbs +9 -6
  22. package/addon/components/{citaten-plugin/citations/decision-detail.js → citation-plugin/citations/decision-detail.ts} +30 -31
  23. package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-list.hbs +2 -2
  24. package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-preview.hbs +0 -0
  25. package/addon/components/citation-plugin/citations/search-modal.hbs +254 -0
  26. package/addon/components/{citaten-plugin/citations/search-modal.js → citation-plugin/citations/search-modal.ts} +117 -90
  27. package/addon/components/{citaten-plugin → citation-plugin}/helpers/alert-load-error.hbs +0 -0
  28. package/addon/components/{citaten-plugin → citation-plugin}/helpers/alert-no-items.hbs +0 -0
  29. package/addon/components/import-snippet-plugin/card.ts +119 -0
  30. package/addon/components/insert-variable-plugin/insert-variable-card.hbs +2 -1
  31. package/addon/components/insert-variable-plugin/insert-variable-card.ts +134 -0
  32. package/addon/components/rdfa-date-plugin/{rdfa-date-plugin-card.hbs → card.hbs} +3 -1
  33. package/addon/components/rdfa-date-plugin/card.ts +72 -0
  34. package/addon/components/rdfa-date-plugin/{rdfa-date-time-picker.hbs → date-time-picker.hbs} +0 -0
  35. package/addon/components/rdfa-date-plugin/{rdfa-date-time-picker.js → date-time-picker.ts} +26 -12
  36. package/addon/components/rdfa-date-plugin/{rdfa-date-plugin-insert.hbs → insert.hbs} +0 -0
  37. package/addon/components/rdfa-date-plugin/insert.ts +45 -0
  38. package/addon/components/roadsign-regulation-plugin/expanded-measure.ts +58 -0
  39. package/addon/components/roadsign-regulation-plugin/measure-template.ts +35 -0
  40. package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.hbs +2 -2
  41. package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.ts +60 -0
  42. package/addon/components/roadsign-regulation-plugin/{roadsigns-modal.js → roadsigns-modal.ts} +103 -66
  43. package/addon/components/roadsign-regulation-plugin/{roadsigns-pagination.js → roadsigns-pagination.ts} +7 -3
  44. package/addon/components/roadsign-regulation-plugin/roadsigns-table.ts +32 -0
  45. package/addon/components/standard-template-plugin/{template-card.hbs → card.hbs} +0 -0
  46. package/addon/components/standard-template-plugin/card.ts +11 -0
  47. package/addon/components/standard-template-plugin/template-provider.hbs +3 -1
  48. package/addon/components/standard-template-plugin/template-provider.ts +75 -0
  49. package/addon/components/table-of-contents-plugin/card.hbs +12 -1
  50. package/addon/components/table-of-contents-plugin/card.ts +60 -0
  51. package/addon/components/table-of-contents-plugin/{inline-components → ember-nodes}/outline.hbs +2 -2
  52. package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.hbs +9 -0
  53. package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.ts +95 -0
  54. package/addon/components/template-variable-plugin/template-variable-card.hbs +2 -1
  55. package/addon/components/template-variable-plugin/template-variable-card.ts +227 -0
  56. package/addon/helpers/{limit-text.js → limit-text.ts} +2 -2
  57. package/addon/models/instruction.ts +18 -0
  58. package/addon/models/measure.ts +38 -0
  59. package/addon/models/sign.ts +36 -0
  60. package/addon/models/template.ts +14 -0
  61. package/addon/plugins/article-structure-plugin/commands/index.ts +6 -0
  62. package/addon/plugins/article-structure-plugin/commands/insert-structure.ts +80 -0
  63. package/addon/plugins/article-structure-plugin/commands/move-selected-structure.ts +130 -0
  64. package/addon/plugins/article-structure-plugin/commands/recalculate-structure-numbers.ts +26 -0
  65. package/addon/plugins/article-structure-plugin/commands/remove-structure.ts +21 -0
  66. package/addon/plugins/article-structure-plugin/commands/unwrap-structure.ts +40 -0
  67. package/addon/plugins/article-structure-plugin/commands/wrap-structure-content.ts +66 -0
  68. package/addon/plugins/article-structure-plugin/constants.ts +11 -0
  69. package/addon/plugins/article-structure-plugin/index.ts +70 -0
  70. package/addon/plugins/article-structure-plugin/structures/article-paragraph.ts +94 -0
  71. package/addon/plugins/article-structure-plugin/structures/article.ts +129 -0
  72. package/addon/plugins/article-structure-plugin/structures/chapter.ts +83 -0
  73. package/addon/plugins/article-structure-plugin/structures/index.ts +33 -0
  74. package/addon/plugins/article-structure-plugin/structures/section.ts +82 -0
  75. package/addon/plugins/article-structure-plugin/structures/structure-header.ts +65 -0
  76. package/addon/plugins/article-structure-plugin/structures/subsection.ts +83 -0
  77. package/addon/plugins/article-structure-plugin/structures/title.ts +83 -0
  78. package/addon/plugins/article-structure-plugin/utils/namespace.ts +25 -0
  79. package/addon/plugins/article-structure-plugin/utils/structure.ts +162 -0
  80. package/addon/plugins/besluit-plugin/commands/get-article-nodes-for-besluit.ts +30 -0
  81. package/addon/plugins/besluit-plugin/commands/index.ts +4 -0
  82. package/addon/plugins/besluit-plugin/commands/insert-article.ts +70 -0
  83. package/addon/plugins/besluit-plugin/commands/insert-title.ts +67 -0
  84. package/addon/plugins/besluit-plugin/commands/move-article.ts +69 -0
  85. package/addon/plugins/besluit-plugin/commands/recalculate-article-numbers.ts +44 -0
  86. package/addon/plugins/besluit-plugin/index.ts +11 -0
  87. package/addon/plugins/besluit-plugin/utils/get-title-for-decision.ts +35 -0
  88. package/addon/plugins/besluit-type-plugin/index.ts +6 -0
  89. package/addon/{utils/fetchBesluitTypes.js → plugins/besluit-type-plugin/utils/fetchBesluitTypes.ts} +35 -16
  90. package/addon/plugins/citation-plugin/index.ts +216 -0
  91. package/addon/plugins/citation-plugin/marks/citation.ts +27 -0
  92. package/addon/plugins/citation-plugin/utils/cited-text.ts +17 -0
  93. package/addon/{utils/legislation-types.js → plugins/citation-plugin/utils/legislation-types.ts} +17 -3
  94. package/addon/plugins/citation-plugin/utils/process-match.ts +132 -0
  95. package/addon/{utils/vlaamse-codex.js → plugins/citation-plugin/utils/vlaamse-codex.ts} +160 -41
  96. package/addon/plugins/import-snippet-plugin.ts +6 -0
  97. package/addon/plugins/insert-variable-plugin/index.ts +11 -0
  98. package/addon/{utils/variable-plugins/default-variable-types.js → plugins/insert-variable-plugin/utils/constants.ts} +18 -7
  99. package/addon/plugins/insert-variable-plugin/utils/fetch-data.ts +41 -0
  100. package/addon/plugins/rdfa-date-plugin/commands/index.ts +1 -0
  101. package/addon/plugins/rdfa-date-plugin/commands/modify-date.ts +48 -0
  102. package/addon/plugins/rdfa-date-plugin/index.ts +11 -0
  103. package/addon/plugins/roadsign-regulation-plugin/index.ts +6 -0
  104. package/addon/plugins/roadsign-regulation-plugin/utils/constants.ts +8 -0
  105. package/addon/{utils/roadsign-regulation-plugin/fetchData.js → plugins/roadsign-regulation-plugin/utils/fetchData.ts} +20 -3
  106. package/addon/plugins/roadsign-regulation-plugin/utils/includeInstructions.ts +16 -0
  107. package/addon/plugins/standard-template-plugin/index.ts +6 -0
  108. package/addon/plugins/standard-template-plugin/utils/instantiate-uuids.ts +48 -0
  109. package/addon/plugins/table-of-contents-plugin/index.ts +14 -0
  110. package/addon/plugins/table-of-contents-plugin/nodes/index.ts +1 -0
  111. package/addon/plugins/table-of-contents-plugin/nodes/table-of-contents.ts +53 -0
  112. package/addon/plugins/table-of-contents-plugin/utils/constants.ts +17 -0
  113. package/addon/plugins/template-variable-plugin/index.ts +6 -0
  114. package/addon/plugins/template-variable-plugin/utils/constants.ts +2 -0
  115. package/addon/plugins/template-variable-plugin/utils/fetch-data.ts +62 -0
  116. package/addon/services/{import-rdfa-snippet.js → import-rdfa-snippet.ts} +48 -36
  117. package/addon/services/roadsign-registry.ts +288 -0
  118. package/addon/services/{standard-template-plugin.js → standard-template-plugin.ts} +17 -11
  119. package/addon/utils/memoize.ts +8 -0
  120. package/addon/utils/option.ts +58 -0
  121. package/addon/utils/sparql-helpers.ts +27 -0
  122. package/app/components/article-structure-plugin/article-structure-card.js +1 -0
  123. package/app/components/article-structure-plugin/structure-card.js +1 -0
  124. package/app/components/{citaten-plugin/citaat-card.js → au-native-input.js} +1 -1
  125. package/app/components/{citaten-plugin/citations/article-list.js → besluit-plugin/besluit-context-card.js} +1 -1
  126. package/app/components/besluit-plugin/besluit-plugin-card.js +1 -0
  127. package/app/components/{citaten-plugin/citations/modal.js → citation-plugin/citation-card.js} +1 -1
  128. package/app/components/citation-plugin/citation-insert.js +1 -0
  129. package/app/components/{citaten-plugin/citations/decision-list.js → citation-plugin/citations/article-list.js} +1 -1
  130. package/app/components/{citaten-plugin → citation-plugin}/citations/article-preview.js +1 -1
  131. package/app/components/{citaten-plugin → citation-plugin}/citations/decision-detail.js +1 -1
  132. package/app/components/citation-plugin/citations/decision-list.js +1 -0
  133. package/app/components/{citaten-plugin → citation-plugin}/citations/decision-preview.js +1 -1
  134. package/app/components/citation-plugin/citations/modal.js +1 -0
  135. package/app/components/{citaten-plugin → citation-plugin}/citations/search-modal.js +1 -1
  136. package/app/components/{citaten-plugin → citation-plugin}/helpers/alert-load-error.js +1 -1
  137. package/app/components/{citaten-plugin → citation-plugin}/helpers/alert-no-items.js +1 -1
  138. package/app/components/{citaten-plugin/citaat-insert.js → rdfa-date-plugin/card.js} +1 -1
  139. package/app/components/rdfa-date-plugin/date-time-picker.js +1 -0
  140. package/app/components/rdfa-date-plugin/insert.js +1 -0
  141. package/app/components/standard-template-plugin/card.js +1 -0
  142. package/app/components/table-of-contents-plugin/ember-nodes/outline.js +1 -0
  143. package/app/components/table-of-contents-plugin/ember-nodes/table-of-contents.js +1 -0
  144. package/app/styles/citaten-plugin.scss +1 -1
  145. package/components/article-structure-plugin/article-structure-card.d.ts +17 -0
  146. package/components/article-structure-plugin/structure-card.d.ts +32 -0
  147. package/components/au-native-input.d.ts +20 -0
  148. package/components/besluit-plugin/besluit-context-card.d.ts +24 -0
  149. package/components/besluit-plugin/besluit-plugin-card.d.ts +14 -0
  150. package/components/besluit-type-plugin/besluit-type-select.d.ts +11 -0
  151. package/components/besluit-type-plugin/toolbar-dropdown.d.ts +46 -0
  152. package/components/citation-plugin/citation-card.d.ts +51 -0
  153. package/components/citation-plugin/citation-insert.d.ts +24 -0
  154. package/components/citation-plugin/citations/decision-detail.d.ts +26 -0
  155. package/components/citation-plugin/citations/search-modal.d.ts +67 -0
  156. package/components/import-snippet-plugin/card.d.ts +19 -0
  157. package/components/insert-variable-plugin/insert-variable-card.d.ts +31 -0
  158. package/components/rdfa-date-plugin/card.d.ts +20 -0
  159. package/components/rdfa-date-plugin/date-time-picker.d.ts +32 -0
  160. package/components/rdfa-date-plugin/insert.d.ts +12 -0
  161. package/components/roadsign-regulation-plugin/expanded-measure.d.ts +20 -0
  162. package/components/roadsign-regulation-plugin/measure-template.d.ts +14 -0
  163. package/components/roadsign-regulation-plugin/roadsign-regulation-card.d.ts +12 -0
  164. package/components/roadsign-regulation-plugin/roadsigns-modal.d.ts +57 -0
  165. package/components/roadsign-regulation-plugin/roadsigns-pagination.d.ts +19 -0
  166. package/components/roadsign-regulation-plugin/roadsigns-table.d.ts +9 -0
  167. package/components/standard-template-plugin/card.d.ts +9 -0
  168. package/components/standard-template-plugin/template-provider.d.ts +17 -0
  169. package/components/table-of-contents-plugin/card.d.ts +20 -0
  170. package/components/table-of-contents-plugin/ember-nodes/table-of-contents.d.ts +22 -0
  171. package/components/template-variable-plugin/template-variable-card.d.ts +27 -0
  172. package/helpers/limit-text.d.ts +8 -0
  173. package/index.js +5 -0
  174. package/models/instruction.d.ts +8 -0
  175. package/models/measure.d.ts +14 -0
  176. package/models/sign.d.ts +12 -0
  177. package/models/template.d.ts +13 -0
  178. package/package.json +29 -8
  179. package/plugins/article-structure-plugin/commands/index.d.ts +6 -0
  180. package/plugins/article-structure-plugin/commands/insert-structure.d.ts +5 -0
  181. package/plugins/article-structure-plugin/commands/move-selected-structure.d.ts +10 -0
  182. package/plugins/article-structure-plugin/commands/recalculate-structure-numbers.d.ts +3 -0
  183. package/plugins/article-structure-plugin/commands/remove-structure.d.ts +7 -0
  184. package/plugins/article-structure-plugin/commands/unwrap-structure.d.ts +8 -0
  185. package/plugins/article-structure-plugin/commands/wrap-structure-content.d.ts +8 -0
  186. package/plugins/article-structure-plugin/constants.d.ts +5 -0
  187. package/plugins/article-structure-plugin/index.d.ts +41 -0
  188. package/plugins/article-structure-plugin/structures/article-paragraph.d.ts +4 -0
  189. package/plugins/article-structure-plugin/structures/article.d.ts +6 -0
  190. package/plugins/article-structure-plugin/structures/chapter.d.ts +4 -0
  191. package/plugins/article-structure-plugin/structures/index.d.ts +17 -0
  192. package/plugins/article-structure-plugin/structures/section.d.ts +4 -0
  193. package/plugins/article-structure-plugin/structures/structure-header.d.ts +2 -0
  194. package/plugins/article-structure-plugin/structures/subsection.d.ts +4 -0
  195. package/plugins/article-structure-plugin/structures/title.d.ts +4 -0
  196. package/plugins/article-structure-plugin/utils/namespace.d.ts +6 -0
  197. package/plugins/article-structure-plugin/utils/structure.d.ts +20 -0
  198. package/plugins/besluit-plugin/commands/get-article-nodes-for-besluit.d.ts +5 -0
  199. package/plugins/besluit-plugin/commands/index.d.ts +4 -0
  200. package/plugins/besluit-plugin/commands/insert-article.d.ts +3 -0
  201. package/plugins/besluit-plugin/commands/insert-title.d.ts +2 -0
  202. package/plugins/besluit-plugin/commands/move-article.d.ts +2 -0
  203. package/plugins/besluit-plugin/commands/recalculate-article-numbers.d.ts +2 -0
  204. package/plugins/besluit-plugin/index.d.ts +3 -0
  205. package/plugins/besluit-plugin/utils/get-title-for-decision.d.ts +10 -0
  206. package/plugins/besluit-type-plugin/index.d.ts +2 -0
  207. package/plugins/besluit-type-plugin/utils/fetchBesluitTypes.d.ts +12 -0
  208. package/plugins/citation-plugin/index.d.ts +31 -0
  209. package/plugins/citation-plugin/marks/citation.d.ts +2 -0
  210. package/plugins/citation-plugin/utils/cited-text.d.ts +3 -0
  211. package/plugins/citation-plugin/utils/legislation-types.d.ts +24 -0
  212. package/plugins/citation-plugin/utils/process-match.d.ts +23 -0
  213. package/plugins/citation-plugin/utils/vlaamse-codex.d.ts +56 -0
  214. package/plugins/import-snippet-plugin.d.ts +2 -0
  215. package/plugins/insert-variable-plugin/index.d.ts +2 -0
  216. package/plugins/insert-variable-plugin/utils/constants.d.ts +7 -0
  217. package/plugins/insert-variable-plugin/utils/fetch-data.d.ts +5 -0
  218. package/plugins/rdfa-date-plugin/commands/index.d.ts +1 -0
  219. package/plugins/rdfa-date-plugin/commands/modify-date.d.ts +2 -0
  220. package/plugins/rdfa-date-plugin/index.d.ts +3 -0
  221. package/plugins/roadsign-regulation-plugin/index.d.ts +2 -0
  222. package/plugins/roadsign-regulation-plugin/utils/constants.d.ts +3 -0
  223. package/plugins/roadsign-regulation-plugin/utils/fetchData.d.ts +8 -0
  224. package/plugins/roadsign-regulation-plugin/utils/includeInstructions.d.ts +2 -0
  225. package/plugins/standard-template-plugin/index.d.ts +2 -0
  226. package/plugins/standard-template-plugin/utils/instantiate-uuids.d.ts +15 -0
  227. package/plugins/table-of-contents-plugin/index.d.ts +3 -0
  228. package/plugins/table-of-contents-plugin/nodes/index.d.ts +1 -0
  229. package/plugins/table-of-contents-plugin/nodes/table-of-contents.d.ts +4 -0
  230. package/plugins/table-of-contents-plugin/utils/constants.d.ts +7 -0
  231. package/plugins/template-variable-plugin/index.d.ts +2 -0
  232. package/plugins/template-variable-plugin/utils/constants.d.ts +1 -0
  233. package/plugins/template-variable-plugin/utils/fetch-data.d.ts +9 -0
  234. package/services/import-rdfa-snippet.d.ts +99 -0
  235. package/services/roadsign-registry.d.ts +42 -0
  236. package/services/standard-template-plugin.d.ts +21 -0
  237. package/translations/en-US.yaml +64 -1
  238. package/translations/nl-BE.yaml +66 -3
  239. package/tsconfig.json +34 -9
  240. package/types/config/environment.d.ts +22 -0
  241. package/types/ember-mu-transform-helpers/transforms/string-set.d.ts +14 -0
  242. package/types/lblod/frontend-gelinkt-notuleren/models/account.d.ts +10 -0
  243. package/types/lblod/frontend-gelinkt-notuleren/models/bestuurseenheid-classificatie-code.d.ts +10 -0
  244. package/types/lblod/frontend-gelinkt-notuleren/models/bestuurseenheid.d.ts +12 -0
  245. package/types/lblod/frontend-gelinkt-notuleren/models/gebruiker-model.d.ts +18 -0
  246. package/types/lblod/frontend-gelinkt-notuleren/services/current-session.d.ts +30 -0
  247. package/types/lblod/marawa/dom-helpers.d.ts +4 -0
  248. package/types/lblod/marawa/ember-object-mock.d.ts +3 -0
  249. package/types/lblod/marawa/node-walker.d.ts +18 -0
  250. package/types/lblod/marawa/range-helpers.d.ts +10 -0
  251. package/types/lblod/marawa/rdfa-attributes.d.ts +25 -0
  252. package/types/lblod/marawa/rdfa-block.d.ts +22 -0
  253. package/types/lblod/marawa/rdfa-context-scanner.d.ts +13 -0
  254. package/types/lblod/marawa/rdfa-helpers.d.ts +22 -0
  255. package/types/lblod/marawa/rich-node.d.ts +50 -0
  256. package/types/lblod/marawa/triple.d.ts +16 -0
  257. package/utils/memoize.d.ts +1 -0
  258. package/utils/option.d.ts +14 -0
  259. package/utils/sparql-helpers.d.ts +7 -0
  260. package/addon/commands/generate-template-command.js +0 -35
  261. package/addon/commands/insert-and-collapse.js +0 -32
  262. package/addon/commands/modify-date-command.js +0 -42
  263. package/addon/components/besluit-type-plugin/toolbar-dropdown.js +0 -188
  264. package/addon/components/citaten-plugin/citaat-card.hbs +0 -76
  265. package/addon/components/citaten-plugin/citaat-card.js +0 -286
  266. package/addon/components/citaten-plugin/citaat-insert.hbs +0 -20
  267. package/addon/components/citaten-plugin/citaat-insert.js +0 -68
  268. package/addon/components/citaten-plugin/citations/search-modal.hbs +0 -175
  269. package/addon/components/import-snippet-plugin/card.js +0 -95
  270. package/addon/components/insert-variable-plugin/insert-variable-card.js +0 -125
  271. package/addon/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -71
  272. package/addon/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -24
  273. package/addon/components/roadsign-regulation-plugin/expanded-measure.js +0 -38
  274. package/addon/components/roadsign-regulation-plugin/measure-template.js +0 -30
  275. package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.js +0 -101
  276. package/addon/components/roadsign-regulation-plugin/roadsigns-table.js +0 -24
  277. package/addon/components/standard-template-plugin/template-card.js +0 -7
  278. package/addon/components/standard-template-plugin/template-provider.js +0 -75
  279. package/addon/components/table-of-contents-plugin/card.js +0 -53
  280. package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.hbs +0 -9
  281. package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -100
  282. package/addon/components/template-variable-plugin/template-variable-card.js +0 -230
  283. package/addon/constants.js +0 -24
  284. package/addon/initializers/plugin-initializer.js +0 -75
  285. package/addon/inline-components/table-of-contents.js +0 -43
  286. package/addon/marks/citaten-mark.js +0 -32
  287. package/addon/models/instruction.js +0 -19
  288. package/addon/models/measure.js +0 -46
  289. package/addon/models/sign.js +0 -37
  290. package/addon/models/template.js +0 -9
  291. package/addon/plugins/besluit-type-plugin.js +0 -16
  292. package/addon/plugins/citaten-plugin.js +0 -22
  293. package/addon/plugins/generate-template-plugin.js +0 -16
  294. package/addon/plugins/import-snippet-plugin.js +0 -16
  295. package/addon/plugins/insert-variable-plugin.js +0 -19
  296. package/addon/plugins/rdfa-date-plugin.js +0 -26
  297. package/addon/plugins/roadsign-regulation-plugin.js +0 -24
  298. package/addon/plugins/standard-template-plugin.js +0 -33
  299. package/addon/plugins/table-of-contents-plugin.js +0 -27
  300. package/addon/plugins/template-variable-plugin.js +0 -21
  301. package/addon/services/roadsign-registry.js +0 -240
  302. package/addon/utils/generate-template-plugin/default-resources.js +0 -9
  303. package/addon/utils/instantiate-uuids.js +0 -34
  304. package/addon/utils/memoize.js +0 -8
  305. package/addon/utils/processMatch.js +0 -80
  306. package/addon/utils/roadsign-regulation-plugin/includeInstructions.js +0 -10
  307. package/addon/utils/variable-plugins/fetch-data.js +0 -98
  308. package/app/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -1
  309. package/app/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -1
  310. package/app/components/rdfa-date-plugin/rdfa-date-time-picker.js +0 -1
  311. package/app/components/standard-template-plugin/template-card.js +0 -1
  312. package/app/components/table-of-contents-plugin/inline-components/outline.js +0 -1
  313. package/app/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -1
  314. package/app/initializers/plugin-initializer.js +0 -4
  315. package/types/dummy/index.d.ts +0 -1
  316. package/types/ember-data/types/registries/model.d.ts +0 -6
package/CHANGELOG.md CHANGED
@@ -7,6 +7,52 @@
7
7
 
8
8
 
9
9
 
10
+
11
+
12
+ ## 1.0.0-alpha.2 (2023-01-03)
13
+
14
+ #### :boom: Breaking Change
15
+ * [#38](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/38) Folder restructure ([@elpoelma](https://github.com/elpoelma))
16
+
17
+ #### :rocket: Enhancement
18
+ * [#40](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/40) Major rework of article-structure plugin ([@elpoelma](https://github.com/elpoelma))
19
+ * [#39](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/39) Remove paragraphs from toc ([@lagartoverde](https://github.com/lagartoverde))
20
+
21
+ #### :bug: Bug Fix
22
+ * [#37](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/37) Fix besluit plugin numbering ([@elpoelma](https://github.com/elpoelma))
23
+
24
+ #### :house: Internal
25
+ * [#41](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/41) Update editor to 1.0.0-alpha.13 ([@elpoelma](https://github.com/elpoelma))
26
+ * [#38](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/38) Folder restructure ([@elpoelma](https://github.com/elpoelma))
27
+
28
+ #### Committers: 2
29
+ - Elena Poelman ([@elpoelma](https://github.com/elpoelma))
30
+ - Oscar Rodriguez Villalobos ([@lagartoverde](https://github.com/lagartoverde))
31
+
32
+ ## 1.0.0-alpha.1 (2022-12-22)
33
+
34
+ #### :rocket: Enhancement
35
+ * [#35](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/35) converting the besluit-plugin to new API ([@usrtim](https://github.com/usrtim))
36
+ * [#34](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/34) Add and convert citation plugin ([@abeforgit](https://github.com/abeforgit))
37
+ * [#32](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/32) Convert table-of-contents plugin to prosemirror based editor. ([@elpoelma](https://github.com/elpoelma))
38
+ * [#33](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/33) feature/dev utils ([@abeforgit](https://github.com/abeforgit))
39
+ * [#31](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/31) Convert roadsign-regulation plugin to prosemirror based editor. ([@elpoelma](https://github.com/elpoelma))
40
+ * [#28](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/28) Convert insert-variable plugin to prosemirror based editor. ([@elpoelma](https://github.com/elpoelma))
41
+ * [#29](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/29) Convert template-variable plugin to prosemirror based editor. ([@elpoelma](https://github.com/elpoelma))
42
+ * [#20](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/20) Convert standard-template plugin to prosemirror based editor plugin ([@elpoelma](https://github.com/elpoelma))
43
+ * [#19](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/19) Convert import-snippet plugin to prosemirror based editor plugin ([@elpoelma](https://github.com/elpoelma))
44
+ * [#18](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/18) Convert besluit-type plugin to prosemirror based editor plugin ([@elpoelma](https://github.com/elpoelma))
45
+ * [#17](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/17) Convert rdfa-date plugin to prosemirror based editor plugin ([@elpoelma](https://github.com/elpoelma))
46
+
47
+ #### :house: Internal
48
+ * [#26](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/26) Convert besluit-type, import-snippet, rdfa-date and standard-template plugins to typescript ([@elpoelma](https://github.com/elpoelma))
49
+
50
+ #### Committers: 4
51
+ - Arne Bertrand ([@abeforgit](https://github.com/abeforgit))
52
+ - Elena Poelman ([@elpoelma](https://github.com/elpoelma))
53
+ - Oscar Rodriguez Villalobos ([@lagartoverde](https://github.com/lagartoverde))
54
+ - [@usrtim](https://github.com/usrtim)
55
+
10
56
  ## 0.4.1 (2022-12-02)
11
57
 
12
58
  #### :bug: Bug Fix
@@ -0,0 +1,10 @@
1
+ <div>
2
+ {{#each this.structureTypes as |structureType|}}
3
+ <AuList::Item>
4
+ <AuButton @icon="add" @iconAlignment="left" @skin="link" @disabled={{not (this.canInsertStructure structureType)}}
5
+ {{on 'click' (fn this.insertStructure structureType)}}>
6
+ {{t structureType.translations.insert}}
7
+ </AuButton>
8
+ </AuList::Item>
9
+ {{/each}}
10
+ </div>
@@ -0,0 +1,33 @@
1
+ import Component from '@glimmer/component';
2
+ import { inject as service } from '@ember/service';
3
+ import { ProseController } from '@lblod/ember-rdfa-editor';
4
+ import IntlService from 'ember-intl/services/intl';
5
+ import {
6
+ ArticleStructurePluginOptions,
7
+ StructureSpec,
8
+ } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin';
9
+ import { action } from '@ember/object';
10
+ import { insertStructure } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin/commands';
11
+
12
+ type Args = {
13
+ controller: ProseController;
14
+ widgetArgs: {
15
+ options: ArticleStructurePluginOptions;
16
+ };
17
+ };
18
+ export default class EditorPluginsArticleStructureCardComponent extends Component<Args> {
19
+ @service declare intl: IntlService;
20
+
21
+ get structureTypes() {
22
+ return this.args.widgetArgs.options;
23
+ }
24
+
25
+ @action
26
+ insertStructure(spec: StructureSpec) {
27
+ this.args.controller.doCommand(insertStructure(spec, this.intl));
28
+ this.args.controller.focus();
29
+ }
30
+
31
+ canInsertStructure = (spec: StructureSpec) =>
32
+ this.args.controller.checkCommand(insertStructure(spec, this.intl));
33
+ }
@@ -0,0 +1,46 @@
1
+ {{#unless this.isOutsideStructure}}
2
+ <AuCard @flex={{true}} @divided={{true}} @expandable={{false}} @shadow={{true}} @size="flush" as |c|>
3
+ <c.header class="au-u-hidden-visually">
4
+ <AuHeading @level="3" @skin="6">{{t "article-structure-plugin.title.structureCard"}}</AuHeading>
5
+ </c.header>
6
+ <c.content class="au-c-content--small">
7
+ <AuList @divider={{true}} class="au-u-padding-top-tiny au-u-padding-bottom-tiny" as |Item|>
8
+ <Item>
9
+ <AuButton
10
+ @icon="chevron-up"
11
+ @iconAlignment="left"
12
+ @skin="link"
13
+ @disabled={{not this.canMoveUp}}
14
+ {{on 'click' (fn this.moveStructure 'up')}}>
15
+ {{t this.currentStructureType.translations.move.up}}
16
+ </AuButton>
17
+ </Item>
18
+ <Item>
19
+ <AuButton
20
+ @icon="chevron-down"
21
+ @iconAlignment="left"
22
+ @skin="link"
23
+ @disabled={{not this.canMoveDown}}
24
+ {{on 'click' (fn this.moveStructure 'down')}}>
25
+ {{t this.currentStructureType.translations.move.down}}
26
+ </AuButton>
27
+ </Item>
28
+ <Item>
29
+ <AuToggleSwitch
30
+ @label={{t "article-structure-plugin.remove.content"}}
31
+ @checked={{this.removeStructureContent}}
32
+ @onChange={{this.setRemoveStructureContent}}/>
33
+ <AuButton
34
+ @icon="bin"
35
+ @iconAlignment="left"
36
+ @skin="link"
37
+ @alert={{true}}
38
+ @disabled={{not this.canRemoveStructure}}
39
+ {{on 'click' this.removeStructure}}>
40
+ {{t this.currentStructureType.translations.remove}}
41
+ </AuButton>
42
+ </Item>
43
+ </AuList>
44
+ </c.content>
45
+ </AuCard>
46
+ {{/unless}}
@@ -0,0 +1,124 @@
1
+ import Component from '@glimmer/component';
2
+ import { action } from '@ember/object';
3
+ import { ProseController } from '@lblod/ember-rdfa-editor';
4
+ import {
5
+ moveSelectedStructure,
6
+ removeStructure,
7
+ unwrapStructure,
8
+ } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin/commands';
9
+ import { ArticleStructurePluginOptions } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin';
10
+ import { findAncestorOfType } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin/utils/structure';
11
+ import { tracked } from '@glimmer/tracking';
12
+ import { inject as service } from '@ember/service';
13
+ import IntlService from 'ember-intl/services/intl';
14
+
15
+ type Args = {
16
+ controller: ProseController;
17
+ widgetArgs: {
18
+ options: ArticleStructurePluginOptions;
19
+ };
20
+ };
21
+
22
+ export default class EditorPluginsStructureCardComponent extends Component<Args> {
23
+ @service declare intl: IntlService;
24
+ @tracked removeStructureContent = false;
25
+
26
+ get controller() {
27
+ return this.args.controller;
28
+ }
29
+
30
+ @action
31
+ moveStructure(direction: 'up' | 'down') {
32
+ this.controller.doCommand(
33
+ moveSelectedStructure(this.structureTypes, direction, this.intl)
34
+ );
35
+ this.controller.focus();
36
+ }
37
+
38
+ @action
39
+ removeStructure() {
40
+ if (this.structure && this.currentStructureType) {
41
+ if (this.removeStructureContent) {
42
+ this.controller.doCommand(
43
+ removeStructure(this.structure, this.structureTypes)
44
+ );
45
+ } else {
46
+ this.controller.doCommand(
47
+ unwrapStructure(
48
+ {
49
+ ...this.structure,
50
+ type: this.currentStructureType,
51
+ },
52
+ this.structureTypes
53
+ )
54
+ );
55
+ }
56
+ }
57
+ this.controller.focus();
58
+ }
59
+
60
+ @action
61
+ setRemoveStructureContent(value: boolean) {
62
+ this.removeStructureContent = value;
63
+ }
64
+
65
+ get structureTypes() {
66
+ return this.args.widgetArgs.options;
67
+ }
68
+
69
+ get structureNodeSpecs() {
70
+ return this.structureTypes.map(
71
+ (type) => this.controller.schema.nodes[type.name]
72
+ );
73
+ }
74
+
75
+ get structure() {
76
+ const currentSelection = this.controller.state.selection;
77
+ return findAncestorOfType(currentSelection, ...this.structureNodeSpecs);
78
+ }
79
+
80
+ get currentStructureType() {
81
+ if (this.structure) {
82
+ const { node: structureNode } = this.structure;
83
+ return this.structureTypes.find(
84
+ (spec) => spec.name === structureNode.type.name
85
+ );
86
+ }
87
+ return;
88
+ }
89
+
90
+ get isOutsideStructure() {
91
+ return !this.structure;
92
+ }
93
+
94
+ get canMoveDown() {
95
+ return this.controller.checkCommand(
96
+ moveSelectedStructure(this.structureTypes, 'down', this.intl)
97
+ );
98
+ }
99
+
100
+ get canMoveUp() {
101
+ return this.controller.checkCommand(
102
+ moveSelectedStructure(this.structureTypes, 'up', this.intl)
103
+ );
104
+ }
105
+
106
+ get canRemoveStructure() {
107
+ if (this.structure && this.currentStructureType) {
108
+ if (this.removeStructureContent) {
109
+ return true;
110
+ } else {
111
+ return this.controller.checkCommand(
112
+ unwrapStructure(
113
+ {
114
+ ...this.structure,
115
+ type: this.currentStructureType,
116
+ },
117
+ this.structureTypes
118
+ )
119
+ );
120
+ }
121
+ }
122
+ return false;
123
+ }
124
+ }
@@ -0,0 +1,30 @@
1
+ {{#if @icon}}
2
+ <span class='au-c-input-wrapper {{this.iconAlignment}} {{this.width}}'>
3
+ <input
4
+ type={{this.type}}
5
+ class='au-c-input
6
+ {{this.error}}
7
+ {{this.warning}}
8
+ {{this.width}}
9
+ {{this.disabled}}'
10
+ disabled={{@disabled}}
11
+ ...attributes
12
+ />
13
+ {{#if (eq @iconAlignment 'right')}}
14
+ <AuIcon @icon={{@icon}} @alignment='right' />
15
+ {{else}}
16
+ <AuIcon @icon={{@icon}} @alignment='left' />
17
+ {{/if}}
18
+ </span>
19
+ {{else}}
20
+ <input
21
+ type={{this.type}}
22
+ class='au-c-input
23
+ {{this.error}}
24
+ {{this.warning}}
25
+ {{this.width}}
26
+ {{this.disabled}}'
27
+ disabled={{@disabled}}
28
+ ...attributes
29
+ />
30
+ {{/if}}
@@ -0,0 +1,47 @@
1
+ import Component from '@glimmer/component';
2
+
3
+ interface Args {
4
+ width?: 'block';
5
+ iconAlignment?: 'left' | 'right';
6
+ error?: boolean;
7
+ warning?: boolean;
8
+ disabled?: boolean;
9
+ type?: string;
10
+ icon?: string;
11
+ }
12
+
13
+ export default class AuNativeInput extends Component<Args> {
14
+ constructor(owner: unknown, args: Args) {
15
+ super(owner, args);
16
+ }
17
+
18
+ get width() {
19
+ if (this.args.width == 'block') return 'au-c-input--block';
20
+ else return '';
21
+ }
22
+
23
+ get iconAlignment() {
24
+ if (this.args.iconAlignment == 'left') return 'au-c-input-wrapper--left';
25
+ if (this.args.iconAlignment == 'right') return 'au-c-input-wrapper--right';
26
+ else return '';
27
+ }
28
+
29
+ get error() {
30
+ if (this.args.error) return 'au-c-input--error';
31
+ else return '';
32
+ }
33
+
34
+ get warning() {
35
+ if (this.args.warning) return 'au-c-input--warning';
36
+ else return '';
37
+ }
38
+
39
+ get disabled() {
40
+ if (this.args.disabled) return 'is-disabled';
41
+ else return '';
42
+ }
43
+
44
+ get type() {
45
+ return this.args.type || 'text';
46
+ }
47
+ }
@@ -0,0 +1,44 @@
1
+ {{#if this.activeArticle}}
2
+ <AuCard
3
+ @shadow={{true}}
4
+ @size="flush" as |c|>
5
+ <c.header class="au-u-hidden-visually">
6
+ <AuHeading @level="3" @skin="6">
7
+ {{t "besluit-plugin.card.title"}}
8
+ </AuHeading>
9
+ </c.header>
10
+ <c.content class="au-c-content--small">
11
+ <AuList @divider={{true}} class="au-u-padding-top-tiny au-u-padding-bottom-tiny">
12
+ <AuList::Item>
13
+ <AuButton
14
+ @icon="bin"
15
+ @iconAlignment="left"
16
+ @skin="link"
17
+ {{on 'click' this.deleteArticle}}>
18
+ {{t "besluit-plugin.action.delete-article"}}
19
+ </AuButton>
20
+ </AuList::Item>
21
+ <AuList::Item>
22
+ <AuButton
23
+ @icon="nav-up"
24
+ @iconAlignment="left"
25
+ @skin="link"
26
+ @disabled={{this.disableMoveUp}}
27
+ {{on 'click' this.moveUpArticle}}>
28
+ {{t "besluit-plugin.action.article-up"}}
29
+ </AuButton>
30
+ </AuList::Item>
31
+ <AuList::Item>
32
+ <AuButton
33
+ @icon="nav-down"
34
+ @iconAlignment="left"
35
+ @skin="link"
36
+ @disabled={{this.disableMoveDown}}
37
+ {{on 'click' this.moveDownArticle}}>
38
+ {{t "besluit-plugin.action.article-down"}}
39
+ </AuButton>
40
+ </AuList::Item>
41
+ </AuList>
42
+ </c.content>
43
+ </AuCard>
44
+ {{/if}}
@@ -0,0 +1,138 @@
1
+ import Component from '@glimmer/component';
2
+ import { tracked } from '@glimmer/tracking';
3
+ import { action } from '@ember/object';
4
+ import {
5
+ moveArticle,
6
+ recalculateArticleNumbers,
7
+ } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-plugin/commands';
8
+ import { ResolvedPNode } from '@lblod/ember-rdfa-editor/plugins/datastore';
9
+ import { ProseController } from '@lblod/ember-rdfa-editor';
10
+
11
+ interface Args {
12
+ controller: ProseController;
13
+ }
14
+
15
+ export default class BesluitContextCardComponent extends Component<Args> {
16
+ @tracked articleElement?: ResolvedPNode;
17
+
18
+ constructor(parent: unknown, args: Args) {
19
+ super(parent, args);
20
+ }
21
+
22
+ get controller() {
23
+ return this.args.controller;
24
+ }
25
+
26
+ get doc() {
27
+ return this.controller.state.doc;
28
+ }
29
+ focus() {
30
+ this.controller.focus();
31
+ }
32
+
33
+ @action
34
+ deleteArticle() {
35
+ if (this.activeArticle && this.besluitURI) {
36
+ const { from, to } = this.activeArticle.range;
37
+ this.controller.withTransaction((tr) => {
38
+ return tr.delete(from, to);
39
+ });
40
+ this.focus();
41
+ recalculateArticleNumbers(this.controller, this.besluitURI);
42
+ }
43
+ }
44
+
45
+ @action
46
+ moveUpArticle() {
47
+ if (this.besluitURI && this.activeArticle) {
48
+ this.controller.doCommand(
49
+ moveArticle(
50
+ this.controller,
51
+ this.besluitURI,
52
+ this.activeArticle.uri,
53
+ true
54
+ )
55
+ );
56
+ }
57
+ }
58
+
59
+ @action
60
+ moveDownArticle() {
61
+ if (this.besluitURI && this.activeArticle) {
62
+ this.controller.doCommand(
63
+ moveArticle(
64
+ this.controller,
65
+ this.besluitURI,
66
+ this.activeArticle.uri,
67
+ false
68
+ )
69
+ );
70
+ }
71
+ }
72
+
73
+ get disableMoveUp() {
74
+ if (this.besluitURI && this.activeArticle) {
75
+ return !this.controller.checkCommand(
76
+ moveArticle(
77
+ this.controller,
78
+ this.besluitURI,
79
+ this.activeArticle.uri,
80
+ true
81
+ )
82
+ );
83
+ }
84
+ return true;
85
+ }
86
+
87
+ get disableMoveDown() {
88
+ if (this.besluitURI && this.activeArticle) {
89
+ return !this.controller.checkCommand(
90
+ moveArticle(
91
+ this.controller,
92
+ this.besluitURI,
93
+ this.activeArticle.uri,
94
+ false
95
+ )
96
+ );
97
+ }
98
+ return true;
99
+ }
100
+
101
+ get besluitURI() {
102
+ const { from, to } = this.controller.state.selection;
103
+
104
+ const limitedDatastore = this.controller.datastore.limitToRange(
105
+ this.controller.state,
106
+ from,
107
+ to
108
+ );
109
+ return limitedDatastore
110
+ .match(null, 'a', 'besluit:Besluit')
111
+ .asQuadResultSet()
112
+ .first()?.subject.value;
113
+ }
114
+
115
+ get activeArticle() {
116
+ if (this.besluitURI) {
117
+ const { from, to } = this.controller.state.selection;
118
+
119
+ const limitedDatastore = this.controller.datastore.limitToRange(
120
+ this.controller.state,
121
+ from,
122
+ to
123
+ );
124
+ const dsResult = [
125
+ ...limitedDatastore
126
+ .match(null, 'a', 'besluit:Artikel')
127
+ .asSubjectNodeMapping(),
128
+ ][0];
129
+ if (dsResult) {
130
+ return {
131
+ uri: dsResult.term.value,
132
+ range: dsResult.nodes[0],
133
+ };
134
+ }
135
+ }
136
+ return;
137
+ }
138
+ }
@@ -0,0 +1,20 @@
1
+ <AuList::Item>
2
+ <AuButton
3
+ @icon="add"
4
+ @iconAlignment="left"
5
+ @skin="link"
6
+ @disabled={{this.hasTitle}}
7
+ {{on 'click' this.insertTitle}}>
8
+ {{t "besluit-plugin.insert.decision-title"}}
9
+ </AuButton>
10
+ </AuList::Item>
11
+ <AuList::Item>
12
+ <AuButton
13
+ @icon="add"
14
+ @iconAlignment="left"
15
+ @skin="link"
16
+ @disabled={{this.disableArticleInsert}}
17
+ {{on "click" this.insertArticle}}>
18
+ {{t "besluit-plugin.insert.article"}}
19
+ </AuButton>
20
+ </AuList::Item>
@@ -0,0 +1,40 @@
1
+ import Component from '@glimmer/component';
2
+ import { action } from '@ember/object';
3
+ import {
4
+ insertTitle,
5
+ insertArticle,
6
+ } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-plugin/commands';
7
+ import { ProseController } from '@lblod/ember-rdfa-editor';
8
+
9
+ type Args = {
10
+ controller: ProseController;
11
+ };
12
+
13
+ export default class BesluitPluginCardComponent extends Component<Args> {
14
+ get controller() {
15
+ return this.args.controller;
16
+ }
17
+
18
+ focus() {
19
+ this.controller.focus();
20
+ }
21
+ @action
22
+ insertArticle() {
23
+ this.controller.checkAndDoCommand(insertArticle(this.controller, ''));
24
+ this.focus();
25
+ }
26
+
27
+ @action
28
+ insertTitle() {
29
+ this.controller.doCommand(insertTitle(this.controller, ''));
30
+ this.focus();
31
+ }
32
+
33
+ get hasTitle() {
34
+ return !this.controller.checkCommand(insertTitle(this.controller, ''));
35
+ }
36
+
37
+ get disableArticleInsert() {
38
+ return !this.controller.checkCommand(insertArticle(this.controller, ''));
39
+ }
40
+ }
@@ -1,18 +1,22 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { action } from '@ember/object';
3
3
  import { tracked } from '@glimmer/tracking';
4
+ import { BesluitType } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-type-plugin/utils/fetchBesluitTypes';
5
+ type Args = {
6
+ besluitTypes: BesluitType[];
7
+ };
4
8
 
5
- export default class BesluitTypePluginBesluitTypeSelectComponent extends Component {
9
+ export default class BesluitTypePluginBesluitTypeSelectComponent extends Component<Args> {
6
10
  @tracked besluitTypes;
7
- constructor() {
8
- super(...arguments);
11
+ constructor(parent: unknown, args: Args) {
12
+ super(parent, args);
9
13
  this.besluitTypes = this.args.besluitTypes.sort((a, b) =>
10
14
  a.label > b.label ? 1 : -1
11
15
  );
12
16
  }
13
17
 
14
18
  @action
15
- search(term) {
19
+ search(term: string) {
16
20
  const lowerTerm = term.toLowerCase();
17
21
  return this.args.besluitTypes.filter((besluitType) =>
18
22
  besluitType.label.toLowerCase().includes(lowerTerm)
@@ -1,3 +1,4 @@
1
+ <div {{did-update this.updateBesluitTypes @controller.state}}>
1
2
  {{#if this.showCard}}
2
3
  {{#if this.loadDataTaskInstance.isError}}
3
4
  <AuPill
@@ -81,3 +82,4 @@
81
82
  </Modal.Body>
82
83
  </AuModal>
83
84
  {{/if}}
85
+ </div>