@hyperspan/framework 1.0.28 → 1.0.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperspan/framework",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "Hyperspan Web Framework",
5
5
  "main": "src/server.ts",
6
6
  "types": "src/server.ts",
@@ -194,14 +194,14 @@ function formSubmitToRoute(e: Event, form: HTMLFormElement, opts: TFormSubmitOpt
194
194
  form,
195
195
  action: hsActionTag,
196
196
  url,
197
- hard: preferHard,
197
+ hardNavigate: preferHard,
198
198
  };
199
199
 
200
200
  if (!dispatchActionEvent(eventTarget, HS_ACTION_BEFORE_NAVIGATE, navigateDetail, true)) {
201
201
  return;
202
202
  }
203
203
 
204
- if (navigateDetail.hard) {
204
+ if (navigateDetail.hardNavigate) {
205
205
  window.location.assign(navigateDetail.url);
206
206
  return;
207
207
  }
@@ -229,7 +229,7 @@ function formSubmitToRoute(e: Event, form: HTMLFormElement, opts: TFormSubmitOpt
229
229
  const resolved = new URL(newUrl, window.location.href);
230
230
 
231
231
  // Default: same-origin + same path → soft morph; anything else → hard navigation.
232
- // Listeners can flip detail.hard on hs:action:before-navigate to override.
232
+ // Listeners can flip detail.hardNavigate on hs:action:before-navigate to override.
233
233
  const preferHard =
234
234
  resolved.origin !== window.location.origin ||
235
235
  resolved.pathname !== window.location.pathname;
package/src/types.ts CHANGED
@@ -307,7 +307,7 @@ export namespace Hyperspan {
307
307
  * - `hs:action:before-swap` — before HTML morph (cancelable). Close modals here.
308
308
  * - `hs:action:after-swap` — after HTML morph.
309
309
  * - `hs:action:before-navigate` — before redirect soft/hard navigation (cancelable).
310
- * Set `detail.hard = true` for a full page load, or `false` to fetch+morph in place.
310
+ * Set `detail.hardNavigate = true` for a full page load, or `false` to fetch+morph in place.
311
311
  */
312
312
  export type ActionEventName =
313
313
  | 'hs:action:before-fetch'
@@ -346,7 +346,7 @@ export namespace Hyperspan {
346
346
  * Mutable. Default is soft (false) for same-origin+same-path redirects, hard (true) otherwise.
347
347
  * Set to `true` for `window.location.assign`, or `false` to fetch + morph in place.
348
348
  */
349
- hard: boolean;
349
+ hardNavigate: boolean;
350
350
  };
351
351
 
352
352
  /**