@styleflow.app/flowpress-astro-core 1.0.0-beta.36 → 1.0.0-beta.37

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 CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0-beta.37 — 2026-10-26
4
+
5
+ - Scan immutable SVG media trees once per render request, preserving nested/resolved media, scoped SVG IDs, and the explicit registration API for mutable caller data.
6
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-26-prestazioni-oauth-dmo.md).
7
+
3
8
  ## 1.0.0-beta.36 — 2026-10-26
4
9
 
5
10
  - Align StyleFlow Astro beta.11 and Components beta.16 so every default/native renderer shares the compiled design contract instead of allocating it for every primitive.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  import "./native/inline-text.css";
3
- import { registerFlowpressSvgMedia, type FlowpressSvgMediaLocals } from "../svg-media.js";
3
+ import { registerFlowpressRenderSvgMedia, type FlowpressSvgMediaLocals } from "../svg-media.js";
4
4
  import "./native/grid.css";
5
5
  import "./native/group.css";
6
6
  import { decorateGridBlocks } from "./native/grid.js";
@@ -42,7 +42,7 @@ const {
42
42
  inheritedTone
43
43
  } = Astro.props;
44
44
 
45
- registerFlowpressSvgMedia(sourceComposition, Astro.locals as FlowpressSvgMediaLocals);
45
+ registerFlowpressRenderSvgMedia(sourceComposition, Astro.locals as FlowpressSvgMediaLocals);
46
46
 
