@atlaskit/editor-common 82.5.0 → 82.7.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 +35 -0
- package/dist/cjs/keymaps/keymap.js +46 -13
- package/dist/cjs/link/ConfigureLinkOverlay/OverlayButton.js +87 -0
- package/dist/cjs/link/index.js +7 -0
- package/dist/cjs/link/types.js +1 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui-color/ColorPalette/Color/index.js +2 -2
- package/dist/cjs/ui-color/ColorPalette/Palettes/highlightColorPalette.js +9 -3
- package/dist/cjs/ui-color/ColorPalette/Palettes/textColorPalette.js +10 -1
- package/dist/cjs/ui-color/index.js +12 -0
- package/dist/es2019/keymaps/keymap.js +46 -13
- package/dist/es2019/link/ConfigureLinkOverlay/OverlayButton.js +80 -0
- package/dist/es2019/link/index.js +2 -1
- package/dist/es2019/link/types.js +1 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui-color/ColorPalette/Color/index.js +2 -2
- package/dist/es2019/ui-color/ColorPalette/Palettes/highlightColorPalette.js +5 -1
- package/dist/es2019/ui-color/ColorPalette/Palettes/textColorPalette.js +6 -1
- package/dist/es2019/ui-color/index.js +2 -2
- package/dist/esm/keymaps/keymap.js +46 -13
- package/dist/esm/link/ConfigureLinkOverlay/OverlayButton.js +79 -0
- package/dist/esm/link/index.js +2 -1
- package/dist/esm/link/types.js +1 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui-color/ColorPalette/Color/index.js +2 -2
- package/dist/esm/ui-color/ColorPalette/Palettes/highlightColorPalette.js +8 -0
- package/dist/esm/ui-color/ColorPalette/Palettes/textColorPalette.js +9 -0
- package/dist/esm/ui-color/index.js +2 -2
- package/dist/types/link/ConfigureLinkOverlay/OverlayButton.d.ts +8 -0
- package/dist/types/link/index.d.ts +2 -0
- package/dist/types/link/types.d.ts +5 -1
- package/dist/types/types/annotation/index.d.ts +2 -0
- package/dist/types/types/feature-flags.d.ts +8 -0
- package/dist/types/ui-color/ColorPalette/Palettes/highlightColorPalette.d.ts +1 -0
- package/dist/types/ui-color/ColorPalette/Palettes/textColorPalette.d.ts +2 -0
- package/dist/types/ui-color/index.d.ts +2 -2
- package/dist/types-ts4.5/link/ConfigureLinkOverlay/OverlayButton.d.ts +8 -0
- package/dist/types-ts4.5/link/index.d.ts +2 -0
- package/dist/types-ts4.5/link/types.d.ts +5 -1
- package/dist/types-ts4.5/types/annotation/index.d.ts +2 -0
- package/dist/types-ts4.5/types/feature-flags.d.ts +8 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/highlightColorPalette.d.ts +1 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/textColorPalette.d.ts +2 -0
- package/dist/types-ts4.5/ui-color/index.d.ts +2 -2
- package/package.json +269 -263
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { base, keyName } from 'w3c-keyname';
|
|
2
2
|
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
3
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { SafePlugin } from '../safe-plugin';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -13,20 +14,52 @@ export function keymap(bindings) {
|
|
|
13
14
|
return new SafePlugin({
|
|
14
15
|
props: {
|
|
15
16
|
handleKeyDown: function handleKeyDown(view, event) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
if (getBooleanFF('platform.editor.text-alignment-keyboard-shortcuts')) {
|
|
18
|
+
var name = keyName(event);
|
|
19
|
+
var keyboardEvent = event;
|
|
20
|
+
|
|
21
|
+
// We will try to bypass the keycode only if any of mod keys are pressed,
|
|
22
|
+
// to allow users to use non-latin and Dead characters.
|
|
23
|
+
var isModKeyPressed = event.ctrlKey || event.metaKey;
|
|
24
|
+
|
|
25
|
+
// Check the unicode of the character to assert that it's not an ASCII character.
|
|
26
|
+
// These are characters outside latin's range.
|
|
27
|
+
var isNonLatinKey = name.length === 1 && /[^\u0000-\u007f]/.test(name);
|
|
28
|
+
|
|
29
|
+
// The `Dead` key is a key that combines with a following key to produce a combined character.
|
|
30
|
+
// It will have `even.key === 'Dead'` in some browsers but the `keyCode` will be the same as in a qwerty-keyboard.
|
|
31
|
+
// See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key and https://en.wikipedia.org/wiki/Dead_key
|
|
32
|
+
var isDeadKey = name === 'Dead';
|
|
33
|
+
if (isModKeyPressed && (isNonLatinKey || isDeadKey)) {
|
|
34
|
+
keyboardEvent = new KeyboardEvent(event.type, {
|
|
35
|
+
// FIXME: The event.keyCode is deprecated (see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode),
|
|
36
|
+
// and could be removed in any time, but the w3c-keyname library doesn't provide a way to get
|
|
37
|
+
// a key by event.code.
|
|
38
|
+
key: base[event.keyCode],
|
|
39
|
+
code: event.code,
|
|
40
|
+
ctrlKey: event.ctrlKey,
|
|
41
|
+
altKey: event.altKey,
|
|
42
|
+
metaKey: event.metaKey,
|
|
43
|
+
shiftKey: event.shiftKey
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return keydownHandler(bindings)(view, keyboardEvent);
|
|
47
|
+
} else {
|
|
48
|
+
var _name = keyName(event);
|
|
49
|
+
var _keyboardEvent = event;
|
|
50
|
+
if (event.ctrlKey && _name.length === 1 &&
|
|
51
|
+
// Check the unicode of the character to
|
|
52
|
+
// assert that its not an ASCII character.
|
|
53
|
+
// These are characters outside Latin's range.
|
|
54
|
+
/[^\u0000-\u007f]/.test(_name)) {
|
|
55
|
+
_keyboardEvent = new KeyboardEvent('keydown', {
|
|
56
|
+
key: base[event.keyCode],
|
|
57
|
+
code: event.code,
|
|
58
|
+
ctrlKey: true
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return keydownHandler(bindings)(view, _keyboardEvent);
|
|
28
62
|
}
|
|
29
|
-
return keydownHandler(bindings)(view, keyboardEvent);
|
|
30
63
|
}
|
|
31
64
|
}
|
|
32
65
|
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
|
+
import { useIntl } from 'react-intl-next';
|
|
5
|
+
import Button from '@atlaskit/button';
|
|
6
|
+
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
+
import PreferencesIcon from '@atlaskit/icon/glyph/preferences';
|
|
8
|
+
import { N0, N30A, N40A, N60A, N700 } from '@atlaskit/theme/colors';
|
|
9
|
+
import { layers } from '@atlaskit/theme/constants';
|
|
10
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
11
|
+
import { cardMessages } from '../../messages';
|
|
12
|
+
var buttonStyles = css({
|
|
13
|
+
background: "var(--ds-background-neutral, ".concat(N30A, ")"),
|
|
14
|
+
color: "var(--ds-icon, ".concat(N700, ")"),
|
|
15
|
+
'&:hover': {
|
|
16
|
+
background: "var(--ds-background-neutral-hovered, ".concat(N40A, ")")
|
|
17
|
+
},
|
|
18
|
+
'&:active': {
|
|
19
|
+
background: "var(--ds-background-neutral-pressed, ".concat(N60A, ")")
|
|
20
|
+
},
|
|
21
|
+
width: '1.375rem',
|
|
22
|
+
height: '1.25rem'
|
|
23
|
+
});
|
|
24
|
+
var buttonWrapperStyles = css({
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
zIndex: layers.card(),
|
|
27
|
+
display: 'inline-flex',
|
|
28
|
+
top: '50%',
|
|
29
|
+
transform: 'translateY(-50%)',
|
|
30
|
+
background: "var(--ds-surface-raised, ".concat(N0, ")")
|
|
31
|
+
});
|
|
32
|
+
export var OverlayButton = function OverlayButton(_ref) {
|
|
33
|
+
var _docNode$nodeSize;
|
|
34
|
+
var editorView = _ref.editorView,
|
|
35
|
+
_ref$testId = _ref.testId,
|
|
36
|
+
testId = _ref$testId === void 0 ? 'link-configure-overlay-button' : _ref$testId,
|
|
37
|
+
_ref$targetElementPos = _ref.targetElementPos,
|
|
38
|
+
targetElementPos = _ref$targetElementPos === void 0 ? 0 : _ref$targetElementPos;
|
|
39
|
+
var _useIntl = useIntl(),
|
|
40
|
+
formatMessage = _useIntl.formatMessage;
|
|
41
|
+
var docNode = editorView.state.doc.nodeAt(targetElementPos);
|
|
42
|
+
var nodeEnd = targetElementPos + ((_docNode$nodeSize = docNode === null || docNode === void 0 ? void 0 : docNode.nodeSize) !== null && _docNode$nodeSize !== void 0 ? _docNode$nodeSize : 0);
|
|
43
|
+
var isText = docNode === null || docNode === void 0 ? void 0 : docNode.isText;
|
|
44
|
+
var handleClick = useCallback(function () {
|
|
45
|
+
var tr = editorView.state.tr;
|
|
46
|
+
if (isText) {
|
|
47
|
+
tr.setSelection(TextSelection.create(tr.doc, targetElementPos, Math.min(nodeEnd, tr.doc.nodeSize)));
|
|
48
|
+
} else {
|
|
49
|
+
tr.setSelection(NodeSelection.create(tr.doc, targetElementPos));
|
|
50
|
+
}
|
|
51
|
+
editorView.dispatch(tr);
|
|
52
|
+
}, [isText, editorView, nodeEnd, targetElementPos]);
|
|
53
|
+
var _editorView$state$sel = editorView.state.selection,
|
|
54
|
+
from = _editorView$state$sel.from,
|
|
55
|
+
to = _editorView$state$sel.to;
|
|
56
|
+
var isSelected = from === targetElementPos && to === nodeEnd;
|
|
57
|
+
if (!targetElementPos || isSelected) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
var configureLinkLabel = formatMessage(cardMessages.inlineConfigureLink);
|
|
61
|
+
return jsx("span", {
|
|
62
|
+
css: buttonWrapperStyles
|
|
63
|
+
}, jsx(Tooltip, {
|
|
64
|
+
content: configureLinkLabel,
|
|
65
|
+
hideTooltipOnClick: true,
|
|
66
|
+
testId: "".concat(testId, "-tooltip")
|
|
67
|
+
}, jsx(Button, {
|
|
68
|
+
testId: testId
|
|
69
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
|
|
70
|
+
,
|
|
71
|
+
css: buttonStyles,
|
|
72
|
+
onClick: handleClick,
|
|
73
|
+
iconBefore: jsx(PreferencesIcon, {
|
|
74
|
+
label: configureLinkLabel,
|
|
75
|
+
size: "small",
|
|
76
|
+
testId: "".concat(testId, "-configure-icon")
|
|
77
|
+
})
|
|
78
|
+
})));
|
|
79
|
+
};
|
package/dist/esm/link/index.js
CHANGED
|
@@ -9,4 +9,5 @@ export { HyperlinkAddToolbar } from './LinkPicker/HyperlinkAddToolbar';
|
|
|
9
9
|
export { default as HyperlinkLinkAddToolbar, HyperlinkLinkAddToolbarWithIntl, RECENT_SEARCH_LIST_SIZE } from './LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar';
|
|
10
10
|
export { sha1 } from './LinkPicker/HyperlinkAddToolbar/utils';
|
|
11
11
|
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV } from './utils';
|
|
12
|
-
export { stagingLinkPreferencesUrl, productionLinkPreferencesUrl } from './constants';
|
|
12
|
+
export { stagingLinkPreferencesUrl, productionLinkPreferencesUrl } from './constants';
|
|
13
|
+
export { OverlayButton } from './ConfigureLinkOverlay/OverlayButton';
|
package/dist/esm/link/types.js
CHANGED
|
@@ -4,6 +4,7 @@ export var LinkAction = /*#__PURE__*/function (LinkAction) {
|
|
|
4
4
|
LinkAction["SELECTION_CHANGE"] = "SELECTION_CHANGE";
|
|
5
5
|
LinkAction["INSERT_LINK_TOOLBAR"] = "INSERT";
|
|
6
6
|
LinkAction["EDIT_INSERTED_TOOLBAR"] = "EDIT_INSERTED_TOOLBAR";
|
|
7
|
+
LinkAction["SET_CONFIGURE_BUTTON_TARGET_POS"] = "SET_CONFIGURE_BUTTON_TARGET_POS";
|
|
7
8
|
return LinkAction;
|
|
8
9
|
}({});
|
|
9
10
|
export var InsertStatus = /*#__PURE__*/function (InsertStatus) {
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "82.
|
|
10
|
+
var packageVersion = "82.7.0";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -15,7 +15,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
15
15
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
16
16
|
import Layer from '../Layer';
|
|
17
17
|
var packageName = "@atlaskit/editor-common";
|
|
18
|
-
var packageVersion = "82.
|
|
18
|
+
var packageVersion = "82.7.0";
|
|
19
19
|
var halfFocusRing = 1;
|
|
20
20
|
var dropOffset = '0, 8';
|
|
21
21
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -54,7 +54,7 @@ function FunctionalComponentColor(props) {
|
|
|
54
54
|
,
|
|
55
55
|
className: "".concat(isSelected ? 'selected' : ''),
|
|
56
56
|
style: {
|
|
57
|
-
backgroundColor: colorStyle || 'transparent',
|
|
57
|
+
backgroundColor: colorStyle || (getBooleanFF('platform.editor.dynamic-palette-borders') ? "var(--ds-background-input, #FFFFFF)" : 'transparent'),
|
|
58
58
|
border: "1px solid ".concat(borderColor)
|
|
59
59
|
},
|
|
60
60
|
autoFocus: autoFocus
|
|
@@ -119,7 +119,7 @@ var ClassComponentColor = /*#__PURE__*/function (_PureComponent) {
|
|
|
119
119
|
,
|
|
120
120
|
className: "".concat(isSelected ? 'selected' : ''),
|
|
121
121
|
style: {
|
|
122
|
-
backgroundColor: colorStyle || 'transparent',
|
|
122
|
+
backgroundColor: colorStyle || (getBooleanFF('platform.editor.dynamic-palette-borders') ? "var(--ds-background-input, #FFFFFF)" : 'transparent'),
|
|
123
123
|
border: "1px solid ".concat(borderColor)
|
|
124
124
|
},
|
|
125
125
|
autoFocus: autoFocus
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
|
|
3
6
|
import { jsx } from '@emotion/react';
|
|
@@ -49,4 +52,9 @@ export var highlightColorPalette = [{
|
|
|
49
52
|
}];
|
|
50
53
|
backgroundColorPalette.forEach(function (label, color) {
|
|
51
54
|
highlightColorPalette.push(mapPaletteColor(label, color));
|
|
55
|
+
});
|
|
56
|
+
export var highlightColorPaletteWithTokenBorders = highlightColorPalette.map(function (paletteColor) {
|
|
57
|
+
return _objectSpread(_objectSpread({}, paletteColor), {}, {
|
|
58
|
+
border: "var(--ds-border, #091E4224)"
|
|
59
|
+
});
|
|
52
60
|
});
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1
4
|
import { colorPalette } from '@atlaskit/adf-schema';
|
|
2
5
|
import { DEFAULT_BORDER_COLOR } from './common';
|
|
3
6
|
import getColorMessage from './getColorMessage';
|
|
@@ -15,6 +18,12 @@ export var mapPaletteColor = function mapPaletteColor(label, color) {
|
|
|
15
18
|
|
|
16
19
|
// row 1
|
|
17
20
|
export var textColorPalette = [];
|
|
21
|
+
export var textColorPaletteTokenBorders = [];
|
|
18
22
|
colorPalette.forEach(function (label, color) {
|
|
19
23
|
textColorPalette.push(mapPaletteColor(label, color));
|
|
24
|
+
});
|
|
25
|
+
export var textColorPaletteWithTokenBorders = textColorPalette.map(function (paletteColor) {
|
|
26
|
+
return _objectSpread(_objectSpread({}, paletteColor), {}, {
|
|
27
|
+
border: "var(--ds-border, #091E4224)"
|
|
28
|
+
});
|
|
20
29
|
});
|
|
@@ -5,8 +5,8 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
|
|
|
5
5
|
export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
|
|
6
6
|
export { panelBackgroundPalette, panelDarkModeBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
|
|
7
7
|
export { lightModeStatusColorPalette, darkModeStatusColorPalette } from './ColorPalette/Palettes/statusColorPalette';
|
|
8
|
-
export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
|
|
9
|
-
export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/highlightColorPalette';
|
|
8
|
+
export { textColorPalette, textColorPaletteWithTokenBorders } from './ColorPalette/Palettes/textColorPalette';
|
|
9
|
+
export { highlightColorPalette, highlightColorPaletteWithTokenBorders, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/highlightColorPalette';
|
|
10
10
|
export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages } from './ColorPalette/Palettes';
|
|
11
11
|
export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
|
|
12
12
|
export { default as borderColorPalette } from './ColorPalette/Palettes/borderColorPalette';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
export interface OverlayButtonProps {
|
|
4
|
+
editorView: EditorView;
|
|
5
|
+
testId?: string;
|
|
6
|
+
targetElementPos?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const OverlayButton: ({ editorView, testId, targetElementPos, }: OverlayButtonProps) => jsx.JSX.Element | null;
|
|
@@ -15,3 +15,5 @@ export type { HyperlinkAddToolbarProps } from './LinkPicker/HyperlinkAddToolbar'
|
|
|
15
15
|
export { sha1 } from './LinkPicker/HyperlinkAddToolbar/utils';
|
|
16
16
|
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV } from './utils';
|
|
17
17
|
export { stagingLinkPreferencesUrl, productionLinkPreferencesUrl } from './constants';
|
|
18
|
+
export { OverlayButton } from './ConfigureLinkOverlay/OverlayButton';
|
|
19
|
+
export type { OverlayButtonProps } from './ConfigureLinkOverlay/OverlayButton';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { type DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
2
3
|
import { type INPUT_METHOD } from '../analytics';
|
|
3
4
|
import type { EditorAppearance } from '../types';
|
|
4
5
|
export declare enum LinkAction {
|
|
@@ -6,7 +7,8 @@ export declare enum LinkAction {
|
|
|
6
7
|
HIDE_TOOLBAR = "HIDE_TOOLBAR",
|
|
7
8
|
SELECTION_CHANGE = "SELECTION_CHANGE",
|
|
8
9
|
INSERT_LINK_TOOLBAR = "INSERT",
|
|
9
|
-
EDIT_INSERTED_TOOLBAR = "EDIT_INSERTED_TOOLBAR"
|
|
10
|
+
EDIT_INSERTED_TOOLBAR = "EDIT_INSERTED_TOOLBAR",
|
|
11
|
+
SET_CONFIGURE_BUTTON_TARGET_POS = "SET_CONFIGURE_BUTTON_TARGET_POS"
|
|
10
12
|
}
|
|
11
13
|
export declare enum InsertStatus {
|
|
12
14
|
EDIT_LINK_TOOLBAR = "EDIT",
|
|
@@ -37,4 +39,6 @@ export interface HyperlinkState {
|
|
|
37
39
|
searchSessionId?: string;
|
|
38
40
|
inputMethod?: INPUT_METHOD;
|
|
39
41
|
editorAppearance?: EditorAppearance;
|
|
42
|
+
configureButtonTargetPos?: number;
|
|
43
|
+
decorations?: DecorationSet;
|
|
40
44
|
}
|
|
@@ -19,6 +19,8 @@ type ActionResult = {
|
|
|
19
19
|
export type AnnotationActionResult = ({
|
|
20
20
|
step: Step;
|
|
21
21
|
doc: JSONDocNode;
|
|
22
|
+
/** The list of types of all inline nodes, which were wrapped by annotation. */
|
|
23
|
+
inlineNodeTypes?: string[];
|
|
22
24
|
targetNodeType?: string;
|
|
23
25
|
} & AnnotationByMatches) | false;
|
|
24
26
|
export type InlineCommentSelectionComponentProps = {
|
|
@@ -293,6 +293,14 @@ export type FeatureFlags = {
|
|
|
293
293
|
* @default false
|
|
294
294
|
*/
|
|
295
295
|
elementDragAndDrop?: boolean;
|
|
296
|
+
/**
|
|
297
|
+
* @description
|
|
298
|
+
* Rearranges the top 5 items in the quick insert menu
|
|
299
|
+
*
|
|
300
|
+
* @see https://product-fabric.atlassian.net/browse/ED-23642
|
|
301
|
+
* @default false
|
|
302
|
+
*/
|
|
303
|
+
platformEditorTypeaheadImprovedRelevancy?: boolean;
|
|
296
304
|
};
|
|
297
305
|
export type FeatureFlagKey = keyof FeatureFlags;
|
|
298
306
|
export type GetEditorFeatureFlags = () => FeatureFlags;
|
|
@@ -4,3 +4,4 @@ import type { PaletteColor } from './type';
|
|
|
4
4
|
export declare const REMOVE_HIGHLIGHT_COLOR = "#00000000";
|
|
5
5
|
export declare const EditorDiagonalLineIcon: () => jsx.JSX.Element;
|
|
6
6
|
export declare const highlightColorPalette: Array<PaletteColor>;
|
|
7
|
+
export declare const highlightColorPaletteWithTokenBorders: Array<PaletteColor>;
|
|
@@ -6,3 +6,5 @@ export declare const mapPaletteColor: (label: string, color: string) => {
|
|
|
6
6
|
message: import("react-intl-next").MessageDescriptor | undefined;
|
|
7
7
|
};
|
|
8
8
|
export declare const textColorPalette: Array<PaletteColor>;
|
|
9
|
+
export declare const textColorPaletteTokenBorders: Array<PaletteColor>;
|
|
10
|
+
export declare const textColorPaletteWithTokenBorders: Array<PaletteColor>;
|
|
@@ -5,8 +5,8 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
|
|
|
5
5
|
export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
|
|
6
6
|
export { panelBackgroundPalette, panelDarkModeBackgroundPalette, } from './ColorPalette/Palettes/panelBackgroundPalette';
|
|
7
7
|
export { lightModeStatusColorPalette, darkModeStatusColorPalette, } from './ColorPalette/Palettes/statusColorPalette';
|
|
8
|
-
export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
|
|
9
|
-
export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
|
|
8
|
+
export { textColorPalette, textColorPaletteWithTokenBorders, } from './ColorPalette/Palettes/textColorPalette';
|
|
9
|
+
export { highlightColorPalette, highlightColorPaletteWithTokenBorders, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
|
|
10
10
|
export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages, } from './ColorPalette/Palettes';
|
|
11
11
|
export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
|
|
12
12
|
export type { PaletteColor, PaletteTooltipMessages } from './ColorPalette/Palettes/type';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
export interface OverlayButtonProps {
|
|
4
|
+
editorView: EditorView;
|
|
5
|
+
testId?: string;
|
|
6
|
+
targetElementPos?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const OverlayButton: ({ editorView, testId, targetElementPos, }: OverlayButtonProps) => jsx.JSX.Element | null;
|
|
@@ -15,3 +15,5 @@ export type { HyperlinkAddToolbarProps } from './LinkPicker/HyperlinkAddToolbar'
|
|
|
15
15
|
export { sha1 } from './LinkPicker/HyperlinkAddToolbar/utils';
|
|
16
16
|
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV } from './utils';
|
|
17
17
|
export { stagingLinkPreferencesUrl, productionLinkPreferencesUrl } from './constants';
|
|
18
|
+
export { OverlayButton } from './ConfigureLinkOverlay/OverlayButton';
|
|
19
|
+
export type { OverlayButtonProps } from './ConfigureLinkOverlay/OverlayButton';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { type DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
2
3
|
import { type INPUT_METHOD } from '../analytics';
|
|
3
4
|
import type { EditorAppearance } from '../types';
|
|
4
5
|
export declare enum LinkAction {
|
|
@@ -6,7 +7,8 @@ export declare enum LinkAction {
|
|
|
6
7
|
HIDE_TOOLBAR = "HIDE_TOOLBAR",
|
|
7
8
|
SELECTION_CHANGE = "SELECTION_CHANGE",
|
|
8
9
|
INSERT_LINK_TOOLBAR = "INSERT",
|
|
9
|
-
EDIT_INSERTED_TOOLBAR = "EDIT_INSERTED_TOOLBAR"
|
|
10
|
+
EDIT_INSERTED_TOOLBAR = "EDIT_INSERTED_TOOLBAR",
|
|
11
|
+
SET_CONFIGURE_BUTTON_TARGET_POS = "SET_CONFIGURE_BUTTON_TARGET_POS"
|
|
10
12
|
}
|
|
11
13
|
export declare enum InsertStatus {
|
|
12
14
|
EDIT_LINK_TOOLBAR = "EDIT",
|
|
@@ -37,4 +39,6 @@ export interface HyperlinkState {
|
|
|
37
39
|
searchSessionId?: string;
|
|
38
40
|
inputMethod?: INPUT_METHOD;
|
|
39
41
|
editorAppearance?: EditorAppearance;
|
|
42
|
+
configureButtonTargetPos?: number;
|
|
43
|
+
decorations?: DecorationSet;
|
|
40
44
|
}
|
|
@@ -19,6 +19,8 @@ type ActionResult = {
|
|
|
19
19
|
export type AnnotationActionResult = ({
|
|
20
20
|
step: Step;
|
|
21
21
|
doc: JSONDocNode;
|
|
22
|
+
/** The list of types of all inline nodes, which were wrapped by annotation. */
|
|
23
|
+
inlineNodeTypes?: string[];
|
|
22
24
|
targetNodeType?: string;
|
|
23
25
|
} & AnnotationByMatches) | false;
|
|
24
26
|
export type InlineCommentSelectionComponentProps = {
|
|
@@ -293,6 +293,14 @@ export type FeatureFlags = {
|
|
|
293
293
|
* @default false
|
|
294
294
|
*/
|
|
295
295
|
elementDragAndDrop?: boolean;
|
|
296
|
+
/**
|
|
297
|
+
* @description
|
|
298
|
+
* Rearranges the top 5 items in the quick insert menu
|
|
299
|
+
*
|
|
300
|
+
* @see https://product-fabric.atlassian.net/browse/ED-23642
|
|
301
|
+
* @default false
|
|
302
|
+
*/
|
|
303
|
+
platformEditorTypeaheadImprovedRelevancy?: boolean;
|
|
296
304
|
};
|
|
297
305
|
export type FeatureFlagKey = keyof FeatureFlags;
|
|
298
306
|
export type GetEditorFeatureFlags = () => FeatureFlags;
|
|
@@ -4,3 +4,4 @@ import type { PaletteColor } from './type';
|
|
|
4
4
|
export declare const REMOVE_HIGHLIGHT_COLOR = "#00000000";
|
|
5
5
|
export declare const EditorDiagonalLineIcon: () => jsx.JSX.Element;
|
|
6
6
|
export declare const highlightColorPalette: Array<PaletteColor>;
|
|
7
|
+
export declare const highlightColorPaletteWithTokenBorders: Array<PaletteColor>;
|
|
@@ -6,3 +6,5 @@ export declare const mapPaletteColor: (label: string, color: string) => {
|
|
|
6
6
|
message: import("react-intl-next").MessageDescriptor | undefined;
|
|
7
7
|
};
|
|
8
8
|
export declare const textColorPalette: Array<PaletteColor>;
|
|
9
|
+
export declare const textColorPaletteTokenBorders: Array<PaletteColor>;
|
|
10
|
+
export declare const textColorPaletteWithTokenBorders: Array<PaletteColor>;
|
|
@@ -5,8 +5,8 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
|
|
|
5
5
|
export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
|
|
6
6
|
export { panelBackgroundPalette, panelDarkModeBackgroundPalette, } from './ColorPalette/Palettes/panelBackgroundPalette';
|
|
7
7
|
export { lightModeStatusColorPalette, darkModeStatusColorPalette, } from './ColorPalette/Palettes/statusColorPalette';
|
|
8
|
-
export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
|
|
9
|
-
export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
|
|
8
|
+
export { textColorPalette, textColorPaletteWithTokenBorders, } from './ColorPalette/Palettes/textColorPalette';
|
|
9
|
+
export { highlightColorPalette, highlightColorPaletteWithTokenBorders, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
|
|
10
10
|
export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages, } from './ColorPalette/Palettes';
|
|
11
11
|
export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
|
|
12
12
|
export type { PaletteColor, PaletteTooltipMessages } from './ColorPalette/Palettes/type';
|