@atlaskit/editor-plugin-synced-block 3.4.0 → 3.4.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,19 @@
1
1
  # @atlaskit/editor-plugin-synced-block
2
2
 
3
+ ## 3.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`b4dfb07c500c1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b4dfb07c500c1) -
14
+ [ux] Add disabled tooltip when source link not resolved
15
+ - Updated dependencies
16
+
3
17
  ## 3.4.0
4
18
 
5
19
  ### Minor Changes
@@ -52,16 +52,17 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(stat
52
52
  onClick: (0, _actions.copySyncedBlockReferenceToClipboard)(api)
53
53
  }, hoverDecorationProps(nodeType, _consts.akEditorSelectedNodeClassName));
54
54
  items.push(copyButton);
55
+ var disabled = !syncBlockStore.getSyncBlockURL(syncBlockObject.node.attrs.resourceId);
55
56
  if (!syncBlockStore.isSourceBlock(syncBlockObject.node)) {
56
57
  var editSourceButton = _objectSpread({
57
58
  id: 'editor.syncedBlock.editSource',
58
59
  type: 'button',
59
- disabled: !syncBlockStore.getSyncBlockURL(syncBlockObject.node.attrs.resourceId),
60
+ disabled: disabled,
60
61
  appearance: 'subtle',
61
62
  icon: _linkExternal.default,
62
63
  title: formatMessage(_messages.syncBlockMessages.editSourceLabel),
63
64
  showTitle: true,
64
- tooltipContent: formatMessage(_messages.syncBlockMessages.editSourceTooltip),
65
+ tooltipContent: disabled ? formatMessage(_messages.syncBlockMessages.editSourceTooltipDisabled) : formatMessage(_messages.syncBlockMessages.editSourceTooltip),
65
66
  onClick: (0, _actions.editSyncedBlockSource)(syncBlockStore, api)
66
67
  }, hoverDecorationProps(nodeType, _consts.akEditorSelectedNodeClassName));
67
68
  items.push(editSourceButton);
@@ -37,16 +37,17 @@ export const getToolbarConfig = (state, intl, _options = {}, _providerFactory, a
37
37
  ...hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)
38
38
  };
39
39
  items.push(copyButton);
40
+ const disabled = !syncBlockStore.getSyncBlockURL(syncBlockObject.node.attrs.resourceId);
40
41
  if (!syncBlockStore.isSourceBlock(syncBlockObject.node)) {
41
42
  const editSourceButton = {
42
43
  id: 'editor.syncedBlock.editSource',
43
44
  type: 'button',
44
- disabled: !syncBlockStore.getSyncBlockURL(syncBlockObject.node.attrs.resourceId),
45
+ disabled,
45
46
  appearance: 'subtle',
46
47
  icon: LinkExternalIcon,
47
48
  title: formatMessage(messages.editSourceLabel),
48
49
  showTitle: true,
49
- tooltipContent: formatMessage(messages.editSourceTooltip),
50
+ tooltipContent: disabled ? formatMessage(messages.editSourceTooltipDisabled) : formatMessage(messages.editSourceTooltip),
50
51
  onClick: editSyncedBlockSource(syncBlockStore, api),
51
52
  ...hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)
52
53
  };
@@ -43,16 +43,17 @@ export var getToolbarConfig = function getToolbarConfig(state, intl) {
43
43
  onClick: copySyncedBlockReferenceToClipboard(api)
44
44
  }, hoverDecorationProps(nodeType, akEditorSelectedNodeClassName));
45
45
  items.push(copyButton);
46
+ var disabled = !syncBlockStore.getSyncBlockURL(syncBlockObject.node.attrs.resourceId);
46
47
  if (!syncBlockStore.isSourceBlock(syncBlockObject.node)) {
47
48
  var editSourceButton = _objectSpread({
48
49
  id: 'editor.syncedBlock.editSource',
49
50
  type: 'button',
50
- disabled: !syncBlockStore.getSyncBlockURL(syncBlockObject.node.attrs.resourceId),
51
+ disabled: disabled,
51
52
  appearance: 'subtle',
52
53
  icon: LinkExternalIcon,
53
54
  title: formatMessage(messages.editSourceLabel),
54
55
  showTitle: true,
55
- tooltipContent: formatMessage(messages.editSourceTooltip),
56
+ tooltipContent: disabled ? formatMessage(messages.editSourceTooltipDisabled) : formatMessage(messages.editSourceTooltip),
56
57
  onClick: editSyncedBlockSource(syncBlockStore, api)
57
58
  }, hoverDecorationProps(nodeType, akEditorSelectedNodeClassName));
58
59
  items.push(editSourceButton);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,7 +29,7 @@
29
29
  "atlaskit:src": "src/index.ts",
30
30
  "dependencies": {
31
31
  "@atlaskit/adf-schema": "^51.2.0",
32
- "@atlaskit/button": "23.5.1",
32
+ "@atlaskit/button": "23.5.2",
33
33
  "@atlaskit/editor-json-transformer": "^8.30.0",
34
34
  "@atlaskit/editor-plugin-analytics": "^6.1.0",
35
35
  "@atlaskit/editor-plugin-block-menu": "^4.0.0",
@@ -38,10 +38,10 @@
38
38
  "@atlaskit/editor-plugin-selection": "^6.1.0",
39
39
  "@atlaskit/editor-prosemirror": "7.0.0",
40
40
  "@atlaskit/editor-shared-styles": "^3.7.0",
41
- "@atlaskit/editor-synced-block-provider": "^0.6.0",
41
+ "@atlaskit/editor-synced-block-provider": "^0.7.0",
42
42
  "@atlaskit/editor-tables": "^2.9.0",
43
43
  "@atlaskit/editor-toolbar": "^0.15.0",
44
- "@atlaskit/icon": "28.5.1",
44
+ "@atlaskit/icon": "28.5.2",
45
45
  "@atlaskit/modal-dialog": "^14.5.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "react-intl-next": "npm:react-intl@^5.18.1"