@atlaskit/editor-common 61.0.0 → 62.1.1
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 +68 -0
- package/dist/cjs/extensions/extension-fields-helpers.js +1 -1
- package/dist/cjs/extensions/index.js +42 -42
- package/dist/cjs/extensions/manifest-helpers.js +3 -1
- package/dist/cjs/extensions/module-helpers.js +3 -1
- package/dist/cjs/extensions/types/field-definitions.js +1 -1
- package/dist/cjs/extensions/types/index.js +10 -10
- package/dist/cjs/extensions.js +38 -38
- package/dist/cjs/i18n/index.js +26 -26
- package/dist/cjs/in-product.js +14 -14
- package/dist/cjs/index.js +328 -304
- package/dist/cjs/messages/codeBidiWarning.js +2 -2
- package/dist/cjs/messages/link.js +2 -2
- package/dist/cjs/messages/unsupportedContent.js +2 -2
- package/dist/cjs/provider-factory/context.js +1 -1
- package/dist/cjs/provider-factory.js +6 -6
- package/dist/cjs/provider-helpers/promise-helpers.js +1 -1
- package/dist/cjs/styles/index.js +90 -82
- package/dist/cjs/styles/shared/annotation.js +1 -1
- package/dist/cjs/styles/shared/media-single.js +1 -1
- package/dist/cjs/styles/shared/panel.js +2 -1
- package/dist/cjs/styles/shared/table.js +1 -1
- package/dist/cjs/styles/shared/text-color.js +17 -0
- package/dist/cjs/type-ahead/index.js +1 -1
- package/dist/cjs/types/annotation/emitter.js +1 -1
- package/dist/cjs/ufo/experience-store.js +1 -1
- package/dist/cjs/ufo/index.js +4 -4
- package/dist/cjs/ui/BaseTheme/index.js +2 -2
- package/dist/cjs/ui/Caption/index.js +2 -2
- package/dist/cjs/ui/Caption/messages.js +2 -2
- package/dist/cjs/ui/Expand/index.js +3 -3
- package/dist/cjs/ui/IntlLegacyFallbackProvider/index.js +60 -0
- package/dist/cjs/ui/IntlNextErrorBoundary/index.js +90 -0
- package/dist/cjs/ui/LegacyToNextIntlProvider/index.js +67 -0
- package/dist/cjs/ui/MediaSingle/grid.js +2 -2
- package/dist/cjs/ui/MediaSingle/index.js +2 -1
- package/dist/cjs/ui/MediaSingle/styled.js +1 -1
- package/dist/cjs/ui/Messages/index.js +1 -1
- package/dist/cjs/ui/Popup/index.js +1 -1
- package/dist/cjs/ui/Popup/utils.js +5 -5
- package/dist/cjs/ui/UnsupportedBlock/index.js +2 -2
- package/dist/cjs/ui/UnsupportedInline/index.js +2 -2
- package/dist/cjs/ui/WidthProvider/index.js +2 -2
- package/dist/cjs/ui/index.js +92 -62
- package/dist/cjs/utils/analytics.js +6 -5
- package/dist/cjs/utils/breakout.js +1 -1
- package/dist/cjs/utils/date.js +3 -4
- package/dist/cjs/utils/index.js +114 -114
- package/dist/cjs/utils/performance/measure-tti.js +2 -2
- package/dist/cjs/utils/performance/measure.js +1 -1
- package/dist/cjs/utils/table.js +1 -1
- package/dist/cjs/utils/validate-using-spec.js +1 -1
- package/dist/cjs/utils/validator.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/messages/codeBidiWarning.js +1 -1
- package/dist/es2019/messages/link.js +1 -1
- package/dist/es2019/messages/unsupportedContent.js +1 -1
- package/dist/es2019/styles/index.js +1 -0
- package/dist/es2019/styles/shared/media-single.js +10 -0
- package/dist/es2019/styles/shared/text-color.js +10 -0
- package/dist/es2019/ui/Caption/index.js +1 -1
- package/dist/es2019/ui/Caption/messages.js +1 -1
- package/dist/es2019/ui/Expand/index.js +1 -1
- package/dist/es2019/ui/IntlLegacyFallbackProvider/index.js +21 -0
- package/dist/es2019/ui/IntlNextErrorBoundary/index.js +43 -0
- package/dist/es2019/ui/LegacyToNextIntlProvider/index.js +24 -0
- package/dist/es2019/ui/UnsupportedBlock/index.js +1 -1
- package/dist/es2019/ui/UnsupportedInline/index.js +1 -1
- package/dist/es2019/ui/index.js +4 -1
- package/dist/es2019/utils/date.js +2 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/messages/codeBidiWarning.js +1 -1
- package/dist/esm/messages/link.js +1 -1
- package/dist/esm/messages/unsupportedContent.js +1 -1
- package/dist/esm/styles/index.js +1 -0
- package/dist/esm/styles/shared/media-single.js +1 -1
- package/dist/esm/styles/shared/text-color.js +6 -0
- package/dist/esm/ui/Caption/index.js +1 -1
- package/dist/esm/ui/Caption/messages.js +1 -1
- package/dist/esm/ui/Expand/index.js +1 -1
- package/dist/esm/ui/IntlLegacyFallbackProvider/index.js +45 -0
- package/dist/esm/ui/IntlNextErrorBoundary/index.js +73 -0
- package/dist/esm/ui/LegacyToNextIntlProvider/index.js +51 -0
- package/dist/esm/ui/UnsupportedBlock/index.js +1 -1
- package/dist/esm/ui/UnsupportedInline/index.js +1 -1
- package/dist/esm/ui/index.js +4 -1
- package/dist/esm/utils/date.js +2 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/extensions/types/extension-handler.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/styles/index.d.ts +1 -0
- package/dist/types/styles/shared/text-color.d.ts +1 -0
- package/dist/types/ui/Caption/index.d.ts +4 -4
- package/dist/types/ui/IntlLegacyFallbackProvider/index.d.ts +8 -0
- package/dist/types/ui/IntlNextErrorBoundary/index.d.ts +15 -0
- package/dist/types/ui/LegacyToNextIntlProvider/index.d.ts +8 -0
- package/dist/types/ui/UnsupportedBlock/index.d.ts +3 -3
- package/dist/types/ui/UnsupportedInline/index.d.ts +3 -3
- package/dist/types/ui/index.d.ts +3 -0
- package/dist/types/ui/unsupported-content-helper.d.ts +2 -2
- package/dist/types/utils/date.d.ts +3 -3
- package/package.json +11 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { injectIntl } from 'react-intl';
|
|
3
|
+
import { injectIntl } from 'react-intl-next';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { N200, N400 } from '@atlaskit/theme/colors';
|
|
6
6
|
import { messages } from './messages';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineMessages } from 'react-intl';
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import * as colors from '@atlaskit/theme/colors';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { IntlProvider, intlShape } from 'react-intl';
|
|
4
|
+
export class IntlLegacyFallbackProvider extends React.Component {
|
|
5
|
+
render() {
|
|
6
|
+
const oldIntl = this.context.intl;
|
|
7
|
+
|
|
8
|
+
if (!oldIntl) {
|
|
9
|
+
return /*#__PURE__*/React.createElement(IntlProvider, {
|
|
10
|
+
locale: "en"
|
|
11
|
+
}, this.props.children);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return this.props.children;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
_defineProperty(IntlLegacyFallbackProvider, "contextTypes", {
|
|
20
|
+
intl: intlShape
|
|
21
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { IntlProvider } from 'react-intl-next';
|
|
4
|
+
export const REACT_INTL_ERROR_MESSAGE = '<IntlProvider> needs to exist in the component ancestry';
|
|
5
|
+
|
|
6
|
+
const isMissingIntlProviderInAncestryError = err => {
|
|
7
|
+
var _err$toString;
|
|
8
|
+
|
|
9
|
+
return err === null || err === void 0 ? void 0 : (_err$toString = err.toString()) === null || _err$toString === void 0 ? void 0 : _err$toString.includes('<IntlProvider> needs to exist in the component ancestry');
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export class IntlNextErrorBoundary extends React.Component {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
15
|
+
|
|
16
|
+
_defineProperty(this, "state", {
|
|
17
|
+
missingIntlProviderInAncestry: false
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
componentDidCatch(error, errorInfo) {
|
|
22
|
+
// if missing IntlProvider in ancestry, we setup a fallback IntlProvider ourselves
|
|
23
|
+
if (isMissingIntlProviderInAncestryError(error)) {
|
|
24
|
+
this.setState({
|
|
25
|
+
missingIntlProviderInAncestry: true
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
// else we re-propagate the non-react-intl-next error
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
render() {
|
|
34
|
+
if (this.state.missingIntlProviderInAncestry) {
|
|
35
|
+
return /*#__PURE__*/React.createElement(IntlProvider, {
|
|
36
|
+
locale: "en"
|
|
37
|
+
}, this.props.children);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return this.props.children;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { intlShape } from 'react-intl';
|
|
4
|
+
import { createIntl, RawIntlProvider } from 'react-intl-next';
|
|
5
|
+
export class LegacyToNextIntlProvider extends React.Component {
|
|
6
|
+
render() {
|
|
7
|
+
const oldIntl = this.context.intl;
|
|
8
|
+
|
|
9
|
+
if (oldIntl) {
|
|
10
|
+
const nextIntl = createIntl({ ...oldIntl
|
|
11
|
+
});
|
|
12
|
+
return /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
13
|
+
value: nextIntl
|
|
14
|
+
}, this.props.children);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return this.props.children;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
_defineProperty(LegacyToNextIntlProvider, "contextTypes", {
|
|
23
|
+
intl: intlShape
|
|
24
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useRef } from 'react';
|
|
2
|
-
import { injectIntl } from 'react-intl';
|
|
2
|
+
import { injectIntl } from 'react-intl-next';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
5
5
|
import QuestionsIcon from '@atlaskit/icon/glyph/question-circle';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useRef } from 'react';
|
|
2
|
-
import { injectIntl } from 'react-intl';
|
|
2
|
+
import { injectIntl } from 'react-intl-next';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
5
5
|
import QuestionsIcon from '@atlaskit/icon/glyph/question-circle';
|
package/dist/es2019/ui/index.js
CHANGED
|
@@ -20,4 +20,7 @@ export { default as overflowShadow, shadowClassNames } from './OverflowShadow';
|
|
|
20
20
|
export { WithCreateAnalyticsEvent } from './WithCreateAnalyticsEvent';
|
|
21
21
|
export { messages as expandMessages, sharedExpandStyles, ExpandIconWrapper, ExpandLayoutWrapper } from './Expand';
|
|
22
22
|
export { ErrorMessage, HelperMessage, ValidMessage } from './Messages';
|
|
23
|
-
export { ClearNextSiblingMarginTop } from './clear-next-sibling-margin-top';
|
|
23
|
+
export { ClearNextSiblingMarginTop } from './clear-next-sibling-margin-top';
|
|
24
|
+
export { IntlNextErrorBoundary, REACT_INTL_ERROR_MESSAGE } from './IntlNextErrorBoundary';
|
|
25
|
+
export { IntlLegacyFallbackProvider } from './IntlLegacyFallbackProvider';
|
|
26
|
+
export { LegacyToNextIntlProvider } from './LegacyToNextIntlProvider';
|
|
@@ -70,9 +70,8 @@ export const timestampToTaskContext = (timestamp, intl) => {
|
|
|
70
70
|
const sameYear = givenDate.getUTCFullYear() === curDate.getUTCFullYear();
|
|
71
71
|
|
|
72
72
|
if (intl && [-1, 0, 1].indexOf(distance) > -1) {
|
|
73
|
-
return capitalizeFirstLetter(intl.
|
|
74
|
-
|
|
75
|
-
now: Number(todayTimestampInUTC())
|
|
73
|
+
return capitalizeFirstLetter(intl.formatRelativeTime(distance, 'day', {
|
|
74
|
+
numeric: 'auto'
|
|
76
75
|
}));
|
|
77
76
|
}
|
|
78
77
|
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -19,7 +19,7 @@ StatusSharedCssClassName, smartCardSharedStyles, SmartCardSharedCssClassName } f
|
|
|
19
19
|
|
|
20
20
|
export { BaseTheme, Caption, ClearNextSiblingMarginTop, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, Emoji, //exported from ./src/emoji.ts
|
|
21
21
|
ErrorMessage, ExpandIconWrapper, ExpandLayoutWrapper, HelperMessage, MediaSingle, MediaSingleDimensionHelper, Mention, //exported from ./src/mention.ts
|
|
22
|
-
Popup, UnsupportedBlock, UnsupportedInline, ValidMessage, WidthConsumer, WidthProvider, WithCreateAnalyticsEvent, calcColumnsFromPx, calcPctFromPx, calcPxFromColumns, calcPxFromPct, expandMessages, findOverflowScrollParent, getBreakpoint, layoutSupportsWidth, mapBreakpointToLayoutMaxWidth, overflowShadow, shadowClassNames, sharedExpandStyles, snapToGrid, withOuterListeners, MediaLink, wrappedLayouts, shouldAddDefaultWrappedWidth } from './ui'; // new child entry point ./ui/index.tsx
|
|
22
|
+
Popup, UnsupportedBlock, UnsupportedInline, ValidMessage, WidthConsumer, WidthProvider, WithCreateAnalyticsEvent, calcColumnsFromPx, calcPctFromPx, calcPxFromColumns, calcPxFromPct, expandMessages, findOverflowScrollParent, getBreakpoint, layoutSupportsWidth, mapBreakpointToLayoutMaxWidth, overflowShadow, shadowClassNames, sharedExpandStyles, snapToGrid, withOuterListeners, MediaLink, wrappedLayouts, shouldAddDefaultWrappedWidth, IntlNextErrorBoundary, REACT_INTL_ERROR_MESSAGE, IntlLegacyFallbackProvider, LegacyToNextIntlProvider } from './ui'; // new child entry point ./ui/index.tsx
|
|
23
23
|
|
|
24
24
|
// already exported by ./messages/index.ts
|
|
25
25
|
export { linkMessages } from './messages/link'; // new child entry point in ./utils/index.ts
|
package/dist/esm/styles/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { textColorStyles } from './shared/text-color';
|
|
1
2
|
export { tableSharedStyle, tableMarginTop, tableMarginBottom, tableMarginSides, tableCellMinWidth, tableNewColumnMinWidth, tableCellBorderWidth, calcTableWidth, TableSharedCssClassName, tableResizeHandleWidth, tableCellPadding } from './shared/table';
|
|
2
3
|
export { AnnotationSharedClassNames, AnnotationSharedCSSByState, annotationSharedStyles } from './shared/annotation';
|
|
3
4
|
export { columnLayoutSharedStyle } from './shared/column-layout';
|
|
@@ -5,5 +5,5 @@ var _templateObject;
|
|
|
5
5
|
import { css } from 'styled-components';
|
|
6
6
|
var richMediaClassName = 'rich-media-item';
|
|
7
7
|
var wrappedMediaBreakoutPoint = 410;
|
|
8
|
-
var mediaSingleSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n li .", " {\n margin: 0;\n }\n\n /* Hack for chrome to fix media single position\n inside a list when media is the first child */\n &.ua-chrome li > .mediaSingleView-content-wrap::before {\n content: '';\n display: block;\n height: 0;\n }\n\n .mediaSingleView-content-wrap[layout='center'] {\n clear: both;\n }\n\n table .", " {\n margin-top: 12px;\n margin-bottom: 12px;\n clear: both;\n }\n\n .", ".image-wrap-right\n + .", ".image-wrap-left {\n clear: both;\n }\n\n .", ".image-wrap-left\n + .", ".image-wrap-right,\n .", ".image-wrap-right\n + .", ".image-wrap-left,\n .", ".image-wrap-left\n + .", ".image-wrap-left,\n .", ".image-wrap-right\n + .", ".image-wrap-right {\n margin-right: 0;\n margin-left: 0;\n }\n\n @media all and (max-width: ", "px) {\n div.mediaSingleView-content-wrap[layout='wrap-left'],\n div.mediaSingleView-content-wrap[data-layout='wrap-left'],\n div.mediaSingleView-content-wrap[layout='wrap-right'],\n div.mediaSingleView-content-wrap[data-layout='wrap-right'] {\n float: none;\n overflow: auto;\n margin: 12px 0;\n }\n }\n"])), richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, wrappedMediaBreakoutPoint);
|
|
8
|
+
var mediaSingleSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n li .", " {\n margin: 0;\n }\n\n /* Hack for chrome to fix media single position\n inside a list when media is the first child */\n &.ua-chrome li > .mediaSingleView-content-wrap::before {\n content: '';\n display: block;\n height: 0;\n }\n\n &.ua-firefox {\n .mediaSingleView-content-wrap {\n user-select: none;\n }\n\n .captionView-content-wrap {\n user-select: text;\n }\n }\n\n .mediaSingleView-content-wrap[layout='center'] {\n clear: both;\n }\n\n table .", " {\n margin-top: 12px;\n margin-bottom: 12px;\n clear: both;\n }\n\n .", ".image-wrap-right\n + .", ".image-wrap-left {\n clear: both;\n }\n\n .", ".image-wrap-left\n + .", ".image-wrap-right,\n .", ".image-wrap-right\n + .", ".image-wrap-left,\n .", ".image-wrap-left\n + .", ".image-wrap-left,\n .", ".image-wrap-right\n + .", ".image-wrap-right {\n margin-right: 0;\n margin-left: 0;\n }\n\n @media all and (max-width: ", "px) {\n div.mediaSingleView-content-wrap[layout='wrap-left'],\n div.mediaSingleView-content-wrap[data-layout='wrap-left'],\n div.mediaSingleView-content-wrap[layout='wrap-right'],\n div.mediaSingleView-content-wrap[data-layout='wrap-right'] {\n float: none;\n overflow: auto;\n margin: 12px 0;\n }\n }\n"])), richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, wrappedMediaBreakoutPoint);
|
|
9
9
|
export { mediaSingleSharedStyle, richMediaClassName };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject;
|
|
4
|
+
|
|
5
|
+
import { css } from 'styled-components';
|
|
6
|
+
export var textColorStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .fabric-text-color-mark {\n color: var(--custom-text-color, inherit);\n }\n\n a .fabric-text-color-mark {\n color: unset;\n }\n"])));
|
|
@@ -13,7 +13,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
13
13
|
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; } }
|
|
14
14
|
|
|
15
15
|
import React from 'react';
|
|
16
|
-
import { injectIntl } from 'react-intl';
|
|
16
|
+
import { injectIntl } from 'react-intl-next';
|
|
17
17
|
import styled from 'styled-components';
|
|
18
18
|
import { N200, N400 } from '@atlaskit/theme/colors';
|
|
19
19
|
import { messages } from './messages';
|
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
4
4
|
|
|
5
|
-
import { defineMessages } from 'react-intl';
|
|
5
|
+
import { defineMessages } from 'react-intl-next';
|
|
6
6
|
import styled, { css } from 'styled-components';
|
|
7
7
|
import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import * as colors from '@atlaskit/theme/colors';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
+
|
|
8
|
+
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); }; }
|
|
9
|
+
|
|
10
|
+
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; } }
|
|
11
|
+
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { IntlProvider, intlShape } from 'react-intl';
|
|
14
|
+
export var IntlLegacyFallbackProvider = /*#__PURE__*/function (_React$Component) {
|
|
15
|
+
_inherits(IntlLegacyFallbackProvider, _React$Component);
|
|
16
|
+
|
|
17
|
+
var _super = _createSuper(IntlLegacyFallbackProvider);
|
|
18
|
+
|
|
19
|
+
function IntlLegacyFallbackProvider() {
|
|
20
|
+
_classCallCheck(this, IntlLegacyFallbackProvider);
|
|
21
|
+
|
|
22
|
+
return _super.apply(this, arguments);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_createClass(IntlLegacyFallbackProvider, [{
|
|
26
|
+
key: "render",
|
|
27
|
+
value: function render() {
|
|
28
|
+
var oldIntl = this.context.intl;
|
|
29
|
+
|
|
30
|
+
if (!oldIntl) {
|
|
31
|
+
return /*#__PURE__*/React.createElement(IntlProvider, {
|
|
32
|
+
locale: "en"
|
|
33
|
+
}, this.props.children);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return this.props.children;
|
|
37
|
+
}
|
|
38
|
+
}]);
|
|
39
|
+
|
|
40
|
+
return IntlLegacyFallbackProvider;
|
|
41
|
+
}(React.Component);
|
|
42
|
+
|
|
43
|
+
_defineProperty(IntlLegacyFallbackProvider, "contextTypes", {
|
|
44
|
+
intl: intlShape
|
|
45
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
|
|
9
|
+
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); }; }
|
|
10
|
+
|
|
11
|
+
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; } }
|
|
12
|
+
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import { IntlProvider } from 'react-intl-next';
|
|
15
|
+
export var REACT_INTL_ERROR_MESSAGE = '<IntlProvider> needs to exist in the component ancestry';
|
|
16
|
+
|
|
17
|
+
var isMissingIntlProviderInAncestryError = function isMissingIntlProviderInAncestryError(err) {
|
|
18
|
+
var _err$toString;
|
|
19
|
+
|
|
20
|
+
return err === null || err === void 0 ? void 0 : (_err$toString = err.toString()) === null || _err$toString === void 0 ? void 0 : _err$toString.includes('<IntlProvider> needs to exist in the component ancestry');
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export var IntlNextErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
24
|
+
_inherits(IntlNextErrorBoundary, _React$Component);
|
|
25
|
+
|
|
26
|
+
var _super = _createSuper(IntlNextErrorBoundary);
|
|
27
|
+
|
|
28
|
+
function IntlNextErrorBoundary() {
|
|
29
|
+
var _this;
|
|
30
|
+
|
|
31
|
+
_classCallCheck(this, IntlNextErrorBoundary);
|
|
32
|
+
|
|
33
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34
|
+
args[_key] = arguments[_key];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
38
|
+
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
40
|
+
missingIntlProviderInAncestry: false
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
_createClass(IntlNextErrorBoundary, [{
|
|
47
|
+
key: "componentDidCatch",
|
|
48
|
+
value: function componentDidCatch(error, errorInfo) {
|
|
49
|
+
// if missing IntlProvider in ancestry, we setup a fallback IntlProvider ourselves
|
|
50
|
+
if (isMissingIntlProviderInAncestryError(error)) {
|
|
51
|
+
this.setState({
|
|
52
|
+
missingIntlProviderInAncestry: true
|
|
53
|
+
});
|
|
54
|
+
} else {
|
|
55
|
+
// else we re-propagate the non-react-intl-next error
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
key: "render",
|
|
61
|
+
value: function render() {
|
|
62
|
+
if (this.state.missingIntlProviderInAncestry) {
|
|
63
|
+
return /*#__PURE__*/React.createElement(IntlProvider, {
|
|
64
|
+
locale: "en"
|
|
65
|
+
}, this.props.children);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return this.props.children;
|
|
69
|
+
}
|
|
70
|
+
}]);
|
|
71
|
+
|
|
72
|
+
return IntlNextErrorBoundary;
|
|
73
|
+
}(React.Component);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
+
|
|
8
|
+
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; }
|
|
9
|
+
|
|
10
|
+
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; }
|
|
11
|
+
|
|
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
|
+
|
|
14
|
+
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; } }
|
|
15
|
+
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import { intlShape } from 'react-intl';
|
|
18
|
+
import { createIntl, RawIntlProvider } from 'react-intl-next';
|
|
19
|
+
export var LegacyToNextIntlProvider = /*#__PURE__*/function (_React$Component) {
|
|
20
|
+
_inherits(LegacyToNextIntlProvider, _React$Component);
|
|
21
|
+
|
|
22
|
+
var _super = _createSuper(LegacyToNextIntlProvider);
|
|
23
|
+
|
|
24
|
+
function LegacyToNextIntlProvider() {
|
|
25
|
+
_classCallCheck(this, LegacyToNextIntlProvider);
|
|
26
|
+
|
|
27
|
+
return _super.apply(this, arguments);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
_createClass(LegacyToNextIntlProvider, [{
|
|
31
|
+
key: "render",
|
|
32
|
+
value: function render() {
|
|
33
|
+
var oldIntl = this.context.intl;
|
|
34
|
+
|
|
35
|
+
if (oldIntl) {
|
|
36
|
+
var nextIntl = createIntl(_objectSpread({}, oldIntl));
|
|
37
|
+
return /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
38
|
+
value: nextIntl
|
|
39
|
+
}, this.props.children);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return this.props.children;
|
|
43
|
+
}
|
|
44
|
+
}]);
|
|
45
|
+
|
|
46
|
+
return LegacyToNextIntlProvider;
|
|
47
|
+
}(React.Component);
|
|
48
|
+
|
|
49
|
+
_defineProperty(LegacyToNextIntlProvider, "contextTypes", {
|
|
50
|
+
intl: intlShape
|
|
51
|
+
});
|
|
@@ -3,7 +3,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef } from 'react';
|
|
6
|
-
import { injectIntl } from 'react-intl';
|
|
6
|
+
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import QuestionsIcon from '@atlaskit/icon/glyph/question-circle';
|
|
@@ -3,7 +3,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef } from 'react';
|
|
6
|
-
import { injectIntl } from 'react-intl';
|
|
6
|
+
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import QuestionsIcon from '@atlaskit/icon/glyph/question-circle';
|
package/dist/esm/ui/index.js
CHANGED
|
@@ -20,4 +20,7 @@ export { default as overflowShadow, shadowClassNames } from './OverflowShadow';
|
|
|
20
20
|
export { WithCreateAnalyticsEvent } from './WithCreateAnalyticsEvent';
|
|
21
21
|
export { messages as expandMessages, sharedExpandStyles, ExpandIconWrapper, ExpandLayoutWrapper } from './Expand';
|
|
22
22
|
export { ErrorMessage, HelperMessage, ValidMessage } from './Messages';
|
|
23
|
-
export { ClearNextSiblingMarginTop } from './clear-next-sibling-margin-top';
|
|
23
|
+
export { ClearNextSiblingMarginTop } from './clear-next-sibling-margin-top';
|
|
24
|
+
export { IntlNextErrorBoundary, REACT_INTL_ERROR_MESSAGE } from './IntlNextErrorBoundary';
|
|
25
|
+
export { IntlLegacyFallbackProvider } from './IntlLegacyFallbackProvider';
|
|
26
|
+
export { LegacyToNextIntlProvider } from './LegacyToNextIntlProvider';
|
package/dist/esm/utils/date.js
CHANGED
|
@@ -70,9 +70,8 @@ export var timestampToTaskContext = function timestampToTaskContext(timestamp, i
|
|
|
70
70
|
var sameYear = givenDate.getUTCFullYear() === curDate.getUTCFullYear();
|
|
71
71
|
|
|
72
72
|
if (intl && [-1, 0, 1].indexOf(distance) > -1) {
|
|
73
|
-
return capitalizeFirstLetter(intl.
|
|
74
|
-
|
|
75
|
-
now: Number(todayTimestampInUTC())
|
|
73
|
+
return capitalizeFirstLetter(intl.formatRelativeTime(distance, 'day', {
|
|
74
|
+
numeric: 'auto'
|
|
76
75
|
}));
|
|
77
76
|
}
|
|
78
77
|
|
package/dist/esm/version.json
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ EmojiSharedCssClassName, //exported from ./src/emoji.ts
|
|
|
15
15
|
StatusSharedCssClassName, smartCardSharedStyles, SmartCardSharedCssClassName, } from './styles';
|
|
16
16
|
export { BaseTheme, Caption, ClearNextSiblingMarginTop, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, Emoji, //exported from ./src/emoji.ts
|
|
17
17
|
ErrorMessage, ExpandIconWrapper, ExpandLayoutWrapper, HelperMessage, MediaSingle, MediaSingleDimensionHelper, Mention, //exported from ./src/mention.ts
|
|
18
|
-
Popup, UnsupportedBlock, UnsupportedInline, ValidMessage, WidthConsumer, WidthProvider, WithCreateAnalyticsEvent, calcColumnsFromPx, calcPctFromPx, calcPxFromColumns, calcPxFromPct, expandMessages, findOverflowScrollParent, getBreakpoint, layoutSupportsWidth, mapBreakpointToLayoutMaxWidth, overflowShadow, shadowClassNames, sharedExpandStyles, snapToGrid, withOuterListeners, MediaLink, wrappedLayouts, shouldAddDefaultWrappedWidth, } from './ui';
|
|
18
|
+
Popup, UnsupportedBlock, UnsupportedInline, ValidMessage, WidthConsumer, WidthProvider, WithCreateAnalyticsEvent, calcColumnsFromPx, calcPctFromPx, calcPxFromColumns, calcPxFromPct, expandMessages, findOverflowScrollParent, getBreakpoint, layoutSupportsWidth, mapBreakpointToLayoutMaxWidth, overflowShadow, shadowClassNames, sharedExpandStyles, snapToGrid, withOuterListeners, MediaLink, wrappedLayouts, shouldAddDefaultWrappedWidth, IntlNextErrorBoundary, REACT_INTL_ERROR_MESSAGE, IntlLegacyFallbackProvider, LegacyToNextIntlProvider, } from './ui';
|
|
19
19
|
export type { CardEventClickHandler, CardSurroundings, EmojiProps, EventHandlers, LinkEventClickHandler, MediaSingleDimensionHelperProps, MediaSingleProps, MentionEventHandler, MentionEventHandlers, OverflowShadowOptions, OverflowShadowProps, OverflowShadowState, PopupPosition, PopupProps, SmartCardEventClickHandler, WidthConsumerContext, ExpandStyleProps, } from './ui';
|
|
20
20
|
export { linkMessages } from './messages/link';
|
|
21
21
|
export { validateADFEntity, validationErrorHandler, } from './utils/validate-using-spec';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { textColorStyles } from './shared/text-color';
|
|
1
2
|
export { tableSharedStyle, tableMarginTop, tableMarginBottom, tableMarginSides, tableCellMinWidth, tableNewColumnMinWidth, tableCellBorderWidth, calcTableWidth, TableSharedCssClassName, tableResizeHandleWidth, tableCellPadding, } from './shared/table';
|
|
2
3
|
export { AnnotationSharedClassNames, AnnotationSharedCSSByState, annotationSharedStyles, } from './shared/annotation';
|
|
3
4
|
export { columnLayoutSharedStyle } from './shared/column-layout';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const textColorStyles: import("styled-components").InterpolationValue[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
declare type Props = {
|
|
4
4
|
selected?: boolean;
|
|
5
5
|
hasContent?: boolean;
|
|
@@ -8,10 +8,10 @@ declare type Props = {
|
|
|
8
8
|
'data-renderer-start-pos': number;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
export declare class CaptionComponent extends React.Component<Props &
|
|
11
|
+
export declare class CaptionComponent extends React.Component<Props & WrappedComponentProps> {
|
|
12
12
|
render(): JSX.Element;
|
|
13
13
|
}
|
|
14
|
-
declare const _default: React.
|
|
15
|
-
WrappedComponent:
|
|
14
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
15
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
16
16
|
};
|
|
17
17
|
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ErrorBoundaryProps {
|
|
3
|
+
}
|
|
4
|
+
interface ErrorBoundaryState {
|
|
5
|
+
missingIntlProviderInAncestry: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const REACT_INTL_ERROR_MESSAGE = "<IntlProvider> needs to exist in the component ancestry";
|
|
8
|
+
export declare class IntlNextErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
9
|
+
state: {
|
|
10
|
+
missingIntlProviderInAncestry: boolean;
|
|
11
|
+
};
|
|
12
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
13
|
+
render(): {} | null | undefined;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Node as PMNode } from 'prosemirror-model';
|
|
3
|
-
import {
|
|
3
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import { UnsupportedContentTooltipPayload } from '../../utils';
|
|
5
5
|
export interface Props {
|
|
6
6
|
node?: PMNode;
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
dispatchAnalyticsEvent?: (payload: UnsupportedContentTooltipPayload) => void;
|
|
9
9
|
}
|
|
10
|
-
declare const _default: React.
|
|
11
|
-
WrappedComponent:
|
|
10
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
11
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
12
12
|
};
|
|
13
13
|
export default _default;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Node as PMNode } from 'prosemirror-model';
|
|
3
|
-
import {
|
|
3
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import { UnsupportedContentTooltipPayload } from '../../utils';
|
|
5
5
|
export interface Props {
|
|
6
6
|
node?: PMNode;
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
dispatchAnalyticsEvent?: (payload: UnsupportedContentTooltipPayload) => void;
|
|
9
9
|
}
|
|
10
|
-
declare const _default: React.
|
|
11
|
-
WrappedComponent:
|
|
10
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
11
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
12
12
|
};
|
|
13
13
|
export default _default;
|
package/dist/types/ui/index.d.ts
CHANGED
|
@@ -24,3 +24,6 @@ export { messages as expandMessages, sharedExpandStyles, ExpandIconWrapper, Expa
|
|
|
24
24
|
export type { StyleProps as ExpandStyleProps } from './Expand';
|
|
25
25
|
export { ErrorMessage, HelperMessage, ValidMessage } from './Messages';
|
|
26
26
|
export { ClearNextSiblingMarginTop } from './clear-next-sibling-margin-top';
|
|
27
|
+
export { IntlNextErrorBoundary, REACT_INTL_ERROR_MESSAGE, } from './IntlNextErrorBoundary';
|
|
28
|
+
export { IntlLegacyFallbackProvider } from './IntlLegacyFallbackProvider';
|
|
29
|
+
export { LegacyToNextIntlProvider } from './LegacyToNextIntlProvider';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Node as PMNode } from 'prosemirror-model';
|
|
2
|
-
import {
|
|
3
|
-
export declare function getUnsupportedContent(message: any, prefix: string, node?: PMNode, intl?:
|
|
2
|
+
import { IntlShape } from 'react-intl-next';
|
|
3
|
+
export declare function getUnsupportedContent(message: any, prefix: string, node?: PMNode, intl?: IntlShape): any;
|