@symbo.ls/sync 2.11.474 → 2.11.476

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
@@ -49,7 +49,7 @@ const onChange = (el, s, ctx) => {
49
49
  const obj = JSON.parse(data);
50
50
  if (!(obj == null ? void 0 : obj.DATA))
51
51
  return;
52
- const { state, designSystem, pages, components, snippets } = obj.DATA;
52
+ const { state, designSystem, pages, components, snippets, functions } = obj.DATA;
53
53
  const { utils } = ctx;
54
54
  if (pages) {
55
55
  (0, import_utils.overwriteShallow)(ctx.pages, pages);
@@ -57,6 +57,9 @@ const onChange = (el, s, ctx) => {
57
57
  if (components) {
58
58
  (0, import_utils.overwriteShallow)(ctx.components, components);
59
59
  }
60
+ if (functions) {
61
+ (0, import_utils.overwriteShallow)(ctx.functions, functions);
62
+ }
60
63
  if (snippets) {
61
64
  (0, import_utils.overwriteShallow)(ctx.snippets, snippets);
62
65
  }
@@ -64,10 +67,10 @@ const onChange = (el, s, ctx) => {
64
67
  const route = state.route;
65
68
  if (route)
66
69
  (utils.router || import_router.router)(route.replace("/state", "") || "/", el, {});
67
- else if (!(snippets && components && pages))
70
+ else if (!(snippets && functions && components && pages))
68
71
  s.update(state);
69
72
  }
70
- if (snippets || components || pages) {
73
+ if (snippets || functions || components || pages) {
71
74
  const { pathname, search, hash } = ctx.window.location;
72
75
  (utils.router || import_router.router)(pathname + search + hash, el, {});
73
76
  }
package/dist/esm/index.js CHANGED
@@ -23,7 +23,7 @@ const onChange = (el, s, ctx) => {
23
23
  const obj = JSON.parse(data);
24
24
  if (!(obj == null ? void 0 : obj.DATA))
25
25
  return;
26
- const { state, designSystem, pages, components, snippets } = obj.DATA;
26
+ const { state, designSystem, pages, components, snippets, functions } = obj.DATA;
27
27
  const { utils } = ctx;
28
28
  if (pages) {
29
29
  overwriteShallow(ctx.pages, pages);
@@ -31,6 +31,9 @@ const onChange = (el, s, ctx) => {
31
31
  if (components) {
32
32
  overwriteShallow(ctx.components, components);
33
33
  }
34
+ if (functions) {
35
+ overwriteShallow(ctx.functions, functions);
36
+ }
34
37
  if (snippets) {
35
38
  overwriteShallow(ctx.snippets, snippets);
36
39
  }
@@ -38,10 +41,10 @@ const onChange = (el, s, ctx) => {
38
41
  const route = state.route;
39
42
  if (route)
40
43
  (utils.router || router)(route.replace("/state", "") || "/", el, {});
41
- else if (!(snippets && components && pages))
44
+ else if (!(snippets && functions && components && pages))
42
45
  s.update(state);
43
46
  }
44
- if (snippets || components || pages) {
47
+ if (snippets || functions || components || pages) {
45
48
  const { pathname, search, hash } = ctx.window.location;
46
49
  (utils.router || router)(pathname + search + hash, el, {});
47
50
  }
package/index.js CHANGED
@@ -29,7 +29,7 @@ const onChange = (el, s, ctx) => {
29
29
  if (event === 'change') {
30
30
  const obj = JSON.parse(data)
31
31
  if (!obj?.DATA) return
32
- const { state, designSystem, pages, components, snippets } = obj.DATA
32
+ const { state, designSystem, pages, components, snippets, functions } = obj.DATA
33
33
  const { utils } = ctx
34
34
 
35
35
  if (pages) {
@@ -41,6 +41,10 @@ const onChange = (el, s, ctx) => {
41
41
  overwriteShallow(ctx.components, components)
42
42
  }
43
43
 
44
+ if (functions) {
45
+ overwriteShallow(ctx.functions, functions)
46
+ }
47
+
44
48
  if (snippets) {
45
49
  overwriteShallow(ctx.snippets, snippets)
46
50
  }
@@ -48,10 +52,10 @@ const onChange = (el, s, ctx) => {
48
52
  if (state) {
49
53
  const route = state.route
50
54
  if (route) (utils.router || router)(route.replace('/state', '') || '/', el, {})
51
- else if (!(snippets && components && pages)) s.update(state)
55
+ else if (!(snippets && functions && components && pages)) s.update(state)
52
56
  }
53
57
 
54
- if (snippets || components || pages) {
58
+ if (snippets || functions || components || pages) {
55
59
  const { pathname, search, hash } = ctx.window.location
56
60
  ;(utils.router || router)(pathname + search + hash, el, {})
57
61
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/sync",
3
- "version": "2.11.474",
3
+ "version": "2.11.476",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
- "gitHead": "dd0429b4bfcc2d43545a301dfe406c5000bd7ae0",
6
+ "gitHead": "7d714966165be175182fb6e10e221fe3866378f5",
7
7
  "files": [
8
8
  "*.js",
9
9
  "dist"
@@ -25,17 +25,17 @@
25
25
  "build:esm": "npx esbuild *.js --target=es2017 --format=esm --outdir=dist/esm --loader:.svg=text",
26
26
  "build:cjs": "npx esbuild *.js --target=node16 --format=cjs --outdir=dist/cjs --loader:.svg=text",
27
27
  "build:iife": "npx esbuild ./index.js --target=es2017 --format=iife --outdir=dist/iife --loader:.svg=text --bundle --minify",
28
- "build": "yarn build:esm; yarn build:cjs",
29
- "prepublish": "rimraf -I dist && yarn build && yarn copy:package:cjs"
28
+ "build": "npm run build:esm; npm run build:cjs",
29
+ "prepublish": "rimraf -I dist && npm run build && npm run copy:package:cjs"
30
30
  },
31
31
  "dependencies": {
32
32
  "@domql/globals": "latest",
33
33
  "@domql/router": "^2.5.0",
34
34
  "@domql/utils": "^2.5.0",
35
- "@symbo.ls/init": "^2.11.474",
36
- "@symbo.ls/scratch": "^2.11.470",
37
- "@symbo.ls/socket": "^2.11.474",
38
- "@symbo.ls/uikit": "^2.11.474"
35
+ "@symbo.ls/init": "^2.11.475",
36
+ "@symbo.ls/scratch": "^2.11.475",
37
+ "@symbo.ls/socket": "^2.11.475",
38
+ "@symbo.ls/uikit": "^2.11.476"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@babel/core": "^7.12.0"