Граф коммитов

164 Коммитов

Автор SHA1 Сообщение Дата
Dusty Greif 78ce055a01
Merge pull request #65 from github/dg/maintenance
Actions/Node Maintenance
2024-10-17 20:31:57 -04:00
dgreif 5133ab3e1f
Enable provenance when publishing 2024-10-17 09:35:47 -04:00
dgreif 28735aed5f
Add explicit permissions for nodejs action 2024-10-17 09:35:26 -04:00
dgreif aca734d41d
Use node 22 in actions 2024-10-17 09:34:43 -04:00
dgreif 83b53965bf
Run npm audit fix 2024-10-17 09:33:45 -04:00
Dusty Greif 3ab8e25e3e
Merge pull request #64 from github/dependabot/npm_and_yarn/npm_and_yarn-82ad408bf4
Bump the npm_and_yarn group with 2 updates
2024-10-17 09:33:12 -04:00
dependabot[bot] fe36c97fe4
Bump the npm_and_yarn group with 2 updates
Bumps the npm_and_yarn group with 2 updates: [cookie](https://github.com/jshttp/cookie) and [socket.io](https://github.com/socketio/socket.io).


Updates `cookie` from 0.4.2 to 0.7.2
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Commits](https://github.com/jshttp/cookie/compare/v0.4.2...v0.7.2)

Updates `socket.io` from 4.7.5 to 4.8.0
- [Release notes](https://github.com/socketio/socket.io/releases)
- [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io/compare/socket.io@4.7.5...socket.io@4.8.0)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: socket.io
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-10 15:54:39 +00:00
Manuel Puyol 7a3a02541d
Merge pull request #63 from github/manuelpuyol-patch-1
Update publish.yml
2024-09-16 17:20:51 -03:00
Manuel Puyol f46bd5801c
Update publish.yml 2024-09-16 11:12:41 -07:00
Dusty Greif 1ffe4f93fa
Merge pull request #62 from github/dependabot/npm_and_yarn/npm_and_yarn-bab23666a6
Bump body-parser from 1.19.2 to 1.20.3 in the npm_and_yarn group
2024-09-16 05:58:40 -07:00
dependabot[bot] e3f99b3c79
Bump body-parser from 1.19.2 to 1.20.3 in the npm_and_yarn group
Bumps the npm_and_yarn group with 1 update: [body-parser](https://github.com/expressjs/body-parser).


Updates `body-parser` from 1.19.2 to 1.20.3
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/body-parser/compare/1.19.2...1.20.3)

---
updated-dependencies:
- dependency-name: body-parser
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-15 21:59:08 +00:00
Manuel Puyol 4936109cbf
Merge pull request #61 from github/dependabot/npm_and_yarn/npm_and_yarn-5964df1f71
Bump the npm_and_yarn group with 3 updates
2024-07-09 10:31:45 -07:00
dependabot[bot] f132dde128
Bump the npm_and_yarn group with 3 updates
Bumps the npm_and_yarn group with 3 updates: [socket.io](https://github.com/socketio/socket.io), [ws](https://github.com/websockets/ws) and [socket.io-adapter](https://github.com/socketio/socket.io-adapter).


Updates `socket.io` from 4.6.1 to 4.7.5
- [Release notes](https://github.com/socketio/socket.io/releases)
- [Changelog](https://github.com/socketio/socket.io/blob/4.7.5/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io/compare/4.6.1...4.7.5)

Updates `ws` from 8.11.0 to 8.17.1
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.11.0...8.17.1)

Updates `socket.io-adapter` from 2.5.2 to 2.5.5
- [Release notes](https://github.com/socketio/socket.io-adapter/releases)
- [Changelog](https://github.com/socketio/socket.io-adapter/blob/2.5.5/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-adapter/compare/2.5.2...2.5.5)

---
updated-dependencies:
- dependency-name: socket.io
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: ws
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: socket.io-adapter
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 17:29:56 +00:00
Manuel Puyol 013f9efc8a
Merge pull request #59 from github/dependabot/npm_and_yarn/braces-3.0.3
Bump braces from 3.0.2 to 3.0.3
2024-06-17 09:20:11 -07:00
dependabot[bot] 3ff0311272
Bump braces from 3.0.2 to 3.0.3
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-16 09:46:55 +00:00
Manuel Puyol a9014d3770
Merge pull request #58 from github/dependabot/npm_and_yarn/follow-redirects-1.15.6
Bump follow-redirects from 1.15.4 to 1.15.6
2024-03-25 10:12:22 -07:00
dependabot[bot] 26f0ae9371
Bump follow-redirects from 1.15.4 to 1.15.6
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-16 22:56:27 +00:00
Ned Schwartz 7b4243af20
Merge pull request #55 from seanpdoyle/html-select-element-support
Support `select` elements
2024-02-08 15:34:04 -05:00
Sean Doyle 8154f26452 Support `select` elements
First, introduce the `PersistableElement` type to incorporate `<input>`,
`<textarea>`, and `<select>` elements.

Next, incorporate some special handling for `HTMLSelectElement`, since
they don't have a `.defaultValue` property.

Support for `HTMLSelectElement` instances is generalized for both
single and `[multiple]` elements by looping over
[HTMLSelectElement.selectedOptions][] while persisting, then setting
[HTMLSelectElement.selected][] when restoring.

[HTMLSelectElement.selectedOptions]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/selectedOptions
[HTMLSelectElement.selected]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionElement#instance_properties
2024-02-08 09:36:29 -05:00
Ned Schwartz bfb858edfc
Merge pull request #30 from helen/add/checked-support
Add support for checkboxes and radio buttons
2024-02-07 17:27:59 -05:00
Sean Doyle 014753454e
Merge pull request #1 from github/ns/add/checked-support
ns/add/checked support
2024-02-07 09:33:08 -05:00
Ned Schwartz 0ef13a766d fix tests 2024-02-06 17:28:02 -05:00
Sean Doyle 909d41cc2f Incorporate checkables into `storageFilter:` 2024-02-01 15:54:54 -05:00
Helen Hou-Sandi f20740ab0c Keep the external script for test page by default 2024-01-25 19:48:39 -05:00
Helen Hou-Sandi b3f5260d1a Account for default checked checkboxes 2024-01-25 19:48:39 -05:00
Helen Hou-Sandi a784967e72 Default to the public built file for the test page 2024-01-25 19:48:39 -05:00
Helen Hou-Sandi 26fe19f54e Add a checkbox test 2024-01-25 19:48:38 -05:00
Helen Hou-Sandi ee09672377 Add example file
Includes a button to set sessionStorage for easier testing/debugging
2024-01-25 19:47:54 -05:00
Helen Hou-Sandi b8cbb08026 Add support for checkboxes and radio buttons
This feels a little rough around the edges, but it's a working start.
2024-01-25 19:47:52 -05:00
Ned Schwartz 30de742bbc
Merge pull request #53 from github/ns/fix-lisnt-test-order
lint after build
2024-01-24 16:46:00 -05:00
Ned Schwartz 4baae16e52
Merge branch 'main' into ns/fix-lisnt-test-order 2024-01-24 16:39:10 -05:00
Ned Schwartz 1f7af8a238
Merge pull request #54 from github/ns/update-node-v20.11.0
Update node version in actions to v20.11 (LTS) and use `.node-version` file
2024-01-24 16:30:38 -05:00
Ned Schwartz 0d895931a6 lint after build 2024-01-24 21:28:50 +00:00
Ned Schwartz 87a53d3411 Update node version in actions to v20.11 (LTS) and use `.node-version` file 2024-01-24 21:25:46 +00:00
Ned Schwartz cee83c0787
Merge pull request #20 from seanpdoyle/provide-field-elements
Support `scope:` option to scope selector query and `fields:` option to skip selector query
2024-01-24 15:43:18 -05:00
Sean Doyle 357e2f834e
Update test/test.js
Co-authored-by: Ned Schwartz <ned@theinterned.net>
2024-01-24 14:57:43 -05:00
Sean Doyle 9fe1e06f7b
Update src/index.ts
Co-authored-by: Ned Schwartz <ned@theinterned.net>
2024-01-24 14:57:36 -05:00
Sean Doyle 1aa47be305
Update src/index.ts
Co-authored-by: Ned Schwartz <ned@theinterned.net>
2024-01-24 14:57:22 -05:00
Sean Doyle 9d20e1f2fc
Update README.md
Co-authored-by: Ned Schwartz <ned@theinterned.net>
2024-01-24 14:57:08 -05:00
Sean Doyle 88fa8135e4 Support `scope:` and `fields:` options
By default, calls to `persistResumableFields()` will query the
`document` for elements with the (default or provided) `selector:`.

This commit adds support for specifying a `fields:` option, collecting
`NodeList` or `Node[]`, to provide the function with a set of `<input>`
or `<textarea>` elements to persist. Providing `fields:` would make
`selector:` redundant, and vice-versa.

```js
const myFields = document.querySelector("[data-persisted-field]")

// ...

// pass the `NodeList` directly
persistResumableFields(getPageID(), { fields: myFields })
// pass an array of `Node` instances
persistResumableFields(getPageID(), { fields: Array.from(myFields) })
```

Similarly, calls to `persistResumableFields()` will query the _document_
for elements with the (default or provided) `selector:` by default.

This commit adds support for specifying a `scope:` option to declare a
`ParentNode` instance other than the `document`.

```js
persistResumableFields(getPageID(), {
  scope: document.getElementById("my-scope"),
  selector: ".descendants-of-my-scope",
})
```
2024-01-24 14:16:50 -05:00
Ned Schwartz 9358f76e7c
Merge pull request #52 from seanpdoyle/document-options
Add function option documentation to `README.md`
2024-01-23 17:10:01 -05:00
Ned Schwartz c2538cfb43
Merge branch 'main' into document-options 2024-01-23 16:57:55 -05:00
Ned Schwartz e0984cdc82
Merge pull request #40 from seanpdoyle/field-storage-filter
Make element filtering configurable
2024-01-23 16:28:46 -05:00
Sean Doyle 4077389a6a Add function option documentation to `README.md`
Adds sections for both `restoreResumableFields` and
`persistResumableFields` to highlight the possible options.
2024-01-20 16:10:27 -05:00
Sean Doyle 27095285b4 Make element filtering configurable
Introduce support for a `{ storageFilter: (field) => boolean }`
configuration override for calls to `persistResumableFields`. By
default, preserve the existing behavior of rejecting fields where
[value][] is equivalent to [defaultValue][].

This change is motivated by situations where an element's value is
impacted by events or packages that change its `[value]` attribute
directly.

For example, consider the following sample code:

```html
<input id="input" type="hidden" value="the default value">
<output id="output"></output>

<button>Change</button>

<script>
  const button = document.querySelector("button")
  const input = document.getElementById("input")
  const output = document.getElementById("output")

  output.textContent = input.defaultValue

  button.addEventListener("click", () => {
    input.setAttribute("value", "a new default value")
    output.textContent = input.defaultValue
  })
</script>
```

You can experiment with the code on [JSFiddle][].

Clicking the button changes the `<input>` element's `[value]` directly,
which has a side-effect of change its `.defaultValue` as well.

Within the context of `session-resume`, this means that any elements
impacted by side-effects of other code on the page will always be
omitted from being stored.

This is especially incompatible with `<trix-editor>` elements provided
by [Trix][] and [Action Text][].

[Trix]: https://trix-editor.org
[Action Text]: https://edgeguides.rubyonrails.org/action_text_overview.html

[value]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#value
[defaultValue]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#defaultvalue
[JSFiddle]: https://jsfiddle.net/1nwb4o23/
2024-01-20 15:59:00 -05:00
Manuel Puyol 9a3eaec159
Merge pull request #50 from github/dependabot/npm_and_yarn/follow-redirects-1.15.4
Bump follow-redirects from 1.14.9 to 1.15.4
2024-01-17 10:30:09 -08:00
Manuel Puyol a2325d0080
Merge branch 'main' into dependabot/npm_and_yarn/follow-redirects-1.15.4 2024-01-17 10:28:52 -08:00
Ned Schwartz 592986f324
Merge pull request #51 from github/ns/web-systems-codeowner
Update CODEOWNERS
2024-01-10 16:00:48 -05:00
Ned Schwartz 8642f94284
Update CODEOWNERS
replace `ui-frameworks-reviewers` with `web-systems-reviewers`
2024-01-10 10:41:46 -05:00
dependabot[bot] c80011673a
Bump follow-redirects from 1.14.9 to 1.15.4
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.9 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.9...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-09 19:47:38 +00:00