@atlaskit/editor-plugin-loom 16.0.0 → 17.0.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,21 @@
1
1
  # @atlaskit/editor-plugin-loom
2
2
 
3
+ ## 17.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 16.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`3a4c286fdb8c1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3a4c286fdb8c1) -
14
+ Add registry-backed Quick Insert search matching under the existing
15
+ `platform_editor_slash_command` experiment. Make native, provider, and extension registered Quick
16
+ Insert items searchable.
17
+ - Updated dependencies
18
+
3
19
  ## 16.0.0
4
20
 
5
21
  ### Patch Changes
package/compass.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  configVersion: 1
2
2
  id: ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/b72f55d4-7af9-4e10-9e0b-ba9b6f331f19
3
3
  name: '@atlaskit/editor-plugin-loom'
4
- ownerId: ari:cloud:identity::team/ce353f56-2a90-491b-b272-b90dca4fffa2 # Editor FE Platform
4
+ ownerId: ari:cloud:identity::team/cf6a670b-5252-4c68-a769-9207de366beb # Editor Developers
5
5
  labels:
6
6
  - platform-code
7
7
  - platform-afm
@@ -16,14 +16,14 @@ links:
16
16
  url: https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master
17
17
  - name: Slack Channel
18
18
  type: CHAT_CHANNEL
19
- url: https://atlassian.enterprise.slack.com/archives/C03SD6QJWPP # #cc-editor-lego
19
+ url: https://atlassian.enterprise.slack.com/archives/CFG3PSQ9E # #help-editor
20
20
  - name: Editor Plugin Loom
21
21
  type: REPOSITORY
22
22
  url: https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/editor/editor-plugin-loom
23
23
  customFields:
24
24
  - name: Department
25
25
  type: text
26
- value: Eng - Editor Frontend Platform
26
+ value: Editor Developers
27
27
  - name: Trusted Reviewer Teams
28
28
  type: text
29
29
  value: ari:cloud:identity::team/cf6a670b-5252-4c68-a769-9207de366beb
@@ -9,11 +9,10 @@ exports.LoomQuickInsertMenuItem = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _reactIntl = require("react-intl");
11
11
  var _analytics = require("@atlaskit/editor-common/analytics");
12
- var _hooks = require("@atlaskit/editor-common/hooks");
13
12
  var _messages = require("@atlaskit/editor-common/messages");
14
13
  var _monitoring = require("@atlaskit/editor-common/monitoring");
15
14
  var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
16
- var _connectivityPluginType = require("@atlaskit/editor-plugin-connectivity/connectivityPluginType");
15
+ var _useQuickInsertContext = require("@atlaskit/editor-common/quick-insert/use-quick-insert-context");
17
16
  var _video = _interopRequireDefault(require("@atlaskit/icon/core/video"));
18
17
  var _commands = require("../../pm-plugins/commands");
19
18
  var _main = require("../../pm-plugins/main");
@@ -22,17 +21,12 @@ var LoomQuickInsertMenuItem = exports.LoomQuickInsertMenuItem = function LoomQui
22
21
  var api = _ref.api;
23
22
  var _useIntl = (0, _reactIntl.useIntl)(),
24
23
  formatMessage = _useIntl.formatMessage;
