Skip to content

Commit 0a88d7e

Browse files
authored
feat: update to UI5 Web Components v2.16.1 (#7911)
1 parent 9a38327 commit 0a88d7e

File tree

40 files changed

+36936
-33704
lines changed

40 files changed

+36936
-33704
lines changed

.storybook/custom-element-manifests/ai.json

Lines changed: 1043 additions & 65 deletions
Large diffs are not rendered by default.

.storybook/custom-element-manifests/fiori.json

Lines changed: 9611 additions & 9440 deletions
Large diffs are not rendered by default.

.storybook/custom-element-manifests/main.json

Lines changed: 24446 additions & 24050 deletions
Large diffs are not rendered by default.

.storybook/utils.ts

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type * as CEM from '@ui5/webcomponents-tools/lib/cem/types-internal';
2-
import { useMemo } from 'react';
2+
import { useMemo, useRef, useState, useTransition } from 'react';
33
// @ts-expect-error: storybook can handle this
44
import cemAi from './custom-element-manifests/ai.json';
55
// @ts-expect-error: storybook can handle this
@@ -85,3 +85,79 @@ export function useGetSubComponentsOfModule(moduleName: string, tags: string[])
8585
return findSubComponentsRecursively(moduleName, cem);
8686
}, [cem, moduleName]);
8787
}
88+
89+
type StartStreamOptions = {
90+
text: string;
91+
onComplete?: (fullText: string) => void;
92+
onProcessingComplete?: () => void;
93+
};
94+
export function useFakeStream(typingDelay = 10, startingDelay = 1500) {
95+
const [value, setValue] = useState('');
96+
const [transitionIsPending, startTransition] = useTransition(); // active character updates
97+
const [isProcessing, setIsProcessing] = useState(false); // starting delay
98+
const [isTyping, setIsTyping] = useState(false); // actively typing characters
99+
const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
100+
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
101+
102+
const startStream = ({ text, onComplete, onProcessingComplete }: StartStreamOptions) => {
103+
// Stop previous stream and timeout
104+
if (intervalRef.current) {
105+
clearInterval(intervalRef.current);
106+
intervalRef.current = null;
107+
}
108+
if (timeoutRef.current) {
109+
clearTimeout(timeoutRef.current);
110+
timeoutRef.current = null;
111+
}
112+
113+
setValue('');
114+
setIsProcessing(true);
115+
116+
timeoutRef.current = setTimeout(() => {
117+
setIsProcessing(false);
118+
119+
if (onProcessingComplete) {
120+
onProcessingComplete();
121+
}
122+
123+
setIsTyping(true);
124+
let index = 0;
125+
126+
intervalRef.current = setInterval(() => {
127+
if (index < text.length) {
128+
const nextChar = text[index];
129+
index++;
130+
131+
startTransition(() => {
132+
setValue((prev) => prev + nextChar);
133+
});
134+
} else {
135+
if (intervalRef.current) {
136+
clearInterval(intervalRef.current);
137+
intervalRef.current = null;
138+
}
139+
setIsTyping(false);
140+
141+
if (onComplete) {
142+
onComplete(text);
143+
}
144+
}
145+
}, typingDelay);
146+
}, startingDelay);
147+
};
148+
149+
const stopStream = () => {
150+
if (intervalRef.current) {
151+
clearInterval(intervalRef.current);
152+
intervalRef.current = null;
153+
}
154+
if (timeoutRef.current) {
155+
clearTimeout(timeoutRef.current);
156+
timeoutRef.current = null;
157+
}
158+
setIsProcessing(false);
159+
setIsTyping(false);
160+
};
161+
162+
return { value, transitionIsPending, isProcessing, isTyping, setValue, startStream, stopStream };
163+
}

