rn-shiki 0.0.10 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/index.js +0 -14
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/syntax/highlighter/index.js +4 -3
- package/lib/commonjs/syntax/highlighter/index.js.map +1 -1
- package/lib/commonjs/types/shiki.d.js +2 -0
- package/lib/commonjs/types/shiki.d.js.map +1 -0
- package/lib/module/index.js +0 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/syntax/highlighter/index.js +2 -1
- package/lib/module/syntax/highlighter/index.js.map +1 -1
- package/lib/module/types/shiki.d.js +2 -0
- package/lib/module/types/shiki.d.js.map +1 -0
- package/lib/typescript/components/syntax/SyntaxHighlighter.d.ts.map +1 -0
- package/lib/typescript/components/syntax/SyntaxLine.d.ts.map +1 -0
- package/lib/typescript/components/syntax/index.d.ts.map +1 -0
- package/lib/typescript/hooks/useSyntaxHighlighter.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/{src/syntax → syntax}/highlighter/index.d.ts +1 -1
- package/lib/typescript/syntax/highlighter/index.d.ts.map +1 -0
- package/lib/typescript/syntax/index.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts.map +1 -0
- package/lib/typescript/utils/index.d.ts.map +1 -0
- package/lib/typescript/utils/string.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/syntax/highlighter/index.ts +3 -1
- package/src/types/shiki.d.ts +7 -0
- package/vendor/shiki/manifest.json +365 -365
- package/lib/commonjs/langs.js +0 -28
- package/lib/commonjs/langs.js.map +0 -1
- package/lib/commonjs/themes.js +0 -28
- package/lib/commonjs/themes.js.map +0 -1
- package/lib/module/langs.js +0 -20
- package/lib/module/langs.js.map +0 -1
- package/lib/module/themes.js +0 -20
- package/lib/module/themes.js.map +0 -1
- package/lib/typescript/src/components/syntax/SyntaxHighlighter.d.ts.map +0 -1
- package/lib/typescript/src/components/syntax/SyntaxLine.d.ts.map +0 -1
- package/lib/typescript/src/components/syntax/index.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useSyntaxHighlighter.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts +0 -4
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/langs.d.ts +0 -6
- package/lib/typescript/src/langs.d.ts.map +0 -1
- package/lib/typescript/src/syntax/highlighter/index.d.ts.map +0 -1
- package/lib/typescript/src/syntax/index.d.ts.map +0 -1
- package/lib/typescript/src/themes.d.ts +0 -6
- package/lib/typescript/src/themes.d.ts.map +0 -1
- package/lib/typescript/src/types/index.d.ts.map +0 -1
- package/lib/typescript/src/utils/index.d.ts.map +0 -1
- package/lib/typescript/src/utils/string.d.ts.map +0 -1
- /package/lib/typescript/{src/components → components}/syntax/SyntaxHighlighter.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/syntax/SyntaxLine.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/syntax/index.d.ts +0 -0
- /package/lib/typescript/{src/hooks → hooks}/useSyntaxHighlighter.d.ts +0 -0
- /package/lib/typescript/{src/syntax → syntax}/index.d.ts +0 -0
- /package/lib/typescript/{src/types → types}/index.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/index.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/string.d.ts +0 -0
package/lib/commonjs/index.js
CHANGED
@@ -15,19 +15,5 @@ Object.defineProperty(exports, "SyntaxLine", {
|
|
15
15
|
return _syntax.SyntaxLine;
|
16
16
|
}
|
17
17
|
});
|
18
|
-
Object.defineProperty(exports, "getLanguage", {
|
19
|
-
enumerable: true,
|
20
|
-
get: function () {
|
21
|
-
return _langs.getLanguage;
|
22
|
-
}
|
23
|
-
});
|
24
|
-
Object.defineProperty(exports, "getTheme", {
|
25
|
-
enumerable: true,
|
26
|
-
get: function () {
|
27
|
-
return _themes.getTheme;
|
28
|
-
}
|
29
|
-
});
|
30
18
|
var _syntax = require("./components/syntax");
|
31
|
-
var _langs = require("./langs");
|
32
|
-
var _themes = require("./themes");
|
33
19
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_syntax","require"
|
1
|
+
{"version":3,"names":["_syntax","require"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA","ignoreList":[]}
|
@@ -5,10 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.createHighlighter = createHighlighter;
|
7
7
|
exports.processTokens = processTokens;
|
8
|
-
var
|
8
|
+
var _core = require("../../../vendor/shiki/core/core");
|
9
|
+
var _engineJavascript = require("../../../vendor/shiki/core/engine-javascript");
|
9
10
|
async function initializeHighlighter(langs, themes) {
|
10
|
-
return (0,
|
11
|
-
engine: (0,
|
11
|
+
return (0, _core.createHighlighterCore)({
|
12
|
+
engine: (0, _engineJavascript.createJavaScriptRegexEngine)(),
|
12
13
|
langs,
|
13
14
|
themes
|
14
15
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_core","require","_engineJavascript","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,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;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 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/shiki.d.ts"],"mappings":"","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["SyntaxHighlighter","SyntaxLine"
|
1
|
+
{"version":3,"names":["SyntaxHighlighter","SyntaxLine"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,iBAAiB,EAAEC,UAAU,QAAQ,qBAAqB","ignoreList":[]}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
import { createHighlighterCore
|
3
|
+
import { createHighlighterCore } from '../../../vendor/shiki/core/core';
|
4
|
+
import { createJavaScriptRegexEngine } from '../../../vendor/shiki/core/engine-javascript';
|
4
5
|
async function initializeHighlighter(langs, themes) {
|
5
6
|
return createHighlighterCore({
|
6
7
|
engine: createJavaScriptRegexEngine(),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createHighlighterCore","createJavaScriptRegexEngine","initializeHighlighter","langs","themes","engine","createHighlighter","length","Error","highlighter","error","console","processTokens","tokens","map","token","content","color","fontStyle","toString"],"sourceRoot":"../../../../src","sources":["syntax/highlighter/index.ts"],"mappings":";;AAEA,SAASA,qBAAqB,
|
1
|
+
{"version":3,"names":["createHighlighterCore","createJavaScriptRegexEngine","initializeHighlighter","langs","themes","engine","createHighlighter","length","Error","highlighter","error","console","processTokens","tokens","map","token","content","color","fontStyle","toString"],"sourceRoot":"../../../../src","sources":["syntax/highlighter/index.ts"],"mappings":";;AAEA,SAASA,qBAAqB,QAAQ,iCAAiC;AACvE,SAASC,2BAA2B,QAAQ,8CAA8C;AAE1F,eAAeC,qBAAqBA,CAACC,KAAsB,EAAEC,MAAoB,EAA8D;EAC7I,OAAOJ,qBAAqB,CAAC;IAC3BK,MAAM,EAAEJ,2BAA2B,CAAC,CAAC;IACrCE,KAAK;IACLC;EACF,CAAC,CAAC;AACJ;AAEA,OAAO,eAAeE,iBAAiBA,CAAC;EAAEH,KAAK;EAAEC;AAAyD,CAAC,EAA8D;EACvK,IAAI,CAACD,KAAK,EAAEI,MAAM,IAAI,CAACH,MAAM,EAAEG,MAAM,EAAE;IACrC,MAAM,IAAIC,KAAK,CAAC,uEAAuE,CAAC;EAC1F;EAEA,IAAI;IACF,MAAMC,WAAW,GAAG,MAAMP,qBAAqB,CAACC,KAAK,EAAEC,MAAM,CAAC;IAC9D,OAAOK,WAAW;EACpB,CAAC,CACD,OAAOC,KAAK,EAAE;IACZC,OAAO,CAACD,KAAK,CAAC,+BAA+B,EAAEA,KAAK,CAAC;IACrD,MAAMA,KAAK;EACb;AACF;AAEA,OAAO,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 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/shiki.d.ts"],"mappings":"","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SyntaxHighlighter.d.ts","sourceRoot":"","sources":["../../../../src/components/syntax/SyntaxHighlighter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,iBAAS,iBAAiB,CAAC,EACzB,IAAI,EACJ,IAAiB,EACjB,QAAuB,EACvB,KAAkB,EAClB,SAAyB,EACzB,QAAQ,GACT,EAAE,sBAAsB,qBA4CxB;AAED,eAAe,iBAAiB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SyntaxLine.d.ts","sourceRoot":"","sources":["../../../../src/components/syntax/SyntaxLine.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,UAAU,eAAe;IACvB,IAAI,EAAE,SAAS,EAAE,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,eAAe,qBAsBtD;AAED,eAAe,UAAU,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/syntax/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useSyntaxHighlighter.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSyntaxHighlighter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAUnE,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,aAAa,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,UAAU,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,sBAAsB;;;;EAqDtG"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { LanguageInput, ThemedToken, ThemeInput } from 'shiki';
|
2
2
|
import type { TokenType } from '../../types';
|
3
|
-
import { createHighlighterCore } from 'shiki';
|
3
|
+
import { createHighlighterCore } from '../../../vendor/shiki/core/core';
|
4
4
|
export declare function createHighlighter({ langs, themes }: {
|
5
5
|
langs: LanguageInput[];
|
6
6
|
themes: ThemeInput[];
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/syntax/highlighter/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AAWvE,wBAAsB,iBAAiB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IAAE,KAAK,EAAE,aAAa,EAAE,CAAC;IAAC,MAAM,EAAE,UAAU,EAAE,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC,CAavK;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,EAAE,CAMhE"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/syntax/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/utils/string.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,SAAS,GAAE,MAAW,GAAG,MAAM,CAMxF;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,UAG7D;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqB3D"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "rn-shiki",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.
|
4
|
+
"version": "0.0.12",
|
5
5
|
"description": "Shiki syntax highlighter for React Native.",
|
6
6
|
"author": "Ryan Skinner <hello@ryanskinner.com>",
|
7
7
|
"license": "MIT",
|
@@ -15,7 +15,7 @@
|
|
15
15
|
],
|
16
16
|
"main": "lib/commonjs/index",
|
17
17
|
"module": "lib/module/index",
|
18
|
-
"types": "lib/typescript/
|
18
|
+
"types": "lib/typescript/index.d.ts",
|
19
19
|
"react-native": "src/index",
|
20
20
|
"source": "src/index",
|
21
21
|
"scripts": {
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { LanguageInput, ThemedToken, ThemeInput } from 'shiki'
|
2
2
|
import type { TokenType } from '../../types'
|
3
|
-
import { createHighlighterCore
|
3
|
+
import { createHighlighterCore } from '../../../vendor/shiki/core/core'
|
4
|
+
import { createJavaScriptRegexEngine } from '../../../vendor/shiki/core/engine-javascript'
|
4
5
|
|
5
6
|
async function initializeHighlighter(langs: LanguageInput[], themes: ThemeInput[]): Promise<Awaited<ReturnType<typeof createHighlighterCore>>> {
|
6
7
|
return createHighlighterCore({
|
@@ -17,6 +18,7 @@ export async function createHighlighter({ langs, themes }: { langs: LanguageInpu
|
|
17
18
|
|
18
19
|
try {
|
19
20
|
const highlighter = await initializeHighlighter(langs, themes)
|
21
|
+
console.log('Initialized highlighter:', highlighter)
|
20
22
|
return highlighter
|
21
23
|
}
|
22
24
|
catch (error) {
|