@lblod/ember-rdfa-editor-lblod-plugins 15.1.0 → 15.2.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @lblod/ember-rdfa-editor-lblod-plugins
2
2
 
3
+ ## 15.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`763d762`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/763d76255bcee0fe9cf7be9472c2120793cad277) Thanks [@dkozickis](https://github.com/dkozickis)! - Bump editor version
8
+
9
+ ## 15.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#362](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/362) [`47f2337`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/47f233767cd5f6169e2d4b8a3c71619d0718c035) Thanks [@piemonkey](https://github.com/piemonkey)! - Add incredibly small plugin for highlighting text as redacted
14
+
3
15
  ## 15.1.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -810,6 +810,36 @@ Template comments have a specific style that can be imported in the stylesheet w
810
810
  @import 'template-comments-plugin';
811
811
  ```
812
812
 
813
+ ## confidentiality-plugin
814
+
815
+ A very small plugin which allows for marking parts of text as redacted and including the styles to make this visible.
816
+
817
+ To enable the plugin you need to add the `MarkSpec` to the `Schema`:
818
+
819
+ ``` js
820
+ import { redacted } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/confidentiality-plugin/marks/redacted';
821
+ // ...
822
+ new Schema({
823
+ // ...
824
+ marks: {
825
+ // ...
826
+ redacted,
827
+ },
828
+ });
829
+ ```
830
+
831
+ You can then add the button to the toolbar, passing it the `SayController`:
832
+
833
+ ``` hbs
834
+ <ConfidentialityPlugin::Toolbar @controller={{this.controller}} />
835
+ ```
836
+
837
+ To see the redactions you'll need to add styles that target the `[property='ext:redacted']` selector, which can be done easily in Sass by importing the included stylesheet:
838
+
839
+ ``` scss
840
+ @import 'confidentiality-plugin';
841
+ ```
842
+
813
843
  ## Embroider
814
844
  To use `@lblod/ember-rdfa-editor-lblod-plugins` with Embroider some extra Webpack configuration is needed, which you can import like this:
815
845
 
@@ -0,0 +1,6 @@
1
+ <Toolbar::Mark
2
+ @icon="not-visible"
3
+ @title={{t 'confidentiality-plugin.redact'}}
4
+ @mark="redacted"
5
+ @controller={{@controller}}
6
+ />
@@ -0,0 +1 @@
1
+ <ConfidentialityPlugin::Redact @controller={{@controller}}/>
@@ -0,0 +1 @@
1
+ export { redacted } from './marks/redacted';
@@ -0,0 +1,24 @@
1
+ import { MarkSpec } from 'prosemirror-model';
2
+ import { EXT } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
3
+ import { hasRDFaAttribute } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
4
+
5
+ export const redacted: MarkSpec = {
6
+ toDOM(_node) {
7
+ return ['span', { property: EXT('redacted').prefixed }, 0];
8
+ },
9
+ parseDOM: [
10
+ {
11
+ tag: 'span',
12
+ getAttrs(value) {
13
+ if (typeof value === 'string') {
14
+ return false;
15
+ }
16
+ return (
17
+ hasRDFaAttribute(value, 'property', EXT('redacted')) && {
18
+ property: value.getAttribute('property'),
19
+ }
20
+ );
21
+ },
22
+ },
23
+ ],
24
+ };
@@ -0,0 +1 @@
1
+ export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/confidentiality-plugin/redact';
@@ -0,0 +1 @@
1
+ export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/confidentiality-plugin/toolbar';
@@ -0,0 +1,8 @@
1
+ @import 'ember-appuniversum';
2
+
3
+ .rdfa-annotations {
4
+ [property='ext:redacted'] {
5
+ background-color: var(--au-red-400);
6
+ border: 1px solid var(--au-red-600);
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lblod/ember-rdfa-editor-lblod-plugins",
3
- "version": "15.1.0",
3
+ "version": "15.2.1",
4
4
  "description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -71,7 +71,7 @@
71
71
  "@glimmer/component": "^1.1.2",
72
72
  "@glimmer/tracking": "^1.1.2",
73
73
  "@glint/template": "^1.1.0",
74
- "@lblod/ember-rdfa-editor": "^7.0.1",
74
+ "@lblod/ember-rdfa-editor": "^8.0.1",
75
75
  "@rdfjs/types": "^1.1.0",
76
76
  "@release-it/keep-a-changelog": "^3.1.0",
77
77
  "@tsconfig/ember": "^3.0.0",
@@ -129,7 +129,7 @@
129
129
  "eslint-plugin-ember": "^11.1.0",
130
130
  "eslint-plugin-node": "^11.1.0",
131
131
  "eslint-plugin-prettier": "^5.0.0",
132
- "eslint-plugin-qunit": "^7.3.1",
132
+ "eslint-plugin-qunit": "^8.0.1",
133
133
  "loader.js": "^4.7.0",
134
134
  "npm-run-all": "^4.1.5",
135
135
  "prettier": "^3.0.0",
@@ -145,7 +145,7 @@
145
145
  "@appuniversum/ember-appuniversum": "^2.4.2",
146
146
  "@ember/string": "3.x",
147
147
  "@glint/template": "^1.1.0",
148
- "@lblod/ember-rdfa-editor": "^6.0.0 || ^7.0.1",
148
+ "@lblod/ember-rdfa-editor": "^6.0.0 || ^7.0.1 || ^8.0.1",
149
149
  "ember-concurrency": "2.x || ^3.1.0",
150
150
  "ember-modifier": "^3.2.7",
151
151
  "ember-power-select": "6.x || 7.x",
@@ -0,0 +1 @@
1
+ export { redacted } from './marks/redacted';
@@ -0,0 +1,2 @@
1
+ import { MarkSpec } from 'prosemirror-model';
2
+ export declare const redacted: MarkSpec;
@@ -377,3 +377,6 @@ editor-plugins:
377
377
  contact: In case of persisting issues, contact <a href="mailto:{email}">{email}</a>.
378
378
  nodeview:
379
379
  placeholder: Insert address
380
+
381
+ confidentiality-plugin:
382
+ redact: Redact
@@ -381,3 +381,6 @@ editor-plugins:
381
381
  contact: Bij blijvende problemen, contacteer <a href="mailto:{email}">{email}</a>.
382
382
  nodeview:
383
383
  placeholder: Voeg adres in
384
+
385
+ confidentiality-plugin:
386
+ redact: Redigeren