Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@
display: grid;
grid-template-columns: repeat(3, 1fr);
}
`,Sr=()=>{const{settings:t,updateSettings:n}=(0,e.useContext)(ot),{tokens:r,setTokens:a}=(0,e.useContext)(it),{figmaUIApi:l}=(0,e.useContext)(lt),[o,i]=(0,e.useState)("");return e.createElement("form",{onSubmit:e=>{if(e.preventDefault(),!0===e.target.checkValidity()){const{accessToken:e}=t,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(t,["accessToken"]);l.postMessage({pluginMessage:{command:at.saveSettings,payload:{settings:n,accessToken:e}}},"*");const i=pr(r,n);a(i),zr(parent,{url:t.serverUrl,accessToken:t.accessToken,acceptHeader:t.acceptHeader,contentType:t.contentType,authType:t.authType,reference:t.reference},{event_type:t.eventType,client_payload:{tokens:`${gr(i,t.urlJsonCompression)}`,filename:`${t.filename}${t.extension}`,commitMessage:`${o}`}})}},className:Cr},e.createElement(tt,{size:"xlarge",weight:"bold"},"URL Export settings"),e.createElement(pt,null,e.createElement(We,{label:"Compress JSON output",type:"switch",checked:t.urlJsonCompression,onChange:e=>n((t=>{t.urlJsonCompression=e}))}),e.createElement(Be,{width:240,label:"Compression removes line breaks and whitespace from the json string"})),e.createElement(ht,null),e.createElement(tt,{size:"xlarge",weight:"bold"},"Server settings"),e.createElement("h3",null,"Event type",e.createElement(Be,{width:150,label:'"event_type" property in post request'})),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"^[\\w\\-\\.\\+@]+$",placeholder:"update-tokens",value:t.eventType,onChange:e=>n((t=>{t.eventType=e}))})),e.createElement("h3",null,"Server url",e.createElement(Be,{width:150,label:"Url the request is sent to, must be https"})),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"^https://.*",placeholder:(t.authType===ut.key.authType.gitlabCommit?"https://gitlab.com/api/v4/projects/:projectId":t.authType===ut.key.authType.githubCommit&&"https://github.com/:username/:repo or https://api.github.com/repos/:username/:repo")||"https://api.github.com/repos/:username/:repo/dispatches",value:t.serverUrl,onChange:e=>n((t=>{t.serverUrl=e}))})),e.createElement("h3",null,"Accept header"),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"\\S+",placeholder:"application/vnd.github.v3+json",value:t.acceptHeader,onChange:e=>n((t=>{t.acceptHeader=e}))})),e.createElement("h3",null,"Content-Type header"),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"\\S+",placeholder:"text/plain;charset=UTF-8",value:t.contentType,onChange:e=>n((t=>{t.contentType=e}))})),e.createElement("h3",null,"Auth type"),e.createElement(pt,{fill:!0},e.createElement(Ye,{defaultValue:t.authType,onChange:({value:e})=>n((t=>{t.authType=e})),placeholder:"Auth type",options:[{label:"(Github) token",value:ut.key.authType.token},{label:"(Github) Direct Commit",value:ut.key.authType.githubCommit},{label:"(Gitlab) token",value:ut.key.authType.gitlabToken},{label:"(Gitlab) Project Token",value:ut.key.authType.gitlabCommit},{label:"Basic authentication",value:ut.key.authType.basic},{label:"Bearer token authentication",value:ut.key.authType.bearer}]})),e.createElement("h3",null,"Access token"),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"\\S+",placeholder:"Your access token",value:t.accessToken,onChange:e=>n((t=>{t.accessToken=e}))})),t.authType===ut.key.authType.gitlabToken&&e.createElement(e.Fragment,null,e.createElement("h3",null,"Reference",e.createElement(Be,{width:150,label:'The branch or commit to associate with a Gitlab trigger. Only used when Gitlab is selected for "Auth type"'})),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"\\S+",placeholder:"main",value:t.reference,onChange:e=>n((t=>{t.reference=e}))}))),ut.key.authType.githubCommit===t.authType&&e.createElement(e.Fragment,null,e.createElement("h3",null,"Branch",e.createElement(Be,{width:150,label:'The branch where the file will be committed. Only used when Github Direct Commit is selected for "Auth type"'})),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"\\S+",placeholder:"main",value:t.reference,onChange:e=>n((t=>{t.reference=e}))}))),ut.key.authType.gitlabCommit===t.authType&&e.createElement(e.Fragment,null,e.createElement("h3",null,"Branch",e.createElement(Be,{width:150,label:'The branch where the file will be committed. Only used when Gitlab Project selected for "Auth type"'})),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"\\S+",placeholder:"main",value:t.reference,onChange:e=>n((t=>{t.reference=e}))}))),e.createElement(ht,null),e.createElement(tt,{size:"xlarge",weight:"bold"},"About This Export"),e.createElement("h3",null,"Commit Message",e.createElement(Be,{width:200,label:'Typically this will be a "commit message" for Git. Your organization may require a specific convention for these messages.'})),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",placeholder:"Describe what has changed since the last export",value:o,onChange:e=>i(e)})),e.createElement(dt,null,e.createElement(vt,{align:"start",href:"https://github.com/lukasoppermann/design-tokens#design-tokens"},"Documentation"),e.createElement(st,null),e.createElement(He,{type:"submit",autofocus:!0},"Save & Export")))},_r=parent,Mr=De`
`,Sr=()=>{const{settings:t,updateSettings:n}=(0,e.useContext)(ot),{tokens:r,setTokens:a}=(0,e.useContext)(it),{figmaUIApi:l}=(0,e.useContext)(lt),[o,i]=(0,e.useState)("");return e.createElement("form",{onSubmit:e=>{if(e.preventDefault(),!0===e.target.checkValidity()){const{accessToken:e}=t,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(t,["accessToken"]);l.postMessage({pluginMessage:{command:at.saveSettings,payload:{settings:n,accessToken:e}}},"*");const i=pr(r,n);a(i),zr(parent,{url:t.serverUrl,accessToken:t.accessToken,acceptHeader:t.acceptHeader,contentType:t.contentType,authType:t.authType,reference:t.reference},{event_type:t.eventType,client_payload:{tokens:`${gr(i,t.urlJsonCompression)}`,filename:`${t.filename}${t.extension}`,commitMessage:`${o}`}})}},className:Cr},e.createElement(tt,{size:"xlarge",weight:"bold"},"URL Export settings"),e.createElement(pt,null,e.createElement(We,{label:"Compress JSON output",type:"switch",checked:t.urlJsonCompression,onChange:e=>n((t=>{t.urlJsonCompression=e}))}),e.createElement(Be,{width:240,label:"Compression removes line breaks and whitespace from the json string"}),"standard"===t.tokenFormat&&e.createElement(e.Fragment,null,e.createElement(We,{label:"Exclude extension property",type:"switch",checked:t.excludeExtensionProp,onChange:e=>n((t=>{t.excludeExtensionProp=e}))}),e.createElement(Be,{width:240,label:"The extension property holds additional information about the token"}))),e.createElement(ht,null),e.createElement(tt,{size:"xlarge",weight:"bold"},"Server settings"),e.createElement("h3",null,"Event type",e.createElement(Be,{width:150,label:'"event_type" property in post request'})),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"^[\\w\\-\\.\\+@]+$",placeholder:"update-tokens",value:t.eventType,onChange:e=>n((t=>{t.eventType=e}))})),e.createElement("h3",null,"Server url",e.createElement(Be,{width:150,label:"Url the request is sent to, must be https"})),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"^https://.*",placeholder:(t.authType===ut.key.authType.gitlabCommit?"https://gitlab.com/api/v4/projects/:projectId":t.authType===ut.key.authType.githubCommit&&"https://github.com/:username/:repo or https://api.github.com/repos/:username/:repo")||"https://api.github.com/repos/:username/:repo/dispatches",value:t.serverUrl,onChange:e=>n((t=>{t.serverUrl=e}))})),e.createElement("h3",null,"Accept header"),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"\\S+",placeholder:"application/vnd.github.v3+json",value:t.acceptHeader,onChange:e=>n((t=>{t.acceptHeader=e}))})),e.createElement("h3",null,"Content-Type header"),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"\\S+",placeholder:"text/plain;charset=UTF-8",value:t.contentType,onChange:e=>n((t=>{t.contentType=e}))})),e.createElement("h3",null,"Auth type"),e.createElement(pt,{fill:!0},e.createElement(Ye,{defaultValue:t.authType,onChange:({value:e})=>n((t=>{t.authType=e})),placeholder:"Auth type",options:[{label:"(Github) token",value:ut.key.authType.token},{label:"(Github) Direct Commit",value:ut.key.authType.githubCommit},{label:"(Gitlab) token",value:ut.key.authType.gitlabToken},{label:"(Gitlab) Project Token",value:ut.key.authType.gitlabCommit},{label:"Basic authentication",value:ut.key.authType.basic},{label:"Bearer token authentication",value:ut.key.authType.bearer}]})),e.createElement("h3",null,"Access token"),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"\\S+",placeholder:"Your access token",value:t.accessToken,onChange:e=>n((t=>{t.accessToken=e}))})),t.authType===ut.key.authType.gitlabToken&&e.createElement(e.Fragment,null,e.createElement("h3",null,"Reference",e.createElement(Be,{width:150,label:'The branch or commit to associate with a Gitlab trigger. Only used when Gitlab is selected for "Auth type"'})),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"\\S+",placeholder:"main",value:t.reference,onChange:e=>n((t=>{t.reference=e}))}))),ut.key.authType.githubCommit===t.authType&&e.createElement(e.Fragment,null,e.createElement("h3",null,"Branch",e.createElement(Be,{width:150,label:'The branch where the file will be committed. Only used when Github Direct Commit is selected for "Auth type"'})),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"\\S+",placeholder:"main",value:t.reference,onChange:e=>n((t=>{t.reference=e}))}))),ut.key.authType.gitlabCommit===t.authType&&e.createElement(e.Fragment,null,e.createElement("h3",null,"Branch",e.createElement(Be,{width:150,label:'The branch where the file will be committed. Only used when Gitlab Project selected for "Auth type"'})),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",required:!0,pattern:"\\S+",placeholder:"main",value:t.reference,onChange:e=>n((t=>{t.reference=e}))}))),e.createElement(ht,null),e.createElement(tt,{size:"xlarge",weight:"bold"},"About This Export"),e.createElement("h3",null,"Commit Message",e.createElement(Be,{width:200,label:'Typically this will be a "commit message" for Git. Your organization may require a specific convention for these messages.'})),e.createElement(pt,{fill:!0},e.createElement(Ge,{type:"text",placeholder:"Describe what has changed since the last export",value:o,onChange:e=>i(e)})),e.createElement(dt,null,e.createElement(vt,{align:"start",href:"https://github.com/lukasoppermann/design-tokens#design-tokens"},"Documentation"),e.createElement(st,null),e.createElement(He,{type:"submit",autofocus:!0},"Save & Export")))},_r=parent,Mr=De`
padding: 8px var(--size-xxsmall) 0;
margin-bottom: 0;
form {
Expand Down
Loading