Skip to content

Commit

Permalink
v0.1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
petar-basic committed Oct 18, 2024
1 parent d2dd47c commit 0b2b477
Show file tree
Hide file tree
Showing 36 changed files with 94 additions and 96 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/chat-widget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,20 @@ jobs:
- name: Lerna - Tests
run: npm run test

# - name: E2E - Install dependencies
# run: npm run e2e:install

# - name: E2E - Run automation suite
# run: npm run e2e:run

# - name: Authenticate with private NPM package
# # if: ${{ github.event_name == 'workflow_dispatch' }}
# run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

# - name: NPM Publish ChatWidget
# # if: ${{ github.event_name == 'workflow_dispatch' }}
# run: npm run lerna publish bump patch --yes
- name: E2E - Install dependencies
run: npm run e2e:install

- name: E2E - Run automation suite
run: npm run e2e:run

- name: Authenticate with private NPM package
if: ${{ github.event_name == 'workflow_dispatch' }}
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: NPM Publish ChatWidget
if: ${{ github.event_name == 'workflow_dispatch' }}
# `--force-publish` flag keeps versions consistent across our packages. Totally wild name for this kind of a flag :shrug:
run: |
git config --global user.email "[email protected]"
git config --global user.name "RasaHQ ChatWidget"
npx lerna publish ${{ inputs.version }} --yes --force-publish
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@ npm run build

## How to Use the Chat Widget in a React Application

This guide will show you how to integrate the Rasa chatbot widget into your React application using the `@vortexwest/chat-widget-react` package.
This guide will show you how to integrate the Rasa chatbot widget into your React application using the `@rasahq/chat-widget-react` package.

### Step 1: Install the Package

First, you need to install the chat widget package via NPM. Run the following command in your project directory:

```bash
npm install @vortexwest/chat-widget-react
npm install @rasahq/chat-widget-react
```

### Step 2: Import the Chat Widget

In your React component, import the RasaChatbotWidget from the installed package:

```javascript
import { RasaChatbotWidget } from "@vortexwest/chat-widget-react";
import { RasaChatbotWidget } from "@rasahq/chat-widget-react";
```

### Step 3: Use the Chat Widget
Expand All @@ -90,7 +90,7 @@ export default App;

### Notes:

- **Installing via NPM:** The package `@vortexwest/chat-widget-react` should be installed in your project via NPM. This package provides the RasaChatbotWidget component, making it easy to integrate the chatbot into your React application.
- **Installing via NPM:** The package `@rasahq/chat-widget-react` should be installed in your project via NPM. This package provides the RasaChatbotWidget component, making it easy to integrate the chatbot into your React application.
- **Handling Events:** You can handle various events such as `onChatWidgetOpened`, `onMessageSent`, etc., by passing the corresponding callback functions as props to the RasaChatbotWidget component.
- React example you can find [here](examples/react/src/App.tsx)
- For a complete list of available events and props, refer to the [documentation](packages/ui/src/rasa-chatbot-widget/readme.md)
Expand All @@ -106,7 +106,7 @@ In the <head> section of your HTML file, include the script tag to load the chat
```html
<script
type="module"
src="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.esm.js"
src="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.esm.js"
></script>
```

Expand All @@ -117,7 +117,7 @@ Also, include the CSS file to ensure the widget is styled correctly.
```html
<link
rel="stylesheet"
href="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.css"
href="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.css"
/>
```

Expand All @@ -140,11 +140,11 @@ In the <body> section of your HTML, add the chat widget’s custom element. Make
<title>HTML Example</title>
<script
type="module"
src="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.esm.js"
src="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.esm.js"
></script>
<link
rel="stylesheet"
href="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.css"
href="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.css"
/>
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@vortexwest/e2e-test-suite",
"name": "@rasahq/e2e-test-suite",
"version": "0.1.0",
"private": true,
"description": "E2E test suite with Cypress framework",
Expand Down
4 changes: 2 additions & 2 deletions examples/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<title>HTML Example</title>
<script
type="module"
src="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.esm.js"
src="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.esm.js"
></script>
<link
rel="stylesheet"
href="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.css"
href="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.css"
/>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@vortexwest/chat-widget-react": "^0.1.0",
"@rasahq/chat-widget-react": "^0.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import RasaChatbotWidget from "@vortexwest/chat-widget-react";
import RasaChatbotWidget from "@rasahq/chat-widget-react";

