@arcblock/nft-display 2.6.7 → 2.6.8

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/index.d.ts CHANGED
@@ -38,4 +38,5 @@ export declare const getVerifiableBadge: (id: string) => string;
38
38
  export declare const getChainBadge: (chain: NFTChain, only: boolean, id: string) => string;
39
39
  export declare const getBadgesSvg: (verifiable: boolean, chain: NFTChain, id: string) => string;
40
40
  export declare const getTagSvg: (tag: string, variant: NFTTagVariant, id: string) => string;
41
+ export declare const nanoid: (length?: number) => string;
41
42
  export declare const getSvg: (props: NFTProps) => string;
package/lib/index.js CHANGED
@@ -26,8 +26,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.getSvg = exports.getTagSvg = exports.getBadgesSvg = exports.getChainBadge = exports.getVerifiableBadge = exports.getDidSvg = exports.getExtraSvg = exports.getIssuerSvg = exports.getHeaderSvg = exports.getLayoutSvg = exports.formatDid = void 0;
30
- const nanoid_1 = require("nanoid");
29
+ exports.getSvg = exports.nanoid = exports.getTagSvg = exports.getBadgesSvg = exports.getChainBadge = exports.getVerifiableBadge = exports.getDidSvg = exports.getExtraSvg = exports.getIssuerSvg = exports.getHeaderSvg = exports.getLayoutSvg = exports.formatDid = void 0;
31
30
  const DidMotif = __importStar(require("@arcblock/did-motif"));
32
31
  const color_1 = require("./color");
33
32
  __exportStar(require("./color"), exports);
@@ -811,8 +810,10 @@ const getTagSvg = (tag, variant, id) => {
811
810
  return '';
812
811
  };
813
812
  exports.getTagSvg = getTagSvg;
813
+ const nanoid = (length = 8) => [...Array(length)].map(() => Math.random().toString(36)[2]).join('');
814
+ exports.nanoid = nanoid;
814
815
  const getSvg = (props) => {
815
- const id = props.id || (0, nanoid_1.nanoid)(8);
816
+ const id = props.id || (0, exports.nanoid)(8);
816
817
  const width = props.width || DEFAULT_WIDTH;
817
818
  const height = props.height || DEFAULT_HEIGHT;
818
819
  const color = props.color || color_1.DEFAULT_COLORS[props.variant] || color_1.DEFAULT_COLORS['app-passport'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/nft-display",
3
- "version": "2.6.7",
3
+ "version": "2.6.8",
4
4
  "description": "arcblock's nft display generic component",
5
5
  "keywords": [
6
6
  "nft"
@@ -25,9 +25,8 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@arcblock/did-motif": "^1.1.13",
28
- "@ocap/mcrypto": "^1.18.85",
29
- "@ocap/util": "^1.18.85",
30
- "nanoid": "3"
28
+ "@ocap/mcrypto": "^1.18.88",
29
+ "@ocap/util": "^1.18.88"
31
30
  },
32
31
  "devDependencies": {
33
32
  "@arcblock/eslint-config-ts": "^0.2.4",
@@ -42,5 +41,5 @@
42
41
  "ts-node": "^10.9.1",
43
42
  "typescript": "^5.0.4"
44
43
  },
45
- "gitHead": "fd951940e58edd0fb3dbfaf0999fb0e0fac18a5f"
44
+ "gitHead": "3fa83a839824d393aba4550d3e90660c0c150425"
46
45
  }