rn-shiki 0.0.24 → 0.0.25
Sign up to get free protection for your applications and to get access to all the features.
- package/babel.config.js +22 -0
- package/lib/commonjs/components/syntax/SyntaxHighlighter.js +2 -2
- package/lib/commonjs/components/syntax/SyntaxHighlighter.js.map +1 -1
- package/lib/commonjs/syntax/highlighter/index.js +3 -5
- package/lib/commonjs/syntax/highlighter/index.js.map +1 -1
- package/lib/commonjs/vendor/shiki/manifest.json +365 -365
- package/lib/typescript/components/syntax/SyntaxHighlighter.d.ts.map +1 -1
- package/lib/typescript/syntax/highlighter/index.d.ts +1 -1
- package/lib/typescript/syntax/highlighter/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/syntax/SyntaxHighlighter.tsx +2 -2
- package/src/syntax/highlighter/index.ts +1 -3
- package/src/vendor/shiki/manifest.json +365 -365
- package/tsconfig.json +2 -3
package/babel.config.js
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
module.exports = {
|
2
|
+
presets: [['module:metro-react-native-babel-preset'], ['@babel/preset-typescript', { allowNamespaces: true }]],
|
3
|
+
plugins: [
|
4
|
+
[
|
5
|
+
'module-resolver',
|
6
|
+
{
|
7
|
+
root: ['./src'],
|
8
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
|
9
|
+
alias: {
|
10
|
+
'@vendor': './src/vendor',
|
11
|
+
},
|
12
|
+
},
|
13
|
+
],
|
14
|
+
],
|
15
|
+
generatorOpts: {
|
16
|
+
compact: false,
|
17
|
+
retainLines: true,
|
18
|
+
concise: false,
|
19
|
+
minified: false,
|
20
|
+
},
|
21
|
+
comments: true,
|
22
|
+
}
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
+
var _typescript = _interopRequireDefault(require("@vendor/shiki/langs/typescript"));
|
8
|
+
var _githubDark = _interopRequireDefault(require("@vendor/shiki/themes/github-dark"));
|
7
9
|
var _react = _interopRequireDefault(require("react"));
|
8
10
|
var _reactNative = require("react-native");
|
9
11
|
var _useSyntaxHighlighter = require("../../hooks/useSyntaxHighlighter");
|
10
|
-
var _typescript = _interopRequireDefault(require("../../vendor/shiki/langs/typescript"));
|
11
|
-
var _githubDark = _interopRequireDefault(require("../../vendor/shiki/themes/github-dark"));
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
14
14
|
function SyntaxHighlighter({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_typescript","_interopRequireDefault","require","_githubDark","_react","_reactNative","_useSyntaxHighlighter","_jsxRuntime","e","__esModule","default","SyntaxHighlighter","text","lang","typescript","langName","theme","githubDark","themeName","fontSize","tokens","error","isLoading","useSyntaxHighlighter","jsxs","Text","style","color","fontFamily","children","jsx","View","map","line","lineIndex","flexDirection","flexWrap","token","tokenIndex","fontStyle","content","replace","_default","exports"],"sourceRoot":"../../../../src","sources":["components/syntax/SyntaxHighlighter.tsx"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAJ,OAAA;AAAuE,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAWvE,SAASG,iBAAiBA,CAAC;EACzBC,IAAI;EACJC,IAAI,GAAGC,mBAAU;EACjBC,QAAQ,GAAG,YAAY;EACvBC,KAAK,GAAGC,mBAAU;EAClBC,SAAS,GAAG,aAAa;EACzBC;AACsB,CAAC,EAAE;EACzB,MAAM;IAAEC,MAAM;IAAEC,KAAK;IAAEC;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;MAAC,GARjC,GAAGP,SAAS,IAAII,UAAU,EAS3B,CACP,CAAC,eACF,IAAA/B,WAAA,CAAAuB,GAAA,EAACzB,YAAA,CAAAoB,IAAI;QAACC,KAAK,EAAE;UAAEC,KAAK,EAAE,SAAS;UAAEC,UAAU,EAAE,WAAW;UAAET;QAAS,CAAE;QAAAU,QAAA,EAAE;MAAI,CAAO,CAAC;IAAA,GAd1E,QAAQK,SAAS,EAetB,CACP;EAAC,CACE,CAAC;AAEX;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAjC,OAAA,GAEcC,iBAAiB","ignoreList":[]}
|
@@ -5,11 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.createHighlighter = createHighlighter;
|
7
7
|
exports.processTokens = processTokens;
|
8
|
-
var
|
9
|
-
var _engineJavascript = require("vendor/shiki/core/engine-javascript");
|
8
|
+
var _shiki = require("@vendor/shiki");
|
10
9
|
async function initializeHighlighter(langs, themes) {
|
11
|
-
return (0,
|
12
|
-
engine: (0,
|
10
|
+
return (0, _shiki.createHighlighterCore)({
|
11
|
+
engine: (0, _shiki.createJavaScriptRegexEngine)(),
|
13
12
|
langs,
|
14
13
|
themes
|
15
14
|
});
|
@@ -23,7 +22,6 @@ async function createHighlighter({
|
|
23
22
|
}
|
24
23
|
try {
|
25
24
|
const highlighter = await initializeHighlighter(langs, themes);
|
26
|
-
console.log('Initialized highlighter:', highlighter);
|
27
25
|
return highlighter;
|
28
26
|
} catch (error) {
|
29
27
|
console.error('Failed to create highlighter:', error);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_shiki","require","initializeHighlighter","langs","themes","createHighlighterCore","engine","createJavaScriptRegexEngine","createHighlighter","length","Error","highlighter","error","console","processTokens","tokens","map","token","content","color","fontStyle","toString"],"sourceRoot":"../../../../src","sources":["syntax/highlighter/index.ts"],"mappings":";;;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAEA,eAAeC,qBAAqBA,CAACC,KAAsB,EAAEC,MAAoB,EAA8D;EAC7I,OAAO,IAAAC,4BAAqB,EAAC;IAC3BC,MAAM,EAAE,IAAAC,kCAA2B,EAAC,CAAC;IACrCJ,KAAK;IACLC;EACF,CAAC,CAAC;AACJ;AAEO,eAAeI,iBAAiBA,CAAC;EAAEL,KAAK;EAAEC;AAAyD,CAAC,EAA8D;EACvK,IAAI,CAACD,KAAK,EAAEM,MAAM,IAAI,CAACL,MAAM,EAAEK,MAAM,EAAE;IACrC,MAAM,IAAIC,KAAK,CAAC,uEAAuE,CAAC;EAC1F;EAEA,IAAI;IACF,MAAMC,WAAW,GAAG,MAAMT,qBAAqB,CAACC,KAAK,EAAEC,MAAM,CAAC;IAC9D,OAAOO,WAAW;EACpB,CAAC,CACD,OAAOC,KAAK,EAAE;IACZC,OAAO,CAACD,KAAK,CAAC,+BAA+B,EAAEA,KAAK,CAAC;IACrD,MAAMA,KAAK;EACb;AACF;AAEO,SAASE,aAAaA,CAACC,MAAqB,EAAe;EAChE,OAAOA,MAAM,CAACC,GAAG,CAACC,KAAK,KAAK;IAC1BC,OAAO,EAAED,KAAK,CAACC,OAAO;IACtBC,KAAK,EAAEF,KAAK,CAACE,KAAK,IAAI,SAAS;IAC/BC,SAAS,EAAEH,KAAK,CAACG,SAAS,EAAEC,QAAQ,CAAC;EACvC,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
|