@nuasite/cms 0.7.3 → 0.8.2

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.
@@ -656,7 +656,10 @@ export async function enhanceManifestWithSourceSnippets(
656
656
  const propName = cached.propAliases.get(baseVar)!
657
657
  const componentFileName = path.basename(filePath)
658
658
  const result = await searchForExpressionProp(
659
- componentFileName, propName, exprPath, entry.text!,
659
+ componentFileName,
660
+ propName,
661
+ exprPath,
662
+ entry.text!,
660
663
  )
661
664
  if (result) {
662
665
  const propSnippet = result.snippet ?? trimmedText
@@ -682,7 +685,8 @@ export async function enhanceManifestWithSourceSnippets(
682
685
  for (const searchDir of ['pages', 'components', 'layouts']) {
683
686
  try {
684
687
  const result = await searchForPropInParents(
685
- path.join(srcDir, searchDir), trimmedText,
688
+ path.join(srcDir, searchDir),
689
+ trimmedText,
686
690
  )
687
691
  if (result) {
688
692
  const parentSnippet = result.snippet ?? trimmedText
@@ -9,6 +9,7 @@ export {
9
9
  buildColorClass,
10
10
  COLOR_CLASS_PATTERNS,
11
11
  DEFAULT_TAILWIND_COLORS,
12
+ extractBackgroundImageClasses,
12
13
  extractColorClasses,
13
14
  extractTextStyleClasses,
14
15
  getColorType,
package/src/types.ts CHANGED
@@ -42,6 +42,20 @@ export interface ComponentDefinition {
42
42
  previewWidth?: number
43
43
  }
44
44
 
45
+ /** Background image metadata for elements using bg-[url()] */
46
+ export interface BackgroundImageMetadata {
47
+ /** Full Tailwind class, e.g. bg-[url('/path.png')] */
48
+ bgImageClass: string
49
+ /** Extracted image URL, e.g. /path.png */
50
+ imageUrl: string
51
+ /** Background size class: bg-auto | bg-cover | bg-contain */
52
+ bgSize?: string
53
+ /** Background position class: bg-center | bg-top | bg-bottom-left | ... */
54
+ bgPosition?: string
55
+ /** Background repeat class: bg-repeat | bg-no-repeat | bg-repeat-x | bg-repeat-y */
56
+ bgRepeat?: string
57
+ }
58
+
45
59
  /** Image metadata for better tracking and integrity */
46
60
  export interface ImageMetadata {
47
61
  /** Image source URL */
@@ -155,6 +169,8 @@ export interface ManifestEntry {
155
169
  sourceHash?: string
156
170
  /** Image metadata for img elements (replaces imageSrc/imageAlt) */
157
171
  imageMetadata?: ImageMetadata
172
+ /** Background image metadata for elements using bg-[url()] */
173
+ backgroundImage?: BackgroundImageMetadata
158
174
  /** Content validation constraints */
159
175
  constraints?: ContentConstraints
160
176
  /** Color classes applied to this element (for buttons, etc.) */