@symbo.ls/sync 3.14.232 → 3.14.595
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/CHANGELOG.md +17 -0
- package/dist/cjs/handlers.js +1 -1
- package/dist/esm/handlers.js +1 -1
- package/handlers.js +16 -4
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @symbo.ls/sync
|
|
2
2
|
|
|
3
|
+
## 3.14.595
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Auto-generated cross-repo patch release.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @symbo.ls/default-config@3.14.595
|
|
10
|
+
- @symbo.ls/scratch@3.14.595
|
|
11
|
+
- @symbo.ls/utils@3.14.595
|
|
12
|
+
- @symbo.ls/router@3.14.595
|
|
13
|
+
|
|
14
|
+
## 3.14.499
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Auto-generated cross-repo patch release.
|
|
19
|
+
|
|
3
20
|
## 3.14.232
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/cjs/handlers.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=Object.defineProperty;var
|
|
1
|
+
var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var u=(t,r)=>{for(var e in r)p(t,e,{get:r[e],enumerable:!0})},y=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of d(r))!g.call(t,s)&&s!==e&&p(t,s,{get:()=>r[s],enumerable:!(n=m(r,s))||n.enumerable});return t};var A=t=>y(p({},"__esModule",{value:!0}),t);var b={};u(b,{onOps:()=>w,onSnapshot:()=>S});module.exports=A(b);var c=require("smbls"),h=require("@symbo.ls/utils"),l=require("./applier.js");const S=(t,r,e)=>{let n=!1;return(s={})=>{let{data:o}=s;const{schema:a}=s;o&&(o=t.call("deepDestringifyFunctions",o,Array.isArray(o)?[]:{}),Object.entries(o).forEach(([i,f])=>{e[i]&&typeof e[i]=="object"?i==="designSystem"?n&&(0,c.init)(f):(0,h.overwriteShallow)(e[i],f):e[i]=f}),n=!0,a&&(e.schema=a))}},w=(t,r,e)=>(n={})=>{let{changes:s}=n;if(!s||!Array.isArray(s)||!s.length)return;s=t.call("deepDestringifyFunctions",s,Array.isArray(s)?[]:{});const o=(0,l.applyOpsToCtx)(e,s);if(o.has("state")&&r.update(e.state),["pages","components","snippets","functions","assets"].some(a=>o.has(a))){const{pathname:a,search:i,hash:f}=e.window.location;t.call("router",a+i+f,t.__ref.root,{},{scrollToTop:!1})}o.has("designSystem")&&(0,c.init)(e.designSystem)};
|
package/dist/esm/handlers.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{init as p}from"smbls";import{overwriteShallow as c}from"@symbo.ls/utils";import{applyOpsToCtx as h}from"./applier.js";const
|
|
1
|
+
import{init as p}from"smbls";import{overwriteShallow as c}from"@symbo.ls/utils";import{applyOpsToCtx as h}from"./applier.js";const g=(n,f,s)=>{let a=!1;return(e={})=>{let{data:t}=e;const{schema:o}=e;t&&(t=n.call("deepDestringifyFunctions",t,Array.isArray(t)?[]:{}),Object.entries(t).forEach(([r,i])=>{s[r]&&typeof s[r]=="object"?r==="designSystem"?a&&p(i):c(s[r],i):s[r]=i}),a=!0,o&&(s.schema=o))}},u=(n,f,s)=>(a={})=>{let{changes:e}=a;if(!e||!Array.isArray(e)||!e.length)return;e=n.call("deepDestringifyFunctions",e,Array.isArray(e)?[]:{});const t=h(s,e);if(t.has("state")&&f.update(s.state),["pages","components","snippets","functions","assets"].some(o=>t.has(o))){const{pathname:o,search:r,hash:i}=s.window.location;n.call("router",o+r+i,n.__ref.root,{},{scrollToTop:!1})}t.has("designSystem")&&p(s.designSystem)};export{u as onOps,g as onSnapshot};
|
package/handlers.js
CHANGED
|
@@ -7,9 +7,19 @@ import { init } from 'smbls'
|
|
|
7
7
|
import { overwriteShallow } from '@symbo.ls/utils'
|
|
8
8
|
import { applyOpsToCtx } from './applier.js'
|
|
9
9
|
|
|
10
|
-
export const onSnapshot =
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export const onSnapshot = (el, s, ctx) => {
|
|
11
|
+
// The FIRST snapshot the server pushes on connect is just the already-rendered
|
|
12
|
+
// project echoed back. Its `designSystem` is the SERVER copy, which does NOT
|
|
13
|
+
// carry the shared-library merge (e.g. the brand design system) that the client
|
|
14
|
+
// applied at boot via prepareSharedLibs/mergeSharedLibraries. Re-running `init`
|
|
15
|
+
// from that brand-less DS reverts the page to the generic default-config theme
|
|
16
|
+
// — the visible, multi-second "design-system flash" (gray→black bg, navbar
|
|
17
|
+
// font-sizes jumping) that appears 5–10s after load when the socket connects.
|
|
18
|
+
// So skip the redundant DS re-init on that boot snapshot; the booted client
|
|
19
|
+
// design system (shared-library-merged) is authoritative. Genuine DS changes
|
|
20
|
+
// pushed in LATER snapshots are still honored.
|
|
21
|
+
let booted = false
|
|
22
|
+
return (payload = {}) => {
|
|
13
23
|
let { data } = payload
|
|
14
24
|
const { schema } = payload
|
|
15
25
|
if (!data) return
|
|
@@ -23,7 +33,7 @@ export const onSnapshot =
|
|
|
23
33
|
Object.entries(data).forEach(([key, val]) => {
|
|
24
34
|
if (ctx[key] && typeof ctx[key] === 'object') {
|
|
25
35
|
if (key === 'designSystem') {
|
|
26
|
-
init(val)
|
|
36
|
+
if (booted) init(val)
|
|
27
37
|
} else {
|
|
28
38
|
overwriteShallow(ctx[key], val)
|
|
29
39
|
}
|
|
@@ -32,8 +42,10 @@ export const onSnapshot =
|
|
|
32
42
|
}
|
|
33
43
|
})
|
|
34
44
|
|
|
45
|
+
booted = true
|
|
35
46
|
if (schema) ctx.schema = schema
|
|
36
47
|
}
|
|
48
|
+
}
|
|
37
49
|
|
|
38
50
|
export const onOps =
|
|
39
51
|
(el, s, ctx) =>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/sync",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.595",
|
|
4
4
|
"main": "./dist/cjs/index.js",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"prepublishOnly": "npm run build"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@symbo.ls/router": "^3.14.
|
|
49
|
-
"@symbo.ls/utils": "^3.14.
|
|
50
|
-
"@symbo.ls/scratch": "^3.14.
|
|
51
|
-
"@symbo.ls/default-config": "^3.14.
|
|
48
|
+
"@symbo.ls/router": "^3.14.595",
|
|
49
|
+
"@symbo.ls/utils": "^3.14.595",
|
|
50
|
+
"@symbo.ls/scratch": "^3.14.595",
|
|
51
|
+
"@symbo.ls/default-config": "^3.14.595",
|
|
52
52
|
"chalk": "^5.4.1",
|
|
53
53
|
"socket.io-client": "^4.8.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@babel/core": "^7.
|
|
56
|
+
"@babel/core": "^7.29.7"
|
|
57
57
|
},
|
|
58
58
|
"browser": "./index.js",
|
|
59
59
|
"sideEffects": false
|