config/version-info.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,6 @@
5757
"2.12.0": "2.12.0",
5858
"2.13.1": "2.13.0",
5959
"2.14.0": "2.14.0",
60-
"2.15.0": "2.15.0"
60+
"2.15.0": "2.15.0",
61+
"2.16.0": "2.16.1"
6162
}

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"prettier:all": "prettier --write --config ./prettier.config.js \"**/*\"",
2222
"lint": "eslint .",
2323
"lerna:version-dryrun": "lerna version --conventional-graduate --no-git-tag-version --no-push",
24-
"wrappers:main": "WITH_WEB_COMPONENT_DOCS_LINK='true' node packages/cli/dist/bin/index.js create-wrappers --packageName @ui5/webcomponents --out ./packages/main/src/webComponents",
24+
"wrappers:main": "WITH_WEB_COMPONENT_DOCS_LINK='true' node packages/cli/dist/bin/index.js create-wrappers --packageName '@ui5/webcomponents' --out ./packages/main/src/webComponents",
2525
"wrappers:fiori": "WITH_WEB_COMPONENT_DOCS_LINK='true' node packages/cli/dist/bin/index.js create-wrappers --packageName @ui5/webcomponents-fiori --out ./packages/main/src/webComponents",
2626
"wrappers:compat": "WITH_WEB_COMPONENT_DOCS_LINK='true' WITH_WEB_COMPONENT_IMPORT_PATH='@ui5/webcomponents-react-base/withWebComponent' node packages/cli/dist/bin/index.js create-wrappers --packageName @ui5/webcomponents-compat --out ./packages/compat/src/components && prettier --log-level silent --write ./packages/compat/src/components",
2727
"wrappers:ai": "WITH_WEB_COMPONENT_DOCS_LINK='true' node packages/cli/dist/bin/index.js create-wrappers --packageName @ui5/webcomponents-ai --out ./packages/ai/src/components && prettier --log-level silent --write ./packages/ai/src/components",
@@ -40,11 +40,11 @@
4040
"@storybook/addon-a11y": "9.1.16",
4141
"@storybook/addon-docs": "9.1.16",
4242
"@storybook/react-vite": "9.1.16",
43-
"@ui5/webcomponents": "2.15.1",
44-
"@ui5/webcomponents-ai": "2.15.1",
45-
"@ui5/webcomponents-compat": "2.15.1",
46-
"@ui5/webcomponents-fiori": "2.15.1",
47-
"@ui5/webcomponents-icons": "2.15.1",
43+
"@ui5/webcomponents": "2.16.1",
44+
"@ui5/webcomponents-ai": "2.16.1",
45+
"@ui5/webcomponents-compat": "2.16.1",
46+
"@ui5/webcomponents-fiori": "2.16.1",
47+
"@ui5/webcomponents-icons": "2.16.1",
4848
"react": "19.2.0",
4949
"react-dom": "19.2.0",
5050
"remark-gfm": "4.0.1",
@@ -66,7 +66,7 @@
6666
"@types/node": "24.9.2",
6767
"@types/react": "19.1.17",
6868
"@types/react-dom": "19.1.11",
69-
"@ui5/webcomponents-tools": "2.15.1",
69+
"@ui5/webcomponents-tools": "2.16.1",
7070
"@vitejs/plugin-react": "5.0.4",
7171
"chromatic": "13.2.1",
7272
"cssnano": "7.1.2",

packages/ai/package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
"./PromptInput": {
2727
"types": "./dist/components/PromptInput/index.d.ts",
2828
"default": "./dist/components/PromptInput/index.js"
29+
},
30+
"./Input": {
31+
"types": "./dist/components/Input/index.d.ts",
32+
"default": "./dist/components/Input/index.js"
33+
},
34+
"./TextArea": {
35+
"types": "./dist/components/TextArea/index.d.ts",
36+
"default": "./dist/components/TextArea/index.js"
2937
}
3038
},
3139
"homepage": "https://ui5.github.io/webcomponents-react",
@@ -45,7 +53,7 @@
4553
"@ui5/webcomponents-react-base": "workspace:~"
4654
},
4755
"peerDependencies": {
48-
"@ui5/webcomponents-ai": "~2.15.0",
56+
"@ui5/webcomponents-ai": "~2.16.1",
4957
"react": "^18 || ^19"
5058
},
5159
"publishConfig": {

0 commit comments

Comments
 (0)