wtfai 1.4.2 → 1.4.4

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/ui/code.js +16 -0
  2. package/package.json +5 -4
package/dist/ui/code.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { CodeHighlighter, Mermaid } from "@ant-design/x";
3
+ import { jsonrepair } from "jsonrepair";
3
4
  const Code = (props)=>{
4
5
  var _className_match;
5
6
  const { className, children } = props;
@@ -8,6 +9,21 @@ const Code = (props)=>{
8
9
  if ('mermaid' === lang) return /*#__PURE__*/ jsx(Mermaid, {
9
10
  children: children
10
11
  });
12
+ console.log(lang);
13
+ if ('tmpl' === lang) {
14
+ const json = JSON.parse(jsonrepair(children));
15
+ if ('iframe' === json.type) return /*#__PURE__*/ jsx("iframe", {
16
+ src: json.data.src,
17
+ width: "100%",
18
+ allow: "clipboard-read; clipboard-write; camera; microphone",
19
+ style: {
20
+ minWidth: '33.333vw',
21
+ aspectRatio: 16 / 9,
22
+ border: 'none',
23
+ display: 'block'
24
+ }
25
+ });
26
+ }
11
27
  return /*#__PURE__*/ jsx(CodeHighlighter, {
12
28
  lang: lang,
13
29
  children: children
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtfai",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -14,14 +14,14 @@
14
14
  ],
15
15
  "devDependencies": {
16
16
  "@eslint/js": "^9.39.2",
17
- "@rsbuild/plugin-react": "^1.4.2",
17
+ "@rsbuild/plugin-react": "^1.4.3",
18
18
  "@rslib/core": "^0.19.2",
19
19
  "@types/react": "^19.2.8",
20
20
  "eslint": "^9.39.2",
21
21
  "eslint-config-prettier": "^10.1.8",
22
- "eslint-plugin-prettier": "^5.5.4",
22
+ "eslint-plugin-prettier": "^5.5.5",
23
23
  "globals": "^17.0.0",
24
- "prettier": "^3.7.4",
24
+ "prettier": "^3.8.0",
25
25
  "react": "^19.2.3",
26
26
  "typescript": "^5.9.3",
27
27
  "typescript-eslint": "^8.53.0"
@@ -37,6 +37,7 @@
37
37
  "clsx": "^2.1.1",
38
38
  "compressorjs": "^1.2.1",
39
39
  "cos-js-sdk-v5": "^1.10.1",
40
+ "jsonrepair": "^3.13.2",
40
41
  "uuid": "^13.0.0",
41
42
  "@our-llm/shared": "3.0.1"
42
43
  },