@helpway/react 0.9.0 → 0.11.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.9.0",
3
+ "version": "0.11.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",
@@ -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 - 100px));
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,199 @@
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
+ /* Anchored stack — consumer-positioned (e.g. above a sidebar Help
2892
+ item). Drops the launcher-bound absolute pin but keeps the flex
2893
+ column + gap so multiple announcement cards still stack vertically
2894
+ inside the consumer's wrapper. Double-class to beat the single
2895
+ `.hw-preview-stack` rule regardless of source order. */
2896
+ .hw-preview-stack.hw-preview-stack--anchored {
2897
+ position: static;
2898
+ bottom: auto;
2899
+ right: auto;
2900
+ width: 100%;
2901
+ }
2902
+
2903
+ /* ── Announcement preview modifier ─────────────────────── */
2904
+ .hw-preview--announcement {
2905
+ width: 340px;
2906
+ }
2907
+
2908
+ .hw-preview--announcement .hw-preview-body--title {
2909
+ font-weight: 600;
2910
+ color: var(--hw-text);
2911
+ font-size: 15px;
2912
+ line-height: 1.3;
2913
+ padding-top: 10px;
2914
+ }
2915
+
2916
+ .hw-preview--announcement .hw-preview-body--desc {
2917
+ font-size: 13px;
2918
+ color: var(--hw-text-2);
2919
+ line-height: 1.5;
2920
+ padding-bottom: 16px;
2921
+ }
2922
+
2923
+ .hw-announcement-badge {
2924
+ display: inline-block;
2925
+ margin: 8px 14px 0;
2926
+ padding: 2px 8px;
2927
+ font-size: 10px;
2928
+ font-weight: 700;
2929
+ text-transform: uppercase;
2930
+ letter-spacing: 0.04em;
2931
+ color: var(--hw-primary);
2932
+ background: color-mix(in srgb, var(--hw-primary) 10%, transparent);
2933
+ border-radius: 4px;
2934
+ }
2935
+
2936
+ /* ── What's New card (Home tab) ────────────────────────── */
2937
+ .hw-whats-new {
2938
+ border-radius: 14px;
2939
+ background: var(--hw-bg);
2940
+ border: 1px solid rgba(0, 0, 0, 0.06);
2941
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
2942
+ overflow: hidden;
2943
+ }
2944
+
2945
+ .hw-whats-new-header {
2946
+ display: flex;
2947
+ align-items: center;
2948
+ justify-content: space-between;
2949
+ padding: 12px 14px 0;
2950
+ }
2951
+
2952
+ .hw-whats-new-title {
2953
+ font-size: 12px;
2954
+ font-weight: 600;
2955
+ color: var(--hw-text-2);
2956
+ }
2957
+
2958
+ .hw-whats-new-view-all {
2959
+ font-size: 11px;
2960
+ font-weight: 500;
2961
+ color: var(--hw-primary);
2962
+ background: none;
2963
+ border: none;
2964
+ cursor: pointer;
2965
+ padding: 0;
2966
+ font-family: inherit;
2967
+ }
2968
+ .hw-whats-new-view-all:hover {
2969
+ opacity: 0.8;
2970
+ }
2971
+
2972
+ .hw-whats-new-list {
2973
+ display: flex;
2974
+ flex-direction: column;
2975
+ }
2976
+
2977
+ .hw-whats-new-item {
2978
+ display: flex;
2979
+ flex-direction: column;
2980
+ gap: 2px;
2981
+ width: 100%;
2982
+ padding: 10px 14px;
2983
+ border: none;
2984
+ border-bottom: 1px solid var(--hw-border);
2985
+ background: none;
2986
+ cursor: pointer;
2987
+ text-align: left;
2988
+ font-family: inherit;
2989
+ color: var(--hw-text);
2990
+ transition: background-color 140ms ease;
2991
+ }
2992
+ .hw-whats-new-item:last-child {
2993
+ border-bottom: none;
2994
+ }
2995
+ .hw-whats-new-item:hover {
2996
+ background: rgba(0, 0, 0, 0.03);
2997
+ }
2998
+
2999
+ .hw-whats-new-item-top {
3000
+ display: flex;
3001
+ align-items: center;
3002
+ gap: 8px;
3003
+ }
3004
+
3005
+ .hw-whats-new-badge {
3006
+ font-size: 10px;
3007
+ font-weight: 700;
3008
+ text-transform: uppercase;
3009
+ letter-spacing: 0.04em;
3010
+ color: var(--hw-primary);
3011
+ }
3012
+
3013
+ .hw-whats-new-time {
3014
+ font-size: 11px;
3015
+ color: var(--hw-text-3);
3016
+ margin-left: auto;
3017
+ }
3018
+
3019
+ .hw-whats-new-item-title {
3020
+ font-size: 13px;
3021
+ font-weight: 600;
3022
+ color: var(--hw-text);
3023
+ line-height: 1.3;
3024
+ display: flex;
3025
+ align-items: baseline;
3026
+ gap: 8px;
3027
+ }
3028
+
3029
+ .hw-whats-new-time-inline {
3030
+ font-size: 11px;
3031
+ font-weight: 400;
3032
+ color: var(--hw-text-3);
3033
+ margin-left: auto;
3034
+ flex-shrink: 0;
3035
+ }
3036
+
3037
+ .hw-whats-new-item-body {
3038
+ font-size: 12px;
3039
+ color: var(--hw-text-2);
3040
+ line-height: 1.4;
3041
+ }
3042
+
3043
+ /* ── Announcement dot (tabs + launcher) ────────────────── */
3044
+ .hw-tabs-dot {
3045
+ position: absolute;
3046
+ top: -2px;
3047
+ right: -6px;
3048
+ width: 8px;
3049
+ height: 8px;
3050
+ border-radius: 50%;
3051
+ background: var(--hw-primary);
3052
+ animation: hw-badge-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
3053
+ }
3054
+
3055
+ .hw-bubble-badge-dot {
3056
+ display: block;
3057
+ width: 8px;
3058
+ height: 8px;
3059
+ border-radius: 50%;
3060
+ background: white;
3061
+ }
3062
+
2821
3063
  /* ═══════════════════════════════════════════════════════════
2822
3064
  Content Tabs — Better i18n Content CMS integration
2823
3065
  Generic list → detail pattern for all content types
@@ -2978,7 +3220,8 @@
2978
3220
  padding: 16px;
2979
3221
  overflow-y: auto;
2980
3222
  overscroll-behavior: contain;
2981
- height: 100%;
3223
+ flex: 1;
3224
+ min-height: 0;
2982
3225
  }
2983
3226
 
2984
3227
  .hw-content-detail-header {