backflow-ui-renderer 0.1.77 → 0.1.78

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/vite.cjs CHANGED
@@ -14,7 +14,7 @@ export const workflowIconResolver = (name, size, style) => {
14
14
  `}const q=`
15
15
  export const createFlowDiagram = () => ({ nodes: [], edges: [] });
16
16
  export const FlowDiagram = () => null;
17
- `,F="manifest.json",A="sw.js",O="backflow-pwa-maskable.svg";function H(e){var o;const t=/^data:([^;,]+)(;base64)?,(.*)$/s.exec(e||"");if(!t)return null;const n=t[1],r=t[2]?Buffer.from(t[3],"base64"):Buffer.from(decodeURIComponent(t[3])),s=n.includes("svg")?"svg":((o=n.split("/")[1])==null?void 0:o.split("+")[0])||"png";return{mime:n,buffer:r,ext:s}}function G(e){return e.length>=24&&e.readUInt32BE(0)===2303741511?`${e.readUInt32BE(16)}x${e.readUInt32BE(20)}`:null}const $={svg:"image/svg+xml",png:"image/png",webp:"image/webp",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"},v=e=>(e.split("?")[0].split(".").pop()||"").toLowerCase();function J(e,t){const n=t||process.env.VITE_LOGO_PATH||process.env.BACKFLOW_LOGO_PATH;if(n)return n;const r=m.dirname(e);for(const s of Object.keys($))if(h.existsSync(m.join(r,`logo.${s}`)))return`/.backflow/workflows/logo.${s}`;return""}function K(e,t){if(t.startsWith("data:"))return t;const n=m.join(m.dirname(e),t.split("/").pop()||"");try{return h.existsSync(n)?`data:${$[v(n)]||"application/octet-stream"};base64,${h.readFileSync(n).toString("base64")}`:null}catch{return null}}function V(e,t,n){var I,k;const r=(e==null?void 0:e.config)||{},s=String((e==null?void 0:e.title)||r.title||"App"),o=String(((I=r.colors)==null?void 0:I.primary)||"#111827"),a=String(((k=r.colors)==null?void 0:k.background)||"#ffffff");let i=null,l=null,c,u,p,d;const f=J(t,n)||String(r.logo||""),g=f.startsWith("data:image/")?H(f):null;if(g)i=`backflow-pwa-icon.${g.ext}`,l=g.buffer,c=`/${i}`,u=g.mime,p=g.ext==="svg"?"any":G(g.buffer)||"512x512",d=f;else if(f)c=f,u=$[v(f)]||"image/png",p=v(f)==="svg"?"any":"512x512",d=K(t,f)||f;else{const T=(s.trim()[0]||"B").toUpperCase(),_=`<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512"><rect width="512" height="512" rx="96" fill="${o}"/><text x="50%" y="52%" font-size="300" font-family="Georgia,serif" fill="#ffffff" text-anchor="middle" dominant-baseline="middle">${T}</text></svg>`;i="backflow-pwa-icon.svg",l=Buffer.from(_),c=`/${i}`,u="image/svg+xml",p="any",d=`data:image/svg+xml;base64,${Buffer.from(_).toString("base64")}`}const B=`<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><rect width="512" height="512" fill="${a}"/><image href="${d}" x="51.2" y="51.2" width="409.6" height="409.6" preserveAspectRatio="xMidYMid meet"/></svg>`,N={id:"/",name:s,short_name:s.slice(0,12),start_url:"/",scope:"/",display:"standalone",orientation:"portrait",background_color:a,theme_color:o,prefer_related_applications:!1,icons:[{src:c,sizes:p,type:u,purpose:"any"},{src:`/${O}`,sizes:"any",type:"image/svg+xml",purpose:"maskable"}]},M=`// Backflow PWA service worker (network pass-through)
17
+ `,F="manifest.json",A="sw.js",O="backflow-pwa-maskable.svg";function H(e){var o;const t=/^data:([^;,]+)(;base64)?,(.*)$/s.exec(e||"");if(!t)return null;const n=t[1],r=t[2]?Buffer.from(t[3],"base64"):Buffer.from(decodeURIComponent(t[3])),s=n.includes("svg")?"svg":((o=n.split("/")[1])==null?void 0:o.split("+")[0])||"png";return{mime:n,buffer:r,ext:s}}function G(e){return e.length>=24&&e.readUInt32BE(0)===2303741511?`${e.readUInt32BE(16)}x${e.readUInt32BE(20)}`:null}const $={svg:"image/svg+xml",png:"image/png",webp:"image/webp",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"},v=e=>(e.split("?")[0].split(".").pop()||"").toLowerCase();function J(e,t){const n=t||process.env.VITE_LOGO_PATH||process.env.BACKFLOW_LOGO_PATH;if(n)return n;const r=m.dirname(e);for(const s of Object.keys($))if(h.existsSync(m.join(r,`logo.${s}`)))return`/.backflow/workflows/logo.${s}`;return""}function K(e,t){if(t.startsWith("data:"))return t;const n=m.join(m.dirname(e),t.split("/").pop()||"");try{return h.existsSync(n)?`data:${$[v(n)]||"application/octet-stream"};base64,${h.readFileSync(n).toString("base64")}`:null}catch{return null}}function V(e,t,n){var I,k;const r=(e==null?void 0:e.config)||{},s=String((e==null?void 0:e.title)||r.title||"App"),o=String(((I=r.colors)==null?void 0:I.primary)||"#111827"),a=String(((k=r.colors)==null?void 0:k.background)||"#ffffff");let i=null,l=null,c,u,p,d;const f=J(t,n)||String(r.logo||""),g=f.startsWith("data:image/")?H(f):null;if(g)i=`backflow-pwa-icon.${g.ext}`,l=g.buffer,c=`/${i}`,u=g.mime,p=g.ext==="svg"?"any":G(g.buffer)||"512x512",d=f;else if(f)c=f,u=$[v(f)]||"image/png",p=v(f)==="svg"?"any":"512x512",d=K(t,f)||f;else{const T=(s.trim()[0]||"B").toUpperCase(),_=`<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512"><rect width="512" height="512" rx="96" fill="${o}"/><text x="50%" y="52%" font-size="300" font-family="Georgia,serif" fill="#ffffff" text-anchor="middle" dominant-baseline="middle">${T}</text></svg>`;i="backflow-pwa-icon.svg",l=Buffer.from(_),c=`/${i}`,u="image/svg+xml",p="any",d=`data:image/svg+xml;base64,${Buffer.from(_).toString("base64")}`}const B=`<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><rect width="512" height="512" fill="${a}"/><image href="${d}" x="51.2" y="51.2" width="409.6" height="409.6" preserveAspectRatio="xMidYMid meet"/></svg>`,N={id:"/",name:s,short_name:s.slice(0,12),start_url:"/",scope:"/",display:"standalone",orientation:"portrait",background_color:a,theme_color:o,prefer_related_applications:!1,icons:[{src:c,sizes:p,type:u,purpose:"any maskable"},{src:`/${O}`,sizes:"any",type:"image/svg+xml",purpose:"maskable"}]},M=`// Backflow PWA service worker (network pass-through)
18
18
  self.addEventListener("install", () => self.skipWaiting());
19
19
  self.addEventListener("activate", (event) => event.waitUntil(self.clients.claim()));
20
20
  self.addEventListener("fetch", () => { /* network only */ });
@@ -1 +1 @@
1
- {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAQnC,UAAU,oBAAoB;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,sGAAsG;IACtG,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA4RD,wBAAgB,aAAa,CAAC,EAC5B,YAAY,EACZ,QAAQ,GACT,EAAE,oBAAoB,GAAG,MAAM,CA2D/B"}
1
+ {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAQnC,UAAU,oBAAoB;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,sGAAsG;IACtG,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA+SD,wBAAgB,aAAa,CAAC,EAC5B,YAAY,EACZ,QAAQ,GACT,EAAE,oBAAoB,GAAG,MAAM,CA6D/B"}
package/dist/vite.js CHANGED
@@ -20,7 +20,10 @@ function y(e) {
20
20
  function L(e) {
21
21
  const t = C.resolve(`react-icons/${e}`, {
22
22
  paths: [process.cwd()]
23
- }), n = g(x($(t), "index.d.ts"), "utf-8");
23
+ }), n = g(
24
+ x($(t), "index.d.ts"),
25
+ "utf-8"
26
+ );
24
27
  return new Set(
25
28
  Array.from(
26
29
  n.matchAll(/export declare const (\w+)/g),
@@ -135,7 +138,14 @@ function X(e, t, n) {
135
138
  theme_color: o,
136
139
  prefer_related_applications: !1,
137
140
  icons: [
138
- { src: c, sizes: p, type: m, purpose: "any" },
141
+ // Single self-contained entry: SVG maskables with external refs are
142
+ // rejected by Chrome install, so the raster icon doubles as maskable.
143
+ {
144
+ src: c,
145
+ sizes: p,
146
+ type: m,
147
+ purpose: "any maskable"
148
+ },
139
149
  {
140
150
  src: `/${F}`,
141
151
  sizes: "any",
@@ -195,17 +205,18 @@ function te({
195
205
  },
196
206
  generateBundle() {
197
207
  for (const o of s().files)
198
- this.emitFile({ type: "asset", fileName: o.name, source: o.source });
208
+ this.emitFile({
209
+ type: "asset",
210
+ fileName: o.name,
211
+ source: o.source
212
+ });
199
213
  },
200
214
  transformIndexHtml: {
201
215
  order: "post",
202
216
  handler(o) {
203
217
  const a = s().html;
204
- return o.replace(
205
- "</head>",
206
- ` ${a}
207
- </head>`
208
- );
218
+ return o.replace("</head>", ` ${a}
219
+ </head>`);
209
220
  }
210
221
  },
211
222
  resolveId(o) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backflow-ui-renderer",
3
- "version": "0.1.77",
3
+ "version": "0.1.78",
4
4
  "description": "Standalone React workflow renderer for Backflow.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",