@lblod/ember-rdfa-editor-lblod-plugins 0.3.0 → 0.4.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 (270) hide show
  1. package/.release-it.json +14 -0
  2. package/.woodpecker/.release.yml +15 -0
  3. package/.woodpecker/.test.yml +23 -0
  4. package/CHANGELOG.md +84 -0
  5. package/README.md +311 -14
  6. package/RELEASE.md +60 -0
  7. package/addon/commands/generate-template-command.js +35 -0
  8. package/addon/commands/insert-and-collapse.js +32 -0
  9. package/addon/commands/modify-date-command.js +42 -0
  10. package/addon/components/besluit-type-plugin/besluit-type-select.hbs +28 -0
  11. package/addon/components/besluit-type-plugin/besluit-type-select.js +21 -0
  12. package/addon/components/besluit-type-plugin/toolbar-dropdown.hbs +83 -0
  13. package/addon/components/besluit-type-plugin/toolbar-dropdown.js +188 -0
  14. package/addon/components/citaten-plugin/citaat-card.hbs +76 -0
  15. package/addon/components/citaten-plugin/citaat-card.js +286 -0
  16. package/addon/components/citaten-plugin/citaat-insert.hbs +20 -0
  17. package/addon/components/citaten-plugin/citaat-insert.js +68 -0
  18. package/addon/components/citaten-plugin/citations/article-list.hbs +13 -0
  19. package/addon/components/citaten-plugin/citations/article-preview.hbs +16 -0
  20. package/addon/components/citaten-plugin/citations/decision-detail.hbs +110 -0
  21. package/addon/components/citaten-plugin/citations/decision-detail.js +94 -0
  22. package/addon/components/citaten-plugin/citations/decision-list.hbs +15 -0
  23. package/addon/components/citaten-plugin/citations/decision-preview.hbs +53 -0
  24. package/addon/components/citaten-plugin/citations/search-modal.hbs +175 -0
  25. package/addon/components/citaten-plugin/citations/search-modal.js +244 -0
  26. package/addon/components/citaten-plugin/helpers/alert-load-error.hbs +21 -0
  27. package/addon/components/citaten-plugin/helpers/alert-no-items.hbs +10 -0
  28. package/addon/components/import-snippet-plugin/card.hbs +17 -0
  29. package/addon/components/import-snippet-plugin/card.js +95 -0
  30. package/addon/components/insert-variable-plugin/insert-variable-card.hbs +33 -0
  31. package/addon/components/insert-variable-plugin/insert-variable-card.js +125 -0
  32. package/addon/components/rdfa-date-plugin/rdfa-date-plugin-card.hbs +22 -0
  33. package/addon/components/rdfa-date-plugin/rdfa-date-plugin-card.js +64 -0
  34. package/addon/components/rdfa-date-plugin/rdfa-date-plugin-insert.hbs +18 -0
  35. package/addon/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +24 -0
  36. package/addon/components/rdfa-date-plugin/rdfa-date-time-picker.hbs +21 -0
  37. package/addon/components/rdfa-date-plugin/rdfa-date-time-picker.js +73 -0
  38. package/addon/components/roadsign-regulation-plugin/expanded-measure.hbs +44 -0
  39. package/addon/components/roadsign-regulation-plugin/expanded-measure.js +38 -0
  40. package/addon/components/roadsign-regulation-plugin/measure-template.hbs +5 -0
  41. package/addon/components/roadsign-regulation-plugin/measure-template.js +30 -0
  42. package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.hbs +12 -0
  43. package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.js +101 -0
  44. package/addon/components/roadsign-regulation-plugin/roadsigns-modal.hbs +92 -0
  45. package/addon/components/roadsign-regulation-plugin/roadsigns-modal.js +268 -0
  46. package/addon/components/roadsign-regulation-plugin/roadsigns-pagination.hbs +25 -0
  47. package/addon/components/roadsign-regulation-plugin/roadsigns-pagination.js +55 -0
  48. package/addon/components/roadsign-regulation-plugin/roadsigns-table.hbs +73 -0
  49. package/addon/components/roadsign-regulation-plugin/roadsigns-table.js +24 -0
  50. package/addon/components/standard-template-plugin/template-card.hbs +16 -0
  51. package/addon/components/standard-template-plugin/template-card.js +7 -0
  52. package/addon/components/standard-template-plugin/template-provider.hbs +6 -0
  53. package/addon/components/standard-template-plugin/template-provider.js +75 -0
  54. package/addon/components/table-of-contents-plugin/card.hbs +5 -0
  55. package/addon/components/table-of-contents-plugin/card.js +53 -0
  56. package/addon/components/table-of-contents-plugin/inline-components/outline.hbs +21 -0
  57. package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.hbs +9 -0
  58. package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.js +100 -0
  59. package/addon/components/template-variable-plugin/template-variable-card.hbs +34 -0
  60. package/addon/components/template-variable-plugin/template-variable-card.js +230 -0
  61. package/addon/constants.js +24 -0
  62. package/{dist → addon}/helpers/limit-text.js +1 -4
  63. package/addon/initializers/plugin-initializer.js +75 -0
  64. package/addon/inline-components/table-of-contents.js +43 -0
  65. package/addon/marks/citaten-mark.js +32 -0
  66. package/addon/models/instruction.js +19 -0
  67. package/addon/models/measure.js +46 -0
  68. package/{dist → addon}/models/sign.js +12 -13
  69. package/addon/models/template.js +9 -0
  70. package/addon/plugins/besluit-type-plugin.js +16 -0
  71. package/addon/plugins/citaten-plugin.js +22 -0
  72. package/addon/plugins/generate-template-plugin.js +16 -0
  73. package/addon/plugins/import-snippet-plugin.js +16 -0
  74. package/addon/plugins/insert-variable-plugin.js +19 -0
  75. package/addon/plugins/rdfa-date-plugin.js +26 -0
  76. package/addon/plugins/roadsign-regulation-plugin.js +24 -0
  77. package/addon/plugins/standard-template-plugin.js +33 -0
  78. package/addon/plugins/table-of-contents-plugin.js +27 -0
  79. package/addon/plugins/template-variable-plugin.js +21 -0
  80. package/addon/serializers/application.js +8 -0
  81. package/{dist → addon}/services/import-rdfa-snippet.js +28 -18
  82. package/{dist → addon}/services/roadsign-registry.js +67 -121
  83. package/addon/services/standard-template-plugin.js +45 -0
  84. package/addon/utils/fetchBesluitTypes.js +90 -0
  85. package/addon/utils/generate-template-plugin/default-resources.js +9 -0
  86. package/addon/utils/instantiate-uuids.js +34 -0
  87. package/addon/utils/legislation-types.js +32 -0
  88. package/addon/utils/memoize.js +8 -0
  89. package/addon/utils/processMatch.js +80 -0
  90. package/addon/utils/roadsign-regulation-plugin/fetchData.js +78 -0
  91. package/addon/utils/roadsign-regulation-plugin/includeInstructions.js +10 -0
  92. package/addon/utils/variable-plugins/default-variable-types.js +56 -0
  93. package/{dist/fetch-data-284bf106.js → addon/utils/variable-plugins/fetch-data.js} +36 -18
  94. package/{dist/vlaamse-codex-187fe526.js → addon/utils/vlaamse-codex.js} +159 -63
  95. package/app/components/besluit-type-plugin/besluit-type-select.js +1 -0
  96. package/app/components/besluit-type-plugin/toolbar-dropdown.js +1 -0
  97. package/app/components/citaten-plugin/citaat-card.js +1 -0
  98. package/app/components/citaten-plugin/citaat-insert.js +1 -0
  99. package/app/components/citaten-plugin/citations/article-list.js +1 -0
  100. package/app/components/citaten-plugin/citations/article-preview.js +1 -0
  101. package/app/components/citaten-plugin/citations/decision-detail.js +1 -0
  102. package/app/components/citaten-plugin/citations/decision-list.js +1 -0
  103. package/app/components/citaten-plugin/citations/decision-preview.js +1 -0
  104. package/app/components/citaten-plugin/citations/modal.js +1 -0
  105. package/app/components/citaten-plugin/citations/search-modal.js +1 -0
  106. package/app/components/citaten-plugin/helpers/alert-load-error.js +1 -0
  107. package/app/components/citaten-plugin/helpers/alert-no-items.js +1 -0
  108. package/app/components/import-snippet-plugin/card.js +1 -0
  109. package/app/components/insert-variable-plugin/insert-variable-card.js +1 -0
  110. package/app/components/rdfa-date-plugin/rdfa-date-plugin-card.js +1 -0
  111. package/app/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +1 -0
  112. package/app/components/rdfa-date-plugin/rdfa-date-time-picker.js +1 -0
  113. package/app/components/roadsign-regulation-plugin/expanded-measure.js +1 -0
  114. package/app/components/roadsign-regulation-plugin/measure-template.js +1 -0
  115. package/app/components/roadsign-regulation-plugin/roadsign-regulation-card.js +1 -0
  116. package/app/components/roadsign-regulation-plugin/roadsigns-modal.js +1 -0
  117. package/app/components/roadsign-regulation-plugin/roadsigns-pagination.js +1 -0
  118. package/app/components/roadsign-regulation-plugin/roadsigns-table.js +1 -0
  119. package/app/components/standard-template-plugin/template-card.js +1 -0
  120. package/app/components/standard-template-plugin/template-provider.js +1 -0
  121. package/app/components/table-of-contents-plugin/card.js +1 -0
  122. package/app/components/table-of-contents-plugin/inline-components/outline.js +1 -0
  123. package/app/components/table-of-contents-plugin/inline-components/table-of-contents.js +1 -0
  124. package/app/components/template-variable-plugin/template-variable-card.js +1 -0
  125. package/app/helpers/limit-text.js +4 -0
  126. package/app/initializers/plugin-initializer.js +4 -0
  127. package/app/models/instruction.js +1 -0
  128. package/app/models/measure.js +1 -0
  129. package/app/models/sign.js +1 -0
  130. package/app/models/template.js +1 -0
  131. package/app/serializers/application.js +1 -0
  132. package/app/services/import-rdfa-snippet.js +1 -0
  133. package/app/services/rdfa-editor-roadsign-regulation-plugin.js +1 -0
  134. package/app/services/roadsign-registry.js +1 -0
  135. package/app/services/standard-template-plugin.js +1 -0
  136. package/{dist → app}/styles/citaten-plugin.scss +0 -0
  137. package/config/environment.js +0 -1
  138. package/index.js +8 -0
  139. package/package.json +112 -107
  140. package/tsconfig.json +42 -0
  141. package/types/dummy/index.d.ts +1 -0
  142. package/types/ember-data/types/registries/model.d.ts +6 -0
  143. package/types/global.d.ts +7 -0
  144. package/addon-main.js +0 -4
  145. package/dist/_app_/components/besluit-type-plugin/besluit-type-select.js +0 -1
  146. package/dist/_app_/components/besluit-type-plugin/toolbar-dropdown.js +0 -1
  147. package/dist/_app_/components/citaten-plugin/citaat-card.js +0 -1
  148. package/dist/_app_/components/citaten-plugin/citaat-insert.js +0 -1
  149. package/dist/_app_/components/citaten-plugin/citations/article-list.js +0 -1
  150. package/dist/_app_/components/citaten-plugin/citations/article-preview.js +0 -1
  151. package/dist/_app_/components/citaten-plugin/citations/decision-detail.js +0 -1
  152. package/dist/_app_/components/citaten-plugin/citations/decision-list.js +0 -1
  153. package/dist/_app_/components/citaten-plugin/citations/decision-preview.js +0 -1
  154. package/dist/_app_/components/citaten-plugin/citations/search-modal.js +0 -1
  155. package/dist/_app_/components/citaten-plugin/helpers/alert-load-error.js +0 -1
  156. package/dist/_app_/components/citaten-plugin/helpers/alert-no-items.js +0 -1
  157. package/dist/_app_/components/import-snippet-plugin/card.js +0 -1
  158. package/dist/_app_/components/insert-variable-plugin/insert-variable-card.js +0 -1
  159. package/dist/_app_/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -1
  160. package/dist/_app_/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -1
  161. package/dist/_app_/components/rdfa-date-plugin/rdfa-date-time-picker.js +0 -1
  162. package/dist/_app_/components/roadsign-regulation-plugin/expanded-measure.js +0 -1
  163. package/dist/_app_/components/roadsign-regulation-plugin/measure-template.js +0 -1
  164. package/dist/_app_/components/roadsign-regulation-plugin/roadsign-regulation-card.js +0 -1
  165. package/dist/_app_/components/roadsign-regulation-plugin/roadsigns-modal.js +0 -1
  166. package/dist/_app_/components/roadsign-regulation-plugin/roadsigns-pagination.js +0 -1
  167. package/dist/_app_/components/roadsign-regulation-plugin/roadsigns-table.js +0 -1
  168. package/dist/_app_/components/standard-template-plugin/template-card.js +0 -1
  169. package/dist/_app_/components/standard-template-plugin/template-provider.js +0 -1
  170. package/dist/_app_/components/table-of-contents-plugin/card.js +0 -1
  171. package/dist/_app_/components/table-of-contents-plugin/inline-components/outline.js +0 -1
  172. package/dist/_app_/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -1
  173. package/dist/_app_/components/template-variable-plugin/template-variable-card.js +0 -1
  174. package/dist/_app_/helpers/limit-text.js +0 -1
  175. package/dist/_app_/initializers/plugin-initializer.js +0 -1
  176. package/dist/_app_/models/instruction.js +0 -1
  177. package/dist/_app_/models/measure.js +0 -1
  178. package/dist/_app_/models/sign.js +0 -1
  179. package/dist/_app_/models/template.js +0 -1
  180. package/dist/_app_/serializers/application.js +0 -1
  181. package/dist/_app_/services/import-rdfa-snippet.js +0 -1
  182. package/dist/_app_/services/roadsign-registry.js +0 -1
  183. package/dist/_app_/services/standard-template-plugin.js +0 -1
  184. package/dist/_rollupPluginBabelHelpers-537ad14b.js +0 -48
  185. package/dist/_rollupPluginBabelHelpers-537ad14b.js.map +0 -1
  186. package/dist/components/besluit-type-plugin/besluit-type-select.js +0 -30
  187. package/dist/components/besluit-type-plugin/besluit-type-select.js.map +0 -1
  188. package/dist/components/besluit-type-plugin/toolbar-dropdown.js +0 -292
  189. package/dist/components/besluit-type-plugin/toolbar-dropdown.js.map +0 -1
  190. package/dist/components/citaten-plugin/citaat-card.js +0 -367
  191. package/dist/components/citaten-plugin/citaat-card.js.map +0 -1
  192. package/dist/components/citaten-plugin/citaat-insert.js +0 -84
  193. package/dist/components/citaten-plugin/citaat-insert.js.map +0 -1
  194. package/dist/components/citaten-plugin/citations/article-list.js +0 -10
  195. package/dist/components/citaten-plugin/citations/article-list.js.map +0 -1
  196. package/dist/components/citaten-plugin/citations/article-preview.js +0 -10
  197. package/dist/components/citaten-plugin/citations/article-preview.js.map +0 -1
  198. package/dist/components/citaten-plugin/citations/decision-detail.js +0 -123
  199. package/dist/components/citaten-plugin/citations/decision-detail.js.map +0 -1
  200. package/dist/components/citaten-plugin/citations/decision-list.js +0 -10
  201. package/dist/components/citaten-plugin/citations/decision-list.js.map +0 -1
  202. package/dist/components/citaten-plugin/citations/decision-preview.js +0 -10
  203. package/dist/components/citaten-plugin/citations/decision-preview.js.map +0 -1
  204. package/dist/components/citaten-plugin/citations/search-modal.js +0 -282
  205. package/dist/components/citaten-plugin/citations/search-modal.js.map +0 -1
  206. package/dist/components/citaten-plugin/helpers/alert-load-error.js +0 -10
  207. package/dist/components/citaten-plugin/helpers/alert-load-error.js.map +0 -1
  208. package/dist/components/citaten-plugin/helpers/alert-no-items.js +0 -10
  209. package/dist/components/citaten-plugin/helpers/alert-no-items.js.map +0 -1
  210. package/dist/components/import-snippet-plugin/card.js +0 -99
  211. package/dist/components/import-snippet-plugin/card.js.map +0 -1
  212. package/dist/components/insert-variable-plugin/insert-variable-card.js +0 -190
  213. package/dist/components/insert-variable-plugin/insert-variable-card.js.map +0 -1
  214. package/dist/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -85
  215. package/dist/components/rdfa-date-plugin/rdfa-date-plugin-card.js.map +0 -1
  216. package/dist/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -23
  217. package/dist/components/rdfa-date-plugin/rdfa-date-plugin-insert.js.map +0 -1
  218. package/dist/components/rdfa-date-plugin/rdfa-date-time-picker.js +0 -91
  219. package/dist/components/rdfa-date-plugin/rdfa-date-time-picker.js.map +0 -1
  220. package/dist/components/roadsign-regulation-plugin/expanded-measure.js +0 -52
  221. package/dist/components/roadsign-regulation-plugin/expanded-measure.js.map +0 -1
  222. package/dist/components/roadsign-regulation-plugin/measure-template.js +0 -42
  223. package/dist/components/roadsign-regulation-plugin/measure-template.js.map +0 -1
  224. package/dist/components/roadsign-regulation-plugin/roadsign-regulation-card.js +0 -82
  225. package/dist/components/roadsign-regulation-plugin/roadsign-regulation-card.js.map +0 -1
  226. package/dist/components/roadsign-regulation-plugin/roadsigns-modal.js +0 -251
  227. package/dist/components/roadsign-regulation-plugin/roadsigns-modal.js.map +0 -1
  228. package/dist/components/roadsign-regulation-plugin/roadsigns-pagination.js +0 -71
  229. package/dist/components/roadsign-regulation-plugin/roadsigns-pagination.js.map +0 -1
  230. package/dist/components/roadsign-regulation-plugin/roadsigns-table.js +0 -36
  231. package/dist/components/roadsign-regulation-plugin/roadsigns-table.js.map +0 -1
  232. package/dist/components/standard-template-plugin/template-card.js +0 -15
  233. package/dist/components/standard-template-plugin/template-card.js.map +0 -1
  234. package/dist/components/standard-template-plugin/template-provider.js +0 -109
  235. package/dist/components/standard-template-plugin/template-provider.js.map +0 -1
  236. package/dist/components/table-of-contents-plugin/card.js +0 -52
  237. package/dist/components/table-of-contents-plugin/card.js.map +0 -1
  238. package/dist/components/table-of-contents-plugin/inline-components/outline.js +0 -10
  239. package/dist/components/table-of-contents-plugin/inline-components/outline.js.map +0 -1
  240. package/dist/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -92
  241. package/dist/components/table-of-contents-plugin/inline-components/table-of-contents.js.map +0 -1
  242. package/dist/components/template-variable-plugin/template-variable-card.js +0 -178
  243. package/dist/components/template-variable-plugin/template-variable-card.js.map +0 -1
  244. package/dist/constants-c77fd478.js +0 -16
  245. package/dist/constants-c77fd478.js.map +0 -1
  246. package/dist/fetch-data-284bf106.js.map +0 -1
  247. package/dist/helpers/limit-text.js.map +0 -1
  248. package/dist/includeInstructions-a32c24e6.js +0 -10
  249. package/dist/includeInstructions-a32c24e6.js.map +0 -1
  250. package/dist/index.js +0 -2
  251. package/dist/index.js.map +0 -1
  252. package/dist/initializers/plugin-initializer.js +0 -401
  253. package/dist/initializers/plugin-initializer.js.map +0 -1
  254. package/dist/legislation-types-4d487cb9.js +0 -26
  255. package/dist/legislation-types-4d487cb9.js.map +0 -1
  256. package/dist/models/instruction.js +0 -18
  257. package/dist/models/instruction.js.map +0 -1
  258. package/dist/models/measure.js +0 -41
  259. package/dist/models/measure.js.map +0 -1
  260. package/dist/models/sign.js.map +0 -1
  261. package/dist/models/template.js +0 -48
  262. package/dist/models/template.js.map +0 -1
  263. package/dist/serializers/application.js +0 -10
  264. package/dist/serializers/application.js.map +0 -1
  265. package/dist/services/import-rdfa-snippet.js.map +0 -1
  266. package/dist/services/roadsign-registry.js.map +0 -1
  267. package/dist/services/standard-template-plugin.js +0 -53
  268. package/dist/services/standard-template-plugin.js.map +0 -1
  269. package/dist/styles/test.css +0 -0
  270. package/dist/vlaamse-codex-187fe526.js.map +0 -1
