@atlaskit/media-document-viewer 0.3.7 → 0.4.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,19 @@
1
1
  # @atlaskit/media-document-viewer
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`a3ad3feab3758`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a3ad3feab3758) -
8
+ Add support for mulitline form fields for PDF forms
9
+
10
+ ## 0.3.8
11
+
12
+ ### Patch Changes
13
+
14
+ - [`407e1dc11eeed`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/407e1dc11eeed) -
15
+ Minor changes to border radius values.
16
+
3
17
  ## 0.3.7
4
18
 
5
19
  ### Patch Changes
@@ -1,5 +1,6 @@
1
1
 
2
- ._19itglyw{border:none}._19bvidpf{padding-left:0}
2
+ ._19itglyw{border:none}._14zgglyw{resize:none}
3
+ ._19bvidpf{padding-left:0}
3
4
  ._1bah1yb4{justify-content:space-between}
4
5
  ._1bsb1osq{width:100%}
5
6
  ._1e0c11p5{display:grid}
@@ -10,4 +11,5 @@
10
11
  ._n3tdidpf{padding-bottom:0}
11
12
  ._r06hglyw{-webkit-appearance:none;appearance:none}
12
13
  ._u5f3idpf{padding-right:0}
14
+ ._vchhusvi{box-sizing:border-box}
13
15
  ._yv0e1ghl{grid-template-columns:1fr auto}
@@ -1,4 +1,4 @@
1
- /* annotations.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* annotations.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -8,8 +8,8 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.TextInputFormField = exports.ComboBoxFormField = exports.Annotations = void 0;
9
9
  require("./annotations.compiled.css");
10
10
  var _runtime = require("@compiled/react/runtime");
11
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
  var _react = _interopRequireDefault(require("react"));
14
14
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
15
15
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
@@ -18,28 +18,37 @@ var textInputStyles = null;
18
18
  var foreignObjectProps = {
19
19
  xmlns: 'http://www.w3.org/1999/xhtml'
20
20
  };
21
- var TextInputFormField = exports.TextInputFormField = function TextInputFormField(_ref) {
22
- var field = _ref.field,
23
- dataTestId = _ref.dataTestId;
24
- return /*#__PURE__*/_react.default.createElement("foreignObject", {
25
- x: field.x,
26
- y: -field.y,
27
- width: field.w,
28
- height: field.h,
29
- "data-testid": dataTestId
30
- }, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, foreignObjectProps, {
31
- style: (0, _defineProperty2.default)({}, 'fontSize', "".concat(field.f, "px")),
32
- type: "text",
33
- value: field.text,
34
- readOnly: true,
21
+ var TextInput = function TextInput(_ref) {
22
+ var Component = _ref.as,
23
+ value = _ref.value;
24
+ return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, foreignObjectProps, {
35
25
  onKeyUp: function onKeyUp(e) {
36
26
  // stop propagation of the arrow key events because they can be used to navigate viewports
37
27
  if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
38
28
  e.stopPropagation();
39
29
  }
40
30
  },
41
- className: (0, _runtime.ax)(["_19itglyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _r06hglyw", "_kqswstnw _4t3i1osq _1bsb1osq"])
42
- })));
31
+ value: value,
32
+ type: "text",
33
+ readOnly: true,
34
+ className: (0, _runtime.ax)(["_19itglyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _r06hglyw _14zgglyw", "_kqswstnw _4t3i1osq _vchhusvi _1bsb1osq"])
35
+ }));
36
+ };
37
+ var TextInputFormField = exports.TextInputFormField = function TextInputFormField(_ref2) {
38
+ var field = _ref2.field,
39
+ dataTestId = _ref2.dataTestId;
40
+ var style = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, 'fontSize', "".concat(field.f, "px")), "width", '100%'), "boxSizing", 'border-box');
41
+ return /*#__PURE__*/_react.default.createElement("foreignObject", {
42
+ x: field.x,
43
+ y: -field.y,
44
+ width: field.w,
45
+ height: field.h,
46
+ "data-testid": dataTestId
47
+ }, /*#__PURE__*/_react.default.createElement(TextInput, {
48
+ style: style,
49
+ as: field.multiline ? 'textarea' : 'input',
50
+ value: field.text
51
+ }));
43
52
  };
44
53
  var comboBoxStyles = null;
45
54
  var comboBoxInputStyles = null;
@@ -66,7 +75,7 @@ var ComboBoxFormField = exports.ComboBoxFormField = function ComboBoxFormField(_
66
75
  }
67
76
  },
68
77
  readOnly: true,
