@botonic/webchat-react 2.35.0-alpha.0 β†’ 2.36.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/CHANGELOG.md CHANGED
@@ -1,3 +1,46 @@
1
+ ## 2.36.0 (2026-09-02)
2
+
3
+ ### πŸš€ Features
4
+
5
+ - ts6 typecheck pass ([#1090](https://github.com/metis-ai/hubtype-product/pull/1090))
6
+
7
+ ### ❀️ Thank You
8
+
9
+ - Oriol RaventΓ³s @Iru89
10
+
11
+ ## 2.35.0 (2026-08-03)
12
+
13
+ ### πŸš€ Features
14
+
15
+ - upgrade to Nx 23.1.0 in bot apps, create-workspace and botonic/nx-plugin ([#1043](https://github.com/metis-ai/hubtype-product/pull/1043))
16
+ - eslint v9 with flat config ([#1039](https://github.com/metis-ai/hubtype-product/pull/1039))
17
+
18
+ ### 🩹 Fixes
19
+
20
+ - add alias to lilara for test in webchat-react ([#1040](https://github.com/metis-ai/hubtype-product/pull/1040))
21
+
22
+ ### ❀️ Thank You
23
+
24
+ - David Hidalgo @Davidhidalgo
25
+ - Oriol RaventΓ³s @Davidhidalgo
26
+
27
+ ## 2.35.0-alpha.0 (2026-08-03)
28
+
29
+ ### πŸš€ Features
30
+
31
+ - eslint v9 with flat config ([#1039](https://github.com/metis-ai/hubtype-product/pull/1039))
32
+ - add alias for ui-web-react in Vite configuration ([55faf5103](https://github.com/metis-ai/hubtype-product/commit/55faf5103))
33
+
34
+ ### 🩹 Fixes
35
+
36
+ - **release-botonic:** fix alpha release version resolution and hook crash ([7b5657fc3](https://github.com/metis-ai/hubtype-product/commit/7b5657fc3))
37
+
38
+ ### ❀️ Thank You
39
+
40
+ - David Hidalgo @Davidhidalgo
41
+ - Oriol Raventos
42
+ - Oriol RaventΓ³s @Iru89
43
+
1
44
  ## 2.34.2 (2026-07-13)
2
45
 
3
46
  This was a version bump only for @botonic/webchat-react to align it with other projects, there were no code changes.
@@ -423,4 +466,4 @@ This was a version bump only for @botonic/webchat-react to align it with other p
423
466
 
424
467
  ## 2.0.1-alpha.0 (2025-11-27)
425
468
 
426
- This was a version bump only for @botonic/webchat-react to align it with other projects, there were no code changes.
469
+ This was a version bump only for @botonic/webchat-react to align it with other projects, there were no code changes.
@@ -1,4 +1,4 @@
1
- import { ChunkIdsGroupedBySourceData, HubtypeChunk, HubtypeSource, PreviewUtils } from '@botonic/shared';
1
+ import { ChunkIdsGroupedBySourceData, HubtypeSource, PreviewUtils } from '@botonic/shared';
2
2
  import { default as React } from 'react';
3
3
  interface UseKnowledgeBaseInfoParams {
4
4
  sourceIds: string[];
@@ -12,6 +12,6 @@ export declare function usePreviewEventMessage({ debugEvent, messageId, previewU
12
12
  eventConfig: DebugEventConfig | undefined;
13
13
  wrapperRef: React.RefObject<HTMLDivElement>;
14
14
  messageId: string | undefined;
15
- previewUtils: PreviewUtils | undefined;
15
+ previewUtils: any;
16
16
  handleContainerClick: (e: React.MouseEvent) => void;
17
17
  };
@@ -11,57 +11,7 @@ export declare function useWebchatMessages(props: WebchatMessagesProps, state: W
11
11
  style?: import('react').CSSProperties;
12
12
  };
13
13
  messageListProps: {
14
- messageActors: import('xstate').ActorRef<import('xstate').MachineSnapshot<{
15
- message: import('@botonic/webchat-core').WebchatMessage;
16
- user: import('@botonic/shared').HubtypeUser;
17
- status: import('@botonic/webchat-core').WebchatMessageStatus;
18
- file?: File;
19
- postMessageActor?: any;
20
- }, {
21
- type: "RETRY";
22
- } | {
23
- type: "UPDATE_MESSAGE_INFO";
24
- message: {
25
- id: string;
26
- data: Record<string, string>;
27
- };
28
- } | {
29
- type: "UPDATE_CUSTOM_PROPS";
30
- props: Record<string, unknown>;
31
- } | {
32
- type: "BUTTON_CLICKED";
33
- button: import('@botonic/shared').BotonicButtonContent;
34
- }, {
35
- [x: string]: import('xstate').ActorRefFromLogic<import('@botonic/webchat-core').PostMessageActor> | undefined;
36
- }, "checkStatus" | "sending" | "idle" | "errorSendingMessage" | "performingPostback", string, import('xstate').NonReducibleUnknown, import('xstate').MetaObject, {
37
- states: {
38
- readonly checkStatus: {};
39
- readonly sending: {};
40
- readonly idle: {};
41
- readonly performingPostback: {};
42
- readonly errorSendingMessage: {};
43
- };
44
- }>, {
45
- type: "RETRY";
46
- } | {
47
- type: "UPDATE_MESSAGE_INFO";
48
- message: {
49
- id: string;
50
- data: Record<string, string>;
51
- };
52
- } | {
53
- type: "UPDATE_CUSTOM_PROPS";
54
- props: Record<string, unknown>;
55
- } | {
56
- type: "BUTTON_CLICKED";
57
- button: import('@botonic/shared').BotonicButtonContent;
58
- }, {
59
- type: "PERSISTENCE.SAVE_MESSAGE";
60
- } | {
61
- type: "WEBVIEW.OPEN";
62
- url: string;
63
- title: string;
64
- }>[];
14
+ messageActors: any[];
65
15
  isTyping: any;
66
16
  hasUserInteracted: boolean;
67
17
  customMessageRenderer: undefined;
@@ -1,4 +1,3 @@
1
- import { WebchatController } from '@botonic/webchat-core';
2
1
  import { default as React } from 'react';
3
2
  import { WebchatStateProps } from '../../hooks/use-webchat-state';
4
3
  export interface WebchatProviderProps extends WebchatStateProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botonic/webchat-react",
3
- "version": "2.35.0-alpha.0",
3
+ "version": "2.36.0",
4
4
  "type": "module",
5
5
  "types": "./index.d.ts",
6
6
  "module": "./index.js",
@@ -30,9 +30,9 @@
30
30
  "peerDependencies": {
31
31
  "react": "^18.0.0",
32
32
  "react-dom": "^18.0.0",
33
- "@botonic/webchat-core": "2.35.0-alpha.0",
34
- "@botonic/shared": "2.35.0-alpha.0",
35
- "@lilara/ui-web-react": ">=0.11.0"
33
+ "@botonic/webchat-core": "2.36.0",
34
+ "@botonic/shared": "2.36.0",
35
+ "@lilara/ui-web-react": ">=0.11.2"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"
package/CLAUDE.md DELETED
@@ -1,174 +0,0 @@
1
- ---
2
- description: webchat-react conventions β€” hook/component split, CSS layers, webchat tokens, message components, inline SVGs, and animation patterns
3
- globs: libs/botonic/webchat-react/**
4
- alwaysApply: false
5
- ---
6
-
7
- # webchat-react
8
-
9
- Conventions specific to `libs/botonic/webchat-react`. Base rules in the root `CLAUDE.md` apply here too.
10
-
11
- ## Hook / Component Split
12
-
13
- Every non-trivial component is split into:
14
-
15
- - **`use-[component].ts`** β€” all state, refs, callbacks, derived values; returns named prop bundles
16
- - **`[component].tsx`** β€” pure render only; spreads prop bundles from the hook
17
-
18
- ```
19
- webchat-input/
20
- β”œβ”€β”€ use-webchat-input.ts
21
- β”œβ”€β”€ webchat-input.tsx
22
- β”œβ”€β”€ webchat-input.module.css
23
- β”œβ”€β”€ webchat-input.spec.tsx
24
- └── index.ts
25
- ```
26
-
27
- **Before touching any component, check:**
28
-
29
- 1. Does a `use-[component].ts` already exist? If not, create it as part of your change.
30
- 2. Is all state, refs, callbacks, and derived values in the hook β€” not in the `.tsx` file?
31
- 3. Does the `.tsx` file only render β€” no `useState`, `useRef`, `useCallback`, or business logic?
32
-
33
- Violating this in a PR is a blocker. When adding a feature or fixing a bug in a component that lacks a hook, refactor it in the same PR.
34
-
35
- Hook return shape uses named bundles, not flat props:
36
-
37
- ```ts
38
- return {
39
- inputProps: { value, onChange: handleChange, onKeyDown: handleKeyDown },
40
- primaryActionProps: { onClick: handleSubmit, 'aria-label': submitLabel },
41
- variants: { isDisabled, hasError, isEmpty },
42
- }
43
- ```
44
-
45
- ## CSS Layers
46
-
47
- The cascade stack, from lowest to highest priority:
48
-
49
- | Layer | Who writes it | Purpose |
50
- | --------------------------- | ------------------------- | ------------------------------------------------------------ |
51
- | `@layer components` | webchat-react | Base component styles |
52
- | `@layer component-variants` | webchat-react | Visual variants of components (e.g. different bubble styles) |
53
- | `@layer overrides` | `webchat-tokens.css` only | Library-default token values |
54
- | _(unlayered)_ | Bot app consumers | Final consumer customizations β€” always wins |
55
-
56
- **Component styles β†’ `@layer components`.**
57
-
58
- ```css
59
- @layer components {
60
- .documentMessage {
61
- width: auto;
62
- }
63
- }
64
- ```
65
-
66
- **CSS animations:** declare `@keyframes` outside any layer (global scope), use them inside `@layer components`. Add `@media (prefers-reduced-motion: reduce)` outside any layer too.
67
-
68
- **Token default values β†’ `@layer overrides`** in `webchat-tokens.css` only. Bot apps override tokens with unlayered CSS in their own `webchat-tokens-overrides.css`.
69
-
70
- ```css
71
- /* webchat-tokens.css */
72
- @layer overrides {
73
- :root {
74
- --webchat-input-bg: var(--lilara-surface-foreground);
75
- --webchat-send-button-color: var(--lilara-primary-500);
76
- }
77
- }
78
- ```
79
-
80
- > **Never add end-consumer override CSS in library code.** The `@layer overrides` in `webchat-tokens.css` is for library defaults only. Bot apps write their own overrides in `webchat-tokens-overrides.css`.
81
-
82
- ## Webchat Tokens (`--webchat-*`)
83
-
84
- Every value a consumer might want to customize must be a `--webchat-*` token defined in `webchat-tokens.css`.
85
-
86
- Pattern: `--webchat-{component}-{property}` with fallback to a semantic foundations token:
87
-
88
- ```css
89
- --webchat-input-bg: var(--lilara-surface-foreground);
90
- --webchat-send-button-color: var(--lilara-primary-500);
91
- --webchat-bubble-bot-bg: var(--lilara-primary-50);
92
- ```
93
-
94
- Prefer `--lilara-primary-*` / `--lilara-secondary-*` over raw `--lilara-color-purple-*` / `--lilara-color-aqua-*`.
95
- Prefer `--lilara-color-focus` over `--lilara-secondary-600` directly.
96
-
97
- ## Message Components
98
-
99
- ```
100
- components/message/[message-type]/
101
- β”œβ”€β”€ [message-type]-message.tsx # forwardRef, extends MessageProps
102
- β”œβ”€β”€ [message-type]-message.module.css
103
- β”œβ”€β”€ [message-type]-message.stories.tsx
104
- └── index.ts
105
- ```
106
-
107
- See the `create-new-message-type` skill for the full step-by-step guide.
108
-
109
- ## Inline SVGs
110
-
111
- No external icon library. Rules:
112
-
113
- 1. Extract each SVG into a **React function component** in `webchat-input/icons/` (e.g. `play-icon.tsx`)
114
- 2. Use `currentColor` for fill/stroke
115
- 3. Set `role='img'` and `aria-hidden={true}` on decorative SVGs
116
- 4. Import and render as `<PlayIcon />` β€” never inline SVG markup inside a component
117
-
118
- ```tsx
119
- // Good β€” dedicated icon component
120
- // webchat-input/icons/play-icon.tsx
121
- export function PlayIcon() {
122
- return (
123
- <svg viewBox='0 0 24 24' fill='currentColor' role='img' aria-hidden={true}>
124
- <polygon points='5,3 19,12 5,21' />
125
- </svg>
126
- )
127
- }
128
-
129
- // Good β€” import and use
130
- import { PlayIcon } from '../icons/play-icon'
131
- const MyButton = () => (
132
- <button>
133
- <PlayIcon />
134
- </button>
135
- )
136
-
137
- // Bad β€” SVG inlined directly inside a component
138
- const MyButton = () => (
139
- <button>
140
- <svg viewBox='0 0 24 24'>...</svg>
141
- </button>
142
- )
143
- ```
144
-
145
- ## Animations
146
-
147
- Prefer CSS keyframes over JS animation libraries. Define keyframes **outside any layer**, use them inside `@layer component-variants`. Always add `prefers-reduced-motion`.
148
-
149
- ```css
150
- @keyframes webchat-fade-in {
151
- from {
152
- opacity: 0;
153
- transform: translateY(4px);
154
- }
155
- to {
156
- opacity: 1;
157
- transform: translateY(0);
158
- }
159
- }
160
-
161
- @layer component-variants {
162
- .messageEnter {
163
- animation: webchat-fade-in var(--webchat-animation-duration, var(--lilara-transition-duration-fast)) var(--webchat-animation-easing, ease-out) both;
164
- }
165
- }
166
-
167
- @media (prefers-reduced-motion: reduce) {
168
- .messageEnter {
169
- animation: none;
170
- }
171
- }
172
- ```
173
-
174
- See the `webchat-animations` skill for token naming conventions and keyframe architecture.