@creaditor/business-ai 1.0.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/LICENSE +22 -0
- package/README.md +114 -0
- package/dist/business-ai.es.js +59187 -0
- package/dist/business-ai.umd.js +1365 -0
- package/dist/style.css +1 -0
- package/package.json +73 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Creaditor
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# @creaditor/business-ai
|
|
2
|
+
|
|
3
|
+
Business AI component built with Vite, React, MUI, and Shadow DOM for easy embedding into any website.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Built with Vite + React + TypeScript
|
|
8
|
+
- Material-UI (MUI) components
|
|
9
|
+
- Shadow DOM encapsulation for style isolation
|
|
10
|
+
- Easy to embed into any website
|
|
11
|
+
- Web Component standard
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
### Via npm
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @creaditor/business-ai
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Via CDN (unpkg)
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<script src="https://unpkg.com/@creaditor/business-ai@latest/dist/business-ai.umd.js"></script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Via CDN (jsDelivr)
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<script src="https://cdn.jsdelivr.net/npm/@creaditor/business-ai@latest/dist/business-ai.umd.js"></script>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
### CDN Usage (Simplest - No Build Step)
|
|
36
|
+
|
|
37
|
+
The UMD build includes all dependencies (React, MUI, etc.) bundled, so you only need one script tag:
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<!DOCTYPE html>
|
|
41
|
+
<html>
|
|
42
|
+
<head>
|
|
43
|
+
<meta charset="UTF-8">
|
|
44
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
45
|
+
<title>Business AI</title>
|
|
46
|
+
|
|
47
|
+
<!-- Load from CDN (unpkg) -->
|
|
48
|
+
<script src="https://unpkg.com/@creaditor/business-ai@latest/dist/business-ai.umd.js"></script>
|
|
49
|
+
|
|
50
|
+
<!-- Or use jsDelivr -->
|
|
51
|
+
<!-- <script src="https://cdn.jsdelivr.net/npm/@creaditor/business-ai@latest/dist/business-ai.umd.js"></script> -->
|
|
52
|
+
</head>
|
|
53
|
+
<body>
|
|
54
|
+
<!-- Use the web component -->
|
|
55
|
+
<cdtr-business-ai></cdtr-business-ai>
|
|
56
|
+
|
|
57
|
+
<script>
|
|
58
|
+
// The component auto-registers when the script loads
|
|
59
|
+
// Optional: Access via global if needed
|
|
60
|
+
console.log('Business AI loaded:', window.BusinessAI);
|
|
61
|
+
|
|
62
|
+
// Example: Set properties programmatically
|
|
63
|
+
const element = document.querySelector('cdtr-business-ai');
|
|
64
|
+
// element.websiteUrl = 'https://example.com';
|
|
65
|
+
</script>
|
|
66
|
+
</body>
|
|
67
|
+
</html>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Note:** The component uses Shadow DOM, so styles are automatically isolated. The CSS file is optional and only needed if you want to override global styles.
|
|
71
|
+
|
|
72
|
+
### As an ES Module (npm)
|
|
73
|
+
|
|
74
|
+
```javascript
|
|
75
|
+
import '@creaditor/business-ai';
|
|
76
|
+
|
|
77
|
+
// The custom element is now registered
|
|
78
|
+
const element = document.createElement('cdtr-business-ai');
|
|
79
|
+
document.body.appendChild(element);
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### As a Web Component (Local File)
|
|
83
|
+
|
|
84
|
+
```html
|
|
85
|
+
<!DOCTYPE html>
|
|
86
|
+
<html>
|
|
87
|
+
<head>
|
|
88
|
+
<script type="module" src="path/to/business-ai.es.js"></script>
|
|
89
|
+
</head>
|
|
90
|
+
<body>
|
|
91
|
+
<cdtr-business-ai></cdtr-business-ai>
|
|
92
|
+
</body>
|
|
93
|
+
</html>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Development
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Install dependencies
|
|
100
|
+
npm install
|
|
101
|
+
|
|
102
|
+
# Start dev server
|
|
103
|
+
npm run dev
|
|
104
|
+
|
|
105
|
+
# Build for production
|
|
106
|
+
npm run build
|
|
107
|
+
|
|
108
|
+
# Preview production build
|
|
109
|
+
npm run preview
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
MIT
|