Skip to content

Commit

Permalink
Updated lil-gui
Browse files Browse the repository at this point in the history
  • Loading branch information
thedworak committed Jul 17, 2024
1 parent 2943697 commit e06905e
Show file tree
Hide file tree
Showing 72 changed files with 2,077 additions and 3,722 deletions.
48 changes: 26 additions & 22 deletions viewer/lil-gui-master/.eslintrc.yml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
root: true
env:
browser: true
es6: true
Expand All @@ -6,13 +7,12 @@ parserOptions:
sourceType: module
extends:
- eslint:recommended
- plugin:jsdoc/recommended
plugins:
- jsdoc
rules:
array-bracket-spacing: [ warn, always ]
arrow-parens: [ warn, as-needed ]
arrow-spacing: warn
brace-style: [ warn, 1tbs, { allowSingleLine: true } ]
block-spacing: [ warn, always ]
comma-spacing: warn
comma-dangle: [ warn, never ]
computed-property-spacing: [ warn, always ]
Expand All @@ -25,39 +25,43 @@ rules:
linebreak-style: [ warn, unix ]
max-len: [ warn, { code: 120 } ]
new-parens: warn
no-console: warn
no-empty: warn
no-extra-semi: warn
no-multiple-empty-lines: [ warn, { max: 1, maxEOF: 1 } ]
no-trailing-spaces: [ warn ]
no-multi-spaces: warn
no-multiple-empty-lines: [ warn, { max: 1, maxBOF: 0, maxEOF: 1 } ]
no-trailing-spaces: warn
no-unused-vars: warn
no-var: warn
no-whitespace-before-property: warn
object-curly-spacing: [ warn, always ]
quotes: [ warn, single ]
quotes: [ warn, single, { avoidEscape: true } ]
semi-spacing: warn
semi: [ warn, always ]
space-before-blocks: [ warn, always ]
space-before-function-paren: [ warn, never ]
space-in-parens: [ warn, always, { exceptions: [ empty ] } ]
space-infix-ops: warn
jsdoc/newline-after-description: [ warn, never ]
jsdoc/no-undefined-types: [ warn, { definedTypes: [ GUI, this, "false" ] } ]
jsdoc/require-jsdoc: off
jsdoc/require-param-description: off
jsdoc/require-returns-description: off
jsdoc/require-description: warn
jsdoc/tag-lines: [ warn, any ]
overrides:
- files: [ src/**/*.js ]
plugins:
- jsdoc
extends:
- plugin:jsdoc/recommended
rules:
jsdoc/newline-after-description: [ warn, never ]
jsdoc/no-undefined-types: [ warn, { definedTypes: [ GUI ] } ]
jsdoc/require-description-complete-sentence: warn
jsdoc/require-jsdoc: off
jsdoc/require-param-description: off
jsdoc/require-returns-description: off
jsdoc/require-returns-check: off
jsdoc/require-description: warn
jsdoc/tag-lines: off
- files: [ rollup.config.js, scripts/**/*.js, tests/**/*.js ]
env:
node: true
parserOptions:
ecmaVersion: 9
- files: [ rollup.config.js, scripts/**/*.js, tests/**/*.js, examples/**/*.js ]
rules:
no-console: off
max-len: off
jsdoc/require-description: off
- files: [ tests/*.test.js ]
ecmaVersion: 2022
- files: [ src/**/*.js, tests/*.test.js ]
rules:
no-console: warn
no-console: warn
Empty file modified viewer/lil-gui-master/.gitignore
100755 → 100644
Empty file.
75 changes: 73 additions & 2 deletions viewer/lil-gui-master/Changelog.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,74 @@
# 0.19.2

29.87kb, 8.51kb gzipped

- Fixed an issue where stepped number controllers emitted extraneous `onChange` events.
- Spellcheck is now disabled for string controllers.
- `name()` and `title()` will no longer render DOM elements if passed an HTML string.

# 0.19.1

29.80kb, 8.49kb gzipped

- Fixed a CSS regression in Firefox for Android. ([#122](https://github.com/georgealways/lil-gui/issues/122))

# 0.19.0

29.77kb, 8.48kb gzipped

- Calling `options()` on an option controller will no longer create a new controller at the end of the GUI.
- Checkboxes can now be toggled by clicking their label.
- Added `exports` field to package.json.
- Removed unused CSS.

# 0.18.2

30.06kb, 8.51kb gzipped

- Fixed a bug that caused decimals to be rendered with commas in certain locales.
- Fixed a bug where `new GUI({ touchStyles: false })` did not apply to folders.
- Fixed a bug where the `.force-touch-styles` class did not apply to folders.
- Fixed a bug that captured key events after clicking a folder header.
- Fixed a bug where number controllers ignored the numpad enter key.

# 0.18.1

29.89kb, 8.47kb gzipped

- Fixed errors in TypeScript definitions. ([#93](https://github.com/georgealways/lil-gui/issues/93#issuecomment-1450399004))

# 0.18.0

29.89kb, 8.47kb gzipped

- Added `gui.onOpenClose()`, which allows you to observe when a folder is opened or closed.
- Passing `{ closeFolders: true }` to GUI's constructor will close folders by default.
- Function controllers will now fire their `onChange` handler after a button press.
- CSS: Moved `--title-height` declaration from `.title` to `.lil-gui`.
- Improved compatibility with tree shaking bundlers.

# 0.17.0

29.53kb, 8.38kb gzipped

- Added `decimals()` to number controllers for limiting display precision. ([#44](https://github.com/georgealways/lil-gui/pull/44))
- Added `show()` and `hide()` to controllers. ([#60](https://github.com/georgealways/lil-gui/pull/60))
- Fixed a bug where typing in a number field did not respect `step`. ([#63](https://github.com/georgealways/lil-gui/pull/63))
- Improved touch-scrolling for scrollable GUI's with many sliders.

# 0.16.1

29.21kb, 8.33kb gzipped

- Improved performance for GUI's that make heavy use of `listen()`. ([#36](https://github.com/georgealways/lil-gui/pull/36))
- Eliminated console warnings about passive event listeners. ([#42](https://github.com/georgealways/lil-gui/pull/42))

# 0.16.0

29.05kb, 8.28kb gzipped

- Added `gui.show()` and `hide()`.

# 0.15.0

29.07kb, 8.26kb gzipped
Expand Down Expand Up @@ -34,7 +105,7 @@
- Added support for dragging number fields vertically.
- Fixed a bug that stopped you from entering decimals in number fields on mobile.
- Fixed a bug that stopped screen readers from reading names in `BooleanController`.
- Removed some dead CSS and JS.
- Removed unused CSS and JS.

# 0.11.0

Expand All @@ -53,4 +124,4 @@
- Restored hover effects for all widgets.
- Remove `import/export` in favor of `save/load`, which respects folder hierarchy
and prevents name collisions between folders.
- Remove automatic docking styles for mobile.
- Remove automatic docking styles for mobile.
26 changes: 13 additions & 13 deletions viewer/lil-gui-master/Guide.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
It's intended as a drop-in replacement for [dat.gui](https://github.com/dataarts/dat.gui),
implemented with more modern web standards and some new quality of life features.

If you've used dat.gui before, the beginning of this guide will be review. The [Migrating](#Migrating)
section points out the notable differences between the two libraries.
The [Migrating](#Migrating) section lists any breaking changes between the two libraries. The changes are limited to the lesser-used portions of the API, but you should read it before moving a project to lil-gui.

If you've used dat.gui before, the beginning of this guide will be review. New features are introduced beginning in the [Change Events](/#Guide#Change-Events) section.

## Installation

Expand Down Expand Up @@ -45,10 +46,9 @@ const gui = new GUI();
gui.add( document, 'title' );
```

lil-gui will choose an appropriate controller type based on the property's value when it was added
to the GUI. Since `document.title` was a string, a text field was created.
lil-gui will choose an appropriate controller based on the property's data type. Since `document.title` is a string, a text field is created.

Here are some more of the variable types you can control:
Here are some more of the data types you can control:

```js
obj = {
Expand Down Expand Up @@ -178,10 +178,11 @@ gui.add( params, 'foo' ).onChange( value => {
} );
```

The `onFinishChange` handler fires after a controller changes and loses focus. This comes in handy if you're using a slow function with a controller that produces continuous change events (like numbers or colors for example).
The `onFinishChange` handler fires after a controller changes and loses focus. This comes in handy if you're using a slow function with a controller that produces continuous change events (like a slider or color picker).

```js
gui.add( params, 'mySlider', 0, 1 ).onFinishChange( complexFunction );
gui.add( params, 'foo' )
.onFinishChange( complexFunction );
```

### Global Change Handlers
Expand Down Expand Up @@ -225,7 +226,7 @@ You can also call `controller.updateDisplay()` at any time to manage this behavi

## Saving

Using `gui.save()` you can create an object that saves the current value of all properties
Using `gui.save()`, you can create an object that saves the current value of all properties
added to the GUI. You can pass that object to `gui.load()` to restore the saved values.

The following creates a GUI that can save a preset. Press the savePreset button, then modify any
Expand All @@ -252,9 +253,8 @@ gui.add( obj, 'value2' );

gui.add( obj, 'savePreset' );

const loadButton =
gui.add( obj, 'loadPreset' )
.disable();
const loadButton = gui.add( obj, 'loadPreset' );
loadButton.disable();
```

### Save Object Format
Expand Down Expand Up @@ -347,12 +347,12 @@ new GUI( { injectStyles: false } );
### Touch Styles

Controllers are larger on touch devices to make them easier to use. By default, these styles are
applied using a CSS query `@media (pointer: coarse)`. You can disable this behavior with the `touchStyles` parameter.
applied using a CSS query: `@media (pointer: coarse)`. You can disable this behavior with the `touchStyles` parameter.

```js
gui = new GUI( { touchStyles: false } );
gui.domElement.classList.add( 'force-touch-styles' );
```

You can then apply these styles at a time of your choosing by adding the `.force-touch-styles` CSS class
to the GUI's root element.
to the GUI's root element.
Empty file modified viewer/lil-gui-master/LICENSE.md
100755 → 100644
Empty file.
10 changes: 5 additions & 5 deletions viewer/lil-gui-master/Migrating.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ section aims to address any breaking changes.

## API Changes

- `gui.__children` is now `gui.children`.
- `gui.__controllers` is now `gui.controllers`.
- `gui.__folders` is now `gui.folders` and it's an array, not a map.
- `gui.remove( controller )` is now `controller.destroy()`
- `gui.removeFolder( folder )` is now `folder.destroy()`
- `gui.remove( controller )` is now `controller.destroy()`.
- `gui.removeFolder( folder )` is now `folder.destroy()`.
- Folders are open by default.

## DOM Structure
Expand All @@ -23,7 +23,7 @@ is likely to break.

CSS class names are also different:

- `.dg.ac` becomes `.lil-gui.autoPlace`
- `.dg.ac` is now `.lil-gui.autoPlace`.

## Color Controller Changes

Expand Down Expand Up @@ -61,4 +61,4 @@ The other differences in color handling are fairly minor:

- "Presets" and `gui.remember()` are gone in favor of `save/load()`, which also removes
mention of `localStorage`.
- `gui.hide/show/hideAll()` and the <key>H</key> to hide hotkey.
- The static `GUI.toggleHide()` method and the <key>H</key> to hide hotkey.
11 changes: 8 additions & 3 deletions viewer/lil-gui-master/README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# lil-gui

Makes a floating panel for controllers on the web. Works as a drop-in replacement for dat.gui.

[**Homepage**](https://lil-gui.georgealways.com/)[**Basic Demo**](https://lil-gui.georgealways.com/examples/basic/)[Examples](https://lil-gui.georgealways.com/#Examples)[Guide](https://lil-gui.georgealways.com/#Guide)[API](https://lil-gui.georgealways.com/#API)[GitHub](https://github.com/georgealways/lil-gui)
Makes a floating panel for controllers on the web. Works as a drop-in replacement for dat.gui in most projects. See [Migrating](https://lil-gui.georgealways.com/#Migrating) for a list of breaking changes.

[**Homepage**](https://lil-gui.georgealways.com/)
[**Basic Demo**](https://lil-gui.georgealways.com/examples/basic/)
[Examples](https://lil-gui.georgealways.com/#Examples)
[Guide](https://lil-gui.georgealways.com/#Guide)
[API](https://lil-gui.georgealways.com/#API)
[GitHub](https://github.com/georgealways/lil-gui)

```js
import GUI from 'lil-gui';
Expand Down
Loading

0 comments on commit e06905e

Please sign in to comment.