@atlaskit/editor-plugin-help-dialog 1.8.13 → 1.9.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,13 @@
1
1
  # @atlaskit/editor-plugin-help-dialog
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#154461](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/154461)
8
+ [`ed3b12d7f1092`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ed3b12d7f1092) -
9
+ Remove WithHelpTrigger from Confluence and deprecate
10
+
3
11
  ## 1.8.13
4
12
 
5
13
  ### Patch Changes
@@ -10,6 +10,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
10
10
  var _keymaps = require("@atlaskit/editor-common/keymaps");
11
11
  var _messages = require("@atlaskit/editor-common/messages");
12
12
  var _questionCircle = _interopRequireDefault(require("@atlaskit/icon/core/migration/question-circle"));
13
+ var _actions = require("./pm-plugins/actions");
13
14
  var _commands = require("./pm-plugins/commands");
14
15
  var _keymap = require("./pm-plugins/keymap");
15
16
  var _main = require("./pm-plugins/main");
@@ -83,6 +84,20 @@ var helpDialogPlugin = exports.helpDialogPlugin = function helpDialogPlugin(_ref
83
84
  return null;
84
85
  }
85
86
  return _pluginKey.pluginKey.getState(editorState) || null;
87
+ },
88
+ actions: {
89
+ openHelp: function openHelp() {
90
+ return api === null || api === void 0 ? void 0 : api.core.actions.execute(function (_ref5) {
91
+ var tr = _ref5.tr;
92
+ return (0, _actions.openHelpAction)(tr);
93
+ });
94
+ },
95
+ closeHelp: function closeHelp() {
96
+ return api === null || api === void 0 ? void 0 : api.core.actions.execute(function (_ref6) {
97
+ var tr = _ref6.tr;
98
+ return (0, _actions.closeHelpAction)(tr);
99
+ });
100
+ }
86
101
  }
87
102
  };
88
103
  };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.openHelpAction = exports.closeHelpAction = void 0;
7
+ var _pluginKey = require("./plugin-key");
8
+ var openHelpAction = exports.openHelpAction = function openHelpAction(tr) {
9
+ return tr.setMeta(_pluginKey.pluginKey, true);
10
+ };
11
+ var closeHelpAction = exports.closeHelpAction = function closeHelpAction(tr) {
12
+ return tr.setMeta(_pluginKey.pluginKey, false);
13
+ };
@@ -3,6 +3,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
3
3
  import { openHelp, tooltip } from '@atlaskit/editor-common/keymaps';
4
4
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
5
5
  import QuestionCircleIcon from '@atlaskit/icon/core/migration/question-circle';
6
+ import { closeHelpAction, openHelpAction } from './pm-plugins/actions';
6
7
  import { openHelpCommand } from './pm-plugins/commands';
7
8
  import { keymapPlugin } from './pm-plugins/keymap';
8
9
  import { createPlugin } from './pm-plugins/main';
@@ -72,5 +73,17 @@ export const helpDialogPlugin = ({
72
73
  return null;
73
74
  }
74
75
  return pluginKey.getState(editorState) || null;
76
+ },
77
+ actions: {
78
+ openHelp: () => {
79
+ return api === null || api === void 0 ? void 0 : api.core.actions.execute(({
80
+ tr
81
+ }) => openHelpAction(tr));
82
+ },
83
+ closeHelp: () => {
84
+ return api === null || api === void 0 ? void 0 : api.core.actions.execute(({
85
+ tr
86
+ }) => closeHelpAction(tr));
87
+ }
75
88
  }
76
89
  });
@@ -0,0 +1,7 @@
1
+ import { pluginKey } from './plugin-key';
2
+ export const openHelpAction = tr => {
3
+ return tr.setMeta(pluginKey, true);
4
+ };
5
+ export const closeHelpAction = tr => {
6
+ return tr.setMeta(pluginKey, false);
7
+ };
@@ -3,6 +3,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
3
3
  import { openHelp, tooltip } from '@atlaskit/editor-common/keymaps';
4
4
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
5
5
  import QuestionCircleIcon from '@atlaskit/icon/core/migration/question-circle';
6
+ import { closeHelpAction, openHelpAction } from './pm-plugins/actions';
6
7
  import { openHelpCommand } from './pm-plugins/commands';
7
8
  import { keymapPlugin } from './pm-plugins/keymap';
8
9
  import { createPlugin } from './pm-plugins/main';
@@ -76,6 +77,20 @@ export var helpDialogPlugin = function helpDialogPlugin(_ref) {
76
77
  return null;
77
78
  }
78
79
  return pluginKey.getState(editorState) || null;
80
+ },
81
+ actions: {
82
+ openHelp: function openHelp() {
83
+ return api === null || api === void 0 ? void 0 : api.core.actions.execute(function (_ref5) {
84
+ var tr = _ref5.tr;
85
+ return openHelpAction(tr);
86
+ });
87
+ },
88
+ closeHelp: function closeHelp() {
89
+ return api === null || api === void 0 ? void 0 : api.core.actions.execute(function (_ref6) {
90
+ var tr = _ref6.tr;
91
+ return closeHelpAction(tr);
92
+ });
93
+ }
79
94
  }
80
95
  };
81
96
  };
@@ -0,0 +1,7 @@
1
+ import { pluginKey } from './plugin-key';
2
+ export var openHelpAction = function openHelpAction(tr) {
3
+ return tr.setMeta(pluginKey, true);
4
+ };
5
+ export var closeHelpAction = function closeHelpAction(tr) {
6
+ return tr.setMeta(pluginKey, false);
7
+ };
@@ -9,4 +9,8 @@ export type HelpDialogPlugin = NextEditorPlugin<'helpDialog', {
9
9
  dependencies: [OptionalPlugin<AnalyticsPlugin>, OptionalPlugin<QuickInsertPlugin>];
10
10
  pluginConfiguration: boolean;
11
11
  sharedState: HelpDialogSharedState | null;
12
+ actions: {
13
+ openHelp(): void;
14
+ closeHelp(): void;
15
+ };
12
16
  }>;
@@ -0,0 +1,3 @@
1
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ export declare const openHelpAction: (tr: Transaction) => Transaction;
3
+ export declare const closeHelpAction: (tr: Transaction) => Transaction;
@@ -12,4 +12,8 @@ export type HelpDialogPlugin = NextEditorPlugin<'helpDialog', {
12
12
  ];
13
13
  pluginConfiguration: boolean;
14
14
  sharedState: HelpDialogSharedState | null;
15
+ actions: {
16
+ openHelp(): void;
17
+ closeHelp(): void;
18
+ };
15
19
  }>;
@@ -0,0 +1,3 @@
1
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ export declare const openHelpAction: (tr: Transaction) => Transaction;
3
+ export declare const closeHelpAction: (tr: Transaction) => Transaction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-help-dialog",
3
- "version": "1.8.13",
3
+ "version": "1.9.0",
4
4
  "description": "Help Dialog plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",