@atlaskit/popper 5.2.10 → 5.3.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/popper
2
2
 
3
+ ## 5.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`6d5881c30a4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6d5881c30a4) - Introducing in-product testing entrypoints to popper.
8
+
9
+ ## 5.2.11
10
+
11
+ ### Patch Changes
12
+
13
+ - [`dc53dc3201b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dc53dc3201b) - Add 'productPushConsumption' as a new optional field in package.json.
14
+
15
+ _Note_:
16
+ We want to track the information if the package was moved from the pull into the push model in the product.
17
+ Hence, we extended the `package.json` file by adding a new field e.g.: "atlassian.productPushConsumption": ["jira"]
18
+ This field is optional.
19
+
3
20
  ## 5.2.10
4
21
 
5
22
  ### Patch Changes
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "popperRendersWithPositionFixedTestCase", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _popper.popperRendersWithPositionFixedTestCase;
10
+ }
11
+ });
12
+
13
+ var _popper = require("./test-cases/popper");
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.BasePopperPageObject = void 0;
9
+
10
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
+
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
+
14
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
+
16
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
+
18
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
+
20
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
+
22
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
+
24
+ var _inProductTesting = require("@atlaskit/in-product-testing");
25
+
26
+ 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); }; }
27
+
28
+ 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; } }
29
+
30
+ var BasePopperPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
31
+ (0, _inherits2.default)(BasePopperPageObject, _InProductTestPageObj);
32
+
33
+ var _super = _createSuper(BasePopperPageObject);
34
+
35
+ function BasePopperPageObject(cy) {
36
+ var _this;
37
+
38
+ (0, _classCallCheck2.default)(this, BasePopperPageObject);
39
+ _this = _super.call(this, cy);
40
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "assertPopperStyle", function (elementSelector) {
41
+ return _this.cy.get(elementSelector).should('be.visbile');
42
+ });
43
+ return _this;
44
+ }
45
+
46
+ return (0, _createClass2.default)(BasePopperPageObject);
47
+ }(_inProductTesting.InProductTestPageObject);
48
+
49
+ exports.BasePopperPageObject = BasePopperPageObject;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.popperRendersWithPositionFixedTestCase = void 0;
7
+
8
+ var _inProductTesting = require("@atlaskit/in-product-testing");
9
+
10
+ var _basePopper = require("../page-objects/base-popper");
11
+
12
+ var popperRendersWithPositionFixedTestCase = function popperRendersWithPositionFixedTestCase(elementSelector) {
13
+ return new _inProductTesting.InProductTestCase({
14
+ title: 'Popped container renders with position fixed',
15
+ id: 'popped-container-fixed-position',
16
+ assertions: function assertions(cy) {
17
+ var popperElement = new _basePopper.BasePopperPageObject(cy);
18
+ popperElement.assertPopperStyle(elementSelector);
19
+ }
20
+ });
21
+ };
22
+
23
+ exports.popperRendersWithPositionFixedTestCase = popperRendersWithPositionFixedTestCase;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "popperRendersWithPositionFixedTestCase", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _tests_external__.popperRendersWithPositionFixedTestCase;
10
+ }
11
+ });
12
+
13
+ var _tests_external__ = require("./__tests_external__");
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/popper",
3
- "version": "5.2.10",
3
+ "version": "5.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1 @@
1
+ export { popperRendersWithPositionFixedTestCase } from './test-cases/popper';
@@ -0,0 +1,12 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import { InProductTestPageObject } from '@atlaskit/in-product-testing';
3
+ export class BasePopperPageObject extends InProductTestPageObject {
4
+ constructor(cy) {
5
+ super(cy);
6
+
7
+ _defineProperty(this, "assertPopperStyle", elementSelector => {
8
+ return this.cy.get(elementSelector).should('be.visbile');
9
+ });
10
+ }
11
+
12
+ }
@@ -0,0 +1,10 @@
1
+ import { InProductTestCase } from '@atlaskit/in-product-testing';
2
+ import { BasePopperPageObject } from '../page-objects/base-popper';
3
+ export const popperRendersWithPositionFixedTestCase = elementSelector => new InProductTestCase({
4
+ title: 'Popped container renders with position fixed',
5
+ id: 'popped-container-fixed-position',
6
+ assertions: cy => {
7
+ const popperElement = new BasePopperPageObject(cy);
8
+ popperElement.assertPopperStyle(elementSelector);
9
+ }
10
+ });
@@ -0,0 +1 @@
1
+ export { popperRendersWithPositionFixedTestCase } from './__tests_external__';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/popper",
3
- "version": "5.2.10",
3
+ "version": "5.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1 @@
1
+ export { popperRendersWithPositionFixedTestCase } from './test-cases/popper';
@@ -0,0 +1,34 @@
1
+ import _createClass from "@babel/runtime/helpers/createClass";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
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 { InProductTestPageObject } from '@atlaskit/in-product-testing';
14
+ export var BasePopperPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
15
+ _inherits(BasePopperPageObject, _InProductTestPageObj);
16
+
17
+ var _super = _createSuper(BasePopperPageObject);
18
+
19
+ function BasePopperPageObject(cy) {
20
+ var _this;
21
+
22
+ _classCallCheck(this, BasePopperPageObject);
23
+
24
+ _this = _super.call(this, cy);
25
+
26
+ _defineProperty(_assertThisInitialized(_this), "assertPopperStyle", function (elementSelector) {
27
+ return _this.cy.get(elementSelector).should('be.visbile');
28
+ });
29
+
30
+ return _this;
31
+ }
32
+
33
+ return _createClass(BasePopperPageObject);
34
+ }(InProductTestPageObject);
@@ -0,0 +1,12 @@
1
+ import { InProductTestCase } from '@atlaskit/in-product-testing';
2
+ import { BasePopperPageObject } from '../page-objects/base-popper';
3
+ export var popperRendersWithPositionFixedTestCase = function popperRendersWithPositionFixedTestCase(elementSelector) {
4
+ return new InProductTestCase({
5
+ title: 'Popped container renders with position fixed',
6
+ id: 'popped-container-fixed-position',
7
+ assertions: function assertions(cy) {
8
+ var popperElement = new BasePopperPageObject(cy);
9
+ popperElement.assertPopperStyle(elementSelector);
10
+ }
11
+ });
12
+ };
@@ -0,0 +1 @@
1
+ export { popperRendersWithPositionFixedTestCase } from './__tests_external__';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/popper",
3
- "version": "5.2.10",
3
+ "version": "5.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1 @@
1
+ export { popperRendersWithPositionFixedTestCase } from './test-cases/popper';
@@ -0,0 +1,6 @@
1
+ /// <reference types="cypress" />
2
+ import { CypressType, InProductTestPageObject } from '@atlaskit/in-product-testing';
3
+ export declare class BasePopperPageObject extends InProductTestPageObject {
4
+ constructor(cy: CypressType);
5
+ assertPopperStyle: (elementSelector: keyof HTMLElementTagNameMap) => Cypress.Chainable<JQuery<HTMLObjectElement | HTMLElement | HTMLHeadElement | HTMLLinkElement | HTMLSourceElement | HTMLBodyElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBRElement | HTMLButtonElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDirectoryElement | HTMLDivElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFontElement | HTMLFormElement | HTMLFrameElement | HTMLFrameSetElement | HTMLHeadingElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMapElement | HTMLMarqueeElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLParamElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement>>;
6
+ }
@@ -0,0 +1,2 @@
1
+ import { InProductTestCase } from '@atlaskit/in-product-testing';
2
+ export declare const popperRendersWithPositionFixedTestCase: (elementSelector: keyof HTMLElementTagNameMap) => InProductTestCase;
@@ -0,0 +1 @@
1
+ export { popperRendersWithPositionFixedTestCase } from './__tests_external__';
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/popper/in-product",
3
+ "main": "../dist/cjs/in-product.js",
4
+ "module": "../dist/esm/in-product.js",
5
+ "module:es2019": "../dist/es2019/in-product.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/in-product.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/in-product.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popper",
3
- "version": "5.2.10",
3
+ "version": "5.3.0",
4
4
  "description": "Wrapper for react-popper with common config and some helpers",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -23,9 +23,11 @@
23
23
  "sideEffects": false,
24
24
  "atlaskit:src": "src/index.tsx",
25
25
  "atlassian": {
26
- "disableProductCI": true,
27
- "team": "Design System Team",
28
- "releaseModel": "scheduled",
26
+ "team": "UIP: Cycle Time Flex",
27
+ "releaseModel": "continuous",
28
+ "productPushConsumption": [
29
+ "jira"
30
+ ],
29
31
  "website": {
30
32
  "name": "Popper",
31
33
  "category": "Components"
@@ -33,9 +35,11 @@
33
35
  },
34
36
  "af:exports": {
35
37
  ".": "./src/index.tsx",
36
- "./Popper": "./src/popper.tsx"
38
+ "./Popper": "./src/popper.tsx",
39
+ "./in-product": "./src/in-product.tsx"
37
40
  },
38
41
  "dependencies": {
42
+ "@atlaskit/in-product-testing": "^0.1.5",
39
43
  "@babel/runtime": "^7.0.0",
40
44
  "@popperjs/core": "^2.9.1",
41
45
  "react-popper": "^2.2.3"
@@ -44,7 +48,7 @@
44
48
  "react": "^16.8.0"
45
49
  },
46
50
  "devDependencies": {
47
- "@atlaskit/button": "^16.3.0",
51
+ "@atlaskit/button": "^16.4.0",
48
52
  "@atlaskit/docs": "*",
49
53
  "@atlaskit/ds-lib": "^2.1.0",
50
54
  "@atlaskit/ssr": "*",
package/report.api.md CHANGED
@@ -1,8 +1,17 @@
1
- ## API Report File for "@atlaskit/popper".
1
+ <!-- API Report Version: 2.3 -->
2
2
 
3
- > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
3
+ ## API Report File for "@atlaskit/popper"
4
4
 
5
- [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
5
+ > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
6
+ > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
+
8
+ ### Table of contents
9
+
10
+ - [Main Entry Types](#main-entry-types)
11
+
12
+ ### Main Entry Types
13
+
14
+ <!--SECTION START: Main Entry Types-->
6
15
 
7
16
  ```ts
8
17
  import { Manager } from 'react-popper';
@@ -19,32 +28,13 @@ import { ReferenceProps } from 'react-popper';
19
28
  import { StrictModifier } from 'react-popper';
20
29
  import { VirtualElement } from '@popperjs/core';
21
30
 
22
- declare interface CustomPopperProps<Modifiers> {
23
- /**
24
- * Returns the element to be positioned.
25
- */
31
+ // @public (undocumented)
32
+ interface CustomPopperProps<Modifiers> {
26
33
  children?: (childrenProps: PopperChildrenProps) => React_2.ReactNode;
27
- /**
28
- * Distance the popup should be offset from the reference in the format of [along, away] (units in px).
29
- * Defaults to [0, 8] - which means the popup will be 8px away from the edge of the reference specified
30
- * by the `placement` prop.
31
- */
34
+ modifiers?: PopperProps<Modifiers>['modifiers'];
32
35
  offset?: Offset;
33
- /**
34
- * Which side of the Reference to show on.
35
- */
36
36
  placement?: Placement;
37
- /**
38
- * Replacement reference element to position popper relative to.
39
- */
40
37
  referenceElement?: HTMLElement | VirtualElement;
41
- /**
42
- * Additional modifiers and modifier overwrites.
43
- */
44
- modifiers?: PopperProps<Modifiers>['modifiers'];
45
- /**
46
- * Placement strategy used. Can be 'fixed' or 'absolute'
47
- */
48
38
  strategy?: PopperProps<Modifiers>['strategy'];
49
39
  }
50
40
 
@@ -54,13 +44,15 @@ export { ManagerProps };
54
44
 
55
45
  export { Modifier };
56
46
 
57
- declare type Offset = [number | null | undefined, number | null | undefined];
47
+ // @public (undocumented)
48
+ type Offset = [null | number | undefined, null | number | undefined];
58
49
 
59
50
  export { Placement };
60
51
 
61
52
  export { placements };
62
53
 
63
- export declare function Popper<CustomModifiers>({
54
+ // @public (undocumented)
55
+ export function Popper<CustomModifiers>({
64
56
  children,
65
57
  offset,
66
58
  placement,
@@ -81,5 +73,7 @@ export { ReferenceProps };
81
73
 
82
74
  export { StrictModifier };
83
75
 
84
- export {};
76
+ // (No @packageDocumentation comment for this package)
85
77
  ```
78
+
79
+ <!--SECTION END: Main Entry Types-->
@@ -0,0 +1,61 @@
1
+ ## API Report File for "@atlaskit/popper"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { Manager } from 'react-popper';
8
+ import { ManagerProps } from 'react-popper';
9
+ import { Modifier } from 'react-popper';
10
+ import { Placement } from '@popperjs/core';
11
+ import { placements } from '@popperjs/core';
12
+ import { PopperArrowProps } from 'react-popper';
13
+ import { PopperChildrenProps } from 'react-popper';
14
+ import { PopperProps } from 'react-popper';
15
+ import { default as React_2 } from 'react';
16
+ import { Reference } from 'react-popper';
17
+ import { ReferenceProps } from 'react-popper';
18
+ import { StrictModifier } from 'react-popper';
19
+ import { VirtualElement } from '@popperjs/core';
20
+
21
+ // @public (undocumented)
22
+ interface CustomPopperProps<Modifiers> {
23
+ children?: (childrenProps: PopperChildrenProps) => React_2.ReactNode;
24
+ modifiers?: PopperProps<Modifiers>['modifiers'];
25
+ offset?: Offset;
26
+ placement?: Placement;
27
+ referenceElement?: HTMLElement | VirtualElement;
28
+ strategy?: PopperProps<Modifiers>['strategy'];
29
+ }
30
+
31
+ export { Manager }
32
+
33
+ export { ManagerProps }
34
+
35
+ export { Modifier }
36
+
37
+ // @public (undocumented)
38
+ type Offset = [null | number | undefined, null | number | undefined];
39
+
40
+ export { Placement }
41
+
42
+ export { placements }
43
+
44
+ // @public (undocumented)
45
+ export function Popper<CustomModifiers>({ children, offset, placement, referenceElement, modifiers, strategy, }: CustomPopperProps<CustomModifiers>): JSX.Element;
46
+
47
+ export { PopperArrowProps }
48
+
49
+ export { PopperChildrenProps }
50
+
51
+ export { PopperProps }
52
+
53
+ export { Reference }
54
+
55
+ export { ReferenceProps }
56
+
57
+ export { StrictModifier }
58
+
59
+ // (No @packageDocumentation comment for this package)
60
+
61
+ ```
@@ -1,3 +0,0 @@
1
- export { Popper, placements } from './popper';
2
- export type { ManagerProps, ReferenceProps, PopperProps, PopperArrowProps, PopperChildrenProps, StrictModifier, Modifier, Placement, } from './popper';
3
- export { Manager, Reference } from 'react-popper';
@@ -1,39 +0,0 @@
1
- import React from 'react';
2
- import { Placement, VirtualElement } from '@popperjs/core';
3
- import { PopperChildrenProps, PopperProps } from 'react-popper';
4
- export { placements } from '@popperjs/core';
5
- export type { Placement, VirtualElement } from '@popperjs/core';
6
- export type { ManagerProps, ReferenceProps, PopperProps, PopperArrowProps, PopperChildrenProps, StrictModifier, Modifier, } from 'react-popper';
7
- declare type Offset = [
8
- number | null | undefined,
9
- number | null | undefined
10
- ];
11
- export interface CustomPopperProps<Modifiers> {
12
- /**
13
- * Returns the element to be positioned.
14
- */
15
- children?: (childrenProps: PopperChildrenProps) => React.ReactNode;
16
- /**
17
- * Distance the popup should be offset from the reference in the format of [along, away] (units in px).
18
- * Defaults to [0, 8] - which means the popup will be 8px away from the edge of the reference specified
19
- * by the `placement` prop.
20
- */
21
- offset?: Offset;
22
- /**
23
- * Which side of the Reference to show on.
24
- */
25
- placement?: Placement;
26
- /**
27
- * Replacement reference element to position popper relative to.
28
- */
29
- referenceElement?: HTMLElement | VirtualElement;
30
- /**
31
- * Additional modifiers and modifier overwrites.
32
- */
33
- modifiers?: PopperProps<Modifiers>['modifiers'];
34
- /**
35
- * Placement strategy used. Can be 'fixed' or 'absolute'
36
- */
37
- strategy?: PopperProps<Modifiers>['strategy'];
38
- }
39
- export declare function Popper<CustomModifiers>({ children, offset, placement, referenceElement, modifiers, strategy, }: CustomPopperProps<CustomModifiers>): JSX.Element;