From be76e73937c2b4da45d0f2b19775efb1fa92c6eb Mon Sep 17 00:00:00 2001 From: relja-rasa Date: Wed, 29 Jan 2025 16:36:24 +0100 Subject: [PATCH] Add generated content after npm run build --- packages/react/dist/RasaRating.js | 13 +++++ packages/react/dist/RasaRating.js.map | 1 + packages/react/dist/types/RasaRating.d.ts | 9 ++++ .../stencil-generated/RasaRating.ts | 25 ++++++++++ packages/ui/src/components.d.ts | 48 +++++++++++++++++++ packages/ui/src/components/rating/readme.md | 25 ++++++++++ 6 files changed, 121 insertions(+) create mode 100644 packages/react/dist/RasaRating.js create mode 100644 packages/react/dist/RasaRating.js.map create mode 100644 packages/react/dist/types/RasaRating.d.ts create mode 100644 packages/react/lib/components/stencil-generated/RasaRating.ts diff --git a/packages/react/dist/RasaRating.js b/packages/react/dist/RasaRating.js new file mode 100644 index 0000000..ca5897f --- /dev/null +++ b/packages/react/dist/RasaRating.js @@ -0,0 +1,13 @@ +'use client'; +import { RasaRating as RasaRatingElement, defineCustomElement as defineRasaRating } from "@rasahq/chat-widget-ui/dist/components/rasa-rating.js"; +import { createComponent } from '@stencil/react-output-target/runtime'; +import React from 'react'; +const RasaRating = createComponent({ + tagName: 'rasa-rating', + elementClass: RasaRatingElement, + react: React, + events: { onRatingSelected: 'ratingSelected' }, + defineCustomElement: defineRasaRating +}); +export default RasaRating; +//# sourceMappingURL=RasaRating.js.map \ No newline at end of file diff --git a/packages/react/dist/RasaRating.js.map b/packages/react/dist/RasaRating.js.map new file mode 100644 index 0000000..612fc2f --- /dev/null +++ b/packages/react/dist/RasaRating.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RasaRating.js","sourceRoot":"","sources":["../lib/components/stencil-generated/RasaRating.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AASb,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,mBAAmB,IAAI,gBAAgB,EAAE,MAAM,uDAAuD,CAAC;AAEjJ,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,UAAU,GAA6E,eAAe,CAAsC;IAC9I,OAAO,EAAE,aAAa;IACtB,YAAY,EAAE,iBAAiB;IAC/B,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,EAAE,gBAAgB,EAAE,gBAAgB,EAAsB;IAClE,mBAAmB,EAAE,gBAAgB;CACxC,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC"} \ No newline at end of file diff --git a/packages/react/dist/types/RasaRating.d.ts b/packages/react/dist/types/RasaRating.d.ts new file mode 100644 index 0000000..68c5240 --- /dev/null +++ b/packages/react/dist/types/RasaRating.d.ts @@ -0,0 +1,9 @@ +import { RasaRating as RasaRatingElement } from "@rasahq/chat-widget-ui/dist/components/rasa-rating.js"; +import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime'; +type RasaRatingEvents = { + onRatingSelected: EventName>; +}; +declare const RasaRating: StencilReactComponent; +export default RasaRating; diff --git a/packages/react/lib/components/stencil-generated/RasaRating.ts b/packages/react/lib/components/stencil-generated/RasaRating.ts new file mode 100644 index 0000000..fa4adee --- /dev/null +++ b/packages/react/lib/components/stencil-generated/RasaRating.ts @@ -0,0 +1,25 @@ +'use client'; + +/** + * This file was automatically generated by the Stencil React Output Target. + * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/* eslint-disable */ + +import { RasaRating as RasaRatingElement, defineCustomElement as defineRasaRating } from "@rasahq/chat-widget-ui/dist/components/rasa-rating.js"; +import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime'; +import { createComponent } from '@stencil/react-output-target/runtime'; +import React from 'react'; + +type RasaRatingEvents = { onRatingSelected: EventName> }; + +const RasaRating: StencilReactComponent = /*@__PURE__*/ createComponent({ + tagName: 'rasa-rating', + elementClass: RasaRatingElement, + react: React, + events: { onRatingSelected: 'ratingSelected' } as RasaRatingEvents, + defineCustomElement: defineRasaRating +}); + +export default RasaRating; diff --git a/packages/ui/src/components.d.ts b/packages/ui/src/components.d.ts index 3c303b8..691c263 100644 --- a/packages/ui/src/components.d.ts +++ b/packages/ui/src/components.d.ts @@ -422,6 +422,16 @@ export namespace Components { */ "quickReplyId": string; } + interface RasaRating { + /** + * List of rating options, each containing a value, icon, and label. + */ + "options": { value: string; icon: string; label: string }[]; + /** + * Instructional text displayed above the rating options. + */ + "text": string; + } interface RasaSessionDivider { /** * Session start datetime @@ -509,6 +519,10 @@ export interface RasaQuickReplyCustomEvent extends CustomEvent { detail: T; target: HTMLRasaQuickReplyElement; } +export interface RasaRatingCustomEvent extends CustomEvent { + detail: T; + target: HTMLRasaRatingElement; +} export interface RasaTextCustomEvent extends CustomEvent { detail: T; target: HTMLRasaTextElement; @@ -722,6 +736,23 @@ declare global { prototype: HTMLRasaQuickReplyElement; new (): HTMLRasaQuickReplyElement; }; + interface HTMLRasaRatingElementEventMap { + "ratingSelected": { value: string }; + } + interface HTMLRasaRatingElement extends Components.RasaRating, HTMLStencilElement { + addEventListener(type: K, listener: (this: HTMLRasaRatingElement, ev: RasaRatingCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: HTMLRasaRatingElement, ev: RasaRatingCustomEvent) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + } + var HTMLRasaRatingElement: { + prototype: HTMLRasaRatingElement; + new (): HTMLRasaRatingElement; + }; interface HTMLRasaSessionDividerElement extends Components.RasaSessionDivider, HTMLStencilElement { } var HTMLRasaSessionDividerElement: { @@ -787,6 +818,7 @@ declare global { "rasa-image": HTMLRasaImageElement; "rasa-image-message": HTMLRasaImageMessageElement; "rasa-quick-reply": HTMLRasaQuickReplyElement; + "rasa-rating": HTMLRasaRatingElement; "rasa-session-divider": HTMLRasaSessionDividerElement; "rasa-text": HTMLRasaTextElement; "rasa-text-message": HTMLRasaTextMessageElement; @@ -1262,6 +1294,20 @@ declare namespace LocalJSX { */ "quickReplyId"?: string; } + interface RasaRating { + /** + * Event emitted when a rating option is selected. + */ + "onRatingSelected"?: (event: RasaRatingCustomEvent<{ value: string }>) => void; + /** + * List of rating options, each containing a value, icon, and label. + */ + "options"?: { value: string; icon: string; label: string }[]; + /** + * Instructional text displayed above the rating options. + */ + "text"?: string; + } interface RasaSessionDivider { /** * Session start datetime @@ -1355,6 +1401,7 @@ declare namespace LocalJSX { "rasa-image": RasaImage; "rasa-image-message": RasaImageMessage; "rasa-quick-reply": RasaQuickReply; + "rasa-rating": RasaRating; "rasa-session-divider": RasaSessionDivider; "rasa-text": RasaText; "rasa-text-message": RasaTextMessage; @@ -1388,6 +1435,7 @@ declare module "@stencil/core" { "rasa-image": LocalJSX.RasaImage & JSXBase.HTMLAttributes; "rasa-image-message": LocalJSX.RasaImageMessage & JSXBase.HTMLAttributes; "rasa-quick-reply": LocalJSX.RasaQuickReply & JSXBase.HTMLAttributes; + "rasa-rating": LocalJSX.RasaRating & JSXBase.HTMLAttributes; "rasa-session-divider": LocalJSX.RasaSessionDivider & JSXBase.HTMLAttributes; "rasa-text": LocalJSX.RasaText & JSXBase.HTMLAttributes; "rasa-text-message": LocalJSX.RasaTextMessage & JSXBase.HTMLAttributes; diff --git a/packages/ui/src/components/rating/readme.md b/packages/ui/src/components/rating/readme.md index e69de29..ee7d6a4 100644 --- a/packages/ui/src/components/rating/readme.md +++ b/packages/ui/src/components/rating/readme.md @@ -0,0 +1,25 @@ +# rasa-rating + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| --------- | --------- | ----------------------------------------------------------------- | --------------------------------------------------- | ----------- | +| `options` | -- | List of rating options, each containing a value, icon, and label. | `{ value: string; icon: string; label: string; }[]` | `undefined` | +| `text` | `text` | Instructional text displayed above the rating options. | `string` | `undefined` | + + +## Events + +| Event | Description | Type | +| ---------------- | ----------------------------------------------- | --------------------------------- | +| `ratingSelected` | Event emitted when a rating option is selected. | `CustomEvent<{ value: string; }>` | + + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)*