@opensumi/ide-components 3.3.1-next-1725521092.0 → 3.3.1-next-1725534862.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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -6709,7 +6709,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
6709
6709
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6710
6710
 
6711
6711
  "use strict";
6712
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getEncodingInfo = exports.detectEncodingFromBuffer = exports.detectEncodingByBOMFromBuffer = exports.iconvEncode = exports.iconvDecode = exports.toNodeEncoding = exports.encodingExists = exports.toCanonicalName = exports.toIconvLiteEncoding = exports.isUTF8 = exports.UTF8_BOM = exports.UTF16le_BOM = exports.UTF16be_BOM = exports.UTF16le = exports.UTF16be = exports.UTF8_with_bom = exports.UTF8 = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.mjs\");\n/* ---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nconst iconv_lite_1 = tslib_1.__importDefault(__webpack_require__(/*! iconv-lite */ \"../../node_modules/iconv-lite/lib/index.js\"));\nconst const_1 = __webpack_require__(/*! ./const */ \"../utils/lib/const/index.js\");\nexports.UTF8 = 'utf8';\nexports.UTF8_with_bom = 'utf8bom';\nexports.UTF16be = 'utf16be';\nexports.UTF16le = 'utf16le';\nexports.UTF16be_BOM = [0xfe, 0xff];\nexports.UTF16le_BOM = [0xff, 0xfe];\nexports.UTF8_BOM = [0xef, 0xbb, 0xbf];\nconst ZERO_BYTE_DETECTION_BUFFER_MAX_LEN = 512; // number of bytes to look at to decide about a file being binary or not\nconst AUTO_ENCODING_GUESS_MAX_BYTES = 512 * 128; // set an upper limit for the number of bytes we pass on to jschardet\nfunction isUTF8(encoding) {\n if (encoding) {\n return toIconvLiteEncoding(encoding) === exports.UTF8;\n }\n return false;\n}\nexports.isUTF8 = isUTF8;\nconst SUPPORT_ENCODINGS_TO_ICONV_ENCODINGS = {\n ibm866: 'cp866',\n big5: 'cp950',\n utf8bom: 'utf8',\n};\nfunction toIconvLiteEncoding(encodingName) {\n const normalizedEncodingName = encodingName.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();\n const mapped = SUPPORT_ENCODINGS_TO_ICONV_ENCODINGS[normalizedEncodingName];\n return mapped || normalizedEncodingName;\n}\nexports.toIconvLiteEncoding = toIconvLiteEncoding;\n/**\n * The encodings that are allowed in a settings file don't match the canonical encoding labels specified by WHATWG.\n * See https://encoding.spec.whatwg.org/#names-and-labels\n * Iconv-lite strips all non-alphanumeric characters, but ripgrep doesn't. For backcompat, allow these labels.\n */\nfunction toCanonicalName(enc) {\n switch (enc) {\n case 'shiftjis':\n return 'shift-jis';\n case 'utf16le':\n return 'utf-16le';\n case 'utf16be':\n return 'utf-16be';\n case 'big5hkscs':\n return 'big5-hkscs';\n case 'eucjp':\n return 'euc-jp';\n case 'euckr':\n return 'euc-kr';\n case 'koi8r':\n return 'koi8-r';\n case 'koi8u':\n return 'koi8-u';\n case 'macroman':\n return 'x-mac-roman';\n case 'utf8bom':\n return 'utf8';\n default: {\n const m = enc.match(/windows(\\d+)/);\n if (m) {\n return 'windows-' + m[1];\n }\n return enc;\n }\n }\n}\nexports.toCanonicalName = toCanonicalName;\nasync function encodingExists(encoding) {\n return iconv_lite_1.default.encodingExists(toNodeEncoding(encoding));\n}\nexports.encodingExists = encodingExists;\nfunction toNodeEncoding(enc) {\n if (enc === exports.UTF8_with_bom || enc === null) {\n return exports.UTF8; // iconv does not distinguish UTF 8 with or without BOM, so we need to help it\n }\n return enc;\n}\nexports.toNodeEncoding = toNodeEncoding;\n/**\n * nodejs 内置的 Buffer 转换编码不支持 GBK,使用第三方的 iconv-lite\n * @param buffer Uint8Array | Buffer\n * @param encoding 传入的是 SUPPORTED_ENCODINGS 已有的键值(已通过 tests case 的)\n */\nfunction iconvDecode(buffer, encoding) {\n encoding = toIconvLiteEncoding(encoding);\n return iconv_lite_1.default.decode(buffer, encoding);\n}\nexports.iconvDecode = iconvDecode;\nfunction iconvEncode(content, encoding) {\n encoding = toIconvLiteEncoding(encoding);\n return iconv_lite_1.default.encode(content, encoding);\n}\nexports.iconvEncode = iconvEncode;\nfunction encodeLatin1(buffer) {\n let result = '';\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < buffer.length; i++) {\n result += String.fromCharCode(buffer[i]);\n }\n return result;\n}\nfunction detectEncodingByBOMFromBuffer(buffer, bytesRead) {\n if (!buffer || bytesRead < exports.UTF16be_BOM.length) {\n return null;\n }\n const b0 = buffer.readUInt8(0);\n const b1 = buffer.readUInt8(1);\n // UTF-16 BE\n if (b0 === exports.UTF16be_BOM[0] && b1 === exports.UTF16be_BOM[1]) {\n return exports.UTF16be;\n }\n // UTF-16 LE\n if (b0 === exports.UTF16le_BOM[0] && b1 === exports.UTF16le_BOM[1]) {\n return exports.UTF16le;\n }\n if (bytesRead < exports.UTF8_BOM.length) {\n return null;\n }\n const b2 = buffer.readUInt8(2);\n // UTF-8\n if (b0 === exports.UTF8_BOM[0] && b1 === exports.UTF8_BOM[1] && b2 === exports.UTF8_BOM[2]) {\n return exports.UTF8_with_bom;\n }\n return null;\n}\nexports.detectEncodingByBOMFromBuffer = detectEncodingByBOMFromBuffer;\n// we explicitly ignore a specific set of encodings from auto guessing\n// - ASCII: we never want this encoding (most UTF-8 files would happily detect as\n// ASCII files and then you could not type non-ASCII characters anymore)\n// - UTF-16: we have our own detection logic for UTF-16\n// - UTF-32: we do not support this encoding in VSCode\nconst IGNORE_ENCODINGS = ['ascii', 'utf-16', 'utf-32'];\nasync function guessEncodingByBuffer(buffer) {\n // lazy load\n const jschardet = await __webpack_require__.e(/*! import() */ \"vendors-node_modules_jschardet_index_js\").then(__webpack_require__.t.bind(__webpack_require__, /*! jschardet */ \"../../node_modules/jschardet/index.js\", 19));\n // ensure to limit buffer for guessing due to https://github.com/aadsm/jschardet/issues/53\n const limitedBuffer = buffer.slice(0, AUTO_ENCODING_GUESS_MAX_BYTES);\n // before guessing jschardet calls toString('binary') on input if it is a Buffer,\n // since we are using it inside browser environment as well we do conversion ourselves\n // https://github.com/aadsm/jschardet/blob/v2.1.1/src/index.js#L36-L40\n const binaryString = encodeLatin1(limitedBuffer.buffer);\n const guessed = jschardet.detect(binaryString);\n if (!guessed || !guessed.encoding) {\n return null;\n }\n const enc = guessed.encoding.toLowerCase();\n if (0 <= IGNORE_ENCODINGS.indexOf(enc)) {\n return null; // see comment above why we ignore some encodings\n }\n return toIconvLiteEncoding(guessed.encoding);\n}\nfunction detectEncodingFromBuffer(buffer, autoGuessEncoding) {\n const bytesRead = buffer.byteLength;\n // Always first check for BOM to find out about encoding\n let encoding = detectEncodingByBOMFromBuffer(buffer, bytesRead);\n // Detect 0 bytes to see if file is binary or UTF-16 LE/BE\n // unless we already know that this file has a UTF-16 encoding\n let seemsBinary = false;\n if (encoding !== exports.UTF16be && encoding !== exports.UTF16le && buffer) {\n let couldBeUTF16LE = true; // e.g. 0xAA 0x00\n let couldBeUTF16BE = true; // e.g. 0x00 0xAA\n let containsZeroByte = false;\n // This is a simplified guess to detect UTF-16 BE or LE by just checking if\n // the first 512 bytes have the 0-byte at a specific location. For UTF-16 LE\n // this would be the odd byte index and for UTF-16 BE the even one.\n // Note: this can produce false positives (a binary file that uses a 2-byte\n // encoding of the same format as UTF-16) and false negatives (a UTF-16 file\n // that is using 4 bytes to encode a character).\n for (let i = 0; i < bytesRead && i < ZERO_BYTE_DETECTION_BUFFER_MAX_LEN; i++) {\n const isEndian = i % 2 === 1; // assume 2-byte sequences typical for UTF-16\n const isZeroByte = buffer.readUInt8(i) === 0;\n if (isZeroByte) {\n containsZeroByte = true;\n }\n // UTF-16 LE: expect e.g. 0xAA 0x00\n if (couldBeUTF16LE && ((isEndian && !isZeroByte) || (!isEndian && isZeroByte))) {\n couldBeUTF16LE = false;\n }\n // UTF-16 BE: expect e.g. 0x00 0xAA\n if (couldBeUTF16BE && ((isEndian && isZeroByte) || (!isEndian && !isZeroByte))) {\n couldBeUTF16BE = false;\n }\n // Return if this is neither UTF16-LE nor UTF16-BE and thus treat as binary\n if (isZeroByte && !couldBeUTF16LE && !couldBeUTF16BE) {\n break;\n }\n }\n // Handle case of 0-byte included\n if (containsZeroByte) {\n if (couldBeUTF16LE) {\n encoding = exports.UTF16le;\n }\n else if (couldBeUTF16BE) {\n encoding = exports.UTF16be;\n }\n else {\n seemsBinary = true;\n }\n }\n }\n // Auto guess encoding if configured\n if (autoGuessEncoding && !seemsBinary && !encoding && buffer) {\n return guessEncodingByBuffer(buffer.slice(0, bytesRead)).then((guessedEncoding) => ({\n seemsBinary: false,\n encoding: guessedEncoding,\n }));\n }\n return { seemsBinary, encoding };\n}\nexports.detectEncodingFromBuffer = detectEncodingFromBuffer;\nfunction getEncodingInfo(encoding) {\n if (!encoding) {\n return null;\n }\n const result = const_1.SUPPORTED_ENCODINGS[encoding] || {};\n return {\n id: encoding,\n labelLong: result.labelLong || encoding,\n labelShort: result.labelShort || encoding,\n };\n}\nexports.getEncodingInfo = getEncodingInfo;\n//# sourceMappingURL=encoding.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../utils/lib/encoding.js?");
6712
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getEncodingInfo = exports.detectEncodingFromBuffer = exports.detectEncodingByBOMFromBuffer = exports.iconvEncode = exports.iconvDecode = exports.toNodeEncoding = exports.encodingExists = exports.toCanonicalName = exports.toIconvLiteEncoding = exports.isUTF8 = exports.ZERO_BYTE_DETECTION_BUFFER_MAX_LEN = exports.UTF8_BOM = exports.UTF16le_BOM = exports.UTF16be_BOM = exports.UTF16le = exports.UTF16be = exports.UTF8_with_bom = exports.UTF8 = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.mjs\");\n/* ---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nconst iconv_lite_1 = tslib_1.__importDefault(__webpack_require__(/*! iconv-lite */ \"../../node_modules/iconv-lite/lib/index.js\"));\nconst const_1 = __webpack_require__(/*! ./const */ \"../utils/lib/const/index.js\");\nexports.UTF8 = 'utf8';\nexports.UTF8_with_bom = 'utf8bom';\nexports.UTF16be = 'utf16be';\nexports.UTF16le = 'utf16le';\nexports.UTF16be_BOM = [0xfe, 0xff];\nexports.UTF16le_BOM = [0xff, 0xfe];\nexports.UTF8_BOM = [0xef, 0xbb, 0xbf];\nexports.ZERO_BYTE_DETECTION_BUFFER_MAX_LEN = 512; // number of bytes to look at to decide about a file being binary or not\nconst AUTO_ENCODING_GUESS_MAX_BYTES = 512 * 128; // set an upper limit for the number of bytes we pass on to jschardet\nfunction isUTF8(encoding) {\n if (encoding) {\n return toIconvLiteEncoding(encoding) === exports.UTF8;\n }\n return false;\n}\nexports.isUTF8 = isUTF8;\nconst SUPPORT_ENCODINGS_TO_ICONV_ENCODINGS = {\n ibm866: 'cp866',\n big5: 'cp950',\n utf8bom: 'utf8',\n};\nfunction toIconvLiteEncoding(encodingName) {\n const normalizedEncodingName = encodingName.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();\n const mapped = SUPPORT_ENCODINGS_TO_ICONV_ENCODINGS[normalizedEncodingName];\n return mapped || normalizedEncodingName;\n}\nexports.toIconvLiteEncoding = toIconvLiteEncoding;\n/**\n * The encodings that are allowed in a settings file don't match the canonical encoding labels specified by WHATWG.\n * See https://encoding.spec.whatwg.org/#names-and-labels\n * Iconv-lite strips all non-alphanumeric characters, but ripgrep doesn't. For backcompat, allow these labels.\n */\nfunction toCanonicalName(enc) {\n switch (enc) {\n case 'shiftjis':\n return 'shift-jis';\n case 'utf16le':\n return 'utf-16le';\n case 'utf16be':\n return 'utf-16be';\n case 'big5hkscs':\n return 'big5-hkscs';\n case 'eucjp':\n return 'euc-jp';\n case 'euckr':\n return 'euc-kr';\n case 'koi8r':\n return 'koi8-r';\n case 'koi8u':\n return 'koi8-u';\n case 'macroman':\n return 'x-mac-roman';\n case 'utf8bom':\n return 'utf8';\n default: {\n const m = enc.match(/windows(\\d+)/);\n if (m) {\n return 'windows-' + m[1];\n }\n return enc;\n }\n }\n}\nexports.toCanonicalName = toCanonicalName;\nasync function encodingExists(encoding) {\n return iconv_lite_1.default.encodingExists(toNodeEncoding(encoding));\n}\nexports.encodingExists = encodingExists;\nfunction toNodeEncoding(enc) {\n if (enc === exports.UTF8_with_bom || enc === null) {\n return exports.UTF8; // iconv does not distinguish UTF 8 with or without BOM, so we need to help it\n }\n return enc;\n}\nexports.toNodeEncoding = toNodeEncoding;\n/**\n * nodejs 内置的 Buffer 转换编码不支持 GBK,使用第三方的 iconv-lite\n * @param buffer Uint8Array | Buffer\n * @param encoding 传入的是 SUPPORTED_ENCODINGS 已有的键值(已通过 tests case 的)\n */\nfunction iconvDecode(buffer, encoding) {\n encoding = toIconvLiteEncoding(encoding);\n return iconv_lite_1.default.decode(buffer, encoding);\n}\nexports.iconvDecode = iconvDecode;\nfunction iconvEncode(content, encoding) {\n encoding = toIconvLiteEncoding(encoding);\n return iconv_lite_1.default.encode(content, encoding);\n}\nexports.iconvEncode = iconvEncode;\nfunction encodeLatin1(buffer) {\n let result = '';\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < buffer.length; i++) {\n result += String.fromCharCode(buffer[i]);\n }\n return result;\n}\nfunction detectEncodingByBOMFromBuffer(buffer, bytesRead) {\n if (!buffer || bytesRead < exports.UTF16be_BOM.length) {\n return null;\n }\n const b0 = buffer.readUInt8(0);\n const b1 = buffer.readUInt8(1);\n // UTF-16 BE\n if (b0 === exports.UTF16be_BOM[0] && b1 === exports.UTF16be_BOM[1]) {\n return exports.UTF16be;\n }\n // UTF-16 LE\n if (b0 === exports.UTF16le_BOM[0] && b1 === exports.UTF16le_BOM[1]) {\n return exports.UTF16le;\n }\n if (bytesRead < exports.UTF8_BOM.length) {\n return null;\n }\n const b2 = buffer.readUInt8(2);\n // UTF-8\n if (b0 === exports.UTF8_BOM[0] && b1 === exports.UTF8_BOM[1] && b2 === exports.UTF8_BOM[2]) {\n return exports.UTF8_with_bom;\n }\n return null;\n}\nexports.detectEncodingByBOMFromBuffer = detectEncodingByBOMFromBuffer;\n// we explicitly ignore a specific set of encodings from auto guessing\n// - ASCII: we never want this encoding (most UTF-8 files would happily detect as\n// ASCII files and then you could not type non-ASCII characters anymore)\n// - UTF-16: we have our own detection logic for UTF-16\n// - UTF-32: we do not support this encoding in VSCode\nconst IGNORE_ENCODINGS = ['ascii', 'utf-16', 'utf-32'];\nasync function guessEncodingByBuffer(buffer) {\n // lazy load\n const jschardet = await __webpack_require__.e(/*! import() */ \"vendors-node_modules_jschardet_index_js\").then(__webpack_require__.t.bind(__webpack_require__, /*! jschardet */ \"../../node_modules/jschardet/index.js\", 19));\n // ensure to limit buffer for guessing due to https://github.com/aadsm/jschardet/issues/53\n const limitedBuffer = buffer.slice(0, AUTO_ENCODING_GUESS_MAX_BYTES);\n // before guessing jschardet calls toString('binary') on input if it is a Buffer,\n // since we are using it inside browser environment as well we do conversion ourselves\n // https://github.com/aadsm/jschardet/blob/v2.1.1/src/index.js#L36-L40\n const binaryString = encodeLatin1(limitedBuffer.buffer);\n const guessed = jschardet.detect(binaryString);\n if (!guessed || !guessed.encoding) {\n return null;\n }\n const enc = guessed.encoding.toLowerCase();\n if (0 <= IGNORE_ENCODINGS.indexOf(enc)) {\n return null; // see comment above why we ignore some encodings\n }\n return toIconvLiteEncoding(guessed.encoding);\n}\nfunction detectEncodingFromBuffer(buffer, autoGuessEncoding) {\n const bytesRead = buffer.byteLength;\n // Always first check for BOM to find out about encoding\n let encoding = detectEncodingByBOMFromBuffer(buffer, bytesRead);\n // Detect 0 bytes to see if file is binary or UTF-16 LE/BE\n // unless we already know that this file has a UTF-16 encoding\n let seemsBinary = false;\n if (encoding !== exports.UTF16be && encoding !== exports.UTF16le && buffer) {\n let couldBeUTF16LE = true; // e.g. 0xAA 0x00\n let couldBeUTF16BE = true; // e.g. 0x00 0xAA\n let containsZeroByte = false;\n // This is a simplified guess to detect UTF-16 BE or LE by just checking if\n // the first 512 bytes have the 0-byte at a specific location. For UTF-16 LE\n // this would be the odd byte index and for UTF-16 BE the even one.\n // Note: this can produce false positives (a binary file that uses a 2-byte\n // encoding of the same format as UTF-16) and false negatives (a UTF-16 file\n // that is using 4 bytes to encode a character).\n for (let i = 0; i < bytesRead && i < exports.ZERO_BYTE_DETECTION_BUFFER_MAX_LEN; i++) {\n const isEndian = i % 2 === 1; // assume 2-byte sequences typical for UTF-16\n const isZeroByte = buffer.readUInt8(i) === 0;\n if (isZeroByte) {\n containsZeroByte = true;\n }\n // UTF-16 LE: expect e.g. 0xAA 0x00\n if (couldBeUTF16LE && ((isEndian && !isZeroByte) || (!isEndian && isZeroByte))) {\n couldBeUTF16LE = false;\n }\n // UTF-16 BE: expect e.g. 0x00 0xAA\n if (couldBeUTF16BE && ((isEndian && isZeroByte) || (!isEndian && !isZeroByte))) {\n couldBeUTF16BE = false;\n }\n // Return if this is neither UTF16-LE nor UTF16-BE and thus treat as binary\n if (isZeroByte && !couldBeUTF16LE && !couldBeUTF16BE) {\n break;\n }\n }\n // Handle case of 0-byte included\n if (containsZeroByte) {\n if (couldBeUTF16LE) {\n encoding = exports.UTF16le;\n }\n else if (couldBeUTF16BE) {\n encoding = exports.UTF16be;\n }\n else {\n seemsBinary = true;\n }\n }\n }\n // Auto guess encoding if configured\n if (autoGuessEncoding && !seemsBinary && !encoding && buffer) {\n return guessEncodingByBuffer(buffer.slice(0, bytesRead)).then((guessedEncoding) => ({\n seemsBinary: false,\n encoding: guessedEncoding,\n }));\n }\n return { seemsBinary, encoding };\n}\nexports.detectEncodingFromBuffer = detectEncodingFromBuffer;\nfunction getEncodingInfo(encoding) {\n if (!encoding) {\n return null;\n }\n const result = const_1.SUPPORTED_ENCODINGS[encoding] || {};\n return {\n id: encoding,\n labelLong: result.labelLong || encoding,\n labelShort: result.labelShort || encoding,\n };\n}\nexports.getEncodingInfo = getEncodingInfo;\n//# sourceMappingURL=encoding.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../utils/lib/encoding.js?");
6713
6713
 
