michael / michael/svedit

Ability to resuse a node type but style it differently based on the context

Open
#147 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
675
Forks
18
Avg merge
5h 11m
Merged PRs (30d)
1

Description

E.g. currently in editable website v2 I have 'nav_item' and 'footer_link', both have label and href, so it could be the same data element. Though i want to render it differently. I also don't want to control it with diffent layouts within one component. So the structure might be fundamentally different (not just the styling). What is the same is the data structure.

E.g. I could let the parent override the component mapping, so that the FooterColumn component can say that the button type should be mapped from the Button.svelte component to FooterLink.svelte.

<NodeArrayProperty
  path={[...path, 'footer_link_columns']}
  components={ button: 'footer_link' }
/>

Not sure if this is the best, but something similiar would be good. If I used the same type in FooterLink Columns and in the menu nav, you can copy and paste entries between the two areas.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with NodeArrayProperty and inspect how its components mapping is handled. Compare the Button.svelte and FooterLink.svelte components, along with the FooterColumn context described in the issue. Define the supported mapping behavior and verify that one node type can be reused while rendering appropriately in each context.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.