function App() {
return (
Expand Down
9 changes: 2 additions & 7 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.1.17",
"command": {
"publish": {
"yes": true
}
}
}
"version": "0.1.0"
}
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/react/dist/RasaChatbotWidget.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/react/dist/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is created manually to bundle stenciljs components with styles (.css)
// Stenciljs doesn't do this automatically
export { default } from "./RasaChatbotWidget";
import "@vortexwest/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.css";
import "@rasahq/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.css";
2 changes: 1 addition & 1 deletion packages/react/dist/types/RasaChatbotWidget.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
import { RasaChatbotWidget as RasaChatbotWidgetElement } from "@vortexwest/chat-widget-ui/dist/components/rasa-chatbot-widget.js";
import { RasaChatbotWidget as RasaChatbotWidgetElement } from "@rasahq/chat-widget-ui/dist/components/rasa-chatbot-widget.js";
type RasaChatbotWidgetEvents = {
onChatSessionStarted: EventName<CustomEvent<{
sessionId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
import { createComponent } from '@stencil/react-output-target/runtime';
import { RasaChatbotWidget as RasaChatbotWidgetElement, defineCustomElement as defineRasaChatbotWidget } from "@vortexwest/chat-widget-ui/dist/components/rasa-chatbot-widget.js";
import { RasaChatbotWidget as RasaChatbotWidgetElement, defineCustomElement as defineRasaChatbotWidget } from "@rasahq/chat-widget-ui/dist/components/rasa-chatbot-widget.js";
import React from 'react';

type RasaChatbotWidgetEvents = {
Expand Down
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vortexwest/chat-widget-react",
"version": "0.1.17",
"name": "@rasahq/chat-widget-react",
"version": "0.1.0",
"publishConfig": {
"access": "restricted"
},
Expand All @@ -27,7 +27,7 @@
"test": "jest"
},
"dependencies": {
"@vortexwest/chat-widget-ui": "^0.1.17"
"@rasahq/chat-widget-ui": "^0.1.0"
},
"devDependencies": {
"@babel/preset-env": "^7.24.8",
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The core package provides essential functionality to connect and interact with a
Install the core package using npm:

```bash
npm install '@vortexwest/chat-widget-sdk'
npm install '@rasahq/chat-widget-sdk'
```

## Initialization
Expand Down Expand Up @@ -68,7 +68,7 @@ this.rasa.on('message', this.onNewMessage);
## Full Example

```typescript
import { Rasa } from '@vortexwest/chat-widget-sdk';
import { Rasa } from '@rasahq/chat-widget-sdk';

const rasa = new Rasa({
url: 'http://example.com',
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vortexwest/chat-widget-sdk",
"version": "0.1.17",
"name": "@rasahq/chat-widget-sdk",
"version": "0.1.0",
"publishConfig": {
"access": "restricted"
},
Expand Down
7 changes: 3 additions & 4 deletions packages/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ A customizable chat widget built with StencilJS. This widget can be easily integ
To install the chat widget via npm, run the following command:

```bash
npm install @vortexwest/chat-widget-ui
npm install @rasahq/chat-widget-ui
```

### Using CDN

Alternatively, you can use a CDN to include the chat widget in your project:

```html
<script type="module" src="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.esm.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.css" />
<script type="module" src="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.esm.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwidget/rasa-chatwidget.css" />
```

## Usage
Expand Down Expand Up @@ -52,4 +52,3 @@ To add new icons to the project, follow these steps:
By following these steps, you can efficiently add new icons to the project without the need for manual editing of existing components.

### TODO: How to add a new component.

2 changes: 1 addition & 1 deletion packages/ui/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ module.exports = {
'^.+\\.(js|jsx)$': 'babel-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transformIgnorePatterns: ['/node_modules/(?!(@vortexwest)/).*/'],
transformIgnorePatterns: ['/node_modules/(?!(@rasahq)/).*/'],
preset: '@stencil/core/testing',
};
6 changes: 3 additions & 3 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vortexwest/chat-widget-ui",
"version": "0.1.17",
"name": "@rasahq/chat-widget-ui",
"version": "0.1.0",
"publishConfig": {
"access": "restricted"
},
Expand Down Expand Up @@ -31,7 +31,7 @@
"generate:icons": "node ./scripts/generate-icons.js"
},
"dependencies": {
"@vortexwest/chat-widget-sdk": "^0.1.17",
"@rasahq/chat-widget-sdk": "^0.1.0",
"uuid": "^10.0.0"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/ui/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* It contains typing information for all components that exist in this project.
*/
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
import { CarouselElement, QuickReply, QuickReplyMessage } from "@vortexwest/chat-widget-sdk";
import { SenderType } from "@vortexwest/chat-widget-sdk/dist/types/common.types";
export { CarouselElement, QuickReply, QuickReplyMessage } from "@vortexwest/chat-widget-sdk";
export { SenderType } from "@vortexwest/chat-widget-sdk/dist/types/common.types";
import { CarouselElement, QuickReply, QuickReplyMessage } from "@rasahq/chat-widget-sdk";
import { SenderType } from "@rasahq/chat-widget-sdk/dist/types/common.types";
export { CarouselElement, QuickReply, QuickReplyMessage } from "@rasahq/chat-widget-sdk";
export { SenderType } from "@rasahq/chat-widget-sdk/dist/types/common.types";
export namespace Components {
interface ChatMessage {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/carousel/carousel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CarouselElement } from '@vortexwest/chat-widget-sdk';
import { CarouselElement } from '@rasahq/chat-widget-sdk';
import { Component, h, State, Element, Prop, Event, EventEmitter } from '@stencil/core';
import { messageQueueService } from '../../store/message-queue';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CUSTOM_ERROR_NAME, CustomErrorClass, ErrorSeverity } from '@vortexwest/chat-widget-sdk';
import { CUSTOM_ERROR_NAME, CustomErrorClass, ErrorSeverity } from '@rasahq/chat-widget-sdk';
import { Component, Host, h } from '@stencil/core';

import { errorMessageService } from '../../store/error-message';
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/error-toast/error-toast.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Element, Host, State, h } from '@stencil/core';

import { CustomErrorClass } from '@vortexwest/chat-widget-sdk';
import { CustomErrorClass } from '@rasahq/chat-widget-sdk';
import { configStore } from '../../store/config-store';
import { errorMessageService } from '../../store/error-message';

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/quick-reply/quick-reply.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, Event, EventEmitter, Host, Listen, Prop, State, h } from '@stencil/core';
import { QuickReply, QuickReplyMessage, SENDER } from '@vortexwest/chat-widget-sdk';
import { QuickReply, QuickReplyMessage, SENDER } from '@rasahq/chat-widget-sdk';

import { messageQueueService } from '../../store/message-queue';
import { widgetState } from '../../store/widget-state-store';
Expand Down
Loading

0 comments on commit 0b2b477

Please sign in to comment.