@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 +12 -0
- package/README.md +30 -0
- package/addon/components/confidentiality-plugin/redact.hbs +6 -0
- package/addon/components/confidentiality-plugin/toolbar.hbs +1 -0
- package/addon/plugins/confidentiality-plugin/index.ts +1 -0
- package/addon/plugins/confidentiality-plugin/marks/redacted.ts +24 -0
- package/app/components/confidentiality-plugin/redact.js +1 -0
- package/app/components/confidentiality-plugin/toolbar.js +1 -0
- package/app/styles/confidentiality-plugin.scss +8 -0
- package/package.json +4 -4
- package/plugins/confidentiality-plugin/index.d.ts +1 -0
- package/plugins/confidentiality-plugin/marks/redacted.d.ts +2 -0
- package/translations/en-US.yaml +3 -0
- package/translations/nl-BE.yaml +3 -0
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 @@
|
|
|
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';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lblod/ember-rdfa-editor-lblod-plugins",
|
|
3
|
-
"version": "15.1
|
|
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": "^
|
|
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": "^
|
|
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';
|
package/translations/en-US.yaml
CHANGED