@atlaskit/code 14.5.2 → 14.5.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,17 @@
1
1
  # @atlaskit/code
2
2
 
3
+ ## 14.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY remove before merging to master; dupe adf-schema via adf-utils
8
+
9
+ ## 14.5.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`74750bef5c4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/74750bef5c4) - Fixes some bugs with the long line wrapping and syntax-highlighting changes that were released in v14.5.0.
14
+
3
15
  ## 14.5.2
4
16
 
5
17
  ### Patch Changes
package/dist/cjs/code.js CHANGED
@@ -22,6 +22,7 @@ var _bidiWarningDecorator = _interopRequireDefault(require("./bidi-warning/bidi-
22
22
  var _styles = require("./internal/theme/styles");
23
23
  var _excluded = ["testId"],
24
24
  _excluded2 = ["children", "codeBidiWarnings", "codeBidiWarningLabel", "codeBidiWarningTooltipEnabled"];
25
+ /** @jsx jsx */
25
26
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
26
27
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
28
  /**
@@ -50,7 +50,7 @@ var syntaxKeywordColors = function syntaxKeywordColors(theme) {
50
50
  return {
51
51
  '.token': {
52
52
  // this specifically stops prism css cascading.
53
- '&:not([class=token],[data-ds--code--row--highlight])': {
53
+ '&:not([class=token],[data-ds--code--row--highlight],[data-ds--code--row])': {
54
54
  all: 'unset'
55
55
  },
56
56
  // additional specificity required to match the all: unset
@@ -6,7 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = createLineElement;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
10
  var _getInlineLineNumber = _interopRequireDefault(require("./get-inline-line-number"));
11
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
13
  function createLineElement(_ref) {
11
14
  var children = _ref.children,
12
15
  lineNumber = _ref.lineNumber,
@@ -15,8 +18,10 @@ function createLineElement(_ref) {
15
18
  lineProps = _ref$lineProps === void 0 ? {} : _ref$lineProps,
16
19
  _ref$className = _ref.className,
17
20
  className = _ref$className === void 0 ? [] : _ref$className;
18
- var properties = typeof lineProps === 'function' ? lineProps(lineNumber) : lineProps;
19
- properties.className = className;
21
+ var propsPassedInFromCodeBlock = typeof lineProps === 'function' ? lineProps(lineNumber) : lineProps;
22
+ var properties = _objectSpread(_objectSpread({}, propsPassedInFromCodeBlock), {}, {
23
+ className: className
24
+ });
20
25
  var currentChildren = children;
21
26
  if (lineNumber && showLineNumbers) {
22
27
  // When syntax highlighting is NOT turned on, the entire LOC is just a single
@@ -28,4 +28,9 @@ var SyntaxHighlighter = /*#__PURE__*/function (_React$PureComponent) {
28
28
  * Function that receives current line number as argument and returns a
29
29
  * line props object to be applied to each `span` wrapping code line.
30
30
  */
31
+ /**
32
+ * Props to be passed to the `span` wrapping each code line. Can be an
33
+ * object or a function that receives current line number as argument and
34
+ * returns a props object.
35
+ */
31
36
  exports.SyntaxHighlighter = SyntaxHighlighter;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.5.2",
3
+ "version": "14.5.4",
4
4
  "sideEffects": false
5
5
  }
@@ -36,7 +36,7 @@ const lineNumberStyle = theme => ({
36
36
  const syntaxKeywordColors = theme => ({
37
37
  '.token': {
38
38
  // this specifically stops prism css cascading.
39
- '&:not([class=token],[data-ds--code--row--highlight])': {
39
+ '&:not([class=token],[data-ds--code--row--highlight],[data-ds--code--row])': {
40
40
  all: 'unset'
41
41
  },
42
42
  // additional specificity required to match the all: unset
@@ -6,8 +6,11 @@ export default function createLineElement({
6
6
  lineProps = {},
7
7
  className = []
8
8
  }) {
9
- const properties = typeof lineProps === 'function' ? lineProps(lineNumber) : lineProps;
10
- properties.className = className;
9
+ const propsPassedInFromCodeBlock = typeof lineProps === 'function' ? lineProps(lineNumber) : lineProps;
10
+ const properties = {
11
+ ...propsPassedInFromCodeBlock,
12
+ className
13
+ };
11
14
  let currentChildren = children;
12
15
  if (lineNumber && showLineNumbers) {
13
16
  // When syntax highlighting is NOT turned on, the entire LOC is just a single
@@ -6,4 +6,10 @@ export class SyntaxHighlighter extends React.PureComponent {}
6
6
  /**
7
7
  * Function that receives current line number as argument and returns a
8
8
  * line props object to be applied to each `span` wrapping code line.
9
+ */
10
+
11
+ /**
12
+ * Props to be passed to the `span` wrapping each code line. Can be an
13
+ * object or a function that receives current line number as argument and
14
+ * returns a props object.
9
15
  */
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.5.2",
3
+ "version": "14.5.4",
4
4
  "sideEffects": false
5
5
  }
@@ -42,7 +42,7 @@ var syntaxKeywordColors = function syntaxKeywordColors(theme) {
42
42
  return {
43
43
  '.token': {
44
44
  // this specifically stops prism css cascading.
45
- '&:not([class=token],[data-ds--code--row--highlight])': {
45
+ '&:not([class=token],[data-ds--code--row--highlight],[data-ds--code--row])': {
46
46
  all: 'unset'
47
47
  },
48
48
  // additional specificity required to match the all: unset
@@ -1,4 +1,7 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2
5
  import getInlineLineNumber from './get-inline-line-number';
3
6
  export default function createLineElement(_ref) {
4
7
  var children = _ref.children,
@@ -8,8 +11,10 @@ export default function createLineElement(_ref) {
8
11
  lineProps = _ref$lineProps === void 0 ? {} : _ref$lineProps,
9
12
  _ref$className = _ref.className,
10
13
  className = _ref$className === void 0 ? [] : _ref$className;
11
- var properties = typeof lineProps === 'function' ? lineProps(lineNumber) : lineProps;
12
- properties.className = className;
14
+ var propsPassedInFromCodeBlock = typeof lineProps === 'function' ? lineProps(lineNumber) : lineProps;
15
+ var properties = _objectSpread(_objectSpread({}, propsPassedInFromCodeBlock), {}, {
16
+ className: className
17
+ });
13
18
  var currentChildren = children;
14
19
  if (lineNumber && showLineNumbers) {
15
20
  // When syntax highlighting is NOT turned on, the entire LOC is just a single
@@ -21,4 +21,10 @@ export var SyntaxHighlighter = /*#__PURE__*/function (_React$PureComponent) {
21
21
  /**
22
22
  * Function that receives current line number as argument and returns a
23
23
  * line props object to be applied to each `span` wrapping code line.
24
+ */
25
+
26
+ /**
27
+ * Props to be passed to the `span` wrapping each code line. Can be an
28
+ * object or a function that receives current line number as argument and
29
+ * returns a props object.
24
30
  */
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.5.2",
3
+ "version": "14.5.4",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.5.2",
3
+ "version": "14.5.4",
4
4
  "description": "Code highlights short strings of code snippets inline with body text.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@atlaskit/codemod-utils": "^4.1.0",
30
- "@atlaskit/theme": "^12.3.0",
30
+ "@atlaskit/theme": "^12.4.0",
31
31
  "@atlaskit/tokens": "^1.2.0",
32
32
  "@atlaskit/tooltip": "^17.7.0",
33
33
  "@babel/runtime": "^7.0.0",
@@ -39,12 +39,12 @@
39
39
  "react": "^16.8.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@atlaskit/button": "^16.5.0",
42
+ "@atlaskit/button": "^16.6.0",
43
43
  "@atlaskit/docs": "^9.0.0",
44
44
  "@atlaskit/ds-explorations": "^2.0.1",
45
45
  "@atlaskit/ds-lib": "^2.1.0",
46
- "@atlaskit/form": "^8.8.0",
47
- "@atlaskit/primitives": "^0.4.0",
46
+ "@atlaskit/form": "^8.9.0",
47
+ "@atlaskit/primitives": "^0.8.0",
48
48
  "@atlaskit/section-message": "^6.3.0",
49
49
  "@atlaskit/ssr": "*",
50
50
  "@atlaskit/toggle": "^12.5.0",