@dicebear/core 7.0.5 → 7.1.1

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <h1><img src="https://dicebear.com/logo-readme.svg" width="28" /> DiceBear</h1>
1
+ <h1><img src="https://www.dicebear.com/logo-readme.svg" width="28" /> DiceBear</h1>
2
2
 
3
3
  <p>
4
4
  <img src="https://api.dicebear.com/6.x/adventurer/svg?seed=Mimi&backgroundColor=0077b6&radius=10" width="64" />
@@ -22,5 +22,5 @@ the countless options that each avatar style provides.
22
22
  And thanks to the JavaScript library, HTTP API, CLI, Figma plugin and
23
23
  Playground, your next avatar is always just a stone's throw away!
24
24
 
25
- [Playground](https://dicebear.com/playground) |
26
- [Documentation](https://dicebear.com/introduction)
25
+ [Playground](https://www.dicebear.com/playground) |
26
+ [Documentation](https://www.dicebear.com/introduction)
@@ -1,3 +1,4 @@
1
1
  import { Exif, Style } from '../types.js';
2
2
  export declare function xml(style: Style<any>): string;
3
+ export declare function text(style: Style<any>): string;
3
4
  export declare function exif(style: Style<any>): Exif;
@@ -1,60 +1,72 @@
1
1
  import * as _ from './escape.js';
2
2
  export function xml(style) {
3
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
4
- const title = (_b = (_a = style.meta) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : 'Unnamed';
5
- const creator = (_d = (_c = style.meta) === null || _c === void 0 ? void 0 : _c.creator) !== null && _d !== void 0 ? _d : 'Unknown';
6
- let description = `"${title}" by "${creator}"`;
7
- if ((_f = (_e = style.meta) === null || _e === void 0 ? void 0 : _e.license) === null || _f === void 0 ? void 0 : _f.name) {
8
- description += `, licensed under "${style.meta.license.name}".`;
3
+ var _a, _b, _c, _d, _e, _f, _g;
4
+ const title = (_a = style.meta) === null || _a === void 0 ? void 0 : _a.title;
5
+ const creator = (_b = style.meta) === null || _b === void 0 ? void 0 : _b.creator;
6
+ const source = (_c = style.meta) === null || _c === void 0 ? void 0 : _c.source;
7
+ const license = (_e = (_d = style.meta) === null || _d === void 0 ? void 0 : _d.license) === null || _e === void 0 ? void 0 : _e.url;
8
+ const rights = text(style);
9
+ if (!title && !creator && !source && !license && !rights) {
10
+ return '';
9
11
  }
10
- description += ' / Remix of the original. - Created with dicebear.com';
11
- const xmlTitle = `<dc:title>${_.xml(title)}</dc:title>`;
12
- const xmlCreator = '<dc:creator>' +
13
- `<cc:Agent rdf:about="${_.xml((_h = (_g = style.meta) === null || _g === void 0 ? void 0 : _g.homepage) !== null && _h !== void 0 ? _h : '')}">` +
14
- `<dc:title>${_.xml(creator)}</dc:title>` +
15
- '</cc:Agent>' +
16
- '</dc:creator>';
17
- const xmlSource = ((_j = style.meta) === null || _j === void 0 ? void 0 : _j.source)
18
- ? `<dc:source>${_.xml(style.meta.source)}</dc:source>`
19
- : '';
20
- const xmlLicense = ((_l = (_k = style.meta) === null || _k === void 0 ? void 0 : _k.license) === null || _l === void 0 ? void 0 : _l.url)
21
- ? `<cc:license rdf:resource="${_.xml(style.meta.license.url)}" />`
22
- : '';
23
- return (`<desc>${description}</desc>` +
24
- '<metadata' +
12
+ // https://nsteffel.github.io/dublin_core_generator/generator.html
13
+ return ('<metadata' +
14
+ ' xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"' +
15
+ ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' +
25
16
  ' xmlns:dc="http://purl.org/dc/elements/1.1/"' +
26
- ' xmlns:cc="http://creativecommons.org/ns#"' +
27
- ' xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">' +
17
+ ' xmlns:dcterms="http://purl.org/dc/terms/">' +
28
18
  '<rdf:RDF>' +
29
- '<cc:Work>' +
30
- xmlTitle +
31
- xmlCreator +
32
- xmlSource +
33
- xmlLicense +
34
- '</cc:Work>' +
19
+ '<rdf:Description>' +
20
+ (title ? `<dc:title>${_.xml(title)}</dc:title>` : '') +
21
+ (creator ? `<dc:creator>${_.xml(creator)}</dc:creator>` : '') +
22
+ (source ? `<dc:source xsi:type="dcterms:URI">${_.xml((_g = (_f = style.meta) === null || _f === void 0 ? void 0 : _f.source) !== null && _g !== void 0 ? _g : '')}</dc:source>` : '') +
23
+ (license ? `<dcterms:license xsi:type="dcterms:URI">${_.xml(license)}</dcterms:license>` : '') +
24
+ (rights ? `<dc:rights>${_.xml(rights)}</dc:rights>` : '') +
25
+ '</rdf:Description>' +
35
26
  '</rdf:RDF>' +
36
27
  '</metadata>');
37
28
  }
38
- export function exif(style) {
39
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
40
- const title = (_b = (_a = style.meta) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : 'Unnamed';
41
- const creator = (_d = (_c = style.meta) === null || _c === void 0 ? void 0 : _c.creator) !== null && _d !== void 0 ? _d : 'Unknown';
42
- let copyright = `"${title}" by "${creator}"`;
43
- if ((_f = (_e = style.meta) === null || _e === void 0 ? void 0 : _e.license) === null || _f === void 0 ? void 0 : _f.name) {
44
- copyright += `, licensed under "${style.meta.license.name}".`;
29
+ export function text(style) {
30
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
31
+ let title = ((_a = style.meta) === null || _a === void 0 ? void 0 : _a.title) ? `„${(_b = style.meta) === null || _b === void 0 ? void 0 : _b.title}”` : 'Design';
32
+ let creator = `„${(_d = (_c = style.meta) === null || _c === void 0 ? void 0 : _c.creator) !== null && _d !== void 0 ? _d : 'Unknown'}”`;
33
+ if ((_e = style.meta) === null || _e === void 0 ? void 0 : _e.source) {
34
+ title += ` (${style.meta.source})`;
45
35
  }
46
- copyright += ' / Remix of the original.';
47
- const exif = {
48
- ImageDescription: `${copyright} - Created with dicebear.com`,
49
- Copyright: copyright,
50
- 'XMP-dc:Title': title,
51
- 'XMP-dc:Creator': creator,
52
- };
53
- if ((_g = style.meta) === null || _g === void 0 ? void 0 : _g.source) {
54
- exif['XMP-dc:Source'] = style.meta.source;
36
+ let result = '';
37
+ if (((_g = (_f = style.meta) === null || _f === void 0 ? void 0 : _f.license) === null || _g === void 0 ? void 0 : _g.name) !== 'MIT' && ((_h = style.meta) === null || _h === void 0 ? void 0 : _h.creator) !== 'DiceBear' && ((_j = style.meta) === null || _j === void 0 ? void 0 : _j.title)) {
38
+ result += 'Remix of ';
55
39
  }
56
- if ((_j = (_h = style.meta) === null || _h === void 0 ? void 0 : _h.license) === null || _j === void 0 ? void 0 : _j.url) {
57
- exif['XMP-cc:License'] = style.meta.license.url;
40
+ result += `${title} by ${creator}`;
41
+ if ((_l = (_k = style.meta) === null || _k === void 0 ? void 0 : _k.license) === null || _l === void 0 ? void 0 : _l.name) {
42
+ result += `, licensed under „${(_o = (_m = style.meta) === null || _m === void 0 ? void 0 : _m.license) === null || _o === void 0 ? void 0 : _o.name}”`;
43
+ if ((_q = (_p = style.meta) === null || _p === void 0 ? void 0 : _p.license) === null || _q === void 0 ? void 0 : _q.url) {
44
+ result += ` (${style.meta.license.url})`;
45
+ }
58
46
  }
59
- return exif;
47
+ return result;
48
+ }
49
+ export function exif(style) {
50
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
51
+ const copyright = text(style);
52
+ // https://www.iptc.org/std/photometadata/specification/IPTC-PhotoMetadata
53
+ // https://developers.google.com/search/docs/appearance/structured-data/image-license-metadata
54
+ return {
55
+ // Title
56
+ 'IPTC:ObjectName': (_a = style.meta) === null || _a === void 0 ? void 0 : _a.title,
57
+ 'XMP-dc:Title': (_b = style.meta) === null || _b === void 0 ? void 0 : _b.title,
58
+ // Copyright
59
+ 'IPTC:CopyrightNotice': copyright,
60
+ 'XMP-dc:Rights': copyright,
61
+ // Creator
62
+ 'IPTC:By-line': (_c = style.meta) === null || _c === void 0 ? void 0 : _c.creator,
63
+ 'XMP-dc:Creator': (_d = style.meta) === null || _d === void 0 ? void 0 : _d.creator,
64
+ // Credit
65
+ 'IPTC:Credit': (_e = style.meta) === null || _e === void 0 ? void 0 : _e.creator,
66
+ 'XMP-photoshop:Credit': (_f = style.meta) === null || _f === void 0 ? void 0 : _f.creator,
67
+ // Licensor
68
+ 'XMP-plus:LicensorURL': (_g = style.meta) === null || _g === void 0 ? void 0 : _g.source,
69
+ // Rights
70
+ 'XMP-xmpRights:WebStatement': (_j = (_h = style.meta) === null || _h === void 0 ? void 0 : _h.license) === null || _j === void 0 ? void 0 : _j.url,
71
+ };
60
72
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@dicebear/core",
3
- "version": "7.0.5",
3
+ "version": "7.1.1",
4
4
  "description": "An avatar library for designers and developers.",
5
5
  "keywords": [
6
6
  "avatar",
7
7
  "identicon"
8
8
  ],
9
- "homepage": "https://dicebear.com",
9
+ "homepage": "https://www.dicebear.com",
10
10
  "bugs": {
11
11
  "url": "https://github.com/dicebear/dicebear/issues"
12
12
  },
@@ -32,7 +32,7 @@
32
32
  "test": "uvu tests"
33
33
  },
34
34
  "dependencies": {
35
- "@dicebear/converter": "7.0.5",
35
+ "@dicebear/converter": "7.1.1",
36
36
  "@types/json-schema": "^7.0.11"
37
37
  },
38
38
  "devDependencies": {
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "644f1f7d23af086cdd17dda5bf64f5c3afa16a64"
50
+ "gitHead": "94b0427038c8d073aefd35f0e886a7782f257582"
51
51
  }