6714
6714
  /***/ }),
6715
6715
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensumi/ide-components",
3
- "version": "3.3.1-next-1725521092.0",
3
+ "version": "3.3.1-next-1725534862.0",
4
4
  "description": "@opensumi/ide-components",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@ant-design/icons": "^4.6.4",
19
- "@opensumi/ide-core-common": "3.3.1-next-1725521092.0",
20
- "@opensumi/ide-utils": "3.3.1-next-1725521092.0",
19
+ "@opensumi/ide-core-common": "3.3.1-next-1725534862.0",
20
+ "@opensumi/ide-utils": "3.3.1-next-1725534862.0",
21
21
  "@opensumi/react-custom-scrollbars-2": "^4.3.4",
22
22
  "@rc-component/mini-decimal": "^1.0.1",
23
23
  "fuzzy": "^0.1.3",
@@ -38,10 +38,10 @@
38
38
  "react-window": "^1.8.5"
39
39
  },
40
40
  "devDependencies": {
41
- "@opensumi/ide-dev-tool": "3.3.1-next-1725521092.0",
41
+ "@opensumi/ide-dev-tool": "3.3.1-next-1725534862.0",
42
42
  "@types/marked": "^4.0.7",
43
43
  "@types/react-window": "^1.8.5",
44
44
  "prop-types": "^15.8.1"
45
45
  },
46
- "gitHead": "68c076414923186ea5f99696d5d23a2fb62a29e1"
46
+ "gitHead": "a08d2631c6c57999778c088371e4899579a33d83"
47
47
  }