@helpway/react 0.9.0 → 0.10.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/dist/index.d.ts +72 -1
- package/dist/index.js +775 -397
- package/dist/index.js.map +1 -1
- package/package.json +1 -3
- package/src/themed/styles.css +234 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helpway/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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",
|
|
@@ -51,8 +51,6 @@
|
|
|
51
51
|
"zustand": "^5.0.11"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@helpway/types": "workspace:*",
|
|
55
|
-
"@helpway/widget-core": "workspace:*",
|
|
56
54
|
"@types/react": "^19.1.6",
|
|
57
55
|
"@types/react-dom": "^19.1.6",
|
|
58
56
|
"@central-icons-react/round-outlined-radius-2-stroke-2": "^1.1.213",
|
package/src/themed/styles.css
CHANGED
|
@@ -354,10 +354,11 @@
|
|
|
354
354
|
/* Reading mode — applied when the visitor enters a content detail view
|
|
355
355
|
(help article, changelog entry). Wider + taller for comfortable long-form
|
|
356
356
|
reading. Mobile (<480px) ignores this — the @media block forces 100% +
|
|
357
|
-
beats this rule by source order.
|
|
357
|
+
beats this rule by source order. Bottom offset (72px bubble + 20px gap)
|
|
358
|
+
is subtracted so the window never clips above the viewport. */
|
|
358
359
|
.hw-window--reading {
|
|
359
360
|
width: min(720px, calc(100vw - 40px));
|
|
360
|
-
height: min(800px, calc(100vh -
|
|
361
|
+
height: min(800px, calc(100vh - 112px));
|
|
361
362
|
}
|
|
362
363
|
|
|
363
364
|
@keyframes hw-window-open {
|
|
@@ -485,6 +486,7 @@
|
|
|
485
486
|
.hw-hero-bot-icon .hw-agent-icon {
|
|
486
487
|
border-radius: inherit;
|
|
487
488
|
overflow: hidden;
|
|
489
|
+
object-fit: contain;
|
|
488
490
|
}
|
|
489
491
|
|
|
490
492
|
.hw-hero-greeting {
|
|
@@ -1165,6 +1167,7 @@
|
|
|
1165
1167
|
.hw-tabs-item svg {
|
|
1166
1168
|
width: 22px;
|
|
1167
1169
|
height: 22px;
|
|
1170
|
+
overflow: visible;
|
|
1168
1171
|
}
|
|
1169
1172
|
.hw-tabs-item--active {
|
|
1170
1173
|
color: var(--hw-text);
|
|
@@ -2684,6 +2687,38 @@
|
|
|
2684
2687
|
transition: transform 0.15s, box-shadow 0.15s;
|
|
2685
2688
|
}
|
|
2686
2689
|
|
|
2690
|
+
/* Anchored placement — used when the preview is rendered next to a
|
|
2691
|
+
custom trigger (e.g. a sidebar item) instead of the floating
|
|
2692
|
+
launcher. Drops the launcher-bound absolute pin AND the fixed 300px
|
|
2693
|
+
so the consumer's own positioned + sized wrapper fully controls it
|
|
2694
|
+
(e.g. fit within a narrow sidebar instead of overflowing into page
|
|
2695
|
+
content). Shadow, radius, animation, hover stay identical. Double-
|
|
2696
|
+
class so it always beats the single-class `.hw-preview` regardless
|
|
2697
|
+
of source order. */
|
|
2698
|
+
.hw-preview.hw-preview--anchored {
|
|
2699
|
+
position: static;
|
|
2700
|
+
bottom: auto;
|
|
2701
|
+
right: auto;
|
|
2702
|
+
width: 100%;
|
|
2703
|
+
max-width: 100%;
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
/* Anchored avatar — dekorasyonsuz: the launcher's gradient puck makes
|
|
2707
|
+
sense above a floating bubble, but in a sidebar it competes with
|
|
2708
|
+
surrounding chrome. Consumers want the bare agent mark and apply
|
|
2709
|
+
their own framing (e.g. dark-mode inversion). SDK only drops the
|
|
2710
|
+
gradient bg here; size and radius inherit from the base. The
|
|
2711
|
+
img/svg sizing stays so an uploaded logo doesn't get cropped. */
|
|
2712
|
+
.hw-preview.hw-preview--anchored .hw-preview-avatar {
|
|
2713
|
+
background: none;
|
|
2714
|
+
}
|
|
2715
|
+
.hw-preview.hw-preview--anchored .hw-preview-avatar img,
|
|
2716
|
+
.hw-preview.hw-preview--anchored .hw-preview-avatar svg {
|
|
2717
|
+
width: 100%;
|
|
2718
|
+
height: 100%;
|
|
2719
|
+
object-fit: contain;
|
|
2720
|
+
}
|
|
2721
|
+
|
|
2687
2722
|
.hw-preview:hover {
|
|
2688
2723
|
transform: translateY(-2px);
|
|
2689
2724
|
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
@@ -2784,6 +2819,20 @@
|
|
|
2784
2819
|
padding-bottom: 14px;
|
|
2785
2820
|
}
|
|
2786
2821
|
|
|
2822
|
+
/* Optional source caption (e.g. "via Helpway"). Thin separated footer
|
|
2823
|
+
so it reads as provenance metadata, not message content. Only
|
|
2824
|
+
rendered when the consumer passes a `footer` — launcher omits it,
|
|
2825
|
+
keeping the original visual byte-identical. */
|
|
2826
|
+
.hw-preview-footer {
|
|
2827
|
+
margin-top: 2px;
|
|
2828
|
+
padding: 8px 14px 12px;
|
|
2829
|
+
border-top: 1px solid var(--hw-border);
|
|
2830
|
+
font-size: 11px;
|
|
2831
|
+
line-height: 1.3;
|
|
2832
|
+
color: var(--hw-text-2);
|
|
2833
|
+
opacity: 0.65;
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2787
2836
|
.hw-preview-prompt {
|
|
2788
2837
|
padding: 2px 14px 6px;
|
|
2789
2838
|
font-size: 14px;
|
|
@@ -2818,6 +2867,187 @@
|
|
|
2818
2867
|
border-color: var(--hw-brand, #000);
|
|
2819
2868
|
}
|
|
2820
2869
|
|
|
2870
|
+
/* ── Preview closing animation ──────────────────────────── */
|
|
2871
|
+
.hw-preview--closing {
|
|
2872
|
+
animation: hw-preview-out 0.2s ease-in forwards;
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
/* ── Announcement preview stack (multiple tabs) ──────── */
|
|
2876
|
+
.hw-preview-stack {
|
|
2877
|
+
position: absolute;
|
|
2878
|
+
bottom: calc(100% + 12px);
|
|
2879
|
+
right: 0;
|
|
2880
|
+
display: flex;
|
|
2881
|
+
flex-direction: column;
|
|
2882
|
+
gap: 8px;
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
.hw-preview-stack .hw-preview {
|
|
2886
|
+
position: relative;
|
|
2887
|
+
bottom: auto;
|
|
2888
|
+
right: auto;
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2891
|
+
/* ── Announcement preview modifier ─────────────────────── */
|
|
2892
|
+
.hw-preview--announcement {
|
|
2893
|
+
width: 340px;
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
.hw-preview--announcement .hw-preview-body--title {
|
|
2897
|
+
font-weight: 600;
|
|
2898
|
+
color: var(--hw-text);
|
|
2899
|
+
font-size: 15px;
|
|
2900
|
+
line-height: 1.3;
|
|
2901
|
+
padding-top: 10px;
|
|
2902
|
+
}
|
|
2903
|
+
|
|
2904
|
+
.hw-preview--announcement .hw-preview-body--desc {
|
|
2905
|
+
font-size: 13px;
|
|
2906
|
+
color: var(--hw-text-2);
|
|
2907
|
+
line-height: 1.5;
|
|
2908
|
+
padding-bottom: 16px;
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2911
|
+
.hw-announcement-badge {
|
|
2912
|
+
display: inline-block;
|
|
2913
|
+
margin: 8px 14px 0;
|
|
2914
|
+
padding: 2px 8px;
|
|
2915
|
+
font-size: 10px;
|
|
2916
|
+
font-weight: 700;
|
|
2917
|
+
text-transform: uppercase;
|
|
2918
|
+
letter-spacing: 0.04em;
|
|
2919
|
+
color: var(--hw-primary);
|
|
2920
|
+
background: color-mix(in srgb, var(--hw-primary) 10%, transparent);
|
|
2921
|
+
border-radius: 4px;
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
/* ── What's New card (Home tab) ────────────────────────── */
|
|
2925
|
+
.hw-whats-new {
|
|
2926
|
+
border-radius: 14px;
|
|
2927
|
+
background: var(--hw-bg);
|
|
2928
|
+
border: 1px solid rgba(0, 0, 0, 0.06);
|
|
2929
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
|
|
2930
|
+
overflow: hidden;
|
|
2931
|
+
}
|
|
2932
|
+
|
|
2933
|
+
.hw-whats-new-header {
|
|
2934
|
+
display: flex;
|
|
2935
|
+
align-items: center;
|
|
2936
|
+
justify-content: space-between;
|
|
2937
|
+
padding: 12px 14px 0;
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
.hw-whats-new-title {
|
|
2941
|
+
font-size: 12px;
|
|
2942
|
+
font-weight: 600;
|
|
2943
|
+
color: var(--hw-text-2);
|
|
2944
|
+
}
|
|
2945
|
+
|
|
2946
|
+
.hw-whats-new-view-all {
|
|
2947
|
+
font-size: 11px;
|
|
2948
|
+
font-weight: 500;
|
|
2949
|
+
color: var(--hw-primary);
|
|
2950
|
+
background: none;
|
|
2951
|
+
border: none;
|
|
2952
|
+
cursor: pointer;
|
|
2953
|
+
padding: 0;
|
|
2954
|
+
font-family: inherit;
|
|
2955
|
+
}
|
|
2956
|
+
.hw-whats-new-view-all:hover {
|
|
2957
|
+
opacity: 0.8;
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
.hw-whats-new-list {
|
|
2961
|
+
display: flex;
|
|
2962
|
+
flex-direction: column;
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2965
|
+
.hw-whats-new-item {
|
|
2966
|
+
display: flex;
|
|
2967
|
+
flex-direction: column;
|
|
2968
|
+
gap: 2px;
|
|
2969
|
+
width: 100%;
|
|
2970
|
+
padding: 10px 14px;
|
|
2971
|
+
border: none;
|
|
2972
|
+
border-bottom: 1px solid var(--hw-border);
|
|
2973
|
+
background: none;
|
|
2974
|
+
cursor: pointer;
|
|
2975
|
+
text-align: left;
|
|
2976
|
+
font-family: inherit;
|
|
2977
|
+
color: var(--hw-text);
|
|
2978
|
+
transition: background-color 140ms ease;
|
|
2979
|
+
}
|
|
2980
|
+
.hw-whats-new-item:last-child {
|
|
2981
|
+
border-bottom: none;
|
|
2982
|
+
}
|
|
2983
|
+
.hw-whats-new-item:hover {
|
|
2984
|
+
background: rgba(0, 0, 0, 0.03);
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
.hw-whats-new-item-top {
|
|
2988
|
+
display: flex;
|
|
2989
|
+
align-items: center;
|
|
2990
|
+
gap: 8px;
|
|
2991
|
+
}
|
|
2992
|
+
|
|
2993
|
+
.hw-whats-new-badge {
|
|
2994
|
+
font-size: 10px;
|
|
2995
|
+
font-weight: 700;
|
|
2996
|
+
text-transform: uppercase;
|
|
2997
|
+
letter-spacing: 0.04em;
|
|
2998
|
+
color: var(--hw-primary);
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
.hw-whats-new-time {
|
|
3002
|
+
font-size: 11px;
|
|
3003
|
+
color: var(--hw-text-3);
|
|
3004
|
+
margin-left: auto;
|
|
3005
|
+
}
|
|
3006
|
+
|
|
3007
|
+
.hw-whats-new-item-title {
|
|
3008
|
+
font-size: 13px;
|
|
3009
|
+
font-weight: 600;
|
|
3010
|
+
color: var(--hw-text);
|
|
3011
|
+
line-height: 1.3;
|
|
3012
|
+
display: flex;
|
|
3013
|
+
align-items: baseline;
|
|
3014
|
+
gap: 8px;
|
|
3015
|
+
}
|
|
3016
|
+
|
|
3017
|
+
.hw-whats-new-time-inline {
|
|
3018
|
+
font-size: 11px;
|
|
3019
|
+
font-weight: 400;
|
|
3020
|
+
color: var(--hw-text-3);
|
|
3021
|
+
margin-left: auto;
|
|
3022
|
+
flex-shrink: 0;
|
|
3023
|
+
}
|
|
3024
|
+
|
|
3025
|
+
.hw-whats-new-item-body {
|
|
3026
|
+
font-size: 12px;
|
|
3027
|
+
color: var(--hw-text-2);
|
|
3028
|
+
line-height: 1.4;
|
|
3029
|
+
}
|
|
3030
|
+
|
|
3031
|
+
/* ── Announcement dot (tabs + launcher) ────────────────── */
|
|
3032
|
+
.hw-tabs-dot {
|
|
3033
|
+
position: absolute;
|
|
3034
|
+
top: -2px;
|
|
3035
|
+
right: -6px;
|
|
3036
|
+
width: 8px;
|
|
3037
|
+
height: 8px;
|
|
3038
|
+
border-radius: 50%;
|
|
3039
|
+
background: var(--hw-primary);
|
|
3040
|
+
animation: hw-badge-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
.hw-bubble-badge-dot {
|
|
3044
|
+
display: block;
|
|
3045
|
+
width: 8px;
|
|
3046
|
+
height: 8px;
|
|
3047
|
+
border-radius: 50%;
|
|
3048
|
+
background: white;
|
|
3049
|
+
}
|
|
3050
|
+
|
|
2821
3051
|
/* ═══════════════════════════════════════════════════════════
|
|
2822
3052
|
Content Tabs — Better i18n Content CMS integration
|
|
2823
3053
|
Generic list → detail pattern for all content types
|
|
@@ -2978,7 +3208,8 @@
|
|
|
2978
3208
|
padding: 16px;
|
|
2979
3209
|
overflow-y: auto;
|
|
2980
3210
|
overscroll-behavior: contain;
|
|
2981
|
-
|
|
3211
|
+
flex: 1;
|
|
3212
|
+
min-height: 0;
|
|
2982
3213
|
}
|
|
2983
3214
|
|
|
2984
3215
|
.hw-content-detail-header {
|