@visactor/vtable-export 0.16.4-alpha.2 → 0.18.0-alpha.0

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
@@ -5,7 +5,7 @@
5
5
  </div>
6
6
 
7
7
  <div align="center">
8
- <h1>VTable</h1>
8
+ <h1>VTable-Export</h1>
9
9
  </div>
10
10
 
11
11
  <div align="center">
package/cjs/util/color.js CHANGED
@@ -1,5 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.DEFAULT_COLORS = exports.rgbaToHex = exports.colorStringToRGB = void 0;
6
+
7
+ const vutils_1 = require("@visactor/vutils");
8
+
3
9
  function colorStringToRGB(colorString) {
4
10
  if (colorString.startsWith("#")) {
5
11
  let hex = colorString.substring(1);
@@ -12,8 +18,8 @@ function colorStringToRGB(colorString) {
12
18
  if (colorString.startsWith("rgba(")) {
13
19
  return colorString.substring(5, colorString.length - 1).split(",").map(Number);
14
20
  }
15
- if (exports.DEFAULT_COLORS[colorString]) return rgb(exports.DEFAULT_COLORS[colorString]);
16
- if (DEFAULT_COLORS_OPACITY[colorString]) return rgba(DEFAULT_COLORS_OPACITY[colorString]);
21
+ if ((0, vutils_1.isNumber)(exports.DEFAULT_COLORS[colorString])) return rgb(exports.DEFAULT_COLORS[colorString]);
22
+ if ((0, vutils_1.isNumber)(DEFAULT_COLORS_OPACITY[colorString])) return rgba(DEFAULT_COLORS_OPACITY[colorString]);
17
23
  throw new Error("Unsupported color format");
18
24
  }
19
25
 
@@ -31,9 +37,6 @@ function rgba(value) {
31
37
  return [ value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value ];
32
38
  }
33
39
 
34
- Object.defineProperty(exports, "__esModule", {
35
- value: !0
36
- }), exports.DEFAULT_COLORS = exports.rgbaToHex = exports.colorStringToRGB = void 0,
37
40
  exports.colorStringToRGB = colorStringToRGB, exports.rgbaToHex = r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;IAChB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,QAAQ;IACjB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,QAAQ;IACrB,SAAS,EAAE,QAAQ;IACnB,GAAG,EAAE,QAAQ;IACb,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,QAAQ;IACjB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,UAAU,EAAE,QAAQ;IACpB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,QAAQ;CACtB,CAAC","file":"color.js","sourcesContent":["export function colorStringToRGB(colorString: string) {\n if (colorString.startsWith('#')) {\n // 处理十六进制颜色值(例如:#RRGGBB 或 #RGB)\n let hex = colorString.substring(1);\n\n // 处理缩写的十六进制颜色值(例如:#RGB)\n if (hex.length === 3) {\n hex = hex.replace(/(.)/g, '$1$1');\n }\n\n const r = parseInt(hex.substring(0, 2), 16);\n const g = parseInt(hex.substring(2, 4), 16);\n const b = parseInt(hex.substring(4, 6), 16);\n return [r, g, b];\n } else if (colorString.startsWith('rgb(')) {\n // 处理RGB颜色值(例如:rgb(R, G, B))\n const values = colorString\n .substring(4, colorString.length - 1)\n .split(',')\n .map(Number);\n return values;\n } else if (colorString.startsWith('rgba(')) {\n // 处理RGBA颜色值(例如:rgba(R, G, B, A))\n const values = colorString\n .substring(5, colorString.length - 1)\n .split(',')\n .map(Number);\n return values;\n } else if (DEFAULT_COLORS[colorString]) {\n return rgb(DEFAULT_COLORS[colorString]);\n } else if (DEFAULT_COLORS_OPACITY[colorString]) {\n return rgba(DEFAULT_COLORS_OPACITY[colorString]);\n }\n\n throw new Error('Unsupported color format');\n}\n\nexport function rgbaToHex(rgbaArray: number[]) {\n if (rgbaArray.length === 3) {\n rgbaArray.push(1);\n }\n\n if (rgbaArray.length !== 4) {\n throw new Error('Invalid RGBA array');\n }\n\n const [r, g, b, a] = rgbaArray.map(Math.round);\n const alphaHex = Math.round(a * 255)\n .toString(16)\n .padStart(2, '0');\n\n return `${alphaHex}${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b\n .toString(16)\n .padStart(2, '0')}`;\n}\n\nfunction rgb(value: number) {\n return [(value as number) >> 16, ((value as number) >> 8) & 0xff, (value as number) & 0xff, 1];\n}\n\nfunction rgba(value: number) {\n return [\n (value as number) >>> 24,\n ((value as number) >>> 16) & 0xff,\n ((value as number) >>> 8) & 0xff,\n (value as number) & 0xff\n ];\n}\n\nconst DEFAULT_COLORS_OPACITY = {\n transparent: 0xffffff00\n};\n\nexport const DEFAULT_COLORS = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n"]}
1
+ {"version":3,"sources":["util/color.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAE5C,SAAgB,gBAAgB,CAAC,WAAmB;IAClD,IAAI,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAE/B,IAAI,GAAG,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAGnC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;YACpB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SACnC;QAED,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE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AU,EAAE,QAAQ;IACpB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,QAAQ;CACtB,CAAC","file":"color.js","sourcesContent":["import { isNumber } from '@visactor/vutils';\n\nexport function colorStringToRGB(colorString: string) {\n if (colorString.startsWith('#')) {\n // 处理十六进制颜色值(例如:#RRGGBB 或 #RGB)\n let hex = colorString.substring(1);\n\n // 处理缩写的十六进制颜色值(例如:#RGB)\n if (hex.length === 3) {\n hex = hex.replace(/(.)/g, '$1$1');\n }\n\n const r = parseInt(hex.substring(0, 2), 16);\n const g = parseInt(hex.substring(2, 4), 16);\n const b = parseInt(hex.substring(4, 6), 16);\n return [r, g, b];\n } else if (colorString.startsWith('rgb(')) {\n // 处理RGB颜色值(例如:rgb(R, G, B))\n const values = colorString\n .substring(4, colorString.length - 1)\n .split(',')\n .map(Number);\n return values;\n } else if (colorString.startsWith('rgba(')) {\n // 处理RGBA颜色值(例如:rgba(R, G, B, A))\n const values = colorString\n .substring(5, colorString.length - 1)\n .split(',')\n .map(Number);\n return values;\n } else if (isNumber(DEFAULT_COLORS[colorString])) {\n return rgb(DEFAULT_COLORS[colorString]);\n } else if (isNumber(DEFAULT_COLORS_OPACITY[colorString])) {\n return rgba(DEFAULT_COLORS_OPACITY[colorString]);\n }\n\n throw new Error('Unsupported color format');\n}\n\nexport function rgbaToHex(rgbaArray: number[]) {\n if (rgbaArray.length === 3) {\n rgbaArray.push(1);\n }\n\n if (rgbaArray.length !== 4) {\n throw new Error('Invalid RGBA array');\n }\n\n const [r, g, b, a] = rgbaArray.map(Math.round);\n const alphaHex = Math.round(a * 255)\n .toString(16)\n .padStart(2, '0');\n\n return `${alphaHex}${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b\n .toString(16)\n .padStart(2, '0')}`;\n}\n\nfunction rgb(value: number) {\n return [(value as number) >> 16, ((value as number) >> 8) & 0xff, (value as number) & 0xff, 1];\n}\n\nfunction rgba(value: number) {\n return [\n (value as number) >>> 24,\n ((value as number) >>> 16) & 0xff,\n ((value as number) >>> 8) & 0xff,\n (value as number) & 0xff\n ];\n}\n\nconst DEFAULT_COLORS_OPACITY = {\n transparent: 0xffffff00\n};\n\nexport const DEFAULT_COLORS = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('crypto'), require('fs'), require('stream'), require('events'), require('buffer'), require('util'), require('string_decoder'), require('path'), require('constants'), require('assert'), require('zlib'), require('os')) :
3
3
  typeof define === 'function' && define.amd ? define(['exports', 'crypto', 'fs', 'stream', 'events', 'buffer', 'util', 'string_decoder', 'path', 'constants', 'assert', 'zlib', 'os'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.VTable = {}, global.require$$0$1, global.require$$0$6, global.require$$0$2, global.require$$0$5, global.require$$0$3, global.require$$0$4, global.require$$0$7, global.require$$1, global.require$$0$8, global.require$$5, global.require$$0$9, global.require$$1$1));
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.VTable = global.VTable || {}, global.VTable.export = {}), global.require$$0$1, global.require$$0$6, global.require$$0$2, global.require$$0$5, global.require$$0$3, global.require$$0$4, global.require$$0$7, global.require$$1, global.require$$0$8, global.require$$5, global.require$$0$9, global.require$$1$1));
5
5
  })(this, (function (exports, require$$0$1, require$$0$6, require$$0$2, require$$0$5, require$$0$3, require$$0$4, require$$0$7, require$$1, require$$0$8, require$$5, require$$0$9, require$$1$1) { 'use strict';
6
6
 
7
7
  const newLine = '\r\n';
@@ -75868,6 +75868,16 @@ ${XMLNS_NAMESPACE}.`);
75868
75868
  return s + (row + 1);
75869
75869
  }
75870
75870
 
75871
+ const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
75872
+ var isType$1 = isType;
75873
+
75874
+ const isNumber = function (value) {
75875
+ let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
75876
+ const type = typeof value;
75877
+ return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
75878
+ };
75879
+ var isNumber$1 = isNumber;
75880
+
75871
75881
  function colorStringToRGB(colorString) {
75872
75882
  if (colorString.startsWith('#')) {
75873
75883
  let hex = colorString.substring(1);
@@ -75893,10 +75903,10 @@ ${XMLNS_NAMESPACE}.`);
75893
75903
  .map(Number);
75894
75904
  return values;
75895
75905
  }
75896
- else if (DEFAULT_COLORS[colorString]) {
75906
+ else if (isNumber$1(DEFAULT_COLORS[colorString])) {
75897
75907
  return rgb(DEFAULT_COLORS[colorString]);
75898
75908
  }
75899
- else if (DEFAULT_COLORS_OPACITY[colorString]) {
75909
+ else if (isNumber$1(DEFAULT_COLORS_OPACITY[colorString])) {
75900
75910
  return rgba(DEFAULT_COLORS_OPACITY[colorString]);
75901
75911
  }
75902
75912
  throw new Error('Unsupported color format');