@hybridly/core 0.4.3 → 0.4.4

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/dist/index.cjs CHANGED
@@ -911,6 +911,9 @@ async function navigate(options) {
911
911
  utils.debug.router(`Target URL is ${context.url}, current window URL is ${window.location.href}.`, { shouldReplaceHistory });
912
912
  setHistoryState({ replace: shouldReplaceHistory });
913
913
  }
914
+ context.adapter.executeOnMounted(() => {
915
+ runHooks("mounted", {}, context);
916
+ });
914
917
  const viewComponent = await context.adapter.resolveComponent(context.view.component);
915
918
  utils.debug.router(`Component [${context.view.component}] resolved to:`, viewComponent);
916
919
  await context.adapter.onViewSwap({
@@ -925,9 +928,6 @@ async function navigate(options) {
925
928
  resetScrollPositions();
926
929
  }
927
930
  await runHooks("navigated", {}, options, context);
928
- context.adapter.executeOnMounted(() => {
929
- runHooks("mounted", {}, context);
930
- });
931
931
  }
932
932
  async function performHybridRequest(targetUrl, options, abortController) {
933
933
  const context = getInternalRouterContext();
@@ -979,6 +979,7 @@ async function initializeRouter() {
979
979
  url: makeUrl(context.url, { hash: window.location.hash }).toString()
980
980
  });
981
981
  await navigate({
982
+ isInitial: true,
982
983
  preserveState: true,
983
984
  replace: sameUrls(context.url, window.location.href)
984
985
  });
package/dist/index.d.cts CHANGED
@@ -165,6 +165,11 @@ interface NavigationOptions {
165
165
  * @internal This is an advanced property meant to be used internally.
166
166
  */
167
167
  isBackForward?: boolean;
168
+ /**
169
+ * Defines whether this navigation is the first to happen after a direct page load.
170
+ * @internal This is an advanced property meant to be used internally.
171
+ */
172
+ isInitial?: boolean;
168
173
  }
169
174
  type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
170
175
  interface HybridRequestOptions extends Omit<NavigationOptions, 'payload'> {
package/dist/index.d.mts CHANGED
@@ -165,6 +165,11 @@ interface NavigationOptions {
165
165
  * @internal This is an advanced property meant to be used internally.
166
166
  */
167
167
  isBackForward?: boolean;
168
+ /**
169
+ * Defines whether this navigation is the first to happen after a direct page load.
170
+ * @internal This is an advanced property meant to be used internally.
171
+ */
172
+ isInitial?: boolean;
168
173
  }
169
174
  type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
170
175
  interface HybridRequestOptions extends Omit<NavigationOptions, 'payload'> {
package/dist/index.d.ts CHANGED
@@ -165,6 +165,11 @@ interface NavigationOptions {
165
165
  * @internal This is an advanced property meant to be used internally.
166
166
  */
167
167
  isBackForward?: boolean;
168
+ /**
169
+ * Defines whether this navigation is the first to happen after a direct page load.
170
+ * @internal This is an advanced property meant to be used internally.
171
+ */
172
+ isInitial?: boolean;
168
173
  }
169
174
  type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
170
175
  interface HybridRequestOptions extends Omit<NavigationOptions, 'payload'> {
package/dist/index.mjs CHANGED
@@ -904,6 +904,9 @@ async function navigate(options) {
904
904
  debug.router(`Target URL is ${context.url}, current window URL is ${window.location.href}.`, { shouldReplaceHistory });
905
905
  setHistoryState({ replace: shouldReplaceHistory });
906
906
  }
907
+ context.adapter.executeOnMounted(() => {
908
+ runHooks("mounted", {}, context);
909
+ });
907
910
  const viewComponent = await context.adapter.resolveComponent(context.view.component);
908
911
  debug.router(`Component [${context.view.component}] resolved to:`, viewComponent);
909
912
  await context.adapter.onViewSwap({
@@ -918,9 +921,6 @@ async function navigate(options) {
918
921
  resetScrollPositions();
919
922
  }
920
923
  await runHooks("navigated", {}, options, context);
921
- context.adapter.executeOnMounted(() => {
922
- runHooks("mounted", {}, context);
923
- });
924
924
  }
925
925
  async function performHybridRequest(targetUrl, options, abortController) {
926
926
  const context = getInternalRouterContext();
@@ -972,6 +972,7 @@ async function initializeRouter() {
972
972
  url: makeUrl(context.url, { hash: window.location.hash }).toString()
973
973
  });
974
974
  await navigate({
975
+ isInitial: true,
975
976
  preserveState: true,
976
977
  replace: sameUrls(context.url, window.location.href)
977
978
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hybridly/core",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Core functionality of Hybridly",
5
5
  "keywords": [
6
6
  "hybridly",
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "qs": "^6.11.2",
40
40
  "superjson": "^1.13.1",
41
- "@hybridly/utils": "0.4.3"
41
+ "@hybridly/utils": "0.4.4"
42
42
  },
43
43
  "devDependencies": {
44
44
  "defu": "^6.1.2"