@atlaskit/editor-core 203.2.1 → 203.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/composable-editor/core-editor.js +2 -0
  3. package/dist/cjs/composable-editor/editor-internal.js +2 -3
  4. package/dist/cjs/composable-editor/temp_useTrackDangerousPlugins.js +35 -0
  5. package/dist/cjs/create-editor/ReactEditorViewNext.js +1 -1
  6. package/dist/cjs/ui/ContentStyles/layout.js +1 -1
  7. package/dist/cjs/version-wrapper.js +1 -1
  8. package/dist/es2019/composable-editor/core-editor.js +2 -0
  9. package/dist/es2019/composable-editor/editor-internal.js +2 -3
  10. package/dist/es2019/composable-editor/temp_useTrackDangerousPlugins.js +27 -0
  11. package/dist/es2019/create-editor/ReactEditorViewNext.js +1 -1
  12. package/dist/es2019/ui/ContentStyles/layout.js +1 -0
  13. package/dist/es2019/version-wrapper.js +1 -1
  14. package/dist/esm/composable-editor/core-editor.js +2 -0
  15. package/dist/esm/composable-editor/editor-internal.js +2 -3
  16. package/dist/esm/composable-editor/temp_useTrackDangerousPlugins.js +29 -0
  17. package/dist/esm/create-editor/ReactEditorViewNext.js +1 -1
  18. package/dist/esm/ui/ContentStyles/layout.js +1 -1
  19. package/dist/esm/version-wrapper.js +1 -1
  20. package/dist/types/composable-editor/temp_useTrackDangerousPlugins.d.ts +3 -0
  21. package/dist/types/create-editor/create-universal-preset.d.ts +244 -19
  22. package/dist/types/presets/default.d.ts +174 -14
  23. package/dist/types/presets/universal.d.ts +244 -19
  24. package/dist/types/presets/useUniversalPreset.d.ts +244 -19
  25. package/dist/types-ts4.5/composable-editor/temp_useTrackDangerousPlugins.d.ts +3 -0
  26. package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +276 -18
  27. package/dist/types-ts4.5/presets/default.d.ts +198 -14
  28. package/dist/types-ts4.5/presets/universal.d.ts +276 -18
  29. package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +276 -18
  30. package/package.json +20 -9
  31. package/dist/cjs/nodeviews/context-adapter.js +0 -78
  32. package/dist/es2019/nodeviews/context-adapter.js +0 -48
  33. package/dist/esm/nodeviews/context-adapter.js +0 -71
  34. package/dist/types/nodeviews/context-adapter.d.ts +0 -2
  35. package/dist/types-ts4.5/nodeviews/context-adapter.d.ts +0 -2
@@ -1,48 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
4
- import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
5
- import { SmartCardContext } from '@atlaskit/link-provider';
6
- function useContextMemoized(reactContext) {
7
- const value = React.useContext(reactContext);
8
- const context = React.useMemo(() => ({
9
- Provider: reactContext.Provider,
10
- Consumer: reactContext.Consumer,
11
- value
12
- }), [value, reactContext]);
13
- return context;
14
- }
15
-
16
- // injects contexts via old context API to children
17
- // and gives access to the original Provider so that
18
- // the child can re-emit it
19
- export const ContextAdapter = ({
20
- children
21
- }) => {
22
- const card = useContextMemoized(SmartCardContext);
23
- const analytics = useContextMemoized(AnalyticsReactContext);
24
- return /*#__PURE__*/React.createElement(LegacyContextAdapter, {
25
- card: card,
26
- analytics: analytics
27
- }, children);
28
- };
29
- class LegacyContextAdapter extends React.PureComponent {
30
- constructor(...args) {
31
- super(...args);
32
- _defineProperty(this, "contextState", {});
33
- }
34
- getChildContext() {
35
- return {
36
- contextAdapter: {
37
- card: this.props.card,
38
- analytics: this.props.analytics
39
- }
40
- };
41
- }
42
- render() {
43
- return this.props.children;
44
- }
45
- }
46
- _defineProperty(LegacyContextAdapter, "childContextTypes", {
47
- contextAdapter: PropTypes.object
48
- });
@@ -1,71 +0,0 @@
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
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
9
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
- import React from 'react';
11
- import PropTypes from 'prop-types';
12
- import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
13
- import { SmartCardContext } from '@atlaskit/link-provider';
14
- function useContextMemoized(reactContext) {
15
- var value = React.useContext(reactContext);
16
- var context = React.useMemo(function () {
17
- return {
18
- Provider: reactContext.Provider,
19
- Consumer: reactContext.Consumer,
20
- value: value
21
- };
22
- }, [value, reactContext]);
23
- return context;
24
- }
25
-
26
- // injects contexts via old context API to children
27
- // and gives access to the original Provider so that
28
- // the child can re-emit it
29
- export var ContextAdapter = function ContextAdapter(_ref) {
30
- var children = _ref.children;
31
- var card = useContextMemoized(SmartCardContext);
32
- var analytics = useContextMemoized(AnalyticsReactContext);
33
- return /*#__PURE__*/React.createElement(LegacyContextAdapter, {
34
- card: card,
35
- analytics: analytics
36
- }, children);
37
- };
38
- var LegacyContextAdapter = /*#__PURE__*/function (_React$PureComponent) {
39
- _inherits(LegacyContextAdapter, _React$PureComponent);
40
- var _super = _createSuper(LegacyContextAdapter);
41
- function LegacyContextAdapter() {
42
- var _this;
43
- _classCallCheck(this, LegacyContextAdapter);
44
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
45
- args[_key] = arguments[_key];
46
- }
47
- _this = _super.call.apply(_super, [this].concat(args));
48
- _defineProperty(_assertThisInitialized(_this), "contextState", {});
49
- return _this;
50
- }
51
- _createClass(LegacyContextAdapter, [{
52
- key: "getChildContext",
53
- value: function getChildContext() {
54
- return {
55
- contextAdapter: {
56
- card: this.props.card,
57
- analytics: this.props.analytics
58
- }
59
- };
60
- }
61
- }, {
62
- key: "render",
63
- value: function render() {
64
- return this.props.children;
65
- }
66
- }]);
67
- return LegacyContextAdapter;
68
- }(React.PureComponent);
69
- _defineProperty(LegacyContextAdapter, "childContextTypes", {
70
- contextAdapter: PropTypes.object
71
- });
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const ContextAdapter: ({ children }: React.PropsWithChildren<{}>) => JSX.Element;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const ContextAdapter: ({ children }: React.PropsWithChildren<{}>) => JSX.Element;