@atlaskit/editor-plugin-card 2.0.2 → 2.0.3
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 +8 -0
- package/dist/cjs/ui/LeftIconOverlay/ConfigureLinkDropdown/index.js +58 -0
- package/dist/es2019/ui/LeftIconOverlay/ConfigureLinkDropdown/index.js +47 -0
- package/dist/esm/ui/LeftIconOverlay/ConfigureLinkDropdown/index.js +48 -0
- package/dist/types/ui/LeftIconOverlay/ConfigureLinkDropdown/index.d.ts +6 -0
- package/dist/types-ts4.5/ui/LeftIconOverlay/ConfigureLinkDropdown/index.d.ts +6 -0
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 2.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#108480](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108480)
|
|
8
|
+
[`8552b1dc7f80d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8552b1dc7f80d) -
|
|
9
|
+
Creating new dropdown component for configuring links
|
|
10
|
+
|
|
3
11
|
## 2.0.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _reactIntlNext = require("react-intl-next");
|
|
13
|
+
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
14
|
+
var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
|
|
15
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
16
|
+
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
17
|
+
var _preferences = _interopRequireDefault(require("@atlaskit/icon/glyph/preferences"));
|
|
18
|
+
var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"));
|
|
19
|
+
var _excluded = ["triggerRef"];
|
|
20
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
21
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
|
+
var ConfigureLinkDropdown = function ConfigureLinkDropdown(props) {
|
|
23
|
+
var testId = props.testId;
|
|
24
|
+
var intl = (0, _reactIntlNext.useIntl)();
|
|
25
|
+
var configureLinkLabel = intl.formatMessage(_messages.cardMessages.inlineConfigureLink);
|
|
26
|
+
var goToLinkLabel = intl.formatMessage(_messages.cardMessages.inlineConfigureLink);
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_dropdownMenu.default, {
|
|
28
|
+
trigger: function trigger(_ref) {
|
|
29
|
+
var triggerRef = _ref.triggerRef,
|
|
30
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(_new.default, (0, _extends2.default)({}, props, {
|
|
32
|
+
spacing: "none",
|
|
33
|
+
ref: triggerRef
|
|
34
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
35
|
+
style: {
|
|
36
|
+
padding: "0 ".concat("var(--ds-space-025, 2px)")
|
|
37
|
+
}
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement(_chevronDown.default, {
|
|
39
|
+
label: configureLinkLabel,
|
|
40
|
+
size: 'small',
|
|
41
|
+
testId: "".concat(testId, "-icon")
|
|
42
|
+
})));
|
|
43
|
+
},
|
|
44
|
+
spacing: "compact",
|
|
45
|
+
placement: "bottom-start"
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItemGroup, null, /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, {
|
|
47
|
+
elemBefore: /*#__PURE__*/_react.default.createElement(_shortcut.default, {
|
|
48
|
+
label: goToLinkLabel,
|
|
49
|
+
size: "small"
|
|
50
|
+
})
|
|
51
|
+
}, goToLinkLabel), /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, {
|
|
52
|
+
elemBefore: /*#__PURE__*/_react.default.createElement(_preferences.default, {
|
|
53
|
+
label: configureLinkLabel,
|
|
54
|
+
size: "small"
|
|
55
|
+
})
|
|
56
|
+
}, configureLinkLabel)));
|
|
57
|
+
};
|
|
58
|
+
var _default = exports.default = ConfigureLinkDropdown;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useIntl } from "react-intl-next";
|
|
4
|
+
import Button from "@atlaskit/button/new";
|
|
5
|
+
import DropdownMenu, { DropdownItem, DropdownItemGroup } from "@atlaskit/dropdown-menu";
|
|
6
|
+
import { cardMessages as messages } from "@atlaskit/editor-common/messages";
|
|
7
|
+
import ChevronDownIcon from "@atlaskit/icon/glyph/chevron-down";
|
|
8
|
+
import PreferencesIcon from "@atlaskit/icon/glyph/preferences";
|
|
9
|
+
import ShortcutIcon from "@atlaskit/icon/glyph/shortcut";
|
|
10
|
+
const ConfigureLinkDropdown = props => {
|
|
11
|
+
const {
|
|
12
|
+
testId
|
|
13
|
+
} = props;
|
|
14
|
+
const intl = useIntl();
|
|
15
|
+
const configureLinkLabel = intl.formatMessage(messages.inlineConfigureLink);
|
|
16
|
+
const goToLinkLabel = intl.formatMessage(messages.inlineConfigureLink);
|
|
17
|
+
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
18
|
+
trigger: ({
|
|
19
|
+
triggerRef,
|
|
20
|
+
...props
|
|
21
|
+
}) => /*#__PURE__*/React.createElement(Button, _extends({}, props, {
|
|
22
|
+
spacing: "none",
|
|
23
|
+
ref: triggerRef
|
|
24
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
25
|
+
style: {
|
|
26
|
+
padding: `0 ${"var(--ds-space-025, 2px)"}`
|
|
27
|
+
}
|
|
28
|
+
}, /*#__PURE__*/React.createElement(ChevronDownIcon, {
|
|
29
|
+
label: configureLinkLabel,
|
|
30
|
+
size: 'small',
|
|
31
|
+
testId: `${testId}-icon`
|
|
32
|
+
}))),
|
|
33
|
+
spacing: "compact",
|
|
34
|
+
placement: "bottom-start"
|
|
35
|
+
}, /*#__PURE__*/React.createElement(DropdownItemGroup, null, /*#__PURE__*/React.createElement(DropdownItem, {
|
|
36
|
+
elemBefore: /*#__PURE__*/React.createElement(ShortcutIcon, {
|
|
37
|
+
label: goToLinkLabel,
|
|
38
|
+
size: "small"
|
|
39
|
+
})
|
|
40
|
+
}, goToLinkLabel), /*#__PURE__*/React.createElement(DropdownItem, {
|
|
41
|
+
elemBefore: /*#__PURE__*/React.createElement(PreferencesIcon, {
|
|
42
|
+
label: configureLinkLabel,
|
|
43
|
+
size: "small"
|
|
44
|
+
})
|
|
45
|
+
}, configureLinkLabel)));
|
|
46
|
+
};
|
|
47
|
+
export default ConfigureLinkDropdown;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["triggerRef"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { useIntl } from "react-intl-next";
|
|
6
|
+
import Button from "@atlaskit/button/new";
|
|
7
|
+
import DropdownMenu, { DropdownItem, DropdownItemGroup } from "@atlaskit/dropdown-menu";
|
|
8
|
+
import { cardMessages as messages } from "@atlaskit/editor-common/messages";
|
|
9
|
+
import ChevronDownIcon from "@atlaskit/icon/glyph/chevron-down";
|
|
10
|
+
import PreferencesIcon from "@atlaskit/icon/glyph/preferences";
|
|
11
|
+
import ShortcutIcon from "@atlaskit/icon/glyph/shortcut";
|
|
12
|
+
var ConfigureLinkDropdown = function ConfigureLinkDropdown(props) {
|
|
13
|
+
var testId = props.testId;
|
|
14
|
+
var intl = useIntl();
|
|
15
|
+
var configureLinkLabel = intl.formatMessage(messages.inlineConfigureLink);
|
|
16
|
+
var goToLinkLabel = intl.formatMessage(messages.inlineConfigureLink);
|
|
17
|
+
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
18
|
+
trigger: function trigger(_ref) {
|
|
19
|
+
var triggerRef = _ref.triggerRef,
|
|
20
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
return /*#__PURE__*/React.createElement(Button, _extends({}, props, {
|
|
22
|
+
spacing: "none",
|
|
23
|
+
ref: triggerRef
|
|
24
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
25
|
+
style: {
|
|
26
|
+
padding: "0 ".concat("var(--ds-space-025, 2px)")
|
|
27
|
+
}
|
|
28
|
+
}, /*#__PURE__*/React.createElement(ChevronDownIcon, {
|
|
29
|
+
label: configureLinkLabel,
|
|
30
|
+
size: 'small',
|
|
31
|
+
testId: "".concat(testId, "-icon")
|
|
32
|
+
})));
|
|
33
|
+
},
|
|
34
|
+
spacing: "compact",
|
|
35
|
+
placement: "bottom-start"
|
|
36
|
+
}, /*#__PURE__*/React.createElement(DropdownItemGroup, null, /*#__PURE__*/React.createElement(DropdownItem, {
|
|
37
|
+
elemBefore: /*#__PURE__*/React.createElement(ShortcutIcon, {
|
|
38
|
+
label: goToLinkLabel,
|
|
39
|
+
size: "small"
|
|
40
|
+
})
|
|
41
|
+
}, goToLinkLabel), /*#__PURE__*/React.createElement(DropdownItem, {
|
|
42
|
+
elemBefore: /*#__PURE__*/React.createElement(PreferencesIcon, {
|
|
43
|
+
label: configureLinkLabel,
|
|
44
|
+
size: "small"
|
|
45
|
+
})
|
|
46
|
+
}, configureLinkLabel)));
|
|
47
|
+
};
|
|
48
|
+
export default ConfigureLinkDropdown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,7 +34,9 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^36.10.7",
|
|
36
36
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
37
|
+
"@atlaskit/button": "^17.17.1",
|
|
37
38
|
"@atlaskit/custom-steps": "^0.2.0",
|
|
39
|
+
"@atlaskit/dropdown-menu": "^12.10.2",
|
|
38
40
|
"@atlaskit/editor-common": "^82.1.0",
|
|
39
41
|
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
|
40
42
|
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|