69
- className: (0, _runtime.ax)(["_19itglyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _r06hglyw", "_1bsb1osq"])
78
+ className: (0, _runtime.ax)(["_19itglyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _r06hglyw _14zgglyw", "_1bsb1osq"])
70
79
  }), /*#__PURE__*/_react.default.createElement(_chevronDown.default, {
71
80
  label: "",
72
81
  size: "small"
@@ -1,4 +1,4 @@
1
- /* documentViewer.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* documentViewer.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
package/dist/cjs/page.js CHANGED
@@ -1,4 +1,4 @@
1
- /* page.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* page.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,5 +1,6 @@
1
1
 
2
- ._19itglyw{border:none}._19bvidpf{padding-left:0}
2
+ ._19itglyw{border:none}._14zgglyw{resize:none}
3
+ ._19bvidpf{padding-left:0}
3
4
  ._1bah1yb4{justify-content:space-between}
4
5
  ._1bsb1osq{width:100%}
5
6
  ._1e0c11p5{display:grid}
@@ -10,4 +11,5 @@
10
11
  ._n3tdidpf{padding-bottom:0}
11
12
  ._r06hglyw{-webkit-appearance:none;appearance:none}
12
13
  ._u5f3idpf{padding-right:0}
14
+ ._vchhusvi{box-sizing:border-box}
13
15
  ._yv0e1ghl{grid-template-columns:1fr auto}
@@ -1,4 +1,4 @@
1
- /* annotations.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* annotations.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./annotations.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -11,31 +11,41 @@ const textInputStyles = null;
11
11
  const foreignObjectProps = {
12
12
  xmlns: 'http://www.w3.org/1999/xhtml'
13
13
  };
14
+ const TextInput = ({
15
+ as: Component,
16
+ value
17
+ }) => /*#__PURE__*/React.createElement(Component, _extends({}, foreignObjectProps, {
18
+ onKeyUp: e => {
19
+ // stop propagation of the arrow key events because they can be used to navigate viewports
20
+ if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
21
+ e.stopPropagation();
22
+ }
23
+ },
24
+ value: value,
25
+ type: "text",
26
+ readOnly: true,
27
+ className: ax(["_19itglyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _r06hglyw _14zgglyw", "_kqswstnw _4t3i1osq _vchhusvi _1bsb1osq"])
28
+ }));
14
29
  export const TextInputFormField = ({
15
30
  field,
16
31
  dataTestId
17
32
  }) => {
33
+ const style = {
34
+ ['fontSize']: `${field.f}px`,
35
+ width: '100%',
36
+ boxSizing: 'border-box'
37
+ };
18
38
  return /*#__PURE__*/React.createElement("foreignObject", {
19
39
  x: field.x,
20
40
  y: -field.y,
21
41
  width: field.w,
22
42
  height: field.h,
23
43
  "data-testid": dataTestId
24
- }, /*#__PURE__*/React.createElement("input", _extends({}, foreignObjectProps, {
25
- style: {
26
- ['fontSize']: `${field.f}px`
27
- },
28
- type: "text",
29
- value: field.text,
30
- readOnly: true,
31
- onKeyUp: e => {
32
- // stop propagation of the arrow key events because they can be used to navigate viewports
33
- if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
34
- e.stopPropagation();
35
- }
36
- },
37
- className: ax(["_19itglyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _r06hglyw", "_kqswstnw _4t3i1osq _1bsb1osq"])
38
- })));
44
+ }, /*#__PURE__*/React.createElement(TextInput, {
45
+ style: style,
46
+ as: field.multiline ? 'textarea' : 'input',
47
+ value: field.text
48
+ }));
39
49
  };
40
50
  const comboBoxStyles = null;
41
51
  const comboBoxInputStyles = null;
@@ -65,7 +75,7 @@ export const ComboBoxFormField = ({
65
75
  }
66
76
  },
67
77
  readOnly: true,
