Skip to content

Releases: abhchand/vanilla-tree-viewer

v2.1.1

27 Dec 18:05
Compare
Choose a tag to compare

Changelog

  • Bugfix: Align Header action buttons d2f37a7
  • Remove drop-shadow as the default 61f920a

v2.1.0...v2.1.1

v2.1.0

26 Dec 04:50
Compare
Choose a tag to compare

Breaking Changes

Old (2.0.0)

Previously, you neeed to call VanillaTreeViewer.renderAll() manually, after the DOM Content loaded:

<script>
  document.addEventListener('DOMContentLoaded', function() {
    VanillaTreeViewer.renderAll();
  }, false);
</script>

New (2.1.0)

To make this simpler going forward,

  1. renderAll() will correctly handle delaying itself till DOM content has loaded. You no longer need to worry about wrapping it in document.addEventListener.

  2. Additionally, we now recommend calling renderAll() on script load (with onload) so it doesn't have to be called separately as a one-off statement.

Example:

<!-- Note the `onload` call within the `<script>` tag. -->
<script
  type="text/javascript"
  onload="VanillaTreeViewer.renderAll()"
  src="..."
</script>

Other Changes

v2.0.0

13 Dec 18:39
Compare
Choose a tag to compare

Breaking Changes

v2.0.0 represents a significant departure from the previous API, based on feedback gathered from users using v1.x.

Old (1.x)

Previously, the list of files was specified as a JavaScript Array of file objects. We then initialize VanillaTreeViewer and call render() to render the component instances.

const files = [
  {
    path: 'foo/bar.js',
    url: 'https://example.com/bar.js'
  },
  // ...
];

new VanillaTreeViewer('my-viewer', files, options).render();

New (2.0.0)

The new approach allows us to define the list of files directly in the DOM (as an <ol> element). A new renderAll() static method avoids the need for initializing a new instance:

<body>
  <ol class='vtv'>
    <li data-path="foo/bar.js" data-url="https://example.com/bar.js">
    </li>
  </ol>

  <script>
    document.addEventListener('DOMContentLoaded', function() {
      VanillaTreeViewer.renderAll();
    }, false);
  </script>
</body>

See README for more examples and documentation.

Other Changes

  • The rendered component is now wrapped in a div with .vtv and .vtv-wrapper classes. (Previously .vtv referred to an internal element, and is now called .vtv-root)
  • Internal highlight.js dependency has been upgraded from 10.4.1 -> 11.3.1
  • Case is now preserved on file paths, so data-path="README.md" is rendered correctly as README.md and not readme.md
  • Consistent case is now enforced on path directories. That means listing 2 files with data-path="/alpha/beta.txt" and data-path="/ALPHA/gamma.txt" will throw a validation error since /alpha is ambiguously defined with two cases.
  • The header logo link now appends campaign params

Changelog

  • Add campaign and update header logo link 2b5560c
  • Upgrading hljs from 10.4.1 -> 11.3.1 07bfcdb
  • Add validation to enforce unambiguous sub-paths 5e3f2fd
  • Preserve original case on user-specified path eab91c4
  • [Breaking Change] Parse structure and options from the DOM directly 26f0688
  • Use .vtv-root instead of .vtv for the top level CSS class name 27b5204
  • [Breaking Change] Combine global options into file options 017e66f

v1.1.1

18 Nov 02:30
Compare
Choose a tag to compare
  • Explicitly set margin on tree nodes to prevent accidental overrides 8d62192
  • Explicitly set font color on tree to prevent accidental overrides b7b89e2

v1.1.0...v1.1.1

v1.1.0

16 Nov 03:36
Compare
Choose a tag to compare

Key Notes

The contents option was added, which adds the ability to specify the file contents inline (instead of specifying a url)

Example:

<script>
  const files = [
    {
      path: 'lib/file.js',
      contents: 'const foo = () => {\n  alert('foo');\n}',
      language: 'javascript'
    }
  ];

  new VanillaTreeViewer('some-id', files).render();
</script>

Notes:

  • At least one of url or contents must be specified
  • This option takes precedence over url if both are specified

Changelog

