Skip to content

Commit

Permalink
Clarify documentation re: init in shadow DOMs
Browse files Browse the repository at this point in the history
  • Loading branch information
vphantom committed Apr 17, 2022
1 parent 522d465 commit 6222c57
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vanilla+

**WARNING: PROOF OF CONCEPT ONLY!** An eventual version 1.0 is expected by 2023. This is a back-burner project for me as of 2022.
**WARNING: CURRENTLY AT THE PROTOTYPE STAGE!** An eventual version 1.0 is expected by 2023. This is a back-burner project for me as of 2022.

[![license](https://img.shields.io/github/license/vphantom/vpweb.svg?style=plastic)]()
[![GitHub release](https://img.shields.io/github/release/vphantom/vpweb.svg?style=plastic)]()
Expand Down Expand Up @@ -58,6 +58,10 @@ import 'vpweb/vpweb';
<script src="dist/vpweb.min.js"></script>
```

You may also use individual components, although if you use more than one as stand-alone scripts, there will be some redundancy.

Note that components triggered by attributes or class names cannot self-activate inside shadow DOMs. If you want to use Vanilla+ components inside those, you'll need to activate them manually (for example, with `fast.preclick(element)`). See each component's documentation below for manual activation usage.

### [Editeur](docs/editeur.md)

### [Fast Clicks](docs/fast.md)
Expand Down
2 changes: 2 additions & 0 deletions docs/editeur.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Example usage:
</form>
```

This is a custom element and is thus available inside shadow DOMs.

The optional JSON scripts may be inline or referenced with `src`, in which case they will be loaded asynchronously. Without `vp-name` is read-only mode, in which case `<form>` is not necessary. At least one of `vp-schema` or `vp-data` must be specified in order to display anything. Attributes:

* **`vp-schema`** Name of schema definition to apply (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/fast.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import 'vpweb/fast';

## `function preclick(el)`

Trigger clicks on mousedown events. Click event is fired twice, so be careful when adding this behavior to new elements.
Manually make an element trigger clicks on mousedown events. Click event is fired twice, so be careful when adding this behavior to new elements.

**Parameters:**

Expand Down
4 changes: 2 additions & 2 deletions docs/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ Take over a form for JSON out, HTML in.

## `function expanding(input)`

Auto-expanding inputs. Types `email`, `number`, `password`, `search`, `text`, `url` are supported.
Manually make auto-expanding inputs. Types `email`, `number`, `password`, `search`, `text`, `url` are supported.

**Parameters:**

* `input``HTMLInputElement` — The input to squeeze

## `function ghost(input, name)`

Include field in form data once it will be modified.
Manually make a field be included form data only once it will be modified.

**Parameters:**

Expand Down
4 changes: 2 additions & 2 deletions js/fast.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import * as $ from './browser.js';
// TODO: is there ANY way to cancel the browser's second click?

/**
* Trigger clicks on mousedown events. Click event is fired twice, so be
* careful when adding this behavior to new elements.
* Manually make an element trigger clicks on mousedown events. Click event is
* fired twice, so be careful when adding this behavior to new elements.
*
* @param {HTMLElement} el Element to monitor
*/
Expand Down
6 changes: 3 additions & 3 deletions js/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ function json(form) {
$.forever('form[method="vp-json"]', json);

/**
* Auto-expanding inputs. Types `email`, `number`, `password`, `search`,
* `text`, `url` are supported.
* Manually make auto-expanding inputs. Types `email`, `number`, `password`,
* `search`, `text`, `url` are supported.
*
* @param {HTMLInputElement} input The input to squeeze
*/
Expand All @@ -65,7 +65,7 @@ function expanding(input) {
$.forever('input[vp-expanding]', expanding);

/**
* Include field in form data once it will be modified.
* Manually make a field be included form data only once it will be modified.
*
* @param {HTMLInputElement|HTMLSelectElement|HTMLTextAreaElement} input Field
* @param {string} [name] Name to use (overrides `vp-name`)
Expand Down

0 comments on commit 6222c57

Please sign in to comment.