3058 Commits

Author SHA1 Message Date
MichaelWest22
0e1eeec8b4
remove extra hx-swap-oob attribute that is not used in the page (#2823)
remove extra hx-swap-oob tag that is not used in the page
2024-10-02 19:40:54 -06:00
Eric Kwoka
b23b2f034e
🐛 Prevents erroring on null vals (#2799)
* 🐛 Prevents erroring on null vals

* 🚧 Applies same fix in FormProxy

* 🧪 Adds Test for null in FormDataProxy
2024-10-02 19:21:02 -06:00
MichaelWest22
5b550e5c49
Optimize Head regex (#2781)
* remove shared tag regex utility function that is no longer really needed

* fix head-support manual test to point to externally hosted extension

* minimize regex
2024-10-02 19:20:23 -06:00
MichaelWest22
b98e4f2b12
fix htmx.ajax defaulting to swap body when target not found (#2878)
* ajax helper handle no target

* allow source only targeting

* Add tests

* Handle source set but invalid target set

* Improve source logic

* missed #

* improve readiblity and add inline comment
2024-10-02 19:18:22 -06:00
Joerg Sonnenberger
df92b295d6
Change hx-trigger's changed modifier to work for independent trigger specifications (#2891)
* Adjust hx-trigger's changed modifier for multiple sources

The `changed` trigger modifier can see different event targets, either due
to the `from` modifier or event bubbling. The existing behavior trigger
only for one node (`from` modifier) or inconsistently (bubbling).

Use a nested weak map to keep track of the last value per distinguished
(trigger specification, event target node) pair. The weak map ensures
that Garbage Collection can still recycle the nodes.

If a event target was not seen via `from`, it is assumed changed for the
first time the trigger is hit.

* Add test case for separate triggers with changed modifier
2024-10-02 19:17:25 -06:00
Jackie Li
4916ce4d02
fix #2932: check parent is null for swap delete (#2933)
* fix #2932: check parent is null for swap

* fix test in swap when parent elt deleted
2024-10-02 19:08:39 -06:00
MichaelWest22
4a8172325e
enable hx-preserve handing for oob swaps (#2934)
* Add support for oob swaps with hx-preserve

* Add tests

* Documentation

* Impove fix to handle when oob swaps shouldSwap set false
2024-10-02 19:02:46 -06:00
MichaelWest22
d528c9d94d
Handle Space before comma in Trigger Spec (#2903)
* strip space after trigger spec

* Add test

* handle addiional case
2024-09-25 13:12:37 -06:00
MichaelWest22
3d1a2e5202
[bug] load trigger stops hx-disabled-elt getting re-enabled (#2925)
* allow disable-elt on load to function

* Update requestCount fallback
2024-09-25 12:13:25 -06:00
Vincent
326ff3b296
Fix focusin-based tests (#2861) 2024-09-01 14:22:04 -04:00
Alexander Kulikov
324ee19377
Listen to resize events and check revealed (#2780) 2024-08-29 12:01:13 -06:00
Carson Gross
2855c2c24e merge https://github.com/bigskysoftware/htmx/pull/2723 2024-08-29 12:00:00 -06:00
Ben Croker
cd6cdb275e
Ability to add options argument to event listener (#2836)
* Update htmx.js

* Update events.js

* Add fallback value

* Use JSDoc syntax

* Document parameter

* Only accept an object

* Revert change

* Add useCapture

* Update htmx.js

* Add `useCapture` test

* Clean up

* Revert addition of test
2024-08-29 10:36:24 -06:00
MichaelWest22
bc4468ddcd
fix restoreHistory title replacment (#2841)
Co-authored-by: 1cg <469183+1cg@users.noreply.github.com>
2024-08-29 10:32:49 -06:00
MichaelWest22
2ba7fd280e
Upgrade Typescript to move configuration from const to let (#2853)
* typescript upgrade v5.5.4

* fix dist
2024-08-29 10:30:51 -06:00
Carson Gross
0fd854758c fix formatting 2024-08-27 07:47:01 -06:00
Carson Gross
b4048ebb59 add moveBefore support 2024-08-23 15:20:01 -06:00
ehenighan
27fc37ce50
Issue #2676 - Tests for v2 to prevent regression of issue from v1 (#2829)
* Tests for v2 to prevent regression of issue from v1

* Linting

---------

Co-authored-by: Ed Henighan <ed.henighan@adi-uk.com>
2024-08-19 21:09:42 +02:00
Carson Gross
c0f80e65f9 update release date 2.0.2 2024-08-12 14:58:37 -06:00
Carson Gross
06d9f72f97 Merge remote-tracking branch 'origin/master' into dev 2024-08-12 14:57:04 -06:00
Saman Shahbazi
de98c40271
Fix typo in update-other-content.md (#2809)
fix typo
2024-08-11 10:27:50 +02:00
Adam Johnson
9bae00b698
Update installing download link to v2 (#2791) 2024-08-09 12:07:00 -04:00
ekzyis
f925e83b95
Add HTML comment and catch-all to responseHandling config via <meta> tag (#2793)
* Add HTML comment that was removed

* Add catch-all

---------

Co-authored-by: ekzyis <ekzyis@ekzy.is>
2024-08-09 11:49:24 -04:00
Serge Bornow
bb733a88f1
Update CONTRIBUTING.md - fixing a link (#2795)
* Update CONTRIBUTING.md  - fixing a link, wording

Excited to see this unframework framework as a long time (since 1998 coder) HTML appreciator. 

I wanted to learn about extensions but noticed a broken link that others might stumble upon. 

Consider rephrasing a question to invite a person to contribute their issue. (this can be ignored if you like).

* Update CONTRIBUTING.md

Removed change to grammar/style of writing back to original.
Providing a more updated reference to extensions with greater detail.
2024-08-09 17:23:45 +02:00
Carson Gross
b61077697d changelog for release 2024-08-05 14:07:57 -06:00
Carson Gross
0322b8782e release prep 2024-08-05 13:54:49 -06:00
Carson Gross
82355a741d release prep 2024-08-05 13:53:33 -06:00
Carson Gross
97b8c68dd3 release prep 2024-08-05 13:53:08 -06:00
Carson Gross
b1d6135dca add htmx:trigger for throttled events too 2024-08-05 13:48:37 -06:00
Kyungmin Bae
27412551a5
fix: Fire htmx:trigger event on delayed triggers (#2411)
* Add test on htmx:trigger for delayed triggers

* Fire htmx:trigger event on delayed triggers
2024-08-05 13:47:58 -06:00
Carson Gross
df3fd8fe28 Merge remote-tracking branch 'origin/dev' into dev 2024-08-05 13:46:28 -06:00
Carson Gross
42343d9194 Merge branch 'master' into dev 2024-08-05 13:41:37 -06:00
Carson Gross
eb32358873 add a catchall to the docs 2024-08-05 13:41:28 -06:00
ekzyis
e2b671d2f5
Fix example for responseHandling config via <meta> tag (#2715)
The current example throws this error:

  htmx.js:2914 SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2)
    at JSON.parse (<anonymous>)
    at parseJSON (htmx.js:816:19)
    at getMetaConfig (htmx.js:4902:14)
    at mergeMetaConfig (htmx.js:4909:24)
    at HTMLDocument.<anonymous> (htmx.js:4917:5)

Co-authored-by: ekzyis <ekzyis@ekzy.is>
2024-08-05 13:40:16 -06:00
pokonski
ee9b0e0390
Do not boost forms with method="dialog" (#2752)
* Do not boost forms with method="dialog"

* Clean up
2024-08-05 13:38:51 -06:00
Vincent
941e94fb98
Fix file upload through htmx.ajax (#2778)
* Fix File values handling in formDataFromObject

Fixes #2630

* Test file input upload + htmx.ajax file upload
2024-08-05 13:38:21 -06:00
Carson Gross
084df38c31 only removed templates explicitly used for encapsulating oob swaps
fixes https://github.com/bigskysoftware/htmx/issues/2776
2024-08-05 13:37:31 -06:00
Carson Gross
ce46e436fd handle situation where body has been deleted
fixes https://github.com/bigskysoftware/htmx/issues/2710
2024-08-05 13:18:03 -06:00
Carson Gross
89dc9bea2e Merge remote-tracking branch 'origin/dev' into dev 2024-08-05 13:12:22 -06:00
Carson Gross
0ace4a731c scan through all siblings (not just until the first non-element) when doing an outerHTML swap to add things to settle
fixes https://github.com/bigskysoftware/htmx/issues/2787
2024-08-05 13:12:13 -06:00
Carson Gross
df16ed8e96 manual test for keeping indicators visible 2024-08-05 12:29:33 -06:00
Carson Gross
e99d8976f5 Manual test to ensure disabled elements are scrubbed when saving history 2024-08-05 12:22:51 -06:00
M Somerville
13b44b7897
Fix inlineStyleNonce typo in reference (#2785) 2024-08-03 19:45:37 +02:00
Carson Gross
a575ad20f0 use attributes rather than request count since we are working on a clone of the original DOM 2024-08-01 13:44:31 -06:00
Carson Gross
115f2cf210 remove disabled attributes from anything disabled due to an htmx request when snapshotting for history 2024-08-01 12:59:42 -06:00
Carson Gross
116c8619d5 allow response actions (such as full page refreshes) to retain htmx indicators during the response handling 2024-08-01 12:56:24 -06:00
Jonas Högman
45d4bec43f
Fix typo in update-other-content.md (#2783)
Co-authored-by: Jonas Hogman <jonas.hogman@seb.se>
2024-08-01 11:27:06 +02:00
Alexandre Spaeth
a30e96b553
Fix package.json configuration for types (#2769)
* Generate .d.ts file from the esm module (#2733)

* Fix types annotation filename in package.json (#2734)

---------

Co-authored-by: Alexandre Spaeth <alex_erson@users.noreply.github.com>
2024-07-29 17:54:06 -04:00
Ben Croker
a44a1b3c34
Add ability to trigger an event on another element using HX-Trigger response header (#2768)
* Update htmx.js

* Update htmx.js

* Update headers.js

* Update htmx.js

* Update htmx.js

* Update htmx.js

* Update hx-trigger.md
2024-07-29 10:33:24 -06:00
Jan-Niklas W.
0f70de7c0f
docs: update jetbrains sponsor logo (#2551)
* docs: update jetbrains sponsor logo

* docs: support light and dark theme for jetbrains logo

---------

Co-authored-by: Jan-Niklas Wortmann <jan-niklas.wortmann@jetbrains.com>
2024-07-26 00:32:59 -04:00