@lblod/ember-rdfa-editor-lblod-plugins 15.0.0 → 15.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @lblod/ember-rdfa-editor-lblod-plugins
2
2
 
3
+ ## 15.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#343](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/343) [`e9b428c`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/e9b428cdffca32164ce9f2c03540dd5ad6a9ba19) Thanks [@dkozickis](https://github.com/dkozickis)! - GN-4130: Move styles for `data-editor-highlight`
8
+
9
+ Styles that were applied to elements with the `data-editor-highlight` attribute (used by `citation-plugin`) moved from
10
+ [editor repository](https://github.com/lblod/ember-rdfa-editor/pull/1013) to this repo as part of the `citation-plugin`.
11
+
12
+ - [#351](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/351) [`f6fa933`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/f6fa933569a70c3cc0f7d4348c4c8a121b77cd1f) Thanks [@elpoelma](https://github.com/elpoelma)! - Remove explicit creation of `rdfa-id` attributes
13
+
14
+ ### Patch Changes
15
+
16
+ - [`83cc1ae`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/83cc1ae8b3bba280aa001566e7d77109a2d43170) Thanks [@abeforgit](https://github.com/abeforgit)! - bump peerdep to allow editor v7
17
+
3
18
  ## 15.0.0
4
19
 
5
20
  ### Major Changes
@@ -32,7 +32,6 @@
32
32
  @standOut={{true}} as |card|
33
33
  >
34
34
  <card.content>
35
- {{! template-lint-disable no-down-event-binding }}
36
35
  <AuNativeInput
37
36
  value={{this.inputNumber}}
38
37
  placeholder={{t 'variable.number.type-number'}}
@@ -1,7 +1,6 @@
1
1
  import { PNode } from '@lblod/ember-rdfa-editor';
2
2
  import { CitationSchema } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin';
3
3
  import { unwrap } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
4
- import { v4 as uuid } from 'uuid';
5
4
 
6
5
  export function citedText(
7
6
  schema: CitationSchema,
@@ -13,7 +12,6 @@ export function citedText(
13
12
  href: uri,
14
13
  property: 'eli:cites',
15
14
  typeof: 'eli:LegalExpression',
16
- __rdfaId: uuid(),
17
15
  },
18
16
  [schema.text(title)],
19
17
  );
@@ -4,7 +4,6 @@ import {
4
4
  NodeSelection,
5
5
  Transaction,
6
6
  } from '@lblod/ember-rdfa-editor';
7
- import { v4 as uuid } from 'uuid';
8
7
  import { besluitArticleStructure } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/standard-template-plugin/utils/nodes';
9
8
  import IntlService from 'ember-intl/services/intl';
10
9
  import { isNone } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
@@ -24,9 +23,7 @@ export default function insertArticleContainer({
24
23
  const { selection, schema } = state;
25
24
  const nodeToInsert = schema.node(
26
25
  'article_container',
27
- {
28
- __rdfaId: uuid(),
29
- },
26
+ {},
30
27
  besluitArticleStructure.constructor({
31
28
  schema,
32
29
  intl,
@@ -3,7 +3,6 @@ import {
3
3
  NodeSelection,
4
4
  Transaction,
5
5
  } from '@lblod/ember-rdfa-editor';
6
- import { v4 as uuid } from 'uuid';
7
6
  import { isNone } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
8
7
  import { transactionCompliesWithShapes } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/validation/utils/transaction-complies-with-shapes';
9
8
  import { findInsertionPosInAncestorOfType } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/find-insertion-pos-in-ancestor-of-type';
@@ -21,7 +20,7 @@ export default function insertDescription({
21
20
  const { selection, schema } = state;
22
21
  const nodeToInsert = schema.node(
23
22
  'description',
24
- { __rdfaId: uuid() },
23
+ {},
25
24
  schema.node(
26
25
  'paragraph',
27
26
  null,
@@ -4,7 +4,6 @@ import {
4
4
  NodeSelection,
5
5
  Transaction,
6
6
  } from '@lblod/ember-rdfa-editor';
7
- import { v4 as uuid } from 'uuid';
8
7
  import { isNone } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
9
8
  import { transactionCompliesWithShapes } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/validation/utils/transaction-complies-with-shapes';
10
9
  import { findInsertionPosInAncestorOfType } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/find-insertion-pos-in-ancestor-of-type';
@@ -23,7 +22,7 @@ export default function insertMotivation({
23
22
  return function (state: EditorState, dispatch?: (tr: Transaction) => void) {
24
23
  const translationWithDocLang = getTranslationFunction(state);
25
24
  const { selection, schema } = state;
26
- const nodeToInsert = schema.node('motivering', { __rdfaId: uuid() }, [
25
+ const nodeToInsert = schema.node('motivering', {}, [
27
26
  schema.node(
28
27
  'paragraph',
29
28
  null,
@@ -1,4 +1,3 @@
1
- import { v4 as uuid } from 'uuid';
2
1
  import { isNone } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
3
2
  import {
4
3
  EditorState,
@@ -21,7 +20,7 @@ export default function insertTitle({
21
20
  const { selection, schema } = state;
22
21
  const nodeToInsert = schema.node(
23
22
  'besluit_title',
24
- { __rdfaId: uuid() },
23
+ {},
25
24
  schema.node(
26
25
  'paragraph',
27
26
  null,
@@ -1,6 +1,5 @@
1
1
  import { Command } from '@lblod/ember-rdfa-editor';
2
2
  import { findInsertionRange } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/_private/find-insertion-range';
3
- import { v4 as uuid } from 'uuid';
4
3
 
5
4
  interface InsertDocumentTitleArgs {
6
5
  placeholder: string;
@@ -27,7 +26,7 @@ export default function insertDocumentTitle({
27
26
  insertionRange.to,
28
27
  schema.node(
29
28
  'document_title',
30
- { __rdfaId: uuid() },
29
+ {},
31
30
  schema.node(
32
31
  'paragraph',
33
32
  null,
@@ -188,16 +188,14 @@ export const besluitArticleStructure: StructureSpec = {
188
188
  `besluit_article`,
189
189
  {
190
190
  resource: `http://data.lblod.info/articles/${uuid()}`,
191
- __rdfaId: uuid(),
192
191
  },
193
192
  [
194
193
  schema.node('besluit_article_header', {
195
194
  number: numberConverted,
196
- __rdfaId: uuid(),
197
195
  }),
198
196
  schema.node(
199
197
  `besluit_article_content`,
200
- { __rdfaId: uuid() },
198
+ {},
201
199
  content ??
202
200
  schema.node(
203
201
  'paragraph',
@@ -48,3 +48,158 @@
48
48
  .citaten--error-code {
49
49
  font-family: var(--au-font-tertiary);
50
50
  }
51
+
52
+ // Start: Styling the highlight when detecting search term inside the editor
53
+ @mixin hints($before, $after) {
54
+ .rdfa-annotations.show-rdfa-blocks [data-editor-highlight=true] {
55
+ &:before {
56
+ content: "#{$before}";
57
+ }
58
+
59
+ &:not([contenteditable=""]):after {
60
+ content: "#{$after}";
61
+ }
62
+ }
63
+ }
64
+
65
+ .rdfa-annotations {
66
+ &.show-rdfa-blocks {
67
+ [data-editor-highlight=true] {
68
+ position: relative;
69
+ border: 1px solid var(--au-gray-200);
70
+ display: block !important; // Override inline styles
71
+ margin: $au-unit-tiny;
72
+ padding: 0;
73
+
74
+ &:before {
75
+ @include au-font-size(1.2rem, 1.2);
76
+ font-family: var(--au-font);
77
+ font-weight: var(--au-medium);
78
+ letter-spacing: 0.01rem;
79
+ color: var(--au-gray-600);
80
+ text-transform: uppercase;
81
+ pointer-events: none;
82
+ content: attr(property) ' ' attr(typeof) ' ' attr(data-type);
83
+ position: relative;
84
+ right: auto;
85
+ top: 0;
86
+ left: 0;
87
+ display: block;
88
+ width: 100%;
89
+ padding: $au-unit-tiny * 0.5;
90
+ transition: none;
91
+ border-bottom: 1px solid var(--au-gray-200);
92
+ background-color: var(--au-gray-100);
93
+ opacity: 1;
94
+ }
95
+
96
+ &:after {
97
+ @include au-font-size($say-smallest-font-size, 1.2);
98
+ font-family: var(--au-font);
99
+ font-weight: var(--au-regular);
100
+ letter-spacing: 0.01rem;
101
+ color: var(--au-gray-600);
102
+ text-transform: uppercase;
103
+ pointer-events: none;
104
+ position: relative;
105
+ right: auto;
106
+ bottom: 0;
107
+ left: 0;
108
+ display: block;
109
+ width: 100%;
110
+ padding: $au-unit-tiny * 0.5;
111
+ transition: none;
112
+ border-top: 1px solid var(--au-gray-200);
113
+ background-color: var(--au-white);
114
+ opacity: 1;
115
+ margin: 0;
116
+ }
117
+ }
118
+ }
119
+
120
+ [data-editor-highlight=true] {
121
+ &:not([contenteditable=""]) {
122
+ background-color: var(--au-gray-100);
123
+ border-bottom: 0.2rem dotted var(--au-gray-300);
124
+ padding-bottom: 0.2rem;
125
+ transition: background-color var(--au-transition);
126
+
127
+ &::selection {
128
+ background-color: var(--au-gray-300);
129
+ }
130
+
131
+ &:hover {
132
+ background-color: var(--au-gray-200);
133
+ }
134
+ }
135
+ }
136
+ }
137
+
138
+ @include hints("Selecteer de juiste optie", "Actie nodig");
139
+
140
+ [data--language=en], [lang=en] {
141
+ @include hints("Select the correct option", "Action required");
142
+ }
143
+
144
+ .rdfa-annotations-hover:not(.show-rdfa-blocks) {
145
+ [data-editor-highlight="true"] {
146
+ &:not(ol):not(ul):not(li):not(span) {
147
+ position: relative;
148
+
149
+ &:before {
150
+ height: 100%;
151
+ top: 0;
152
+ }
153
+ }
154
+
155
+ &:not([contenteditable='']) {
156
+ &:hover {
157
+ border-bottom-color: tint($au-gray-600, 20);
158
+ }
159
+
160
+ &:before {
161
+ @include au-font-size(1.2rem, 1.2);
162
+ position: absolute;
163
+ transition: opacity $au-easing 0.5s, left $au-easing 0.2s;
164
+ right: calc(100% + #{$au-unit-large});
165
+ opacity: 0;
166
+ display: block;
167
+ margin-top: 0.2rem;
168
+ padding-right: $au-unit + $au-unit-small;
169
+ margin-right: -$au-unit + $au-unit-tiny;
170
+ width: $au-unit-huge * 1.5;
171
+ font-family: var(--au-font);
172
+ font-weight: var(--au-medium);
173
+ letter-spacing: 0.01rem;
174
+ text-transform: uppercase;
175
+ text-overflow: ellipsis;
176
+ white-space: nowrap;
177
+ color: var(--au-gray-600);
178
+ pointer-events: none;
179
+ overflow: hidden;
180
+ min-height: 2rem;
181
+ border-right: 1px dashed var(--au-gray-300);
182
+ border-top: 1px dashed var(--au-gray-300);
183
+ z-index: var(--au-z-index-gamma);
184
+ background: var(--au-white) linear-gradient(
185
+ to right,
186
+ $au-white,
187
+ $au-white calc(100% - #{$au-unit + $au-unit-tiny}),
188
+ transparent calc(100% - #{$au-unit + $au-unit-tiny}),
189
+ transparent 100%
190
+ );
191
+ }
192
+ }
193
+ }
194
+
195
+ @include mq($until: 1280px) {
196
+ [data-editor-highlight='true'] {
197
+ &:before {
198
+ display: none !important;
199
+ }
200
+ }
201
+ }
202
+
203
+ }
204
+
205
+ // End: Styling the highlight when detecting search term inside the editor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lblod/ember-rdfa-editor-lblod-plugins",
3
- "version": "15.0.0",
3
+ "version": "15.1.0",
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": "^6.1.0",
74
+ "@lblod/ember-rdfa-editor": "^7.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",
@@ -122,7 +122,7 @@
122
122
  "ember-simple-auth": "4.2.2",
123
123
  "ember-source": "~4.12.0",
124
124
  "ember-source-channel-url": "^3.0.0",
125
- "ember-template-lint": "^4.16.1",
125
+ "ember-template-lint": "^5.11.2",
126
126
  "ember-try": "^2.0.0",
127
127
  "eslint": "^8.44.0",
128
128
  "eslint-config-prettier": "^9.0.0",
@@ -138,14 +138,14 @@
138
138
  "qunit-dom": "^2.0.0",
139
139
  "release-it": "^15.5.0",
140
140
  "sass": "^1.49.7",
141
- "typescript": "~5.0.4",
141
+ "typescript": "~5.2.2",
142
142
  "webpack": "^5.74.0"
143
143
  },
144
144
  "peerDependencies": {
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",
148
+ "@lblod/ember-rdfa-editor": "^6.0.0 || ^7.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",