@lblod/ember-rdfa-editor-lblod-plugins 37.0.2 → 37.0.3-dev.be7ffcf1928f284b60aef82e8203211f65695a9b

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,11 @@
1
1
  # @lblod/ember-rdfa-editor-lblod-plugins
2
2
 
3
+ ## 37.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`edc47f2`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/edc47f296f8a525bde907a88d047de49441c37da) Thanks [@abeforgit](https://github.com/abeforgit)! - Fix location command signature, again
8
+
3
9
  ## 37.0.2
4
10
 
5
11
  ### Patch Changes
@@ -14,6 +14,7 @@ import t from 'ember-intl/helpers/t';
14
14
  import { SayController } from '@lblod/ember-rdfa-editor';
15
15
  import { PreviewableDocument } from './types';
16
16
  import { VoteStarUnfilledIcon } from '../vote-star-unfilled-icon';
17
+ import perform from 'ember-concurrency/helpers/perform';
17
18
 
18
19
  interface Signature<Doc extends PreviewableDocument> {
19
20
  Args: {
@@ -31,10 +32,10 @@ export default class DocumentPreview<
31
32
  @tracked controller?: SayController;
32
33
  @tracked isExpanded = false;
33
34
 
34
- @action
35
- onInsert() {
35
+ onInsert = task(async () => {
36
+ await this.contentTask.perform();
36
37
  this.args.onInsert(this.args.doc);
37
- }
38
+ });
38
39
 
39
40
  @action
40
41
  togglePreview() {
@@ -101,7 +102,7 @@ export default class DocumentPreview<
101
102
  <div
102
103
  role='button'
103
104
  title={{t 'common.preview-list.select-button.title'}}
104
- {{on 'click' this.onInsert}}
105
+ {{on 'click' (perform this.onInsert)}}
105
106
  {{! template-lint-disable require-presentational-children}}
106
107
  >
107
108
  <AuButton class='snippet-preview__insert-button' @skin='naked'>
@@ -4,6 +4,7 @@ import {
4
4
  EditorState,
5
5
  EditorView,
6
6
  Transaction,
7
+ Command,
7
8
  } from '@lblod/ember-rdfa-editor';
8
9
  import { LocationType } from '@lblod/ember-rdfa-editor-lblod-plugins/components/location-plugin/map';
9
10
 
@@ -44,11 +45,8 @@ export function openLocationModal(
44
45
  view.dispatch(tr);
45
46
  }
46
47
 
47
- export function openLocationModalCommand(locationType: LocationType) {
48
- return function (
49
- state: EditorState,
50
- dispatch?: (tr: Transaction) => boolean,
51
- ) {
48
+ export function openLocationModalCommand(locationType: LocationType): Command {
49
+ return function (state, dispatch) {
52
50
  if (!dispatch) {
53
51
  return false;
54
52
  }
@@ -13,7 +13,7 @@ interface Signature<Doc extends PreviewableDocument> {
13
13
  export default class DocumentPreview<Doc extends PreviewableDocument> extends Component<Signature<Doc>> {
14
14
  controller?: SayController;
15
15
  isExpanded: boolean;
16
- onInsert(): void;
16
+ onInsert: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<void>>;
17
17
  togglePreview(): void;
18
18
  get isFavourite(): boolean | undefined;
19
19
  toggleFavourite: (event: MouseEvent) => void;
@@ -3,7 +3,7 @@ import { LocationType } from '@lblod/ember-rdfa-editor-lblod-plugins/components/
3
3
  export declare function getContextualActions(): (state: EditorState, searchQuery?: string) => {
4
4
  id: string;
5
5
  group: string;
6
- command: (state: EditorState, dispatch?: (tr: import("@lblod/ember-rdfa-editor").Transaction) => boolean) => boolean;
6
+ command: import("@lblod/ember-rdfa-editor").Command;
7
7
  label: string;
8
8
  locationType: LocationType;
9
9
  icon: string;
@@ -1,4 +1,4 @@
1
- import { ProsePlugin, PluginKey, EditorState, EditorView, Transaction } from '@lblod/ember-rdfa-editor';
1
+ import { ProsePlugin, PluginKey, EditorState, EditorView, Command } from '@lblod/ember-rdfa-editor';
2
2
  import { LocationType } from '@lblod/ember-rdfa-editor-lblod-plugins/components/location-plugin/map';
3
3
  type PluginState = {
4
4
  modalOpen: boolean;
@@ -7,7 +7,7 @@ type PluginState = {
7
7
  export declare const locationModalsPluginKey: PluginKey<PluginState>;
8
8
  export declare function closeLocationModal(view: EditorView): void;
9
9
  export declare function openLocationModal(view: EditorView, locationType?: LocationType): void;
10
- export declare function openLocationModalCommand(locationType: LocationType): (state: EditorState, dispatch?: (tr: Transaction) => boolean) => boolean;
10
+ export declare function openLocationModalCommand(locationType: LocationType): Command;
11
11
  export declare function locationModalsPlugin(): ProsePlugin<PluginState>;
12
12
  export declare function getLocationModalsPluginState(state: EditorState): PluginState | undefined;
13
13
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lblod/ember-rdfa-editor-lblod-plugins",
3
- "version": "37.0.2",
3
+ "version": "37.0.3-dev.be7ffcf1928f284b60aef82e8203211f65695a9b",
4
4
  "description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
5
5
  "keywords": [
6
6
  "ember-addon",