@atlaskit/editor-plugin-placeholder-text 1.0.3 → 1.0.4

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-placeholder-text
2
2
 
3
+ ## 1.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#82109](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/82109) [`2ab37a71220d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2ab37a71220d) - Setup react 18 types for @atlaskit/editor-plugin-placeholder-text
8
+
3
9
  ## 1.0.3
4
10
 
5
11
  ### Patch Changes
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = void 0;
7
+ exports.default = FloatingToolbar;
8
8
  Object.defineProperty(exports, "getNearestNonTextNode", {
9
9
  enumerable: true,
10
10
  get: function get() {
@@ -23,66 +23,48 @@ Object.defineProperty(exports, "handlePositionCalculatedWith", {
23
23
  return _utils.handlePositionCalculatedWith;
24
24
  }
25
25
  });
26
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
27
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
28
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
29
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
30
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
31
- var _react = require("react");
26
+ var _react = _interopRequireDefault(require("react"));
32
27
  var _react2 = require("@emotion/react");
33
28
  var _ui = require("@atlaskit/editor-common/ui");
34
29
  var _styles = require("./styles");
35
30
  var _utils = require("./utils");
36
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
37
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/prefer-primitives */ /** @jsx jsx */
38
- // eslint-disable-next-line @repo/internal/react/no-class-components
39
- var FloatingToolbar = exports.default = /*#__PURE__*/function (_PureComponent) {
40
- (0, _inherits2.default)(FloatingToolbar, _PureComponent);
41
- var _super = _createSuper(FloatingToolbar);
42
- function FloatingToolbar() {
43
- (0, _classCallCheck2.default)(this, FloatingToolbar);
44
- return _super.apply(this, arguments);
31
+ /* eslint-disable @atlaskit/design-system/prefer-primitives */
32
+ /** @jsx jsx */
33
+
34
+ function FloatingToolbar(_ref) {
35
+ var children = _ref.children,
36
+ target = _ref.target,
37
+ offset = _ref.offset,
38
+ fitWidth = _ref.fitWidth,
39
+ _ref$fitHeight = _ref.fitHeight,
40
+ fitHeight = _ref$fitHeight === void 0 ? 40 : _ref$fitHeight,
41
+ onPositionCalculated = _ref.onPositionCalculated,
42
+ popupsMountPoint = _ref.popupsMountPoint,
43
+ popupsBoundariesElement = _ref.popupsBoundariesElement,
44
+ className = _ref.className,
45
+ absoluteOffset = _ref.absoluteOffset,
46
+ alignX = _ref.alignX,
47
+ alignY = _ref.alignY,
48
+ zIndex = _ref.zIndex;
49
+ if (!target) {
50
+ return null;
45
51
  }
46
- (0, _createClass2.default)(FloatingToolbar, [{
47
- key: "render",
48
- value: function render() {
49
- var _this$props = this.props,
50
- children = _this$props.children,
51
- target = _this$props.target,
52
- offset = _this$props.offset,
53
- fitWidth = _this$props.fitWidth,
54
- _this$props$fitHeight = _this$props.fitHeight,
55
- fitHeight = _this$props$fitHeight === void 0 ? 40 : _this$props$fitHeight,
56
- onPositionCalculated = _this$props.onPositionCalculated,
57
- popupsMountPoint = _this$props.popupsMountPoint,
58
- popupsBoundariesElement = _this$props.popupsBoundariesElement,
59
- className = _this$props.className,
60
- absoluteOffset = _this$props.absoluteOffset,
61
- alignX = _this$props.alignX,
62
- alignY = _this$props.alignY,
63
- zIndex = _this$props.zIndex;
64
- if (!target) {
65
- return null;
66
- }
67
- return (0, _react2.jsx)(_ui.Popup, {
68
- absoluteOffset: absoluteOffset,
69
- alignX: alignX,
70
- alignY: alignY,
71
- target: target,
72
- zIndex: zIndex,
73
- mountTo: popupsMountPoint,
74
- boundariesElement: popupsBoundariesElement,
75
- offset: offset,
76
- fitWidth: fitWidth,
77
- fitHeight: fitHeight,
78
- onPositionCalculated: onPositionCalculated
79
- }, (0, _react2.jsx)("div", {
80
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
81
- css: (0, _styles.container)(fitHeight),
82
- "data-testid": "popup-container",
83
- className: className
84
- }, children));
85
- }
86
- }]);
87
- return FloatingToolbar;
88
- }(_react.PureComponent);
52
+ return (0, _react2.jsx)(_ui.Popup, {
53
+ absoluteOffset: absoluteOffset,
54
+ alignX: alignX,
55
+ alignY: alignY,
56
+ target: target,
57
+ zIndex: zIndex,
58
+ mountTo: popupsMountPoint,
59
+ boundariesElement: popupsBoundariesElement,
60
+ offset: offset,
61
+ fitWidth: fitWidth,
62
+ fitHeight: fitHeight,
63
+ onPositionCalculated: onPositionCalculated
64
+ }, (0, _react2.jsx)("div", {
65
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
66
+ css: (0, _styles.container)(fitHeight),
67
+ "data-testid": "popup-container",
68
+ className: className
69
+ }, children));
70
+ }
@@ -1,49 +1,44 @@
1
1
  /* eslint-disable @atlaskit/design-system/prefer-primitives */
2
2
  /** @jsx jsx */
3
- import { PureComponent } from 'react';
3
+ import React from 'react';
4
4
  import { jsx } from '@emotion/react';
5
5
  import { Popup } from '@atlaskit/editor-common/ui';
6
6
  import { container } from './styles';
7
7
  export { handlePositionCalculatedWith, getOffsetParent, getNearestNonTextNode } from './utils';
8
-
9
- // eslint-disable-next-line @repo/internal/react/no-class-components
10
- export default class FloatingToolbar extends PureComponent {
11
- render() {
12
- const {
13
- children,
14
- target,
15
- offset,
16
- fitWidth,
17
- fitHeight = 40,
18
- onPositionCalculated,
19
- popupsMountPoint,
20
- popupsBoundariesElement,
21
- className,
22
- absoluteOffset,
23
- alignX,
24
- alignY,
25
- zIndex
26
- } = this.props;
27
- if (!target) {
28
- return null;
29
- }
30
- return jsx(Popup, {
31
- absoluteOffset: absoluteOffset,
32
- alignX: alignX,
33
- alignY: alignY,
34
- target: target,
35
- zIndex: zIndex,
36
- mountTo: popupsMountPoint,
37
- boundariesElement: popupsBoundariesElement,
38
- offset: offset,
39
- fitWidth: fitWidth,
40
- fitHeight: fitHeight,
41
- onPositionCalculated: onPositionCalculated
42
- }, jsx("div", {
43
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
44
- css: container(fitHeight),
45
- "data-testid": "popup-container",
46
- className: className
47
- }, children));
8
+ export default function FloatingToolbar({
9
+ children,
10
+ target,
11
+ offset,
12
+ fitWidth,
13
+ fitHeight = 40,
14
+ onPositionCalculated,
15
+ popupsMountPoint,
16
+ popupsBoundariesElement,
17
+ className,
18
+ absoluteOffset,
19
+ alignX,
20
+ alignY,
21
+ zIndex
22
+ }) {
23
+ if (!target) {
24
+ return null;
48
25
  }
26
+ return jsx(Popup, {
27
+ absoluteOffset: absoluteOffset,
28
+ alignX: alignX,
29
+ alignY: alignY,
30
+ target: target,
31
+ zIndex: zIndex,
32
+ mountTo: popupsMountPoint,
33
+ boundariesElement: popupsBoundariesElement,
34
+ offset: offset,
35
+ fitWidth: fitWidth,
36
+ fitHeight: fitHeight,
37
+ onPositionCalculated: onPositionCalculated
38
+ }, jsx("div", {
39
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
40
+ css: container(fitHeight),
41
+ "data-testid": "popup-container",
42
+ className: className
43
+ }, children));
49
44
  }
@@ -1,67 +1,44 @@
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
- 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); }; }
7
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
1
  /* eslint-disable @atlaskit/design-system/prefer-primitives */
9
2
  /** @jsx jsx */
10
- import { PureComponent } from 'react';
3
+ import React from 'react';
11
4
  import { jsx } from '@emotion/react';
12
5
  import { Popup } from '@atlaskit/editor-common/ui';
13
6
  import { container } from './styles';
14
7
  export { handlePositionCalculatedWith, getOffsetParent, getNearestNonTextNode } from './utils';
15
-
16
- // eslint-disable-next-line @repo/internal/react/no-class-components
17
- var FloatingToolbar = /*#__PURE__*/function (_PureComponent) {
18
- _inherits(FloatingToolbar, _PureComponent);
19
- var _super = _createSuper(FloatingToolbar);
20
- function FloatingToolbar() {
21
- _classCallCheck(this, FloatingToolbar);
22
- return _super.apply(this, arguments);
8
+ export default function FloatingToolbar(_ref) {
9
+ var children = _ref.children,
10
+ target = _ref.target,
11
+ offset = _ref.offset,
12
+ fitWidth = _ref.fitWidth,
13
+ _ref$fitHeight = _ref.fitHeight,
14
+ fitHeight = _ref$fitHeight === void 0 ? 40 : _ref$fitHeight,
15
+ onPositionCalculated = _ref.onPositionCalculated,
16
+ popupsMountPoint = _ref.popupsMountPoint,
17
+ popupsBoundariesElement = _ref.popupsBoundariesElement,
18
+ className = _ref.className,
19
+ absoluteOffset = _ref.absoluteOffset,
20
+ alignX = _ref.alignX,
21
+ alignY = _ref.alignY,
22
+ zIndex = _ref.zIndex;
23
+ if (!target) {
24
+ return null;
23
25
  }
24
- _createClass(FloatingToolbar, [{
25
- key: "render",
26
- value: function render() {
27
- var _this$props = this.props,
28
- children = _this$props.children,
29
- target = _this$props.target,
30
- offset = _this$props.offset,
31
- fitWidth = _this$props.fitWidth,
32
- _this$props$fitHeight = _this$props.fitHeight,
33
- fitHeight = _this$props$fitHeight === void 0 ? 40 : _this$props$fitHeight,
34
- onPositionCalculated = _this$props.onPositionCalculated,
35
- popupsMountPoint = _this$props.popupsMountPoint,
36
- popupsBoundariesElement = _this$props.popupsBoundariesElement,
37
- className = _this$props.className,
38
- absoluteOffset = _this$props.absoluteOffset,
39
- alignX = _this$props.alignX,
40
- alignY = _this$props.alignY,
41
- zIndex = _this$props.zIndex;
42
- if (!target) {
43
- return null;
44
- }
45
- return jsx(Popup, {
46
- absoluteOffset: absoluteOffset,
47
- alignX: alignX,
48
- alignY: alignY,
49
- target: target,
50
- zIndex: zIndex,
51
- mountTo: popupsMountPoint,
52
- boundariesElement: popupsBoundariesElement,
53
- offset: offset,
54
- fitWidth: fitWidth,
55
- fitHeight: fitHeight,
56
- onPositionCalculated: onPositionCalculated
57
- }, jsx("div", {
58
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
59
- css: container(fitHeight),
60
- "data-testid": "popup-container",
61
- className: className
62
- }, children));
63
- }
64
- }]);
65
- return FloatingToolbar;
66
- }(PureComponent);
67
- export { FloatingToolbar as default };
26
+ return jsx(Popup, {
27
+ absoluteOffset: absoluteOffset,
28
+ alignX: alignX,
29
+ alignY: alignY,
30
+ target: target,
31
+ zIndex: zIndex,
32
+ mountTo: popupsMountPoint,
33
+ boundariesElement: popupsBoundariesElement,
34
+ offset: offset,
35
+ fitWidth: fitWidth,
36
+ fitHeight: fitHeight,
37
+ onPositionCalculated: onPositionCalculated
38
+ }, jsx("div", {
39
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
40
+ css: container(fitHeight),
41
+ "data-testid": "popup-container",
42
+ className: className
43
+ }, children));
44
+ }
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { PureComponent } from 'react';
2
+ import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  export type Coordinates = {
5
5
  left?: number;
@@ -9,6 +9,7 @@ export type Coordinates = {
9
9
  };
10
10
  export type PositionOffset = Coordinates;
11
11
  export interface Props {
12
+ children?: React.ReactNode;
12
13
  zIndex?: number;
13
14
  className?: string;
14
15
  target?: HTMLElement;
@@ -23,6 +24,4 @@ export interface Props {
23
24
  onPositionCalculated?: (position: Coordinates) => Coordinates;
24
25
  }
25
26
  export { handlePositionCalculatedWith, getOffsetParent, getNearestNonTextNode, } from './utils';
26
- export default class FloatingToolbar extends PureComponent<Props, unknown> {
27
- render(): jsx.JSX.Element | null;
28
- }
27
+ export default function FloatingToolbar({ children, target, offset, fitWidth, fitHeight, onPositionCalculated, popupsMountPoint, popupsBoundariesElement, className, absoluteOffset, alignX, alignY, zIndex, }: Props): jsx.JSX.Element | null;
@@ -11,6 +11,7 @@ export interface Props {
11
11
  editorViewDOM: HTMLElement;
12
12
  popupsMountPoint?: HTMLElement;
13
13
  popupsBoundariesElement?: HTMLElement;
14
+ children?: React.ReactNode;
14
15
  }
15
16
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
16
17
  WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { PureComponent } from 'react';
2
+ import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  export type Coordinates = {
5
5
  left?: number;
@@ -9,6 +9,7 @@ export type Coordinates = {
9
9
  };
10
10
  export type PositionOffset = Coordinates;
11
11
  export interface Props {
12
+ children?: React.ReactNode;
12
13
  zIndex?: number;
13
14
  className?: string;
14
15
  target?: HTMLElement;
@@ -23,6 +24,4 @@ export interface Props {
23
24
  onPositionCalculated?: (position: Coordinates) => Coordinates;
24
25
  }
25
26
  export { handlePositionCalculatedWith, getOffsetParent, getNearestNonTextNode, } from './utils';
26
- export default class FloatingToolbar extends PureComponent<Props, unknown> {
27
- render(): jsx.JSX.Element | null;
28
- }
27
+ export default function FloatingToolbar({ children, target, offset, fitWidth, fitHeight, onPositionCalculated, popupsMountPoint, popupsBoundariesElement, className, absoluteOffset, alignX, alignY, zIndex, }: Props): jsx.JSX.Element | null;
@@ -11,6 +11,7 @@ export interface Props {
11
11
  editorViewDOM: HTMLElement;
12
12
  popupsMountPoint?: HTMLElement;
13
13
  popupsBoundariesElement?: HTMLElement;
14
+ children?: React.ReactNode;
14
15
  }
15
16
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
16
17
  WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-placeholder-text",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "placeholder text plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@atlaskit/adf-schema": "^35.6.0",
32
- "@atlaskit/editor-common": "^78.12.0",
32
+ "@atlaskit/editor-common": "^78.14.0",
33
33
  "@atlaskit/editor-plugin-analytics": "^1.0.0",
34
34
  "@atlaskit/editor-plugin-type-ahead": "^1.0.0",
35
35
  "@atlaskit/editor-prosemirror": "3.0.0",
@@ -79,11 +79,9 @@
79
79
  "ui-components": [
80
80
  "lite-mode"
81
81
  ],
82
- "deprecation": [
83
- "no-deprecated-imports"
84
- ],
82
+ "deprecation": "no-deprecated-imports",
85
83
  "styling": [
86
- "static",
84
+ "emotion",
87
85
  "emotion"
88
86
  ],
89
87
  "imports": [
@@ -104,4 +102,4 @@
104
102
  "./styles": "./src/styles.ts"
105
103
  },
106
104
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
107
- }
105
+ }