@lblod/ember-rdfa-editor-lblod-plugins 24.3.0 → 24.3.1-dev.2f0c6fa7bb8db188849b5331892eb16d7d692f44

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.
@@ -0,0 +1,5 @@
1
+ ---
2
+ '@lblod/ember-rdfa-editor-lblod-plugins': patch
3
+ ---
4
+
5
+ Correctly instantiate placeholder URIs in snippets when inserting
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lblod/ember-rdfa-editor-lblod-plugins
2
2
 
3
+ ## 24.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#494](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/494) [`3941b65`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/3941b659fbb710be0aafd34b911a42416a1124c9) Thanks [@elpoelma](https://github.com/elpoelma)! - Ensure that the event handlers of snippet actions are only triggered once
8
+
3
9
  ## 24.3.0
4
10
 
5
11
  ### Minor Changes
@@ -32,7 +32,6 @@ import { recalculateNumbers } from '@lblod/ember-rdfa-editor-lblod-plugins/plugi
32
32
  interface ButtonSig {
33
33
  Args: {
34
34
  isActive: boolean;
35
- onClick: () => void;
36
35
  icon: AuIconSignature['Args']['icon'];
37
36
  helpText: string;
38
37
  };
@@ -41,13 +40,8 @@ interface ButtonSig {
41
40
 
42
41
  const SnippetButton: TemplateOnlyComponent<ButtonSig> = <template>
43
42
  {{#if @isActive}}
44
- <button
45
- class='say-snippet-button'
46
- type='button'
47
- {{on 'click' @onClick}}
48
- ...attributes
49
- >
50
- <AuIcon @icon={{@icon}} @size='large' {{on 'click' @onClick}} />
43
+ <button class='say-snippet-button' type='button' ...attributes>
44
+ <AuIcon @icon={{@icon}} @size='large' />
51
45
  <div class='say-snippet-button-text'>
52
46
  {{t @helpText}}
53
47
  </div>
@@ -169,13 +163,13 @@ export default class SnippetNode extends Component<Signature> {
169
163
  <SnippetButton
170
164
  @icon={{SynchronizeIcon}}
171
165
  @helpText='snippet-plugin.snippet-node.change-fragment'
172
- @onClick={{this.editFragment}}
166
+ {{on 'click' this.editFragment}}
173
167
  @isActive={{this.isActive}}
174
168
  />
175
169
  <SnippetButton
176
170
  @icon={{BinIcon}}
177
171
  @helpText='snippet-plugin.snippet-node.remove-fragment'
178
- @onClick={{this.deleteFragment}}
172
+ {{on 'click' this.deleteFragment}}
179
173
  @isActive={{this.isActive}}
180
174
  class='say-snippet-remove-button'
181
175
  />
@@ -183,7 +177,7 @@ export default class SnippetNode extends Component<Signature> {
183
177
  <SnippetButton
184
178
  @icon={{AddIcon}}
185
179
  @helpText='snippet-plugin.snippet-node.add-fragment'
186
- @onClick={{this.addFragment}}
180
+ {{on 'click' this.addFragment}}
187
181
  @isActive={{this.isActive}}
188
182
  />
189
183
  {{/if}}
@@ -1,4 +1,5 @@
1
1
  import { v4 as uuidv4 } from 'uuid';
2
+ import templateUuidInstantiator from '@lblod/template-uuid-instantiator';
2
3
  import {
3
4
  type Attrs,
4
5
  getRdfaAttrs,
@@ -88,6 +89,8 @@ export function createSnippet({
88
89
  replacedContent = replacedContent.replaceAll(imported, linked);
89
90
  }
90
91
  }
92
+ // Instantiate URIs of the form --ref-algo-123
93
+ replacedContent = templateUuidInstantiator(replacedContent);
91
94
  // Create the new node
92
95
  const parser = ProseParser.fromSchema(schema);
93
96
  const contentAsNode = htmlToDoc(replacedContent, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lblod/ember-rdfa-editor-lblod-plugins",
3
- "version": "24.3.0",
3
+ "version": "24.3.1-dev.2f0c6fa7bb8db188849b5331892eb16d7d692f44",
4
4
  "description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -57,6 +57,7 @@
57
57
  "@curvenote/prosemirror-utils": "^1.0.5",
58
58
  "@embroider/macros": "^1.16.5",
59
59
  "@lblod/marawa": "0.8.0-beta.6",
60
+ "@lblod/template-uuid-instantiator": "^1.0.2",
60
61
  "@rdfjs/data-model": "^2.0.2",
61
62
  "@rdfjs/dataset": "^2.0.2",
62
63
  "@rdfjs/parser-n3": "^2.0.2",
package/pnpm-lock.yaml CHANGED
@@ -29,6 +29,9 @@ importers:
29
29
  '@lblod/marawa':
30
30
  specifier: 0.8.0-beta.6
31
31
  version: 0.8.0-beta.6
32
+ '@lblod/template-uuid-instantiator':
33
+ specifier: ^1.0.2
34
+ version: 1.0.2
32
35
  '@rdfjs/data-model':
33
36
  specifier: ^2.0.2
34
37
  version: 2.0.2
@@ -1618,6 +1621,9 @@ packages:
1618
1621
  '@lblod/marawa@0.8.0-beta.6':
1619
1622
  resolution: {integrity: sha512-BW3yCpeQlk9EPnQAEQnM9uViA8RC5DkuoiaPJzbuhMcLvKHfI4cjc6dTg9i8qAijbL/xObmQ/Aexko2Xcj9ktw==}
1620
1623
 
1624
+ '@lblod/template-uuid-instantiator@1.0.2':
1625
+ resolution: {integrity: sha512-gw6nJnWCcHZYOG/Z/5Br8Txjqi5qV4S95ApoBpxeJKFzFyXMpl1Gh6LOKeOtuJerLp4NtZ71uVTJ3LzrrS2bdQ==}
1626
+
1621
1627
  '@lezer/common@1.2.1':
1622
1628
  resolution: {integrity: sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ==}
1623
1629
 
@@ -4968,7 +4974,7 @@ packages:
4968
4974
  resolution: {integrity: sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==}
4969
4975
  engines: {node: '>= 4.0'}
4970
4976
  os: [darwin]
4971
- deprecated: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
4977
+ deprecated: Upgrade to fsevents v2 to mitigate potential security issues
4972
4978
 
4973
4979
  fsevents@2.3.3:
4974
4980
  resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
@@ -10804,6 +10810,10 @@ snapshots:
10804
10810
  '@rdfjs/data-model': 1.3.4
10805
10811
  '@rdfjs/dataset': 1.1.1
10806
10812
 
10813
+ '@lblod/template-uuid-instantiator@1.0.2':
10814
+ dependencies:
10815
+ uuid: 9.0.1
10816
+
10807
10817
  '@lezer/common@1.2.1': {}
10808
10818
 
10809
10819
  '@lezer/css@1.1.8':
@@ -0,0 +1,3 @@
1
+ declare module '@lblod/template-uuid-instantiator' {
2
+ export default function (content: string): string;
3
+ }