Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@uiw/github-corners

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/github-corners - npm Package Compare versions

Comparing version
1.5.8
to
1.5.9
+1
-1
lib/index.d.ts

@@ -29,3 +29,3 @@ /// <reference types="react" />

transform?: string;
warpper?: HTMLElement;
private shadow;
static get observedAttributes(): string[];

@@ -32,0 +32,0 @@ constructor();

@@ -27,9 +27,11 @@ const TEMPLATE = document.createElement("template");

</style>
<a id="warpper">
<svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true" style="fill: rgb(21, 21, 19); color: rgb(255, 255, 255); position: absolute; border: 0px; top: 0px;">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" class="octo-arm" style="transform-origin: 130px 106px;"></path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
</svg>
</a>
<svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true" style="position: absolute; border: 0px; top: 0px;">
<a xlink:href="https://github.com/uiwjs/react-github-corners" target="_blank" rel="nofollow sponsored" style="fill: rgb(21, 21, 19); color: rgb(255, 255, 255);">
<g>
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" class="octo-arm" style="transform-origin: 130px 106px;"></path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
</g>
</a>
</svg>
`;

@@ -46,9 +48,8 @@ export class GithubCorners extends HTMLElement {

initDom() {
const shadow = this.attachShadow({ mode: 'open' });
shadow.appendChild(this.ownerDocument.importNode(TEMPLATE.content, true));
this.warpper = shadow.getElementById('warpper');
this.shadow = this.attachShadow({ mode: 'open' });
this.shadow.appendChild(this.ownerDocument.importNode(TEMPLATE.content, true));
this.update();
}
update() {
const svg = this.warpper.querySelector('svg');
const svg = this.shadow.querySelector('svg');
[...this.getAttributeNames(), 'right'].forEach((name) => {

@@ -60,3 +61,3 @@ const value = this.getAttribute(name) || this[name] || '';

else {
this.warpper.setAttribute(name, value);
svg.setAttribute(name, value);
}

@@ -63,0 +64,0 @@ });

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;AACpD,QAAQ,CAAC,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCpB,CAAC;AAEF,MAAM,OAAO,aAAc,SAAQ,WAAW;IAmB5C;QACE,KAAK,EAAE,CAAC;QARV,UAAK,GAAY,GAAG,CAAC;QASnB,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAND,MAAM,KAAK,kBAAkB;QAC3B,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;IACtI,CAAC;IAKO,OAAO;QACb,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QAC1E,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAEhD,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IACO,MAAM;QACZ,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAC5C;QAAA,CAAC,GAAG,IAAI,CAAC,iBAAiB,EAAE,EAAE,OAAO,CAAC,CAAC,OAAO,CA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AAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IACO,MAAM;QACZ,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAC3C;QAAA,CAAC,GAAG,IAAI,CAAC,iBAAiB,EAAE,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACvD,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAA2B,CAAQ,IAAI,EAAE,CAAC;YACxF,IAAI,4EAA4E,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,EAAE;gBAC/G,GAAG,CAAC,KAAK,CAAC,IAAW,CAAC,GAAG,KAAK,CAAC;aAChC;iBAAM;gBACL,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;aAC/B;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACD,iBAAiB;QACf,IAAI,CAAC,MAAM,EAAE,CAAA;IACf,CAAC;IACD,wBAAwB,CAAC,IAAY,EAAE,QAAgB,EAAE,QAAgB;QACvE,IAAI,CAAC,MAAM,EAAE,CAAA;IACf,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC"}
{
"name": "@uiw/github-corners",
"version": "1.5.8",
"version": "1.5.9",
"description": "Add a Github corner to your project page, This GitHub corners for web component.",

@@ -5,0 +5,0 @@ "type": "module",

@@ -45,3 +45,3 @@ @uiw/github-corners

```html
<github-corners></github-corners>
<github-corners target="__blank" position="fixed" href="https://github.com/uiwjs/react-github-corners"></github-corners>
```

@@ -59,3 +59,3 @@

return (
<github-corners></github-corners>
<github-corners target="__blank" position="fixed" href="https://github.com/uiwjs/react-github-corners"></github-corners>
);

@@ -77,2 +77,2 @@ }

Licensed under the MIT License.
Licensed under the MIT License.

@@ -40,9 +40,11 @@ declare global {

</style>
<a id="warpper">
<svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true" style="fill: rgb(21, 21, 19); color: rgb(255, 255, 255); position: absolute; border: 0px; top: 0px;">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" class="octo-arm" style="transform-origin: 130px 106px;"></path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
</svg>
</a>
<svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true" style="position: absolute; border: 0px; top: 0px;">
<a xlink:href="https://github.com/uiwjs/react-github-corners" target="_blank" rel="nofollow sponsored" style="fill: rgb(21, 21, 19); color: rgb(255, 255, 255);">
<g>
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" class="octo-arm" style="transform-origin: 130px 106px;"></path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
</g>
</a>
</svg>
`;

@@ -65,3 +67,3 @@

transform?: string;
warpper?: HTMLElement;
private shadow: ShadowRoot
static get observedAttributes(): string[] {

@@ -75,10 +77,8 @@ return ['z-index', 'target', 'height', 'width', 'href', 'color', 'fill', 'position', 'top', 'left', 'right', 'bottom', 'transform'];

private initDom() {
const shadow = this.attachShadow({ mode: 'open' });
shadow.appendChild(this.ownerDocument.importNode(TEMPLATE.content, true));
this.warpper = shadow.getElementById('warpper');
this.shadow = this.attachShadow({ mode: 'open' });
this.shadow.appendChild(this.ownerDocument.importNode(TEMPLATE.content, true));
this.update();
}
private update() {
const svg = this.warpper.querySelector('svg')
const svg = this.shadow.querySelector('svg')
;[...this.getAttributeNames(), 'right'].forEach((name) => {

@@ -89,3 +89,3 @@ const value = this.getAttribute(name) || this[name as keyof GithubCorners] as any || '';

} else {
this.warpper.setAttribute(name, value);
svg.setAttribute(name, value);
}

@@ -92,0 +92,0 @@ });