@styleflow.app/flowpress-astro-core 1.0.0-beta.30 → 1.0.0-beta.32

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.
Files changed (112) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/astro/CompositionRenderer.astro +13 -2
  3. package/dist/astro/DefaultBlockAdapter.astro +3 -1
  4. package/dist/astro/FontStylesheets.astro +35 -0
  5. package/dist/astro/GutenbergRenderer.astro +59 -19
  6. package/dist/astro/Media.astro +24 -0
  7. package/dist/astro/StyleflowElement.astro +1 -0
  8. package/dist/astro/blocks/CarouselBlock.astro +3 -0
  9. package/dist/astro/blocks/CoverBlock.astro +2 -1
  10. package/dist/astro/blocks/HeroBlock.astro +2 -1
  11. package/dist/astro/blocks/ImageBlock.astro +2 -1
  12. package/dist/astro/blocks/ListItemFallback.astro +2 -1
  13. package/dist/astro/blocks/SiteLogoBlock.astro +3 -2
  14. package/dist/astro/blocks/helpers.d.ts +3 -1
  15. package/dist/astro/blocks/helpers.d.ts.map +1 -1
  16. package/dist/astro/blocks/helpers.js +5 -3
  17. package/dist/astro/blocks/helpers.js.map +1 -1
  18. package/dist/astro/blocks/helpers.ts +7 -4
  19. package/dist/astro/motion/AccordionRuntime.astro +9 -0
  20. package/dist/astro/motion/MotionBoot.astro +21 -0
  21. package/dist/astro/motion/MotionRuntime.astro +31 -0
  22. package/dist/astro/motion/accordion.css +163 -0
  23. package/dist/astro/motion/accordion.d.ts +3 -0
  24. package/dist/astro/motion/accordion.d.ts.map +1 -0
  25. package/dist/astro/motion/accordion.js +98 -0
  26. package/dist/astro/motion/accordion.js.map +1 -0
  27. package/dist/astro/motion/accordion.ts +109 -0
  28. package/dist/astro/motion/motion-controller.d.ts +12 -0
  29. package/dist/astro/motion/motion-controller.d.ts.map +1 -0
  30. package/dist/astro/motion/motion-controller.js +293 -0
  31. package/dist/astro/motion/motion-controller.js.map +1 -0
  32. package/dist/astro/motion/motion-controller.ts +377 -0
  33. package/dist/astro/motion/motion.css +546 -0
  34. package/dist/astro/motion/motion.d.ts +127 -0
  35. package/dist/astro/motion/motion.d.ts.map +1 -0
  36. package/dist/astro/motion/motion.js +255 -0
  37. package/dist/astro/motion/motion.js.map +1 -0
  38. package/dist/astro/motion/motion.ts +419 -0
  39. package/dist/astro/native/CustomFieldValue.astro +2 -1
  40. package/dist/astro/native/ReservedLogin.astro +107 -0
  41. package/dist/astro/native/ResolvedBlocks.astro +3 -1
  42. package/dist/astro/native/SyncedPatternContent.astro +3 -1
  43. package/dist/astro/native/TermFieldValue.astro +2 -1
  44. package/dist/astro/native/Timeline.astro +2 -1
  45. package/dist/astro/native/blob.css +1 -1
  46. package/dist/astro/native/button-template.d.ts +31 -0
  47. package/dist/astro/native/button-template.d.ts.map +1 -0
  48. package/dist/astro/native/button-template.js +54 -0
  49. package/dist/astro/native/button-template.js.map +1 -0
  50. package/dist/astro/native/button-template.ts +92 -0
  51. package/dist/astro/native/core-button-fallback.astro +43 -0
  52. package/dist/astro/native/core-button.astro +48 -26
  53. package/dist/astro/native/core-group.astro +3 -1
  54. package/dist/astro/native/core-image.astro +3 -2
  55. package/dist/astro/native/core-navigation.astro +9 -2
  56. package/dist/astro/native/core-post-featured-image.astro +3 -2
  57. package/dist/astro/native/core-post-template-fallback.astro +30 -0
  58. package/dist/astro/native/core-post-template.astro +17 -24
  59. package/dist/astro/native/grid-bleed.d.ts +2 -0
  60. package/dist/astro/native/grid-bleed.d.ts.map +1 -0
  61. package/dist/astro/native/grid-bleed.js +24 -7
  62. package/dist/astro/native/grid-bleed.js.map +1 -0
  63. package/dist/astro/native/group.css +36 -0
  64. package/dist/astro/native/group.d.ts +15 -0
  65. package/dist/astro/native/group.d.ts.map +1 -0
  66. package/dist/astro/native/group.js +66 -0
  67. package/dist/astro/native/group.js.map +1 -0
  68. package/dist/astro/native/group.ts +61 -0
  69. package/dist/astro/native/inline-text.css +15 -0
  70. package/dist/astro/native/query-carousel.d.ts +12 -0
  71. package/dist/astro/native/query-carousel.d.ts.map +1 -0
  72. package/dist/astro/native/query-carousel.js +36 -0
  73. package/dist/astro/native/query-carousel.js.map +1 -0
  74. package/dist/astro/native/query-carousel.ts +56 -0
  75. package/dist/astro/native/registry.d.ts.map +1 -1
  76. package/dist/astro/native/registry.js +3 -0
  77. package/dist/astro/native/registry.js.map +1 -1
  78. package/dist/astro/native/registry.ts +4 -0
  79. package/dist/astro/native/timeline.css +1 -1
  80. package/dist/astro/preferences/AccessibilityPanel.astro +73 -86
  81. package/dist/block-renderers.d.ts +3 -0
  82. package/dist/block-renderers.d.ts.map +1 -1
  83. package/dist/block-renderers.js.map +1 -1
  84. package/dist/composition.d.ts.map +1 -1
  85. package/dist/composition.js +2 -1
  86. package/dist/composition.js.map +1 -1
  87. package/dist/default-blocks.d.ts +1 -1
  88. package/dist/default-blocks.d.ts.map +1 -1
  89. package/dist/default-blocks.js +3 -1
  90. package/dist/default-blocks.js.map +1 -1
  91. package/dist/reserved-area.d.ts +10 -0
  92. package/dist/reserved-area.d.ts.map +1 -0
  93. package/dist/reserved-area.js +93 -0
  94. package/dist/reserved-area.js.map +1 -0
  95. package/dist/styleflow.d.ts +2 -0
  96. package/dist/styleflow.d.ts.map +1 -1
  97. package/dist/styleflow.js +6 -4
  98. package/dist/styleflow.js.map +1 -1
  99. package/dist/svg-media-runtime.d.ts +3 -0
  100. package/dist/svg-media-runtime.d.ts.map +1 -0
  101. package/dist/svg-media-runtime.js +33 -0
  102. package/dist/svg-media-runtime.js.map +1 -0
  103. package/dist/svg-media-types.d.ts +11 -0
  104. package/dist/svg-media-types.d.ts.map +1 -0
  105. package/dist/svg-media-types.js +2 -0
  106. package/dist/svg-media-types.js.map +1 -0
  107. package/dist/svg-media.d.ts +10 -0
  108. package/dist/svg-media.d.ts.map +1 -0
  109. package/dist/svg-media.js +34 -0
  110. package/dist/svg-media.js.map +1 -0
  111. package/dist/tsconfig.tsbuildinfo +1 -1
  112. package/package.json +30 -3
