@atlaskit/editor-common 62.1.0 → 64.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 +102 -0
- package/dist/cjs/extensions/manifest-helpers.js +2 -2
- package/dist/cjs/extensions/module-helpers.js +2 -2
- package/dist/cjs/icons/index.js +45 -0
- package/dist/cjs/icons/shared/PanelErrorIcon.js +37 -0
- package/dist/cjs/icons/shared/PanelInfoIcon.js +37 -0
- package/dist/cjs/icons/shared/PanelNoteIcon.js +37 -0
- package/dist/cjs/icons/shared/PanelSuccessIcon.js +37 -0
- package/dist/cjs/icons/shared/PanelWarningIcon.js +37 -0
- package/dist/cjs/index.js +1 -945
- package/dist/cjs/provider-factory/with-providers.js +2 -2
- package/dist/cjs/safe-plugin/index.js +42 -0
- package/dist/cjs/styles/index.js +12 -24
- package/dist/cjs/styles/shared/block-marks.js +1 -1
- package/dist/cjs/styles/shared/lists.js +3 -1
- package/dist/cjs/styles/shared/panel.js +26 -8
- package/dist/cjs/styles/shared/table.js +2 -1
- package/dist/cjs/types/collab.js +5 -0
- package/dist/cjs/ui/LegacyToNextIntlProvider/index.js +2 -2
- package/dist/cjs/ui/MediaSingle/index.js +3 -1
- package/dist/cjs/ui/Mention/index.js +1 -3
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +33 -194
- package/dist/cjs/ui/Mention/mention-with-providers.js +1 -5
- package/dist/cjs/ui/Popup/index.js +4 -4
- package/dist/cjs/ui/Popup/utils.js +2 -2
- package/dist/cjs/ui/index.js +0 -16
- package/dist/cjs/utils/browser.js +1 -1
- package/dist/cjs/utils/profiler/render-count.js +2 -2
- package/dist/cjs/utils/track-unsupported-content.js +2 -2
- package/dist/cjs/utils/validator.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/icons/index.js +5 -0
- package/dist/es2019/icons/shared/PanelErrorIcon.js +24 -0
- package/dist/es2019/icons/shared/PanelInfoIcon.js +24 -0
- package/dist/es2019/icons/shared/PanelNoteIcon.js +24 -0
- package/dist/es2019/icons/shared/PanelSuccessIcon.js +24 -0
- package/dist/es2019/icons/shared/PanelWarningIcon.js +24 -0
- package/dist/es2019/index.js +5 -25
- package/dist/es2019/safe-plugin/index.js +10 -0
- package/dist/es2019/styles/index.js +2 -7
- package/dist/es2019/styles/shared/block-marks.js +2 -1
- package/dist/es2019/styles/shared/lists.js +16 -0
- package/dist/es2019/styles/shared/panel.js +20 -8
- package/dist/es2019/styles/shared/table.js +3 -2
- package/dist/es2019/types/collab.js +1 -0
- package/dist/es2019/ui/MediaSingle/index.js +3 -1
- package/dist/es2019/ui/Mention/index.js +1 -3
- package/dist/es2019/ui/Mention/mention-with-profilecard.js +33 -146
- package/dist/es2019/ui/Mention/mention-with-providers.js +1 -5
- package/dist/es2019/ui/Popup/index.js +2 -2
- package/dist/es2019/ui/index.js +1 -8
- package/dist/es2019/utils/browser.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/extensions/manifest-helpers.js +2 -2
- package/dist/esm/extensions/module-helpers.js +2 -2
- package/dist/esm/icons/index.js +5 -0
- package/dist/esm/icons/shared/PanelErrorIcon.js +24 -0
- package/dist/esm/icons/shared/PanelInfoIcon.js +24 -0
- package/dist/esm/icons/shared/PanelNoteIcon.js +24 -0
- package/dist/esm/icons/shared/PanelSuccessIcon.js +24 -0
- package/dist/esm/icons/shared/PanelWarningIcon.js +24 -0
- package/dist/esm/index.js +5 -25
- package/dist/esm/provider-factory/with-providers.js +2 -2
- package/dist/esm/safe-plugin/index.js +27 -0
- package/dist/esm/styles/index.js +2 -7
- package/dist/esm/styles/shared/block-marks.js +1 -1
- package/dist/esm/styles/shared/lists.js +2 -1
- package/dist/esm/styles/shared/panel.js +22 -8
- package/dist/esm/styles/shared/table.js +3 -2
- package/dist/esm/types/collab.js +1 -0
- package/dist/esm/ui/LegacyToNextIntlProvider/index.js +2 -2
- package/dist/esm/ui/MediaSingle/index.js +3 -1
- package/dist/esm/ui/Mention/index.js +1 -3
- package/dist/esm/ui/Mention/mention-with-profilecard.js +33 -189
- package/dist/esm/ui/Mention/mention-with-providers.js +1 -5
- package/dist/esm/ui/Popup/index.js +4 -4
- package/dist/esm/ui/Popup/utils.js +2 -2
- package/dist/esm/ui/index.js +1 -8
- package/dist/esm/utils/browser.js +1 -1
- package/dist/esm/utils/profiler/render-count.js +2 -2
- package/dist/esm/utils/track-unsupported-content.js +2 -2
- package/dist/esm/utils/validator.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/collab/types.d.ts +14 -2
- package/dist/types/collab.d.ts +1 -1
- package/dist/types/extensions/types/extension-handler.d.ts +1 -0
- package/dist/types/icons/index.d.ts +5 -0
- package/dist/types/icons/shared/PanelErrorIcon.d.ts +3 -0
- package/dist/types/icons/shared/PanelInfoIcon.d.ts +3 -0
- package/dist/types/icons/shared/PanelNoteIcon.d.ts +3 -0
- package/dist/types/icons/shared/PanelSuccessIcon.d.ts +3 -0
- package/dist/types/icons/shared/PanelWarningIcon.d.ts +3 -0
- package/dist/types/index.d.ts +13 -19
- package/dist/types/safe-plugin/index.d.ts +6 -0
- package/dist/types/styles/index.d.ts +1 -4
- package/dist/types/styles/shared/panel.d.ts +56 -0
- package/dist/types/styles/shared/table.d.ts +1 -0
- package/dist/types/types/collab.d.ts +8 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/ui/MediaSingle/index.d.ts +2 -1
- package/dist/types/ui/MediaSingle/styled.d.ts +2 -2
- package/dist/types/ui/Mention/index.d.ts +0 -3
- package/dist/types/ui/Mention/mention-with-profilecard.d.ts +2 -25
- package/dist/types/ui/Mention/mention-with-providers.d.ts +0 -3
- package/dist/types/ui/Popup/index.d.ts +1 -1
- package/dist/types/ui/WidthProvider/index.d.ts +3 -1
- package/dist/types/ui/index.d.ts +1 -4
- package/icons/package.json +7 -0
- package/package.json +23 -21
- package/safe-plugin/package.json +7 -0
- package/dist/cjs/styles/shared/inline-nodes.js +0 -17
- package/dist/es2019/styles/shared/inline-nodes.js +0 -7
- package/dist/esm/styles/shared/inline-nodes.js +0 -7
- package/dist/types/styles/shared/inline-nodes.d.ts +0 -2
|
@@ -19,7 +19,7 @@ var lightPanelColor = {
|
|
|
19
19
|
warning: colors.Y50,
|
|
20
20
|
error: colors.R50
|
|
21
21
|
};
|
|
22
|
-
var darkPanelColors = {
|
|
22
|
+
export var darkPanelColors = {
|
|
23
23
|
// standard panels
|
|
24
24
|
info: '#0C294F',
|
|
25
25
|
error: "#441C13",
|
|
@@ -76,9 +76,9 @@ var darkPanelColors = {
|
|
|
76
76
|
T900S: "#056270",
|
|
77
77
|
T1200S: "#0B3037",
|
|
78
78
|
// Dark Mode Alpha
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
DarkGray: '#161A1D',
|
|
80
|
+
Gray: '#2C333A',
|
|
81
|
+
LightGray: '#5A6977',
|
|
82
82
|
TextColor: '#D9DDE3'
|
|
83
83
|
};
|
|
84
84
|
var lightIconColor = {
|
|
@@ -101,7 +101,14 @@ var darkIconColor = {
|
|
|
101
101
|
|
|
102
102
|
var panelEmojiSpriteVerticalAlignment = -(gridSize() * 3 - akEditorCustomIconSize) / 2;
|
|
103
103
|
var panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1;
|
|
104
|
-
|
|
104
|
+
var panelDarkModeColors = [[colors.B50, darkPanelColors.B1200S], [colors.B75, darkPanelColors.B900], [colors.B100, darkPanelColors.B800S], [colors.N0, darkPanelColors.LightGray], [colors.N20, darkPanelColors.Gray], [colors.N60, darkPanelColors.DarkGray], [colors.T50, darkPanelColors.T1200S], [colors.T75, darkPanelColors.T900], [colors.T100, darkPanelColors.T900S], [colors.G50, darkPanelColors.G1200S], [colors.G75, darkPanelColors.G900], [colors.G200, darkPanelColors.G900S], [colors.Y50, darkPanelColors.Y1200S], [colors.Y75, darkPanelColors.Y900], [colors.Y200, darkPanelColors.Y800S], [colors.R50, darkPanelColors.R1200S], [colors.R75, darkPanelColors.R900], [colors.R100, darkPanelColors.R800S], [colors.P50, darkPanelColors.P1200S], [colors.P75, darkPanelColors.P900], [colors.P100, darkPanelColors.P800S]];
|
|
105
|
+
export var getPanelDarkColor = function getPanelDarkColor(panelColor) {
|
|
106
|
+
var colorObject = panelDarkModeColors.find(function (color) {
|
|
107
|
+
return color[0] === panelColor || color[1] === panelColor;
|
|
108
|
+
});
|
|
109
|
+
return colorObject ? colorObject[1] : darkPanelColors.B1200S;
|
|
110
|
+
};
|
|
111
|
+
export var getPanelBackgroundDarkModeColors = panelDarkModeColors.map(function (_ref) {
|
|
105
112
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
106
113
|
colorName = _ref2[0],
|
|
107
114
|
colorValue = _ref2[1];
|
|
@@ -124,13 +131,20 @@ export var PanelSharedSelectors = {
|
|
|
124
131
|
errorPanel: ".".concat(prefix, "[data-panel-type=").concat(PanelType.ERROR, "]"),
|
|
125
132
|
successPanel: ".".concat(prefix, "[data-panel-type=").concat(PanelType.SUCCESS, "]"),
|
|
126
133
|
noteButton: "button[aria-label=\"Note\"]",
|
|
134
|
+
warningButton: "button[aria-label=\"Warning\"]",
|
|
127
135
|
removeButton: "button[aria-label=\"Remove\"]",
|
|
128
136
|
colorPalette: "[aria-label=\"Background color\"]",
|
|
129
|
-
selectedColor: "[aria-label=\"
|
|
137
|
+
selectedColor: "[aria-label=\"Light green\"]",
|
|
130
138
|
removeEmojiIcon: "[aria-label=\"Remove emoji\"]",
|
|
131
139
|
emojiIcon: "[aria-label=\"editor-add-emoji\"]",
|
|
132
140
|
selectedEmoji: "[aria-label=\":grinning:\"]",
|
|
133
|
-
|
|
141
|
+
addYourOwnEmoji: "[aria-label=\"Add your own emoji\"]",
|
|
142
|
+
emojiNameInCustomEmoji: "[aria-label=\"Enter a name for the new emoji\"]",
|
|
143
|
+
title: "#editor-title",
|
|
144
|
+
emojiPopup: "[aria-label=\"Popup\"]",
|
|
145
|
+
searchEmoji: "[aria-label=\"Search emoji\"]",
|
|
146
|
+
orangeWarningIcon: "[aria-label=\":warning:\"]",
|
|
147
|
+
yellowWarningIcon: "[aria-label=\":warning:\"] span:nth-child(1)"
|
|
134
148
|
};
|
|
135
149
|
|
|
136
150
|
var iconDynamicStyles = function iconDynamicStyles(panelType) {
|
|
@@ -167,6 +181,6 @@ var mainDynamicStyles = function mainDynamicStyles(panelType) {
|
|
|
167
181
|
};
|
|
168
182
|
};
|
|
169
183
|
|
|
170
|
-
export var panelSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n border-radius: ", "px;\n margin: ", " 0 0;\n padding: ", "px;\n min-width: ", "px;\n display: flex;\n position: relative;\n align-items: baseline;\n word-break: break-word;\n\n ", "\n\n .", " {\n flex-shrink: 0;\n height: ", "px;\n width: ", "px;\n box-sizing: content-box;\n padding-right: ", "px;\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n ", "\n\n > span {\n vertical-align: middle;\n display: inline;\n }\n\n .", " {\n vertical-align: ", "px;\n }\n\n .", " {\n vertical-align: ", "px;\n\n // Vertical align only works for inline-block elements in Firefox\n @-moz-document url-prefix() {\n img {\n display: inline-block;\n }\n }\n }\n }\n\n .ak-editor-panel__content {\n margin: 1px 0 1px;\n flex: 1 0 0;\n /*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n min-width: 0;\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", ";\n }\n }\n"])), PanelSharedCssClassName.prefix, borderRadius(), blockNodesVerticalMargin, gridSize(), akEditorTableCellMinWidth, mainDynamicStyles(PanelType.INFO), PanelSharedCssClassName.icon, gridSize() * 3, gridSize() * 3, gridSize(), iconDynamicStyles(PanelType.INFO), emojiSprite, panelEmojiSpriteVerticalAlignment, emojiImage, panelEmojiImageVerticalAlignment, PanelType.NOTE, mainDynamicStyles(PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.NOTE), PanelType.TIP, mainDynamicStyles(PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.TIP), PanelType.WARNING, mainDynamicStyles(PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.WARNING), PanelType.ERROR, mainDynamicStyles(PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.ERROR), PanelType.SUCCESS, mainDynamicStyles(PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.SUCCESS), PanelType.CUSTOM, themed({
|
|
184
|
+
export var panelSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n border-radius: ", "px;\n margin: ", " 0 0;\n padding: ", "px;\n min-width: ", "px;\n display: flex;\n position: relative;\n align-items: baseline;\n word-break: break-word;\n\n ", "\n\n .", " {\n flex-shrink: 0;\n height: ", "px;\n width: ", "px;\n box-sizing: content-box;\n padding-right: ", "px;\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n ", "\n\n > span {\n vertical-align: middle;\n display: inline-flex;\n }\n\n .", " {\n vertical-align: ", "px;\n }\n\n .", " {\n vertical-align: ", "px;\n\n // Vertical align only works for inline-block elements in Firefox\n @-moz-document url-prefix() {\n img {\n display: inline-block;\n }\n }\n }\n }\n\n .ak-editor-panel__content {\n margin: 1px 0 1px;\n flex: 1 0 0;\n /*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n min-width: 0;\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", ";\n }\n }\n"])), PanelSharedCssClassName.prefix, borderRadius(), blockNodesVerticalMargin, gridSize(), akEditorTableCellMinWidth, mainDynamicStyles(PanelType.INFO), PanelSharedCssClassName.icon, gridSize() * 3, gridSize() * 3, gridSize(), iconDynamicStyles(PanelType.INFO), emojiSprite, panelEmojiSpriteVerticalAlignment, emojiImage, panelEmojiImageVerticalAlignment, PanelType.NOTE, mainDynamicStyles(PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.NOTE), PanelType.TIP, mainDynamicStyles(PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.TIP), PanelType.WARNING, mainDynamicStyles(PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.WARNING), PanelType.ERROR, mainDynamicStyles(PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.ERROR), PanelType.SUCCESS, mainDynamicStyles(PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.SUCCESS), PanelType.CUSTOM, themed({
|
|
171
185
|
dark: getPanelBackgroundDarkModeColors
|
|
172
186
|
}));
|
|
@@ -3,7 +3,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
5
|
import { css } from 'styled-components';
|
|
6
|
-
import { tableCellContentDomSelector, tableCellSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
|
|
6
|
+
import { tableCellContentDomSelector, tableCellSelector, tableHeaderSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
|
|
7
7
|
import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorTableToolbarDark, akEditorWideLayoutWidth, getTableCellBackgroundDarkModeColors, overflowShadow } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { DN20 } from '@atlaskit/theme/colors';
|
|
9
9
|
import { themed } from '@atlaskit/theme/components';
|
|
@@ -27,7 +27,8 @@ export var TableSharedCssClassName = {
|
|
|
27
27
|
TABLE_STICKY_SENTINEL_TOP: "".concat(tablePrefixSelector, "-sticky-sentinel-top"),
|
|
28
28
|
TABLE_STICKY_SENTINEL_BOTTOM: "".concat(tablePrefixSelector, "-sticky-sentinel-bottom"),
|
|
29
29
|
TABLE_CELL_NODEVIEW_CONTENT_DOM: tableCellContentDomSelector,
|
|
30
|
-
TABLE_CELL_WRAPPER: tableCellSelector
|
|
30
|
+
TABLE_CELL_WRAPPER: tableCellSelector,
|
|
31
|
+
TABLE_HEADER_CELL_WRAPPER: tableHeaderSelector
|
|
31
32
|
};
|
|
32
33
|
var tableSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-child > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n margin: ", "px ", "px 0 0;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: white;\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n th p:not(:first-of-type),\n td p:not(:first-of-type) {\n margin-top: 12px;\n }\n }\n th {\n background-color: ", ";\n text-align: left;\n\n /* only apply this styling to codeblocks in default background headercells */\n /* TODO this needs to be overhauled as it relies on unsafe selectors */\n &:not([style]) {\n .code-block {\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n background-color: ", ";\n\n .line-number-gutter {\n background-color: ", ";\n }\n\n /* this is only relevant to the element taken care of by renderer */\n > [data-ds--code--code-block] {\n background-image: ", "!important;\n\n background-color: ", "!important;\n\n // selector lives inside @atlaskit/code\n --ds--code--line-number-bg-color: ", ";\n }\n }\n }\n }\n }\n }\n"])), TableSharedCssClassName.TABLE_CONTAINER, tableMarginBottom, TableSharedCssClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, tableCellBorderWidth, themed({
|
|
33
34
|
light: akEditorTableBorder,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,9 +5,9 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
7
|
|
|
8
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
9
|
|
|
10
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
11
|
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
|
|
@@ -26,7 +26,8 @@ export default function MediaSingle(_ref) {
|
|
|
26
26
|
fullWidthMode = _ref.fullWidthMode,
|
|
27
27
|
lineLength = _ref.lineLength,
|
|
28
28
|
_ref$hasFallbackConta = _ref.hasFallbackContainer,
|
|
29
|
-
hasFallbackContainer = _ref$hasFallbackConta === void 0 ? true : _ref$hasFallbackConta
|
|
29
|
+
hasFallbackContainer = _ref$hasFallbackConta === void 0 ? true : _ref$hasFallbackConta,
|
|
30
|
+
handleMediaSingleRef = _ref.handleMediaSingleRef;
|
|
30
31
|
var children = React.Children.toArray(propsChildren);
|
|
31
32
|
|
|
32
33
|
if (!pctWidth && shouldAddDefaultWrappedWidth(layout, width, lineLength)) {
|
|
@@ -81,6 +82,7 @@ export default function MediaSingle(_ref) {
|
|
|
81
82
|
caption = _children[1];
|
|
82
83
|
|
|
83
84
|
return /*#__PURE__*/React.createElement(MediaSingleWrapper, {
|
|
85
|
+
innerRef: handleMediaSingleRef,
|
|
84
86
|
width: width,
|
|
85
87
|
layout: layout,
|
|
86
88
|
containerWidth: containerWidth,
|
|
@@ -31,7 +31,6 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
|
|
|
31
31
|
accessLevel = _this$props.accessLevel,
|
|
32
32
|
eventHandlers = _this$props.eventHandlers,
|
|
33
33
|
id = _this$props.id,
|
|
34
|
-
portal = _this$props.portal,
|
|
35
34
|
text = _this$props.text;
|
|
36
35
|
var mentionProvider = providers.mentionProvider,
|
|
37
36
|
profilecardProvider = providers.profilecardProvider;
|
|
@@ -41,8 +40,7 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
|
|
|
41
40
|
accessLevel: accessLevel,
|
|
42
41
|
eventHandlers: eventHandlers,
|
|
43
42
|
mentionProvider: mentionProvider,
|
|
44
|
-
profilecardProvider: profilecardProvider
|
|
45
|
-
portal: portal
|
|
43
|
+
profilecardProvider: profilecardProvider
|
|
46
44
|
});
|
|
47
45
|
});
|
|
48
46
|
|
|
@@ -1,190 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
-
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
13
|
-
|
|
14
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
|
-
|
|
16
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
|
-
|
|
18
|
-
import React, { PureComponent } from 'react';
|
|
19
|
-
import { findDOMNode } from 'react-dom';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
20
2
|
import { ResourcedMention } from '@atlaskit/mention';
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
_defineProperty(_assertThisInitialized(_this), "handleMentionNodeRef", function (component) {
|
|
56
|
-
if (!component) {
|
|
57
|
-
_this.domNode = null;
|
|
58
|
-
} else {
|
|
59
|
-
_this.domNode = findDOMNode(component);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
_defineProperty(_assertThisInitialized(_this), "showProfilecard", function (event) {
|
|
64
|
-
if (!_this.domNode) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
event.stopPropagation();
|
|
69
|
-
|
|
70
|
-
var _this$calculateLayerP = _this.calculateLayerPosition(),
|
|
71
|
-
_this$calculateLayerP2 = _slicedToArray(_this$calculateLayerP, 2),
|
|
72
|
-
popupAlignX = _this$calculateLayerP2[0],
|
|
73
|
-
popupAlignY = _this$calculateLayerP2[1];
|
|
74
|
-
|
|
75
|
-
_this.setState({
|
|
76
|
-
popupAlignX: popupAlignX,
|
|
77
|
-
popupAlignY: popupAlignY,
|
|
78
|
-
visible: true
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
_defineProperty(_assertThisInitialized(_this), "hideProfilecard", function () {
|
|
83
|
-
_this.setState({
|
|
84
|
-
visible: false
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
return _this;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
_createClass(MentionWithProfileCard, [{
|
|
92
|
-
key: "calculateLayerPosition",
|
|
93
|
-
value: function calculateLayerPosition() {
|
|
94
|
-
var domNodeCentreCoords = this.getDomNodeCenterCoords();
|
|
95
|
-
var visibleAreaCentreCoords = this.getVisibleAreaCentreCoords();
|
|
96
|
-
var popupAlignY = domNodeCentreCoords.y > visibleAreaCentreCoords.y ? 'top' : 'bottom';
|
|
97
|
-
var popupAlignX = domNodeCentreCoords.x > visibleAreaCentreCoords.x ? 'right' : 'left';
|
|
98
|
-
return [popupAlignX, popupAlignY];
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
key: "getDomNodeCenterCoords",
|
|
102
|
-
value: function getDomNodeCenterCoords() {
|
|
103
|
-
var rect = this.domNode.getBoundingClientRect();
|
|
104
|
-
return {
|
|
105
|
-
x: rect.left + rect.width / 2,
|
|
106
|
-
y: rect.top + rect.height / 2
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
key: "getVisibleAreaCentreCoords",
|
|
111
|
-
value: function getVisibleAreaCentreCoords() {
|
|
112
|
-
return {
|
|
113
|
-
x: window.innerWidth / 2,
|
|
114
|
-
y: window.innerHeight / 2
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}, {
|
|
118
|
-
key: "getActions",
|
|
119
|
-
value: function getActions(id, text, accessLevel) {
|
|
120
|
-
var _this2 = this;
|
|
121
|
-
|
|
122
|
-
var profilecardProvider = this.props.profilecardProvider;
|
|
123
|
-
var actions = profilecardProvider.getActions(id, text, accessLevel);
|
|
124
|
-
return actions.map(function (action) {
|
|
125
|
-
return _objectSpread(_objectSpread({}, action), {}, {
|
|
126
|
-
callback: function callback() {
|
|
127
|
-
_this2.setState({
|
|
128
|
-
visible: false
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
if (action && action.callback) {
|
|
132
|
-
action.callback();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
}, {
|
|
139
|
-
key: "render",
|
|
140
|
-
value: function render() {
|
|
141
|
-
var _this$props = this.props,
|
|
142
|
-
accessLevel = _this$props.accessLevel,
|
|
143
|
-
id = _this$props.id,
|
|
144
|
-
mentionProvider = _this$props.mentionProvider,
|
|
145
|
-
profilecardProvider = _this$props.profilecardProvider,
|
|
146
|
-
text = _this$props.text,
|
|
147
|
-
onClick = _this$props.onClick,
|
|
148
|
-
onMouseEnter = _this$props.onMouseEnter,
|
|
149
|
-
onMouseLeave = _this$props.onMouseLeave,
|
|
150
|
-
portal = _this$props.portal;
|
|
151
|
-
var _this$state = this.state,
|
|
152
|
-
popupAlignX = _this$state.popupAlignX,
|
|
153
|
-
popupAlignY = _this$state.popupAlignY,
|
|
154
|
-
target = _this$state.target,
|
|
155
|
-
visible = _this$state.visible;
|
|
156
|
-
var cloudId = profilecardProvider.cloudId,
|
|
157
|
-
resourceClient = profilecardProvider.resourceClient;
|
|
158
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
159
|
-
ref: this.handleRef,
|
|
160
|
-
onClick: this.showProfilecard
|
|
161
|
-
}, /*#__PURE__*/React.createElement(ResourcedMention, {
|
|
162
|
-
ref: this.handleMentionNodeRef,
|
|
163
|
-
id: id,
|
|
164
|
-
text: text,
|
|
165
|
-
accessLevel: accessLevel,
|
|
166
|
-
mentionProvider: mentionProvider,
|
|
167
|
-
onClick: onClick,
|
|
168
|
-
onMouseEnter: onMouseEnter,
|
|
169
|
-
onMouseLeave: onMouseLeave
|
|
170
|
-
}), target && portal && visible && /*#__PURE__*/React.createElement(Popup, {
|
|
171
|
-
offset: [0, 8],
|
|
172
|
-
target: target,
|
|
173
|
-
mountTo: portal,
|
|
174
|
-
alignX: popupAlignX,
|
|
175
|
-
alignY: popupAlignY
|
|
176
|
-
}, /*#__PURE__*/React.createElement(ProfilecardResourcedWithListeners, {
|
|
177
|
-
handleClickOutside: this.hideProfilecard,
|
|
178
|
-
handleEscapeKeydown: this.hideProfilecard,
|
|
179
|
-
cloudId: cloudId,
|
|
180
|
-
userId: id,
|
|
181
|
-
resourceClient: resourceClient,
|
|
182
|
-
actions: this.getActions(id, text, accessLevel)
|
|
183
|
-
})));
|
|
184
|
-
}
|
|
185
|
-
}]);
|
|
186
|
-
|
|
187
|
-
return MentionWithProfileCard;
|
|
188
|
-
}(PureComponent);
|
|
189
|
-
|
|
190
|
-
export { MentionWithProfileCard as default };
|
|
3
|
+
import { ProfileCardTrigger } from '@atlaskit/profilecard';
|
|
4
|
+
export default function MentionWithProfileCard(_ref) {
|
|
5
|
+
var id = _ref.id,
|
|
6
|
+
text = _ref.text,
|
|
7
|
+
accessLevel = _ref.accessLevel,
|
|
8
|
+
mentionProvider = _ref.mentionProvider,
|
|
9
|
+
profilecardProvider = _ref.profilecardProvider,
|
|
10
|
+
onClick = _ref.onClick,
|
|
11
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
12
|
+
onMouseLeave = _ref.onMouseLeave;
|
|
13
|
+
var cloudId = profilecardProvider.cloudId,
|
|
14
|
+
resourceClient = profilecardProvider.resourceClient;
|
|
15
|
+
var actions = useMemo(function () {
|
|
16
|
+
return profilecardProvider.getActions(id, text, accessLevel);
|
|
17
|
+
}, [accessLevel, id, profilecardProvider, text]);
|
|
18
|
+
return /*#__PURE__*/React.createElement(ProfileCardTrigger, {
|
|
19
|
+
cloudId: cloudId,
|
|
20
|
+
userId: id,
|
|
21
|
+
resourceClient: resourceClient,
|
|
22
|
+
actions: actions,
|
|
23
|
+
trigger: "click",
|
|
24
|
+
position: "bottom-end"
|
|
25
|
+
}, /*#__PURE__*/React.createElement(ResourcedMention, {
|
|
26
|
+
id: id,
|
|
27
|
+
text: text,
|
|
28
|
+
accessLevel: accessLevel,
|
|
29
|
+
mentionProvider: mentionProvider,
|
|
30
|
+
onClick: onClick,
|
|
31
|
+
onMouseEnter: onMouseEnter,
|
|
32
|
+
onMouseLeave: onMouseLeave
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
@@ -83,11 +83,9 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
|
|
|
83
83
|
value: function render() {
|
|
84
84
|
var _this$props = this.props,
|
|
85
85
|
accessLevel = _this$props.accessLevel,
|
|
86
|
-
userType = _this$props.userType,
|
|
87
86
|
eventHandlers = _this$props.eventHandlers,
|
|
88
87
|
id = _this$props.id,
|
|
89
88
|
mentionProvider = _this$props.mentionProvider,
|
|
90
|
-
portal = _this$props.portal,
|
|
91
89
|
text = _this$props.text;
|
|
92
90
|
var profilecardProvider = this.state.profilecardProvider;
|
|
93
91
|
var actionHandlers = {};
|
|
@@ -99,10 +97,8 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
|
|
|
99
97
|
id: id,
|
|
100
98
|
text: text,
|
|
101
99
|
accessLevel: accessLevel,
|
|
102
|
-
userType: userType,
|
|
103
100
|
mentionProvider: mentionProvider,
|
|
104
|
-
profilecardProvider: profilecardProvider
|
|
105
|
-
portal: portal
|
|
101
|
+
profilecardProvider: profilecardProvider
|
|
106
102
|
}, actionHandlers));
|
|
107
103
|
}
|
|
108
104
|
}]);
|
|
@@ -6,9 +6,9 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
|
|
9
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
9
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
10
|
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
12
|
|
|
13
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
14
|
|
|
@@ -55,7 +55,7 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
55
55
|
}));
|
|
56
56
|
|
|
57
57
|
_defineProperty(_assertThisInitialized(_this), "onResize", function () {
|
|
58
|
-
return _this.scheduledUpdatePosition();
|
|
58
|
+
return _this.scheduledUpdatePosition(_this.props);
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
return _this;
|
|
@@ -170,7 +170,7 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
170
170
|
* which is currently working for most of the floating toolbar and other popups.
|
|
171
171
|
*/
|
|
172
172
|
|
|
173
|
-
this.scheduledUpdatePosition();
|
|
173
|
+
this.scheduledUpdatePosition(this.props);
|
|
174
174
|
}
|
|
175
175
|
}, {
|
|
176
176
|
key: "UNSAFE_componentWillReceiveProps",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
|
|
8
8
|
export function isBody(elem) {
|
|
9
9
|
return elem === document.body;
|
package/dist/esm/ui/index.js
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
// TODO: ED-13875 Remove Emoji & EmojiProps exports once root entry point for editor-common has been removed
|
|
2
|
-
export { default as Emoji } from './Emoji'; //exported from ./src/emoji.ts
|
|
3
|
-
|
|
4
|
-
//exported from ./src/emoji.ts
|
|
5
1
|
export { default as Caption } from './Caption';
|
|
6
2
|
export { default as MediaSingle, DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, wrappedLayouts, shouldAddDefaultWrappedWidth } from './MediaSingle';
|
|
7
3
|
export { MediaSingleDimensionHelper } from './MediaSingle/styled';
|
|
8
4
|
export { layoutSupportsWidth, calcPxFromColumns, calcPctFromPx, calcPxFromPct, calcColumnsFromPx, snapToGrid } from './MediaSingle/grid';
|
|
9
|
-
export { MediaLink } from './MediaSingle/link';
|
|
10
|
-
|
|
11
|
-
export { default as Mention } from './Mention'; //exported from ./src/mention.ts
|
|
12
|
-
|
|
5
|
+
export { MediaLink } from './MediaSingle/link';
|
|
13
6
|
export { default as Popup, findOverflowScrollParent } from './Popup';
|
|
14
7
|
export { default as UnsupportedBlock } from './UnsupportedBlock';
|
|
15
8
|
export { default as UnsupportedInline } from './UnsupportedInline';
|
|
@@ -22,7 +22,7 @@ if (typeof navigator !== 'undefined') {
|
|
|
22
22
|
result.ie_version = ieUpTo10 ? document.documentMode || 6 : ie11up ? +ie11up[1] : ieEdge ? +ieEdge[1] : null;
|
|
23
23
|
result.gecko = !ie && /gecko\/\d/i.test(navigator.userAgent);
|
|
24
24
|
result.chrome = !ie && /Chrome\//.test(navigator.userAgent);
|
|
25
|
-
result.chrome_version = parseInt((navigator.userAgent.match(/Chrome\/(\d
|
|
25
|
+
result.chrome_version = parseInt((navigator.userAgent.match(/Chrome\/(\d+)/) || [])[1], 10);
|
|
26
26
|
result.android = /Android \d/.test(navigator.userAgent);
|
|
27
27
|
result.ios = !ie && /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
|
|
28
28
|
result.webkit = !ie && !!document.documentElement && 'WebkitAppearance' in document.documentElement.style;
|
|
@@ -2,9 +2,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
|
|
7
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
|
|
9
9
|
export var PROFILER_KEY = '__editorRenderCountProfiler';
|
|
10
10
|
export var RenderCountProfiler = /*#__PURE__*/function () {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
7
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from './analytics';
|
|
8
8
|
var whitelistedAttributes = ['align', 'annotationType', 'extensionKey', 'extensionType', 'layout', 'type', 'localId', 'mode', 'language', 'timestamp', 'state', 'originalWidth', 'originalHeight', 'height', 'width', 'shortName', 'level', 'userType', 'order', 'panelType', 'color', 'style', 'isNumberColumnEnabled', 'colspan', 'rowspan', 'colwidth', 'background'];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
|
|
8
8
|
import { defaultSchema, inlineNodes, isSafeUrl, PanelType, generateUuid as uuid } from '@atlaskit/adf-schema';
|
|
9
9
|
export var ADFStages = {
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
2
2
|
import { Step } from 'prosemirror-transform';
|
|
3
|
+
import { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
4
|
+
import { SyncUpErrorFunction } from '../types';
|
|
3
5
|
export interface CollabParticipant {
|
|
4
6
|
lastActive: number;
|
|
5
7
|
sessionId: string;
|
|
@@ -23,7 +25,7 @@ export interface CollabEventRemoteData {
|
|
|
23
25
|
export interface CollabEventConnectionData {
|
|
24
26
|
sid: string;
|
|
25
27
|
}
|
|
26
|
-
export interface
|
|
28
|
+
export interface CollabEventDisconnectedData {
|
|
27
29
|
sid: string;
|
|
28
30
|
reason: 'CLIENT_DISCONNECT' | 'SERVER_DISCONNECT' | 'SOCKET_CLOSED' | 'SOCKET_ERROR' | 'SOCKET_TIMEOUT' | 'UNKNOWN_DISCONNECT';
|
|
29
31
|
}
|
|
@@ -50,7 +52,7 @@ export declare type CollabEvent = keyof CollabEventData;
|
|
|
50
52
|
export interface CollabEventData {
|
|
51
53
|
init: CollabEventInitData;
|
|
52
54
|
connected: CollabEventConnectionData;
|
|
53
|
-
disconnected:
|
|
55
|
+
disconnected: CollabEventDisconnectedData;
|
|
54
56
|
data: CollabEventRemoteData;
|
|
55
57
|
telepointer: CollabEventTelepointerData;
|
|
56
58
|
presence: CollabEventPresenceData;
|
|
@@ -58,8 +60,17 @@ export interface CollabEventData {
|
|
|
58
60
|
'local-steps': any;
|
|
59
61
|
entity: any;
|
|
60
62
|
}
|
|
63
|
+
export declare type ResolvedEditorState = {
|
|
64
|
+
content: JSONDocNode;
|
|
65
|
+
title: string | null;
|
|
66
|
+
stepVersion: number;
|
|
67
|
+
};
|
|
61
68
|
export interface CollabEditProvider<Events extends CollabEventData = CollabEventData> {
|
|
62
69
|
initialize(getState: () => any, createStep: (json: object) => Step): this;
|
|
70
|
+
setup(props: {
|
|
71
|
+
getState: () => EditorState;
|
|
72
|
+
onSyncUpError?: SyncUpErrorFunction;
|
|
73
|
+
}): this;
|
|
63
74
|
send(tr: Transaction, oldState: EditorState, newState: EditorState): void;
|
|
64
75
|
on(evt: keyof Events, handler: (...args: any) => void): this;
|
|
65
76
|
off(evt: keyof Events, handler: (...args: any) => void): this;
|
|
@@ -67,4 +78,5 @@ export interface CollabEditProvider<Events extends CollabEventData = CollabEvent
|
|
|
67
78
|
sendMessage<K extends keyof Events>(data: {
|
|
68
79
|
type: K;
|
|
69
80
|
} & Events[K]): void;
|
|
81
|
+
getFinalAcknowledgedState(): Promise<ResolvedEditorState>;
|
|
70
82
|
}
|
package/dist/types/collab.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { CollabEditProvider, CollabEventPresenceData, CollabEvent, CollabEventConnectionData, CollabEventData, CollabEventInitData, CollabEventRemoteData, CollabEventTelepointerData, CollabParticipant, CollabSendableSelection, CollabEventLocalStepData, } from './collab/types';
|
|
1
|
+
export type { CollabEditProvider, CollabEventPresenceData, CollabEvent, CollabEventConnectionData, CollabEventData, CollabEventInitData, CollabEventRemoteData, CollabEventTelepointerData, CollabParticipant, CollabSendableSelection, CollabEventLocalStepData, ResolvedEditorState, } from './collab/types';
|
|
@@ -21,6 +21,7 @@ export declare type ExtensionAPI<T extends Parameters = Parameters> = {
|
|
|
21
21
|
allowSelectionToNewNode?: boolean;
|
|
22
22
|
}) => void;
|
|
23
23
|
scrollTo: (localId: string) => void;
|
|
24
|
+
update: (localId: string, mutationCallback: (currentValue: Pick<ADFEntity, 'attrs' | 'marks'>) => Pick<ADFEntity, 'attrs' | 'marks'>) => void;
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
27
|
export declare type UpdateExtension<T extends Parameters = Parameters> = (extensionParameters: T, actions?: ExtensionAPI<T>) => Promise<T | void>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PanelInfoIcon } from './shared/PanelInfoIcon';
|
|
2
|
+
export { PanelWarningIcon } from './shared/PanelWarningIcon';
|
|
3
|
+
export { PanelErrorIcon } from './shared/PanelErrorIcon';
|
|
4
|
+
export { PanelSuccessIcon } from './shared/PanelSuccessIcon';
|
|
5
|
+
export { PanelNoteIcon } from './shared/PanelNoteIcon';
|