@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.
- package/README.md +2 -6
- package/dist/editor.js +8983 -8467
- package/package.json +1 -1
- package/src/color-patterns.ts +68 -1
- package/src/editor/color-utils.ts +8 -8
- package/src/editor/components/bg-image-overlay.tsx +483 -0
- package/src/editor/components/editable-highlights.tsx +14 -0
- package/src/editor/components/frontmatter-fields.tsx +7 -3
- package/src/editor/components/outline.tsx +3 -2
- package/src/editor/components/text-style-toolbar.tsx +4 -1
- package/src/editor/constants.ts +3 -0
- package/src/editor/editor.ts +173 -7
- package/src/editor/history.ts +120 -34
- package/src/editor/hooks/index.ts +3 -0
- package/src/editor/hooks/useBgImageHoverDetection.ts +101 -0
- package/src/editor/index.tsx +12 -0
- package/src/editor/signals.ts +48 -14
- package/src/editor/storage.ts +50 -0
- package/src/editor/types.ts +79 -8
- package/src/handlers/source-writer.ts +61 -69
- package/src/html-processor.ts +75 -5
- package/src/source-finder/snippet-utils.ts +6 -2
- package/src/tailwind-colors.ts +1 -0
- package/src/types.ts +16 -0
|
@@ -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,
|
|
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),
|
|
688
|
+
path.join(srcDir, searchDir),
|
|
689
|
+
trimmedText,
|
|
686
690
|
)
|
|
687
691
|
if (result) {
|
|
688
692
|
const parentSnippet = result.snippet ?? trimmedText
|
package/src/tailwind-colors.ts
CHANGED
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.) */
|