@botonic/shared 2.28.0 → 2.29.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,13 @@
1
+ ## 2.29.0 (2026-05-12)
2
+
3
+ ### 🚀 Features
4
+
5
+ - rating component ([#882](https://github.com/metis-ai/hubtype-product/pull/882))
6
+
7
+ ### ❤️ Thank You
8
+
9
+ - Marc Rabat @vanbasten17
10
+
1
11
  ## 2.28.0 (2026-05-06)
2
12
 
3
13
  This was a version bump only for @botonic/shared to align it with other projects, there were no code changes.
package/README.md CHANGED
@@ -27,3 +27,14 @@ pnpm add @botonic/shared
27
27
  # or
28
28
  npm install @botonic/shared
29
29
  ```
30
+
31
+ ## Webchat rating submit payload (builtin)
32
+
33
+ Built-in webchat rating UI (and demos that follow it) send postbacks with the same **`prefix|JSON`** pattern as webchat client settings:
34
+
35
+ - **Prefix:** `submit-webchat-rating` (`SUBMIT_WEBCHAT_RATING_PAYLOAD`).
36
+ - **Helpers:** `createSubmitWebchatRatingPayload`, `parseSubmitWebchatRatingPayload`, `isSubmitWebchatRatingPayload`.
37
+
38
+ Flow Builder **CMS** rating nodes may still use **`agent-rating|…`** and other CMS-defined payloads; those are separate from this builtin contract. Custom **`payloads`** arrays on rating custom messages override defaults and are sent as-is.
39
+
40
+ With **`@botonic/webchat-react`**, the UI for **`BOTONIC_OUTPUT_RATING`** (`botonic-output-rating`) is registered automatically in `customMessages`. Pass your own component under the same key only when you need to replace the default **`RatingMessage`**.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botonic/shared",
3
- "version": "2.28.0",
3
+ "version": "2.29.0",
4
4
  "type": "module",
5
5
  "module": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -6,5 +6,6 @@ export * from './session';
6
6
  export * from './settings';
7
7
  export * from './types';
8
8
  export * from './webchat-client-settings';
9
+ export * from './webchat-outputs';
9
10
  export * from './webviews-session';
10
11
  export * from './whatsapp-outputs';
@@ -6,6 +6,7 @@ export * from './session';
6
6
  export * from './settings';
7
7
  export * from './types';
8
8
  export * from './webchat-client-settings';
9
+ export * from './webchat-outputs';
9
10
  export * from './webviews-session';
10
11
  export * from './whatsapp-outputs';
11
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../libs/botonic/shared/src/lib/domain/botonic/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,2BAA2B,CAAA;AACzC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../libs/botonic/shared/src/lib/domain/botonic/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,2BAA2B,CAAA;AACzC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './webchat-output-rating';
@@ -0,0 +1,2 @@
1
+ export * from './webchat-output-rating';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../libs/botonic/shared/src/lib/domain/botonic/webchat-outputs/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Built-in webchat output names emitted by Hubtype Botonic packages.
3
+ *
4
+ * `@botonic/webchat-react` registers matching renderers automatically (merged with
5
+ * embedder `customMessages`; embedder keys override builtins). You only need to add
6
+ * keys here yourself when using a custom webchat composition that does not use the
7
+ * default provider merge.
8
+ *
9
+ * Note: Flow Builder **content node** types (e.g. `type: 'rating'` in flow JSON) are
10
+ * separate from the wire **`name`** on custom chat messages.
11
+ */
12
+ export * from './webchat-output-rating';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Built-in webchat output names emitted by Hubtype Botonic packages.
3
+ *
4
+ * `@botonic/webchat-react` registers matching renderers automatically (merged with
5
+ * embedder `customMessages`; embedder keys override builtins). You only need to add
6
+ * keys here yourself when using a custom webchat composition that does not use the
7
+ * default provider merge.
8
+ *
9
+ * Note: Flow Builder **content node** types (e.g. `type: 'rating'` in flow JSON) are
10
+ * separate from the wire **`name`** on custom chat messages.
11
+ */
12
+ export * from './webchat-output-rating';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../../libs/botonic/shared/src/lib/domain/botonic/webchat-outputs/webchat-output-rating/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,yBAAyB,CAAA"}
@@ -0,0 +1,14 @@
1
+ export declare const WEBCHAT_OUTPUT_RATING: "botonic-output-rating";
2
+ /** Matches Flow Builder / CMS `rating_type` wire values. */
3
+ export type WebchatOutputRatingRatingType = 'stars' | 'smileys';
4
+ export interface WebchatOutputRatingButton {
5
+ value: number;
6
+ payload: string;
7
+ }
8
+ export interface WebchatOutputRatingProps {
9
+ messageText?: string;
10
+ buttonText?: string;
11
+ /** JSON-serialised {@link WebchatOutputRatingButton} entries — one per rating option. */
12
+ payloads?: string[];
13
+ ratingType?: WebchatOutputRatingRatingType;
14
+ }
@@ -0,0 +1,2 @@
1
+ export const WEBCHAT_OUTPUT_RATING = 'botonic-output-rating';
2
+ //# sourceMappingURL=webchat-output-rating.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webchat-output-rating.js","sourceRoot":"","sources":["../../../../../../../../../../libs/botonic/shared/src/lib/domain/botonic/webchat-outputs/webchat-output-rating/webchat-output-rating.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAgC,CAAA"}