@helpway/react 0.2.0 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helpway/react",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Official React SDK for Helpway — drop-in AI chat support widget with headless hooks for custom UIs.",
5
5
  "keywords": [
6
6
  "helpway",
@@ -534,6 +534,20 @@
534
534
  width: 24px;
535
535
  height: 24px;
536
536
  }
537
+ .hw-header-bot-icon--team {
538
+ background: var(--hw-brand, #0a0a0a);
539
+ color: #fff;
540
+ }
541
+ .hw-header-agent-img {
542
+ width: 100%;
543
+ height: 100%;
544
+ object-fit: cover;
545
+ }
546
+ .hw-header-agent-initials {
547
+ font-size: 11px;
548
+ font-weight: 600;
549
+ line-height: 1;
550
+ }
537
551
 
538
552
  .hw-header-info {
539
553
  flex: 1;
@@ -886,6 +900,21 @@
886
900
  width: 20px;
887
901
  height: 20px;
888
902
  }
903
+ .hw-conv-card-avatar-img {
904
+ width: 100%;
905
+ height: 100%;
906
+ object-fit: cover;
907
+ }
908
+ .hw-conv-card-avatar--team {
909
+ background: var(--hw-brand, #0a0a0a);
910
+ color: #fff;
911
+ }
912
+ .hw-conv-card-avatar-initials {
913
+ font-size: 12px;
914
+ font-weight: 600;
915
+ line-height: 1;
916
+ letter-spacing: 0.02em;
917
+ }
889
918
 
890
919
  .hw-conv-card-content {
891
920
  flex: 1;
@@ -1086,6 +1115,43 @@
1086
1115
  /* Flex column with constrained children — min-width:0 allows children to
1087
1116
  honor their own max-width rather than inflating to content width. */
1088
1117
  min-width: 0;
1118
+ scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
1119
+ scrollbar-width: thin;
1120
+ }
1121
+
1122
+ .hw-messages::-webkit-scrollbar {
1123
+ width: 10px;
1124
+ height: 10px;
1125
+ }
1126
+
1127
+ .hw-messages::-webkit-scrollbar-track {
1128
+ background: transparent;
1129
+ }
1130
+
1131
+ .hw-messages::-webkit-scrollbar-thumb {
1132
+ background: rgba(0, 0, 0, 0.16);
1133
+ background-clip: content-box;
1134
+ border: 3px solid transparent;
1135
+ border-radius: 999px;
1136
+ }
1137
+
1138
+ .hw-messages::-webkit-scrollbar-thumb:hover {
1139
+ background: rgba(0, 0, 0, 0.28);
1140
+ background-clip: content-box;
1141
+ }
1142
+
1143
+ .hw-widget[data-theme="dark"] .hw-messages {
1144
+ scrollbar-color: rgba(255, 255, 255, 0.26) transparent;
1145
+ }
1146
+
1147
+ .hw-widget[data-theme="dark"] .hw-messages::-webkit-scrollbar-thumb {
1148
+ background: rgba(255, 255, 255, 0.2);
1149
+ background-clip: content-box;
1150
+ }
1151
+
1152
+ .hw-widget[data-theme="dark"] .hw-messages::-webkit-scrollbar-thumb:hover {
1153
+ background: rgba(255, 255, 255, 0.32);
1154
+ background-clip: content-box;
1089
1155
  }
1090
1156
 
1091
1157
  /* ── Empty Messages ─────────────────────────── */
@@ -1164,6 +1230,11 @@
1164
1230
  align-self: flex-start;
1165
1231
  }
1166
1232
 
1233
+ .hw-msg--ai {
1234
+ width: 100%;
1235
+ max-width: 100%;
1236
+ }
1237
+
1167
1238
  .hw-msg-body {
1168
1239
  display: flex;
1169
1240
  flex-direction: column;
@@ -1206,21 +1277,54 @@
1206
1277
  color: var(--hw-text);
1207
1278
  border-bottom-left-radius: 4px;
1208
1279
  white-space: normal; /* AI messages use HTML rendering (markdown), not pre-wrap */
1280
+ max-width: min(100%, 640px);
1281
+ }
1282
+
1283
+ .hw-msg--ai .hw-msg-body {
1284
+ width: 100%;
1285
+ }
1286
+
1287
+ .hw-msg--ai .hw-msg-bubble:has(.hw-code),
1288
+ .hw-msg--ai .hw-msg-bubble:has(pre) {
1289
+ width: 100%;
1290
+ }
1291
+
1292
+ .hw-msg--ai .hw-code {
1293
+ width: 100%;
1294
+ box-sizing: border-box;
1209
1295
  }
1210
1296
 
1211
- /* Meta (time + sender label) — hidden, show on hover */
1297
+ /* Meta (clock always visible; sender/copy reveal on hover) */
1212
1298
  .hw-msg-meta {
1299
+ display: inline-flex;
1300
+ align-items: center;
1301
+ gap: 4px;
1213
1302
  font-size: 11px;
1214
1303
  color: var(--hw-text-3);
1215
1304
  margin-top: 3px;
1216
1305
  padding: 0 4px;
1217
- opacity: 0;
1218
- transition: opacity 0.15s;
1306
+ opacity: 1;
1219
1307
  font-variant-numeric: tabular-nums;
1308
+ min-height: 20px;
1309
+ }
1310
+
1311
+ .hw-msg-time {
1312
+ opacity: 0.72;
1220
1313
  }
1221
1314
 
1222
- .hw-msg:hover .hw-msg-meta,
1223
- .hw-msg:focus-within .hw-msg-meta {
1315
+ .hw-msg-hover-meta {
1316
+ max-width: 0;
1317
+ opacity: 0;
1318
+ overflow: hidden;
1319
+ white-space: nowrap;
1320
+ transition:
1321
+ max-width 180ms ease,
1322
+ opacity 140ms ease;
1323
+ }
1324
+
1325
+ .hw-msg:hover .hw-msg-hover-meta,
1326
+ .hw-msg:focus-within .hw-msg-hover-meta {
1327
+ max-width: 180px;
1224
1328
  opacity: 1;
1225
1329
  }
1226
1330
 
@@ -2260,6 +2364,9 @@
2260
2364
  .hw-msg {
2261
2365
  max-width: 82%;
2262
2366
  }
2367
+ .hw-msg--ai {
2368
+ max-width: 100%;
2369
+ }
2263
2370
  }
2264
2371
 
2265
2372
  /* ════════════════════════════════════════════════
@@ -2635,7 +2742,8 @@
2635
2742
  display: flex;
2636
2743
  align-items: center;
2637
2744
  justify-content: space-between;
2638
- padding: 6px 12px;
2745
+ gap: 10px;
2746
+ padding: 7px 8px 7px 12px;
2639
2747
  font-size: 11px;
2640
2748
  color: var(--hw-text-2, #6b7280);
2641
2749
  background: rgba(0, 0, 0, 0.03);
@@ -2648,24 +2756,85 @@
2648
2756
  font-weight: 500;
2649
2757
  }
2650
2758
 
2651
- .hw-code-copy {
2759
+ .hw-code-actions {
2652
2760
  display: inline-flex;
2653
2761
  align-items: center;
2654
- gap: 4px;
2655
- padding: 2px 8px;
2656
- font-size: 11px;
2762
+ gap: 1px;
2763
+ }
2764
+
2765
+ .hw-code-action {
2766
+ position: relative;
2767
+ display: inline-flex;
2768
+ align-items: center;
2769
+ justify-content: center;
2770
+ width: 22px;
2771
+ height: 22px;
2772
+ padding: 0;
2657
2773
  font-family: inherit;
2658
2774
  color: var(--hw-text-2, #6b7280);
2659
2775
  background: transparent;
2660
2776
  border: 1px solid transparent;
2661
- border-radius: 5px;
2777
+ border-radius: 6px;
2662
2778
  cursor: pointer;
2663
- transition: background 120ms ease, color 120ms ease;
2779
+ opacity: 0.62;
2780
+ transition:
2781
+ background 120ms ease,
2782
+ color 120ms ease,
2783
+ opacity 120ms ease,
2784
+ scale 120ms ease;
2664
2785
  }
2665
2786
 
2666
- .hw-code-copy:hover {
2787
+ .hw-code-action:hover {
2667
2788
  color: var(--hw-text, #111);
2668
2789
  background: rgba(0, 0, 0, 0.06);
2790
+ opacity: 1;
2791
+ }
2792
+
2793
+ .hw-code-action:active {
2794
+ scale: 0.96;
2795
+ }
2796
+
2797
+ .hw-code-action svg {
2798
+ width: 13px;
2799
+ height: 13px;
2800
+ }
2801
+
2802
+ .hw-code-copy-icon,
2803
+ .hw-code-check-icon {
2804
+ position: absolute;
2805
+ inset: 50% auto auto 50%;
2806
+ transition:
2807
+ opacity 180ms cubic-bezier(0.2, 0, 0, 1),
2808
+ scale 180ms cubic-bezier(0.2, 0, 0, 1),
2809
+ filter 180ms cubic-bezier(0.2, 0, 0, 1);
2810
+ translate: -50% -50%;
2811
+ }
2812
+
2813
+ .hw-code-check-icon {
2814
+ filter: blur(4px);
2815
+ opacity: 0;
2816
+ scale: 0.25;
2817
+ }
2818
+
2819
+ .hw-code-copy--copied .hw-code-copy-icon {
2820
+ filter: blur(4px);
2821
+ opacity: 0;
2822
+ scale: 0.25;
2823
+ }
2824
+
2825
+ .hw-code-copy--copied .hw-code-check-icon {
2826
+ filter: blur(0);
2827
+ opacity: 1;
2828
+ scale: 1;
2829
+ }
2830
+
2831
+ .hw-code-copy-label {
2832
+ position: absolute;
2833
+ width: 1px;
2834
+ height: 1px;
2835
+ overflow: hidden;
2836
+ clip: rect(0, 0, 0, 0);
2837
+ white-space: nowrap;
2669
2838
  }
2670
2839
 
2671
2840
  .hw-code-copy--copied {
@@ -2683,6 +2852,30 @@
2683
2852
  border-radius: 0;
2684
2853
  overflow-x: auto;
2685
2854
  max-width: 100%;
2855
+ max-height: 320px;
2856
+ scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
2857
+ scrollbar-width: thin;
2858
+ }
2859
+
2860
+ .hw-code pre::-webkit-scrollbar {
2861
+ width: 10px;
2862
+ height: 10px;
2863
+ }
2864
+
2865
+ .hw-code pre::-webkit-scrollbar-track {
2866
+ background: transparent;
2867
+ }
2868
+
2869
+ .hw-code pre::-webkit-scrollbar-thumb {
2870
+ background: rgba(0, 0, 0, 0.18);
2871
+ background-clip: content-box;
2872
+ border: 3px solid transparent;
2873
+ border-radius: 999px;
2874
+ }
2875
+
2876
+ .hw-code pre::-webkit-scrollbar-thumb:hover {
2877
+ background: rgba(0, 0, 0, 0.28);
2878
+ background-clip: content-box;
2686
2879
  }
2687
2880
 
2688
2881
  .hw-code pre code {
@@ -2707,9 +2900,21 @@
2707
2900
  background: rgba(255, 255, 255, 0.03);
2708
2901
  border-bottom-color: rgba(255, 255, 255, 0.06);
2709
2902
  }
2710
- .hw-code-copy:hover {
2903
+ .hw-code-action:hover,
2904
+ .hw-code-action:focus-visible {
2711
2905
  background: rgba(255, 255, 255, 0.08);
2712
2906
  }
2907
+ .hw-code pre {
2908
+ scrollbar-color: rgba(255, 255, 255, 0.26) transparent;
2909
+ }
2910
+ .hw-code pre::-webkit-scrollbar-thumb {
2911
+ background: rgba(255, 255, 255, 0.22);
2912
+ background-clip: content-box;
2913
+ }
2914
+ .hw-code pre::-webkit-scrollbar-thumb:hover {
2915
+ background: rgba(255, 255, 255, 0.32);
2916
+ background-clip: content-box;
2917
+ }
2713
2918
  }
2714
2919
 
2715
2920
  /* Legacy bare <pre> fallback (rendered by old CMS bodyHtml content that may
@@ -2755,6 +2960,20 @@
2755
2960
  white-space: pre;
2756
2961
  }
2757
2962
 
2963
+ .hw-msg-bubble .hw-code pre {
2964
+ margin: 0;
2965
+ padding: 10px 12px;
2966
+ background: transparent;
2967
+ border-radius: 0;
2968
+ }
2969
+
2970
+ .hw-msg-bubble .hw-code pre code {
2971
+ background: transparent;
2972
+ padding: 0;
2973
+ font-size: 12px;
2974
+ line-height: 1.55;
2975
+ }
2976
+
2758
2977
  .hw-msg--team .hw-msg-bubble pre,
2759
2978
  .hw-msg--visitor .hw-msg-bubble pre {
2760
2979
  background: rgba(255, 255, 255, 0.12);
@@ -2851,6 +3070,9 @@
2851
3070
  .hw-msg-meta {
2852
3071
  opacity: 1;
2853
3072
  }
3073
+ .hw-msg-copy {
3074
+ opacity: 1;
3075
+ }
2854
3076
  }
2855
3077
 
2856
3078
  /* ════════════════════════════════════════════════
@@ -2909,11 +3131,20 @@
2909
3131
  color: var(--hw-text-4);
2910
3132
  cursor: pointer;
2911
3133
  vertical-align: middle;
2912
- transition: color 0.15s, background 0.15s;
3134
+ opacity: 0;
3135
+ transition:
3136
+ color 0.15s,
3137
+ background 0.15s,
3138
+ opacity 0.15s;
2913
3139
  padding: 0;
2914
3140
  flex-shrink: 0;
2915
3141
  }
2916
3142
 
3143
+ .hw-msg:hover .hw-msg-copy,
3144
+ .hw-msg:focus-within .hw-msg-copy {
3145
+ opacity: 1;
3146
+ }
3147
+
2917
3148
  .hw-msg-copy:hover {
2918
3149
  background: var(--hw-bg-hover);
2919
3150
  color: var(--hw-text-2);
@@ -3296,6 +3527,20 @@
3296
3527
  }
3297
3528
 
3298
3529
  @media (prefers-color-scheme: dark) {
3530
+ .hw-widget:not([data-theme="light"]) .hw-messages {
3531
+ scrollbar-color: rgba(255, 255, 255, 0.26) transparent;
3532
+ }
3533
+
3534
+ .hw-widget:not([data-theme="light"]) .hw-messages::-webkit-scrollbar-thumb {
3535
+ background: rgba(255, 255, 255, 0.2);
3536
+ background-clip: content-box;
3537
+ }
3538
+
3539
+ .hw-widget:not([data-theme="light"]) .hw-messages::-webkit-scrollbar-thumb:hover {
3540
+ background: rgba(255, 255, 255, 0.32);
3541
+ background-clip: content-box;
3542
+ }
3543
+
3299
3544
  .hw-widget:not([data-theme="light"]) {
3300
3545
  --hw-bg: #1c1c1e;
3301
3546
  --hw-bg-subtle: #161618;