@symbo.ls/create 2.28.37 → 2.28.41

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/cjs/index.js CHANGED
@@ -80,6 +80,7 @@ const createSync = async (App, options = import_options.default, optionsExternal
80
80
  const key = options.key;
81
81
  await (0, import_ferchOnCreate.fetchSync)(key, redefinedOptions);
82
82
  const domqlApp = await (0, import_createDomql.createDomqlElement)(App, redefinedOptions);
83
+ (0, import_router.popStateRouter)(domqlApp, redefinedOptions);
83
84
  if (redefinedOptions.on && redefinedOptions.on.create)
84
85
  await redefinedOptions.on.create(
85
86
  domqlApp,
@@ -62,10 +62,15 @@ const popStateRouter = (element, context) => {
62
62
  const routerOptions = context.router || DEFAULT_ROUTING_OPTIONS;
63
63
  if (!routerOptions.popState) return;
64
64
  const router = context.utils && context.utils.router ? context.utils.router : import_router.router;
65
- import_utils.window.onpopstate = (e) => {
65
+ import_utils.window.onpopstate = async (e) => {
66
66
  const { pathname, search, hash } = import_utils.window.location;
67
67
  const url = pathname + search + hash;
68
- router(url, element, {}, { pushState: false, scrollToTop: false, level: 0 });
68
+ await router(
69
+ url,
70
+ element,
71
+ {},
72
+ { pushState: false, scrollToTop: false, level: 0 }
73
+ );
69
74
  };
70
75
  };
71
76
  const injectRouterInLinkComponent = (routerOptions) => {
package/dist/esm/index.js CHANGED
@@ -50,6 +50,7 @@ const createSync = async (App, options = DEFAULT_CREATE_OPTIONS, optionsExternal
50
50
  const key = options.key;
51
51
  await fetchSync(key, redefinedOptions);
52
52
  const domqlApp = await createDomqlElement(App, redefinedOptions);
53
+ popStateRouter(domqlApp, redefinedOptions);
53
54
  if (redefinedOptions.on && redefinedOptions.on.create)
54
55
  await redefinedOptions.on.create(
55
56
  domqlApp,
@@ -37,10 +37,15 @@ const popStateRouter = (element, context) => {
37
37
  const routerOptions = context.router || DEFAULT_ROUTING_OPTIONS;
38
38
  if (!routerOptions.popState) return;
39
39
  const router = context.utils && context.utils.router ? context.utils.router : defaultRouter;
40
- window.onpopstate = (e) => {
40
+ window.onpopstate = async (e) => {
41
41
  const { pathname, search, hash } = window.location;
42
42
  const url = pathname + search + hash;
43
- router(url, element, {}, { pushState: false, scrollToTop: false, level: 0 });
43
+ await router(
44
+ url,
45
+ element,
46
+ {},
47
+ { pushState: false, scrollToTop: false, level: 0 }
48
+ );
44
49
  };
45
50
  };
46
51
  const injectRouterInLinkComponent = (routerOptions) => {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.28.37",
3
+ "version": "2.28.41",
4
4
  "license": "MIT",
5
- "gitHead": "65666d0a998f268ff1512bdf23aa0f4c331efcd9",
5
+ "gitHead": "f3572ee2c95501d529813cc40a381254f51492a6",
6
6
  "type": "module",
7
7
  "module": "src/index.js",
8
8
  "main": "src/index.js",
@@ -29,17 +29,17 @@
29
29
  "prepublish": "npm run build; npm run copy:package:cjs"
30
30
  },
31
31
  "dependencies": {
32
- "@domql/emotion": "^2.28.37",
33
- "@domql/event": "^2.28.37",
34
- "@domql/report": "^2.28.37",
35
- "@domql/router": "^2.28.37",
36
- "@symbo.ls/fetch": "^2.28.37",
37
- "@symbo.ls/init": "^2.28.37",
38
- "@symbo.ls/scratch": "^2.28.37",
39
- "@symbo.ls/sync": "^2.28.37",
40
- "@symbo.ls/uikit": "^2.28.37",
41
- "@symbo.ls/utils": "^2.28.37",
42
- "domql": "^2.28.37"
32
+ "@domql/emotion": "^2.28.41",
33
+ "@domql/event": "^2.28.41",
34
+ "@domql/report": "^2.28.41",
35
+ "@domql/router": "^2.28.41",
36
+ "@symbo.ls/fetch": "^2.28.41",
37
+ "@symbo.ls/init": "^2.28.41",
38
+ "@symbo.ls/scratch": "^2.28.41",
39
+ "@symbo.ls/sync": "^2.28.41",
40
+ "@symbo.ls/uikit": "^2.28.41",
41
+ "@symbo.ls/utils": "^2.28.41",
42
+ "domql": "^2.28.41"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@babel/core": "^7.26.0"
package/src/index.js CHANGED
@@ -75,6 +75,8 @@ export const createSync = async (
75
75
  await fetchSync(key, redefinedOptions)
76
76
 
77
77
  const domqlApp = await createDomqlElement(App, redefinedOptions)
78
+ popStateRouter(domqlApp, redefinedOptions)
79
+
78
80
  if (redefinedOptions.on && redefinedOptions.on.create)
79
81
  await redefinedOptions.on.create(
80
82
  domqlApp,
package/src/router.js CHANGED
@@ -16,7 +16,8 @@ export const initRouter = (element, context) => {
16
16
  else merge(context.router || {}, DEFAULT_ROUTING_OPTIONS)
17
17
 
18
18
  const routerOptions = context.router
19
- const router = (context.utils && context.utils.router) ? context.utils.router : defaultRouter
19
+ const router =
20
+ context.utils && context.utils.router ? context.utils.router : defaultRouter
20
21
 
21
22
  const onRouterRenderDefault = (el, s) => {
22
23
  const { pathname, search, hash } = window.location
@@ -46,17 +47,21 @@ export const popStateRouter = (element, context) => {
46
47
  popStateFired = true
47
48
  const routerOptions = context.router || DEFAULT_ROUTING_OPTIONS
48
49
  if (!routerOptions.popState) return
49
- const router = (context.utils && context.utils.router)
50
- ? context.utils.router
51
- : defaultRouter
52
- window.onpopstate = e => {
50
+ const router =
51
+ context.utils && context.utils.router ? context.utils.router : defaultRouter
52
+ window.onpopstate = async e => {
53
53
  const { pathname, search, hash } = window.location
54
54
  const url = pathname + search + hash
55
- router(url, element, {}, { pushState: false, scrollToTop: false, level: 0 })
55
+ await router(
56
+ url,
57
+ element,
58
+ {},
59
+ { pushState: false, scrollToTop: false, level: 0 }
60
+ )
56
61
  }
57
62
  }
58
63
 
59
- export const injectRouterInLinkComponent = (routerOptions) => {
64
+ export const injectRouterInLinkComponent = routerOptions => {
60
65
  if (routerOptions && routerOptions.injectRouterInLinkComponent) {
61
66
  return deepMerge(Link, RouterLink)
62
67
  }