htmx.org 1.9.5 → 1.9.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.9.7] - 2023-11-03
4
+
5
+ * Fixed a bug where a button associated with a form that is swapped out of the DOM caused errors
6
+ * The `hx-target-error` attribute was added to the `response-targets` extension, allowing you to capture all 400 & 500
7
+ responses with a single attribute
8
+ * `hx-on` now properly supports multiple listeners
9
+ * The `hx-confirm` prompt is now passed into custom confirmation handlers
10
+ * `next` and `previous` are now valid _extended CSS_ symbols in htmx
11
+ * The `htmx:beforeHistoryUpdate` event was added
12
+ * Properly ignore the `dialog` formmethod on buttons when resolving the HTTP method to use
13
+ * Added a `htmx.config.scrollIntoViewOnBoost` option that may be set to `false` to disable scrolling the top of the
14
+ body into view for boosted elements
15
+
16
+ ## [1.9.6] - 2023-09-22
17
+
18
+ * IE support has been restored (thank you @telroshan!)
19
+ * Introduced the `hx-disabled-elt` attribute to allow specifing elements to disable during a request
20
+ * You can now explicitly decide to ignore `title` tags found in new content via the `ignoreTitle` option in `hx-swap` and the `htmx.config.ignoreTitle` configuration variable.
21
+ * `hx-swap` modifiers may be used without explicitly specifying the swap mechanism
22
+ * Arrays are now supported in the `client-side-templates` extension
23
+ * XSLT support in the `client-side-templates` extension
24
+ * Support `preventDefault()` in extension event handling
25
+ * Allow the `HX-Refresh` header to apply even after an `HX-Redirect` has occurred
26
+ * the `formaction` and `formmethod` attributes on buttons are now properly respected
27
+ * `hx-on` can now handle events with dots in their name
28
+ * `htmx.ajax()` now always returns a Promise
29
+ * Handle leading `style` tag parsing more effectively
30
+
3
31
  ## [1.9.5] - 2023-08-25
4
32
 
5
33
  * Web sockets now properly pass the target id in the HEADERS struct
@@ -23,7 +51,7 @@
23
51
 
24
52
  ## [1.9.3] - 2023-07-14
25
53
 
26
- * The `hx-on` attribute has been deprecated (sorry) in favor of `hx-on-<event name>` attributes. See [`hx-on`](/attributes/hx-on) for more information.
54
+ * The `hx-on` attribute has been deprecated (sorry) in favor of `hx-on:<event name>` attributes. See [`hx-on`](/attributes/hx-on) for more information.
27
55
  * We now have functioning CI using GitHub actions!
28
56
  * You can now configure if a type of HTTP request uses the body for parameters or not. In particular, the `DELETE` _should_ use
29
57
  query parameters, according to the spec. htmx has used the body, instead. To avoid breaking code we are keeping this undefined
package/README.md CHANGED
@@ -33,7 +33,7 @@ By removing these arbitrary constraints htmx completes HTML as a
33
33
  ## quick start
34
34
 
