Skip to content

feat: add flexible field support for nova-flexible-content integration#3

Merged
iamgerwin merged 4 commits into
mainfrom
feat/issue-2-flexible-field-support
Nov 25, 2025
Merged

feat: add flexible field support for nova-flexible-content integration#3
iamgerwin merged 4 commits into
mainfrom
feat/issue-2-flexible-field-support

Conversation

@iamgerwin

Copy link
Copy Markdown
Owner

Summary

This PR adds support for using NovaDependencyContainer inside whitecube/nova-flexible-content Flexible field layouts.

Key Changes:

  • Implemented context-aware attribute resolution for nested field structures
  • Added automatic detection of Flexible field attribute prefixes
  • Support for multiple attribute formats (double underscore and bracket notation)
  • Enhanced field lookup with fallback suffix matching

Technical Details

New Methods Added

FormField.vue and DetailField.vue:

  • getFlexibleContextPrefix() - Detects the Flexible field context prefix
  • extractBaseAttribute() - Parses prefixed attribute names to base names
  • getFlexibleAttributeFormats() - Generates alternative attribute patterns
  • getAllFields() - Traverses component tree to find all rendered fields

How It Works

  1. When a dependency is checked, the component first tries exact attribute matching
  2. If no match found, it detects if we are inside a Flexible layout context
  3. The component resolves the relative field name to its prefixed equivalent
  4. Multiple format variations are checked for compatibility

Documentation

  • Added docs/flexible-field-support.md with comprehensive guide
  • Updated README with Flexible field usage example
  • Updated CHANGELOG for v1.0.5

Closes #2

- Implement context-aware attribute resolution for Flexible fields
- Add getFlexibleContextPrefix() to detect nested field context
- Add extractBaseAttribute() to parse prefixed attribute names
- Add getFlexibleAttributeFormats() for alternative pattern matching
- Enhance findFieldByAttribute() with prefix-based lookups
- Update getFieldValue() to check multiple attribute formats
- Update handleFieldChanged() to cache both full and base attributes

Resolves #2
- Add matching flexible field resolution from FormField component
- Implement getFlexibleContextPrefix() for context detection
- Implement getFlexibleAttributeFormats() for pattern matching
- Implement getAllFields() for parent component traversal
- Update findFieldByAttribute() with prefix-based lookups

Resolves #2
- Create docs/flexible-field-support.md with comprehensive guide
- Document usage patterns for nova-flexible-content integration
- Explain context-aware attribute resolution mechanism
- Document supported attribute format patterns
- Include limitations and troubleshooting sections
- Add Flexible Field Support to features list in README
- Add usage example for nova-flexible-content integration
- Link to detailed flexible field documentation
- Update CHANGELOG with v1.0.5 release notes
- Document all new methods and technical changes
@iamgerwin iamgerwin merged commit 49b4f5a into main Nov 25, 2025
2 checks passed
@iamgerwin iamgerwin deleted the feat/issue-2-flexible-field-support branch November 25, 2025 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NovaDependencyContainer does not work inside Flexible field layouts

1 participant