@helpway/react 0.16.0 → 0.17.1
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 +23 -7
- package/dist/index.js +675 -568
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/src/themed/styles.css +82 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helpway/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
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",
|
|
@@ -43,8 +43,9 @@
|
|
|
43
43
|
"test": "bun test",
|
|
44
44
|
"sync:icons": "bun scripts/sync-icons.ts",
|
|
45
45
|
"prepublishOnly": "bun run build",
|
|
46
|
-
"prepack": "bun run build && bun scripts/apply-publish-config.ts",
|
|
47
|
-
"postpack": "bun scripts/apply-publish-config.ts --restore"
|
|
46
|
+
"prepack": "bun scripts/sync-icons.ts --check && bun run build && bun scripts/apply-publish-config.ts",
|
|
47
|
+
"postpack": "bun scripts/apply-publish-config.ts --restore",
|
|
48
|
+
"check:icons": "bun scripts/sync-icons.ts --check"
|
|
48
49
|
},
|
|
49
50
|
"//": "publishConfig swaps main/types/exports to the built dist on publish. Workspace consumers get raw src (fast HMR, no build step); npm consumers get compiled dist with .d.ts. Standard monorepo pattern.",
|
|
50
51
|
"dependencies": {
|
package/src/themed/styles.css
CHANGED
|
@@ -98,6 +98,15 @@
|
|
|
98
98
|
border-radius: inherit;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
/* A host `agentAvatar` brings its own shape and colour: every box that holds
|
|
102
|
+
one drops its tile radius and fill so the host's mark is not framed by a
|
|
103
|
+
rounded square it did not ask for. */
|
|
104
|
+
.hw-widget :is(.hw-header-bot-icon, .hw-hero-bot-icon, .hw-conv-card-avatar, .hw-event-avatar, .hw-bubble-icon--bot):has(> .hw-agent-custom) {
|
|
105
|
+
border-radius: 50%;
|
|
106
|
+
background: transparent;
|
|
107
|
+
padding: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
101
110
|
/* ── Focus Styles ──────────────────────────────── */
|
|
102
111
|
.hw-widget :focus-visible {
|
|
103
112
|
outline: 2px solid var(--hw-primary);
|
|
@@ -219,7 +228,7 @@
|
|
|
219
228
|
transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
|
|
220
229
|
}
|
|
221
230
|
|
|
222
|
-
.hw-bubble-icon svg {
|
|
231
|
+
.hw-bubble-icon svg:not(.hw-agent-custom svg) {
|
|
223
232
|
width: 22px;
|
|
224
233
|
height: 22px;
|
|
225
234
|
}
|
|
@@ -361,6 +370,48 @@
|
|
|
361
370
|
height: min(800px, calc(100vh - 112px));
|
|
362
371
|
}
|
|
363
372
|
|
|
373
|
+
/* The mobile SDK's sheet (widget.js mobile mode, #268): the native sheet IS
|
|
374
|
+
the window, at every width. An iPad's page sheet is wider than the 480px
|
|
375
|
+
phone breakpoint, and without this the floating panel would sit in a
|
|
376
|
+
corner of it. No open animation either — the sheet already slid up, and
|
|
377
|
+
a second slide inside it reads as the app stuttering. :host only matches
|
|
378
|
+
inside the embed's shadow root, so @helpway/react consumers never see it. */
|
|
379
|
+
:host([data-hw-mode="mobile"]) .hw-window,
|
|
380
|
+
:host([data-hw-mode="mobile"]) .hw-window--reading {
|
|
381
|
+
position: fixed;
|
|
382
|
+
inset: 0;
|
|
383
|
+
width: 100%;
|
|
384
|
+
height: var(--hw-visible-height, 100%);
|
|
385
|
+
border-radius: 0;
|
|
386
|
+
box-shadow: none;
|
|
387
|
+
animation: none;
|
|
388
|
+
}
|
|
389
|
+
/* The bubble is the launcher, and the app's own Help row is the launcher
|
|
390
|
+
here. hideLauncher does not remove it (it only stops click-outside from
|
|
391
|
+
closing the panel), so without this a black × sat over the send button. */
|
|
392
|
+
/* The hero is a gradient (background-image), so its computed
|
|
393
|
+
background-color was transparent and the SDK could not tell the native
|
|
394
|
+
sheet what colour sits under iOS's grabber. The gradient's own top-left
|
|
395
|
+
stop, as a solid underneath it: invisible here, measurable there
|
|
396
|
+
(widget-embed mobile-chrome.ts). */
|
|
397
|
+
:host([data-hw-mode="mobile"]) .hw-hero {
|
|
398
|
+
background-color: color-mix(in srgb, var(--hw-primary) 60%, black);
|
|
399
|
+
}
|
|
400
|
+
:host([data-hw-mode="mobile"]) .hw-bubble {
|
|
401
|
+
display: none;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/* Keyboard open (default-widget.tsx sets data-hw-keyboard from
|
|
405
|
+
visualViewport). The home-indicator inset is under the keyboard, so
|
|
406
|
+
padding for it leaves an empty band between composer and keys; and the
|
|
407
|
+
"Powered by" line costs a row the conversation needs more. */
|
|
408
|
+
.hw-window[data-hw-keyboard] .hw-composer {
|
|
409
|
+
padding-bottom: 8px;
|
|
410
|
+
}
|
|
411
|
+
.hw-window[data-hw-keyboard] .hw-powered {
|
|
412
|
+
display: none;
|
|
413
|
+
}
|
|
414
|
+
|
|
364
415
|
@keyframes hw-window-open {
|
|
365
416
|
from {
|
|
366
417
|
opacity: 0;
|
|
@@ -478,7 +529,10 @@
|
|
|
478
529
|
justify-content: center;
|
|
479
530
|
border-radius: 10px;
|
|
480
531
|
}
|
|
481
|
-
|
|
532
|
+
/* Direct children only (the Helpway mark, a preset icon): a host `agentAvatar`
|
|
533
|
+
brings its own SVG and sizing, which this must not resize. */
|
|
534
|
+
.hw-hero-bot-icon > svg,
|
|
535
|
+
.hw-hero-bot-icon > .hw-agent-icon > svg {
|
|
482
536
|
width: 32px;
|
|
483
537
|
height: 32px;
|
|
484
538
|
}
|
|
@@ -599,7 +653,8 @@
|
|
|
599
653
|
chain — exactly the cascade behavior we want. */
|
|
600
654
|
background: var(--hw-agent-bg, var(--hw-agent-bg-default, transparent));
|
|
601
655
|
}
|
|
602
|
-
.hw-header-bot-icon svg
|
|
656
|
+
.hw-header-bot-icon > svg,
|
|
657
|
+
.hw-header-bot-icon > .hw-agent-icon > svg {
|
|
603
658
|
width: 24px;
|
|
604
659
|
height: 24px;
|
|
605
660
|
}
|
|
@@ -893,7 +948,7 @@
|
|
|
893
948
|
height: 32px;
|
|
894
949
|
border-radius: 8px;
|
|
895
950
|
}
|
|
896
|
-
.hw-recent-row .hw-conv-card-avatar svg {
|
|
951
|
+
.hw-recent-row .hw-conv-card-avatar svg:not(.hw-agent-custom svg) {
|
|
897
952
|
width: 18px;
|
|
898
953
|
height: 18px;
|
|
899
954
|
}
|
|
@@ -995,7 +1050,7 @@
|
|
|
995
1050
|
flex-shrink: 0;
|
|
996
1051
|
overflow: hidden;
|
|
997
1052
|
}
|
|
998
|
-
.hw-conv-card-avatar svg {
|
|
1053
|
+
.hw-conv-card-avatar svg:not(.hw-agent-custom svg) {
|
|
999
1054
|
width: 20px;
|
|
1000
1055
|
height: 20px;
|
|
1001
1056
|
}
|
|
@@ -2674,6 +2729,16 @@
|
|
|
2674
2729
|
.hw-powered {
|
|
2675
2730
|
padding-bottom: calc(5px + env(safe-area-inset-bottom, 0px));
|
|
2676
2731
|
}
|
|
2732
|
+
/* The inset belongs to whatever is LAST in the window. With "Powered by"
|
|
2733
|
+
under the composer (or the tabs), both were padding for the same home
|
|
2734
|
+
indicator — the empty band above "Powered by" in Ali's simulator run of
|
|
2735
|
+
the mobile SDK. The line carries it; what sits above it does not. */
|
|
2736
|
+
.hw-window:has(.hw-powered) .hw-composer {
|
|
2737
|
+
padding-bottom: 8px;
|
|
2738
|
+
}
|
|
2739
|
+
.hw-window:has(.hw-powered) .hw-tabs {
|
|
2740
|
+
padding-bottom: 0;
|
|
2741
|
+
}
|
|
2677
2742
|
|
|
2678
2743
|
/* Touch targets */
|
|
2679
2744
|
.hw-header-close,
|
|
@@ -2755,7 +2820,7 @@
|
|
|
2755
2820
|
background: none;
|
|
2756
2821
|
}
|
|
2757
2822
|
.hw-preview.hw-preview--anchored .hw-preview-avatar img,
|
|
2758
|
-
.hw-preview.hw-preview--anchored .hw-preview-avatar svg {
|
|
2823
|
+
.hw-preview.hw-preview--anchored .hw-preview-avatar svg:not(.hw-agent-custom svg) {
|
|
2759
2824
|
width: 100%;
|
|
2760
2825
|
height: 100%;
|
|
2761
2826
|
object-fit: contain;
|
|
@@ -2807,7 +2872,7 @@
|
|
|
2807
2872
|
overflow: hidden;
|
|
2808
2873
|
}
|
|
2809
2874
|
|
|
2810
|
-
.hw-preview-avatar svg {
|
|
2875
|
+
.hw-preview-avatar svg:not(.hw-agent-custom svg) {
|
|
2811
2876
|
width: 16px;
|
|
2812
2877
|
height: 16px;
|
|
2813
2878
|
}
|
|
@@ -5460,6 +5525,16 @@
|
|
|
5460
5525
|
gap: 8px;
|
|
5461
5526
|
padding: 2px 0 8px;
|
|
5462
5527
|
}
|
|
5528
|
+
/* Host agent avatar at the bar's start; bottom-aligned with the actions so it
|
|
5529
|
+
stays on the first line's baseline row when the field grows. */
|
|
5530
|
+
.hw-dock-lead {
|
|
5531
|
+
flex: none;
|
|
5532
|
+
display: grid;
|
|
5533
|
+
place-items: center;
|
|
5534
|
+
width: 32px;
|
|
5535
|
+
height: 32px;
|
|
5536
|
+
margin-left: -8px;
|
|
5537
|
+
}
|
|
5463
5538
|
.hw-dock-actions {
|
|
5464
5539
|
flex: none;
|
|
5465
5540
|
display: flex;
|