@symbo.ls/mermaid 3.14.711 → 3.14.713

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/README.md CHANGED
@@ -53,7 +53,7 @@ Pure runtime-agnostic renderer. Returns `{ html, status, contentType }`.
53
53
  | `analyzedScript` | string | analytics tracking `<script>` to inject |
54
54
  | `indexHtml` | string | override the index.html template |
55
55
  | `ssrCache` | object | pre-computed SSR cache (skips runtime brender) |
56
- | `ProjectDataService` | object | passed to `getBundleScript` for shared-library merging |
56
+ | `ProjectDataService` | object | ignored — shared libraries ship unmerged, the browser merges them |
57
57
 
58
58
  ### `loadJsonData(jsonPath)`
59
59
 
@@ -1,5 +1,5 @@
1
- import o from"./utils/logger.js";import*as p from"smbls/iife-string";import{isWrappedLibrary as L}from"@symbo.ls/utils";const f=p.default,g=p.version||null;o.debug(`[BUNDLE] smbls IIFE loaded from smbls/iife-string (${f.length} bytes, v${g||"unknown"})`);const b=s=>s.replace(/</g,"\\u003c");function R(){return f}function N(){return g}function B(s,e,t,{ProjectDataService:a}={}){if(o.debug(`[BUNDLE] getBundleScript started for ${s}`),!e)return o.warn("[BUNDLE] No data provided, returning empty"),"";try{if(e.merged)Object.assign(e,e.merged),o.debug(`[BUNDLE] Applied precomputed merged data for project ${e.id}`);else if(a&&Array.isArray(e.sharedLibraries)&&e.sharedLibraries.length>0){const r=a.mergeSharedLibraries(e,e.sharedLibraries,e.projectType);Object.assign(e,r),o.debug(`[BUNDLE] Merged ${e.sharedLibraries.length} shared libraries`)}}catch(r){o.error(`[BUNDLE] Failed to ensure merged data: ${r.message}`)}try{if(e.dependencies&&Array.isArray(e.sharedLibraries))for(const r of e.sharedLibraries){const u=L(r)?r.library:r,m=u&&u.key;if(m)for(const D of["@symbo-ls","@symbo.ls"]){const i=`${D}/${m}`;e.dependencies[i]&&(delete e.dependencies[i],o.debug(`[BUNDLE] Dropped CDN dependency ${i} \u2014 already merged as shared library`))}}}catch(r){o.error(`[BUNDLE] Failed to strip shared-library dependencies: ${r.message}`)}const y=b(JSON.stringify(e)),S=t?.headers&&typeof t.headers.get=="function"&&t.headers.get("host")||t?.headers?.host||t?.host||t?.url&&(()=>{try{return new URL(t.url).host}catch{return""}})()||"",n=String(S).toLowerCase().split(":")[0],c=(()=>{if(t?.query)return t.query;try{return Object.fromEntries(new URL(t?.url||"","http://x").searchParams)}catch{return{}}})(),v=c.release||!1,w=c.version,l=n.endsWith(".symbo.ls")||n.endsWith(".preview.symbols.app")||n==="localhost"||n.endsWith(".localhost"),d=!!v||!!w||!l,x=e&&(e._id||e.projectId||e.id)||null,k=l?b(JSON.stringify({...e.settings,liveSync:!d,inspect:!0,verbose:!d,projectId:x})):"null",h=`
2
- var context = Smbls.deepDestringifyFunctions(${y}, {}, { lazy: 'context', window: window });
1
+ import r from"./utils/logger.js";import*as m from"smbls/iife-string";import{isWrappedLibrary as D}from"@symbo.ls/utils";const p=m.default,f=m.version||null;r.debug(`[BUNDLE] smbls IIFE loaded from smbls/iife-string (${p.length} bytes, v${f||"unknown"})`);const g=s=>s.replace(/</g,"\\u003c");function E(){return p}function N(){return f}function B(s,e,t,T={}){if(r.debug(`[BUNDLE] getBundleScript started for ${s}`),!e)return r.warn("[BUNDLE] No data provided, returning empty"),"";try{if(e.dependencies&&Array.isArray(e.sharedLibraries))for(const o of e.sharedLibraries){const h=D(o)?o.library:o,u=h&&h.key;if(u)for(const k of["@symbo-ls","@symbo.ls"]){const i=`${k}/${u}`;e.dependencies[i]&&(delete e.dependencies[i],r.debug(`[BUNDLE] Dropped CDN dependency ${i} \u2014 shipped as a shared library`))}}}catch(o){r.error(`[BUNDLE] Failed to strip shared-library dependencies: ${o.message}`)}const b=g(JSON.stringify(e)),y=t?.headers&&typeof t.headers.get=="function"&&t.headers.get("host")||t?.headers?.host||t?.host||t?.url&&(()=>{try{return new URL(t.url).host}catch{return""}})()||"",n=String(y).toLowerCase().split(":")[0],a=(()=>{if(t?.query)return t.query;try{return Object.fromEntries(new URL(t?.url||"","http://x").searchParams)}catch{return{}}})(),v=a.release||!1,S=a.version,c=n.endsWith(".symbo.ls")||n.endsWith(".preview.symbols.app")||n==="localhost"||n.endsWith(".localhost"),l=!!v||!!S||!c,w=e&&(e._id||e.projectId||e.id)||null,x=c?g(JSON.stringify({...e.settings,liveSync:!l,inspect:!0,verbose:!l,projectId:w})):"null",d=`
2
+ var context = Smbls.deepDestringifyFunctions(${b}, {}, { lazy: 'context', window: window });
3
3
  // Must name the SAME provider render.js used for the page's importmap
4
4
  // (default 'symbols' \u2192 pkg.symbo.ls). This drives prepareDependencies'
5
5
  // runtime loads; if the two disagree, a package arrives twice from two
@@ -20,7 +20,7 @@ import o from"./utils/logger.js";import*as p from"smbls/iife-string";import{isWr
20
20
 
21
21
  var app = context.app || {};
22
22
  delete context.app;
23
- var settings = ${k};
23
+ var settings = ${x};
24
24
  if (settings) context.editor = settings;
25
25
 
26
26
  // Theme initialization: set data-theme before app renders to avoid FOUC.
@@ -98,4 +98,4 @@ import o from"./utils/logger.js";import*as p from"smbls/iife-string";import{isWr
98
98
  }
99
99
 
100
100
  Smbls.create(app, context);
101
- `;return o.debug(`[BUNDLE] Script generated (${h.length} bytes)`),h}export{B as getBundleScript,R as getSmblsIife,N as getSmblsRuntimeVersion};
101
+ `;return r.debug(`[BUNDLE] Script generated (${d.length} bytes)`),d}export{B as getBundleScript,E as getSmblsIife,N as getSmblsRuntimeVersion};
@@ -1,4 +1,4 @@
1
- import E from"./utils/logger.js";import ut from"./utils/vartranformer.js";import{getBundleScript as yt,getSmblsIife as bt,getSmblsRuntimeVersion as St}from"./bundle.js";import{deepDestringifyFunctions as $t}from"./utils/deepDestringify.js";import{transpile as z}from"./utils/funcql-transpile.js";import{normalizeRoute as Tt,resolvePageRoute as Et}from"./route.js";import{generateMetaTags as It,getPageMetadata as Ot,getImportMapScript as Rt}from"@symbo.ls/utils";import{getTapStyles as Nt,getTapRuntimeSnippet as _t}from"@symbo.ls/tap";import{resolveDeployIdentity as vt,deployIdentityScript as Dt}from"./deployIdentity.js";const xt=(t,r)=>{const e=parseInt(t,16);if(Number.isNaN(e))return t;const s=m=>m>255?255:m<0?0:m,n=s((e>>16)+r),i=s((e>>8&255)+r);return((s((e&255)+r)|i<<8|n<<16)+16777216).toString(16).slice(1)},U=(t,r)=>{if(typeof t!="string")return;if(r&&typeof r[t]=="string")return r[t];if(/^(#|rgb|hsl|var\(|[a-z]+$)/i.test(t))return t;const e=t.match(/^([a-z][a-z0-9]*)(?:\.(\d+))?([+-]\d+)?$/i);if(e&&(e[2]||e[3])){const s=r&&r[e[1]],n=typeof s=="string"&&s.match(/^#?([0-9a-f]{6})$/i);if(n){let i=n[1];if(e[3]&&(i=xt(i,parseInt(e[3],10))),e[2]){const f=parseFloat("0."+e[2]),m=parseInt(i,16);return`rgba(${m>>16&255},${m>>8&255},${m&255},${f})`}return"#"+i}}},wt=process.env.BRENDER!=="false";let M=null,K=null,V=null;if(wt)try{const t=await import("@symbo.ls/brender");M=t.renderRoute,K=t.generateSitemap,V=t.prefetchPageData}catch(t){E.debug(`[MERMAID] Brender not available: ${t.message}`)}const Pt=`<!doctype html>
1
+ import E from"./utils/logger.js";import ut from"./utils/vartranformer.js";import{getBundleScript as yt,getSmblsIife as bt,getSmblsRuntimeVersion as St}from"./bundle.js";import{deepDestringifyFunctions as $t,isStringTag as z,markRevived as Tt}from"./utils/deepDestringify.js";import{transpile as U}from"./utils/funcql-transpile.js";import{normalizeRoute as Et,resolvePageRoute as It}from"./route.js";import{generateMetaTags as Ot,getPageMetadata as vt,getImportMapScript as Rt}from"@symbo.ls/utils";import{getTapStyles as Nt,getTapRuntimeSnippet as _t}from"@symbo.ls/tap";import{resolveDeployIdentity as xt,deployIdentityScript as Dt}from"./deployIdentity.js";const wt=(t,o)=>{const e=parseInt(t,16);if(Number.isNaN(e))return t;const s=m=>m>255?255:m<0?0:m,n=s((e>>16)+o),i=s((e>>8&255)+o);return((s((e&255)+o)|i<<8|n<<16)+16777216).toString(16).slice(1)},K=(t,o)=>{if(typeof t!="string")return;if(o&&typeof o[t]=="string")return o[t];if(/^(#|rgb|hsl|var\(|[a-z]+$)/i.test(t))return t;const e=t.match(/^([a-z][a-z0-9]*)(?:\.(\d+))?([+-]\d+)?$/i);if(e&&(e[2]||e[3])){const s=o&&o[e[1]],n=typeof s=="string"&&s.match(/^#?([0-9a-f]{6})$/i);if(n){let i=n[1];if(e[3]&&(i=wt(i,parseInt(e[3],10))),e[2]){const f=parseFloat("0."+e[2]),m=parseInt(i,16);return`rgba(${m>>16&255},${m>>8&255},${m&255},${f})`}return"#"+i}}},Pt=process.env.BRENDER!=="false";let M=null,V=null,W=null;if(Pt)try{const t=await import("@symbo.ls/brender");M=t.renderRoute,V=t.generateSitemap,W=t.prefetchPageData}catch(t){E.debug(`[MERMAID] Brender not available: ${t.message}`)}const Lt=`<!doctype html>
2
2
  <html'\${{{ ROOT_ATTRS }}}'>
3
3
  <head>
4
4
  <meta charset="UTF-8" />
@@ -23,20 +23,20 @@ import E from"./utils/logger.js";import ut from"./utils/vartranformer.js";import
23
23
  <\/script>
24
24
  '\${{{ EDITOR }}}'
25
25
  </body>
26
- </html>`;function j(t,r=Array.isArray(t)?[]:{}){for(const e in t){if(!Object.prototype.hasOwnProperty.call(t,e))continue;const s=t[e];if(typeof s=="string"){const n=s.trim();if(n.startsWith("(")&&n.includes("=>")||n.startsWith("function")||n.startsWith("async ")){const f=z(s);r[e]=f?f.schema:null}else r[e]=s}else Array.isArray(s)?r[e]=s.map(n=>{if(typeof n=="string"){const i=n.trim();if(i.startsWith("(")&&i.includes("=>")||i.startsWith("function")||i.startsWith("async ")){const m=z(n);return m?m.schema:null}}return n&&typeof n=="object"?j(n):n}):s&&typeof s=="object"&&!Array.isArray(s)?r[e]=j(s):r[e]=s}return r}async function Kt(t,r={}){const{appkey:e,pathname:s="/",channel:n="production",userEnv:i=n,isProd:f=!1,req:m,query:Lt,userId:A,smblsIife:W,editorBundle:k,analyzedScript:q="",indexHtml:G,ssrCache:a,ProjectDataService:Q,deployChannel:X,apiBaseUrl:Z}=r;if(!t)return{html:"",status:404,contentType:"text/html"};if(typeof e=="string"&&e.includes("/")){const[c,g]=e.split("/");t.key||(t.key=g),t.owner||(t.owner=c)}const _=Tt(s),$=Et(t.pages,s),v=i==="production"||i==="staging";let I="",D="",o=null,O=null,x="";if(a&&v){I=a.html||"";const c=[];a.fontLinks&&c.push(a.fontLinks);const g=[a.globalCSS||"",a.resetCss||""].filter(Boolean).join(`
27
- `);g&&c.push(`<style>${g}</style>`),a.css&&c.push(`<style data-emotion="smbls">${a.css}</style>`),D=c.join(`
28
- `);const u=[];if(a.ssrTranslations){const p=(t.config||t.settings||{}).polyglot||t.polyglot,l=p?.storagePrefix||"",d=p?.storageLangKey||"",h=[];for(const y in a.ssrTranslations){const b=a.ssrTranslations[y];b&&typeof b=="object"&&h.push(`localStorage.setItem(${JSON.stringify(l+y)},${JSON.stringify(JSON.stringify(b))})`)}if(d){const y=p?.defaultLang||"en";h.push(`if(!localStorage.getItem(${JSON.stringify(d)}))localStorage.setItem(${JSON.stringify(d)},${JSON.stringify(y)})`)}h.length&&u.push(`<script>try{${h.join(";")}}catch(e){}<\/script>`)}u.push("<script>window.__BRENDER__=true<\/script>"),x=u.join(`
29
- `),o={metadata:a.metadata,prefetchedState:a.prefetchedState,activeLang:a.activeLang}}else if(M&&v)try{const c=$?$.route:_;E.debug(`[MERMAID] Running brender for route: ${c}`);let g=!1;try{(0,eval)("1"),g=!0}catch{}if(O=g?$t(t):j(t),o=await M(O,{route:c,pathname:_}),o){I=o.html||"";const u=[];o.fontLinks&&u.push(o.fontLinks);const S=o.globalCSS||{},p=[S.rootRule||"",o.resetCss||"",S.keyframeRules||""].filter(Boolean).join(`
30
- `);p&&u.push(`<style>${p}</style>`),o.css&&u.push(`<style data-emotion="smbls">${o.css}</style>`),D=u.join(`
31
- `);const l=[];if(o.ssrTranslations){const h=(O?.config||{}).polyglot||O?.polyglot,y=h?.storagePrefix||"",b=h?.storageLangKey||"",R=[];for(const N in o.ssrTranslations){const B=o.ssrTranslations[N];B&&typeof B=="object"&&R.push(`localStorage.setItem(${JSON.stringify(y+N)},${JSON.stringify(JSON.stringify(B))})`)}if(b){const N=h?.defaultLang||"en";R.push(`if(!localStorage.getItem(${JSON.stringify(b)}))localStorage.setItem(${JSON.stringify(b)},${JSON.stringify(N)})`)}R.length&&l.push(`<script>try{${R.join(";")}}catch(e){}<\/script>`)}g&&o.brRegistry&&Object.keys(o.brRegistry).length&&l.push(`<script>window.__BR_REGISTRY__=${JSON.stringify(o.brRegistry)}<\/script>`),l.push("<script>window.__BRENDER__=true<\/script>"),x=l.join(`
32
- `),E.debug(`[MERMAID] Brender completed: body=${I.length}b, registry=${Object.keys(o.brRegistry||{}).length}`)}}catch(c){E.warn(`[MERMAID] Brender failed, falling back to client render: ${c.message}`)}const tt=yt(e,t,m,{ProjectDataService:Q}),F=St(),et=Rt(t,t?.settings?.cdnProvider||"symbols",{pin:F?{smbls:F}:void 0}),st=t?.files&&t.files["index.html"],C=G||st?.code||Pt,nt=vt({deployChannel:X,channel:n,userEnv:i,apiBaseUrl:Z}),J=Dt(nt),ot=/\$\{\{\{\s*DEPLOY_IDENTITY\s*\}\}\}/.test(C),rt=A?`<script>window.__SYMBOLS_AUTH__=${JSON.stringify({userId:A})}<\/script>`:"",w=o?.prefetchedState,it=(t.config||t.settings||{}).polyglot||t.polyglot,ct=o?.activeLang||it?.defaultLang||"en",lt=w&&Object.keys(w).length?{state:w,lang:ct,actualPathname:s}:{actualPathname:s},at=o?.metadata&&Object.keys(o.metadata).length?o.metadata:Ot(t,$?$.route:_,lt,{isProduction:f,channel:n}),pt=It(at,f),P=W||bt();if(!P)return E.error("[MERMAID] smbls IIFE bundle not available"),{html:"Internal Server Error: smbls bundle not found",status:500,contentType:"text/plain"};const ft=k&&!f?`<script defer type="text/javascript">${k}<\/script>`:"",mt=f?`<!-- built with symbols.app -->
33
- `:`<!-- symbols | ${e} | ${i} | ${v?"ssr":"csr"} | noindex -->
26
+ </html>`;function k(t,o=Array.isArray(t)?[]:{}){for(const e in t){if(!Object.prototype.hasOwnProperty.call(t,e))continue;const s=t[e];if(typeof s=="string"){const n=s.trim();if(n.startsWith("(")&&n.includes("=>")||n.startsWith("function")||n.startsWith("async ")){const f=U(s);o[e]=f?f.schema:null}else o[e]=s}else z(s)?o[e]=s.value:Array.isArray(s)?o[e]=s.map(n=>{if(typeof n=="string"){const i=n.trim();if(i.startsWith("(")&&i.includes("=>")||i.startsWith("function")||i.startsWith("async ")){const m=U(n);return m?m.schema:null}}return z(n)?n.value:n&&typeof n=="object"?k(n):n}):s&&typeof s=="object"&&!Array.isArray(s)?o[e]=k(s):o[e]=s}return Tt(o)}async function Vt(t,o={}){const{appkey:e,pathname:s="/",channel:n="production",userEnv:i=n,isProd:f=!1,req:m,query:Bt,userId:A,smblsIife:q,editorBundle:j,analyzedScript:G="",indexHtml:Q,ssrCache:a,deployChannel:X,apiBaseUrl:Z}=o;if(!t)return{html:"",status:404,contentType:"text/html"};if(typeof e=="string"&&e.includes("/")){const[c,g]=e.split("/");t.key||(t.key=g),t.owner||(t.owner=c)}const N=Et(s),$=It(t.pages,s),_=i==="production"||i==="staging";let I="",x="",r=null,O=null,D="";if(a&&_){I=a.html||"";const c=[];a.fontLinks&&c.push(a.fontLinks);const g=[a.globalCSS||"",a.resetCss||""].filter(Boolean).join(`
27
+ `);g&&c.push(`<style>${g}</style>`),a.css&&c.push(`<style data-emotion="smbls">${a.css}</style>`),x=c.join(`
28
+ `);const u=[];if(a.ssrTranslations){const p=(t.config||t.settings||{}).polyglot||t.polyglot,l=p?.storagePrefix||"",d=p?.storageLangKey||"",h=[];for(const y in a.ssrTranslations){const b=a.ssrTranslations[y];b&&typeof b=="object"&&h.push(`localStorage.setItem(${JSON.stringify(l+y)},${JSON.stringify(JSON.stringify(b))})`)}if(d){const y=p?.defaultLang||"en";h.push(`if(!localStorage.getItem(${JSON.stringify(d)}))localStorage.setItem(${JSON.stringify(d)},${JSON.stringify(y)})`)}h.length&&u.push(`<script>try{${h.join(";")}}catch(e){}<\/script>`)}u.push("<script>window.__BRENDER__=true<\/script>"),D=u.join(`
29
+ `),r={metadata:a.metadata,prefetchedState:a.prefetchedState,activeLang:a.activeLang}}else if(M&&_)try{const c=$?$.route:N;E.debug(`[MERMAID] Running brender for route: ${c}`);let g=!1;try{(0,eval)("1"),g=!0}catch{}if(O=g?$t(t):k(t),r=await M(O,{route:c,pathname:N}),r){I=r.html||"";const u=[];r.fontLinks&&u.push(r.fontLinks);const S=r.globalCSS||{},p=[S.rootRule||"",r.resetCss||"",S.keyframeRules||""].filter(Boolean).join(`
30
+ `);p&&u.push(`<style>${p}</style>`),r.css&&u.push(`<style data-emotion="smbls">${r.css}</style>`),x=u.join(`
31
+ `);const l=[];if(r.ssrTranslations){const h=(O?.config||{}).polyglot||O?.polyglot,y=h?.storagePrefix||"",b=h?.storageLangKey||"",v=[];for(const R in r.ssrTranslations){const B=r.ssrTranslations[R];B&&typeof B=="object"&&v.push(`localStorage.setItem(${JSON.stringify(y+R)},${JSON.stringify(JSON.stringify(B))})`)}if(b){const R=h?.defaultLang||"en";v.push(`if(!localStorage.getItem(${JSON.stringify(b)}))localStorage.setItem(${JSON.stringify(b)},${JSON.stringify(R)})`)}v.length&&l.push(`<script>try{${v.join(";")}}catch(e){}<\/script>`)}g&&r.brRegistry&&Object.keys(r.brRegistry).length&&l.push(`<script>window.__BR_REGISTRY__=${JSON.stringify(r.brRegistry)}<\/script>`),l.push("<script>window.__BRENDER__=true<\/script>"),D=l.join(`
32
+ `),E.debug(`[MERMAID] Brender completed: body=${I.length}b, registry=${Object.keys(r.brRegistry||{}).length}`)}}catch(c){E.warn(`[MERMAID] Brender failed, falling back to client render: ${c.message}`)}const tt=yt(e,t,m),F=St(),et=Rt(t,t?.settings?.cdnProvider||"symbols",{pin:F?{smbls:F}:void 0}),st=t?.files&&t.files["index.html"],C=Q||st?.code||Lt,nt=xt({deployChannel:X,channel:n,userEnv:i,apiBaseUrl:Z}),J=Dt(nt),ot=/\$\{\{\{\s*DEPLOY_IDENTITY\s*\}\}\}/.test(C),rt=A?`<script>window.__SYMBOLS_AUTH__=${JSON.stringify({userId:A})}<\/script>`:"",w=r?.prefetchedState,it=(t.config||t.settings||{}).polyglot||t.polyglot,ct=r?.activeLang||it?.defaultLang||"en",lt=w&&Object.keys(w).length?{state:w,lang:ct,actualPathname:s}:{actualPathname:s},at=r?.metadata&&Object.keys(r.metadata).length?r.metadata:vt(t,$?$.route:N,lt,{isProduction:f,channel:n}),pt=Ot(at,f),P=q||bt();if(!P)return E.error("[MERMAID] smbls IIFE bundle not available"),{html:"Internal Server Error: smbls bundle not found",status:500,contentType:"text/plain"};const ft=j&&!f?`<script defer type="text/javascript">${j}<\/script>`:"",mt=f?`<!-- built with symbols.app -->
33
+ `:`<!-- symbols | ${e} | ${i} | ${_?"ssr":"csr"} | noindex -->
34
34
  `,L=t.useDocumentTheme!==!1,T=t.globalTheme&&t.globalTheme!=="auto"?String(t.globalTheme):null,H=t.themeStorageKey?String(t.themeStorageKey):"",dt=L&&T?' data-theme="'+T+'"':"",gt=L?"<script>(function(){try{var t=null;try{t=new URLSearchParams(location.search).get('globalTheme')}catch(e){}"+(H?"if(!t){try{t=localStorage.getItem("+JSON.stringify(H)+")}catch(e){}}":"")+"if(!t||t==='auto'){"+(T?"t="+JSON.stringify(T)+";":"try{t=window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'}catch(e){}")+`}if(t&&t!=='auto')document.documentElement.setAttribute('data-theme',t);}catch(e){}})();<\/script>
35
- <meta name="color-scheme" content="light dark">`:"";let Y="";if(L){const c=t.designSystem||t.config&&t.config.designSystem||{},g=c.color||{},u=c.theme&&c.theme.document||{},S=l=>{const d=u["@"+l];if(!d)return null;const h=U(d.background,g),y=U(d.color,g);return[h&&`background:${h}`,y&&`color:${y}`].filter(Boolean).join(";")||null},p=[];if(T){const l=S(T);l&&p.push(`html{${l}}`)}else{const l=S("dark"),d=S("light");l&&(p.push(`@media (prefers-color-scheme:dark){:root:not([data-theme]) html{${l}}}`),p.push(`[data-theme="dark"] html{${l}}`)),d&&(p.push(`@media (prefers-color-scheme:light){:root:not([data-theme]) html{${d}}}`),p.push(`[data-theme="light"] html{${d}}`))}p.length&&(Y=`<style>${p.join("")}</style>`)}const ht=typeof t.__criticalCss=="string"&&t.__criticalCss.trim()?`<style>${t.__criticalCss}</style>`:"";return{html:ut(mt+C,{ROOT_ATTRS:dt,HEAD_BOOT:gt+(ht||Y),META:pt+`
36
- `+D+`
35
+ <meta name="color-scheme" content="light dark">`:"";let Y="";if(L){const c=t.designSystem||t.config&&t.config.designSystem||{},g=c.color||{},u=c.theme&&c.theme.document||{},S=l=>{const d=u["@"+l];if(!d)return null;const h=K(d.background,g),y=K(d.color,g);return[h&&`background:${h}`,y&&`color:${y}`].filter(Boolean).join(";")||null},p=[];if(T){const l=S(T);l&&p.push(`html{${l}}`)}else{const l=S("dark"),d=S("light");l&&(p.push(`@media (prefers-color-scheme:dark){:root:not([data-theme]) html{${l}}}`),p.push(`[data-theme="dark"] html{${l}}`)),d&&(p.push(`@media (prefers-color-scheme:light){:root:not([data-theme]) html{${d}}}`),p.push(`[data-theme="light"] html{${d}}`))}p.length&&(Y=`<style>${p.join("")}</style>`)}const ht=typeof t.__criticalCss=="string"&&t.__criticalCss.trim()?`<style>${t.__criticalCss}</style>`:"";return{html:ut(mt+C,{ROOT_ATTRS:dt,HEAD_BOOT:gt+(ht||Y),META:pt+`
37
36
  `+x+`
37
+ `+D+`
38
38
  `+rt,BUNDLE:tt,BODY:I,SMBLS_IIFE:ot?P:J+`
39
- `+P,DEPLOY_IDENTITY:J,NODE_ENV:"'production'",IMPORTMAP:et,EDITOR:ft+q},{allowScript:!0}),status:$&&$.notFound?404:200,contentType:"text/html"}}function Vt(t,r="production",e=null){const s=r!=="production"?` (${r})`:"",n=e==="not_public",i=n?"Site Not Yet Public":"Not Published",f=n?`This site isn't public yet${s}`:`This project hasn't been published yet${s}`;return`<!doctype html>
39
+ `+P,DEPLOY_IDENTITY:J,NODE_ENV:"'production'",IMPORTMAP:et,EDITOR:ft+G},{allowScript:!0}),status:$&&$.notFound?404:200,contentType:"text/html"}}function Wt(t,o="production",e=null){const s=o!=="production"?` (${o})`:"",n=e==="not_public",i=n?"Site Not Yet Public":"Not Published",f=n?`This site isn't public yet${s}`:`This project hasn't been published yet${s}`;return`<!doctype html>
40
40
  <html>
41
41
  <head>
42
42
  <meta charset="UTF-8">
@@ -62,4 +62,4 @@ import E from"./utils/logger.js";import ut from"./utils/vartranformer.js";import
62
62
  <span class="env">${t}${s}</span>
63
63
  </div>
64
64
  </body>
65
- </html>`}export{Pt as DEFAULT_TEMPLATE_HTML,K as generateSitemap,V as prefetchPageData,Vt as renderNotPublishedHtml,Kt as renderProjectHtml,j as transpileFunctionStrings};
65
+ </html>`}export{Lt as DEFAULT_TEMPLATE_HTML,V as generateSitemap,W as prefetchPageData,Wt as renderNotPublishedHtml,Vt as renderProjectHtml,k as transpileFunctionStrings};
@@ -1 +1 @@
1
- function u(c){if(!c)return!1;const n=c.trim().replace(/\n\s*/g," ").trim();if(n===""||n==="{}"||n==="[]")return!1;const r=[/^\(\s*\{[^}]*\}\s*\)\s*=>/,/^(\([^)]*\)|[^=]*)\s*=>/,/^function[\s(]/,/^async\s+/,/^\(\s*function/,/^[a-zA-Z_$][a-zA-Z0-9_$]*\s*=>/].some(a=>a.test(n)),i=n.startsWith("{")&&!n.includes("=>"),o=n.startsWith("["),y=/^["[{]/.test(n)&&!n.includes("=>");return r&&!i&&!o&&!y}const e=c=>typeof c=="string",t=Array.isArray,f=c=>c!==null&&typeof c=="object"&&!t(c);function p(c,n=Array.isArray(c)?[]:{}){for(const s in c){if(!Object.prototype.hasOwnProperty.call(c,s))continue;const r=c[s];if(e(r)){if(u(r))try{const i=Function("return ("+r+")")();n[s]=i}catch{n[s]=r}else n[s]=r;continue}if(t(r)){n[s]=[],r.forEach(i=>{if(e(i))if(u(i))try{const o=Function("return ("+i+")")();n[s].push(o)}catch{n[s].push(i)}else n[s].push(i);else f(i)||t(i)?n[s].push(p(i)):n[s].push(i)});continue}if(f(r)){n[s]=p(r);continue}n[s]=r}return n}function l(c,n=Array.isArray(c)?[]:{}){for(const s in c){if(!Object.prototype.hasOwnProperty.call(c,s))continue;const r=c[s];e(r)?n[s]=u(r)?null:r:t(r)?n[s]=r.map(i=>e(i)&&u(i)?null:f(i)||t(i)?l(i):i):f(r)?n[s]=l(r):n[s]=r}return n}var h=p;export{p as deepDestringifyFunctions,h as default,l as stripFunctionStrings};
1
+ function f(s){if(!s)return!1;const n=s.trim().replace(/\n\s*/g," ").trim();if(n===""||n==="{}"||n==="[]")return!1;const r=[/^\(\s*\{[^}]*\}\s*\)\s*=>/,/^(\([^)]*\)|[^=]*)\s*=>/,/^function[\s(]/,/^async\s+/,/^\(\s*function/,/^[a-zA-Z_$][a-zA-Z0-9_$]*\s*=>/].some(h=>h.test(n)),e=n.startsWith("{")&&!n.includes("=>"),o=n.startsWith("["),a=/^["[{]/.test(n)&&!n.includes("=>");return r&&!e&&!o&&!a}const c=s=>typeof s=="string",t=Array.isArray,u=s=>s!==null&&typeof s=="object"&&!t(s),l=s=>{if(!u(s)||s.__type!=="String"||!c(s.value))return!1;const n=Object.keys(s);return n.length===2&&n.includes("value")},A=Symbol.for("smbls.revived"),d=s=>{if(s&&typeof s=="object")try{s[A]=!0}catch{}return s};function _(s,n=Array.isArray(s)?[]:{}){return d(p(s,n))}function p(s,n=Array.isArray(s)?[]:{}){for(const i in s){if(!Object.prototype.hasOwnProperty.call(s,i))continue;const r=s[i];if(c(r)){if(f(r))try{const e=Function("return ("+r+")")();n[i]=e}catch{n[i]=r}else n[i]=r;continue}if(t(r)){n[i]=[],r.forEach(e=>{if(c(e))if(f(e))try{const o=Function("return ("+e+")")();n[i].push(o)}catch{n[i].push(e)}else n[i].push(e);else l(e)?n[i].push(e.value):u(e)||t(e)?n[i].push(p(e)):n[i].push(e)});continue}if(l(r)){n[i]=r.value;continue}if(u(r)){n[i]=p(r);continue}n[i]=r}return n}function y(s,n=Array.isArray(s)?[]:{}){for(const i in s){if(!Object.prototype.hasOwnProperty.call(s,i))continue;const r=s[i];c(r)?n[i]=f(r)?null:r:l(r)?n[i]=r.value:t(r)?n[i]=r.map(e=>c(e)&&f(e)?null:l(e)?e.value:u(e)||t(e)?y(e):e):u(r)?n[i]=y(r):n[i]=r}return n}var O=_;export{_ as deepDestringifyFunctions,O as default,l as isStringTag,d as markRevived,y as stripFunctionStrings};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/mermaid",
3
- "version": "3.14.711",
3
+ "version": "3.14.713",
4
4
  "type": "module",
5
5
  "license": "CC-BY-NC-4.0",
6
6
  "description": "Self-sustaining server runner for Symbols projects from JSON. Renders DOMQL projects to HTML with optional brender SSR.",
@@ -63,7 +63,7 @@
63
63
  "dependencies": {
64
64
  "@symbo.ls/channels": "^3.14.676",
65
65
  "@symbo.ls/tap": "^3.14.612",
66
- "@symbo.ls/utils": "^3.14.770",
66
+ "@symbo.ls/utils": "^3.14.783",
67
67
  "cors": "^2.8.6",
68
68
  "express": "^4.22.2"
69
69
  },