@wix/himalaya-cli 0.1028.0 → 0.1029.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/cli.mjs +106 -24
- package/dist/preview-assets.generated.bin +0 -0
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +15 -3
- package/templates/beauty-salon-owner/dev/index.ts +22 -27
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-chat.ts +23 -3
- package/templates/branded-lite/dev/index.ts +32 -4
- package/templates/community-club-owner/dev/index.ts +22 -27
- package/templates/community-club-owner/tier5-src/_shared/aria-chat.ts +23 -3
- package/templates/events-meetups-owner/dev/index.ts +22 -27
- package/templates/events-meetups-owner/tier5-src/_shared/aria-chat.ts +23 -3
- package/templates/gym-fitness/dev/index.ts +15 -3
- package/templates/gym-fitness-owner/dev/index.ts +22 -27
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-chat.ts +23 -3
- package/templates/nonprofit-cause-owner/dev/index.ts +22 -27
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-chat.ts +23 -3
- package/templates/owner-lite/dev/index.ts +22 -27
- package/templates/owner-lite/tier5-src/_shared/aria-chat.ts +23 -3
- package/templates/podcast-creator-owner/dev/index.ts +22 -27
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-chat.ts +23 -3
- package/templates/portfolio-creative-owner/dev/index.ts +22 -27
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-chat.ts +23 -3
- package/templates/restaurant-owner/dev/index.ts +22 -27
- package/templates/restaurant-owner/tier5-src/_shared/aria-chat.ts +23 -3
- package/templates/retail-store-owner/dev/index.ts +22 -27
- package/templates/retail-store-owner/tier5-src/_shared/aria-chat.ts +23 -3
- package/templates/yoga-studio/dev/index.ts +15 -1
- package/templates/yoga-studio-owner/dev/index.ts +22 -27
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-chat.ts +23 -3
|
@@ -54894,7 +54894,7 @@ const SCREENS = runtimeSetting({
|
|
|
54894
54894
|
"spacing": 3,
|
|
54895
54895
|
"children": [
|
|
54896
54896
|
{
|
|
54897
|
-
"id": "himi_owner_lite_aria.msg_$item.id.
|
|
54897
|
+
"id": "himi_owner_lite_aria.msg_$item.id.content",
|
|
54898
54898
|
"body": {
|
|
54899
54899
|
"package": "himalaya",
|
|
54900
54900
|
"type": "HStack",
|
|
@@ -54913,43 +54913,34 @@ const SCREENS = runtimeSetting({
|
|
|
54913
54913
|
}
|
|
54914
54914
|
},
|
|
54915
54915
|
{
|
|
54916
|
-
"id": "",
|
|
54916
|
+
"id": "himi_owner_lite_aria.msg_$item.id.bubble",
|
|
54917
54917
|
"body": {
|
|
54918
54918
|
"package": "himalaya",
|
|
54919
54919
|
"type": "Text",
|
|
54920
54920
|
"props": {
|
|
54921
|
-
"text": "$item.
|
|
54922
|
-
"style": "
|
|
54923
|
-
"
|
|
54924
|
-
"maxLines": 1
|
|
54921
|
+
"text": "$item.content",
|
|
54922
|
+
"style": "body",
|
|
54923
|
+
"maxLines": 50
|
|
54925
54924
|
}
|
|
54926
|
-
}
|
|
54927
|
-
}
|
|
54928
|
-
]
|
|
54929
|
-
}
|
|
54930
|
-
}
|
|
54931
|
-
},
|
|
54932
|
-
{
|
|
54933
|
-
"id": "himi_owner_lite_aria.msg_$item.id.content",
|
|
54934
|
-
"body": {
|
|
54935
|
-
"package": "himalaya",
|
|
54936
|
-
"type": "HStack",
|
|
54937
|
-
"props": {
|
|
54938
|
-
"spacing": 0,
|
|
54939
|
-
"children": [
|
|
54940
|
-
{
|
|
54941
|
-
"id": "",
|
|
54942
|
-
"body": {
|
|
54943
|
-
"package": "himalaya",
|
|
54944
|
-
"type": "Spacer",
|
|
54945
|
-
"props": {}
|
|
54946
54925
|
},
|
|
54947
54926
|
"modifiers": {
|
|
54927
|
+
"accessibilityLabel": "$item.spoken",
|
|
54928
|
+
"padding": {
|
|
54929
|
+
"leading": 16,
|
|
54930
|
+
"trailing": 16,
|
|
54931
|
+
"top": 8,
|
|
54932
|
+
"bottom": 8
|
|
54933
|
+
},
|
|
54934
|
+
"background": {
|
|
54935
|
+
"token": "surfaceSecondary"
|
|
54936
|
+
},
|
|
54937
|
+
"cornerRadius": 20,
|
|
54938
|
+
"maxWidth": 300,
|
|
54948
54939
|
"hiddenPath": "$item.notUser"
|
|
54949
54940
|
}
|
|
54950
54941
|
},
|
|
54951
54942
|
{
|
|
54952
|
-
"id": "",
|
|
54943
|
+
"id": "himi_owner_lite_aria.msg_$item.id.text",
|
|
54953
54944
|
"body": {
|
|
54954
54945
|
"package": "himalaya",
|
|
54955
54946
|
"type": "Text",
|
|
@@ -54958,6 +54949,10 @@ const SCREENS = runtimeSetting({
|
|
|
54958
54949
|
"style": "body",
|
|
54959
54950
|
"maxLines": 50
|
|
54960
54951
|
}
|
|
54952
|
+
},
|
|
54953
|
+
"modifiers": {
|
|
54954
|
+
"accessibilityLabel": "$item.spoken",
|
|
54955
|
+
"hiddenPath": "$item.notAria"
|
|
54961
54956
|
}
|
|
54962
54957
|
}
|
|
54963
54958
|
]
|
|
@@ -83,6 +83,11 @@ export interface AriaBubble {
|
|
|
83
83
|
* that right-aligns the owner renders two templates and collapses one. */
|
|
84
84
|
notUser: boolean;
|
|
85
85
|
notAria: boolean;
|
|
86
|
+
/** What a screen reader says for the row: the author, then the words. A
|
|
87
|
+
* screen that draws the speaker only as a bubble and a side of the screen
|
|
88
|
+
* (`messageStyle: 'userBubble'`) has no visible author line to read, and
|
|
89
|
+
* without this the owner's question and Aria's reply sound the same. */
|
|
90
|
+
spoken: string;
|
|
86
91
|
link1Label: string; link1Url: string; link1Hidden: boolean;
|
|
87
92
|
link2Label: string; link2Url: string; link2Hidden: boolean;
|
|
88
93
|
link3Label: string; link3Url: string; link3Hidden: boolean;
|
|
@@ -561,9 +566,23 @@ export function disclosedLabel(link: { label: string; url: string }): string {
|
|
|
561
566
|
* machinery dies. (Measured: 20 tests, every one of them about polling.) */
|
|
562
567
|
export { stripMarkdown };
|
|
563
568
|
|
|
569
|
+
/** The screen-reader line for a bubble — see `AriaBubble.spoken`. */
|
|
570
|
+
export function spokenOf(who: string, content: string): string {
|
|
571
|
+
return who ? `${who}: ${content}` : content;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/** A persisted transcript from before `spoken` existed, made whole. A `$item.`
|
|
575
|
+
* path missing on a row does not substitute, so a row without the field would
|
|
576
|
+
* announce the literal binding until the next rebuild replaced it. */
|
|
577
|
+
export function withSpoken(bubbles: AriaBubble[]): AriaBubble[] {
|
|
578
|
+
return bubbles.every((b) => typeof b.spoken === "string")
|
|
579
|
+
? bubbles
|
|
580
|
+
: bubbles.map((b) => (typeof b.spoken === "string" ? b : { ...b, spoken: spokenOf(b.who, b.content) }));
|
|
581
|
+
}
|
|
582
|
+
|
|
564
583
|
/** A greeting or optimistic bubble: no links, all slots defaulted. */
|
|
565
584
|
export function plainBubble(id: string, role: string, who: string, content: string): AriaBubble {
|
|
566
|
-
return { id, role, who, content, notUser: role !== "USER", notAria: role === "USER", ...linkFieldsOf("", role) };
|
|
585
|
+
return { id, role, who, content, notUser: role !== "USER", notAria: role === "USER", spoken: spokenOf(who, content), ...linkFieldsOf("", role) };
|
|
567
586
|
}
|
|
568
587
|
|
|
569
588
|
/** Server transcript → bubbles. USER text is literal; ASSISTANT replies are
|
|
@@ -644,6 +663,7 @@ function bubbleOf(id: string, role: string, who: string, raw: string, writing: b
|
|
|
644
663
|
content,
|
|
645
664
|
notUser: role !== "USER",
|
|
646
665
|
notAria: role === "USER",
|
|
666
|
+
spoken: spokenOf(who, content),
|
|
647
667
|
...linkFieldsOf(prose, role),
|
|
648
668
|
};
|
|
649
669
|
}
|
|
@@ -2004,7 +2024,7 @@ export function createAriaChat(o: AriaChatOptions): AriaChatCore {
|
|
|
2004
2024
|
// a rehydrated turn there was no ladder at all, leaving "Aria is
|
|
2005
2025
|
// typing…" on screen with nothing ever fetching the answer.
|
|
2006
2026
|
if (s._pending || s.status === "sending") {
|
|
2007
|
-
const held: AriaChatState = { ...s, status: "sending", prompts: [] };
|
|
2027
|
+
const held: AriaChatState = { ...s, status: "sending", prompts: [], messages: withSpoken(s.messages) };
|
|
2008
2028
|
return cadence(held, o.poll ? o.poll.fastMs : null, null);
|
|
2009
2029
|
}
|
|
2010
2030
|
// …but the self-kick pass runs BEFORE the pack is stashed, so the
|
|
@@ -2013,7 +2033,7 @@ export function createAriaChat(o: AriaChatOptions): AriaChatCore {
|
|
|
2013
2033
|
// still the only thing on screen — `prompts` is already recomputed
|
|
2014
2034
|
// here, and a chip pack that localizes beside a greeting that does not
|
|
2015
2035
|
// is the visible half of the same bug.
|
|
2016
|
-
const messages = isGreetingOnly(s.messages) ? greetingOnly() : s.messages;
|
|
2036
|
+
const messages = isGreetingOnly(s.messages) ? greetingOnly() : withSpoken(s.messages);
|
|
2017
2037
|
return { ...s, status: "ready", messages, prompts: promptsFor(messages, promptList()) };
|
|
2018
2038
|
}
|
|
2019
2039
|
try {
|