25
- var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['connectivity'], function (_ref2) {
26
- var connectivityState = _ref2.connectivityState;
27
- return {
28
- isOffline: (0, _connectivityPluginType.isOfflineMode)(connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode)
29
- };
30
- }),
31
- isOffline = _useSharedPluginState.isOffline;
32
- var onSelect = (0, _react.useCallback)(function (_ref3) {
24
+ var _useQuickInsertContex = (0, _useQuickInsertContext.useQuickInsertContext)(),
25
+ isOffline = _useQuickInsertContex.isOffline;
26
+ var onSelect = (0, _react.useCallback)(function (_ref2) {
33
27
  var _recordVideo, _api$analytics2;
34
- var editorView = _ref3.editorView,
35
- insert = _ref3.insert;
28
+ var editorView = _ref2.editorView,
29
+ insert = _ref2.insert;
36
30
  var tr = insert(undefined);
37
31
  var loomState = _main.loomPluginKey.getState(editorView.state);
38
32
  if (!(loomState !== null && loomState !== void 0 && loomState.isEnabled)) {
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.getLoomQuickInsertComponents = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _messages = require("@atlaskit/editor-common/messages");
10
+ var _createQuickInsertMatcher = require("@atlaskit/editor-common/quick-insert/create-quick-insert-matcher");
9
11
  var _keys = require("@atlaskit/editor-common/quick-insert/keys");
10
12
  var _rank = require("@atlaskit/editor-common/quick-insert/rank");
11
13
  var _LoomQuickInsertMenuItem = require("./LoomQuickInsertMenuItem");
@@ -19,6 +21,14 @@ var getLoomQuickInsertComponents = exports.getLoomQuickInsertComponents = functi
19
21
  type: _keys.MEDIA_SECTION.type,
20
22
  rank: _rank.MEDIA_SECTION_RANK[_keys.LOOM_MENU_ITEM.key]
21
23
  }],
24
+ match: (0, _createQuickInsertMatcher.createQuickInsertMatcher)(function (_ref2) {
25
+ var formatMessage = _ref2.formatMessage;
26
+ return {
27
+ description: formatMessage(_messages.toolbarInsertBlockMessages.recordVideoDescription),
28
+ keywords: ['loom', 'record', 'video'],
29
+ title: formatMessage(_messages.toolbarInsertBlockMessages.recordVideo)
30
+ };
31
+ }),
22
32
  component: function component() {
23
33
  return /*#__PURE__*/_react.default.createElement(_LoomQuickInsertMenuItem.LoomQuickInsertMenuItem, {
24
34
  api: api
@@ -1,11 +1,10 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { useIntl } from 'react-intl';
3
3
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
- import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
5
4
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
6
5
  import { logException } from '@atlaskit/editor-common/monitoring';
7
6
  import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
8
- import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity/connectivityPluginType';
7
+ import { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
9
8
  import VideoIcon from '@atlaskit/icon/core/video';
10
9
  import { recordVideo, recordVideoFailed } from '../../pm-plugins/commands';
11
10
  import { loomPluginKey } from '../../pm-plugins/main';
@@ -17,11 +16,7 @@ export const LoomQuickInsertMenuItem = ({
17
16
  } = useIntl();
18
17
  const {
19
18
  isOffline
20
- } = useSharedPluginStateWithSelector(api, ['connectivity'], ({
21
- connectivityState
22
- }) => ({
23
- isOffline: isOfflineMode(connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode)
24
- }));
19
+ } = useQuickInsertContext();
25
20
  const onSelect = useCallback(({
26
21
  editorView,
27
22
  insert
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
3
+ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
2
4
  import { LOOM_MENU_ITEM, MEDIA_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
3
5
  import { MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
4
6
  import { LoomQuickInsertMenuItem } from './LoomQuickInsertMenuItem';
@@ -12,6 +14,13 @@ export const getLoomQuickInsertComponents = ({
12
14
  type: MEDIA_SECTION.type,
13
15
  rank: MEDIA_SECTION_RANK[LOOM_MENU_ITEM.key]
14
16
  }],
17
+ match: createQuickInsertMatcher(({
18
+ formatMessage
19
+ }) => ({
20
+ description: formatMessage(messages.recordVideoDescription),
21
+ keywords: ['loom', 'record', 'video'],
22
+ title: formatMessage(messages.recordVideo)
23
+ })),
15
24
  component: () => /*#__PURE__*/React.createElement(LoomQuickInsertMenuItem, {
16
25
  api: api
17
26
  })
@@ -1,11 +1,10 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { useIntl } from 'react-intl';
3
3
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
- import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
5
4
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
6
5
  import { logException } from '@atlaskit/editor-common/monitoring';
7
6
  import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
8
- import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity/connectivityPluginType';
7
+ import { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
9
8
  import VideoIcon from '@atlaskit/icon/core/video';
10
9
  import { recordVideo, recordVideoFailed } from '../../pm-plugins/commands';
11
10
  import { loomPluginKey } from '../../pm-plugins/main';
@@ -13,17 +12,12 @@ export var LoomQuickInsertMenuItem = function LoomQuickInsertMenuItem(_ref) {
13
12
  var api = _ref.api;
14
13
  var _useIntl = useIntl(),
15
14
  formatMessage = _useIntl.formatMessage;
16
- var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['connectivity'], function (_ref2) {
17
- var connectivityState = _ref2.connectivityState;
18
- return {
19
- isOffline: isOfflineMode(connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode)
20
- };
21
- }),
22
- isOffline = _useSharedPluginState.isOffline;
23
- var onSelect = useCallback(function (_ref3) {
15
+ var _useQuickInsertContex = useQuickInsertContext(),
16
+ isOffline = _useQuickInsertContex.isOffline;
17
+ var onSelect = useCallback(function (_ref2) {
24
18
  var _recordVideo, _api$analytics2;
25
- var editorView = _ref3.editorView,
26
- insert = _ref3.insert;
19
+ var editorView = _ref2.editorView,
20
+ insert = _ref2.insert;
27
21
  var tr = insert(undefined);
28
22
  var loomState = loomPluginKey.getState(editorView.state);
29
23
  if (!(loomState !== null && loomState !== void 0 && loomState.isEnabled)) {
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
3
+ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
2
4
  import { LOOM_MENU_ITEM, MEDIA_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
3
5
  import { MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
4
6
  import { LoomQuickInsertMenuItem } from './LoomQuickInsertMenuItem';
@@ -12,6 +14,14 @@ export var getLoomQuickInsertComponents = function getLoomQuickInsertComponents(
12
14
  type: MEDIA_SECTION.type,
13
15
  rank: MEDIA_SECTION_RANK[LOOM_MENU_ITEM.key]
14
16
  }],
17
+ match: createQuickInsertMatcher(function (_ref2) {
18
+ var formatMessage = _ref2.formatMessage;
19
+ return {
20
+ description: formatMessage(messages.recordVideoDescription),
21
+ keywords: ['loom', 'record', 'video'],
22
+ title: formatMessage(messages.recordVideo)
23
+ };
24
+ }),
15
25
  component: function component() {
16
26
  return /*#__PURE__*/React.createElement(LoomQuickInsertMenuItem, {
17
27
  api: api
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-loom",
3
- "version": "16.0.0",
3
+ "version": "17.0.0",
4
4
  "description": "Loom plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -25,28 +25,28 @@
25
25
  "atlaskit:src": "src/index.ts",
26
26
  "dependencies": {
27
27
  "@atlaskit/button": "^25.0.0",
28
- "@atlaskit/editor-plugin-analytics": "^14.0.0",
29
- "@atlaskit/editor-plugin-connectivity": "^14.0.0",
30
- "@atlaskit/editor-plugin-editor-viewmode": "^16.0.0",
31
- "@atlaskit/editor-plugin-hyperlink": "^16.0.0",
32
- "@atlaskit/editor-plugin-primary-toolbar": "^15.0.0",
33
- "@atlaskit/editor-plugin-quick-insert": "^14.0.0",
34
- "@atlaskit/editor-plugin-toolbar": "^11.0.0",
35
- "@atlaskit/editor-plugin-ui-control-registry": "^8.0.0",
36
- "@atlaskit/editor-plugin-width": "^15.0.0",
28
+ "@atlaskit/editor-plugin-analytics": "^15.0.0",
29
+ "@atlaskit/editor-plugin-connectivity": "^15.0.0",
30
+ "@atlaskit/editor-plugin-editor-viewmode": "^17.0.0",
31
+ "@atlaskit/editor-plugin-hyperlink": "^17.0.0",
32
+ "@atlaskit/editor-plugin-primary-toolbar": "^16.0.0",
33
+ "@atlaskit/editor-plugin-quick-insert": "^15.0.0",
34
+ "@atlaskit/editor-plugin-toolbar": "^12.0.0",
35
+ "@atlaskit/editor-plugin-ui-control-registry": "^9.0.0",
36
+ "@atlaskit/editor-plugin-width": "^16.0.0",
37
37
  "@atlaskit/editor-prosemirror": "^8.0.0",
38
38
  "@atlaskit/editor-toolbar": "^2.4.0",
39
- "@atlaskit/editor-ui-control-model": "^2.4.0",
39
+ "@atlaskit/editor-ui-control-model": "^2.6.0",
40
40
  "@atlaskit/icon": "^37.3.0",
41
41
  "@atlaskit/platform-feature-experiments": "^0.3.0",
42
42
  "@atlaskit/platform-feature-flags": "^2.1.0",
43
- "@atlaskit/tokens": "^16.4.0",
43
+ "@atlaskit/tokens": "^16.7.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1",
46
46
  "@loomhq/record-sdk": "^4.12.4"
47
47
  },
48
48
  "peerDependencies": {
49
- "@atlaskit/editor-common": "^118.0.0",
49
+ "@atlaskit/editor-common": "^119.0.0",
50
50
  "react": "^18.2.0 || ^19.2.0",
51
51
  "react-dom": "^18.2.0 || ^19.2.0",
52
52
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"