@wandelbots/wandelbots-js-react-components 1.51.1 → 1.51.2-pr.feat-mui-6.171.e939459

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wandelbots/wandelbots-js-react-components",
3
- "version": "1.51.1",
3
+ "version": "v1.51.2-pr.feat-mui-6.171.e939459",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -48,7 +48,8 @@
48
48
  "devDependencies": {
49
49
  "@emotion/react": "^11.13.3",
50
50
  "@emotion/styled": "^11.13.0",
51
- "@mui/material": "^5.16.7",
51
+ "@mui/icons-material": "^6.4.0",
52
+ "@mui/material": "^6.4.0",
52
53
  "@rollup/plugin-commonjs": "^28.0.1",
53
54
  "@rollup/plugin-json": "^6.1.0",
54
55
  "@rollup/plugin-node-resolve": "^15.3.0",
@@ -92,7 +93,7 @@
92
93
  "storybook-dark-mode": "^4.0.2",
93
94
  "storybook-preset-inline-svg": "^1.0.1",
94
95
  "ts-dedent": "^2.2.0",
95
- "typescript": "^5.6.3",
96
+ "typescript": "^5.7.3",
96
97
  "unplugin": "^1.15.0",
97
98
  "vite": "^5.4.10",
98
99
  "vite-plugin-svgr": "^4.3.0",
@@ -102,7 +103,8 @@
102
103
  "peerDependencies": {
103
104
  "@emotion/react": "^11.11.1",
104
105
  "@emotion/styled": "^11.11.0",
105
- "@mui/material": "^5",
106
+ "@mui/icons-material": "^6",
107
+ "@mui/material": "^6",
106
108
  "@react-spring/three": ">=9",
107
109
  "@react-three/drei": ">=9",
108
110
  "@react-three/fiber": ">=8",
@@ -118,8 +120,6 @@
118
120
  },
119
121
  "dependencies": {
120
122
  "@monaco-editor/react": "^4.6.0",
121
- "@mui/icons-material": "^5.16.7",
122
- "@mui/lab": "^5.0.0-alpha.173",
123
123
  "@shikijs/monaco": "^1.22.2",
124
124
  "@wandelbots/wandelbots-js": "^1.12.0",
125
125
  "i18next-browser-languagedetector": "^8.0.0",
@@ -1,7 +1,8 @@
1
+ import type { ToggleButtonGroupProps } from "@mui/material"
1
2
  import { styled, ToggleButtonGroup } from "@mui/material"
2
3
 
3
- export const JoggingToggleButtonGroup = styled(ToggleButtonGroup)(
4
- ({ theme }) => ({
4
+ export const JoggingToggleButtonGroup: React.ComponentType<ToggleButtonGroupProps> =
5
+ styled(ToggleButtonGroup)(({ theme }) => ({
5
6
  "&.MuiToggleButtonGroup-root": {
6
7
  background: theme.palette.backgroundPaperElevation?.[8],
7
8
  borderRadius: "8px",
@@ -21,5 +22,4 @@ export const JoggingToggleButtonGroup = styled(ToggleButtonGroup)(
21
22
  },
22
23
  },
23
24
  },
24
- }),
25
- )
25
+ }))
@@ -1,5 +1,5 @@
1
1
  import type { Monaco } from "@monaco-editor/react"
2
- import { lazy, Suspense, useRef, useState } from "react"
2
+ import { lazy, Suspense, useState } from "react"
3
3
  import type { BundledLanguage, BundledTheme, HighlighterGeneric } from "shiki"
4
4
 
5
5
  import { useTheme } from "@mui/material"
@@ -24,25 +24,47 @@ type WandelscriptEditorProps = {
24
24
 
25
25
  const Editor = lazy(() => import("@monaco-editor/react"))
26
26
 
27
+ let preparedShiki: {
28
+ shiki: HighlighterGeneric<BundledLanguage, BundledTheme>
29
+ shikiToMonaco: (
30
+ shiki: HighlighterGeneric<BundledLanguage, BundledTheme>,
31
+ monaco: Monaco,
32
+ ) => void
33
+ } | null = null
34
+
35
+ async function getShiki() {
36
+ if (!preparedShiki) {
37
+ const [{ createHighlighter }, { shikiToMonaco }] = await Promise.all([
38
+ import("shiki"),
39
+ import("@shikijs/monaco"),
40
+ ])
41
+
42
+ const shiki = await createHighlighter({
43
+ // Our textmate grammar doesn't quite conform to the expected type
44
+ // here; I'm not sure what the missing properties mean exactly
45
+ langs: [wandelscriptTextmateGrammar as any],
46
+ themes: ["dark-plus", "light-plus"],
47
+ })
48
+
49
+ preparedShiki = {
50
+ shiki,
51
+ shikiToMonaco,
52
+ }
53
+ }
54
+
55
+ return preparedShiki
56
+ }
57
+
27
58
  /** A Monaco (VSCode-style) embedded code editor with Wandelscript syntax highlighting */
28
59
  export const WandelscriptEditor = externalizeComponent(
29
60
  (props: WandelscriptEditorProps) => {
30
61
  const theme = useTheme()
31
- const shikiHighlighterRef = useRef<HighlighterGeneric<
32
- BundledLanguage,
33
- BundledTheme
34
- > | null>(null)
35
62
  const [activeShikiTheme, setActiveShikiTheme] =
36
63
  useState<BundledTheme>("dark-plus")
37
64
  const targetShikiTheme =
38
65
  theme.palette.mode === "dark" ? "dark-plus" : "light-plus"
39
66
 
40
67
  async function setupEditor(monaco: Monaco) {
41
- const [{ createHighlighter }, { shikiToMonaco }] = await Promise.all([
42
- import("shiki"),
43
- import("@shikijs/monaco"),
44
- ])
45
-
46
68
  // Register and configure the Wandelscript language
47
69
  monaco.languages.register({ id: "wandelscript" })
48
70
 
@@ -64,19 +86,11 @@ export const WandelscriptEditor = externalizeComponent(
64
86
  ],
65
87
  })
66
88
 
89
+ const { shiki, shikiToMonaco } = await getShiki()
90
+
67
91
  // Monaco doesn't support TextMate grammar config directly, so we
68
92
  // use Shiki as an intermediary
69
-
70
- if (!shikiHighlighterRef.current) {
71
- shikiHighlighterRef.current = await createHighlighter({
72
- // Our textmate grammar doesn't quite conform to the expected type
73
- // here; I'm not sure what the missing properties mean exactly
74
- langs: [wandelscriptTextmateGrammar as any],
75
- themes: ["dark-plus", "light-plus"],
76
- })
77
- }
78
-
79
- shikiToMonaco(shikiHighlighterRef.current, monaco)
93
+ shikiToMonaco(shiki, monaco)
80
94
 
81
95
  // Override the generated shiki theme to use shiki syntax highlighting
82
96
  // but vscode colors
@@ -1,5 +0,0 @@
1
- /** Button with a loading state to indicate a task is being processed */
2
- export declare const LoadingButton: import("react").ForwardRefExoticComponent<Omit<import("@mui/lab").LoadingButtonOwnProps & Omit<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes">, "classes"> & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
3
- ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
4
- }, "children" | "color" | "size" | "className" | "style" | "tabIndex" | "loading" | "classes" | "sx" | "disabled" | "href" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "variant" | "fullWidth" | "disableElevation" | "endIcon" | "startIcon" | "loadingIndicator" | "loadingPosition">, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
5
- //# sourceMappingURL=LoadingButton.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoadingButton.d.ts","sourceRoot":"","sources":["../../src/components/LoadingButton.tsx"],"names":[],"mappings":"AAKA,wEAAwE;AACxE,eAAO,MAAM,aAAa;;4fAYzB,CAAA"}
@@ -1,19 +0,0 @@
1
- import { LoadingButton as MUILoadingButton } from "@mui/lab"
2
- import { forwardRef } from "react"
3
-
4
- type LoadingButtonProps = React.ComponentProps<typeof MUILoadingButton>
5
-
6
- /** Button with a loading state to indicate a task is being processed */
7
- export const LoadingButton = forwardRef<HTMLButtonElement, LoadingButtonProps>(
8
- ({ sx, ...rest }, ref) => {
9
- return (
10
- <MUILoadingButton
11
- sx={{
12
- ...sx,
13
- }}
14
- ref={ref}
15
- {...rest}
16
- />
17
- )
18
- },
19
- )