v1.0.1...v1.1.0

v1.0.1

08 Oct 01:22
Compare
Choose a tag to compare

Changelog

  • Using overflow-*: auto instead of overflow-*: scroll 453daf3

v1.0.0...v1.0.1

v1.0.0

04 Oct 02:18
Compare
Choose a tag to compare

Key Notes

To keep the bundle size as small as possible, we now support a smaller number of languages for syntax highlighting by default (via Highlight.js).

bash, c, cpp, csharp, css, diff, go, java, javascript, json, makefile, xml, markdown, objectivec, php, php-template, plaintext, python, ruby, rust, scss, shell, sql, typescript, yaml

The README provides instructions on how to include other languages.

See the full list of language syntax definitions supported by highlight.js.

Changelog

  • Updating to 1.0.0 244509d
  • Correct listed hljs version e8530df
  • Trimming down the number of default languages supported for syntax highlighting a41aaac
  • Set viewport for mobile view 7eee5cc
  • Using shorthand flex-flow property b172c9f
  • Shorten CSS classes from .vanilla-tree-viewer* to .vtv* dbc793c
  • General changes to reduce size and add comments 94aae75
  • Optimizing SVG icon sizes c2a0960
  • Set tree nodes to be the full width of the parent container 836d1ab
  • Updating demo image after recent changes c0bad9a
  • Remove TravisCI, replace with Circle CI 83f8886
  • Separate yarn run lint and yarn run test e7896dd
  • Decrease font size and increase line spacing on code blocks f3bf5d3
  • Adding binocular logo with link to source repository 4235fd0
  • Updating logo 6825927
  • Add and configure prettier as a linter 8f0decf
  • Bump ssri from 6.0.1 to 6.0.2 50bd403
  • Bump elliptic from 6.5.2 to 6.5.4 80e42e3
  • Bump ws from 5.2.2 to 5.2.3 6241e45
  • Bump url-parse from 1.4.7 to 1.5.3 0122c0c
  • Bump tmpl from 1.0.4 to 1.0.5 9aeb692
  • Bump path-parse from 1.0.6 to 1.0.7 4d3a9f0
  • Bump postcss from 7.0.31 to 7.0.36 92927a6
  • Bump dns-packet from 1.3.1 to 1.3.4 d555730
  • Bump browserslist from 4.12.0 to 4.16.6 a396691
  • Bump hosted-git-info from 2.8.8 to 2.8.9 3bc0bfd
  • Bump lodash from 4.17.15 to 4.17.21 8e5d795
  • Bump y18n from 4.0.0 to 4.0.1 22eb4ba
  • Bump ini from 1.3.5 to 1.3.8 88a899c
  • Bump highlight.js from 10.1.1 to 10.4.1 0b4f7a0
  • Bump node-fetch from 2.6.0 to 2.6.1 8416fb7
  • Bump websocket-extensions from 0.1.3 to 0.1.4 7a98bf4

v1.0.0-beta.7...v1.0.0

v1.0.0-beta.7

29 Jun 20:53
Compare
Choose a tag to compare
v1.0.0-beta.7 Pre-release
Pre-release
  • Updating to 1.0.0-beta.7 110cdbc
  • Code should use fixed line-height 593fa53
  • Code content and &lt;pre&gt; tag should always take up 100% of the vertical space available ce94c4b

v1.0.0-beta.6...v1.0.0-beta.7

v1.0.0-beta.6

29 Jun 20:10
Compare
Choose a tag to compare
v1.0.0-beta.6 Pre-release
Pre-release
  • Updating to 1.0.0-beta.6 d1e610f
  • Update release instructions 16a09e5

v1.0.0-beta.5...v1.0.0-beta.6

v1.0.0-beta.5

29 Jun 19:56
Compare
Choose a tag to compare
v1.0.0-beta.5 Pre-release
Pre-release
  • Updating to 1.0.0-beta.5 9e3585f
  • Component should take up the full width of the containing DOM node instead of specifying a direct width. f75b51e
  • Include type attribute and closing &lt;/script&gt; in Validation message e6130f0

v1.0.0-beta.4...v1.0.0-beta.5