@@ -0,0 +1,14 @@
1
+ {
2
+ "github": {
3
+ "release": true
4
+ },
5
+ "plugins": {
6
+ "@release-it-plugins/lerna-changelog": {
7
+ "infile": "CHANGELOG.md",
8
+ "launchEditor": true
9
+ }
10
+ },
11
+ "npm": {
12
+ "publish": false
13
+ }
14
+ }
@@ -0,0 +1,15 @@
1
+ pipeline:
2
+ install:
3
+ image: danlynn/ember-cli:4.4.0
4
+ commands:
5
+ - npm ci
6
+ release:
7
+ image: plugins/npm
8
+ settings:
9
+ token:
10
+ from_secret: npm_access_token
11
+ # Pipeline level conditions aren't supported yet:
12
+ # https://github.com/woodpecker-ci/woodpecker/issues/283
13
+ when:
14
+ event: tag
15
+ tag: v*
@@ -0,0 +1,23 @@
1
+
2
+ pipeline:
3
+ install:
4
+ image: danlynn/ember-cli:4.4.0
5
+ commands:
6
+ - npm ci
7
+ lint-js:
8
+ image: danlynn/ember-cli:4.4.0
9
+ group: lint
10
+ commands:
11
+ - npm run lint:js
12
+ lint-hbs:
13
+ image: danlynn/ember-cli:4.4.0
14
+ group: lint
15
+ commands:
16
+ - npm run lint:hbs
17
+ test:
18
+ image: danlynn/ember-cli:4.4.0
19
+ commands:
20
+ - npm run test:ember || exit 0
21
+ when:
22
+ event:
23
+ - pull_request
package/CHANGELOG.md ADDED
@@ -0,0 +1,84 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+ ## 0.4.0 (2022-12-01)
10
+
11
+ #### :house: Internal
12
+ * [#23](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/23) Add typescript support ([@elpoelma](https://github.com/elpoelma))
13
+ * [#22](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/22) Move to classic ember addon ([@elpoelma](https://github.com/elpoelma))
14
+
15
+ #### Committers: 1
16
+ - Elena Poelman ([@elpoelma](https://github.com/elpoelma))
17
+
18
+ ## v0.3.1 (2022-11-24)
19
+
20
+ #### :memo: Documentation
21
+ * [#15](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/15) Add documentation to readme ([@elpoelma](https://github.com/elpoelma))
22
+
23
+ #### Committers: 1
24
+ - Elena Poelman ([@elpoelma](https://github.com/elpoelma))
25
+
26
+ ## v0.3.0 (2022-11-23)
27
+
28
+ #### :rocket: Enhancement
29
+ * [#7](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/7) Add roadsign regulation plugin ([@elpoelma](https://github.com/elpoelma))
30
+
31
+ #### Committers: 1
32
+ - Elena Poelman ([@elpoelma](https://github.com/elpoelma))
33
+
34
+ ## v0.2.0 (2022-11-23)
35
+
36
+ #### :rocket: Enhancement
37
+ * [#14](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/14) Add insert and template variable plugins ([@elpoelma](https://github.com/elpoelma))
38
+
39
+ #### Committers: 1
40
+ - Elena Poelman ([@elpoelma](https://github.com/elpoelma))
41
+
42
+ ## v0.1.3 (2022-11-23)
43
+
44
+ #### :bug: Bug Fix
45
+ * [#13](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/13) Fix path of table-of-contents outline component ([@elpoelma](https://github.com/elpoelma))
46
+
47
+ #### Committers: 1
48
+ - Elena Poelman ([@elpoelma](https://github.com/elpoelma))
49
+
50
+ ## v0.1.2 (2022-11-23)
51
+
52
+ #### :house: Internal
53
+ * [#12](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/12) Export config and translations ([@elpoelma](https://github.com/elpoelma))
54
+
55
+ #### Committers: 1
56
+ - Elena Poelman ([@elpoelma](https://github.com/elpoelma))
57
+
58
+ ## v0.1.1 (2022-11-23)
59
+
60
+ #### :house: Internal
61
+ * [#11](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/11) Loosen ember-data peerdep requirement to 3.27.0 ([@elpoelma](https://github.com/elpoelma))
62
+
63
+ #### Committers: 1
64
+ - Elena Poelman ([@elpoelma](https://github.com/elpoelma))
65
+
66
+ ## v0.1.0 (2022-11-23)
67
+
68
+ #### :rocket: Enhancement
69
+ * [#9](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/9) Add import-snippet plugin ([@elpoelma](https://github.com/elpoelma))
70
+ * [#8](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/8) Add rdfa-date plugin ([@elpoelma](https://github.com/elpoelma))
71
+ * [#3](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/3) Add standard-template plugin ([@elpoelma](https://github.com/elpoelma))
72
+ * [#4](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/4) Add besluit-type plugin ([@elpoelma](https://github.com/elpoelma))
73
+ * [#6](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/6) Add generate template plugin ([@elpoelma](https://github.com/elpoelma))
74
+ * [#5](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/5) Add table-of-contents plugin ([@elpoelma](https://github.com/elpoelma))
75
+ * [#2](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/2) Add citaten-plugin ([@elpoelma](https://github.com/elpoelma))
76
+
77
+ #### :house: Internal
78
+ * [#10](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/10) Set up woodpecker ([@elpoelma](https://github.com/elpoelma))
79
+ * [#1](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/1) Setup basic test-app ([@elpoelma](https://github.com/elpoelma))
80
+
81
+ #### Committers: 1
82
+ - Elena Poelman ([@elpoelma](https://github.com/elpoelma))
83
+
84
+ # Changelog
package/README.md CHANGED
@@ -1,37 +1,334 @@
1
- ember-rdfa-editor-lblod-plugins
2
- ==============================================================================
1
+ # ember-rdfa-editor-lblod-plugins
3
2
 
4
- [Short description of the addon.]
5
3
 
4
+ Ember v2 addon which bundles a collection of [ember-rdfa-editor](https://github.com/lblod/ember-rdfa-editor) plugins related to the LBLOD Project.
5
+
6
+
7
+ ## Compatibility
6
8
 
7
- Compatibility
8
- ------------------------------------------------------------------------------
9
9
 
10
10
  * Ember.js v3.28 or above
11
11
  * Embroider or ember-auto-import v2
12
12
 
13
13
 
14
- Installation
15
- ------------------------------------------------------------------------------
14
+ ## Installation
15
+
16
16
 
17
17
  ```
18
18
  ember install ember-rdfa-editor-lblod-plugins
19
19
  ```
20
20
 
21
21
 
22
- Usage
23
- ------------------------------------------------------------------------------
22
+ ## General addon information
23
+
24
+
25
+ This addon contains the following editor plugins:
26
+ * besluit-type-plugin
27
+ * citaten-plugin
28
+ * generate-template-plugin
29
+ * import-snippet-plugin
30
+ * insert-variable-plugin
31
+ * rdfa-date-plugin
32
+ * roadsign-regulation-plugin
33
+ * standard-template-plugin
34
+ * table-of-contents-plugin
35
+ * template-variable-plugin
36
+
37
+ An array of plugin configurations can be passed to an instance of the ember-rdfa-editor in order to enable them.
38
+ This is typically done in the following manner:
39
+ ```hbs
40
+ <Rdfa::RdfaEditor
41
+ class="au-c-rdfa-editor"
42
+ @profile={{@profile}}
43
+ @rdfaEditorInit={{this.rdfaEditorInit}}
44
+ @editorOptions={{this.editorOptions}}
45
+ @toolbarOptions={{this.toolbarOptions}}
46
+ @plugins={{this.plugins}}
47
+ />
48
+ ```
49
+ Where `this.plugins` is an array of plugin configurations found in the backing class of the template shown above.
50
+
51
+ ## besluit-type-plugin
52
+
53
+ Plugin which allows a user to change the type of a [besluit](https://data.vlaanderen.be/ns/besluit#Besluit).
54
+
55
+ This plugin can be configured in the following manner:
56
+
57
+ ```js
58
+ this.plugins = ["besluit"];
59
+ ```
60
+ ## citaten-plugin
61
+ Plugin which allows a user to insert references to a legal resource or legal expression into the document.
62
+
63
+ This plugin can be configured in the following manner:
64
+
65
+ ```js
66
+ this.plugins = ["citaten"];
67
+ ```
68
+
69
+ ### Using the plugin
70
+ This plugin can be triggered by typing one of the following in the correct RDFa context (the [besluit:motivering](http://data.vlaanderen.be/ns/besluit#motivering) of a [besluit:Besluit](https://data.vlaanderen.be/ns/besluit#Besluit)).
71
+
72
+ * [specification]**decreet** [words to search for] *(e.g. "gemeentedecreet wijziging")*
73
+ * **omzendbrief** [words to search for]
74
+ * **verdrag** [words to search for]
75
+ * **grondwetswijziging** [words to search for]
76
+ * **samenwerkingsakkoord** [words to search for]
77
+ * [specification]**wetboek** [words to search for]
78
+ * **protocol** [words to search for]
79
+ * **besluit van de vlaamse regering** [words to search for]
80
+ * **gecoordineerde wetten** [words to search for]
81
+ * [specification]**wet** [words to search for] *(e.g. "kieswet wijziging", or "grondwet")*
82
+ * **koninklijk besluit** [words to search for]
83
+ * **ministerieel besluit** [words to search for]
84
+ * **genummerd besluit** [words to search for]
85
+
86
+ You should be able to add a reference manually by clicking on the `Insert` > `Insert reference` item in the Insert menu located on the top right of the editor. This will open the advanced search window. **Note** that this will only be avaliable in the proper context (see above in this section).
87
+
88
+ ## generate-template-plugin
89
+ Plugin which provides an editor command which replaces resource URIs in a document by a generic template URI containing `${generateUuid()}`. This allows for the generation of template documents. Template documents can be used by other applications, these other applications can create an instance of a template by replacing the `${generateUuid()}` keywords by real URIs.
90
+
91
+ This plugin can be configured in the following manner:
92
+
93
+ ```js
94
+ this.plugins = ["generate-template"];
95
+ ```
96
+
97
+ The command can be used by executing:
98
+
99
+ ```js
100
+ controller.executeCommand('generateTemplate', controller);
101
+ ```
102
+
103
+ Where `controller` is an editor-controller.
104
+
105
+ ## import-snippet-plugin
106
+ Plugin allowing importing of external RDFA snippets and inserting it in the document.
107
+
108
+ This plugin can be configured in the following manner:
109
+
110
+ ```js
111
+ this.plugins = ["import-snippet"];
112
+ ```
113
+
114
+ ### Using the plugin
115
+
116
+ This plugin provides an Ember service, `import-rdfa-snippet` which allows you to download rdfa snippets in the following manner:
117
+
118
+ ```js
119
+ import { inject as service } from '@ember/service';
120
+
121
+
122
+ // An entry point to download the resouce (e.g a route) in your host app.
123
+ // (...)
124
+
125
+ let downloadData = { source: 'http://remote/resource.html' }
126
+ await this.importRdfaSnippet.downloadSnippet(downloadData);
127
+ ```
128
+
129
+ After having downloaded a snippet, a user can use the plugin in the Gelinkt Notuleren application (https://github.com/lblod/frontend-gelinkt-notuleren).
130
+
131
+ When opening a new document, users will get the option to either include the snippet data in the document or as an attachment.
132
+
133
+ ## insert-variable-plugin
134
+ Plugin which allows users to insert variable placeholders into a document.
135
+
136
+ ### Configuring the plugin
137
+
138
+ The plugin can be configured through the following optional attributes:
139
+ - `publisher`: the URI of a specific codelist publisher which you can use if you want to filter the codelists by its publisher.
140
+ - `defaultEndpoint`: The default endpoint where the codelists are fetched, this is also the variable that gets passed to the fetchSubtypes and template function
141
+ - `variableTypes`: a custom list of variable types you want the plugin to use. This list can contain the following default variable types: `text`, `number`,`date`,`location` and `codelist`. Additionally this list can also contain custom variable types, configured by the following three sub-attributes:
142
+ * `label`: the label of the custom variable type
143
+ * `fetchSubTypes` (optional): a function which returns a list of possible variable values. The function takes two optional arguments: an `endpoint` and a `publisher`.
144
+ * `template`: function which returns an html template which should be resolved and inserted when inserting a variable of the custom variable type. The function takes two arguments: an `endpoint` and a `selectedVariableValue`.
145
+
146
+ #### Example
147
+
148
+ ```js
149
+ {
150
+ name:'insert-variable',
151
+ options: {
152
+ publisher: 'http://data.lblod.info/id/bestuurseenheden/141d9d6b-54af-4d17-b313-8d1c30bc3f5b',
153
+ defaultEndpoint: 'https://dev.roadsigns.lblod.info/sparql',
154
+ variableTypes: [
155
+ 'text',
156
+ 'number',
157
+ 'date',
158
+ 'location',
159
+ 'codelist',
160
+ {
161
+ label: 'Simple Variable',
162
+ template: `
163
+ <span property="ext:content" datatype="ext:myNewType">
164
+ <span class="mark-highlight-manual">\${Simple variable}</span>
165
+ </span>
166
+ `,
167
+ },
168
+ {
169
+ label: 'Complex Variable',
170
+ fetchSubtypes: async (endpoint, publisher) => {
171
+ const codelists = [
172
+ {
173
+ uri: '1',
174
+ label: '1',
175
+ },
176
+ {
177
+ uri: '2',
178
+ label: '2',
179
+ },
180
+ {
181
+ uri: '3',
182
+ label: '3',
183
+ },
184
+ ];
185
+ return codelists;
186
+ },
187
+ template: (endpoint, selectedCodelist) => `
188
+ <span property="ext:codelist" resource="${selectedCodelist.uri}"></span>
189
+ <span property="dct:type" content="location"></span>
190
+ <span property="dct:source" resource="${endpoint}"></span>
191
+ <span property="ext:content" datatype="xsd:date">
192
+ <span class="mark-highlight-manual">\${${selectedCodelist.label}}</span>
193
+ </span>
194
+ `,
195
+ },
196
+ ],
197
+ }
198
+ }
199
+ ```
200
+ ### Using the plugin
201
+
202
+ When the insert-variable-plugin is enabled, users will have the option to insert a variable into a document through a card which pops up in the sidebar of the editor.
203
+
204
+
205
+ ## rdfa-date-plugin
206
+ Plugin to insert and modify semantic dates and timestamps in an editor document.
207
+
208
+ This plugin can be configured in the following manner:
209
+
210
+ ```js
211
+ this.plugins = ["rdfa-date"];
212
+ ```
213
+
214
+
215
+
216
+ ## roadsign-regulation-plugin
217
+ A plugin that fetches data from the mow regulation and roadsign registry and allows users to insert roadsign regulations inside an editor document.
218
+
219
+ This plugin can be configured in the following manner:
220
+
221
+ ```js
222
+ this.plugins = ["roadsign-regulation"];
223
+ ```
224
+
225
+ The default endpoint the plugin will query is https://roadsigns.lblod.info/sparql . This can be overwritten by setting `roadsignRegulationPlugin.endpoint` in your `config/environment.js`.
226
+
227
+ ## standard-template-plugin
228
+ Plugin which allows users to insert standard templates in the editor. Depending on the position of the cursor or selected text, a dropdown will appear in the toolbar of the editor that lets you insert a template for the proper context at the location of the cursor.
229
+
230
+ This plugin can be configured in the following manner:
231
+
232
+ ```js
233
+ this.plugins = ["standard-template"];
234
+ ```
235
+
236
+ ### Template resource used by the plugin
237
+
238
+ When creating a template in your database, the following properties are used by the plugin:
239
+
240
+ * the title of the template (`title`)
241
+ * its HTML content (`content`)
242
+ * the words of the document the template should match on (`matches`)
243
+ * the contexts in which it should be active (`contexts`)
244
+ * the contexts in which it should not be active (`disabled-in-contexts`)
245
+
246
+ ### Using the plugin
247
+
248
+
249
+ The plugin will search for RDFa contexts in the content of the editor and the editor itself. Based on the contexts, the plugin will show possible templates to be added at the location of the cursor. E.g. if an element in the editor has the `typeof="besluit:BehandelingVanAgendapunt"` attribute, the plugin will show the templates related to [`besluit:BehandelingVanAgendapunt`](http://data.vlaanderen.be/ns/besluit#BehandelingVanAgendapunt) in the dropdown menu. This attribute can be set on an element in the content of the editor or predefined in the editor itself.
250
+
251
+ ## table-of-contents-plugin
24
252
 
25
- [Longer description of how to use the addon in apps.]
253
+ Plugin implementing an auto-refreshing table of contents using an ember-rdfa-editor inline component.
26
254
 
255
+ In order to enable the plugin you need to add `table-of-contents` to the list of plugins passed to the rdfa-editor. You can configure the plugin with a custom table of contents configuration.
256
+ ### Configuring the plugin with a custom config
257
+
258
+ ```js
259
+ this.plugins = [
260
+ { name: 'table-of-contents',
261
+ options: {
262
+ config: {
263
+ sectionPredicate: 'https://say.data.gift/ns/hasPart',
264
+ value: {
265
+ predicate: 'https://say.data.gift/ns/heading',
266
+ },
267
+ },
268
+ {
269
+ sectionPredicate: 'https://say.data.gift/ns/hasParagraph',
270
+ value: '§',
271
+ },
272
+ }
273
+ },
274
+ ]
275
+ ```
276
+
277
+ You can insert an instance of a table of contents using the `insert-component` command:
278
+
279
+ ```js
280
+ controller.executeCommand(
281
+ 'insert-component',
282
+ 'table-of-contents-plugin/inline-components/table-of-contents',
283
+ {
284
+ config: [
285
+ {
286
+ sectionPredicate: 'https://say.data.gift/ns/hasPart',
287
+ value: {
288
+ predicate: 'https://say.data.gift/ns/heading',
289
+ },
290
+ },
291
+ {
292
+ sectionPredicate: 'https://say.data.gift/ns/hasParagraph',
293
+ value: '§',
294
+ },
295
+ ],
296
+ },
297
+ {},
298
+ false
299
+ );
300
+ ```
301
+ ## template-variable-plugin
302
+
303
+ Editor plugin which allows you to interact with placeholders created by the insert-variable-plugin.
304
+
305
+ ### Configuring the plugin
306
+
307
+ You can enable the plugin by adding it to the list of plugins:
308
+
309
+ ```js
310
+ this.plugins = ['template-variable'];
311
+ ```
312
+
313
+ Additionally, you can configure the plugin in your `environment.js` file:
314
+
315
+ ```js
316
+ templateVariablePlugin: {
317
+ endpoint: 'https://dev.roadsigns.lblod.info/sparql', // the fallback endpoint which should be used for codelists which do not have a `dct:source` property.
318
+ zonalLocationCodelistUri:
319
+ 'http://lblod.data.gift/concept-schemes/62331E6900730AE7B99DF7EF',
320
+ nonZonalLocationCodelistUri:
321
+ 'http://lblod.data.gift/concept-schemes/62331FDD00730AE7B99DF7F2',
322
+ },
323
+ ```
324
+
325
+ ## Contributing
27
326
 
28
- Contributing
29
- ------------------------------------------------------------------------------
30
327
 
31
328
  See the [Contributing](CONTRIBUTING.md) guide for details.
32
329
 
33
330
 
34
- License
35
- ------------------------------------------------------------------------------
331
+ ## License
332
+
36
333
 
37
334
  This project is licensed under the [MIT License](LICENSE.md).
package/RELEASE.md ADDED
@@ -0,0 +1,60 @@
1
+ # Release Process
2
+
3
+ Releases are mostly automated using
4
+ [release-it](https://github.com/release-it/release-it/) and
5
+ [lerna-changelog](https://github.com/lerna/lerna-changelog/).
6
+
7
+ ## Preparation
8
+
9
+ Since the majority of the actual release process is automated, the primary
10
+ remaining task prior to releasing is confirming that all pull requests that
11
+ have been merged since the last release have been labeled with the appropriate
12
+ `lerna-changelog` labels and the titles have been updated to ensure they
13
+ represent something that would make sense to our users. Some great information
14
+ on why this is important can be found at
15
+ [keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
16
+ guiding principle here is that changelogs are for humans, not machines.
17
+
18
+ When reviewing merged PR's the labels to be used are:
19
+
20
+ * breaking - Used when the PR is considered a breaking change.
21
+ * enhancement - Used when the PR adds a new feature or enhancement.
22
+ * bug - Used when the PR fixes a bug included in a previous release.
23
+ * documentation - Used when the PR adds or updates documentation.
24
+ * internal - Used for internal changes that still require a mention in the
25
+ changelog/release notes.
26
+
27
+ ## Release
28
+
29
+ Once the prep work is completed, the actual release is straight forward:
30
+
31
+ * First, ensure that you have installed your projects dependencies:
32
+
33
+ ```sh
34
+ npm install
35
+ ```
36
+
37
+ * Second, ensure that you have obtained a
38
+ [GitHub personal access token][generate-token] with the `repo` scope (no
39
+ other permissions are needed). Make sure the token is available as the
40
+ `GITHUB_AUTH` environment variable.
41
+
42
+ For instance:
43
+
44
+ ```bash
45
+ export GITHUB_AUTH=abc123def456
46
+ ```
47
+
48
+ [generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable
49
+
50
+ * And last (but not least 😁) do your release.
51
+
52
+ ```sh
53
+ npx release-it
54
+ ```
55
+
56
+ [release-it](https://github.com/release-it/release-it/) manages the actual
57
+ release process. It will prompt you to to choose the version number after which
58
+ you will have the chance to hand tweak the changelog to be used (for the
59
+ `CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
60
+ pushing the tag and commits, etc.
@@ -0,0 +1,35 @@
1
+ import defaultResources from '../utils/generate-template-plugin/default-resources';
2
+
3
+ export default class GenerateTemplateCommand {
4
+ name = 'generateTemplate';
5
+
6
+ constructor(model) {
7
+ this.model = model;
8
+ }
9
+
10
+ canExecute() {
11
+ return true;
12
+ }
13
+
14
+ execute(controller) {
15
+ let uris = [];
16
+ for (let resource of defaultResources) {
17
+ const quads = [
18
+ ...controller.datastore.match(null, 'a', `>${resource}`).asQuads(),
19
+ ];
20
+ const resourceUris = quads.map((quad) => quad.subject.value);
21
+ uris = [...uris, ...resourceUris];
22
+ }
23
+ let documentHTML = controller.htmlContent;
24
+ for (let uri of uris) {
25
+ const uriParts = uri.split('/');
26
+ uriParts.pop();
27
+ const uriWithoutUuid = uriParts.join('/');
28
+ documentHTML = documentHTML.replace(
29
+ uri,
30
+ `${uriWithoutUuid}/\${generateUuid()}`
31
+ );
32
+ }
33
+ return documentHTML;
34
+ }
35
+ }
@@ -0,0 +1,32 @@
1
+ export default class InsertAndCollapseCommand {
2
+ name = 'insert-and-collapse';
3
+
4
+ constructor(model) {
5
+ this.model = model;
6
+ }
7
+
8
+ canExecute() {
9
+ return true;
10
+ }
11
+
12
+ execute(controller, htmlString, node) {
13
+ const range = controller.rangeFactory.fromInNode(
14
+ node,
15
+ 0,
16
+ node.getMaxOffset()
17
+ );
18
+ controller.executeCommand('insert-html', htmlString, range);
19
+
20
+ controller.selection.selectRange(
21
+ controller.selection.lastRange.shrinkToVisible()
22
+ );
23
+ const containedNodes =
24
+ controller.selection.lastRange.contextNodes('rangeContains');
25
+ containedNodes.next();
26
+ const span = containedNodes.next().value;
27
+ const finalRange = controller.rangeFactory.fromInNode(span);
28
+ controller.selection.selectRange(finalRange);
29
+
30
+ this.model.writeSelection();
31
+ }
32
+ }
@@ -0,0 +1,42 @@
1
+ export default class ModifyDateCommand {
2
+ name = 'modify-date';
3
+
4
+ constructor(model) {
5
+ this.model = model;
6
+ }
7
+
8
+ canExecute() {
9
+ return true;
10
+ }
11
+
12
+ execute(controller, element, dateValue, onlyDate) {
13
+ this.model.change((mutator) => {
14
+ const range = controller.rangeFactory.fromInElement(
15
+ element,
16
+ 0,
17
+ element.getMaxOffset()
18
+ );
19
+ mutator.insertText(
20
+ range,
21
+ this.formatDate(dateValue, onlyDate),
22
+ range.getMarks()
23
+ );
24
+ element.attributeMap.set('content', dateValue.toISOString());
25
+ });
26
+ }
27
+
28
+ formatDate(date, onlyDate) {
29
+ let options = {
30
+ year: 'numeric',
31
+ month: '2-digit',
32
+ day: '2-digit',
33
+ hour: '2-digit',
34
+ minute: '2-digit',
35
+ };
36
+ if (onlyDate) {
37
+ options.hour = undefined;
38
+ options.minute = undefined;
39
+ }
40
+ return date.toLocaleString('nl-BE', options);
41
+ }
42
+ }
@@ -0,0 +1,28 @@
1
+ <div ...attributes>
2
+ <PowerSelect
3
+ @renderInPlace={{true}}
4
+ @searchEnabled={{true}}
5
+ @searchMessage={{t "besluit-type-plugin.search-message"}}
6
+ @noMatchesMessage={{t "besluit-type-plugin.no-matches-message"}}
7
+ @search={{this.search}}
8
+ @options={{this.besluitTypes}}
9
+ @selected={{@selected}}
10
+ @onChange={{@onchange}} as |besluitType|>
11
+ {{besluitType.label}}
12
+ </PowerSelect>
13
+ <p class='au-u-muted au-u-margin-tiny au-u-margin-bottom-small'>
14
+ {{@selected.definition}}
15
+ </p>
16
+ {{#if @showWarningWhenEmpty}}
17
+ {{#unless @selected}}
18
+ <AuAlert
19
+ @icon="alert-triangle"
20
+ @title={{t "besluit-type-plugin.alert-title"}}
21
+ @skin="warning"
22
+ @size="small"
23
+ class="au-u-margin-bottom-none au-u-margin-top-small">
24
+ <p>{{t "besluit-type-plugin.alert-body"}}</p>
25
+ </AuAlert>
26
+ {{/unless}}
27
+ {{/if}}
28
+ </div>