35
35
  ```html
36
- <script src="https://unpkg.com/htmx.org@1.9.5"></script>
36
+ <script src="https://unpkg.com/htmx.org@1.9.7"></script>
37
37
  <!-- have a button POST a click via AJAX -->
38
38
  <button hx-post="/clicked" hx-swap="outerHTML">
39
39
  Click Me
@@ -62,15 +62,9 @@ Note there is an old broken package called `htmx`. This is `htmx.org`.
62
62
  * <https://htmx.org/docs>
63
63
 
64
64
  ## contributing
65
+ Want to contribute? Check out our [contribution guidelines](CONTRIBUTING.md)
65
66
 
66
- * All PRs should be made against the `dev` branch, except documentation PRs (`www/` directory) which can be made against `master`
67
- * Please write code, including tests, in ES5 for [IE 11 compatibility](https://stackoverflow.com/questions/39902809/support-for-es6-in-internet-explorer-11)
68
- * Please include test cases in [`/test`](https://github.com/bigskysoftware/htmx/tree/dev/test) and docs in [`/www`](https://github.com/bigskysoftware/htmx/tree/dev/www)
69
- * Search the issues before proposing a feature to see if it is already under discussion
70
- * If you are adding a feature, consider doing it as an [extension](https://htmx.org/extensions) instead to keep the core htmx code tidy
71
- * Want to contribute but don't know where to start? Look for issues with the "help wanted" tag
72
- * Refactors that do not make functional changes will be automatically closed, unless explicitly solicited (documentation typo fixes are fine)
73
- * No time? Then [become a sponsor](https://github.com/sponsors/bigskysoftware#sponsors)
67
+ No time? Then [become a sponsor](https://github.com/sponsors/bigskysoftware#sponsors)
74
68
 
75
69
  ### hacking guide
76
70
 
@@ -108,6 +102,8 @@ At this point you can modify `/src/htmx.js` to add features, and then add tests
108
102
  htmx uses the [mocha](https://mochajs.org/) testing framework, the [chai](https://www.chaijs.com/) assertion framework
109
103
  and [sinon](https://sinonjs.org/releases/v9/fake-xhr-and-server/) to mock out AJAX requests. They are all OK.
110
104
 
105
+ You can also run live tests and demo of the WebSockets and Server-Side Events extensions with `npm run ws-tests`
106
+
111
107
  ## haiku
112
108
 
113
109
  *javascript fatigue:<br/>
@@ -13,11 +13,42 @@ htmx.defineExtension('client-side-templates', {
13
13
  }
14
14
  }
15
15
 
16
+ var mustacheArrayTemplate = htmx.closest(elt, "[mustache-array-template]");
17
+ if (mustacheArrayTemplate) {
18
+ var data = JSON.parse(text);
19
+ var templateId = mustacheArrayTemplate.getAttribute('mustache-array-template');
20
+ var template = htmx.find("#" + templateId);
21
+ if (template) {
22
+ return Mustache.render(template.innerHTML, {"data": data });
23
+ } else {
24
+ throw "Unknown mustache template: " + templateId;
25
+ }
26
+ }
27
+
16
28
  var handlebarsTemplate = htmx.closest(elt, "[handlebars-template]");
17
29
  if (handlebarsTemplate) {
18
30
  var data = JSON.parse(text);
19
- var templateName = handlebarsTemplate.getAttribute('handlebars-template');
20
- return Handlebars.partials[templateName](data);
31
+ var templateId = handlebarsTemplate.getAttribute('handlebars-template');
32
+ var templateElement = htmx.find('#' + templateId).innerHTML;
33
+ var renderTemplate = Handlebars.compile(templateElement);
34
+ if (renderTemplate) {
35
+ return renderTemplate(data);
36
+ } else {
37
+ throw "Unknown handlebars template: " + templateId;
38
+ }
39
+ }
40
+
41
+ var handlebarsArrayTemplate = htmx.closest(elt, "[handlebars-array-template]");
42
+ if (handlebarsArrayTemplate) {
43
+ var data = JSON.parse(text);
44
+ var templateId = handlebarsArrayTemplate.getAttribute('handlebars-array-template');
45
+ var templateElement = htmx.find('#' + templateId).innerHTML;
46
+ var renderTemplate = Handlebars.compile(templateElement);
47
+ if (renderTemplate) {
48
+ return renderTemplate(data);
49
+ } else {
50
+ throw "Unknown handlebars template: " + templateId;
51
+ }
21
52
  }
22
53
 
23
54
  var nunjucksTemplate = htmx.closest(elt, "[nunjucks-template]");
@@ -30,8 +61,36 @@ htmx.defineExtension('client-side-templates', {
30
61
  } else {
31
62
  return nunjucks.render(templateName, data);
32
63
  }
33
- }
64
+ }
34
65
 
66
+ var xsltTemplate = htmx.closest(elt, "[xslt-template]");
67
+ if (xsltTemplate) {
68
+ var templateId = xsltTemplate.getAttribute('xslt-template');
69
+ var template = htmx.find("#" + templateId);
70
+ if (template) {
71
+ var content = template.innerHTML ? new DOMParser().parseFromString(template.innerHTML, 'application/xml')
72
+ : template.contentDocument;
73
+ var processor = new XSLTProcessor();
74
+ processor.importStylesheet(content);
75
+ var data = new DOMParser().parseFromString(text, "application/xml");
76
+ var frag = processor.transformToFragment(data, document);
77
+ return new XMLSerializer().serializeToString(frag);
78
+ } else {
79
+ throw "Unknown XSLT template: " + templateId;
80
+ }
81
+ }
82
+
83
+ var nunjucksArrayTemplate = htmx.closest(elt, "[nunjucks-array-template]");
84
+ if (nunjucksArrayTemplate) {
85
+ var data = JSON.parse(text);
86
+ var templateName = nunjucksArrayTemplate.getAttribute('nunjucks-array-template');
87
+ var template = htmx.find('#' + templateName);
88
+ if (template) {
89
+ return nunjucks.renderString(template.innerHTML, {"data": data});
90
+ } else {
91
+ return nunjucks.render(templateName, {"data": data});
92
+ }
93
+ }
35
94
  return text;
36
95
  }
37
96
  });
@@ -5,12 +5,14 @@ htmx.defineExtension('disable-element', {
5
5
  onEvent: function (name, evt) {
6
6
  let elt = evt.detail.elt;
7
7
  let target = elt.getAttribute("hx-disable-element");
8
- let targetElement = (target == "self") ? elt : document.querySelector(target);
8
+ let targetElements = (target == "self") ? [ elt ] : document.querySelectorAll(target);
9
9
 
10
- if (name === "htmx:beforeRequest" && targetElement) {
11
- targetElement.disabled = true;
12
- } else if (name == "htmx:afterRequest" && targetElement) {
13
- targetElement.disabled = false;
10
+ for (var i = 0; i < targetElements.length; i++) {
11
+ if (name === "htmx:beforeRequest" && targetElements[i]) {
12
+ targetElements[i].disabled = true;
13
+ } else if (name == "htmx:afterRequest" && targetElements[i]) {
14
+ targetElements[i].disabled = false;
15
+ }
14
16
  }
15
17
  }
16
18
  });
@@ -25,28 +25,28 @@
25
25
  if (delayElt) {
26
26
  const delayInMilliseconds =
27
27
  delayElt.getAttribute('data-loading-delay') || 200
28
- const timeout = setTimeout(() => {
28
+ const timeout = setTimeout(function () {
29
29
  doCallback()
30
30
 
31
- loadingStatesUndoQueue.push(() => {
32
- mayProcessUndoCallback(targetElt, () => undoCallback())
31
+ loadingStatesUndoQueue.push(function () {
32
+ mayProcessUndoCallback(targetElt, undoCallback)
33
33
  })
34
34
  }, delayInMilliseconds)
35
35
 
36
- loadingStatesUndoQueue.push(() => {
37
- mayProcessUndoCallback(targetElt, () => clearTimeout(timeout))
36
+ loadingStatesUndoQueue.push(function () {
37
+ mayProcessUndoCallback(targetElt, function () { clearTimeout(timeout) })
38
38
  })
39
39
  } else {
40
40
  doCallback()
41
- loadingStatesUndoQueue.push(() => {
42
- mayProcessUndoCallback(targetElt, () => undoCallback())
41
+ loadingStatesUndoQueue.push(function () {
42
+ mayProcessUndoCallback(targetElt, undoCallback)
43
43
  })
44
44
  }
45
45
  }
46
46
 
47
47
  function getLoadingStateElts(loadingScope, type, path) {
48
- return Array.from(htmx.findAll(loadingScope, `[${type}]`)).filter(
49
- (elt) => mayProcessLoadingStateByPath(elt, path)
48
+ return Array.from(htmx.findAll(loadingScope, "[" + type + "]")).filter(
49
+ function (elt) { return mayProcessLoadingStateByPath(elt, path) }
50
50
  )
51
51
  }
52
52
 
@@ -74,7 +74,7 @@
74
74
 
75
75
  let loadingStateEltsByType = {}
76
76
 
77
- loadingStateTypes.forEach((type) => {
77
+ loadingStateTypes.forEach(function (type) {
78
78
  loadingStateEltsByType[type] = getLoadingStateElts(
79
79
  container,
80
80
  type,
@@ -82,87 +82,91 @@
82
82
  )
83
83
  })
84
84
 
85
- loadingStateEltsByType['data-loading'].forEach((sourceElt) => {
86
- getLoadingTarget(sourceElt).forEach((targetElt) => {
85
+ loadingStateEltsByType['data-loading'].forEach(function (sourceElt) {
86
+ getLoadingTarget(sourceElt).forEach(function (targetElt) {
87
87
  queueLoadingState(
88
88
  sourceElt,
89
89
  targetElt,
90
- () =>
91
- (targetElt.style.display =
90
+ function () {
91
+ targetElt.style.display =
92
92
  sourceElt.getAttribute('data-loading') ||
93
- 'inline-block'),
94
- () => (targetElt.style.display = 'none')
93
+ 'inline-block' },
94
+ function () { targetElt.style.display = 'none' }
95
95
  )
96
96
  })
97
97
  })
98
98
 
99
99
  loadingStateEltsByType['data-loading-class'].forEach(
100
- (sourceElt) => {
100
+ function (sourceElt) {
101
101
  const classNames = sourceElt
102
102
  .getAttribute('data-loading-class')
103
103
  .split(' ')
104
104
 
105
- getLoadingTarget(sourceElt).forEach((targetElt) => {
105
+ getLoadingTarget(sourceElt).forEach(function (targetElt) {
106
106
  queueLoadingState(
107
107
  sourceElt,
108
108
  targetElt,
109
- () =>
110
- classNames.forEach((className) =>
111
- targetElt.classList.add(className)
112
- ),
113
- () =>
114
- classNames.forEach((className) =>
115
- targetElt.classList.remove(className)
116
- )
109
+ function () {
110
+ classNames.forEach(function (className) {
111
+ targetElt.classList.add(className)
112
+ })
113
+ },
114
+ function() {
115
+ classNames.forEach(function (className) {
116
+ targetElt.classList.remove(className)
117
+ })
118
+ }
117
119
  )
118
120
  })
119
121
  }
120
122
  )
121
123
 
122
124
  loadingStateEltsByType['data-loading-class-remove'].forEach(
123
- (sourceElt) => {
125
+ function (sourceElt) {
124
126
  const classNames = sourceElt
125
127
  .getAttribute('data-loading-class-remove')
126
128
  .split(' ')
127
129
 
128
- getLoadingTarget(sourceElt).forEach((targetElt) => {
130
+ getLoadingTarget(sourceElt).forEach(function (targetElt) {
129
131
  queueLoadingState(
130
132
  sourceElt,
131
133
  targetElt,
132
- () =>
133
- classNames.forEach((className) =>
134
- targetElt.classList.remove(className)
135
- ),
136
- () =>
137
- classNames.forEach((className) =>
138
- targetElt.classList.add(className)
139
- )
134
+ function () {
135
+ classNames.forEach(function (className) {
136
+ targetElt.classList.remove(className)
137
+ })
138
+ },
139
+ function() {
140
+ classNames.forEach(function (className) {
141
+ targetElt.classList.add(className)
142
+ })
143
+ }
140
144
  )
141
145
  })
142
146
  }
143
147
  )
144
148
 
145
149
  loadingStateEltsByType['data-loading-disable'].forEach(
146
- (sourceElt) => {
147
- getLoadingTarget(sourceElt).forEach((targetElt) => {
150
+ function (sourceElt) {
151
+ getLoadingTarget(sourceElt).forEach(function (targetElt) {
148
152
  queueLoadingState(
149
153
  sourceElt,
150
154
  targetElt,
151
- () => (targetElt.disabled = true),
152
- () => (targetElt.disabled = false)
155
+ function() { targetElt.disabled = true },
156
+ function() { targetElt.disabled = false }
153
157
  )
154
158
  })
155
159
  }
156
160
  )
157
161
 
158
162
  loadingStateEltsByType['data-loading-aria-busy'].forEach(
159
- (sourceElt) => {
160
- getLoadingTarget(sourceElt).forEach((targetElt) => {
163
+ function (sourceElt) {
164
+ getLoadingTarget(sourceElt).forEach(function (targetElt) {
161
165
  queueLoadingState(
162
166
  sourceElt,
163
167
  targetElt,
164
- () => (targetElt.setAttribute("aria-busy", "true")),
165
- () => (targetElt.removeAttribute("aria-busy"))
168
+ function () { targetElt.setAttribute("aria-busy", "true") },
169
+ function () { targetElt.removeAttribute("aria-busy") }
166
170
  )
167
171
  })
168
172
  }
@@ -5,7 +5,8 @@ htmx.defineExtension('morphdom-swap', {
5
5
  handleSwap: function (swapStyle, target, fragment) {
6
6
  if (swapStyle === 'morphdom') {
7
7
  if (fragment.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
8
- morphdom(target, fragment.firstElementChild);
8
+ // IE11 doesn't support DocumentFragment.firstElementChild
9
+ morphdom(target, fragment.firstElementChild || fragment.firstChild);
9
10
  return [target];
10
11
  } else {
11
12
  morphdom(target, fragment.outerHTML);
@@ -5,6 +5,11 @@
5
5
 
6
6
  var attrPrefix = 'hx-target-';
7
7
 
8
+ // IE11 doesn't support string.startsWith
9
+ function startsWith(str, prefix) {
10
+ return str.substring(0, prefix.length) === prefix
11
+ }
12
+
8
13
  /**
9
14
  * @param {HTMLElement} elt
10
15
  * @param {number} respCode
@@ -38,6 +43,9 @@
38
43
  '***',
39
44
  'xxx',
40
45
  ];
46
+ if (startsWith(respCode, '4') || startsWith(respCode, '5')) {
47
+ attrPossibilities.push('error');
48
+ }
41
49
 
42
50
  for (var i = 0; i < attrPossibilities.length; i++) {
43
51
  var attr = attrPrefix + attrPossibilities[i];
package/dist/ext/ws.js CHANGED
@@ -379,7 +379,7 @@ This extension adds support for WebSockets to htmx. See /www/extensions/ws.md f
379
379
 
380
380
  socketWrapper.send(body, elt);
381
381
 
382
- if (api.shouldCancel(evt, elt)) {
382
+ if (evt && api.shouldCancel(evt, elt)) {
383
383
  evt.preventDefault();
384
384
  }
385
385
  });
package/dist/htmx.d.ts CHANGED
@@ -19,8 +19,9 @@ export function addClass(elt: Element, clazz: string, delay?: number): void;
19
19
  * @param verb 'GET', 'POST', etc.
20
20
  * @param path the URL path to make the AJAX
21
21
  * @param element the element to target (defaults to the **body**)
22
+ * @returns Promise that resolves immediately if no request is sent, or when the request is complete
22
23
  */
23
- export function ajax(verb: string, path: string, element: Element): void;
24
+ export function ajax(verb: string, path: string, element: Element): Promise<void>;
24
25
 
25
26
  /**
26
27
  * Issues an htmx-style AJAX request
@@ -30,8 +31,9 @@ export function ajax(verb: string, path: string, element: Element): void;
30
31
  * @param verb 'GET', 'POST', etc.
31
32
  * @param path the URL path to make the AJAX
32
33
  * @param selector a selector for the target
34
+ * @returns Promise that resolves immediately if no request is sent, or when the request is complete
33
35
  */
34
- export function ajax(verb: string, path: string, selector: string): void;
36
+ export function ajax(verb: string, path: string, selector: string): Promise<void>;
35
37
 
36
38
  /**
37
39
  * Issues an htmx-style AJAX request
@@ -41,12 +43,13 @@ export function ajax(verb: string, path: string, selector: string): void;
41
43
  * @param verb 'GET', 'POST', etc.
42
44
  * @param path the URL path to make the AJAX
43
45
  * @param context a context object that contains any of the following
46
+ * @returns Promise that resolves immediately if no request is sent, or when the request is complete
44
47
  */
45
48
  export function ajax(
46
49
  verb: string,
47
50
  path: string,
48
51
  context: Partial<{ source: any; event: any; handler: any; target: any; swap: any; values: any; headers: any }>
49
- ): void;
52
+ ): Promise<void>;
50
53
 
51
54
  /**
52
55
  * Finds the closest matching element in the given elements parentage, inclusive of the element
@@ -288,44 +291,99 @@ export function values(elt: Element, requestType?: string): any;
288
291
  export const version: string;
289
292
 
290
293
  export interface HtmxConfig {
291
- /** array of strings: the attributes to settle during the settling phase */
294
+ /**
295
+ * The attributes to settle during the settling phase.
296
+ * @default ["class", "style", "width", "height"]
297
+ */
292
298
  attributesToSettle?: ["class", "style", "width", "height"] | string[];
293
- /** if the focused element should be scrolled into view */
299
+ /**
300
+ * If the focused element should be scrolled into view.
301
+ * @default false
302
+ */
294
303
  defaultFocusScroll?: boolean;
295
- /** the default delay between completing the content swap and settling attributes */
304
+ /**
305
+ * The default delay between completing the content swap and settling attributes.
306
+ * @default 20
307
+ */
296
308
  defaultSettleDelay?: number;
297
- /** the default delay between receiving a response from the server and doing the swap */
309
+ /**
310
+ * The default delay between receiving a response from the server and doing the swap.
311
+ * @default 0
312
+ */
298
313
  defaultSwapDelay?: number;
299
- /** the default swap style to use if **[hx-swap](https://htmx.org/attributes/hx-swap)** is omitted */
314
+ /**
315
+ * The default swap style to use if **[hx-swap](https://htmx.org/attributes/hx-swap)** is omitted.
316
+ * @default "innerHTML"
317
+ */
300
318
  defaultSwapStyle?: "innerHTML" | string;
301
- /** the number of pages to keep in **localStorage** for history support */
319
+ /**
320
+ * The number of pages to keep in **localStorage** for history support.
321
+ * @default 10
322
+ */
302
323
  historyCacheSize?: number;
303
- /** whether or not to use history */
324
+ /**
325
+ * Whether or not to use history.
326
+ * @default true
327
+ */
304
328
  historyEnabled?: boolean;
305
- /** if true, htmx will inject a small amount of CSS into the page to make indicators invisible unless the **htmx-indicator** class is present */
329
+ /**
330
+ * If true, htmx will inject a small amount of CSS into the page to make indicators invisible unless the **htmx-indicator** class is present.
331
+ * @default true
332
+ */
306
333
  includeIndicatorStyles?: boolean;
307
- /** the class to place on indicators when a request is in flight */
334
+ /**
335
+ * The class to place on indicators when a request is in flight.
336
+ * @default "htmx-indicator"
337
+ */
308
338
  indicatorClass?: "htmx-indicator" | string;
309
- /** the class to place on triggering elements when a request is in flight */
339
+ /**
340
+ * The class to place on triggering elements when a request is in flight.
341
+ * @default "htmx-request"
342
+ */
310
343
  requestClass?: "htmx-request" | string;
311
- /** the class to temporarily place on elements that htmx has added to the DOM */
344
+ /**
345
+ * The class to temporarily place on elements that htmx has added to the DOM.
346
+ * @default "htmx-added"
347
+ */
312
348
  addedClass?: "htmx-added" | string;
313
- /** the class to place on target elements when htmx is in the settling phase */
349
+ /**
350
+ * The class to place on target elements when htmx is in the settling phase.
351
+ * @default "htmx-settling"
352
+ */
314
353
  settlingClass?: "htmx-settling" | string;
315
- /** the class to place on target elements when htmx is in the swapping phase */
354
+ /**
355
+ * The class to place on target elements when htmx is in the swapping phase.
356
+ * @default "htmx-swapping"
357
+ */
316
358
  swappingClass?: "htmx-swapping" | string;
317
- /** allows the use of eval-like functionality in htmx, to enable **hx-vars**, trigger conditions & script tag evaluation. Can be set to **false** for CSP compatibility */
359
+ /**
360
+ * Allows the use of eval-like functionality in htmx, to enable **hx-vars**, trigger conditions & script tag evaluation. Can be set to **false** for CSP compatibility.
361
+ * @default true
362
+ */
318
363
  allowEval?: boolean;
319
- /** use HTML template tags for parsing content from the server. This allows you to use Out of Band content when returning things like table rows, but it is *not* IE11 compatible. */
364
+ /**
365
+ * Use HTML template tags for parsing content from the server. This allows you to use Out of Band content when returning things like table rows, but it is *not* IE11 compatible.
366
+ * @default false
367
+ */
320
368
  useTemplateFragments?: boolean;
321
- /** allow cross-site Access-Control requests using credentials such as cookies, authorization headers or TLS client certificates */
369
+ /**
370
+ * Allow cross-site Access-Control requests using credentials such as cookies, authorization headers or TLS client certificates.
371
+ * @default false
372
+ */
322
373
  withCredentials?: boolean;
323
- /** the default implementation of **getWebSocketReconnectDelay** for reconnecting after unexpected connection loss by the event code **Abnormal Closure**, **Service Restart** or **Try Again Later** */
374
+ /**
375
+ * The default implementation of **getWebSocketReconnectDelay** for reconnecting after unexpected connection loss by the event code **Abnormal Closure**, **Service Restart** or **Try Again Later**.
376
+ * @default "full-jitter"
377
+ */
324
378
  wsReconnectDelay?: "full-jitter" | string | ((retryCount: number) => number);
325
379
  // following don't appear in the docs
380
+ /** @default false */
326
381
  refreshOnHistoryMiss?: boolean;
382
+ /** @default 0 */
327
383
  timeout?: number;
384
+ /** @default "[hx-disable], [data-hx-disable]" */
328
385
  disableSelector?: "[hx-disable], [data-hx-disable]" | string;
386
+ /** @default "smooth" */
329
387
  scrollBehavior?: "smooth" | "auto";
330
388
  }
331
389