nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: styled-system/styled-system
Pull request #568 (2019-06-19 01:15:41)

Use system scale on negative positional properties
`top`, `bottom`, `left`, & `right` now all use system values for
negative numbers.

Additionally, this change prompted a refactor of the
transforms object into a reducer to avoid all the repetition. LMK if that's not cool.


Patch:
diff --git a/packages/css/README.md b/packages/css/README.md
index 265d565..af23c9b 100644
--- a/packages/css/README.md
+++ b/packages/css/README.md
@@ -68,6 +68,10 @@ Property  | Theme Key
 `paddingLeft`, `pl` | `space`
 `paddingX`, `px` | `space`
 `paddingY`, `py` | `space`
+`top` | `space`
+`bottom` | `space`
+`left` | `space`
+`right` | `space`
 `border` | `borders`
 `borderTop` | `borders`
 `borderRight` | `borders`
diff --git a/packages/css/src/index.js b/packages/css/src/index.js
index 9ee41df..8706915 100644
--- a/packages/css/src/index.js
+++ b/packages/css/src/index.js
@@ -57,6 +57,10 @@ const scales = {
   paddingLeft: 'space',
   paddingX: 'space',
   paddingY: 'space',
+  top: 'space',
+  right: 'space',
+  bottom: 'space',
+  left: 'space',
   fontFamily: 'fonts',
   fontSize: 'fontSizes',
   fontWeight: 'fontWeights',
@@ -85,7 +89,7 @@ const scales = {
   maxHeight: 'sizes',
 }
 
-const getMargin = (scale, value) => {
+const positiveOrNegative = (scale, value) => {
   if (typeof value !== 'number' || value >= 0) {
     return get(scale, value, value)
   }
@@ -95,20 +99,33 @@ const getMargin = (scale, value) => {
   return n * -1
 }
 
-const transforms = {
-  margin: getMargin,
-  marginTop: getMargin,
-  marginRight: getMargin,
-  marginBottom: getMargin,
-  marginLeft: getMargin,
-  marginX: getMargin,
-  marginY: getMargin,
-}
+const transforms = [
+  'margin',
+  'marginTop',
+  'marginRight',
+  'marginBottom',
+  'marginLeft',
+  'marginX',
+  'marginY',
+  'top',
+  'bottom',
+  'left',
+  'right',
+].reduce(
+  (acc, curr) => ({
+    ...acc,
+    [curr]: positiveOrNegative,
+  }),
+  {}
+)
 
 export const responsive = styles => theme => {
   const next = {}
   const breakpoints = get(theme, 'breakpoints', defaultBreakpoints)
-  const mediaQueries = [ null, ...breakpoints.map(n => `@media screen and (min-width: ${n})`) ]
+  const mediaQueries = [
+    null,
+    ...breakpoints.map(n => `@media screen and (min-width: ${n})`),
+  ]
 
   for (const key in styles) {
     const value = styles[key]


Test patch:
diff --git a/packages/css/test/index.js b/packages/css/test/index.js
index bb1c192..930baae 100644
--- a/packages/css/test/index.js
+++ b/packages/css/test/index.js
@@ -226,3 +226,18 @@ test('handles negative margins from scale', () => {
     marginRight: -32,
   })
 })
+
+test('handles negative top, left, bottom, and right from scale', () => {
+  const result = css({
+    top: -1,
+    right: -4,
+    bottom: -3,
+    left: -2,
+  })(theme)
+  expect(result).toEqual({
+    top: -4,
+    right: -32,
+    bottom: -16,
+    left: -8,
+  })
+})
Repository: styled-system/styled-system
Pull request #589 (2019-06-28 23:28:08)

Position: Use space scale for top/right/bottom/left
Hi, @jxnblk 👋 

This pull request connects the `top`, `right`, `bottom` and `left` style functions in the `position` category to the `space` theme scale. If there's a reason that they shouldn't use the `space` scale feel free to close this PR 😄  

I noticed this issue when I was using the `Absolute` component from `@primer/components` and expected `<Absolute top={3}>` to render a box `16px` from the top not `3px` from the top.


Patch:
diff --git a/docs/table.md b/docs/table.md
index dd1b8d3..3f346a1 100644
--- a/docs/table.md
+++ b/docs/table.md
@@ -169,10 +169,10 @@ import { position } from 'styled-system'
 | ---------- | ------------ | ----------- |
 | `position` | `position`   | none        |
 | `zIndex`   | `z-index`    | `zIndices`  |
-| `top`      | `top`        | none        |
-| `right`    | `right`      | none        |
-| `bottom`   | `bottom`     | none        |
-| `left`     | `left`       | none        |
+| `top`      | `top`        | `space`     |
+| `right`    | `right`      | `space`     |
+| `bottom`   | `bottom`     | `space`     |
+| `left`     | `left`       | `space`     |
 
 ## Shadow
 
diff --git a/packages/position/src/index.js b/packages/position/src/index.js
index 317b610..eb406f0 100644
--- a/packages/position/src/index.js
+++ b/packages/position/src/index.js
@@ -1,15 +1,35 @@
 import { system } from '@styled-system/core'
 
+const defaults = {
+  space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
+}
+
 const config = {
   position: true,
   zIndex: {
     property: 'zIndex',
     scale: 'zIndices',
   },
-  top: true,
-  right: true,
-  bottom: true,
-  left: true,
+  top: {
+    property: 'top',
+    scale: 'space',
+    defaultScale: defaults.space,
+  },
+  right: {
+    property: 'right',
+    scale: 'space',
+    defaultScale: defaults.space,
+  },
+  bottom: {
+    property: 'bottom',
+    scale: 'space',
+    defaultScale: defaults.space,
+  },
+  left: {
+    property: 'left',
+    scale: 'space',
+    defaultScale: defaults.space,
+  },
 }
 
 export const position = system(config)


Test patch:
diff --git a/packages/position/test/index.js b/packages/position/test/index.js
index a42f9c7..0c94258 100644
--- a/packages/position/test/index.js
+++ b/packages/position/test/index.js
@@ -12,3 +12,23 @@ test('returns position styles', () => {
     right: 0,
   })
 })
+
+test('returns theme values', () => {
+  const style = position({ top: 1, right: 2, bottom: 3, left: 4 })
+  expect(style).toEqual({ top: 4, right: 8, bottom: 16, left: 32 })
+})
+
+test('returns pixel values', () => {
+  const style = position({
+    top: '1px',
+    right: '2px',
+    bottom: '3px',
+    left: '4px',
+  })
+  expect(style).toEqual({
+    top: '1px',
+    right: '2px',
+    bottom: '3px',
+    left: '4px',
+  })
+})
Repository: styled-system/styled-system
Pull request #610 (2019-07-22 15:28:47)

Fix paragraph padding collision bug
Fixes system-ui/theme-ui#194


Patch:
diff --git a/packages/css/src/index.js b/packages/css/src/index.js
index a491b98..eb8627a 100644
--- a/packages/css/src/index.js
+++ b/packages/css/src/index.js
@@ -162,22 +162,26 @@ export const css = args => (props = {}) => {
   const styles = responsive(obj)(theme)
 
   for (const key in styles) {
-    const prop = get(aliases, key, key)
-    const scaleName = get(scales, prop)
-    const scale = get(theme, scaleName, get(theme, prop, {}))
     const x = styles[key]
     const val = typeof x === 'function' ? x(theme) : x
+
     if (key === 'variant') {
       const variant = css(get(theme, val))(theme)
       result = { ...result, ...variant }
       continue
     }
+
     if (val && typeof val === 'object') {
-      result[prop] = css(val)(theme)
+      result[key] = css(val)(theme)
       continue
     }
+
+    const prop = get(aliases, key, key)
+    const scaleName = get(scales, prop)
+    const scale = get(theme, scaleName, get(theme, prop, {}))
     const transform = get(transforms, prop, get)
     const value = transform(scale, val, val)
+
     if (directions[prop]) {
       const dirs = directions[prop]
       for (let i = 0; i < dirs.length; i++) {
diff --git a/yarn.lock b/yarn.lock
index 5064703..82eed63 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2220,6 +2220,18 @@
   resolved "https://registry.yarnpkg.com/@styled-system/css/-/css-2.0.4.tgz#58c9043f48a6ff3a726820829407375a71d3ca0c"
   integrity sha512-Y7D+rqEpQk4311GDrzRtO5yreILywX8JiFYWyXhB5eG8Qz7kF4KKhpta54e5GA/FGFcPF47HVKjcuATf3hqsMQ==
 
+"@styled-system/edit@5.0.5":
+  version "5.0.5"
+  resolved "https://registry.yarnpkg.com/@styled-system/edit/-/edit-5.0.5.tgz#9ab7cfb0287d1c82fef372bb12f9c5bdfb2e8fd7"
+  integrity sha512-nzz3MLj9ouhLPrdlXjro3JjQBt8ruGc9JxeLP7BYlqN5vzLWYyJZ6M0A4nfk73D4QRROl9cpf2HKcZll65SARg==
+  dependencies:
+    "@emotion/core" "^10.0.10"
+    color "^3.1.0"
+    lodash.get "^4.4.2"
+    lodash.merge "^4.6.1"
+    lodash.omit "^4.5.0"
+    lodash.set "^4.3.2"
+
 "@styled-system/jsx@5.0.5":
   version "5.0.5"
   resolved "https://registry.yarnpkg.com/@styled-system/jsx/-/jsx-5.0.5.tgz#be4db3898103e58cf508593b0f733204763c1403"


Test patch:
diff --git a/packages/css/test/index.js b/packages/css/test/index.js
index 2af9327..fef96a1 100644
--- a/packages/css/test/index.js
+++ b/packages/css/test/index.js
@@ -253,3 +253,22 @@ test('skip breakpoints', () => {
     }
   })
 })
+
+test('padding shorthand does not collide with nested p selector', () => {
+  const result = css({
+    p: {
+      fontSize: 32,
+      color: 'tomato',
+      p: 2,
+    },
+    padding: 32,
+  })(theme)
+  expect(result).toEqual({
+    p: {
+      fontSize: 32,
+      color: 'tomato',
+      padding: 8,
+    },
+    padding: 32,
+  })
+})
Repository: styled-system/styled-system
Pull request #627 (2019-07-24 22:46:12)

@styled-system/css: slice array values based on breakpoints length


Patch:
diff --git a/packages/css/src/index.js b/packages/css/src/index.js
index eb8627a..ba59ac7 100644
--- a/packages/css/src/index.js
+++ b/packages/css/src/index.js
@@ -140,7 +140,7 @@ export const responsive = styles => theme => {
       next[key] = value
       continue
     }
-    for (let i = 0; i < value.length; i++) {
+    for (let i = 0; i < value.slice(0, mediaQueries.length).length; i++) {
       const media = mediaQueries[i]
       if (value[i] == null) continue
       if (!media) {


Test patch:
diff --git a/packages/css/test/index.js b/packages/css/test/index.js
index fef96a1..fa319be 100644
--- a/packages/css/test/index.js
+++ b/packages/css/test/index.js
@@ -272,3 +272,20 @@ test('padding shorthand does not collide with nested p selector', () => {
     padding: 32,
   })
 })
+
+test('ignores array values longer than breakpoints', () => {
+  const result = css({
+    width: [ 32, 64, 128, 256, 512 ]
+  })({
+    breakpoints: [ '32em', '40em' ],
+  })
+  expect(result).toEqual({
+    width: 32,
+    '@media screen and (min-width: 32em)': {
+      width: 64,
+    },
+    '@media screen and (min-width: 40em)': {
+      width: 128,
+    },
+  })
+})
Repository: styled-system/styled-system
Pull request #654 (2019-08-05 00:49:55)

Functional values can return responsive arrays
For https://github.com/system-ui/theme-ui/issues/229, also includes a test.


Patch:
diff --git a/packages/css/src/index.js b/packages/css/src/index.js
index ba59ac7..30f6493 100644
--- a/packages/css/src/index.js
+++ b/packages/css/src/index.js
@@ -134,7 +134,9 @@ export const responsive = styles => theme => {
   ]
 
   for (const key in styles) {
-    const value = styles[key]
+    const value =
+      typeof styles[key] === 'function' ? styles[key](theme) : styles[key]
+
     if (value == null) continue
     if (!Array.isArray(value)) {
       next[key] = value


Test patch:
diff --git a/packages/css/test/index.js b/packages/css/test/index.js
index fa319be..cd866aa 100644
--- a/packages/css/test/index.js
+++ b/packages/css/test/index.js
@@ -289,3 +289,15 @@ test('ignores array values longer than breakpoints', () => {
     },
   })
 })
+
+test('functional values can return responsive arrays', () => {
+  const result = css({
+    color: t => [t.colors.primary, t.colors.secondary],
+  })(theme)
+  expect(result).toEqual({
+    '@media screen and (min-width: 40em)': {
+      color: 'cyan',
+    },
+    color: 'tomato',
+  })
+})
Repository: styled-system/styled-system
Pull request #671 (2019-08-07 05:01:41)

css: Support individual border styles
Secondary PR to https://github.com/styled-system/styled-system/pull/670 which also supports the css prop.


Patch:
diff --git a/packages/css/src/index.js b/packages/css/src/index.js
index 30f6493..c3225bc 100644
--- a/packages/css/src/index.js
+++ b/packages/css/src/index.js
@@ -84,6 +84,22 @@ const scales = {
   borderTopLeftRadius: 'radii',
   borderBottomRightRadius: 'radii',
   borderBottomLeftRadius: 'radii',
+  borderTopWidth: 'borderWidths',
+  borderTopColor: 'colors',
+  borderTopStyle: 'borderStyles',
+  borderTopLeftRadius: 'radii',
+  borderTopRightRadius: 'radii',
+  borderBottomWidth: 'borderWidths',
+  borderBottomColor: 'colors',
+  borderBottomStyle: 'borderStyles',
+  borderBottomLeftRadius: 'radii',
+  borderBottomRightRadius: 'radii',
+  borderLeftWidth: 'borderWidths',
+  borderLeftColor: 'colors',
+  borderLeftStyle: 'borderStyles',
+  borderRightWidth: 'borderWidths',
+  borderRightColor: 'colors',
+  borderRightStyle: 'borderStyles',
   boxShadow: 'shadows',
   textShadow: 'shadows',
   zIndex: 'zIndices',


Test patch:
diff --git a/packages/css/test/index.js b/packages/css/test/index.js
index cd866aa..2cb23da 100644
--- a/packages/css/test/index.js
+++ b/packages/css/test/index.js
@@ -35,6 +35,15 @@ const theme = {
       letterSpacing: ['-0.01em', '-0.02em'],
     },
   },
+  borderWidths: {
+    thin: 1,
+  },
+  borderStyles: {
+    thick: 'solid',
+  },
+  radii: {
+    small: 5,
+  },
 }
 
 test('returns a function', () => {
@@ -301,3 +310,42 @@ test('functional values can return responsive arrays', () => {
     color: 'tomato',
   })
 })
+
+test('returns individual border styles', () => {
+  const result = css({
+    borderTopWidth: 'thin',
+    borderTopColor: 'primary',
+    borderTopStyle: 'thick',
+    borderTopLeftRadius: 'small',
+    borderTopRightRadius: 'small',
+    borderBottomWidth: 'thin',
+    borderBottomColor: 'primary',
+    borderBottomStyle: 'thick',
+    borderBottomLeftRadius: 'small',
+    borderBottomRightRadius: 'small',
+    borderRightWidth: 'thin',
+    borderRightColor: 'primary',
+    borderRightStyle: 'thick',
+    borderLeftWidth: 'thin',
+    borderLeftColor: 'primary',
+    borderLeftStyle: 'thick',
+  })(theme)
+  expect(result).toEqual({
+    borderTopColor: 'tomato',
+    borderTopWidth: 1,
+    borderTopStyle: 'solid',
+    borderTopLeftRadius: 5,
+    borderTopRightRadius: 5,
+    borderBottomColor: 'tomato',
+    borderBottomWidth: 1,
+    borderBottomStyle: 'solid',
+    borderBottomLeftRadius: 5,
+    borderBottomRightRadius: 5,
+    borderRightColor: 'tomato',
+    borderRightWidth: 1,
+    borderRightStyle: 'solid',
+    borderLeftColor: 'tomato',
+    borderLeftWidth: 1,
+    borderLeftStyle: 'solid',
+  })
+})
\ No newline at end of file
Repository: styled-system/styled-system
Pull request #684 (2019-08-12 00:52:50)

css: Adds support for size
Wasn't sure if it was missing intentionally, but it seems like it should be included


Patch:
diff --git a/packages/css/README.md b/packages/css/README.md
index af23c9b..6215618 100644
--- a/packages/css/README.md
+++ b/packages/css/README.md
@@ -90,6 +90,7 @@ Property  | Theme Key
 `height` | `sizes`
 `minHeight` | `sizes`
 `maxHeight` | `sizes`
+`size` | `sizes`
 
 ## Responsive Arrays
 
diff --git a/packages/css/src/index.js b/packages/css/src/index.js
index 2562b68..11f95d1 100644
--- a/packages/css/src/index.js
+++ b/packages/css/src/index.js
@@ -32,11 +32,12 @@ const aliases = {
   py: 'paddingY',
 }
 
-const directions = {
+const multiples = {
   marginX: ['marginLeft', 'marginRight'],
   marginY: ['marginTop', 'marginBottom'],
   paddingX: ['paddingLeft', 'paddingRight'],
   paddingY: ['paddingTop', 'paddingBottom'],
+  size: ['width', 'height'],
 }
 
 const scales = {
@@ -110,6 +111,7 @@ const scales = {
   minHeight: 'sizes',
   maxHeight: 'sizes',
   flexBasis: 'sizes',
+  size: 'sizes',
   // svg
   fill: 'colors',
   stroke: 'colors',
@@ -204,8 +206,9 @@ export const css = args => (props = {}) => {
     const transform = get(transforms, prop, get)
     const value = transform(scale, val, val)
 
-    if (directions[prop]) {
-      const dirs = directions[prop]
+    if (multiples[prop]) {
+      const dirs = multiples[prop]
+      
       for (let i = 0; i < dirs.length; i++) {
         result[dirs[i]] = value
       }


Test patch:
diff --git a/packages/css/test/index.js b/packages/css/test/index.js
index 9c14787..3889034 100644
--- a/packages/css/test/index.js
+++ b/packages/css/test/index.js
@@ -16,6 +16,9 @@ const theme = {
     bold: 600,
   },
   sizes: {
+    small: 4,
+    medium: 8,
+    large: 16,
     sidebar: 320,
   },
   buttons: {
@@ -372,3 +375,25 @@ test('fill and stroke use theme.colors', () => {
     stroke: 'cyan',
   })
 })
+
+test('multiples are transformed', () => {
+  const style = css({
+    marginX: 2,
+    marginY: 2,
+    paddingX: 2,
+    paddingY: 2,
+    size: 'large',
+  })(theme)
+  expect(style).toEqual({
+    marginLeft: 8,
+    marginRight: 8,
+    marginTop: 8,
+    marginBottom: 8,
+    paddingLeft: 8,
+    paddingRight: 8,
+    paddingTop: 8,
+    paddingBottom: 8,
+    width: 16,
+    height: 16,
+  })
+})
Repository: styled-system/styled-system
Pull request #825 (2019-09-17 22:00:13)

css: add outlineColor theme scale
Add ability to reference color values from theme when using outlineColor
Relevant issue: https://github.com/rebassjs/rebass/issues/735


Patch:
diff --git a/packages/css/src/index.js b/packages/css/src/index.js
index 11f95d1..32b4070 100644
--- a/packages/css/src/index.js
+++ b/packages/css/src/index.js
@@ -101,6 +101,7 @@ const scales = {
   borderRightWidth: 'borderWidths',
   borderRightColor: 'colors',
   borderRightStyle: 'borderStyles',
+  outlineColor: 'colors',
   boxShadow: 'shadows',
   textShadow: 'shadows',
   zIndex: 'zIndices',


Test patch:
diff --git a/packages/css/test/index.js b/packages/css/test/index.js
index 3889034..7386a31 100644
--- a/packages/css/test/index.js
+++ b/packages/css/test/index.js
@@ -397,3 +397,12 @@ test('multiples are transformed', () => {
     height: 16,
   })
 })
+
+test('returns outline color from theme', () => {
+  const result = css({
+    outlineColor: 'primary',
+  })(theme)
+  expect(result).toEqual({
+    outlineColor: 'tomato'
+  })
+})
Repository: styled-system/styled-system
Pull request #1137 (2020-02-17 00:24:17)

Fix media query when using css package with null responsive values
Hi,

Noticed an issue with responsive arrays when using @styled-system/css today. When null values are passed in, the order that the media queries are loaded in, can be out of order.

A detail of the issue and what is happening is in the issue https://github.com/system-ui/theme-ui/issues/577 on theme-ui project.

I looked through many issues in this repo where it was bought up, #551, #561 and #813. 

I noticed it was fixed in theme ui with PR https://github.com/system-ui/theme-ui/pull/600

This is a port of that fix, with the added tests also.

I don't have full context over the reason it may or may not have been ported from theme-ui, since it seems the css package there is identical to this one, minus this fix.


Patch:
diff --git a/packages/css/src/index.js b/packages/css/src/index.js
index 6c9b805..b635233 100644
--- a/packages/css/src/index.js
+++ b/packages/css/src/index.js
@@ -163,12 +163,12 @@ export const responsive = styles => theme => {
     }
     for (let i = 0; i < value.slice(0, mediaQueries.length).length; i++) {
       const media = mediaQueries[i]
-      if (value[i] == null) continue
       if (!media) {
         next[key] = value[i]
         continue
       }
       next[media] = next[media] || {}
+      if (value[i] == null) continue
       next[media][key] = value[i]
     }
   }


Test patch:
diff --git a/packages/css/test/index.js b/packages/css/test/index.js
index 7386a31..7827bf1 100644
--- a/packages/css/test/index.js
+++ b/packages/css/test/index.js
@@ -263,6 +263,7 @@ test('skip breakpoints', () => {
   })(theme)
   expect(result).toEqual({
     width: '100%',
+    '@media screen and (min-width: 40em)': {},
     '@media screen and (min-width: 52em)': {
       width: '50%',
     }
@@ -406,3 +407,52 @@ test('returns outline color from theme', () => {
     outlineColor: 'tomato'
   })
 })
+
+test('returns correct media query order', () => {
+  const result = css({
+    width: ['100%', , '50%'],
+    color: ['red', 'green', 'blue'],
+  })(theme)
+  const keys = Object.keys(result)
+  expect(keys).toEqual([
+    'width',
+    '@media screen and (min-width: 40em)',
+    '@media screen and (min-width: 52em)',
+    'color',
+  ])
+  expect(result).toEqual({
+    width: '100%',
+    '@media screen and (min-width: 40em)': {
+      color: 'green',
+    },
+    '@media screen and (min-width: 52em)': {
+      width: '50%',
+      color: 'blue',
+    },
+    color: 'red',
+  })
+})
+
+test('returns correct media query order 2', () => {
+  const result = css({
+    flexDirection: 'column',
+    justifyContent: [null, 'flex-start', 'flex-end'],
+    color: 'background',
+    height: '100%',
+    px: [2, 3, 4],
+    py: 4,
+  })(theme)
+  const keys = Object.keys(result)
+  expect(keys).toEqual([
+    'flexDirection',
+    'justifyContent',
+    '@media screen and (min-width: 40em)',
+    '@media screen and (min-width: 52em)',
+    'color',
+    'height',
+    'paddingLeft',
+    'paddingRight',
+    'paddingTop',
+    'paddingBottom',
+  ])
+})
Repository: chartjs/chartjs-plugin-zoom
Pull request #481 (2021-04-30 02:58:09)

Expose zoomFunctions and panFunctions for customization
I'm tying to upgrade [chartjs-plugin-streaming](https://github.com/nagix/chartjs-plugin-streaming) for Chart.js 3.x and chartjs-plugin-zoom 1.x, but the latest code doesn't expose `zoomFunctions` or `panFunctions` which are required to support new scale types. So, this PR adds these internal objects to the plugin object as properties.

nagix: #169 is related to this

Patch:
diff --git a/src/plugin.js b/src/plugin.js
index 669bc39..94fbf54 100644
--- a/src/plugin.js
+++ b/src/plugin.js
@@ -2,6 +2,7 @@ import Hammer from 'hammerjs';
 import {addListeners, computeDragRect, removeListeners} from './handlers';
 import {startHammer, stopHammer} from './hammer';
 import {doPan, doZoom, resetZoom} from './core';
+import {panFunctions, zoomFunctions} from './scale.types';
 import {getState, removeState} from './state';
 import {version} from '../package.json';
 
@@ -83,5 +84,9 @@ export default {
       stopHammer(chart);
     }
     removeState(chart);
-  }
+  },
+
+  panFunctions,
+
+  zoomFunctions
 };


Test patch:
diff --git a/test/specs/module.spec.js b/test/specs/module.spec.js
index cace463..456939c 100644
--- a/test/specs/module.spec.js
+++ b/test/specs/module.spec.js
@@ -7,6 +7,11 @@ describe('module', function() {
     expect(window.ChartZoom.id).toBe('zoom');
   });
 
+  it ('should expose zoomFunctions and panFunctions', function() {
+    expect(window.ChartZoom.zoomFunctions instanceof Object).toBe(true);
+    expect(window.ChartZoom.panFunctions instanceof Object).toBe(true);
+  });
+
   it ('should be globally registered', function() {
     const plugin = Chart.registry.getPlugin('zoom');
     expect(plugin).toBe(window.ChartZoom);
Repository: godaddy/kubernetes-external-secrets
Pull request #20 (2019-02-20 16:28:34)

fix(updating): use PUT not PATCH when updating an existing Secret
PATCH is going to result in a merge, potentially resulting in a union of the
previous Secret's fields and the updated Secret's fields.


Patch:
diff --git a/lib/poller.js b/lib/poller.js
index 1422c16..bbedb07 100644
--- a/lib/poller.js
+++ b/lib/poller.js
@@ -98,7 +98,7 @@ class Poller {
     }
 
     this._logger.info(`updating secret ${secretName}`);
-    return kubeNamespace.secrets(secretName).patch({ body: secretManifest });
+    return kubeNamespace.secrets(secretName).put({ body: secretManifest });
   }
 
   /**


Test patch:
diff --git a/lib/poller.test.js b/lib/poller.test.js
index a1128da..7cb12cd 100644
--- a/lib/poller.test.js
+++ b/lib/poller.test.js
@@ -186,13 +186,13 @@ describe('Poller', () => {
 
     it('updates secret', async () => {
       kubeNamespaceMock.get = sinon.stub().resolves({ fakeSecretName: 'fakeSecretString' });
-      kubeNamespaceMock.patch = sinon.stub().resolves();
+      kubeNamespaceMock.put = sinon.stub().resolves();
 
       await poller._upsertKubernetesSecret(upsertSecretParams);
 
       expect(kubeNamespaceMock.secrets.calledWith('fakeSecretName')).to.be.true;
       expect(kubeNamespaceMock.get.called).to.be.true;
-      expect(kubeNamespaceMock.patch.calledWith({
+      expect(kubeNamespaceMock.put.calledWith({
         body: {
           apiVersion: 'v1',
           kind: 'Secret',