@sensiblestats/widget-react 0.14.0 → 0.14.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/CHANGELOG.md +11 -0
- package/dist/index.cjs +32 -80
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +103 -151
- package/dist/index.js.map +1 -1
- package/dist/styles.css +15 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.14.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5dce658: Greeting dashboard UX refinements from design review: tile icons are now
|
|
8
|
+
emoji (matching the betting mockup) rendered at a larger size instead of the
|
|
9
|
+
small monochrome line glyphs; the greeting bubble text is suppressed when a
|
|
10
|
+
dashboard is present so the question shows once (as the dashboard title)
|
|
11
|
+
rather than twice; and the discovery full-span trends tile aligns its icon
|
|
12
|
+
and title on a single row.
|
|
13
|
+
|
|
3
14
|
## 0.14.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -655,88 +655,27 @@ function SendIcon() {
|
|
|
655
655
|
function CloseIcon() {
|
|
656
656
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "none", d: "M18 6L6 18M6 6l12 12", stroke: "currentColor", strokeWidth: "2" }) });
|
|
657
657
|
}
|
|
658
|
-
function FootballIcon() {
|
|
659
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: [
|
|
660
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "9", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
661
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "currentColor", d: "M12 7l3.5 2.5-1.3 4.1H9.8L8.5 9.5z" })
|
|
662
|
-
] });
|
|
663
|
-
}
|
|
664
|
-
function GoalNetIcon() {
|
|
665
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: [
|
|
666
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "3", y: "5", width: "18", height: "12", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
667
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "none", stroke: "currentColor", strokeWidth: "1", d: "M3 9h18M3 13h18M8 5v12M16 5v12" })
|
|
668
|
-
] });
|
|
669
|
-
}
|
|
670
|
-
function BttsIcon() {
|
|
671
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: [
|
|
672
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "8", cy: "12", r: "4.5", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
673
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "16", cy: "12", r: "4.5", fill: "none", stroke: "currentColor", strokeWidth: "1.6" })
|
|
674
|
-
] });
|
|
675
|
-
}
|
|
676
|
-
function CardIcon() {
|
|
677
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "6", y: "3", width: "12", height: "18", rx: "1.5", fill: "currentColor" }) });
|
|
678
|
-
}
|
|
679
|
-
function CornerFlagIcon() {
|
|
680
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: [
|
|
681
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "none", stroke: "currentColor", strokeWidth: "1.6", d: "M6 21V4" }),
|
|
682
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "currentColor", d: "M6 4l11 3.5L6 11z" })
|
|
683
|
-
] });
|
|
684
|
-
}
|
|
685
|
-
function PlayerIcon() {
|
|
686
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: [
|
|
687
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "7", r: "3.2", fill: "currentColor" }),
|
|
688
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "currentColor", d: "M5 20c0-4 3-6.5 7-6.5s7 2.5 7 6.5z" })
|
|
689
|
-
] });
|
|
690
|
-
}
|
|
691
|
-
function TargetIcon() {
|
|
692
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: [
|
|
693
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "8.5", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
694
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "4.5", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
695
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "1.4", fill: "currentColor" })
|
|
696
|
-
] });
|
|
697
|
-
}
|
|
698
|
-
function TrophyIcon() {
|
|
699
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: [
|
|
700
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "currentColor", d: "M7 3h10v4a5 5 0 0 1-5 5 5 5 0 0 1-5-5zM9 15h6v3H9zM7 19h10v2H7z" }),
|
|
701
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "none", stroke: "currentColor", strokeWidth: "1.4", d: "M7 5H4v2a3 3 0 0 0 3 3M17 5h3v2a3 3 0 0 1-3 3" })
|
|
702
|
-
] });
|
|
703
|
-
}
|
|
704
|
-
function ChartLineIcon() {
|
|
705
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", d: "M4 17l5-6 4 3 7-9" }) });
|
|
706
|
-
}
|
|
707
|
-
function ChartBarIcon() {
|
|
708
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "currentColor", d: "M5 12h3v8H5zM10.5 7h3v13h-3zM16 15h3v5h-3z" }) });
|
|
709
|
-
}
|
|
710
|
-
function ChatIcon() {
|
|
711
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "none", stroke: "currentColor", strokeWidth: "1.6", d: "M4 5h16v11H9l-4 4z" }) });
|
|
712
|
-
}
|
|
713
|
-
function FireIcon() {
|
|
714
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "currentColor", d: "M12 2c1 3-2 4-2 7a3 3 0 0 0 6 0c1 1 2 2.5 2 4.5A6 6 0 0 1 6 14c0-4 3-5 3-9 1 1 1.5 2 1.5 3C11.5 6 11 4 12 2z" }) });
|
|
715
|
-
}
|
|
716
|
-
function SparkleIcon() {
|
|
717
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "currentColor", d: "M12 2l1.6 6.4L20 10l-6.4 1.6L12 18l-1.6-6.4L4 10l6.4-1.6z" }) });
|
|
718
|
-
}
|
|
719
658
|
function ChevronIcon() {
|
|
720
659
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) });
|
|
721
660
|
}
|
|
722
|
-
var
|
|
723
|
-
football:
|
|
724
|
-
"goal-net":
|
|
725
|
-
btts:
|
|
726
|
-
card:
|
|
727
|
-
"corner-flag":
|
|
728
|
-
player:
|
|
729
|
-
target:
|
|
730
|
-
trophy:
|
|
731
|
-
"chart-line":
|
|
732
|
-
"chart-bar":
|
|
733
|
-
chat:
|
|
734
|
-
fire:
|
|
735
|
-
sparkle:
|
|
661
|
+
var DASHBOARD_EMOJI = {
|
|
662
|
+
football: "\u26BD",
|
|
663
|
+
"goal-net": "\u{1F945}",
|
|
664
|
+
btts: "\u{1F91D}",
|
|
665
|
+
card: "\u{1F7E8}",
|
|
666
|
+
"corner-flag": "\u{1F6A9}",
|
|
667
|
+
player: "\u{1F464}",
|
|
668
|
+
target: "\u{1F3AF}",
|
|
669
|
+
trophy: "\u{1F3C6}",
|
|
670
|
+
"chart-line": "\u{1F4C8}",
|
|
671
|
+
"chart-bar": "\u{1F4CA}",
|
|
672
|
+
chat: "\u{1F4AC}",
|
|
673
|
+
fire: "\u{1F525}",
|
|
674
|
+
sparkle: "\u2728"
|
|
736
675
|
};
|
|
737
676
|
function DashboardIcon({ name }) {
|
|
738
|
-
const
|
|
739
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
677
|
+
const glyph = Object.prototype.hasOwnProperty.call(DASHBOARD_EMOJI, name) ? DASHBOARD_EMOJI[name] : DASHBOARD_EMOJI.target;
|
|
678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ss-w-dash-emoji", "aria-hidden": "true", children: glyph });
|
|
740
679
|
}
|
|
741
680
|
|
|
742
681
|
// src/components/GreetingBubble.tsx
|
|
@@ -1263,7 +1202,7 @@ function ChatMessage({ message, disabled, onAct, onTap, ui, slip }) {
|
|
|
1263
1202
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "ss-w-msg ss-w-user", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "ss-w-bubble", children: message.text }) });
|
|
1264
1203
|
}
|
|
1265
1204
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "ss-w-msg ss-w-bot", children: [
|
|
1266
|
-
message.text ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Markdown, { text: message.text }) : null,
|
|
1205
|
+
message.text && !message.greetingDashboard ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Markdown, { text: message.text }) : null,
|
|
1267
1206
|
message.greetingDashboard ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GreetingDashboard, { dashboard: message.greetingDashboard, onTap }) : null,
|
|
1268
1207
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(EntityCardList, { cards: message.cards, disabled, showLessLabel: ui?.showLess, showMoreLabel: ui?.showMore }),
|
|
1269
1208
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(BettingInsightList, { insights: message.insights, ui, slip }),
|
|
@@ -1665,7 +1604,8 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
1665
1604
|
min-width: 0; /* the panel is min(400px, 100vw - 40px): without this,
|
|
1666
1605
|
a long Turkish title blows the column out */
|
|
1667
1606
|
}
|
|
1668
|
-
.ss-w-dash-tile-icon { flex: none; display: grid; place-items: center; width:
|
|
1607
|
+
.ss-w-dash-tile-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; font-size: 22px; }
|
|
1608
|
+
.ss-w-dash-emoji { line-height: 1; }
|
|
1669
1609
|
.ss-w-dash-tile-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }
|
|
1670
1610
|
.ss-w-dash-tile-title { min-width: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
|
|
1671
1611
|
.ss-w-dash-tile-subtitle { min-width: 0; font-size: 11.5px; color: var(--ss-w-faint); overflow-wrap: anywhere; }
|
|
@@ -1695,7 +1635,19 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
1695
1635
|
.ss-w-dash--goal .ss-w-dash-grid { grid-template-columns: 1fr; }
|
|
1696
1636
|
.ss-w-dash--goal .ss-w-dash-tile { border-radius: 999px; padding: 10px 14px; }
|
|
1697
1637
|
|
|
1698
|
-
/* Discovery: tinted bento cards.
|
|
1638
|
+
/* Discovery: tinted bento cards. Stacked (icon over text) so a two- or three-word title gets
|
|
1639
|
+
the tile's full width instead of the ~100px left of a horizontal icon+chevron -- that narrow
|
|
1640
|
+
column was wrapping "Most interesting angles" onto three lines. The chevron is dropped (the
|
|
1641
|
+
whole card is the tap target) and the badge + crest row is forced onto one line. */
|
|
1642
|
+
.ss-w-dash--discovery .ss-w-dash-tile { flex-direction: column; align-items: stretch; gap: 8px; }
|
|
1643
|
+
.ss-w-dash--discovery .ss-w-dash-tile-icon { align-self: flex-start; width: 32px; height: 32px; font-size: 26px; }
|
|
1644
|
+
.ss-w-dash--discovery .ss-w-dash-tile-chevron { display: none; }
|
|
1645
|
+
/* The full-span trends tile has the whole panel width, so its icon and title sit on one row
|
|
1646
|
+
(horizontal, centre-aligned) rather than stacking like the narrow half tiles. */
|
|
1647
|
+
.ss-w-dash--discovery .ss-w-dash-tile--full { flex-direction: row; align-items: center; }
|
|
1648
|
+
.ss-w-dash--discovery .ss-w-dash-tile--full .ss-w-dash-tile-icon { align-self: center; }
|
|
1649
|
+
.ss-w-dash--discovery .ss-w-dash-tile-meta { flex-wrap: nowrap; }
|
|
1650
|
+
.ss-w-dash--discovery .ss-w-dash-tile-crest { width: 22px; height: 22px; }
|
|
1699
1651
|
.ss-w-dash--discovery .ss-w-dash-tile:nth-child(1) { background: #eef8f1; }
|
|
1700
1652
|
.ss-w-dash--discovery .ss-w-dash-tile:nth-child(2) { background: #eef3fb; }
|
|
1701
1653
|
.ss-w-dash--discovery .ss-w-dash-tile:nth-child(3) { background: #fdf6ec; }
|