Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[esl-anchornav]: beta release version of esl-anchornav module #2578

Open
dshovchko opened this issue Aug 9, 2024 · 2 comments
Open

[esl-anchornav]: beta release version of esl-anchornav module #2578

dshovchko opened this issue Aug 9, 2024 · 2 comments

Comments

@dshovchko
Copy link
Collaborator

dshovchko commented Aug 9, 2024

As ESL consumer, I want to have an anchor navigation component implemented on the ESL side.

API Drafts

Template:

// Register default
ESLAnchornav.setTemplatte(renderer: ESLAnchornavRender);
// Register named renderer
ESLAnchornav.setTemplatte(name: string, renderer: ESLAnchornavRender);

type ESLAnchornavRender = (data: ESLAnchorData) => string | Element;

interface ESLAnchorData {
    id: string;
    title: string;
    // order number in the anchor list
    index: string;
    $anchor: Element;
}
   <esl-anchrnav type?="renderer-alias" role="list">
       <ul esl-anchornav-placeholder><!-- ... renderer output ... --></ul>
   </esl-anchrnav>


  <esl-anchornav role="navigation"> 
     <!-- TODO: marker name to discuss with team -->
    <ul esl-anchornav-content><!-- ... renderer output ... --></ul>
    <ul esl-anchornav-anchors><!-- ... renderer output ... --></ul>
  </esl-anchornav>

Discussion 05.08

Name ~ setRenderer

Notation

  • ESLAnchornav.setRenderer / get

Signature (1.5 : 6, optional) :

static setTemplatte(renderer: ESLAnchornavRender);
static setTemplatte(name: string, renderer: ESLAnchornavRender);
static setTemplatte(name: string | ESLAnchornavRender, renderer: ESLAnchornavRender) {
    if (typeof renderer !== 'string') this.setTemplatte('default', name);
    // Normalized 
}

Expectation from defaults

// pseudo
ESLAnchornav.setRenderer('default', (data) => `<a calss="esl-anchornav-item" href="#${data.id}">${data.title}</a>`);

ESLAnchornav.setRenderer((data) => `<a calss="esl-anchornav-item" href="#${data.id}">${data.title}</a>`);

Attributes:

<esl-anchrnav renderer?="renderer-alias" role="list">
    <ul esl-anchornav-items></ul>
</esl-anchrnav>

Voting:
esl-anchornav-placeholder 1 1 1 0.5 0.5 0.5
esl-anchornav-content 1 1 0 0.5 0 0
esl-anchornav-items 1 1 2 2 2.5 2.5

@dshovchko dshovchko self-assigned this Aug 9, 2024
@dshovchko dshovchko changed the title [esl-anchornav]: (draft) basic implementation [esl-anchornav]: beta release version of esl-anchornav module Aug 9, 2024
@dshovchko dshovchko added this to the ⚡ESL: 5.0.0 Major release milestone Aug 9, 2024
@ala-n
Copy link
Collaborator

ala-n commented Aug 13, 2024

🎉 This issue has been resolved in version 5.0.0-beta.31 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ala-n
Copy link
Collaborator

ala-n commented Sep 30, 2024

🎉 This issue has been resolved in version 5.0.0-beta.36 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants