dohomi / storyblok-generate-ts

Generates TypeScript interface types based on Storyblok component file
MIT License
102 stars 33 forks source link

`target` property missing from `MultiLinkStoryBlok` #59

Closed damnsamn closed 9 months ago

damnsamn commented 1 year ago

When a Link field is configured with "Allow links to be open in a new tab", the JSON will contain a "target" attribute containing either "_self" or "_blank".

Example Storyblok content JSON:

"bottom_link": {
    "id": "106ed398-8719-4ffd-b548-7d583b152d3f",
    "url": "",
    "target": "_self",
    "linktype": "story",
    "fieldtype": "multilink",
    "cached_url": "about"
},

The JSON provided by running storyblok pull-components also includes a flag to tell whether this is enabled or not. Example link field:

"bottom_link": {
    "type": "multilink",
    "pos": 12,
    "allow_target_blank": true
},

Can we include some support for an optional "target" key on the MultiLinkStoryBlok type?

yobananaboy15 commented 10 months ago

I created a PR for this:

https://github.com/dohomi/storyblok-generate-ts/pull/61

dohomi commented 9 months ago

released in 2.0.2