@helpway/react 0.15.2 → 0.16.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 +60 -2
- package/dist/index.js +1224 -896
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/src/themed/styles.css +80 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helpway/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.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",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsup",
|
|
42
42
|
"typecheck": "tsc --noEmit",
|
|
43
|
+
"test": "bun test",
|
|
43
44
|
"sync:icons": "bun scripts/sync-icons.ts",
|
|
44
45
|
"prepublishOnly": "bun run build",
|
|
45
46
|
"prepack": "bun run build && bun scripts/apply-publish-config.ts",
|
|
@@ -51,9 +52,10 @@
|
|
|
51
52
|
"zustand": "^5.0.11"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
55
|
+
"@central-icons-react/round-outlined-radius-2-stroke-2": "^1.1.213",
|
|
56
|
+
"@happy-dom/global-registrator": "^20.14.0",
|
|
54
57
|
"@types/react": "^19.1.6",
|
|
55
58
|
"@types/react-dom": "^19.1.6",
|
|
56
|
-
"@central-icons-react/round-outlined-radius-2-stroke-2": "^1.1.213",
|
|
57
59
|
"react-dom": "^19.1.6",
|
|
58
60
|
"tsup": "^8.3.5",
|
|
59
61
|
"typescript": "~5.9.3"
|
package/src/themed/styles.css
CHANGED
|
@@ -2903,6 +2903,62 @@
|
|
|
2903
2903
|
margin-top: 0;
|
|
2904
2904
|
}
|
|
2905
2905
|
|
|
2906
|
+
/* ── Awaiting-reply marker ───────────────────────────────
|
|
2907
|
+
A state, not an alert. It sits on a row next to product chrome and must not
|
|
2908
|
+
compete with the primary action, so: muted ink, no accent colour, no pill.
|
|
2909
|
+
Labelled rather than counted — a bare number in a coloured badge reads as
|
|
2910
|
+
"unread" and says nothing about what it counts, while these three words say
|
|
2911
|
+
the thing that decides whether the visitor comes back. */
|
|
2912
|
+
.hw-awaiting {
|
|
2913
|
+
margin-top: 2px;
|
|
2914
|
+
padding-left: 44px;
|
|
2915
|
+
font-size: 11px;
|
|
2916
|
+
line-height: 1.4;
|
|
2917
|
+
color: var(--hw-text-3, var(--hw-text-muted));
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2920
|
+
/* ── Closed-state dock ───────────────────────────────────
|
|
2921
|
+
One owner for the strip above the launcher.
|
|
2922
|
+
|
|
2923
|
+
The incoming-reply card and the announcement stack were two independent
|
|
2924
|
+
absolute pins on the same anchor — both `bottom: calc(100% + 12px); right: 0`
|
|
2925
|
+
— so whenever a visitor had an unread reply AND unseen announced content,
|
|
2926
|
+
the two cards drew on top of each other. Neither was readable and the one
|
|
2927
|
+
underneath was unclickable. Nothing in either component could detect the
|
|
2928
|
+
other, which is the tell: the bug is that the region had no owner, not that
|
|
2929
|
+
one of the cards was positioned wrong.
|
|
2930
|
+
|
|
2931
|
+
The dock pins once; its children lay out in flow. Order in the markup is the
|
|
2932
|
+
priority order and it is deliberate — an actual reply from a person sits
|
|
2933
|
+
nearest the launcher, where the thumb already is, and announcements stack
|
|
2934
|
+
above it. Right-aligned rather than stretched because the two cards are
|
|
2935
|
+
different widths (300px vs 340px) and a shared left edge would read as one
|
|
2936
|
+
ragged surface instead of two cards. */
|
|
2937
|
+
.hw-preview-dock {
|
|
2938
|
+
position: absolute;
|
|
2939
|
+
bottom: calc(100% + 12px);
|
|
2940
|
+
right: 0;
|
|
2941
|
+
display: flex;
|
|
2942
|
+
flex-direction: column;
|
|
2943
|
+
align-items: flex-end;
|
|
2944
|
+
gap: 8px;
|
|
2945
|
+
/* Empty dock must not sit over the page. With no children it has zero size,
|
|
2946
|
+
but the gaps between cards are dead space either way — the cards take
|
|
2947
|
+
their own events back below. */
|
|
2948
|
+
pointer-events: none;
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
/* Docked children give up their own pin — two classes, so this wins over the
|
|
2952
|
+
single-class `.hw-preview` / `.hw-preview-stack` rules whatever the source
|
|
2953
|
+
order. */
|
|
2954
|
+
.hw-preview-dock > .hw-preview,
|
|
2955
|
+
.hw-preview-dock > .hw-preview-stack {
|
|
2956
|
+
position: relative;
|
|
2957
|
+
bottom: auto;
|
|
2958
|
+
right: auto;
|
|
2959
|
+
pointer-events: auto;
|
|
2960
|
+
}
|
|
2961
|
+
|
|
2906
2962
|
/* ── Preview closing animation ──────────────────────────── */
|
|
2907
2963
|
.hw-preview--closing {
|
|
2908
2964
|
animation: hw-preview-out 0.2s ease-in forwards;
|
|
@@ -2936,6 +2992,30 @@
|
|
|
2936
2992
|
width: 100%;
|
|
2937
2993
|
}
|
|
2938
2994
|
|
|
2995
|
+
/* ── Overflow row ────────────────────────────────────────
|
|
2996
|
+
What is left when the announcement stack is clipped. Deliberately not a
|
|
2997
|
+
card: a fourth bordered box would be the volume problem it exists to
|
|
2998
|
+
solve. A single quiet line, right-aligned with the cards above it, that
|
|
2999
|
+
opens the next unread update. */
|
|
3000
|
+
.hw-preview-more {
|
|
3001
|
+
align-self: flex-end;
|
|
3002
|
+
padding: 4px 10px;
|
|
3003
|
+
border: 0;
|
|
3004
|
+
border-radius: 999px;
|
|
3005
|
+
background: var(--hw-bg);
|
|
3006
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), inset 0 0 0 1px var(--hw-border);
|
|
3007
|
+
color: var(--hw-text-2);
|
|
3008
|
+
font: inherit;
|
|
3009
|
+
font-size: 12px;
|
|
3010
|
+
line-height: 1.4;
|
|
3011
|
+
cursor: pointer;
|
|
3012
|
+
transition: background 0.12s, color 0.12s;
|
|
3013
|
+
}
|
|
3014
|
+
.hw-preview-more:hover {
|
|
3015
|
+
background: var(--hw-bg-hover);
|
|
3016
|
+
color: var(--hw-text);
|
|
3017
|
+
}
|
|
3018
|
+
|
|
2939
3019
|
/* ── Announcement preview modifier ─────────────────────── */
|
|
2940
3020
|
.hw-preview--announcement {
|
|
2941
3021
|
width: 340px;
|