Skip to content

Latest commit

 

History

History
1221 lines (873 loc) · 30.9 KB

CHANGELOG.md

File metadata and controls

1221 lines (873 loc) · 30.9 KB

@leafygreen-ui/code

16.0.2

Patch Changes

16.0.1

Patch Changes

16.0.0

Major Changes

  • 274d7e1a7: Removes prop-types from LeafyGreen UI

Patch Changes

15.0.0

Major Changes

  • 04bb887c0: LG-4121: Code renders the copy button tooltip and language selector in the top layer using popover API. As a result, the following props are removed:

    • popoverZIndex
    • portalClassName
    • portalContainer
    • scrollContainer
    • usePortal

    Migration guide

    Use popover-v12 codemod for migration assistance.

    Old
    <Code popoverZIndex={9999} usePortal={false} />
    <Code portalClassName="portal-class" usePortal />
    New
    <Code />
    <Code />

Patch Changes

14.4.0

Minor Changes

  • f827eb412: LG-4319 Adds expandable prop to Code component. This makes it so that a codeblock with more than 5 lines of code can be expanded and collapsed via the click of a button.

Patch Changes

14.3.3

Patch Changes

14.3.2

Patch Changes

14.3.1

Patch Changes

14.3.0

Minor Changes

  • 9afcc3bd: Adds tooltip hover interaction for Code component copy button LG-3915

14.2.19

Patch Changes

14.2.18

Patch Changes

14.2.17

Patch Changes

14.2.16

Patch Changes

14.2.15

Patch Changes

14.2.14

Patch Changes

14.2.13

Patch Changes

  • 4fcf2e94: Move custom select menu button into separate components and passes custom select menu button props to new internal select prop, __INTERNAL__menuButtonSlotProps__.
  • 4fcf2e94: Updates LanguageSwitcher hover styles specificity to &:hover[aria-disabled='false'].
  • Updated dependencies [4fcf2e94]
  • Updated dependencies [4fcf2e94]
  • Updated dependencies [4fcf2e94]
  • Updated dependencies [4fcf2e94]
  • Updated dependencies [4fcf2e94]
  • Updated dependencies [4fcf2e94]

14.2.12

Patch Changes

14.2.11

Patch Changes

14.2.10

Patch Changes

14.2.9

Patch Changes

14.2.8

Patch Changes

  • 4f03c6c5: Line highlight colors updated to use new palette, and consistent with design spec.
  • Updated dependencies [547d828e]

14.2.7

Patch Changes

14.2.6

Patch Changes

  • 63b2deb0b: Upgrade button to v20.1.1
  • Updated dependencies [63b2deb0b]

14.2.5

Patch Changes

14.2.4

Patch Changes

  • d3dd7aad5: Updates to TSDocs
  • Updated dependencies [d3dd7aad5]

14.2.3

Patch Changes

14.2.2

Patch Changes

14.2.1

Patch Changes

14.2.0

Minor Changes

  • 1f8ebbba6: Exports LanguageOption type
  • 7edcd1b0f: Adds support for C and C++. Adds HTML alias for XML

Patch Changes

14.1.2

Patch Changes

14.1.1

Patch Changes

  • 48ffa944d: Adds TSDoc annotations for language, languageOptions & onChange
  • Updated dependencies [405636249]

14.1.0

Minor Changes

  • 10dd1dc50: Remove useUsingKeyboardContext hook and use focus-visible to show focus states.

Patch Changes

14.0.2

Patch Changes

  • 48013291e: Fixing bug where numbered cells would stretch excessively in wide viewports
  • Updated dependencies [75f26afbc]
  • Updated dependencies [95bd93ef9]
  • Updated dependencies [3bb4b7506]

14.0.1

Patch Changes

  • ed0e425e5: Adds polished as an explicit dependency
  • ae5421cf6: Updates components to use internal transition tokens
  • Updated dependencies [696adb1b6]
  • Updated dependencies [ae5421cf6]
  • Updated dependencies [ed0e425e5]
  • Updated dependencies [4b4c2d27d]
  • Updated dependencies [1a335d0b2]
  • Updated dependencies [ae5421cf6]
  • Updated dependencies [7ca2da507]

14.0.0

Major Changes

  • 30207122: Updates Code for dark mode brand refresh.

