htmx.org 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,7 +17,7 @@ directly in HTML, using [attributes](https://htmx.org/reference#attributes), so
17
17
 
18
18
  htmx is small ([~14k min.gz'd](https://unpkg.com/htmx.org/dist/)),
19
19
  [dependency-free](https://github.com/bigskysoftware/htmx/blob/master/package.json) &
20
- [extendable](https://htmx.org/extensions)
20
+ [extendable](https://extensions.htmx.org/)
21
21
 
22
22
  ## motivation
23
23
 
@@ -32,7 +32,7 @@ By removing these arbitrary constraints htmx completes HTML as a
32
32
  ## quick start
33
33
 
34
34
  ```html
35
- <script src="https://unpkg.com/htmx.org@2.0.1"></script>
35
+ <script src="https://unpkg.com/htmx.org@2.0.2"></script>
36
36
  <!-- have a button POST a click via AJAX -->
37
37
  <button hx-post="/clicked" hx-swap="outerHTML">
38
38
  Click Me
package/dist/htmx.amd.js CHANGED
@@ -207,7 +207,7 @@ var htmx = (function() {
207
207
  disableSelector: '[hx-disable], [data-hx-disable]',
208
208
  /**
209
209
  * @type {'auto' | 'instant' | 'smooth'}
210
- * @default 'smooth'
210
+ * @default 'instant'
211
211
  */
212
212
  scrollBehavior: 'instant',
213
213
  /**
@@ -278,7 +278,7 @@ var htmx = (function() {
278
278
  parseInterval: null,
279
279
  /** @type {typeof internalEval} */
280
280
  _: null,
281
- version: '2.0.1'
281
+ version: '2.0.2'
282
282
  }
283
283
  // Tsc madness part 2
284
284
  htmx.onLoad = onLoadHelper
@@ -1640,13 +1640,13 @@ var htmx = (function() {
1640
1640
  newElt = eltBeforeNewContent.nextSibling
1641
1641
  }
1642
1642
  settleInfo.elts = settleInfo.elts.filter(function(e) { return e !== target })
1643
+ // scan through all newly added content and add all elements to the settle info so we trigger
1644
+ // events properly on them
1643
1645
  while (newElt && newElt !== target) {
1644
1646
  if (newElt instanceof Element) {
1645
1647
  settleInfo.elts.push(newElt)
1646
- newElt = newElt.nextElementSibling
1647
- } else {
1648
- newElt = null
1649
1648
  }
1649
+ newElt = newElt.nextSibling
1650
1650
  }
1651
1651
  cleanUpElement(target)
1652
1652
  if (target instanceof Element) {
@@ -1754,7 +1754,7 @@ var htmx = (function() {
1754
1754
  try {
1755
1755
  const newElements = ext.handleSwap(swapStyle, target, fragment, settleInfo)
1756
1756
  if (newElements) {
1757
- if (typeof newElements.length !== 'undefined') {
1757
+ if (Array.isArray(newElements)) {
1758
1758
  // if handleSwap returns an array (like) of elements, we handle them
1759
1759
  for (let j = 0; j < newElements.length; j++) {
1760
1760
  const child = newElements[j]
@@ -1782,7 +1782,8 @@ var htmx = (function() {
1782
1782
  * @param {HtmxSettleInfo} settleInfo
1783
1783
  */
1784
1784
  function findAndSwapOobElements(fragment, settleInfo) {
1785
- forEach(findAll(fragment, '[hx-swap-oob], [data-hx-swap-oob]'), function(oobElement) {
1785
+ var oobElts = findAll(fragment, '[hx-swap-oob], [data-hx-swap-oob]')
1786
+ forEach(oobElts, function(oobElement) {
1786
1787
  if (htmx.config.allowNestedOobSwaps || oobElement.parentElement === null) {
1787
1788
  const oobValue = getAttributeValue(oobElement, 'hx-swap-oob')
1788
1789
  if (oobValue != null) {
@@ -1793,6 +1794,7 @@ var htmx = (function() {
1793
1794
  oobElement.removeAttribute('data-hx-swap-oob')
1794
1795
  }
1795
1796
  })
1797
+ return oobElts.length > 0
1796
1798
  }
1797
1799
 
1798
1800
  /**
@@ -1854,9 +1856,8 @@ var htmx = (function() {
1854
1856
  // oob swaps
1855
1857
  findAndSwapOobElements(fragment, settleInfo)
1856
1858
  forEach(findAll(fragment, 'template'), /** @param {HTMLTemplateElement} template */function(template) {
1857
- findAndSwapOobElements(template.content, settleInfo)
1858
- if (template.content.childElementCount === 0 && template.content.textContent.trim() === '') {
1859
- // Avoid polluting the DOM with empty templates that were only used to encapsulate oob swap
1859
+ if (findAndSwapOobElements(template.content, settleInfo)) {
1860
+ // Avoid polluting the DOM with empty templates that were only used to encapsulate oob swap
1860
1861
  template.remove()
1861
1862
  }
1862
1863
  })
@@ -1953,7 +1954,10 @@ var htmx = (function() {
1953
1954
  for (const eventName in triggers) {
1954
1955
  if (triggers.hasOwnProperty(eventName)) {
1955
1956
  let detail = triggers[eventName]
1956
- if (!isRawObject(detail)) {
1957
+ if (isRawObject(detail)) {
1958
+ // @ts-ignore
1959
+ elt = detail.target !== undefined ? detail.target : elt
1960
+ } else {
1957
1961
  detail = { value: detail }
1958
1962
  }
1959
1963
  triggerEvent(elt, eventName, detail)
@@ -2274,7 +2278,7 @@ var htmx = (function() {
2274
2278
  * @param {HtmxTriggerSpecification[]} triggerSpecs
2275
2279
  */
2276
2280
  function boostElement(elt, nodeData, triggerSpecs) {
2277
- if ((elt instanceof HTMLAnchorElement && isLocalLink(elt) && (elt.target === '' || elt.target === '_self')) || elt.tagName === 'FORM') {
2281
+ if ((elt instanceof HTMLAnchorElement && isLocalLink(elt) && (elt.target === '' || elt.target === '_self')) || (elt.tagName === 'FORM' && String(getRawAttribute(elt, 'method')).toLowerCase() !== 'dialog')) {
2278
2282
  nodeData.boosted = true
2279
2283
  let verb, path
2280
2284
  if (elt.tagName === 'A') {
@@ -2436,13 +2440,17 @@ var htmx = (function() {
2436
2440
 
2437
2441
  if (triggerSpec.throttle > 0) {
2438
2442
  if (!elementData.throttle) {
2443
+ triggerEvent(elt, 'htmx:trigger')
2439
2444
  handler(elt, evt)
2440
2445
  elementData.throttle = getWindow().setTimeout(function() {
2441
2446
  elementData.throttle = null
2442
2447
  }, triggerSpec.throttle)
2443
2448
  }
2444
2449
  } else if (triggerSpec.delay > 0) {
2445
- elementData.delayed = getWindow().setTimeout(function() { handler(elt, evt) }, triggerSpec.delay)
2450
+ elementData.delayed = getWindow().setTimeout(function() {
2451
+ triggerEvent(elt, 'htmx:trigger')
2452
+ handler(elt, evt)
2453
+ }, triggerSpec.delay)
2446
2454
  } else {
2447
2455
  triggerEvent(elt, 'htmx:trigger')
2448
2456
  handler(elt, evt)
@@ -3060,6 +3068,10 @@ var htmx = (function() {
3060
3068
  forEach(findAll(clone, '.' + className), function(child) {
3061
3069
  removeClassFromElement(child, className)
3062
3070
  })
3071
+ // remove the disabled attribute for any element disabled due to an htmx request
3072
+ forEach(findAll(clone, '[data-disabled-by-htmx]'), function(child) {
3073
+ child.removeAttribute('disabled')
3074
+ })
3063
3075
  return clone.innerHTML
3064
3076
  }
3065
3077
 
@@ -3213,6 +3225,7 @@ var htmx = (function() {
3213
3225
  const internalData = getInternalData(disabledElement)
3214
3226
  internalData.requestCount = (internalData.requestCount || 0) + 1
3215
3227
  disabledElement.setAttribute('disabled', '')
3228
+ disabledElement.setAttribute('data-disabled-by-htmx', '')
3216
3229
  })
3217
3230
  return disabledElts
3218
3231
  }
@@ -3234,6 +3247,7 @@ var htmx = (function() {
3234
3247
  internalData.requestCount = (internalData.requestCount || 0) - 1
3235
3248
  if (internalData.requestCount === 0) {
3236
3249
  disabledElement.removeAttribute('disabled')
3250
+ disabledElement.removeAttribute('data-disabled-by-htmx')
3237
3251
  }
3238
3252
  })
3239
3253
  }
@@ -3383,10 +3397,10 @@ var htmx = (function() {
3383
3397
  function overrideFormData(receiver, donor) {
3384
3398
  for (const key of donor.keys()) {
3385
3399
  receiver.delete(key)
3386
- donor.getAll(key).forEach(function(value) {
3387
- receiver.append(key, value)
3388
- })
3389
3400
  }
3401
+ donor.forEach(function(value, key) {
3402
+ receiver.append(key, value)
3403
+ })
3390
3404
  return receiver
3391
3405
  }
3392
3406
 
@@ -3916,7 +3930,7 @@ var htmx = (function() {
3916
3930
  if (obj.hasOwnProperty(key)) {
3917
3931
  if (typeof obj[key].forEach === 'function') {
3918
3932
  obj[key].forEach(function(v) { formData.append(key, v) })
3919
- } else if (typeof obj[key] === 'object') {
3933
+ } else if (typeof obj[key] === 'object' && !(obj[key] instanceof Blob)) {
3920
3934
  formData.append(key, JSON.stringify(obj[key]))
3921
3935
  } else {
3922
3936
  formData.append(key, obj[key])
@@ -4009,6 +4023,8 @@ var htmx = (function() {
4009
4023
  target.delete(name)
4010
4024
  if (typeof value.forEach === 'function') {
4011
4025
  value.forEach(function(v) { target.append(name, v) })
4026
+ } else if (typeof value === 'object' && !(value instanceof Blob)) {
4027
+ target.append(name, JSON.stringify(value))
4012
4028
  } else {
4013
4029
  target.append(name, value)
4014
4030
  }
@@ -4344,7 +4360,9 @@ var htmx = (function() {
4344
4360
  const hierarchy = hierarchyForElt(elt)
4345
4361
  responseInfo.pathInfo.responsePath = getPathFromResponse(xhr)
4346
4362
  responseHandler(elt, responseInfo)
4347
- removeRequestIndicators(indicators, disableElts)
4363
+ if (responseInfo.keepIndicators !== true) {
4364
+ removeRequestIndicators(indicators, disableElts)
4365
+ }
4348
4366
  triggerEvent(elt, 'htmx:afterRequest', responseInfo)
4349
4367
  triggerEvent(elt, 'htmx:afterOnLoad', responseInfo)
4350
4368
  // if the body no longer contains the element, trigger the event on the closest parent
@@ -4584,12 +4602,14 @@ var htmx = (function() {
4584
4602
  const shouldRefresh = hasHeader(xhr, /HX-Refresh:/i) && xhr.getResponseHeader('HX-Refresh') === 'true'
4585
4603
 
4586
4604
  if (hasHeader(xhr, /HX-Redirect:/i)) {
4605
+ responseInfo.keepIndicators = true
4587
4606
  location.href = xhr.getResponseHeader('HX-Redirect')
4588
4607
  shouldRefresh && location.reload()
4589
4608
  return
4590
4609
  }
4591
4610
 
4592
4611
  if (shouldRefresh) {
4612
+ responseInfo.keepIndicators = true
4593
4613
  location.reload()
4594
4614
  return
4595
4615
  }
@@ -5073,6 +5093,7 @@ var htmx = (function() {
5073
5093
  * @property {{requestPath: string, finalRequestPath: string, responsePath: string|null, anchor: string}} pathInfo
5074
5094
  * @property {boolean} [failed]
5075
5095
  * @property {boolean} [successful]
5096
+ * @property {boolean} [keepIndicators]
5076
5097
  */
5077
5098
 
5078
5099
  /**
@@ -5122,14 +5143,15 @@ var htmx = (function() {
5122
5143
  */
5123
5144
 
5124
5145
  /**
5146
+ * @see https://github.com/bigskysoftware/htmx-extensions/blob/main/README.md
5125
5147
  * @typedef {Object} HtmxExtension
5126
- * @see https://htmx.org/extensions/#defining
5127
5148
  * @property {(api: any) => void} init
5128
5149
  * @property {(name: string, event: Event|CustomEvent) => boolean} onEvent
5129
5150
  * @property {(text: string, xhr: XMLHttpRequest, elt: Element) => string} transformResponse
5130
5151
  * @property {(swapStyle: HtmxSwapStyle) => boolean} isInlineSwap
5131
- * @property {(swapStyle: HtmxSwapStyle, target: Element, fragment: Node, settleInfo: HtmxSettleInfo) => boolean} handleSwap
5132
- * @property {(xhr: XMLHttpRequest, parameters: FormData, elt: Element) => *|string|null} encodeParameters
5152
+ * @property {(swapStyle: HtmxSwapStyle, target: Node, fragment: Node, settleInfo: HtmxSettleInfo) => boolean|Node[]} handleSwap
5153
+ * @property {(xhr: XMLHttpRequest, parameters: FormData, elt: Node) => *|string|null} encodeParameters
5154
+ * @property {() => string[]|null} getSelectors
5133
5155
  */
5134
5156
  return htmx
5135
5157
  })
package/dist/htmx.cjs.js CHANGED
@@ -206,7 +206,7 @@ var htmx = (function() {
206
206
  disableSelector: '[hx-disable], [data-hx-disable]',
207
207
  /**
208
208
  * @type {'auto' | 'instant' | 'smooth'}
209
- * @default 'smooth'
209
+ * @default 'instant'
210
210
  */
211
211
  scrollBehavior: 'instant',
212
212
  /**
@@ -277,7 +277,7 @@ var htmx = (function() {
277
277
  parseInterval: null,
278
278
  /** @type {typeof internalEval} */
279
279
  _: null,
280
- version: '2.0.1'
280
+ version: '2.0.2'
281
281
  }
282
282
  // Tsc madness part 2
283
283
  htmx.onLoad = onLoadHelper
@@ -1639,13 +1639,13 @@ var htmx = (function() {
1639
1639
  newElt = eltBeforeNewContent.nextSibling
1640
1640
  }
1641
1641
  settleInfo.elts = settleInfo.elts.filter(function(e) { return e !== target })
1642
+ // scan through all newly added content and add all elements to the settle info so we trigger
1643
+ // events properly on them
1642
1644
  while (newElt && newElt !== target) {
1643
1645
  if (newElt instanceof Element) {
1644
1646
  settleInfo.elts.push(newElt)
1645
- newElt = newElt.nextElementSibling
1646
- } else {
1647
- newElt = null
1648
1647
  }
1648
+ newElt = newElt.nextSibling
1649
1649
  }
1650
1650
  cleanUpElement(target)
1651
1651
  if (target instanceof Element) {
@@ -1753,7 +1753,7 @@ var htmx = (function() {
1753
1753
  try {
1754
1754
  const newElements = ext.handleSwap(swapStyle, target, fragment, settleInfo)
1755
1755
  if (newElements) {
1756
- if (typeof newElements.length !== 'undefined') {
1756
+ if (Array.isArray(newElements)) {
1757
1757
  // if handleSwap returns an array (like) of elements, we handle them
1758
1758
  for (let j = 0; j < newElements.length; j++) {
1759
1759
  const child = newElements[j]
@@ -1781,7 +1781,8 @@ var htmx = (function() {
1781
1781
  * @param {HtmxSettleInfo} settleInfo
1782
1782
  */
1783
1783
  function findAndSwapOobElements(fragment, settleInfo) {
1784
- forEach(findAll(fragment, '[hx-swap-oob], [data-hx-swap-oob]'), function(oobElement) {
1784
+ var oobElts = findAll(fragment, '[hx-swap-oob], [data-hx-swap-oob]')
1785
+ forEach(oobElts, function(oobElement) {
1785
1786
  if (htmx.config.allowNestedOobSwaps || oobElement.parentElement === null) {
1786
1787
  const oobValue = getAttributeValue(oobElement, 'hx-swap-oob')
1787
1788
  if (oobValue != null) {
@@ -1792,6 +1793,7 @@ var htmx = (function() {
1792
1793
  oobElement.removeAttribute('data-hx-swap-oob')
1793
1794
  }
1794
1795
  })
1796
+ return oobElts.length > 0
1795
1797
  }
1796
1798
 
1797
1799
  /**
@@ -1853,9 +1855,8 @@ var htmx = (function() {
1853
1855
  // oob swaps
1854
1856
  findAndSwapOobElements(fragment, settleInfo)
1855
1857
  forEach(findAll(fragment, 'template'), /** @param {HTMLTemplateElement} template */function(template) {
1856
- findAndSwapOobElements(template.content, settleInfo)
1857
- if (template.content.childElementCount === 0 && template.content.textContent.trim() === '') {
1858
- // Avoid polluting the DOM with empty templates that were only used to encapsulate oob swap
1858
+ if (findAndSwapOobElements(template.content, settleInfo)) {
1859
+ // Avoid polluting the DOM with empty templates that were only used to encapsulate oob swap
1859
1860
  template.remove()
1860
1861
  }
1861
1862
  })
@@ -1952,7 +1953,10 @@ var htmx = (function() {
1952
1953
  for (const eventName in triggers) {
1953
1954
  if (triggers.hasOwnProperty(eventName)) {
1954
1955
  let detail = triggers[eventName]
1955
- if (!isRawObject(detail)) {
1956
+ if (isRawObject(detail)) {
1957
+ // @ts-ignore
1958
+ elt = detail.target !== undefined ? detail.target : elt
1959
+ } else {
1956
1960
  detail = { value: detail }
1957
1961
  }
1958
1962
  triggerEvent(elt, eventName, detail)
@@ -2273,7 +2277,7 @@ var htmx = (function() {
2273
2277
  * @param {HtmxTriggerSpecification[]} triggerSpecs
2274
2278
  */
2275
2279
  function boostElement(elt, nodeData, triggerSpecs) {
2276
- if ((elt instanceof HTMLAnchorElement && isLocalLink(elt) && (elt.target === '' || elt.target === '_self')) || elt.tagName === 'FORM') {
2280
+ if ((elt instanceof HTMLAnchorElement && isLocalLink(elt) && (elt.target === '' || elt.target === '_self')) || (elt.tagName === 'FORM' && String(getRawAttribute(elt, 'method')).toLowerCase() !== 'dialog')) {
2277
2281
  nodeData.boosted = true
2278
2282
  let verb, path
2279
2283
  if (elt.tagName === 'A') {
@@ -2435,13 +2439,17 @@ var htmx = (function() {
2435
2439
 
2436
2440
  if (triggerSpec.throttle > 0) {
2437
2441
  if (!elementData.throttle) {
2442
+ triggerEvent(elt, 'htmx:trigger')
2438
2443
  handler(elt, evt)
2439
2444
  elementData.throttle = getWindow().setTimeout(function() {
2440
2445
  elementData.throttle = null
2441
2446
  }, triggerSpec.throttle)
2442
2447
  }
2443
2448
  } else if (triggerSpec.delay > 0) {
2444
- elementData.delayed = getWindow().setTimeout(function() { handler(elt, evt) }, triggerSpec.delay)
2449
+ elementData.delayed = getWindow().setTimeout(function() {
2450
+ triggerEvent(elt, 'htmx:trigger')
2451
+ handler(elt, evt)
2452
+ }, triggerSpec.delay)
2445
2453
  } else {
2446
2454
  triggerEvent(elt, 'htmx:trigger')
2447
2455
  handler(elt, evt)
@@ -3059,6 +3067,10 @@ var htmx = (function() {
3059
3067
  forEach(findAll(clone, '.' + className), function(child) {
3060
3068
  removeClassFromElement(child, className)
3061
3069
  })
3070
+ // remove the disabled attribute for any element disabled due to an htmx request
3071
+ forEach(findAll(clone, '[data-disabled-by-htmx]'), function(child) {
3072
+ child.removeAttribute('disabled')
3073
+ })
3062
3074
  return clone.innerHTML
3063
3075
  }
3064
3076
 
@@ -3212,6 +3224,7 @@ var htmx = (function() {
3212
3224
  const internalData = getInternalData(disabledElement)
3213
3225
  internalData.requestCount = (internalData.requestCount || 0) + 1
3214
3226
  disabledElement.setAttribute('disabled', '')
3227
+ disabledElement.setAttribute('data-disabled-by-htmx', '')
3215
3228
  })
3216
3229
  return disabledElts
3217
3230
  }
@@ -3233,6 +3246,7 @@ var htmx = (function() {
3233
3246
  internalData.requestCount = (internalData.requestCount || 0) - 1
3234
3247
  if (internalData.requestCount === 0) {
3235
3248
  disabledElement.removeAttribute('disabled')
3249
+ disabledElement.removeAttribute('data-disabled-by-htmx')
3236
3250
  }
3237
3251
  })
3238
3252
  }
@@ -3382,10 +3396,10 @@ var htmx = (function() {
3382
3396
  function overrideFormData(receiver, donor) {
3383
3397
  for (const key of donor.keys()) {
3384
3398
  receiver.delete(key)
3385
- donor.getAll(key).forEach(function(value) {
3386
- receiver.append(key, value)
3387
- })
3388
3399
  }
3400
+ donor.forEach(function(value, key) {
3401
+ receiver.append(key, value)
3402
+ })
3389
3403
  return receiver
3390
3404
  }
3391
3405
 
@@ -3915,7 +3929,7 @@ var htmx = (function() {
3915
3929
  if (obj.hasOwnProperty(key)) {
3916
3930
  if (typeof obj[key].forEach === 'function') {
3917
3931
  obj[key].forEach(function(v) { formData.append(key, v) })
3918
- } else if (typeof obj[key] === 'object') {
3932
+ } else if (typeof obj[key] === 'object' && !(obj[key] instanceof Blob)) {
3919
3933
  formData.append(key, JSON.stringify(obj[key]))
3920
3934
  } else {
3921
3935
  formData.append(key, obj[key])
@@ -4008,6 +4022,8 @@ var htmx = (function() {
4008
4022
  target.delete(name)
4009
4023
  if (typeof value.forEach === 'function') {
4010
4024
  value.forEach(function(v) { target.append(name, v) })
4025
+ } else if (typeof value === 'object' && !(value instanceof Blob)) {
4026
+ target.append(name, JSON.stringify(value))
4011
4027
  } else {
4012
4028
  target.append(name, value)
4013
4029
  }
@@ -4343,7 +4359,9 @@ var htmx = (function() {
4343
4359
  const hierarchy = hierarchyForElt(elt)
4344
4360
  responseInfo.pathInfo.responsePath = getPathFromResponse(xhr)
4345
4361
  responseHandler(elt, responseInfo)
4346
- removeRequestIndicators(indicators, disableElts)
4362
+ if (responseInfo.keepIndicators !== true) {
4363
+ removeRequestIndicators(indicators, disableElts)
4364
+ }
4347
4365
  triggerEvent(elt, 'htmx:afterRequest', responseInfo)
4348
4366
  triggerEvent(elt, 'htmx:afterOnLoad', responseInfo)
4349
4367
  // if the body no longer contains the element, trigger the event on the closest parent
@@ -4583,12 +4601,14 @@ var htmx = (function() {
4583
4601
  const shouldRefresh = hasHeader(xhr, /HX-Refresh:/i) && xhr.getResponseHeader('HX-Refresh') === 'true'
4584
4602
 
4585
4603
  if (hasHeader(xhr, /HX-Redirect:/i)) {
4604
+ responseInfo.keepIndicators = true
4586
4605
  location.href = xhr.getResponseHeader('HX-Redirect')
4587
4606
  shouldRefresh && location.reload()
4588
4607
  return
4589
4608
  }
4590
4609
 
4591
4610
  if (shouldRefresh) {
4611
+ responseInfo.keepIndicators = true
4592
4612
  location.reload()
4593
4613
  return
4594
4614
  }
@@ -5072,6 +5092,7 @@ var htmx = (function() {
5072
5092
  * @property {{requestPath: string, finalRequestPath: string, responsePath: string|null, anchor: string}} pathInfo
5073
5093
  * @property {boolean} [failed]
5074
5094
  * @property {boolean} [successful]
5095
+ * @property {boolean} [keepIndicators]
5075
5096
  */
5076
5097
 
5077
5098
  /**
@@ -5121,13 +5142,14 @@ var htmx = (function() {
5121
5142
  */
5122
5143
 
5123
5144
  /**
5145
+ * @see https://github.com/bigskysoftware/htmx-extensions/blob/main/README.md
5124
5146
  * @typedef {Object} HtmxExtension
5125
- * @see https://htmx.org/extensions/#defining
5126
5147
  * @property {(api: any) => void} init
5127
5148
  * @property {(name: string, event: Event|CustomEvent) => boolean} onEvent
5128
5149
  * @property {(text: string, xhr: XMLHttpRequest, elt: Element) => string} transformResponse
5129
5150
  * @property {(swapStyle: HtmxSwapStyle) => boolean} isInlineSwap
5130
- * @property {(swapStyle: HtmxSwapStyle, target: Element, fragment: Node, settleInfo: HtmxSettleInfo) => boolean} handleSwap
5131
- * @property {(xhr: XMLHttpRequest, parameters: FormData, elt: Element) => *|string|null} encodeParameters
5151
+ * @property {(swapStyle: HtmxSwapStyle, target: Node, fragment: Node, settleInfo: HtmxSettleInfo) => boolean|Node[]} handleSwap
5152
+ * @property {(xhr: XMLHttpRequest, parameters: FormData, elt: Node) => *|string|null} encodeParameters
5153
+ * @property {() => string[]|null} getSelectors
5132
5154
  */
5133
5155
  module.exports = htmx;