@sharadox/metadata-web-library 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +22 -22
- package/README.md +1 -1
- package/distribution/manifest/index.d.ts +1 -1
- package/distribution/manifest/index.js +1 -1
- package/distribution/manifest/type.d.ts +1 -1
- package/distribution/manifest/type.d.ts.map +1 -1
- package/distribution/share-image/index.d.ts +2 -1
- package/distribution/share-image/index.d.ts.map +1 -1
- package/distribution/share-image/index.js +5 -3
- package/distribution/share-image/index.js.map +1 -1
- package/distribution/share-image/type.d.ts +1 -0
- package/distribution/share-image/type.d.ts.map +1 -1
- package/llms.txt +1 -1
- package/package.json +2 -2
package/LICENSE.md
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
# Sharadox Open Source
|
|
1
|
+
# Sharadox Open Source License
|
|
2
2
|
|
|
3
3
|
Version 0.1.0
|
|
4
4
|
|
|
5
|
-
This is an informative English translation. The Portuguese text (`LICENCA.md`) is the only original and binding text of this
|
|
5
|
+
This is an informative English translation. The Portuguese text (`LICENCA.md`) is the only original and binding text of this license; if the two differ, the Portuguese text prevails.
|
|
6
6
|
|
|
7
7
|
## 1. Definitions
|
|
8
8
|
|
|
9
|
-
For the purposes of this
|
|
9
|
+
For the purposes of this license:
|
|
10
10
|
|
|
11
|
-
1. **"Work"** — the computer program, its documentation and any other content made available by the Licensor under this
|
|
11
|
+
1. **"Work"** — the computer program, its documentation and any other content made available by the Licensor under this license, in source code or in any other form.
|
|
12
12
|
2. **"Licensor"** — the copyright holder identified in the copyright notice that accompanies the Work.
|
|
13
|
-
3. **"Licensee"** — any natural or legal person exercising the rights granted by this
|
|
13
|
+
3. **"Licensee"** — any natural or legal person exercising the rights granted by this license.
|
|
14
14
|
4. **"Derivative Work"** — any work based on or incorporating the Work, in whole or in part, with or without modifications, including translations, adaptations and programs that integrate it.
|
|
15
|
-
5. **"Notice"** — the Licensor's copyright notice and the statement that the Work is licensed under this
|
|
15
|
+
5. **"Notice"** — the Licensor's copyright notice and the statement that the Work is licensed under this license, including its version.
|
|
16
16
|
|
|
17
17
|
## 2. Grant of rights
|
|
18
18
|
|
|
19
|
-
1. Under this
|
|
19
|
+
1. Under this license, the Licensor grants the Licensee a worldwide, royalty-free, non-exclusive license, for the whole term of copyright protection, to:
|
|
20
20
|
1. use the Work for any purpose, including commercial purposes;
|
|
21
21
|
2. reproduce the Work, in whole or in part, by any means and in any form;
|
|
22
22
|
3. modify, translate, adapt and transform the Work and create Derivative Works;
|
|
23
23
|
4. distribute, publish, communicate to the public, make available, sell and sublicense the Work and Derivative Works.
|
|
24
|
-
2. To the extent the Licensor holds patents necessarily infringed by the Work as made available by it, the Licensor also grants the Licensee, on the same terms, a
|
|
25
|
-
3. This
|
|
24
|
+
2. To the extent the Licensor holds patents necessarily infringed by the Work as made available by it, the Licensor also grants the Licensee, on the same terms, a license to use those patents in exercising the rights in the previous paragraph.
|
|
25
|
+
3. This license does not transfer ownership of any rights, which remain with the Licensor.
|
|
26
26
|
|
|
27
27
|
## 3. Conditions
|
|
28
28
|
|
|
29
29
|
The exercise of the rights granted is subject to the following conditions:
|
|
30
30
|
|
|
31
|
-
1. Every copy of the Work, or of substantial parts of it, and every distributed Derivative Work must include the Notice and a copy of this
|
|
31
|
+
1. Every copy of the Work, or of substantial parts of it, and every distributed Derivative Work must include the Notice and a copy of this license or a stable link to its text.
|
|
32
32
|
2. Anyone distributing a modified version of the Work must state visibly that it has been modified and may not present it as the Licensor's original version.
|
|
33
|
-
3. The Licensee may license their own modifications under other terms, provided the part of the Work included in them remains subject to the conditions of this
|
|
33
|
+
3. The Licensee may license their own modifications under other terms, provided the part of the Work included in them remains subject to the conditions of this license.
|
|
34
34
|
|
|
35
35
|
## 4. Names and trademarks
|
|
36
36
|
|
|
37
|
-
This
|
|
37
|
+
This license grants no rights to the Licensor's name, trademarks, logos or other distinctive signs, including the name "Sharadox", except as strictly necessary to comply with the duty to include the Notice. Using them to promote or suggest the Licensor's endorsement of Derivative Works or of any products or services without prior written permission is prohibited.
|
|
38
38
|
|
|
39
39
|
## 5. Disclaimer of warranties
|
|
40
40
|
|
|
@@ -43,29 +43,29 @@ The Work is provided "as is" and "as available", without any warranty, express o
|
|
|
43
43
|
## 6. Limitation of liability
|
|
44
44
|
|
|
45
45
|
1. To the maximum extent permitted by applicable law, the Licensor is not liable for any damages, direct or indirect, including loss of profits, loss of data or business interruption, arising from the use of or inability to use the Work, even if advised of the possibility of such damages.
|
|
46
|
-
2. Nothing in this
|
|
46
|
+
2. Nothing in this license excludes or limits the Licensor's liability where such exclusion or limitation is not permitted by law, in particular for acts committed with intent or gross negligence, under article 809 and article 800(2) of the Portuguese Civil Code, nor does it affect rights that the law mandatorily grants to consumers.
|
|
47
47
|
|
|
48
48
|
## 7. Termination
|
|
49
49
|
|
|
50
|
-
1. The rights granted by this
|
|
50
|
+
1. The rights granted by this license terminate automatically if the Licensee breaches any of its conditions.
|
|
51
51
|
2. The rights are reinstated if the breach is remedied within 30 days of the Licensee becoming aware of it, unless the Licensor has meanwhile objected in writing.
|
|
52
|
-
3. Termination does not affect
|
|
52
|
+
3. Termination does not affect licenses validly granted by the Licensee to third parties who comply with this license.
|
|
53
53
|
|
|
54
54
|
## 8. Governing law and jurisdiction
|
|
55
55
|
|
|
56
|
-
1. This
|
|
57
|
-
2. The Judicial Court of the District of Faro has jurisdiction over any dispute arising from this
|
|
56
|
+
1. This license is governed by Portuguese law, in particular the Code of Copyright and Related Rights, approved by Decree-Law no. 63/85 of 14 March, and Decree-Law no. 252/94 of 20 October on the legal protection of computer programs.
|
|
57
|
+
2. The Judicial Court of the District of Faro has jurisdiction over any dispute arising from this license, without prejudice to applicable mandatory rules of jurisdiction, in particular those protecting consumers.
|
|
58
58
|
|
|
59
|
-
## 9.
|
|
59
|
+
## 9. License versions
|
|
60
60
|
|
|
61
|
-
The Licensor may publish new versions of this
|
|
61
|
+
The Licensor may publish new versions of this license, identified by a version number. The Work is subject to the version stated in the Notice. If the Notice allows it, the Licensee may choose any later version.
|
|
62
62
|
|
|
63
63
|
## 10. Final provisions
|
|
64
64
|
|
|
65
|
-
1. If any provision of this
|
|
66
|
-
2. Failure to enforce any provision of this
|
|
65
|
+
1. If any provision of this license is held invalid or unenforceable, the remaining provisions stay in force, and the affected provision shall be interpreted as closely as possible to its original intent.
|
|
66
|
+
2. Failure to enforce any provision of this license at any time does not waive the right to enforce it later.
|
|
67
67
|
|
|
68
|
-
## How to apply this
|
|
68
|
+
## How to apply this license
|
|
69
69
|
|
|
70
70
|
Include in the Work a `LICENCA.md` file with the Portuguese text, this translation as `LICENSE.md`, and the following notice, filling in the year and holder:
|
|
71
71
|
|
package/README.md
CHANGED
|
@@ -71,6 +71,6 @@ export default async function Image() {
|
|
|
71
71
|
|
|
72
72
|
`pnpm verify` runs formatting, lint, type-check, tests with 100% coverage and the build. Branches follow `<feature>.development` → `development` → `index`, and releases are `v<version>` tags on `index`.
|
|
73
73
|
|
|
74
|
-
##
|
|
74
|
+
## License
|
|
75
75
|
|
|
76
76
|
Licença Sharadox de Código Aberto, versão 0.1.0. See [português](LICENCA.md) (the binding text) and the [English translation](LICENSE.md).
|
|
@@ -4,7 +4,7 @@ import type { WebManifestOptions } from "@sharadox/metadata-web-library/manifest
|
|
|
4
4
|
export declare const DEFAULT_ICONS: NonNullable<WebManifestOptions["icons"]>;
|
|
5
5
|
/**
|
|
6
6
|
* The web app manifest of an installable, online-only site: it opens in its own window (`standalone`), with a
|
|
7
|
-
* stable id, its
|
|
7
|
+
* stable id, its colors and icons. No service worker or offline support is involved.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* // src/app/manifest.ts
|
|
@@ -7,7 +7,7 @@ export const DEFAULT_ICONS = [
|
|
|
7
7
|
];
|
|
8
8
|
/**
|
|
9
9
|
* The web app manifest of an installable, online-only site: it opens in its own window (`standalone`), with a
|
|
10
|
-
* stable id, its
|
|
10
|
+
* stable id, its colors and icons. No service worker or offline support is involved.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* // src/app/manifest.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/manifest/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0GAA0G;IAC1G,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/manifest/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0GAA0G;IAC1G,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,GAAG,UAAU,GAAG,YAAY,CAAA;KAAE,EAAE,CAAC;CACrG"}
|
|
@@ -6,7 +6,8 @@ export declare const SHARE_IMAGE_SIZE: {
|
|
|
6
6
|
readonly height: 630;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
|
-
* Renders a share card (Open Graph and Twitter image) from JSX
|
|
9
|
+
* Renders a share card (Open Graph and Twitter image) from JSX as a PNG response, with the given fonts or, without
|
|
10
|
+
* any, Next.js's built-in default font. Use it in
|
|
10
11
|
* `opengraph-image.tsx` and `twitter-image.tsx`; the design stays in the site's own library.
|
|
11
12
|
*
|
|
12
13
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/share-image/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAE5G,oDAAoD;AACpD,eAAO,MAAM,gBAAgB;;;CAAwC,CAAC;AAEtE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/share-image/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAE5G,oDAAoD;AACpD,eAAO,MAAM,gBAAgB;;;CAAwC,CAAC;AAEtE;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,iBAAiB,EAC1B,EAAE,KAA8B,EAAE,MAAgC,EAAE,KAAK,EAAE,GAAE,iBAAsB,GAClG,aAAa,CAGf"}
|
|
@@ -2,7 +2,8 @@ import { ImageResponse } from "next/og";
|
|
|
2
2
|
/** The size Open Graph and Twitter cards expect. */
|
|
3
3
|
export const SHARE_IMAGE_SIZE = { width: 1200, height: 630 };
|
|
4
4
|
/**
|
|
5
|
-
* Renders a share card (Open Graph and Twitter image) from JSX
|
|
5
|
+
* Renders a share card (Open Graph and Twitter image) from JSX as a PNG response, with the given fonts or, without
|
|
6
|
+
* any, Next.js's built-in default font. Use it in
|
|
6
7
|
* `opengraph-image.tsx` and `twitter-image.tsx`; the design stays in the site's own library.
|
|
7
8
|
*
|
|
8
9
|
* @example
|
|
@@ -10,7 +11,8 @@ export const SHARE_IMAGE_SIZE = { width: 1200, height: 630 };
|
|
|
10
11
|
* return shareImage(<div style={{ display: "flex" }}>Sharadox</div>, { fonts: [{ name: "Geist", data: font }] });
|
|
11
12
|
* }
|
|
12
13
|
*/
|
|
13
|
-
export function shareImage(element, { width = SHARE_IMAGE_SIZE.width, height = SHARE_IMAGE_SIZE.height, fonts
|
|
14
|
-
|
|
14
|
+
export function shareImage(element, { width = SHARE_IMAGE_SIZE.width, height = SHARE_IMAGE_SIZE.height, fonts } = {}) {
|
|
15
|
+
// An empty font list would replace the default font and leave nothing to lay text out with.
|
|
16
|
+
return new ImageResponse(element, fonts?.length ? { width, height, fonts } : { width, height });
|
|
15
17
|
}
|
|
16
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/share-image/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,oDAAoD;AACpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAW,CAAC;AAEtE
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/share-image/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,oDAAoD;AACpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAW,CAAC;AAEtE;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CACxB,OAA0B,EAC1B,EAAE,KAAK,GAAG,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAAC,MAAM,EAAE,KAAK,KAAwB,EAAE;IAEnG,4FAA4F;IAC5F,OAAO,IAAI,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AAClG,CAAC"}
|
|
@@ -10,6 +10,7 @@ export interface ShareImageOptions {
|
|
|
10
10
|
/** 1200×630 by default, the size Open Graph and Twitter cards expect. */
|
|
11
11
|
width?: number;
|
|
12
12
|
height?: number;
|
|
13
|
+
/** Next.js's built-in default font when none are given. */
|
|
13
14
|
fonts?: ShareImageFont[];
|
|
14
15
|
}
|
|
15
16
|
export type ShareImageElement = ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/share-image/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC7D,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/share-image/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC7D,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC"}
|
package/llms.txt
CHANGED
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
- `/manifest` webManifest({ name, shortName?, description?, id? = "/", startUrl? = "/", backgroundColor, themeColor, icons? = DEFAULT_ICONS }) → standalone, online-only
|
|
9
9
|
- `/structured-data` <StructuredData data /> ; `/structured-data-graph` structuredDataGraph(...nodes)
|
|
10
10
|
- `/share-image` shareImage(jsx, { width?, height?, fonts? }) → ImageResponse; SHARE_IMAGE_SIZE 1200x630
|
|
11
|
-
- Peer deps: next, react.
|
|
11
|
+
- Peer deps: next, react. License: Sharadox Open Source License 0.1.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sharadox/metadata-web-library",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Everything search engines, share cards and installation need: page metadata, sitemaps, robots rules, web app manifests, JSON-LD structured data and share images for Next.js.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "SEE LICENSE IN LICENCA.md",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"**/*.css"
|
|
32
32
|
],
|
|
33
33
|
"engines": {
|
|
34
|
-
"node": ">=
|
|
34
|
+
"node": ">=26"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|