@@ -1 +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,CAAC,CAAC;QAC3D,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,SAAS,IAAI,CAAC,IAAI,SAAS,IAAI,EAAE,EAAE,CAAC;YACrE,SAAS,GAAG,SAAS,CAAC;QACxB,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAC1B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAC7B,+DAA+D,CAChE,CAAC;IACF,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAC5B,CAAC","sourcesContent":["import {\n resolveFlowpressBlockStyleflowProps,\n type StyleflowContract\n} from \"../../styleflow.js\";\nimport type { FlowpressBlock } from \"../../types.js\";\nimport { flowpressLinkHref } from \"../../links.js\";\n\nexport const DEFAULT_SEMANTIC_PROPS = {\n surface: \"default\",\n layoutRole: \"stack\",\n density: \"regular\"\n};\n\nexport const DEFAULT_HERO_OBJECT_POSITION = \"50% 50%\";\n\nexport function heroObjectPosition(value: unknown): string {\n if (typeof value !== \"string\") {\n return DEFAULT_HERO_OBJECT_POSITION;\n }\n\n const match = value.trim().match(\n /^(\\d+(?:\\.\\d+)?|\\.\\d+)%\\s+(\\d+(?:\\.\\d+)?|\\.\\d+)%$/\n );\n if (\n !match\n || [match[1], match[2]].some((coordinate) => {\n const numeric = Number(coordinate);\n return !Number.isFinite(numeric) || numeric < 0 || numeric > 100;\n })\n ) {\n return DEFAULT_HERO_OBJECT_POSITION;\n }\n\n return `${match[1]}% ${match[2]}%`;\n}\n\nexport function blockHtmlAttributes(\n attributes: Record<string, unknown>,\n baseClass = \"\"\n): { id?: string; class?: string } {\n const anchor = typeof attributes.anchor === \"string\"\n ? attributes.anchor.trim()\n : \"\";\n const customClass = typeof attributes.className === \"string\"\n ? attributes.className.trim()\n : \"\";\n const className = [baseClass.trim(), customClass]\n .filter(Boolean)\n .join(\" \")\n .replace(/\\s+/g, \" \");\n\n return {\n ...(anchor ? { id: anchor } : {}),\n ...(className ? { class: className } : {})\n };\n}\n\nexport const TEXT_HTML_TAGS = [\n \"span\",\n \"p\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"strong\",\n \"em\",\n \"small\",\n \"mark\"\n] as const;\n\nexport type TextHtmlTag = (typeof TEXT_HTML_TAGS)[number];\n\nfunction preferredTypographyVariant(type: string): string | undefined {\n if (type === \"heading\") return \"2\";\n if (type === \"body\" || type === \"label\" || type === \"code\") return \"md\";\n return undefined;\n}\n\n/**\n * Derive a variant only when Gutenberg omitted it. The selected typography\n * type can differ from the block's native type, so a paragraph styled as a\n * heading must not inherit the paragraph-only `md` variant.\n */\nexport function compatibleTypographyVariant(\n type: string,\n preferred: string,\n contract?: StyleflowContract\n): string {\n const variants = contract?.semantic.axes.typography.variantsByType[type];\n if (!variants?.length) return preferred;\n\n return [\n preferredTypographyVariant(type),\n preferred,\n contract?.semantic.agentPolicy.defaults.typography.ty === type\n ? contract.semantic.agentPolicy.defaults.typography.v\n : undefined,\n variants[0]\n ].find((candidate): candidate is string => (\n typeof candidate === \"string\" && variants.includes(candidate)\n )) ?? preferred;\n}\n\nexport function textBlockSemanticDefaults(\n blockName: string,\n attributes: Record<string, unknown>,\n contract?: StyleflowContract\n): Record<string, unknown> {\n const name = blockName.replace(/^sf\\//, \"\");\n const heading = name === \"heading\" || name === \"core/heading\";\n const level = Math.min(6, Math.max(1, Number(attributes.level ?? 2)));\n const defaultType = heading ? \"heading\" : \"body\";\n const authored = (...values: unknown[]) => values.find((value) => value !== undefined && value !== null && value !== \"\");\n const activeType = String(authored(attributes.ty) ?? defaultType);\n const nativeVariant = heading\n ? String(level)\n : name.includes(\"quote\") ? \"lg\" : \"md\";\n const authoredVariant = authored(attributes.v, attributes.variant);\n\n return {\n ty: defaultType,\n v: authoredVariant === undefined\n ? compatibleTypographyVariant(activeType, nativeVariant, contract)\n : String(authoredVariant),\n w: String(authored(attributes.w, attributes.weight) ?? (heading ? \"strong\" : \"default\")),\n foreground: \"primary\"\n };\n}\n\nexport function textHtmlTag(value: unknown): TextHtmlTag {\n const candidate = String(value ?? \"span\");\n return TEXT_HTML_TAGS.includes(candidate as TextHtmlTag)\n ? candidate as TextHtmlTag\n : \"span\";\n}\n\nexport function semanticProps(\n attributes: Record<string, unknown>,\n contract?: StyleflowContract,\n defaults: Record<string, unknown> = DEFAULT_SEMANTIC_PROPS\n): Record<string, unknown> {\n return resolveFlowpressBlockStyleflowProps(attributes, contract, defaults, {\n strict: process.env.NODE_ENV === \"production\" || process.env.STYLEFLOW_STRICT === \"1\",\n onDiagnostic: (diagnostic) => console.warn(`[${diagnostic.code}] ${diagnostic.message}`)\n });\n}\n\nconst TEXT_ALIGNMENTS = new Set([\n \"left\",\n \"center\",\n \"right\",\n \"justify\",\n \"start\",\n \"end\"\n]);\n\n/** Resolve only Gutenberg's supported text-alignment values to inline CSS. */\nexport function textAlignmentStyle(\n attributes: Record<string, unknown>\n): string | undefined {\n const style = attributes.style && typeof attributes.style === \"object\"\n && !Array.isArray(attributes.style)\n ? attributes.style as Record<string, unknown>\n : {};\n const typography = style.typography && typeof style.typography === \"object\"\n && !Array.isArray(style.typography)\n ? style.typography as Record<string, unknown>\n : {};\n const candidate = typography.textAlign ?? attributes.textAlign;\n const alignment = String(candidate ?? \"\");\n return TEXT_ALIGNMENTS.has(alignment) ? `text-align: ${alignment};` : undefined;\n}\n\nexport function prefixedTextSemanticProps(\n attributes: Record<string, unknown>,\n prefix: string,\n contract?: StyleflowContract,\n defaults: Record<string, unknown> = {}\n): Record<string, unknown> {\n const attributeName = (name: string) =>\n `${prefix}${name.charAt(0).toUpperCase()}${name.slice(1)}`;\n return semanticProps({\n ty: attributes[attributeName(\"ty\")],\n v: attributes[attributeName(\"v\")],\n w: attributes[attributeName(\"w\")],\n foreground: attributes[attributeName(\"foreground\")]\n }, contract, defaults);\n}\n\nexport function objectValue(\n block: FlowpressBlock,\n key: string\n): Record<string, unknown> {\n const value = block.attributes[key];\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? value as Record<string, unknown>\n : {};\n}\n\nexport function textValue(block: FlowpressBlock, key = \"text\"): string {\n return String(block.attributes[key] ?? \"\");\n}\n\n/**\n * Keep intentional blank lines visible across current and legacy RichText\n * serializations. Gutenberg can represent them either as repeated `<br>` tags,\n * empty paragraph elements, or literal newlines in an attribute value.\n */\nexport function preserveRichTextSpacing(html: string): string {\n const visibleEmptyBlocks = html\n .replace(/\\r\\n?/g, \"\\n\")\n .replace(\n /<(p|div)(\\s[^>]*)?>(?:\\s|&nbsp;|&#160;)*<\\/\\1>/gi,\n (_match, tag: string, attributes = \"\") =>\n `<${tag}${attributes}>&nbsp;</${tag}>`\n );\n\n return visibleEmptyBlocks\n .split(/(<[^>]+>)/g)\n .map((part) => {\n if (part.startsWith(\"<\") || part.trim() === \"\") {\n return part;\n }\n return part.replace(/\\n(?:[ \\t]*\\n)+/g, (newlines) =>\n \"<br>\".repeat((newlines.match(/\\n/g) || []).length)\n );\n })\n .join(\"\");\n}\n\n/** Keep an empty text element at its typographic line height without visible text. */\nexport function preserveEmptyTextBlock(html: string): string {\n return html.trim() === \"\" ? \"&nbsp;\" : html;\n}\n\nexport function linkValue(block: FlowpressBlock, key = \"link\"): string {\n return flowpressLinkHref(block.attributes[key]);\n}\n\nexport function responsiveValues(\n attributes: Record<string, unknown>,\n prefix: \"columns\" | \"span\",\n fallback: number\n): Record<\"base\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\", number> {\n const keys = [\"base\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\"] as const;\n const result = {} as Record<(typeof keys)[number], number>;\n let inherited = fallback;\n for (const key of keys) {\n const suffix = key === \"base\"\n ? \"Base\"\n : key === \"2xl\" ? \"2xl\" : key.charAt(0).toUpperCase() + key.slice(1);\n const candidate = Number(attributes[`${prefix}${suffix}`]);\n if (Number.isInteger(candidate) && candidate >= 1 && candidate <= 12) {\n inherited = candidate;\n }\n result[key] = inherited;\n }\n return result;\n}\n\nexport function unwrapCoreHtml(html: string): string {\n const match = html.trim().match(\n /^<(p|h[1-6]|ul|ol|li|blockquote)(?:\\s[^>]*)?>([\\s\\S]*)<\\/\\1>$/\n );\n return match?.[2] ?? html;\n}\n"]}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/astro/blocks/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,mCAAmC,EAEpC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,OAAO;IACnB,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,SAAS,CAAC;AAEtD,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,4BAA4B,CAAC;IACtC,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAC9B,mDAAmD,CACpD,CAAC;IACF,IACE,CAAC,KAAK;WACH,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE;YAC1C,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;YACnC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,GAAG,CAAC;QACnE,CAAC,CAAC,EACF,CAAC;QACD,OAAO,4BAA4B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AM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM;YAC3B,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvE,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;QAC3D,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,SAAS,IAAI,CAAC,IAAI,SAAS,IAAI,EAAE,EAAE,CAAC;YACrE,SAAS,GAAG,SAAS,CAAC;QACxB,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAC1B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAC7B,+DAA+D,CAChE,CAAC;IACF,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAC5B,CAAC","sourcesContent":["import { nativeFlexItemProps } from \"../native/group.js\";\nimport {\n resolveFlowpressBlockStyleflowProps,\n type StyleflowContract\n} from \"../../styleflow.js\";\nimport type { FlowpressBlock } from \"../../types.js\";\nimport { flowpressLinkHref } from \"../../links.js\";\n\nexport const DEFAULT_SEMANTIC_PROPS = {\n surface: \"default\",\n layoutRole: \"stack\",\n density: \"regular\"\n};\n\nexport const DEFAULT_HERO_OBJECT_POSITION = \"50% 50%\";\n\nexport function heroObjectPosition(value: unknown): string {\n if (typeof value !== \"string\") {\n return DEFAULT_HERO_OBJECT_POSITION;\n }\n\n const match = value.trim().match(\n /^(\\d+(?:\\.\\d+)?|\\.\\d+)%\\s+(\\d+(?:\\.\\d+)?|\\.\\d+)%$/\n );\n if (\n !match\n || [match[1], match[2]].some((coordinate) => {\n const numeric = Number(coordinate);\n return !Number.isFinite(numeric) || numeric < 0 || numeric > 100;\n })\n ) {\n return DEFAULT_HERO_OBJECT_POSITION;\n }\n\n return `${match[1]}% ${match[2]}%`;\n}\n\nexport function blockHtmlAttributes(\n attributes: Record<string, unknown>,\n baseClass = \"\"\n): { id?: string; class?: string; style?: string; [key: string]: unknown } {\n const anchor = typeof attributes.anchor === \"string\"\n ? attributes.anchor.trim()\n : \"\";\n const customClass = typeof attributes.className === \"string\"\n ? attributes.className.trim()\n : \"\";\n const className = [baseClass.trim(), customClass]\n .filter(Boolean)\n .join(\" \")\n .replace(/\\s+/g, \" \");\n\n return nativeFlexItemProps(attributes, {\n ...(anchor ? { id: anchor } : {}),\n ...(className ? { class: className } : {})\n });\n}\n\nexport const TEXT_HTML_TAGS = [\n \"span\",\n \"p\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"strong\",\n \"em\",\n \"small\",\n \"mark\"\n] as const;\n\nexport type TextHtmlTag = (typeof TEXT_HTML_TAGS)[number];\n\nfunction preferredTypographyVariant(type: string): string | undefined {\n if (type === \"heading\") return \"2\";\n if (type === \"body\" || type === \"label\" || type === \"code\") return \"md\";\n return undefined;\n}\n\n/**\n * Derive a variant only when Gutenberg omitted it. The selected typography\n * type can differ from the block's native type, so a paragraph styled as a\n * heading must not inherit the paragraph-only `md` variant.\n */\nexport function compatibleTypographyVariant(\n type: string,\n preferred: string,\n contract?: StyleflowContract\n): string {\n const variants = contract?.semantic.axes.typography.variantsByType[type];\n if (!variants?.length) return preferred;\n\n return [\n preferredTypographyVariant(type),\n preferred,\n contract?.semantic.agentPolicy.defaults.typography.ty === type\n ? contract.semantic.agentPolicy.defaults.typography.v\n : undefined,\n variants[0]\n ].find((candidate): candidate is string => (\n typeof candidate === \"string\" && variants.includes(candidate)\n )) ?? preferred;\n}\n\nexport function textBlockSemanticDefaults(\n blockName: string,\n attributes: Record<string, unknown>,\n contract?: StyleflowContract\n): Record<string, unknown> {\n const name = blockName.replace(/^sf\\//, \"\");\n const heading = name === \"heading\" || name === \"core/heading\";\n const level = Math.min(6, Math.max(1, Number(attributes.level ?? 2)));\n const defaultType = heading ? \"heading\" : \"body\";\n const authored = (...values: unknown[]) => values.find((value) => value !== undefined && value !== null && value !== \"\");\n const activeType = String(authored(attributes.ty) ?? defaultType);\n const nativeVariant = heading\n ? String(level)\n : name.includes(\"quote\") ? \"lg\" : \"md\";\n const authoredVariant = authored(attributes.v, attributes.variant);\n\n return {\n ty: defaultType,\n v: authoredVariant === undefined\n ? compatibleTypographyVariant(activeType, nativeVariant, contract)\n : String(authoredVariant),\n w: String(authored(attributes.w, attributes.weight) ?? (heading ? \"strong\" : \"default\")),\n foreground: \"primary\"\n };\n}\n\nexport function textHtmlTag(value: unknown): TextHtmlTag {\n const candidate = String(value ?? \"span\");\n return TEXT_HTML_TAGS.includes(candidate as TextHtmlTag)\n ? candidate as TextHtmlTag\n : \"span\";\n}\n\nexport function semanticProps(\n attributes: Record<string, unknown>,\n contract?: StyleflowContract,\n defaults: Record<string, unknown> = DEFAULT_SEMANTIC_PROPS,\n effectiveTone?: string\n): Record<string, unknown> {\n return resolveFlowpressBlockStyleflowProps(attributes, contract, defaults, {\n effectiveTone,\n strict: process.env.NODE_ENV === \"production\" || process.env.STYLEFLOW_STRICT === \"1\",\n onDiagnostic: (diagnostic) => console.warn(`[${diagnostic.code}] ${diagnostic.message}`)\n });\n}\n\nconst TEXT_ALIGNMENTS = new Set([\n \"left\",\n \"center\",\n \"right\",\n \"justify\",\n \"start\",\n \"end\"\n]);\n\n/** Resolve only Gutenberg's supported text-alignment values to inline CSS. */\nexport function textAlignmentStyle(\n attributes: Record<string, unknown>\n): string | undefined {\n const style = attributes.style && typeof attributes.style === \"object\"\n && !Array.isArray(attributes.style)\n ? attributes.style as Record<string, unknown>\n : {};\n const typography = style.typography && typeof style.typography === \"object\"\n && !Array.isArray(style.typography)\n ? style.typography as Record<string, unknown>\n : {};\n const candidate = typography.textAlign ?? attributes.textAlign;\n const alignment = String(candidate ?? \"\");\n return TEXT_ALIGNMENTS.has(alignment) ? `text-align: ${alignment};` : undefined;\n}\n\nexport function prefixedTextSemanticProps(\n attributes: Record<string, unknown>,\n prefix: string,\n contract?: StyleflowContract,\n defaults: Record<string, unknown> = {}\n): Record<string, unknown> {\n const attributeName = (name: string) =>\n `${prefix}${name.charAt(0).toUpperCase()}${name.slice(1)}`;\n return semanticProps({\n ty: attributes[attributeName(\"ty\")],\n v: attributes[attributeName(\"v\")],\n w: attributes[attributeName(\"w\")],\n foreground: attributes[attributeName(\"foreground\")]\n }, contract, defaults);\n}\n\nexport function objectValue(\n block: FlowpressBlock,\n key: string\n): Record<string, unknown> {\n const value = block.attributes[key];\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? value as Record<string, unknown>\n : {};\n}\n\nexport function textValue(block: FlowpressBlock, key = \"text\"): string {\n return String(block.attributes[key] ?? \"\");\n}\n\n/**\n * Keep intentional blank lines visible across current and legacy RichText\n * serializations. Gutenberg can represent them either as repeated `<br>` tags,\n * empty paragraph elements, or literal newlines in an attribute value.\n */\nexport function preserveRichTextSpacing(html: string): string {\n const visibleEmptyBlocks = html\n .replace(/\\r\\n?/g, \"\\n\")\n .replace(\n /<(p|div)(\\s[^>]*)?>(?:\\s|&nbsp;|&#160;)*<\\/\\1>/gi,\n (_match, tag: string, attributes = \"\") =>\n `<${tag}${attributes}>&nbsp;</${tag}>`\n );\n\n return visibleEmptyBlocks\n .split(/(<[^>]+>)/g)\n .map((part) => {\n if (part.startsWith(\"<\") || part.trim() === \"\") {\n return part;\n }\n return part.replace(/\\n(?:[ \\t]*\\n)+/g, (newlines) =>\n \"<br>\".repeat((newlines.match(/\\n/g) || []).length)\n );\n })\n .join(\"\");\n}\n\n/** Keep an empty text element at its typographic line height without visible text. */\nexport function preserveEmptyTextBlock(html: string): string {\n return html.trim() === \"\" ? \"&nbsp;\" : html;\n}\n\nexport function linkValue(block: FlowpressBlock, key = \"link\"): string {\n return flowpressLinkHref(block.attributes[key]);\n}\n\nexport function responsiveValues(\n attributes: Record<string, unknown>,\n prefix: \"columns\" | \"span\",\n fallback: number\n): Record<\"base\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\", number> {\n const keys = [\"base\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\"] as const;\n const result = {} as Record<(typeof keys)[number], number>;\n let inherited = fallback;\n for (const key of keys) {\n const suffix = key === \"base\"\n ? \"Base\"\n : key === \"2xl\" ? \"2xl\" : key.charAt(0).toUpperCase() + key.slice(1);\n const candidate = Number(attributes[`${prefix}${suffix}`]);\n if (Number.isInteger(candidate) && candidate >= 1 && candidate <= 12) {\n inherited = candidate;\n }\n result[key] = inherited;\n }\n return result;\n}\n\nexport function unwrapCoreHtml(html: string): string {\n const match = html.trim().match(\n /^<(p|h[1-6]|ul|ol|li|blockquote)(?:\\s[^>]*)?>([\\s\\S]*)<\\/\\1>$/\n );\n return match?.[2] ?? html;\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { nativeFlexItemProps } from "../native/group.js";
1
2
  import {
2
3
  resolveFlowpressBlockStyleflowProps,
3
4
  type StyleflowContract
@@ -37,7 +38,7 @@ export function heroObjectPosition(value: unknown): string {
37
38
  export function blockHtmlAttributes(
38
39
  attributes: Record<string, unknown>,
39
40
  baseClass = ""
40
- ): { id?: string; class?: string } {
41
+ ): { id?: string; class?: string; style?: string; [key: string]: unknown } {
41
42
  const anchor = typeof attributes.anchor === "string"
42
43
  ? attributes.anchor.trim()
43
44
  : "";
@@ -49,10 +50,10 @@ export function blockHtmlAttributes(
49
50
  .join(" ")
50
51
  .replace(/\s+/g, " ");
51
52
 
52
- return {
53
+ return nativeFlexItemProps(attributes, {
53
54
  ...(anchor ? { id: anchor } : {}),
54
55
  ...(className ? { class: className } : {})
55
- };
56
+ });
56
57
  }
57
58
 
58
59
  export const TEXT_HTML_TAGS = [
@@ -139,9 +140,11 @@ export function textHtmlTag(value: unknown): TextHtmlTag {
139
140
  export function semanticProps(
140
141
  attributes: Record<string, unknown>,
141
142
  contract?: StyleflowContract,
142
- defaults: Record<string, unknown> = DEFAULT_SEMANTIC_PROPS
143
+ defaults: Record<string, unknown> = DEFAULT_SEMANTIC_PROPS,
144
+ effectiveTone?: string
143
145
  ): Record<string, unknown> {
144
146
  return resolveFlowpressBlockStyleflowProps(attributes, contract, defaults, {
147
+ effectiveTone,
145
148
  strict: process.env.NODE_ENV === "production" || process.env.STYLEFLOW_STRICT === "1",
146
149
  onDiagnostic: (diagnostic) => console.warn(`[${diagnostic.code}] ${diagnostic.message}`)
147
150
  });
@@ -0,0 +1,9 @@
1
+ ---
2
+ import "./accordion.css";
3
+ ---
4
+ <script>
5
+ import { initializeAccordions } from "./accordion.js";
6
+ let cleanup = () => {};
7
+ const start = () => { cleanup(); cleanup = initializeAccordions(); };
8
+ start(); document.addEventListener("astro:page-load", start); document.addEventListener("astro:before-swap", () => cleanup());
9
+ </script>
@@ -0,0 +1,21 @@
1
+ ---
2
+ /**
3
+ * Head counterpart of MotionRuntime: render it right after the motion
4
+ * preference bootstrap, with the same options. Reveals that the controller
5
+ * will arm are hidden before first paint instead of after it.
6
+ * Portabile in FlowPress: docs/pilots/primo-paint-stabile.md
7
+ */
8
+ import { motionBootCss, motionBootScript, type SfMotionOptions } from "./motion.js";
9
+ import { MOTION_ATTRIBUTE } from "../../motion-preference.js";
10
+
11
+ export interface Props extends SfMotionOptions {}
12
+
13
+ const css = motionBootCss(Astro.props);
14
+ ---
15
+
16
+ {css && (
17
+ <>
18
+ <style is:inline set:html={css}></style>
19
+ <script is:inline set:html={motionBootScript(MOTION_ATTRIBUTE)}></script>
20
+ </>
21
+ )}
@@ -0,0 +1,31 @@
1
+ ---
2
+ import {
3
+ resolveSfMotionOptions,
4
+ type SfMotionOptions,
5
+ } from "./motion.js";
6
+
7
+ export interface Props extends SfMotionOptions {}
8
+
9
+ const options = resolveSfMotionOptions(Astro.props);
10
+ ---
11
+
12
+ <style is:global>@import "./motion.css";</style>
13
+ <template data-sf-motion-options={JSON.stringify(options)}></template>
14
+
15
+ <script>
16
+ import { initializeSfMotion } from "./motion-controller.js";
17
+ import type { SfMotionOptions } from "./motion.js";
18
+
19
+ const optionsElement = document.querySelector<HTMLTemplateElement>(
20
+ "template[data-sf-motion-options]",
21
+ );
22
+ let options: SfMotionOptions = {};
23
+
24
+ try {
25
+ options = JSON.parse(optionsElement?.dataset.sfMotionOptions ?? "{}");
26
+ } catch {
27
+ // Malformed serialized configuration keeps all markup visible.
28
+ }
29
+
30
+ initializeSfMotion(options);
31
+ </script>
@@ -0,0 +1,163 @@
1
+ /* FlowPress accordion: stack > item > details, including the unmodified markup. */
2
+ /* styleflow-ignore-start rule=SF_CSS_HARDCODED reason="Disclosure geometry and motion are interaction behavior; typography uses StyleFlow tokens" scope="Project accordion" */
3
+ :where([data-layout-role="stack"]):has(> [data-layout-role="item"] > details) {
4
+ gap: 0;
5
+ }
6
+
7
+ /* Unboxed rows: the separator line below each item replaces the item frame. */
8
+ :where([data-layout-role="stack"]) > :where([data-layout-role="item"]):has(> details) {
9
+ position: relative;
10
+ padding: 0;
11
+ border-width: 0;
12
+ border-radius: 0;
13
+ background: transparent;
14
+ }
15
+
16
+ /*
17
+ * Separator with the same reveal as an <hr> (`sf-reveal--line`). It is drawn
18
+ * by the item because an injected <hr> would miss the one-time reveal setup.
19
+ */
20
+ :where([data-layout-role="stack"]) > :where([data-layout-role="item"]):has(> details)::after {
21
+ content: "";
22
+ position: absolute;
23
+ inset-inline: 0;
24
+ inset-block-end: 0;
25
+ block-size: 1px;
26
+ background: currentColor;
27
+ pointer-events: none;
28
+ }
29
+
30
+ /* The item only carries the reveal state: the row itself never moves or fades. */
31
+ .sf-reveal.sf-reveal--accordion-line {
32
+ --sf-reveal-duration: 1100ms;
33
+ }
34
+
35
+ html[data-sf-motion="ready"]
36
+ .sf-reveal.sf-reveal--accordion-line[data-sf-reveal-state]:not(.sf-motion-static) {
37
+ clip-path: none;
38
+ filter: none;
39
+ opacity: 1;
40
+ transform: none;
41
+ }
42
+
43
+ html[data-sf-motion="ready"]
44
+ .sf-reveal--accordion-line[data-sf-reveal-state="pending"]:not(.sf-motion-static)::after {
45
+ clip-path: inset(0 100% 0 0);
46
+ }
47
+
48
+ html[data-sf-motion="ready"]
49
+ .sf-reveal--accordion-line[data-sf-reveal-state="pending"]:not(.sf-motion-static):dir(rtl)::after {
50
+ clip-path: inset(0 0 0 100%);
51
+ }
52
+
53
+ /* Settled keeps the transition so the line never jumps if the state changes mid-draw. */
54
+ html[data-sf-motion="ready"]
55
+ .sf-reveal--accordion-line:is([data-sf-reveal-state="visible"], [data-sf-reveal-state="settled"]):not(.sf-motion-static)::after {
56
+ clip-path: inset(0);
57
+ transition: clip-path var(--sf-reveal-duration) var(--sf-motion-ease-luxury)
58
+ var(--sf-reveal-delay);
59
+ }
60
+
61
+ /* Hover styles live on details: the item's reveal states override its transitions. */
62
+ :where([data-layout-role="stack"]) > :where([data-layout-role="item"]) > details {
63
+ --fp-accordion-duration: var(--sf-motion-duration-default, 500ms);
64
+ --fp-accordion-easing: var(--sf-motion-ease-soft, cubic-bezier(0.22, 1, 0.36, 1));
65
+ --fp-accordion-hover-indent: var(--sf-layout-panel-comfortable-padding-x, 1rem);
66
+ box-sizing: border-box;
67
+ padding-inline: 0;
68
+ background-color: transparent;
69
+ transition:
70
+ background-color var(--fp-accordion-duration) var(--fp-accordion-easing),
71
+ padding-inline-start var(--fp-accordion-duration) var(--fp-accordion-easing);
72
+ }
73
+
74
+ @media (hover: hover) {
75
+ :where([data-layout-role="stack"]) > :where([data-layout-role="item"]) > details:hover {
76
+ padding-inline-start: var(--fp-accordion-hover-indent);
77
+ background-color: var(--sf-surface-sunken-background);
78
+ }
79
+ }
80
+
81
+ /* Vertical spacing stays off details: accordion.ts collapses it to the summary height. */
82
+ :where([data-layout-role="stack"]) > :where([data-layout-role="item"]) > details > summary {
83
+ display: flex;
84
+ align-items: center;
85
+ justify-content: space-between;
86
+ gap: var(--sf-layout-panel-regular-gap, 1rem);
87
+ min-block-size: 44px;
88
+ padding-block: var(--sf-layout-panel-comfortable-padding-y, 1rem);
89
+ list-style: none;
90
+ cursor: pointer;
91
+ font-family: var(--sf-text-heading-3-light-font-family, inherit);
92
+ font-size: var(--sf-text-heading-3-light-font-size, 1.75rem);
93
+ font-style: var(--sf-text-heading-3-light-font-style, normal);
94
+ font-weight: var(--sf-text-heading-3-light-font-weight, 400);
95
+ line-height: var(--sf-text-heading-3-light-line-height, 1.1);
96
+ letter-spacing: var(--sf-text-heading-3-light-letter-spacing, -0.025em);
97
+ text-transform: var(--sf-text-heading-3-light-text-transform, none);
98
+ font-variation-settings: var(--sf-text-heading-3-light-font-variation-settings, normal);
99
+ overflow-wrap: anywhere;
100
+ }
101
+
102
+ :where([data-layout-role="stack"]) > :where([data-layout-role="item"]) > details > summary::-webkit-details-marker {
103
+ display: none;
104
+ }
105
+
106
+ :where([data-layout-role="stack"]) > :where([data-layout-role="item"]) > details > summary::marker {
107
+ content: "";
108
+ }
109
+
110
+ /* Two 2px bars make a decorative +; rotating 45 degrees makes the close ×. */
111
+ :where([data-layout-role="stack"]) > :where([data-layout-role="item"]) > details > summary::after {
112
+ content: "";
113
+ flex: 0 0 auto;
114
+ inline-size: 0.75em;
115
+ block-size: 0.75em;
116
+ /* An even box keeps the centered 2px bars on whole pixels. */
117
+ inline-size: round(0.75em, 2px);
118
+ block-size: round(0.75em, 2px);
119
+ background:
120
+ linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
121
+ linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
122
+ transform: rotate(0deg);
123
+ transition: transform var(--fp-accordion-duration) var(--fp-accordion-easing);
124
+ }
125
+
126
+ :where([data-layout-role="stack"]) > :where([data-layout-role="item"]) > details[open]:not([data-accordion-expanded="false"]) > summary::after {
127
+ transform: rotate(45deg);
128
+ }
129
+
130
+ :where([data-layout-role="stack"]) > :where([data-layout-role="item"]) > details > summary:focus-visible {
131
+ outline: 2px solid currentColor;
132
+ outline-offset: 4px;
133
+ }
134
+
135
+ :where([data-layout-role="stack"]) > :where([data-layout-role="item"]) > details > summary ~ * {
136
+ margin-block-start: var(--sf-layout-stack-regular-gap, 0.5rem);
137
+ }
138
+
139
+ /* The summary padding already separates the first content block. */
140
+ :where([data-layout-role="stack"]) > :where([data-layout-role="item"]) > details > summary + * {
141
+ margin-block-start: 0;
142
+ }
143
+
144
+ /* Padding, not margin: a trailing margin could collapse out below the separator. */
145
+ :where([data-layout-role="stack"]) > :where([data-layout-role="item"]) > details > summary ~ :last-child {
146
+ padding-block-end: var(--sf-layout-panel-comfortable-padding-y, 1rem);
147
+ }
148
+
149
+ /* Height is animated by accordion.ts, so closing content remains visible. */
150
+ details[data-accordion-animating="true"] {
151
+ overflow: clip;
152
+ }
153
+
154
+ html[data-sf-motion-preference="reduce"] details > summary::after {
155
+ transition: none;
156
+ }
157
+
158
+ @media (prefers-reduced-motion: reduce) {
159
+ html:not([data-sf-motion-preference]) details > summary::after {
160
+ transition: none;
161
+ }
162
+ }
163
+ /* styleflow-ignore-end */
@@ -0,0 +1,3 @@
1
+ /** Enhance the existing FlowPress markup without changing native summary controls. */
2
+ export declare function initializeAccordions(scope?: ParentNode): () => void;
3
+ //# sourceMappingURL=accordion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../src/astro/motion/accordion.ts"],"names":[],"mappings":"AAKA,sFAAsF;AACtF,wBAAgB,oBAAoB,CAAC,KAAK,GAAE,UAAqB,GAAG,MAAM,IAAI,CAsG7E"}
@@ -0,0 +1,98 @@
1
+ import { getMotionPreference, subscribeMotionPreference } from "../../motion-preference.js";
2
+ const GROUP_SELECTOR = '[data-layout-role="stack"]:has(> [data-layout-role="item"] > details)';
3
+ const ITEM_SELECTOR = ':scope > [data-layout-role="item"] > details';
4
+ /** Enhance the existing FlowPress markup without changing native summary controls. */
5
+ export function initializeAccordions(scope = document) {
6
+ const cleanups = [];
7
+ const settleAnimations = [];
8
+ scope.querySelectorAll(GROUP_SELECTOR).forEach((group) => {
9
+ if (group.dataset.accordionReady === "true")
10
+ return;
11
+ group.dataset.accordionReady = "true";
12
+ const items = [];
13
+ let hasOpenItem = false;
14
+ group.querySelectorAll(ITEM_SELECTOR).forEach((details) => {
15
+ const summary = details.querySelector(":scope > summary");
16
+ if (!summary)
17
+ return;
18
+ // Keep at most one initially open item, independently for each group.
19
+ let expanded = details.open && !hasOpenItem;
20
+ hasOpenItem ||= expanded;
21
+ let animation;
22
+ details.open = expanded;
23
+ details.dataset.accordionExpanded = String(expanded);
24
+ summary.setAttribute("aria-expanded", String(expanded));
25
+ const settle = () => {
26
+ details.open = expanded;
27
+ animation?.cancel();
28
+ animation = undefined;
29
+ delete details.dataset.accordionAnimating;
30
+ };
31
+ settleAnimations.push(settle);
32
+ const setExpanded = (next) => {
33
+ if (next === expanded)
34
+ return;
35
+ // Capture the current frame before cancelling: rapid clicks can reverse smoothly.
36
+ const from = details.getBoundingClientRect().height;
37
+ animation?.cancel();
38
+ animation = undefined;
39
+ expanded = next;
40
+ details.dataset.accordionExpanded = String(expanded);
41
+ summary.setAttribute("aria-expanded", String(expanded));
42
+ if (getMotionPreference() === "reduce" || details.closest(".sf-motion-disable") || !details.animate) {
43
+ settle();
44
+ return;
45
+ }
46
+ // Keep open until collapse finishes; the native closed state hides content instantly.
47
+ details.open = true;
48
+ const to = expanded ? details.getBoundingClientRect().height : summary.getBoundingClientRect().height;
49
+ const styles = getComputedStyle(details);
50
+ const durationValue = styles.getPropertyValue("--fp-accordion-duration").trim();
51
+ const duration = Number.parseFloat(durationValue) * (durationValue.endsWith("ms") ? 1 : 1000);
52
+ if (from === to || !Number.isFinite(duration) || duration <= 0) {
53
+ settle();
54
+ return;
55
+ }
56
+ details.dataset.accordionAnimating = "true";
57
+ animation = details.animate([{ height: `${from}px` }, { height: `${to}px` }], {
58
+ duration,
59
+ easing: styles.getPropertyValue("--fp-accordion-easing").trim() || "ease-out",
60
+ fill: "both",
61
+ });
62
+ animation.onfinish = settle;
63
+ };
64
+ const onClick = (event) => {
65
+ if (event.defaultPrevented || event.button !== 0)
66
+ return;
67
+ if (event.target instanceof Element && event.target.closest("a, button, input, select, textarea"))
68
+ return;
69
+ event.preventDefault();
70
+ const next = !expanded;
71
+ if (next)
72
+ items.forEach((item) => {
73
+ if (item.details !== details)
74
+ item.setExpanded(false);
75
+ });
76
+ setExpanded(next);
77
+ };
78
+ items.push({ details, setExpanded });
79
+ summary.addEventListener("click", onClick);
80
+ cleanups.push(() => {
81
+ summary.removeEventListener("click", onClick);
82
+ settle();
83
+ summary.removeAttribute("aria-expanded");
84
+ delete details.dataset.accordionExpanded;
85
+ });
86
+ });
87
+ cleanups.push(() => { delete group.dataset.accordionReady; });
88
+ });
89
+ const unsubscribe = settleAnimations.length ? subscribeMotionPreference((preference) => {
90
+ if (preference === "reduce")
91
+ settleAnimations.forEach((settle) => settle());
92
+ }) : () => { };
93
+ return () => {
94
+ unsubscribe();
95
+ cleanups.forEach((cleanup) => cleanup());
96
+ };
97
+ }
98
+ //# sourceMappingURL=accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../../src/astro/motion/accordion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE5F,MAAM,cAAc,GAAG,uEAAuE,CAAC;AAC/F,MAAM,aAAa,GAAG,8CAA8C,CAAC;AAErE,sFAAsF;AACtF,MAAM,UAAU,oBAAoB,CAAC,QAAoB,QAAQ;IAC/D,MAAM,QAAQ,GAAmB,EAAE,CAAC;IACpC,MAAM,gBAAgB,GAAmB,EAAE,CAAC;IAE5C,KAAK,CAAC,gBAAgB,CAAc,cAAc,CA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C,OAAO,CAAC,iBAAiB,CAAC;YAC3C,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,UAAU,EAAE,EAAE;QACrF,IAAI,UAAU,KAAK,QAAQ;YAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC;IAEd,OAAO,GAAG,EAAE;QACV,WAAW,EAAE,CAAC;QACd,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IAC3C,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { getMotionPreference, subscribeMotionPreference } from \"../../motion-preference.js\";\n\nconst GROUP_SELECTOR = '[data-layout-role=\"stack\"]:has(> [data-layout-role=\"item\"] > details)';\nconst ITEM_SELECTOR = ':scope > [data-layout-role=\"item\"] > details';\n\n/** Enhance the existing FlowPress markup without changing native summary controls. */\nexport function initializeAccordions(scope: ParentNode = document): () => void {\n const cleanups: (() => void)[] = [];\n const settleAnimations: (() => void)[] = [];\n\n scope.querySelectorAll<HTMLElement>(GROUP_SELECTOR).forEach((group) => {\n if (group.dataset.accordionReady === \"true\") return;\n group.dataset.accordionReady = \"true\";\n\n const items: { details: HTMLDetailsElement; setExpanded: (expanded: boolean) => void }[] = [];\n let hasOpenItem = false;\n\n group.querySelectorAll<HTMLDetailsElement>(ITEM_SELECTOR).forEach((details) => {\n const summary = details.querySelector<HTMLElement>(\":scope > summary\");\n if (!summary) return;\n\n // Keep at most one initially open item, independently for each group.\n let expanded = details.open && !hasOpenItem;\n hasOpenItem ||= expanded;\n let animation: Animation | undefined;\n details.open = expanded;\n details.dataset.accordionExpanded = String(expanded);\n summary.setAttribute(\"aria-expanded\", String(expanded));\n\n const settle = () => {\n details.open = expanded;\n animation?.cancel();\n animation = undefined;\n delete details.dataset.accordionAnimating;\n };\n settleAnimations.push(settle);\n\n const setExpanded = (next: boolean) => {\n if (next === expanded) return;\n\n // Capture the current frame before cancelling: rapid clicks can reverse smoothly.\n const from = details.getBoundingClientRect().height;\n animation?.cancel();\n animation = undefined;\n expanded = next;\n details.dataset.accordionExpanded = String(expanded);\n summary.setAttribute(\"aria-expanded\", String(expanded));\n\n if (getMotionPreference() === \"reduce\" || details.closest(\".sf-motion-disable\") || !details.animate) {\n settle();\n return;\n }\n\n // Keep open until collapse finishes; the native closed state hides content instantly.\n details.open = true;\n const to = expanded ? details.getBoundingClientRect().height : summary.getBoundingClientRect().height;\n const styles = getComputedStyle(details);\n const durationValue = styles.getPropertyValue(\"--fp-accordion-duration\").trim();\n const duration = Number.parseFloat(durationValue) * (durationValue.endsWith(\"ms\") ? 1 : 1000);\n\n if (from === to || !Number.isFinite(duration) || duration <= 0) {\n settle();\n return;\n }\n\n details.dataset.accordionAnimating = \"true\";\n animation = details.animate(\n [{ height: `${from}px` }, { height: `${to}px` }],\n {\n duration,\n easing: styles.getPropertyValue(\"--fp-accordion-easing\").trim() || \"ease-out\",\n fill: \"both\",\n },\n );\n animation.onfinish = settle;\n };\n\n const onClick = (event: MouseEvent) => {\n if (event.defaultPrevented || event.button !== 0) return;\n if (event.target instanceof Element && event.target.closest(\"a, button, input, select, textarea\")) return;\n event.preventDefault();\n const next = !expanded;\n if (next) items.forEach((item) => {\n if (item.details !== details) item.setExpanded(false);\n });\n setExpanded(next);\n };\n\n items.push({ details, setExpanded });\n summary.addEventListener(\"click\", onClick);\n cleanups.push(() => {\n summary.removeEventListener(\"click\", onClick);\n settle();\n summary.removeAttribute(\"aria-expanded\");\n delete details.dataset.accordionExpanded;\n });\n });\n cleanups.push(() => { delete group.dataset.accordionReady; });\n });\n\n const unsubscribe = settleAnimations.length ? subscribeMotionPreference((preference) => {\n if (preference === \"reduce\") settleAnimations.forEach((settle) => settle());\n }) : () => {};\n\n return () => {\n unsubscribe();\n cleanups.forEach((cleanup) => cleanup());\n };\n}\n"]}
@@ -0,0 +1,109 @@
1
+ import { getMotionPreference, subscribeMotionPreference } from "../../motion-preference.js";
2
+
3
+ const GROUP_SELECTOR = '[data-layout-role="stack"]:has(> [data-layout-role="item"] > details)';
4
+ const ITEM_SELECTOR = ':scope > [data-layout-role="item"] > details';
5
+
6
+ /** Enhance the existing FlowPress markup without changing native summary controls. */
7
+ export function initializeAccordions(scope: ParentNode = document): () => void {
8
+ const cleanups: (() => void)[] = [];
9
+ const settleAnimations: (() => void)[] = [];
10
+
11
+ scope.querySelectorAll<HTMLElement>(GROUP_SELECTOR).forEach((group) => {
12
+ if (group.dataset.accordionReady === "true") return;
13
+ group.dataset.accordionReady = "true";
14
+
15
+ const items: { details: HTMLDetailsElement; setExpanded: (expanded: boolean) => void }[] = [];
16
+ let hasOpenItem = false;
17
+
18
+ group.querySelectorAll<HTMLDetailsElement>(ITEM_SELECTOR).forEach((details) => {
19
+ const summary = details.querySelector<HTMLElement>(":scope > summary");
20
+ if (!summary) return;
21
+
22
+ // Keep at most one initially open item, independently for each group.
23
+ let expanded = details.open && !hasOpenItem;
24
+ hasOpenItem ||= expanded;
25
+ let animation: Animation | undefined;
26
+ details.open = expanded;
27
+ details.dataset.accordionExpanded = String(expanded);
28
+ summary.setAttribute("aria-expanded", String(expanded));
29
+
30
+ const settle = () => {
31
+ details.open = expanded;
32
+ animation?.cancel();
33
+ animation = undefined;
34
+ delete details.dataset.accordionAnimating;
35
+ };
36
+ settleAnimations.push(settle);
37
+
38
+ const setExpanded = (next: boolean) => {
39
+ if (next === expanded) return;
40
+
41
+ // Capture the current frame before cancelling: rapid clicks can reverse smoothly.
42
+ const from = details.getBoundingClientRect().height;
43
+ animation?.cancel();
44
+ animation = undefined;
45
+ expanded = next;
46
+ details.dataset.accordionExpanded = String(expanded);
47
+ summary.setAttribute("aria-expanded", String(expanded));
48
+
49
+ if (getMotionPreference() === "reduce" || details.closest(".sf-motion-disable") || !details.animate) {
50
+ settle();
51
+ return;
52
+ }
53
+
54
+ // Keep open until collapse finishes; the native closed state hides content instantly.
55
+ details.open = true;
56
+ const to = expanded ? details.getBoundingClientRect().height : summary.getBoundingClientRect().height;
57
+ const styles = getComputedStyle(details);
58
+ const durationValue = styles.getPropertyValue("--fp-accordion-duration").trim();
59
+ const duration = Number.parseFloat(durationValue) * (durationValue.endsWith("ms") ? 1 : 1000);
60
+
61
+ if (from === to || !Number.isFinite(duration) || duration <= 0) {
62
+ settle();
63
+ return;
64
+ }
65
+
66
+ details.dataset.accordionAnimating = "true";
67
+ animation = details.animate(
68
+ [{ height: `${from}px` }, { height: `${to}px` }],
69
+ {
70
+ duration,
71
+ easing: styles.getPropertyValue("--fp-accordion-easing").trim() || "ease-out",
72
+ fill: "both",
73
+ },
74
+ );
75
+ animation.onfinish = settle;
76
+ };
77
+
78
+ const onClick = (event: MouseEvent) => {
79
+ if (event.defaultPrevented || event.button !== 0) return;
80
+ if (event.target instanceof Element && event.target.closest("a, button, input, select, textarea")) return;
81
+ event.preventDefault();
82
+ const next = !expanded;
83
+ if (next) items.forEach((item) => {
84
+ if (item.details !== details) item.setExpanded(false);
85
+ });
86
+ setExpanded(next);
87
+ };
88
+
89
+ items.push({ details, setExpanded });
90
+ summary.addEventListener("click", onClick);
91
+ cleanups.push(() => {
92
+ summary.removeEventListener("click", onClick);
93
+ settle();
94
+ summary.removeAttribute("aria-expanded");
95
+ delete details.dataset.accordionExpanded;
96
+ });
97
+ });
98
+ cleanups.push(() => { delete group.dataset.accordionReady; });
99
+ });
100
+
101
+ const unsubscribe = settleAnimations.length ? subscribeMotionPreference((preference) => {
102
+ if (preference === "reduce") settleAnimations.forEach((settle) => settle());
103
+ }) : () => {};
104
+
105
+ return () => {
106
+ unsubscribe();
107
+ cleanups.forEach((cleanup) => cleanup());
108
+ };
109
+ }
@@ -0,0 +1,12 @@
1
+ import { type SfMotionOptions } from "./motion.js";
2
+ /**
3
+ * Initializes the project reveal system once per document.
4
+ *
5
+ * Markup is visible by default. Initial-viewport content remains visible unless
6
+ * `revealAboveFold` explicitly opts it into motion; every reveal completes once.
7
+ * Reveals follow the shared motion preference (see `motion-preference.ts`):
8
+ * reduced motion shows everything at once, and allowing it again re-arms the
9
+ * reveals still below the fold without a reload.
10
+ */
11
+ export declare function initializeSfMotion(options?: SfMotionOptions): void;
12
+ //# sourceMappingURL=motion-controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion-controller.d.ts","sourceRoot":"","sources":["../../../src/astro/motion/motion-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAeL,KAAK,eAAe,EAErB,MAAM,aAAa,CAAC;AAmHrB;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,eAAoB,GAAG,IAAI,CA2OtE"}