@assistant-ui/react-syntax-highlighter 0.9.3 → 0.10.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/dist/index.js
CHANGED
|
@@ -1,77 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var index_exports = {};
|
|
32
|
-
__export(index_exports, {
|
|
33
|
-
makeLightAsyncSyntaxHighlighter: () => makeLightAsyncSyntaxHighlighter,
|
|
34
|
-
makeLightSyntaxHighlighter: () => makeLightSyntaxHighlighter,
|
|
35
|
-
makePrismAsyncLightSyntaxHighlighter: () => makePrismAsyncLightSyntaxHighlighter,
|
|
36
|
-
makePrismAsyncSyntaxHighlighter: () => makePrismAsyncSyntaxHighlighter,
|
|
37
|
-
makePrismLightSyntaxHighlighter: () => makePrismLightSyntaxHighlighter,
|
|
38
|
-
makePrismSyntaxHighlighter: () => makePrismSyntaxHighlighter,
|
|
39
|
-
makeSyntaxHighlighter: () => makeSyntaxHighlighter
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(index_exports);
|
|
42
|
-
|
|
43
|
-
// src/react-syntax-highlighter.tsx
|
|
44
|
-
var import_react_syntax_highlighter = __toESM(require("react-syntax-highlighter"));
|
|
45
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
46
|
-
var makeMakeSyntaxHighlighter = (SyntaxHighlighter2) => (config) => {
|
|
47
|
-
const PrismSyntaxHighlighter = ({
|
|
48
|
-
components: { Pre, Code },
|
|
49
|
-
language,
|
|
50
|
-
code
|
|
51
|
-
}) => {
|
|
52
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
53
|
-
SyntaxHighlighter2,
|
|
54
|
-
{
|
|
55
|
-
PreTag: Pre,
|
|
56
|
-
CodeTag: Code,
|
|
57
|
-
...config,
|
|
58
|
-
language,
|
|
59
|
-
children: code
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
PrismSyntaxHighlighter.displayName = "PrismSyntaxHighlighter";
|
|
64
|
-
return PrismSyntaxHighlighter;
|
|
65
|
-
};
|
|
66
|
-
var makeSyntaxHighlighter = makeMakeSyntaxHighlighter(import_react_syntax_highlighter.default);
|
|
67
|
-
var makePrismSyntaxHighlighter = makeMakeSyntaxHighlighter(import_react_syntax_highlighter.Prism);
|
|
68
|
-
var makePrismAsyncSyntaxHighlighter = makeMakeSyntaxHighlighter(import_react_syntax_highlighter.PrismAsync);
|
|
69
|
-
var makePrismAsyncLightSyntaxHighlighter = makeMakeSyntaxHighlighter(import_react_syntax_highlighter.PrismAsyncLight);
|
|
70
|
-
var makePrismLightSyntaxHighlighter = makeMakeSyntaxHighlighter(import_react_syntax_highlighter.PrismLight);
|
|
71
|
-
var makeLightSyntaxHighlighter = makeMakeSyntaxHighlighter(import_react_syntax_highlighter.Light);
|
|
72
|
-
var makeLightAsyncSyntaxHighlighter = makeMakeSyntaxHighlighter(import_react_syntax_highlighter.LightAsync);
|
|
73
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
74
|
-
0 && (module.exports = {
|
|
1
|
+
import {
|
|
2
|
+
makeSyntaxHighlighter,
|
|
3
|
+
makeLightSyntaxHighlighter,
|
|
4
|
+
makeLightAsyncSyntaxHighlighter,
|
|
5
|
+
makePrismSyntaxHighlighter,
|
|
6
|
+
makePrismLightSyntaxHighlighter,
|
|
7
|
+
makePrismAsyncSyntaxHighlighter,
|
|
8
|
+
makePrismAsyncLightSyntaxHighlighter
|
|
9
|
+
} from "./react-syntax-highlighter";
|
|
10
|
+
export {
|
|
75
11
|
makeLightAsyncSyntaxHighlighter,
|
|
76
12
|
makeLightSyntaxHighlighter,
|
|
77
13
|
makePrismAsyncLightSyntaxHighlighter,
|
|
@@ -79,5 +15,5 @@ var makeLightAsyncSyntaxHighlighter = makeMakeSyntaxHighlighter(import_react_syn
|
|
|
79
15
|
makePrismLightSyntaxHighlighter,
|
|
80
16
|
makePrismSyntaxHighlighter,
|
|
81
17
|
makeSyntaxHighlighter
|
|
82
|
-
}
|
|
18
|
+
};
|
|
83
19
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n makeSyntaxHighlighter,\n makeLightSyntaxHighlighter,\n makeLightAsyncSyntaxHighlighter,\n makePrismSyntaxHighlighter,\n makePrismLightSyntaxHighlighter,\n makePrismAsyncSyntaxHighlighter,\n makePrismAsyncLightSyntaxHighlighter,\n} from \"./react-syntax-highlighter\";\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import SyntaxHighlighter, {
|
|
3
4
|
Prism,
|
|
4
5
|
PrismAsync,
|
|
@@ -7,8 +8,7 @@ import SyntaxHighlighter, {
|
|
|
7
8
|
Light,
|
|
8
9
|
LightAsync
|
|
9
10
|
} from "react-syntax-highlighter";
|
|
10
|
-
|
|
11
|
-
var makeMakeSyntaxHighlighter = (SyntaxHighlighter2) => (config) => {
|
|
11
|
+
const makeMakeSyntaxHighlighter = (SyntaxHighlighter2) => (config) => {
|
|
12
12
|
const PrismSyntaxHighlighter = ({
|
|
13
13
|
components: { Pre, Code },
|
|
14
14
|
language,
|
|
@@ -28,13 +28,13 @@ var makeMakeSyntaxHighlighter = (SyntaxHighlighter2) => (config) => {
|
|
|
28
28
|
PrismSyntaxHighlighter.displayName = "PrismSyntaxHighlighter";
|
|
29
29
|
return PrismSyntaxHighlighter;
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
const makeSyntaxHighlighter = makeMakeSyntaxHighlighter(SyntaxHighlighter);
|
|
32
|
+
const makePrismSyntaxHighlighter = makeMakeSyntaxHighlighter(Prism);
|
|
33
|
+
const makePrismAsyncSyntaxHighlighter = makeMakeSyntaxHighlighter(PrismAsync);
|
|
34
|
+
const makePrismAsyncLightSyntaxHighlighter = makeMakeSyntaxHighlighter(PrismAsyncLight);
|
|
35
|
+
const makePrismLightSyntaxHighlighter = makeMakeSyntaxHighlighter(PrismLight);
|
|
36
|
+
const makeLightSyntaxHighlighter = makeMakeSyntaxHighlighter(Light);
|
|
37
|
+
const makeLightAsyncSyntaxHighlighter = makeMakeSyntaxHighlighter(LightAsync);
|
|
38
38
|
export {
|
|
39
39
|
makeLightAsyncSyntaxHighlighter,
|
|
40
40
|
makeLightSyntaxHighlighter,
|
|
@@ -44,4 +44,4 @@ export {
|
|
|
44
44
|
makePrismSyntaxHighlighter,
|
|
45
45
|
makeSyntaxHighlighter
|
|
46
46
|
};
|
|
47
|
-
//# sourceMappingURL=
|
|
47
|
+
//# sourceMappingURL=react-syntax-highlighter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react-syntax-highlighter.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentType, type FC } from \"react\";\nimport SyntaxHighlighter, {\n Prism,\n PrismAsync,\n PrismAsyncLight,\n PrismLight,\n Light,\n LightAsync,\n SyntaxHighlighterProps as SHP,\n} from \"react-syntax-highlighter\";\nimport type { SyntaxHighlighterProps } from \"@assistant-ui/react-markdown\";\n\nconst makeMakeSyntaxHighlighter =\n (SyntaxHighlighter: ComponentType<SHP>) =>\n (config: Omit<SHP, \"language\" | \"children\">) => {\n const PrismSyntaxHighlighter: FC<SyntaxHighlighterProps> = ({\n components: { Pre, Code },\n language,\n code,\n }) => {\n return (\n <SyntaxHighlighter\n PreTag={Pre}\n CodeTag={Code}\n {...config}\n language={language}\n >\n {code}\n </SyntaxHighlighter>\n );\n };\n\n PrismSyntaxHighlighter.displayName = \"PrismSyntaxHighlighter\";\n\n return PrismSyntaxHighlighter;\n };\n\nexport const makeSyntaxHighlighter =\n makeMakeSyntaxHighlighter(SyntaxHighlighter);\n\nexport const makePrismSyntaxHighlighter = makeMakeSyntaxHighlighter(Prism);\n\nexport const makePrismAsyncSyntaxHighlighter =\n makeMakeSyntaxHighlighter(PrismAsync);\n\nexport const makePrismAsyncLightSyntaxHighlighter =\n makeMakeSyntaxHighlighter(PrismAsyncLight);\n\nexport const makePrismLightSyntaxHighlighter =\n makeMakeSyntaxHighlighter(PrismLight);\n\nexport const makeLightSyntaxHighlighter = makeMakeSyntaxHighlighter(Light);\n\nexport const makeLightAsyncSyntaxHighlighter =\n makeMakeSyntaxHighlighter(LightAsync);\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../src/react-syntax-highlighter.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentType, type FC } from \"react\";\nimport SyntaxHighlighter, {\n Prism,\n PrismAsync,\n PrismAsyncLight,\n PrismLight,\n Light,\n LightAsync,\n SyntaxHighlighterProps as SHP,\n} from \"react-syntax-highlighter\";\nimport type { SyntaxHighlighterProps } from \"@assistant-ui/react-markdown\";\n\nconst makeMakeSyntaxHighlighter =\n (SyntaxHighlighter: ComponentType<SHP>) =>\n (config: Omit<SHP, \"language\" | \"children\">) => {\n const PrismSyntaxHighlighter: FC<SyntaxHighlighterProps> = ({\n components: { Pre, Code },\n language,\n code,\n }) => {\n return (\n <SyntaxHighlighter\n PreTag={Pre}\n CodeTag={Code}\n {...config}\n language={language}\n >\n {code}\n </SyntaxHighlighter>\n );\n };\n\n PrismSyntaxHighlighter.displayName = \"PrismSyntaxHighlighter\";\n\n return PrismSyntaxHighlighter;\n };\n\nexport const makeSyntaxHighlighter =\n makeMakeSyntaxHighlighter(SyntaxHighlighter);\n\nexport const makePrismSyntaxHighlighter = makeMakeSyntaxHighlighter(Prism);\n\nexport const makePrismAsyncSyntaxHighlighter =\n makeMakeSyntaxHighlighter(PrismAsync);\n\nexport const makePrismAsyncLightSyntaxHighlighter =\n makeMakeSyntaxHighlighter(PrismAsyncLight);\n\nexport const makePrismLightSyntaxHighlighter =\n makeMakeSyntaxHighlighter(PrismLight);\n\nexport const makeLightSyntaxHighlighter = makeMakeSyntaxHighlighter(Light);\n\nexport const makeLightAsyncSyntaxHighlighter =\n makeMakeSyntaxHighlighter(LightAsync);\n"],"mappings":";AAuBQ;AApBR,OAAO;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAGP,MAAM,4BACJ,CAACA,uBACD,CAAC,WAA+C;AAC9C,QAAM,yBAAqD,CAAC;AAAA,IAC1D,YAAY,EAAE,KAAK,KAAK;AAAA,IACxB;AAAA,IACA;AAAA,EACF,MAAM;AACJ,WACE;AAAA,MAACA;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR,SAAS;AAAA,QACR,GAAG;AAAA,QACJ;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,yBAAuB,cAAc;AAErC,SAAO;AACT;AAEK,MAAM,wBACX,0BAA0B,iBAAiB;AAEtC,MAAM,6BAA6B,0BAA0B,KAAK;AAElE,MAAM,kCACX,0BAA0B,UAAU;AAE/B,MAAM,uCACX,0BAA0B,eAAe;AAEpC,MAAM,kCACX,0BAA0B,UAAU;AAE/B,MAAM,6BAA6B,0BAA0B,KAAK;AAElE,MAAM,kCACX,0BAA0B,UAAU;","names":["SyntaxHighlighter"]}
|
package/package.json
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/react-syntax-highlighter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"exports": {
|
|
6
7
|
".": {
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"default": "./dist/index.mjs"
|
|
10
|
-
},
|
|
11
|
-
"require": {
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
|
-
"default": "./dist/index.js"
|
|
14
|
-
}
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
15
10
|
}
|
|
16
11
|
},
|
|
17
|
-
"source": "./src/index.ts",
|
|
18
12
|
"main": "./dist/index.js",
|
|
19
|
-
"module": "./dist/index.mjs",
|
|
20
13
|
"types": "./dist/index.d.ts",
|
|
21
14
|
"files": [
|
|
22
15
|
"dist",
|
|
@@ -24,8 +17,8 @@
|
|
|
24
17
|
],
|
|
25
18
|
"sideEffects": false,
|
|
26
19
|
"peerDependencies": {
|
|
27
|
-
"@assistant-ui/react": "^0.
|
|
28
|
-
"@assistant-ui/react-markdown": "^0.
|
|
20
|
+
"@assistant-ui/react": "^0.10.0",
|
|
21
|
+
"@assistant-ui/react-markdown": "^0.10.0",
|
|
29
22
|
"@types/react": "*",
|
|
30
23
|
"@types/react-syntax-highlighter": "*",
|
|
31
24
|
"react": "^18 || ^19 || ^19.0.0-rc",
|
|
@@ -40,10 +33,17 @@
|
|
|
40
33
|
}
|
|
41
34
|
},
|
|
42
35
|
"devDependencies": {
|
|
36
|
+
"@types/node": "^22.14.1",
|
|
37
|
+
"@types/react": "^19.1.0",
|
|
38
|
+
"@types/react-syntax-highlighter": "^15.5.11",
|
|
39
|
+
"eslint": "^9",
|
|
43
40
|
"eslint-config-next": "15.3.1",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
41
|
+
"react": "^19.1.0",
|
|
42
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
43
|
+
"tsx": "^4.19.3",
|
|
44
|
+
"@assistant-ui/react": "0.10.0",
|
|
45
|
+
"@assistant-ui/react-markdown": "0.10.0",
|
|
46
|
+
"@assistant-ui/tsbuildutils": "0.0.1",
|
|
47
47
|
"@assistant-ui/tsconfig": "0.0.0"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
@@ -59,6 +59,6 @@
|
|
|
59
59
|
"url": "https://github.com/assistant-ui/assistant-ui/issues"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
|
-
"build": "
|
|
62
|
+
"build": "tsx scripts/build.mts"
|
|
63
63
|
}
|
|
64
64
|
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { SyntaxHighlighterProps } from 'react-syntax-highlighter';
|
|
3
|
-
import { SyntaxHighlighterProps as SyntaxHighlighterProps$1 } from '@assistant-ui/react-markdown';
|
|
4
|
-
|
|
5
|
-
declare const makeSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
6
|
-
declare const makePrismSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
7
|
-
declare const makePrismAsyncSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
8
|
-
declare const makePrismAsyncLightSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
9
|
-
declare const makePrismLightSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
10
|
-
declare const makeLightSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
11
|
-
declare const makeLightAsyncSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
12
|
-
|
|
13
|
-
export { makeLightAsyncSyntaxHighlighter, makeLightSyntaxHighlighter, makePrismAsyncLightSyntaxHighlighter, makePrismAsyncSyntaxHighlighter, makePrismLightSyntaxHighlighter, makePrismSyntaxHighlighter, makeSyntaxHighlighter };
|
package/dist/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { SyntaxHighlighterProps } from 'react-syntax-highlighter';
|
|
3
|
-
import { SyntaxHighlighterProps as SyntaxHighlighterProps$1 } from '@assistant-ui/react-markdown';
|
|
4
|
-
|
|
5
|
-
declare const makeSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
6
|
-
declare const makePrismSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
7
|
-
declare const makePrismAsyncSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
8
|
-
declare const makePrismAsyncLightSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
9
|
-
declare const makePrismLightSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
10
|
-
declare const makeLightSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
11
|
-
declare const makeLightAsyncSyntaxHighlighter: (config: Omit<SyntaxHighlighterProps, "language" | "children">) => FC<SyntaxHighlighterProps$1>;
|
|
12
|
-
|
|
13
|
-
export { makeLightAsyncSyntaxHighlighter, makeLightSyntaxHighlighter, makePrismAsyncLightSyntaxHighlighter, makePrismAsyncSyntaxHighlighter, makePrismLightSyntaxHighlighter, makePrismSyntaxHighlighter, makeSyntaxHighlighter };
|