rn-shiki 0.0.23 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
@@ -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":["_react","_interopRequireDefault","require","_reactNative","_useSyntaxHighlighter","_typescript","_githubDark","_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,IAAA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AM,CAACY,GAAG,CAAC,CAACC,IAAI,EAAEC,SAAS,kBAC1B,IAAA3B,WAAA,CAAAiB,IAAA,EAACrB,YAAA,CAAA4B,IAAI;MAA2BL,KAAK,EAAE;QAAES,aAAa,EAAE,KAAK;QAAEC,QAAQ,EAAE;MAAO,CAAE;MAAAP,QAAA,GAC/EI,IAAI,CAACD,GAAG,CAAC,CAACK,KAAK,EAAEC,UAAU,kBAC1B,IAAA/B,WAAA,CAAAuB,GAAA,EAAC3B,YAAA,CAAAsB,IAAI;QAEHC,KAAK,EAAE;UACLC,KAAK,EAAEU,KAAK,CAACV,KAAK,IAAI,SAAS;UAC/BC,UAAU,EAAE,WAAW;UACvBT,QAAQ;UACRoB,SAAS,EAAEF,KAAK,CAACE;QACnB,CAAE;QAAAV,QAAA,EAEDQ,KAAK,CAACG,OAAO,CAACC,OAAO,CAAC,IAAI,EAAE,QAAQ;MAAC,GARjC,GAAGP,SAAS,IAAII,UAAU,EAS3B,CACP,CAAC,eACF,IAAA/B,WAAA,CAAAuB,GAAA,EAAC3B,YAAA,CAAAsB,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":[]}
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/SyntaxHigh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0B,IAAI;IAAAF,QAAA,EACFT,MAAM,CAACY,GAAG,CAAC,CAACC,IAAI,EAAEC,SAAS,kBAC1B,IAAA3B,WAAA,CAAAiB,IAAA,EAACnB,YAAA,CAAA0B,IAAI;MAA2BL,KAAK,EAAE;QAAES,aAAa,EAAE,KAAK;QAAEC,QAAQ,EAAE;MAAO,CAAE;MAAAP,QAAA,GAC/EI,IAAI,CAACD,GAAG,CAAC,CAACK,KAAK,EAAEC,UAAU,kBAC1B,IAAA/B,WAAA,CAAAuB,GAAA,EAACzB,YAAA,CAAAoB,IAAI;QAEHC,KAAK,EAAE;UACLC,KAAK,EAAEU,KAAK,CAACV,KAAK,IAAI,SAAS;UAC/BC,UAAU,EAAE,WAAW;UACvBT,QAAQ;UACRoB,SAAS,EAAEF,KAAK,CAACE;QACnB,CAAE;QAAAV,QAAA,EAEDQ,KAAK,CAACG,OAAO,CAACC,OAAO,CAAC,IAAI,EAAE,QAAQ;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":[]}
@@ -10,16 +10,17 @@ var _exportNames = {
10
10
  Object.defineProperty(exports, "SyntaxHighlighter", {
11
11
  enumerable: true,
12
12
  get: function () {
13
- return _syntax.SyntaxHighlighter;
13
+ return _SyntaxHighlighter.default;
14
14
  }
15
15
  });
16
16
  Object.defineProperty(exports, "SyntaxLine", {
17
17
  enumerable: true,
18
18
  get: function () {
19
- return _syntax.SyntaxLine;
19
+ return _SyntaxLine.default;
20
20
  }
21
21
  });
22
- var _syntax = require("./components/syntax");
22
+ var _SyntaxHighlighter = _interopRequireDefault(require("./components/syntax/SyntaxHighlighter"));
23
+ var _SyntaxLine = _interopRequireDefault(require("./components/syntax/SyntaxLine"));
23
24
  var _shiki = require("./types/shiki");
24
25
  Object.keys(_shiki).forEach(function (key) {
25
26
  if (key === "default" || key === "__esModule") return;
@@ -32,4 +33,5 @@ Object.keys(_shiki).forEach(function (key) {
32
33
  }
33
34
  });
34
35
  });
36
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
35
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_syntax","require","_shiki","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_SyntaxHighlighter","_interopRequireDefault","require","_SyntaxLine","_shiki","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","__esModule","default"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAA6B,SAAAP,uBAAAgB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
@@ -5,11 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.createHighlighter = createHighlighter;
7
7
  exports.processTokens = processTokens;
8
- var _core = require("vendor/shiki/core/core");
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, _core.createHighlighterCore)({
12
- engine: (0, _engineJavascript.createJavaScriptRegexEngine)(),
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":["_core","require","_engineJavascript","initializeHighlighter","langs","themes","createHighlighterCore","engine","createJavaScriptRegexEngine","createHighlighter","length","Error","highlighter","console","log","error","processTokens","tokens","map","token","content","color","fontStyle","toString"],"sourceRoot":"../../../../src","sources":["syntax/highlighter/index.ts"],"mappings":";;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEA,eAAeE,qBAAqBA,CAACC,KAAsB,EAAEC,MAAoB,EAA8D;EAC7I,OAAO,IAAAC,2BAAqB,EAAC;IAC3BC,MAAM,EAAE,IAAAC,6CAA2B,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;IAC9DQ,OAAO,CAACC,GAAG,CAAC,0BAA0B,EAAEF,WAAW,CAAC;IACpD,OAAOA,WAAW;EACpB,CAAC,CACD,OAAOG,KAAK,EAAE;IACZF,OAAO,CAACE,KAAK,CAAC,+BAA+B,EAAEA,KAAK,CAAC;IACrD,MAAMA,KAAK;EACb;AACF;AAEO,SAASC,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":[]}
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":[]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "createHighlighterCore", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _core.createHighlighterCore;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "createJavaScriptRegexEngine", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _engineJavascript.createJavaScriptRegexEngine;
16
+ }
17
+ });
18
+ var _core = require("./core/core");
19
+ var _engineJavascript = require("./core/engine-javascript");
20
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_core","require","_engineJavascript"],"sourceRoot":"../../../../src","sources":["vendor/shiki/index.d.ts"],"mappings":";;;;;;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createHighlighterCore = require('./core/core').createHighlighterCore;
7
+ exports.createJavaScriptRegexEngine = require('./core/engine-javascript').createJavaScriptRegexEngine;
8
+ exports.themes = {};
9
+ exports.languages = {};
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Object","defineProperty","exports","value","createHighlighterCore","require","createJavaScriptRegexEngine","themes","languages"],"sourceRoot":"../../../../src","sources":["vendor/shiki/index.js"],"mappings":"AAAA,YAAY;;AACZA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAE7DD,OAAO,CAACE,qBAAqB,GAAGC,OAAO,CAAC,aAAa,CAAC,CAACD,qBAAqB;AAC5EF,OAAO,CAACI,2BAA2B,GAAGD,OAAO,CAAC,0BAA0B,CAAC,CAACC,2BAA2B;AAErGJ,OAAO,CAACK,MAAM,GAAG,CAAC,CAAC;AACnBL,OAAO,CAACM,SAAS,GAAG,CAAC,CAAC","ignoreList":[]}