68
- className: ax(["_19itglyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _r06hglyw", "_1bsb1osq"])
78
+ className: ax(["_19itglyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _r06hglyw _14zgglyw", "_1bsb1osq"])
69
79
  }), /*#__PURE__*/React.createElement(ChevronDownIcon, {
70
80
  label: "",
71
81
  size: "small"
@@ -1,4 +1,4 @@
1
- /* documentViewer.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* documentViewer.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./documentViewer.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* page.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* page.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./page.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,5 +1,6 @@
1
1
 
2
- ._19itglyw{border:none}._19bvidpf{padding-left:0}
2
+ ._19itglyw{border:none}._14zgglyw{resize:none}
3
+ ._19bvidpf{padding-left:0}
3
4
  ._1bah1yb4{justify-content:space-between}
4
5
  ._1bsb1osq{width:100%}
5
6
  ._1e0c11p5{display:grid}
@@ -10,4 +11,5 @@
10
11
  ._n3tdidpf{padding-bottom:0}
11
12
  ._r06hglyw{-webkit-appearance:none;appearance:none}
12
13
  ._u5f3idpf{padding-right:0}
14
+ ._vchhusvi{box-sizing:border-box}
13
15
  ._yv0e1ghl{grid-template-columns:1fr auto}
@@ -1,6 +1,6 @@
1
- /* annotations.tsx generated by @compiled/babel-plugin v0.36.1 */
2
- import _extends from "@babel/runtime/helpers/extends";
1
+ /* annotations.tsx generated by @compiled/babel-plugin v0.38.1 */
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _extends from "@babel/runtime/helpers/extends";
4
4
  import "./annotations.compiled.css";
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
@@ -12,28 +12,37 @@ var textInputStyles = null;
12
12
  var foreignObjectProps = {
13
13
  xmlns: 'http://www.w3.org/1999/xhtml'
14
14
  };
15
- export var TextInputFormField = function TextInputFormField(_ref) {
16
- var field = _ref.field,
17
- dataTestId = _ref.dataTestId;
18
- return /*#__PURE__*/React.createElement("foreignObject", {
19
- x: field.x,
20
- y: -field.y,
21
- width: field.w,
22
- height: field.h,
23
- "data-testid": dataTestId
24
- }, /*#__PURE__*/React.createElement("input", _extends({}, foreignObjectProps, {
25
- style: _defineProperty({}, 'fontSize', "".concat(field.f, "px")),
26
- type: "text",
27
- value: field.text,
28
- readOnly: true,
15
+ var TextInput = function TextInput(_ref) {
16
+ var Component = _ref.as,
17
+ value = _ref.value;
18
+ return /*#__PURE__*/React.createElement(Component, _extends({}, foreignObjectProps, {
29
19
  onKeyUp: function onKeyUp(e) {
30
20
  // stop propagation of the arrow key events because they can be used to navigate viewports
31
21
  if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
32
22
  e.stopPropagation();
33
23
  }
34
24
  },
35
- className: ax(["_19itglyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _r06hglyw", "_kqswstnw _4t3i1osq _1bsb1osq"])
36
- })));
25
+ value: value,
26
+ type: "text",
27
+ readOnly: true,
28
+ className: ax(["_19itglyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _r06hglyw _14zgglyw", "_kqswstnw _4t3i1osq _vchhusvi _1bsb1osq"])
29
+ }));
30
+ };
31
+ export var TextInputFormField = function TextInputFormField(_ref2) {
32
+ var field = _ref2.field,
33
+ dataTestId = _ref2.dataTestId;
34
+ var style = _defineProperty(_defineProperty(_defineProperty({}, 'fontSize', "".concat(field.f, "px")), "width", '100%'), "boxSizing", 'border-box');
35
+ return /*#__PURE__*/React.createElement("foreignObject", {
36
+ x: field.x,
37
+ y: -field.y,
38
+ width: field.w,
39
+ height: field.h,
40
+ "data-testid": dataTestId
41
+ }, /*#__PURE__*/React.createElement(TextInput, {
42
+ style: style,
43
+ as: field.multiline ? 'textarea' : 'input',
44
+ value: field.text
45
+ }));
37
46
  };
38
47
  var comboBoxStyles = null;
39
48
  var comboBoxInputStyles = null;
@@ -60,7 +69,7 @@ export var ComboBoxFormField = function ComboBoxFormField(_ref3) {
60
69
  }
61
70
  },
62
71
  readOnly: true,
63
- className: ax(["_19itglyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _r06hglyw", "_1bsb1osq"])
72
+ className: ax(["_19itglyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _r06hglyw _14zgglyw", "_1bsb1osq"])
64
73
  }), /*#__PURE__*/React.createElement(ChevronDownIcon, {
65
74
  label: "",
66
75
  size: "small"
@@ -1,4 +1,4 @@
1
- /* documentViewer.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* documentViewer.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
3
  import "./documentViewer.compiled.css";
4
4
  import * as React from 'react';
package/dist/esm/page.js CHANGED
@@ -1,4 +1,4 @@
1
- /* page.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* page.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import "./page.compiled.css";
@@ -45,6 +45,7 @@ export type TextField = {
45
45
  w: number;
46
46
  h: number;
47
47
  f: number;
48
+ multiline: boolean;
48
49
  text: string;
49
50
  };
50
51
  export type ComboBoxField = {
@@ -45,6 +45,7 @@ export type TextField = {
45
45
  w: number;
46
46
  h: number;
47
47
  f: number;
48
+ multiline: boolean;
48
49
  text: string;
49
50
  };
50
51
  export type ComboBoxField = {
package/package.json CHANGED
@@ -26,11 +26,11 @@
26
26
  "dependencies": {
27
27
  "@atlaskit/browser-apis": "^0.0.1",
28
28
  "@atlaskit/css": "^0.14.0",
29
- "@atlaskit/icon": "^28.1.0",
29
+ "@atlaskit/icon": "^28.3.0",
30
30
  "@atlaskit/media-common": "^12.3.0",
31
- "@atlaskit/primitives": "^14.14.0",
31
+ "@atlaskit/primitives": "^14.15.0",
32
32
  "@atlaskit/spinner": "^19.0.0",
33
- "@atlaskit/tokens": "^6.3.0",
33
+ "@atlaskit/tokens": "^6.4.0",
34
34
  "@babel/runtime": "^7.0.0",
35
35
  "@compiled/react": "^0.18.3"
36
36
  },
@@ -81,7 +81,7 @@
81
81
  }
82
82
  },
83
83
  "name": "@atlaskit/media-document-viewer",
84
- "version": "0.3.7",
84
+ "version": "0.4.0",
85
85
  "description": "Modern and fast document viewer",
86
86
  "author": "Atlassian Pty Ltd",
87
87
  "license": "Apache-2.0",