@lblod/ember-rdfa-editor-lblod-plugins 37.0.0 → 37.0.2

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
+ ## 37.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`22a4866`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/22a486642e8c7d7ee6d42370e59da200e4339121) Thanks [@abeforgit](https://github.com/abeforgit)! - correct return type for location context commands
8
+
9
+ ## 37.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`d088a86`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/d088a868fdacb5d6b5f7c6d16eb0a2e9a5abdf24) Thanks [@abeforgit](https://github.com/abeforgit)! - correctly type command signature of location actions
14
+
3
15
  ## 37.0.0
4
16
 
5
17
  ### Major Changes
@@ -45,13 +45,20 @@ export function openLocationModal(
45
45
  }
46
46
 
47
47
  export function openLocationModalCommand(locationType: LocationType) {
48
- return function (state: EditorState, dispatch: (tr: Transaction) => void) {
48
+ return function (
49
+ state: EditorState,
50
+ dispatch?: (tr: Transaction) => boolean,
51
+ ) {
52
+ if (!dispatch) {
53
+ return false;
54
+ }
49
55
  const tr = state.tr;
50
56
  tr.setMeta(locationModalsPluginKey, {
51
57
  action: 'open_location_modal',
52
58
  locationType,
53
59
  });
54
60
  dispatch(tr);
61
+ return true;
55
62
  };
56
63
  }
57
64
 
@@ -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) => void) => void;
6
+ command: (state: EditorState, dispatch?: (tr: import("@lblod/ember-rdfa-editor").Transaction) => boolean) => boolean;
7
7
  label: string;
8
8
  locationType: LocationType;
9
9
  icon: string;
@@ -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) => void) => void;
10
+ export declare function openLocationModalCommand(locationType: LocationType): (state: EditorState, dispatch?: (tr: Transaction) => boolean) => boolean;
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.0",
3
+ "version": "37.0.2",
4
4
  "description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
5
5
  "keywords": [
6
6
  "ember-addon",