@symbo.ls/create 2.29.50 → 2.29.51

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.
@@ -23,7 +23,6 @@ __export(router_exports, {
23
23
  onpopstateRouter: () => onpopstateRouter
24
24
  });
25
25
  module.exports = __toCommonJS(router_exports);
26
- var import_router = require("@domql/router");
27
26
  var import_utils = require("@domql/utils");
28
27
  var import_uikit = require("@symbo.ls/uikit");
29
28
  const DEFAULT_ROUTING_OPTIONS = {
@@ -36,11 +35,10 @@ const initRouter = (element, context) => {
36
35
  else if (context.router === true) context.router = DEFAULT_ROUTING_OPTIONS;
37
36
  else (0, import_utils.merge)(context.router || {}, DEFAULT_ROUTING_OPTIONS);
38
37
  const routerOptions = context.router;
39
- const router = context.utils && context.utils.router ? context.utils.router : import_router.router;
40
- const onRouterRenderDefault = (el, s) => {
38
+ const onRouterRenderDefault = (el2, s) => {
41
39
  const { pathname, search, hash } = import_utils.window.location;
42
40
  const url = pathname + search + hash;
43
- if (el.routes) router(url, el, {}, { initialRender: true });
41
+ if (el2.routes) element.call("router", url, el2, {}, { initialRender: true });
44
42
  };
45
43
  const hasRenderRouter = element.on && !(0, import_utils.isUndefined)(element.on.renderRouter);
46
44
  if (routerOptions && routerOptions.initRouter && !hasRenderRouter) {
@@ -61,11 +59,11 @@ const onpopstateRouter = (element, context) => {
61
59
  popStateFired = true;
62
60
  const routerOptions = context.router || DEFAULT_ROUTING_OPTIONS;
63
61
  if (!routerOptions.popState) return;
64
- const router = context.utils && context.utils.router ? context.utils.router : import_router.router;
65
62
  import_utils.window.onpopstate = async (event) => {
66
63
  const { pathname, search, hash } = import_utils.window.location;
67
64
  const url = pathname + search + hash;
68
- await router(
65
+ await el.call(
66
+ "router",
69
67
  url,
70
68
  element,
71
69
  {},
@@ -1,4 +1,3 @@
1
- import { router as defaultRouter } from "@domql/router";
2
1
  import { window, deepMerge, merge, isUndefined } from "@domql/utils";
3
2
  import { Link, RouterLink } from "@symbo.ls/uikit";
4
3
  const DEFAULT_ROUTING_OPTIONS = {
@@ -11,11 +10,10 @@ const initRouter = (element, context) => {
11
10
  else if (context.router === true) context.router = DEFAULT_ROUTING_OPTIONS;
12
11
  else merge(context.router || {}, DEFAULT_ROUTING_OPTIONS);
13
12
  const routerOptions = context.router;
14
- const router = context.utils && context.utils.router ? context.utils.router : defaultRouter;
15
- const onRouterRenderDefault = (el, s) => {
13
+ const onRouterRenderDefault = (el2, s) => {
16
14
  const { pathname, search, hash } = window.location;
17
15
  const url = pathname + search + hash;
18
- if (el.routes) router(url, el, {}, { initialRender: true });
16
+ if (el2.routes) element.call("router", url, el2, {}, { initialRender: true });
19
17
  };
20
18
  const hasRenderRouter = element.on && !isUndefined(element.on.renderRouter);
21
19
  if (routerOptions && routerOptions.initRouter && !hasRenderRouter) {
@@ -36,11 +34,11 @@ const onpopstateRouter = (element, context) => {
36
34
  popStateFired = true;
37
35
  const routerOptions = context.router || DEFAULT_ROUTING_OPTIONS;
38
36
  if (!routerOptions.popState) return;
39
- const router = context.utils && context.utils.router ? context.utils.router : defaultRouter;
40
37
  window.onpopstate = async (event) => {
41
38
  const { pathname, search, hash } = window.location;
42
39
  const url = pathname + search + hash;
43
- await router(
40
+ await el.call(
41
+ "router",
44
42
  url,
45
43
  element,
46
44
  {},
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.29.50",
3
+ "version": "2.29.51",
4
4
  "license": "MIT",
5
- "gitHead": "0ac401042c1518bd435e8c61b2407d3f00b86264",
5
+ "gitHead": "afbffe9a2317d2d0929447ab49251d83296bf546",
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.29.50",
33
- "@domql/event": "^2.29.50",
34
- "@domql/report": "^2.29.50",
35
- "@domql/router": "^2.29.50",
36
- "@symbo.ls/fetch": "^2.29.50",
37
- "@symbo.ls/init": "^2.29.50",
38
- "@symbo.ls/scratch": "^2.29.50",
39
- "@symbo.ls/sync": "^2.29.50",
40
- "@symbo.ls/uikit": "^2.29.50",
41
- "@symbo.ls/utils": "^2.29.50",
42
- "domql": "^2.29.50"
32
+ "@domql/emotion": "^2.29.51",
33
+ "@domql/event": "^2.29.51",
34
+ "@domql/report": "^2.29.51",
35
+ "@domql/router": "^2.29.51",
36
+ "@symbo.ls/fetch": "^2.29.51",
37
+ "@symbo.ls/init": "^2.29.51",
38
+ "@symbo.ls/scratch": "^2.29.51",
39
+ "@symbo.ls/sync": "^2.29.51",
40
+ "@symbo.ls/uikit": "^2.29.51",
41
+ "@symbo.ls/utils": "^2.29.51",
42
+ "domql": "^2.29.51"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@babel/core": "^7.27.1"
package/src/router.js CHANGED
@@ -1,6 +1,5 @@
1
1
  'use strict'
2
2
 
3
- import { router as defaultRouter } from '@domql/router'
4
3
  import { window, deepMerge, merge, isUndefined } from '@domql/utils'
5
4
  import { Link, RouterLink } from '@symbo.ls/uikit'
6
5
 
@@ -16,13 +15,11 @@ export const initRouter = (element, context) => {
16
15
  else merge(context.router || {}, DEFAULT_ROUTING_OPTIONS)
17
16
 
18
17
  const routerOptions = context.router
19
- const router =
20
- context.utils && context.utils.router ? context.utils.router : defaultRouter
21
18
 
22
19
  const onRouterRenderDefault = (el, s) => {
23
20
  const { pathname, search, hash } = window.location
24
21
  const url = pathname + search + hash
25
- if (el.routes) router(url, el, {}, { initialRender: true })
22
+ if (el.routes) element.call('router', url, el, {}, { initialRender: true })
26
23
  }
27
24
 
28
25
  const hasRenderRouter = element.on && !isUndefined(element.on.renderRouter)
@@ -47,12 +44,11 @@ export const onpopstateRouter = (element, context) => {
47
44
  popStateFired = true
48
45
  const routerOptions = context.router || DEFAULT_ROUTING_OPTIONS
49
46
  if (!routerOptions.popState) return
50
- const router =
51
- context.utils && context.utils.router ? context.utils.router : defaultRouter
52
- window.onpopstate = async event => {
47
+ window.onpopstate = async (event) => {
53
48
  const { pathname, search, hash } = window.location
54
49
  const url = pathname + search + hash
55
- await router(
50
+ await el.call(
51
+ 'router',
56
52
  url,
57
53
  element,
58
54
  {},
@@ -61,7 +57,7 @@ export const onpopstateRouter = (element, context) => {
61
57
  }
62
58
  }
63
59
 
64
- export const injectRouterInLinkComponent = routerOptions => {
60
+ export const injectRouterInLinkComponent = (routerOptions) => {
65
61
  if (routerOptions && routerOptions.injectRouterInLinkComponent) {
66
62
  return deepMerge(Link, RouterLink)
67
63
  }