@dicebear/core 5.0.0-alpha.29 → 5.0.0-alpha.31

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/lib/core.js CHANGED
@@ -34,10 +34,9 @@ export function createAvatar(style, options = {}) {
34
34
  // Reduces the occurrence of ID collisions when rendering multiple avatars on one HTML page.
35
35
  result.body = svgUtils.randomizeIds(result, prng.seed);
36
36
  const attributes = svgUtils.createAttrString(result);
37
- const description = '<desc>Created with dicebear.com</desc>';
38
37
  const metadata = license.xml(style);
39
38
  const exif = license.exif(style);
40
- const avatar = `<svg ${attributes}>${description}${metadata}${result.body}</svg>`;
39
+ const avatar = `<svg ${attributes}>${metadata}${result.body}</svg>`;
41
40
  return {
42
41
  toString: () => avatar,
43
42
  ...toFormat(avatar, 'svg'),
@@ -1,19 +1,27 @@
1
1
  import * as _ from './escape.js';
2
2
  export function xml(style) {
3
- var _a, _b, _c, _d;
4
- const xmlTitle = `<dc:title>${_.xml((_a = style.meta.title) !== null && _a !== void 0 ? _a : 'Unnamed')}</dc:title>`;
3
+ var _a, _b, _c, _d, _e;
4
+ const title = (_a = style.meta.title) !== null && _a !== void 0 ? _a : 'Unnamed';
5
+ const creator = (_b = style.meta.creator) !== null && _b !== void 0 ? _b : 'Unknown';
6
+ let description = `"${title}" by "${creator}"`;
7
+ if ((_c = style.meta.license) === null || _c === void 0 ? void 0 : _c.name) {
8
+ description += `, licensed under "${style.meta.license.name}".`;
9
+ }
10
+ description += ' / Remix of the original. - Created with dicebear.com';
11
+ const xmlTitle = `<dc:title>${_.xml(title)}</dc:title>`;
5
12
  const xmlCreator = '<dc:creator>' +
6
- `<cc:Agent rdf:about="${_.xml((_b = style.meta.homepage) !== null && _b !== void 0 ? _b : '')}">` +
7
- `<dc:title>${_.xml((_c = style.meta.creator) !== null && _c !== void 0 ? _c : 'Unknown')}</dc:title>` +
13
+ `<cc:Agent rdf:about="${_.xml((_d = style.meta.homepage) !== null && _d !== void 0 ? _d : '')}">` +
14
+ `<dc:title>${_.xml(creator)}</dc:title>` +
8
15
  '</cc:Agent>' +
9
16
  '</dc:creator>';
10
17
  const xmlSource = style.meta.source
11
18
  ? `<dc:source>${_.xml(style.meta.source)}</dc:source>`
12
19
  : '';
13
- const xmlLicense = ((_d = style.meta.license) === null || _d === void 0 ? void 0 : _d.url)
20
+ const xmlLicense = ((_e = style.meta.license) === null || _e === void 0 ? void 0 : _e.url)
14
21
  ? `<cc:license rdf:resource="${_.xml(style.meta.license.url)}" />`
15
22
  : '';
16
- return ('<metadata' +
23
+ return (`<desc>${description}</desc>` +
24
+ '<metadata' +
17
25
  ' xmlns:dc="http://purl.org/dc/elements/1.1/"' +
18
26
  ' xmlns:cc="http://creativecommons.org/ns#"' +
19
27
  ' xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">' +
@@ -33,9 +41,11 @@ export function exif(style) {
33
41
  const creator = (_b = style.meta.creator) !== null && _b !== void 0 ? _b : 'Unknown';
34
42
  let copyright = `"${title}" by "${creator}"`;
35
43
  if ((_c = style.meta.license) === null || _c === void 0 ? void 0 : _c.name) {
36
- copyright += ` is licensed under "${style.meta.license.name}".`;
44
+ copyright += `, licensed under "${style.meta.license.name}".`;
37
45
  }
46
+ copyright += ' / Remix of the original.';
38
47
  const exif = {
48
+ ImageDescription: `${copyright} - Created with dicebear.com`,
39
49
  Copyright: copyright,
40
50
  'XMP-dc:Title': title,
41
51
  'XMP-dc:Creator': creator,
@@ -28,5 +28,7 @@ export function merge(style, options) {
28
28
  ...defaults(style.schema),
29
29
  ...options,
30
30
  };
31
- return result;
31
+ // Return a complete copy because the styles could partially customize the
32
+ // options and thus modify nested objects and arrays.
33
+ return JSON.parse(JSON.stringify(result));
32
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dicebear/core",
3
- "version": "5.0.0-alpha.29",
3
+ "version": "5.0.0-alpha.31",
4
4
  "description": "An avatar library for designers and developers.",
5
5
  "keywords": [
6
6
  "avatar",
@@ -31,7 +31,7 @@
31
31
  "test": "uvu tests"
32
32
  },
33
33
  "dependencies": {
34
- "@dicebear/converter": "^5.0.0-alpha.29",
34
+ "@dicebear/converter": "^5.0.0-alpha.31",
35
35
  "@types/json-schema": "^7.0.7"
36
36
  },
37
37
  "devDependencies": {
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "775410bda059fa21dcb79b38c72ebadb80896243"
49
+ "gitHead": "088e33eb5bc45d01c9b6350011d973a5bd23bcc8"
50
50
  }