47
47
  const mediaOptions: FlowpressFrontendMediaOptions = Astro.props.media ?? {
48
48
  frontendOrigin: Astro.url.origin,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  import "./native/inline-text.css";
3
- import { registerFlowpressSvgMedia, type FlowpressSvgMediaLocals } from "../svg-media.js";
3
+ import { registerFlowpressRenderSvgMedia, type FlowpressSvgMediaLocals } from "../svg-media.js";
4
4
  import Media from "./Media.astro";
5
5
  import { decodeFlowpressText } from "../text.js";
6
6
  import "./native/grid.css";
@@ -78,7 +78,7 @@ const {
78
78
  interactiveAncestor = false,
79
79
  requireRegisteredAdapters = false
80
80
  } = Astro.props;
81
- registerFlowpressSvgMedia(rawBlocks, Astro.locals as FlowpressSvgMediaLocals);
81
+ registerFlowpressRenderSvgMedia(rawBlocks, Astro.locals as FlowpressSvgMediaLocals);
82
82
 
83
83
  const { decorateGridBlocks } = await import("./native/grid.js");
84
84
  const blocks = decorateGridBlocks(rawBlocks);
@@ -2,7 +2,10 @@ import type { FlowpressSvgMediaLocals } from "./svg-media-types.js";
2
2
  export type { FlowpressSvgMediaPayload, FlowpressSvgMediaLocals } from "./svg-media-types.js";
3
3
  export declare const SVG_INSTANCE_PLACEHOLDER = "__SF_SVG_INSTANCE__";
4
4
  export declare function flowpressSvgMediaUrl(url: unknown): string;
5
+ /** Explicit registration rescans mutable caller data, as before. */
5
6
  export declare function registerFlowpressSvgMedia(value: unknown, locals: FlowpressSvgMediaLocals): void;
7
+ /** Immutable renderer inputs are scanned once per request, including nested passes. */
8
+ export declare function registerFlowpressRenderSvgMedia(value: unknown, locals: FlowpressSvgMediaLocals): void;
6
9
  export declare function flowpressSvgMediaProps(src: unknown, props: Record<string, unknown>, locals: FlowpressSvgMediaLocals): {
7
10
  attributes: Record<string, unknown>;
8
11
  content: string;
@@ -1 +1 @@
1
- {"version":3,"file":"svg-media.d.ts","sourceRoot":"","sources":["../src/svg-media.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA4B,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC9F,YAAY,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC9F,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAC9D,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAsE;AAChI,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAc/F;AACD,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,uBAAuB,GAAG;IAAC,UAAU,EAAC,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,CAAC;IAAA,OAAO,EAAC,MAAM,CAAA;CAAC,GAAC,IAAI,CAS7K"}
1
+ {"version":3,"file":"svg-media.d.ts","sourceRoot":"","sources":["../src/svg-media.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA4B,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC9F,YAAY,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC9F,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAC9D,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAsE;AAkBhI,oEAAoE;AACpE,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAE/F;AAED,uFAAuF;AACvF,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAQrG;AACD,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,uBAAuB,GAAG;IAAC,UAAU,EAAC,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,CAAC;IAAA,OAAO,EAAC,MAAM,CAAA;CAAC,GAAC,IAAI,CAS7K"}
package/dist/svg-media.js CHANGED
@@ -1,8 +1,7 @@
1
1
  export const SVG_INSTANCE_PLACEHOLDER = "__SF_SVG_INSTANCE__";
2
2
  export function flowpressSvgMediaUrl(url) { return typeof url === "string" ? url.replace(/[?#].*$/, "") : ""; }
3
- export function registerFlowpressSvgMedia(value, locals) {
4
- const registry = locals.flowpressSvgMedia ??= new Map();
5
- const seen = new WeakSet();
3
+ const renderScans = new WeakMap();
4
+ function scanSvgMedia(value, registry, seen) {
6
5
  function visit(node) {
7
6
  if (!node || typeof node !== "object" || seen.has(node))
8
7
  return;
@@ -19,6 +18,20 @@ export function registerFlowpressSvgMedia(value, locals) {
19
18
  }
20
19
  visit(value);
21
20
  }
21
+ /** Explicit registration rescans mutable caller data, as before. */
22
+ export function registerFlowpressSvgMedia(value, locals) {
23
+ scanSvgMedia(value, locals.flowpressSvgMedia ??= new Map(), new WeakSet());
24
+ }
25
+ /** Immutable renderer inputs are scanned once per request, including nested passes. */
26
+ export function registerFlowpressRenderSvgMedia(value, locals) {
27
+ const registry = locals.flowpressSvgMedia ??= new Map();
28
+ let state = renderScans.get(locals);
29
+ if (!state || state.registry !== registry) {
30
+ state = { registry, seen: new WeakSet() };
31
+ renderScans.set(locals, state);
32
+ }
33
+ scanSvgMedia(value, registry, state.seen);
34
+ }
22
35
  export function flowpressSvgMediaProps(src, props, locals) {
23
36
  const payload = locals.flowpressSvgMedia?.get(flowpressSvgMediaUrl(src));
24
37
  if (!payload)
@@ -1 +1 @@
1
- {"version":3,"file":"svg-media.js","sourceRoot":"","sources":["../src/svg-media.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAC9D,MAAM,UAAU,oBAAoB,CAAC,GAAY,IAAY,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAChI,MAAM,UAAU,yBAAyB,CAAC,KAAc,EAAE,MAA+B;IACxF,MAAM,QAAQ,GAAG,MAAM,CAAC,iBAAiB,KAAK,IAAI,GAAG,EAAE,CAAC;IACxD,MAAM,IAAI,GAAG,IAAI,OAAO,EAAU,CAAC;IACnC,SAAS,KAAK,CAAC,IAAa;QAC3B,IAAI,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AA,CAAC,CAAA,KAAK,EAAC,aAAa,EAAC,UAAU,CAAA,CAAC,CAAA,MAAM,CAAA,CAAC,CAAA,SAAS,EAAC,SAAS,EAAC,OAAO,EAAC,4BAA4B,EAAC,MAAM,CAAC,OAAO,EAAC,0BAA0B,EAAC,MAAM,CAAC,KAAK,EAAC,2BAA2B,EAAC,MAAM,CAAC,MAAM,EAAC,EAAC,OAAO,EAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAC,CAAC;AACte,CAAC","sourcesContent":["import type { FlowpressSvgMediaPayload, FlowpressSvgMediaLocals } from \"./svg-media-types.js\";\nexport type { FlowpressSvgMediaPayload, FlowpressSvgMediaLocals } from \"./svg-media-types.js\";\nexport const SVG_INSTANCE_PLACEHOLDER = \"__SF_SVG_INSTANCE__\";\nexport function flowpressSvgMediaUrl(url: unknown): string { return typeof url === \"string\" ? url.replace(/[?#].*$/, \"\") : \"\"; }\nexport function registerFlowpressSvgMedia(value: unknown, locals: FlowpressSvgMediaLocals): void {\n const registry = locals.flowpressSvgMedia ??= new Map();\n const seen = new WeakSet<object>();\n function visit(node: unknown): void {\n if (!node || typeof node !== \"object\" || seen.has(node)) return;\n seen.add(node);\n const record = node as Record<string, any>;\n if (record.svg?.version === \"1\" && record.svg.attributes && typeof record.svg.content === \"string\") {\n const url = flowpressSvgMediaUrl(record.url || record.sourceUrl);\n if (url) registry.set(url, record.svg as FlowpressSvgMediaPayload);\n }\n for (const [key,child] of Object.entries(record)) if(key !== \"svg\") visit(child);\n }\n visit(value);\n}\nexport function flowpressSvgMediaProps(src: unknown, props: Record<string, unknown>, locals: FlowpressSvgMediaLocals): {attributes:Record<string,unknown>;content:string}|null {\n const payload=locals.flowpressSvgMedia?.get(flowpressSvgMediaUrl(src));if(!payload)return null;\n const scope=`fp-svg-${locals.flowpressSvgMediaSequence=(locals.flowpressSvgMediaSequence||0)+1}`;\n const replace=(v:unknown)=>String(v).split(SVG_INSTANCE_PLACEHOLDER).join(scope);\n const source=Object.fromEntries(Object.entries(payload.attributes).map(([n,v])=>[n,replace(v)]));\n const {src:_src,srcset:_srcset,sizes:_sizes,loading:_loading,decoding:_decoding,fetchpriority:_priority,alt,...html}=props;\n const label=typeof html['aria-label']==='string'?html['aria-label']:String(alt??'');\n const decorative=html['aria-hidden']==='true'||html['aria-hidden']===true||!label;\n return {attributes:{...source,...html,class:['flowpress-svg-media',source.class,html.class].filter(Boolean).join(' '),style:[source.style,html.style].filter(Boolean).join(';')||undefined,role:decorative?'presentation':'img','aria-label':decorative?undefined:label,'aria-hidden':decorative?'true':undefined,focusable:'false','data-flowpress-svg-viewbox':source.viewBox,'data-flowpress-svg-width':source.width,'data-flowpress-svg-height':source.height},content:replace(payload.content)};\n}\n"]}
1
+ {"version":3,"file":"svg-media.js","sourceRoot":"","sources":["../src/svg-media.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAC9D,MAAM,UAAU,oBAAoB,CAAC,GAAY,IAAY,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEhI,MAAM,WAAW,GAAG,IAAI,OAAO,EAA6E,CAAC;AAE7G,SAAS,YAAY,CAAC,KAAc,EAAE,QAAqB,EAAE,IAAqB;IACjF,SAAS,KAAK,CAAC,IAAa;QAC3B,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO;QAChE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,MAAM,MAAM,GAAG,IAA2B,CAAC;QAC3C,IAAI,MAAM,CAAC,GAAG,EAAE,OAAO,KAAK,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,OAA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CAAC,qBAAqB,EAAC,MAAM,CAAC,KAAK,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAC,KAAK,EAAC,CAAC,MAAM,CAAC,KAAK,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAE,SAAS,EAAC,IAAI,EAAC,UAAU,CAAA,CAAC,CAAA,cAAc,CAAA,CAAC,CAAA,KAAK,EAAC,YAAY,EAAC,UAAU,CAAA,CAAC,CAAA,SAAS,CAAA,CAAC,CAAA,KAAK,EAAC,aAAa,EAAC,UAAU,CAAA,CAAC,CAAA,MAAM,CAAA,CAAC,CAAA,SAAS,EAAC,SAAS,EAAC,OAAO,EAAC,4BAA4B,EAAC,MAAM,CAAC,OAAO,EAAC,0BAA0B,EAAC,MAAM,CAAC,KAAK,EAAC,2BAA2B,EAAC,MAAM,CAAC,MAAM,EAAC,EAAC,OAAO,EAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAC,CAAC;AACte,CAAC","sourcesContent":["import type { FlowpressSvgMediaPayload, FlowpressSvgMediaLocals } from \"./svg-media-types.js\";\nexport type { FlowpressSvgMediaPayload, FlowpressSvgMediaLocals } from \"./svg-media-types.js\";\nexport const SVG_INSTANCE_PLACEHOLDER = \"__SF_SVG_INSTANCE__\";\nexport function flowpressSvgMediaUrl(url: unknown): string { return typeof url === \"string\" ? url.replace(/[?#].*$/, \"\") : \"\"; }\ntype SvgRegistry = NonNullable<FlowpressSvgMediaLocals[\"flowpressSvgMedia\"]>;\nconst renderScans = new WeakMap<FlowpressSvgMediaLocals, { registry: SvgRegistry; seen: WeakSet<object> }>();\n\nfunction scanSvgMedia(value: unknown, registry: SvgRegistry, seen: WeakSet<object>): void {\n function visit(node: unknown): void {\n if (!node || typeof node !== \"object\" || seen.has(node)) return;\n seen.add(node);\n const record = node as Record<string, any>;\n if (record.svg?.version === \"1\" && record.svg.attributes && typeof record.svg.content === \"string\") {\n const url = flowpressSvgMediaUrl(record.url || record.sourceUrl);\n if (url) registry.set(url, record.svg as FlowpressSvgMediaPayload);\n }\n for (const [key,child] of Object.entries(record)) if(key !== \"svg\") visit(child);\n }\n visit(value);\n}\n\n/** Explicit registration rescans mutable caller data, as before. */\nexport function registerFlowpressSvgMedia(value: unknown, locals: FlowpressSvgMediaLocals): void {\n scanSvgMedia(value, locals.flowpressSvgMedia ??= new Map(), new WeakSet<object>());\n}\n\n/** Immutable renderer inputs are scanned once per request, including nested passes. */\nexport function registerFlowpressRenderSvgMedia(value: unknown, locals: FlowpressSvgMediaLocals): void {\n const registry = locals.flowpressSvgMedia ??= new Map();\n let state = renderScans.get(locals);\n if (!state || state.registry !== registry) {\n state = { registry, seen: new WeakSet<object>() };\n renderScans.set(locals, state);\n }\n scanSvgMedia(value, registry, state.seen);\n}\nexport function flowpressSvgMediaProps(src: unknown, props: Record<string, unknown>, locals: FlowpressSvgMediaLocals): {attributes:Record<string,unknown>;content:string}|null {\n const payload=locals.flowpressSvgMedia?.get(flowpressSvgMediaUrl(src));if(!payload)return null;\n const scope=`fp-svg-${locals.flowpressSvgMediaSequence=(locals.flowpressSvgMediaSequence||0)+1}`;\n const replace=(v:unknown)=>String(v).split(SVG_INSTANCE_PLACEHOLDER).join(scope);\n const source=Object.fromEntries(Object.entries(payload.attributes).map(([n,v])=>[n,replace(v)]));\n const {src:_src,srcset:_srcset,sizes:_sizes,loading:_loading,decoding:_decoding,fetchpriority:_priority,alt,...html}=props;\n const label=typeof html['aria-label']==='string'?html['aria-label']:String(alt??'');\n const decorative=html['aria-hidden']==='true'||html['aria-hidden']===true||!label;\n return {attributes:{...source,...html,class:['flowpress-svg-media',source.class,html.class].filter(Boolean).join(' '),style:[source.style,html.style].filter(Boolean).join(';')||undefined,role:decorative?'presentation':'img','aria-label':decorative?undefined:label,'aria-hidden':decorative?'true':undefined,focusable:'false','data-flowpress-svg-viewbox':source.viewBox,'data-flowpress-svg-width':source.width,'data-flowpress-svg-height':source.height},content:replace(payload.content)};\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@styleflow.app/flowpress-astro-core",
3
- "version": "1.0.0-beta.36",
3
+ "version": "1.0.0-beta.37",
4
4
  "description": "Project-agnostic WordPress routing, templates, SEO and GraphQL runtime for FlowPress Astro apps.",
5
5
  "type": "module",
6
6
  "private": false,