Patch Changes

13.0.1

Patch Changes

13.0.0

Patch Changes

12.1.1

Patch Changes

12.1.0

Minor Changes

  • 3690df49: Updates TypeScript annotations, type structures and export format of some components

Patch Changes

12.0.2

Patch Changes

12.0.1

Patch Changes

  • cfb82f90: Swap default icon from 'Copy' to 'File'
  • Updated dependencies [b22cc41f]
  • Updated dependencies [828c895d]

12.0.0

Patch Changes

11.0.1

Patch Changes

  • fd2f6de0: Updates to TSDocs, PropTypes, and Storybook files
  • 96d1ff9c: Updates to propTypes, TSDocs, and Storybook controls
  • Updated dependencies [6a89bc29]
  • Updated dependencies [fd2f6de0]
  • Updated dependencies [6792bc44]
  • Updated dependencies [96d1ff9c]
  • Updated dependencies [422dbfcd]
  • Updated dependencies [9ff90d4b]
  • Updated dependencies [6792bc44]

11.0.0

Major Changes

  • e13d2487: Moving leafygreen-provider to peerDependencies.
  • Updated dependencies [500d6c60]

Patch Changes

10.0.0

Major Changes

  • ab1fd9e: Updates Code to allign with visual brand update
    • Removes fixed width when Language picker is shown (width was formerly set to a static 700px)

Patch Changes

9.5.0

Minor Changes

  • 1067fe9: Add support to specify starting value for line numbering.

9.4.0

Minor Changes

  • 548ca2c: Adds support for controlling the language switcher popover characteristics with usePortal, portalClassName, portalContainer, scrollContainer, and popoverZIndex props.
  • 548ca2c: Add support for Dart language

9.3.0

Minor Changes

  • 70f3c2c: Add support for custom action buttons in the code component

Patch Changes

9.2.0

Minor Changes

  • 2a945c7a: Adds support for Java .properties files

Patch Changes

9.1.0

Minor Changes

  • a30caf8f: Removes clike language support in Code component (previously removed by highlight.js)

9.0.0

Major Changes

  • 3c2fdcde: Upgrades highlight.js dependency from v10 to v11. This update will cause some syntax highlighting styles to change from previous versions of the Code component.

Patch Changes

8.1.6

Patch Changes

8.1.5

Patch Changes

8.1.4

Patch Changes

  • 74ffc369: Announces "copied" to screenreaders when text is copied
  • Updated dependencies [1ffbb84c]

8.1.3

Patch Changes

8.1.2

Patch Changes

8.1.1

Patch Changes

  • 909ede70: Removes empty panel rendered when copyable is false

8.1.0

Minor Changes

  • 55ccd908: Adds ability for Code component to be rendered with a language switcher

Patch Changes

8.0.9

Patch Changes

8.0.8

Patch Changes

8.0.7

Patch Changes

  • 16b902b5: Provides callback to sort() function in renderingPlugin to ensure that line numbers are being properly sorted before determining whether or not to highlight a line.

8.0.6

Patch Changes

  • b905c17d: Fixes issue where sublanguages like JSX would not render.

8.0.5

Patch Changes

  • 63a6c2f6: - Fixes issue where many applications had global styles for pre tags that added a second border and border radius to the pre element.
    • Fixes issue where code examples would be detected as multi-line when a single line example has preceding or subsequent new line characters.

8.0.4

Patch Changes

  • 717c7023: Fix issue where border wouldn't stretch the full height of the component with a wrapping, single line code example.

8.0.3

Patch Changes

8.0.2

Patch Changes

  • a85c6d8d: Prevent default behavior when copy button is clicked to prevent accidental form submissions.
  • Updated dependencies [bf8b83e1]

8.0.1

Patch Changes

8.0.0

