Skip to content

Commit 00c2c46

Browse files
authored
Updated zudoku to latest (#454)
* Updated zudoku to latest, use cdn chat widget * updated zudoku * updated zudoku
1 parent 1355a96 commit 00c2c46

16 files changed

+8470
-21127
lines changed

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 22.12.0

.vercelignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ checkly.config.ts
99
CONTRIBUTING.md
1010
prettier.config.js
1111
__checks__
12+
13+
dist/docs/server/*

package-lock.json

Lines changed: 8380 additions & 21079 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "module",
55
"version": "0.0.0",
66
"engines": {
7-
"node": ">=20"
7+
"node": "22.x"
88
},
99
"scripts": {
1010
"dev": "zudoku dev",
@@ -23,33 +23,32 @@
2323
},
2424
"dependencies": {
2525
"@dagrejs/dagre": "^1.1.4",
26-
"@inkeep/widgets": "0.2.289",
2726
"@sentry/react": "^8.46.0",
2827
"@sentry/vite-plugin": "^2.22.7",
2928
"@xyflow/react": "^12.3.6",
3029
"d3-hierarchy": "^3.1.2",
3130
"elkjs": "^0.9.3",
3231
"posthog-js": "^1.139.3",
33-
"react": "18.3.1",
34-
"react-dom": "18.3.1",
35-
"safe-marked": "16.0.0",
36-
"typescript": "5.6.3",
37-
"zudoku": "^0.22.0"
32+
"react": "^19.0.0",
33+
"react-dom": "^19.0.0",
34+
"zudoku": "^0.23.3"
3835
},
3936
"devDependencies": {
4037
"@types/d3-hierarchy": "^3.1.7",
4138
"@types/json-schema": "7.0.15",
4239
"@types/node": "22.7.5",
43-
"@types/react": "18.3.11",
44-
"@types/react-dom": "18.3.0",
40+
"@types/react": "^19.0.2",
41+
"@types/react-dom": "^19.0.2",
4542
"@typescript-eslint/parser": "^6.19.0",
4643
"eslint": "^8.51.0",
4744
"eslint-config-prettier": "^9.0.0",
4845
"eslint-plugin-prettier": "^5.0.0",
4946
"glob": "11.0.0",
5047
"gray-matter": "4.0.3",
5148
"prettier": "3.3.3",
49+
"safe-marked": "16.0.0",
5250
"tsx": "4.19.1",
51+
"typescript": "5.6.3",
5352
"unified": "^11.0.5",
5453
"vfile": "^6.0.3"
5554
}

src/EmbeddedChat.tsx

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import {
2-
type InkeepAIChatSettings,
3-
InkeepEmbeddedChat,
4-
type InkeepWidgetBaseSettings,
5-
} from "@inkeep/widgets";
1+
import React, { useEffect, useRef } from "react";
62

7-
const baseSettings: InkeepWidgetBaseSettings = {
3+
type _react = typeof React;
4+
5+
const baseSettings = {
86
apiKey: "499c156cf7a9798343949c8bb5665ac95e48132c6d68c42e",
97
integrationId: "clot3asdz0000s601nc8jwnzx",
108
organizationId: "org_dDOlt2uJlMWM8oIS",
@@ -28,7 +26,7 @@ const baseSettings: InkeepWidgetBaseSettings = {
2826
},
2927
};
3028

31-
const aiChatSettings: InkeepAIChatSettings = {
29+
const aiChatSettings = {
3230
shareChatUrlBasePath: `${process.env.NODE_ENV === "development" ? "http://localhost:9000" : "https://zuplo.com"}/docs/ask`,
3331
isChatSharingEnabled: true,
3432
quickQuestions: [
@@ -39,22 +37,38 @@ const aiChatSettings: InkeepAIChatSettings = {
3937
],
4038
};
4139

40+
interface InkeepWidget {
41+
render: (config: any & { isOpen: boolean }) => void;
42+
}
43+
44+
declare global {
45+
let Inkeep: () => {
46+
embed: (config: any) => InkeepWidget;
47+
};
48+
}
49+
4250
const EmbeddedChat = () => {
43-
return (
44-
<div>
45-
<InkeepEmbeddedChat
46-
stylesheetUrls={["/docs/styles/inkeep.css"]}
47-
baseSettings={{
51+
const ref = useRef<HTMLDivElement>(null);
52+
53+
useEffect(() => {
54+
Inkeep().embed({
55+
componentType: "EmbeddedChat",
56+
targetElement: ref.current!,
57+
properties: {
58+
stylesheetUrls: ["/docs/styles/inkeep.css"],
59+
baseSettings: {
4860
...baseSettings,
4961
colorMode: {
50-
...baseSettings.colorMode,
62+
// ...baseSettings.colorMode,
5163
forcedColorMode: "dark",
5264
},
53-
}}
54-
aiChatSettings={aiChatSettings}
55-
/>
56-
</div>
57-
);
65+
},
66+
aiChatSettings,
67+
},
68+
});
69+
}, [ref]);
70+
71+
return <div ref={ref} />;
5872
};
5973

6074
export default EmbeddedChat;

src/diagrams/CustomerIngressWithManagedDedicated.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { Position } from "@xyflow/react";
22
import React from "react";
33
import Diagram, { DiagramNode, Edge } from "./common/Diagram.js";
4-
import { createIngressEdgressEdge } from "./edges.js";
4+
import { createIngressEdgressEdge } from "./helpers/edges.js";
55
import {
66
createBackend,
77
createClient,
88
createCustomNode,
99
createVpcGroupNode,
1010
createZuploApiNode,
11-
} from "./nodes.js";
11+
} from "./helpers/nodes.js";
1212

1313
type _react = typeof React;
1414

src/diagrams/ZuploIngressWithManagedDedicated.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import Diagram, { DiagramNode, Edge } from "./common/Diagram.js";
22

33
import { Position } from "@xyflow/react";
44
import React from "react";
5-
import { createIngressEdgressEdge } from "./edges.js";
5+
import { createIngressEdgressEdge } from "./helpers/edges.js";
66
import {
77
createBackend,
88
createClient,
99
createVpcGroupNode,
1010
createZuploApiNode,
11-
} from "./nodes.js";
11+
} from "./helpers/nodes.js";
1212
type _react = typeof React;
1313

1414
const clientNode = createClient({ position: { x: 10, y: 90 } });

src/diagrams/common/BaseNode.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from "react";
22
import { cn } from "../../utils";
3-
type _react = typeof React;
43

54
export const BaseNode = React.forwardRef<
65
HTMLDivElement,

src/diagrams/common/CustomNode.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { Handle, HandleProps } from "@xyflow/react";
2-
import React, { memo } from "react";
2+
import React from "react";
33
import { BaseNode } from "./BaseNode";
4-
type _react = typeof React;
54

65
export type CustomHandleProps = Pick<HandleProps, "position" | "type" | "id">;
76

8-
export const CustomNode = memo(
7+
export const CustomNode = React.memo(
98
({ data }: { data: { label: string; handles?: CustomHandleProps[] } }) => {
109
return (
1110
<BaseNode title={data.label}>

src/diagrams/common/Diagram.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const proOptions = {
5252
hideAttribution: true,
5353
};
5454

55-
function Diagram({ className, nodes, edges }: DiagramProps) {
55+
export default function Diagram({ className, nodes, edges }: DiagramProps) {
5656
return (
5757
<div className={className}>
5858
<ReactFlow
@@ -81,5 +81,3 @@ function Diagram({ className, nodes, edges }: DiagramProps) {
8181
</div>
8282
);
8383
}
84-
85-
export default Diagram;

0 commit comments

Comments
 (0)