@telelogx/analytick-widget 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/README.md +727 -0
- package/dist/analytick-widget.css +1 -0
- package/dist/analytick-widget.es.js +8326 -0
- package/dist/analytick-widget.umd.js +1 -0
- package/dist/demo.html +123 -0
- package/dist/vite.svg +1 -0
- package/package.json +67 -0
package/dist/demo.html
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Analytick Widget - Script Tag Integration</title>
|
|
7
|
+
<style>
|
|
8
|
+
body {
|
|
9
|
+
font-family: Arial, sans-serif;
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 20px;
|
|
12
|
+
background-color: #f5f5f5;
|
|
13
|
+
}
|
|
14
|
+
.container {
|
|
15
|
+
max-width: 800px;
|
|
16
|
+
margin: 0 auto;
|
|
17
|
+
background: white;
|
|
18
|
+
padding: 20px;
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
21
|
+
}
|
|
22
|
+
.demo-section {
|
|
23
|
+
margin: 20px 0;
|
|
24
|
+
padding: 20px;
|
|
25
|
+
border: 1px solid #ddd;
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
}
|
|
28
|
+
.code-block {
|
|
29
|
+
background: #f8f9fa;
|
|
30
|
+
padding: 15px;
|
|
31
|
+
border-radius: 4px;
|
|
32
|
+
font-family: 'Courier New', monospace;
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
overflow-x: auto;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
37
|
+
</head>
|
|
38
|
+
<body>
|
|
39
|
+
<div class="container">
|
|
40
|
+
<h1>Analytick Widget Integration Demo</h1>
|
|
41
|
+
|
|
42
|
+
<div class="demo-section">
|
|
43
|
+
<h2>Basic Integration</h2>
|
|
44
|
+
<p>The widget is embedded using a simple custom element:</p>
|
|
45
|
+
<div class="code-block">
|
|
46
|
+
<analytick-widget
|
|
47
|
+
org-id="your-org-id"
|
|
48
|
+
widget-id="your-widget-id"
|
|
49
|
+
base-url="https://your-api-domain.com">
|
|
50
|
+
</analytick-widget>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div class="demo-section">
|
|
55
|
+
<h2>Live Widget</h2>
|
|
56
|
+
<p>The widget below is a live example (using demo configuration):</p>
|
|
57
|
+
|
|
58
|
+
<!-- Widget Integration -->
|
|
59
|
+
<analytick-widget
|
|
60
|
+
org-id="0DZ8CNH8AKV5E"
|
|
61
|
+
widget-id="68a0a4aecb3bbc293b0e5071"
|
|
62
|
+
base-url="http://localhost:8080/analytick"
|
|
63
|
+
primary-color="#3C5BFF"
|
|
64
|
+
secondary-color="#6B7280">
|
|
65
|
+
</analytick-widget>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div class="demo-section">
|
|
69
|
+
<h2>Multiple Widgets</h2>
|
|
70
|
+
<p>Multiple widgets can be embedded independently:</p>
|
|
71
|
+
|
|
72
|
+
<!-- Second Widget with different config -->
|
|
73
|
+
<analytick-widget
|
|
74
|
+
org-id="0DZ8CNH8AKV5E"
|
|
75
|
+
widget-id="68a0a4aecb3bbc293b0e5071"
|
|
76
|
+
base-url="http://localhost:8080/analytick"
|
|
77
|
+
primary-color="#25D366"
|
|
78
|
+
secondary-color="#128C7E">
|
|
79
|
+
</analytick-widget>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div class="demo-section">
|
|
83
|
+
<h2>Manual Initialization (Optional)</h2>
|
|
84
|
+
<p>For advanced use cases, you can manually initialize the widget:</p>
|
|
85
|
+
<div class="code-block">
|
|
86
|
+
<script>
|
|
87
|
+
// Check if widget is loaded
|
|
88
|
+
if (window.AnalytickWidget) {
|
|
89
|
+
console.log('Widget version:', window.AnalytickWidget.version);
|
|
90
|
+
|
|
91
|
+
// Manual initialization if needed
|
|
92
|
+
window.AnalytickWidget.init();
|
|
93
|
+
}
|
|
94
|
+
</script>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<div class="demo-section">
|
|
99
|
+
<h2>Integration Instructions</h2>
|
|
100
|
+
<ol>
|
|
101
|
+
<li>Include the widget script in your HTML head or before closing body tag</li>
|
|
102
|
+
<li>Add the custom element where you want the widget to appear</li>
|
|
103
|
+
<li>Configure the org-id, widget-id, and base-url attributes</li>
|
|
104
|
+
<li>The widget will automatically initialize and be ready to use</li>
|
|
105
|
+
</ol>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
<!-- Widget Script - This would be served from your CDN -->
|
|
110
|
+
<script src="../dist/analytick-widget.umd.js"></script>
|
|
111
|
+
|
|
112
|
+
<!-- Optional: Manual initialization example -->
|
|
113
|
+
<script>
|
|
114
|
+
// Widget is automatically initialized, but you can access it globally
|
|
115
|
+
console.log('Analytick Widget loaded:', !!window.AnalytickWidget);
|
|
116
|
+
|
|
117
|
+
// Example of accessing widget programmatically
|
|
118
|
+
if (window.AnalytickWidget) {
|
|
119
|
+
console.log('Widget version:', window.AnalytickWidget.version);
|
|
120
|
+
}
|
|
121
|
+
</script>
|
|
122
|
+
</body>
|
|
123
|
+
</html>
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@telelogx/analytick-widget",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Customizable web widget for Analytick platform",
|
|
5
|
+
"author": "Analytick",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/analytick-widget.umd.js",
|
|
9
|
+
"module": "./dist/analytick-widget.es.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [
|
|
14
|
+
"widget",
|
|
15
|
+
"analytick",
|
|
16
|
+
"chat"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "vite --config vite.config.dev.ts",
|
|
20
|
+
"dev:test": "node scripts/dev-server.js",
|
|
21
|
+
"serve:examples": "npx http-server examples -p 3001 -o /dev-index.html --cors",
|
|
22
|
+
"build": "npm run clean && vite build && npm run copy-demo && npm run size-check",
|
|
23
|
+
"build:dev": "npm run clean && tsc -b && vite build --config vite.config.dev.ts",
|
|
24
|
+
"build:prod": "npm run clean && tsc -b && vite build --mode production && npm run size-check",
|
|
25
|
+
"build:analyze": "npm run build && npx vite-bundle-analyzer dist/analytick-widget.umd.js",
|
|
26
|
+
"clean": "rmdir /s /q dist 2>nul || echo \"Directory already clean\"",
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"stress-test": "node scripts/stress-test.js",
|
|
29
|
+
"stress-test:config": "node scripts/stress-test.js --config scripts/stress-config.json",
|
|
30
|
+
"stress-test:analyze": "node scripts/analyze-results.js",
|
|
31
|
+
"lint": "biome check .",
|
|
32
|
+
"lint:fix": "biome check --apply .",
|
|
33
|
+
"format": "biome format --write .",
|
|
34
|
+
"fix": "biome format --write . && biome check --write .",
|
|
35
|
+
"preview": "vite preview --host",
|
|
36
|
+
"size-check": "node scripts/build-check.js",
|
|
37
|
+
"copy-demo": "copy examples\\script-tag-integration.html dist\\demo.html 2>nul || echo \"Demo file copied\"",
|
|
38
|
+
"copy-widget": "copy dist\\analytick-widget.umd.js examples\\ 2>nul || echo \"Widget copied to examples\""
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@stomp/stompjs": "^7.0.0",
|
|
42
|
+
"i18next": "^25.4.1",
|
|
43
|
+
"i18next-browser-languagedetector": "^8.0.2",
|
|
44
|
+
"preact": "^10.27.0",
|
|
45
|
+
"react-i18next": "^15.1.4"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@biomejs/biome": "^2.2.2",
|
|
49
|
+
"@preact/preset-vite": "^2.10.2",
|
|
50
|
+
"@tailwindcss/postcss": "^4.1.12",
|
|
51
|
+
"@tailwindcss/typography": "^0.5.16",
|
|
52
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
53
|
+
"@testing-library/preact": "^3.2.4",
|
|
54
|
+
"@types/node": "^22.10.5",
|
|
55
|
+
"autoprefixer": "^10.4.21",
|
|
56
|
+
"http-server": "^14.1.1",
|
|
57
|
+
"jsdom": "^26.1.0",
|
|
58
|
+
"postcss": "^8.5.6",
|
|
59
|
+
"tailwind-scrollbar": "^4.0.2",
|
|
60
|
+
"tailwindcss": "^4.1.12",
|
|
61
|
+
"terser": "^5.36.0",
|
|
62
|
+
"typescript": "~5.8.3",
|
|
63
|
+
"vite": "^7.1.2",
|
|
64
|
+
"vitest": "^3.2.4",
|
|
65
|
+
"ws": "^8.18.0"
|
|
66
|
+
}
|
|
67
|
+
}
|