Major Changes

  • 4f3f7b9f: Fixes various bugs, makes accessibility improvements, tweaks the design, and improves maintainability of the Code component.

    Design changes:

    • Updates the syntax highlighting theme to improve contrast between comments and regular code, as well as making several optimizations for red-green colorblindness.
    • Tightens the top and bottom padding for the code component, especially for single line code examples.
    • Significantly tightens the left padding when line numbers are shown.
    • Right-aligns line numbers in their column to improve readability.

    Bug fixes:

    • Fixes an issue where iOS browsers would render code examples at a 20px size, rather than the 13px font size they're supposed to render as.
    • Sometimes code that's written as multi-line statements wouldn't have line numbers applied to each line of the statement. That should now be fixed.
    • Fixes an issue where line highlight gradients in dark mode in Safari would render multiple gradients when line numbers were shown.

    Under the hood updates:

    • Removes the Syntax component. This component was extremely tightly coupled with the code component to a point where it wasn't a feasible component when used independently. All functionality is now self-contained within the Code component code.
    • Line highlighting definitions written with tuples expressing ranges are no longer expanded, making for a more efficient implementation, and allowing us to remove an arbitrary restriction on the number of lines possible to highlight.
    • Tokens can now have multiple classNames expressing their "kind", allowing for more precise code highlighting.

Patch Changes

7.3.1

Patch Changes

  • aae1e47e: Adds component to browser's Tab order when scrollable so those navigating via keyboard are able to scroll and view content appropriately

7.3.0

Minor Changes

  • c18f16e6: Improves compatibility with React v17

Patch Changes

7.2.0

Minor Changes

  • 611012de: Adds support for http language

Patch Changes

7.1.0

Minor Changes

  • 2643d4e7: Adds support for xml language

Patch Changes

7.0.1

Patch Changes

7.0.0

Major Changes

  • 0267bfd2: The underlying structure of distributed module definition files have changed and now have official support for ES modules. Module definition files are now generated using Rollup instead of Webpack. This should not affect functionality, but some thorough testing and caution should be exercised when upgrading.

Patch Changes

6.0.0

Major Changes

  • 50ea11ad: Deprecates the multiline prop in the Code component. Single line code examples are now detected automatically via the presence of line breaks in the string, and single line spacing is applied automatically.
  • 50ea11ad: - Adds the line highlighting feature! This feature is supported through the highlightLines prop.
    • All code examples are now rendered as a table, making unhighlighted code render consistently with highlighted code.
    • Fixes an issue where users might be unable to manually copy code.

Patch Changes

  • 50ea11ad: Fixes issue where the Code and Syntax components would break when passed code with invalid syntax"
  • Updated dependencies [65d5ed4d]
  • Updated dependencies [50ea11ad]
  • Updated dependencies [50ea11ad]

5.0.0

Major Changes

  • 729c79f8: Deprecates variant prop in favor of darkMode prop to control whether or not the component will appear in dark mode

Patch Changes

4.0.4

Patch Changes

4.0.3

Patch Changes

  • e599707: Require lodash dependencies instead of inlining them.
  • 8c867bb: Reduces server side effect warnings
  • Updated dependencies [e49d66b]
  • Updated dependencies [e599707]
  • Updated dependencies [8c867bb]

4.0.2

Patch Changes

4.0.1

Patch Changes

4.0.0

Major Changes

  • 7373e7b: Updates Syntax component to use the Highlight.js plugin API to render syntax.

    This helps in a couple ways:

    • Lets us remove the only instance of dangerouslySetInnerHTML within LeafyGreen UI by rendering syntax highlighting through React directly.
    • Allows us to render the component's content as a Table. This allows us to fix an alignment issue between line numbers and wrapped text, as well as opens the door for future features.

Patch Changes

3.5.0

Minor Changes

  • 6233a34: Adds onCopy callback, invoked when copy button is clicked

3.4.6

Patch Changes

3.4.5

Patch Changes

3.4.4

Patch Changes

  • cf6167e: Build and consume individual glyph components
  • Updated dependencies [2fc4ef9]
  • Updated dependencies [e857861]
  • Updated dependencies [cf6167e]

3.4.3

Patch Changes

3.4.2

Patch Changes

3.4.1

Patch Changes

3.4.0

Minor Changes

  • beccf70: Adds Objective-C language highlight support

Patch Changes

3.3.0

Minor Changes

  • f2fed7c: Adds copy functionality to Code component

Patch Changes

3.2.0

Minor Changes

  • c117a62: Enables Kotlin language support

Patch Changes

3.1.0

Minor Changes

  • a0d0d7b: Enables Swift language support

3.0.0

Major Changes

  • 464c09d: Introduces SSR compatibility though a change to our build process and files

Patch Changes