@wix/himalaya-cli 0.1785.0 → 0.1787.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/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +8 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +18 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +11 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +11 -0
- package/dist/cli.mjs +1451 -866
- package/guides/app-config.md +30 -0
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +8 -0
- package/guides/himi-json-output.md +17 -1
- package/guides/push-cli-onboarding.md +18 -0
- package/guides/qa-builds.md +22 -9
- package/package.json +2 -2
- package/templates/beauty-salon/tokens.json +2 -1
- package/templates/branded-lite/dev/index.ts +1719 -452
- package/templates/branded-lite/l10n/ar.json +36 -16
- package/templates/branded-lite/l10n/cs.json +36 -16
- package/templates/branded-lite/l10n/da.json +36 -16
- package/templates/branded-lite/l10n/de.json +36 -16
- package/templates/branded-lite/l10n/el.json +36 -16
- package/templates/branded-lite/l10n/en.json +42 -12
- package/templates/branded-lite/l10n/es.json +36 -16
- package/templates/branded-lite/l10n/fi.json +36 -16
- package/templates/branded-lite/l10n/fr.json +36 -16
- package/templates/branded-lite/l10n/he.json +30 -13
- package/templates/branded-lite/l10n/hu.json +36 -16
- package/templates/branded-lite/l10n/id.json +36 -16
- package/templates/branded-lite/l10n/it.json +36 -16
- package/templates/branded-lite/l10n/ja.json +36 -16
- package/templates/branded-lite/l10n/ko.json +36 -16
- package/templates/branded-lite/l10n/lt.json +36 -16
- package/templates/branded-lite/l10n/nl.json +36 -16
- package/templates/branded-lite/l10n/no.json +36 -16
- package/templates/branded-lite/l10n/pl.json +36 -16
- package/templates/branded-lite/l10n/pt.json +36 -16
- package/templates/branded-lite/l10n/ru.json +36 -16
- package/templates/branded-lite/l10n/sv.json +36 -16
- package/templates/branded-lite/l10n/th.json +36 -16
- package/templates/branded-lite/l10n/tr.json +36 -16
- package/templates/branded-lite/l10n/uk.json +36 -16
- package/templates/branded-lite/l10n/vi.json +36 -16
- package/templates/branded-lite/l10n/zh.json +36 -16
- package/templates/branded-lite/tier5-src/_shared/inbox-rooms.ts +10 -5
- package/templates/branded-lite/tier5-src/_shared/inbox-search.ts +1 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-inbox/index.ts +1 -1
- package/templates/branded-lite/tokens.json +3 -2
- package/templates/brandy/dev/member-screens.ts +7546 -5432
- package/templates/brandy/tier5-src/_shared/inbox-rooms.ts +10 -5
- package/templates/brandy/tier5-src/_shared/inbox-search.ts +1 -1
- package/templates/brandy/tier5-src/himi-branded-lite-inbox/index.ts +1 -1
- package/templates/brandy/tokens.json +5 -0
- package/templates/community-club/tokens.json +2 -1
- package/templates/conference/tier5-src/_shared/inbox-rooms.ts +10 -5
- package/templates/events-meetups/tokens.json +2 -1
- package/templates/fitness-gym/tier5-src/_shared/inbox-rooms.ts +10 -5
- package/templates/gym-fitness/tokens.json +2 -1
- package/templates/medical-services/tier5-src/_shared/inbox-rooms.ts +10 -5
- package/templates/nonprofit-cause/tokens.json +2 -1
- package/templates/personal-fitness-trainer/tier5-src/_shared/inbox-rooms.ts +10 -5
- package/templates/podcast-creator/tokens.json +2 -1
- package/templates/portfolio-creative/tokens.json +2 -1
- package/templates/restaurant/tokens.json +2 -1
- package/templates/retail-store/tokens.json +2 -1
- package/templates/salon-spa/tier5-src/_shared/inbox-rooms.ts +10 -5
- package/templates/wholesale-store/tier5-src/_shared/inbox-rooms.ts +10 -5
- package/templates/yoga-studio/tokens.json +2 -1
|
@@ -27,7 +27,10 @@ export interface InboxRow {
|
|
|
27
27
|
/** `chatroom` makes the thread use `id` as the room instead of resolving it as a member id. */
|
|
28
28
|
kind: "chatroom" | "";
|
|
29
29
|
photo: string;
|
|
30
|
-
/**
|
|
30
|
+
/** The business's own room. Set from the room, never from `screenId`, which a host may route elsewhere. */
|
|
31
|
+
business: boolean;
|
|
32
|
+
/** No photo on a member's room: the screen draws grey initials. Always false for the business, which keeps the solid
|
|
33
|
+
* accent avatar (kept with the photo by completeRow). */
|
|
31
34
|
noPhoto: boolean;
|
|
32
35
|
initial: string;
|
|
33
36
|
/** Has unread messages, or the member marked it unread. */
|
|
@@ -61,14 +64,15 @@ export const unreadCountText = (count: number): string => (count > MAX_COUNT ? `
|
|
|
61
64
|
|
|
62
65
|
/** Everything that follows from a row's base fields. The one place a flag is derived, so a row that changes
|
|
63
66
|
* (marked read, archived) can never carry a flag that disagrees with its base fields. */
|
|
64
|
-
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
67
|
+
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "business" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
65
68
|
export function completeRow(base: RowBase): InboxRow {
|
|
66
69
|
const unreadText = unreadCountText(base.unreadCount);
|
|
67
70
|
const showCount = base.unread && unreadText !== "";
|
|
68
71
|
const showDot = base.unread && !showCount;
|
|
69
72
|
return {
|
|
70
73
|
...base,
|
|
71
|
-
|
|
74
|
+
// Grey initials are for members: the business row keeps the solid accent avatar, photo or not.
|
|
75
|
+
noPhoto: !base.photo && !base.business,
|
|
72
76
|
unreadDot: base.unread ? "●" : "",
|
|
73
77
|
unreadText,
|
|
74
78
|
showCount, hideCount: !showCount, showDot, hideDot: !showDot,
|
|
@@ -80,8 +84,8 @@ export function completeRow(base: RowBase): InboxRow {
|
|
|
80
84
|
|
|
81
85
|
/** A row's read state changed: `count` is the server's count (0 = unknown or none). */
|
|
82
86
|
export function withUnread(row: InboxRow, unread: boolean, count: number): InboxRow {
|
|
83
|
-
const { id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
84
|
-
return completeRow({ id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
87
|
+
const { id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
88
|
+
return completeRow({ id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
/** Last-activity label in the device's zone: today → the time, yesterday → [yesterday] (the caller passes the localised
|
|
@@ -138,6 +142,7 @@ export function inboxRows(rooms: unknown[], fallbackTitle: string, options: Inbo
|
|
|
138
142
|
subtitle: text(last.summary),
|
|
139
143
|
screenId: business ? BUSINESS_SCREEN : "himi_chat_thread",
|
|
140
144
|
kind: business ? "" : "chatroom",
|
|
145
|
+
business,
|
|
141
146
|
photo: text(object(object(room.displayData).image).url),
|
|
142
147
|
initial: (title[0] ?? "#").toUpperCase(),
|
|
143
148
|
unread: count > 0 || unreadIds?.has(id) === true,
|
|
@@ -107,7 +107,7 @@ export function readSearch(response: unknown, options: ReadSearchOptions): Searc
|
|
|
107
107
|
screenId: room?.screenId ?? (business ? BUSINESS_SCREEN : "himi_chat_thread"),
|
|
108
108
|
kind: room ? room.kind : business ? "" : "chatroom",
|
|
109
109
|
photo: room?.photo ?? "",
|
|
110
|
-
noPhoto: !
|
|
110
|
+
noPhoto: room ? room.noPhoto : !business,
|
|
111
111
|
initial: room?.initial ?? (title[0] ?? "#").toUpperCase(),
|
|
112
112
|
});
|
|
113
113
|
}
|
|
@@ -85,7 +85,7 @@ interface S extends LoadFlags {
|
|
|
85
85
|
|
|
86
86
|
const PREFIX = "inbox";
|
|
87
87
|
const sample = (base: Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "initial">): Row =>
|
|
88
|
-
strip(completeRow({ ...base, photo: "", unread: false, unreadCount: 0, dateLabel: "", isArchived: false, isPrivate: false, at: 0 }));
|
|
88
|
+
strip(completeRow({ ...base, business: base.screenId === "himi_business_chat", photo: "", unread: false, unreadCount: 0, dateLabel: "", isArchived: false, isPrivate: false, at: 0 }));
|
|
89
89
|
const SAMPLES: Row[] = [
|
|
90
90
|
sample({ id: "sample-support", title: "Support", subtitle: "Hi! Let us know how we can help.", screenId: "himi_business_chat", kind: "", initial: "S" }),
|
|
91
91
|
sample({ id: "sample-member", title: "A member", subtitle: "Welcome 👋 Thanks for joining us!", screenId: "himi_chat_thread", kind: "chatroom", initial: "A" }),
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
"size": 14,
|
|
186
186
|
"weight": 400,
|
|
187
187
|
"line": 1.4,
|
|
188
|
-
"letterSpacing":
|
|
188
|
+
"letterSpacing": 0
|
|
189
189
|
},
|
|
190
190
|
"caption": {
|
|
191
191
|
"size": 13,
|
|
@@ -225,6 +225,7 @@
|
|
|
225
225
|
"sm": 18,
|
|
226
226
|
"md": 24,
|
|
227
227
|
"lg": 12,
|
|
228
|
+
"full": 999,
|
|
228
229
|
"pill": 28
|
|
229
230
|
},
|
|
230
231
|
"kit": {
|
|
@@ -27,7 +27,10 @@ export interface InboxRow {
|
|
|
27
27
|
/** `chatroom` makes the thread use `id` as the room instead of resolving it as a member id. */
|
|
28
28
|
kind: "chatroom" | "";
|
|
29
29
|
photo: string;
|
|
30
|
-
/**
|
|
30
|
+
/** The business's own room. Set from the room, never from `screenId`, which a host may route elsewhere. */
|
|
31
|
+
business: boolean;
|
|
32
|
+
/** No photo on a member's room: the screen draws grey initials. Always false for the business, which keeps the solid
|
|
33
|
+
* accent avatar (kept with the photo by completeRow). */
|
|
31
34
|
noPhoto: boolean;
|
|
32
35
|
initial: string;
|
|
33
36
|
/** Has unread messages, or the member marked it unread. */
|
|
@@ -61,14 +64,15 @@ export const unreadCountText = (count: number): string => (count > MAX_COUNT ? `
|
|
|
61
64
|
|
|
62
65
|
/** Everything that follows from a row's base fields. The one place a flag is derived, so a row that changes
|
|
63
66
|
* (marked read, archived) can never carry a flag that disagrees with its base fields. */
|
|
64
|
-
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
67
|
+
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "business" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
65
68
|
export function completeRow(base: RowBase): InboxRow {
|
|
66
69
|
const unreadText = unreadCountText(base.unreadCount);
|
|
67
70
|
const showCount = base.unread && unreadText !== "";
|
|
68
71
|
const showDot = base.unread && !showCount;
|
|
69
72
|
return {
|
|
70
73
|
...base,
|
|
71
|
-
|
|
74
|
+
// Grey initials are for members: the business row keeps the solid accent avatar, photo or not.
|
|
75
|
+
noPhoto: !base.photo && !base.business,
|
|
72
76
|
unreadDot: base.unread ? "●" : "",
|
|
73
77
|
unreadText,
|
|
74
78
|
showCount, hideCount: !showCount, showDot, hideDot: !showDot,
|
|
@@ -80,8 +84,8 @@ export function completeRow(base: RowBase): InboxRow {
|
|
|
80
84
|
|
|
81
85
|
/** A row's read state changed: `count` is the server's count (0 = unknown or none). */
|
|
82
86
|
export function withUnread(row: InboxRow, unread: boolean, count: number): InboxRow {
|
|
83
|
-
const { id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
84
|
-
return completeRow({ id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
87
|
+
const { id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
88
|
+
return completeRow({ id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
/** Last-activity label in the device's zone: today → the time, yesterday → [yesterday] (the caller passes the localised
|
|
@@ -138,6 +142,7 @@ export function inboxRows(rooms: unknown[], fallbackTitle: string, options: Inbo
|
|
|
138
142
|
subtitle: text(last.summary),
|
|
139
143
|
screenId: business ? BUSINESS_SCREEN : "himi_chat_thread",
|
|
140
144
|
kind: business ? "" : "chatroom",
|
|
145
|
+
business,
|
|
141
146
|
photo: text(object(object(room.displayData).image).url),
|
|
142
147
|
initial: (title[0] ?? "#").toUpperCase(),
|
|
143
148
|
unread: count > 0 || unreadIds?.has(id) === true,
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
"size": 14,
|
|
176
176
|
"weight": 400,
|
|
177
177
|
"line": 1.4,
|
|
178
|
-
"letterSpacing":
|
|
178
|
+
"letterSpacing": 0
|
|
179
179
|
},
|
|
180
180
|
"caption": {
|
|
181
181
|
"size": 13,
|
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"sm": 12,
|
|
213
213
|
"md": 18,
|
|
214
214
|
"lg": 12,
|
|
215
|
+
"full": 999,
|
|
215
216
|
"pill": 26
|
|
216
217
|
},
|
|
217
218
|
"kit": {
|
|
@@ -27,7 +27,10 @@ export interface InboxRow {
|
|
|
27
27
|
/** `chatroom` makes the thread use `id` as the room instead of resolving it as a member id. */
|
|
28
28
|
kind: "chatroom" | "";
|
|
29
29
|
photo: string;
|
|
30
|
-
/**
|
|
30
|
+
/** The business's own room. Set from the room, never from `screenId`, which a host may route elsewhere. */
|
|
31
|
+
business: boolean;
|
|
32
|
+
/** No photo on a member's room: the screen draws grey initials. Always false for the business, which keeps the solid
|
|
33
|
+
* accent avatar (kept with the photo by completeRow). */
|
|
31
34
|
noPhoto: boolean;
|
|
32
35
|
initial: string;
|
|
33
36
|
/** Has unread messages, or the member marked it unread. */
|
|
@@ -61,14 +64,15 @@ export const unreadCountText = (count: number): string => (count > MAX_COUNT ? `
|
|
|
61
64
|
|
|
62
65
|
/** Everything that follows from a row's base fields. The one place a flag is derived, so a row that changes
|
|
63
66
|
* (marked read, archived) can never carry a flag that disagrees with its base fields. */
|
|
64
|
-
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
67
|
+
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "business" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
65
68
|
export function completeRow(base: RowBase): InboxRow {
|
|
66
69
|
const unreadText = unreadCountText(base.unreadCount);
|
|
67
70
|
const showCount = base.unread && unreadText !== "";
|
|
68
71
|
const showDot = base.unread && !showCount;
|
|
69
72
|
return {
|
|
70
73
|
...base,
|
|
71
|
-
|
|
74
|
+
// Grey initials are for members: the business row keeps the solid accent avatar, photo or not.
|
|
75
|
+
noPhoto: !base.photo && !base.business,
|
|
72
76
|
unreadDot: base.unread ? "●" : "",
|
|
73
77
|
unreadText,
|
|
74
78
|
showCount, hideCount: !showCount, showDot, hideDot: !showDot,
|
|
@@ -80,8 +84,8 @@ export function completeRow(base: RowBase): InboxRow {
|
|
|
80
84
|
|
|
81
85
|
/** A row's read state changed: `count` is the server's count (0 = unknown or none). */
|
|
82
86
|
export function withUnread(row: InboxRow, unread: boolean, count: number): InboxRow {
|
|
83
|
-
const { id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
84
|
-
return completeRow({ id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
87
|
+
const { id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
88
|
+
return completeRow({ id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
/** Last-activity label in the device's zone: today → the time, yesterday → [yesterday] (the caller passes the localised
|
|
@@ -138,6 +142,7 @@ export function inboxRows(rooms: unknown[], fallbackTitle: string, options: Inbo
|
|
|
138
142
|
subtitle: text(last.summary),
|
|
139
143
|
screenId: business ? BUSINESS_SCREEN : "himi_chat_thread",
|
|
140
144
|
kind: business ? "" : "chatroom",
|
|
145
|
+
business,
|
|
141
146
|
photo: text(object(object(room.displayData).image).url),
|
|
142
147
|
initial: (title[0] ?? "#").toUpperCase(),
|
|
143
148
|
unread: count > 0 || unreadIds?.has(id) === true,
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"size": 14,
|
|
182
182
|
"weight": 400,
|
|
183
183
|
"line": 1.4,
|
|
184
|
-
"letterSpacing":
|
|
184
|
+
"letterSpacing": 0
|
|
185
185
|
},
|
|
186
186
|
"caption": {
|
|
187
187
|
"size": 12,
|
|
@@ -221,6 +221,7 @@
|
|
|
221
221
|
"sm": 0,
|
|
222
222
|
"md": 0,
|
|
223
223
|
"lg": 12,
|
|
224
|
+
"full": 999,
|
|
224
225
|
"pill": 0
|
|
225
226
|
},
|
|
226
227
|
"kit": {
|
|
@@ -27,7 +27,10 @@ export interface InboxRow {
|
|
|
27
27
|
/** `chatroom` makes the thread use `id` as the room instead of resolving it as a member id. */
|
|
28
28
|
kind: "chatroom" | "";
|
|
29
29
|
photo: string;
|
|
30
|
-
/**
|
|
30
|
+
/** The business's own room. Set from the room, never from `screenId`, which a host may route elsewhere. */
|
|
31
|
+
business: boolean;
|
|
32
|
+
/** No photo on a member's room: the screen draws grey initials. Always false for the business, which keeps the solid
|
|
33
|
+
* accent avatar (kept with the photo by completeRow). */
|
|
31
34
|
noPhoto: boolean;
|
|
32
35
|
initial: string;
|
|
33
36
|
/** Has unread messages, or the member marked it unread. */
|
|
@@ -61,14 +64,15 @@ export const unreadCountText = (count: number): string => (count > MAX_COUNT ? `
|
|
|
61
64
|
|
|
62
65
|
/** Everything that follows from a row's base fields. The one place a flag is derived, so a row that changes
|
|
63
66
|
* (marked read, archived) can never carry a flag that disagrees with its base fields. */
|
|
64
|
-
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
67
|
+
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "business" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
65
68
|
export function completeRow(base: RowBase): InboxRow {
|
|
66
69
|
const unreadText = unreadCountText(base.unreadCount);
|
|
67
70
|
const showCount = base.unread && unreadText !== "";
|
|
68
71
|
const showDot = base.unread && !showCount;
|
|
69
72
|
return {
|
|
70
73
|
...base,
|
|
71
|
-
|
|
74
|
+
// Grey initials are for members: the business row keeps the solid accent avatar, photo or not.
|
|
75
|
+
noPhoto: !base.photo && !base.business,
|
|
72
76
|
unreadDot: base.unread ? "●" : "",
|
|
73
77
|
unreadText,
|
|
74
78
|
showCount, hideCount: !showCount, showDot, hideDot: !showDot,
|
|
@@ -80,8 +84,8 @@ export function completeRow(base: RowBase): InboxRow {
|
|
|
80
84
|
|
|
81
85
|
/** A row's read state changed: `count` is the server's count (0 = unknown or none). */
|
|
82
86
|
export function withUnread(row: InboxRow, unread: boolean, count: number): InboxRow {
|
|
83
|
-
const { id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
84
|
-
return completeRow({ id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
87
|
+
const { id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
88
|
+
return completeRow({ id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
/** Last-activity label in the device's zone: today → the time, yesterday → [yesterday] (the caller passes the localised
|
|
@@ -138,6 +142,7 @@ export function inboxRows(rooms: unknown[], fallbackTitle: string, options: Inbo
|
|
|
138
142
|
subtitle: text(last.summary),
|
|
139
143
|
screenId: business ? BUSINESS_SCREEN : "himi_chat_thread",
|
|
140
144
|
kind: business ? "" : "chatroom",
|
|
145
|
+
business,
|
|
141
146
|
photo: text(object(object(room.displayData).image).url),
|
|
142
147
|
initial: (title[0] ?? "#").toUpperCase(),
|
|
143
148
|
unread: count > 0 || unreadIds?.has(id) === true,
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
"size": 14,
|
|
176
176
|
"weight": 400,
|
|
177
177
|
"line": 1.4,
|
|
178
|
-
"letterSpacing":
|
|
178
|
+
"letterSpacing": 0
|
|
179
179
|
},
|
|
180
180
|
"caption": {
|
|
181
181
|
"size": 12,
|
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"sm": 8,
|
|
213
213
|
"md": 12,
|
|
214
214
|
"lg": 12,
|
|
215
|
+
"full": 999,
|
|
215
216
|
"pill": 20
|
|
216
217
|
},
|
|
217
218
|
"kit": {
|
|
@@ -27,7 +27,10 @@ export interface InboxRow {
|
|
|
27
27
|
/** `chatroom` makes the thread use `id` as the room instead of resolving it as a member id. */
|
|
28
28
|
kind: "chatroom" | "";
|
|
29
29
|
photo: string;
|
|
30
|
-
/**
|
|
30
|
+
/** The business's own room. Set from the room, never from `screenId`, which a host may route elsewhere. */
|
|
31
|
+
business: boolean;
|
|
32
|
+
/** No photo on a member's room: the screen draws grey initials. Always false for the business, which keeps the solid
|
|
33
|
+
* accent avatar (kept with the photo by completeRow). */
|
|
31
34
|
noPhoto: boolean;
|
|
32
35
|
initial: string;
|
|
33
36
|
/** Has unread messages, or the member marked it unread. */
|
|
@@ -61,14 +64,15 @@ export const unreadCountText = (count: number): string => (count > MAX_COUNT ? `
|
|
|
61
64
|
|
|
62
65
|
/** Everything that follows from a row's base fields. The one place a flag is derived, so a row that changes
|
|
63
66
|
* (marked read, archived) can never carry a flag that disagrees with its base fields. */
|
|
64
|
-
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
67
|
+
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "business" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
65
68
|
export function completeRow(base: RowBase): InboxRow {
|
|
66
69
|
const unreadText = unreadCountText(base.unreadCount);
|
|
67
70
|
const showCount = base.unread && unreadText !== "";
|
|
68
71
|
const showDot = base.unread && !showCount;
|
|
69
72
|
return {
|
|
70
73
|
...base,
|
|
71
|
-
|
|
74
|
+
// Grey initials are for members: the business row keeps the solid accent avatar, photo or not.
|
|
75
|
+
noPhoto: !base.photo && !base.business,
|
|
72
76
|
unreadDot: base.unread ? "●" : "",
|
|
73
77
|
unreadText,
|
|
74
78
|
showCount, hideCount: !showCount, showDot, hideDot: !showDot,
|
|
@@ -80,8 +84,8 @@ export function completeRow(base: RowBase): InboxRow {
|
|
|
80
84
|
|
|
81
85
|
/** A row's read state changed: `count` is the server's count (0 = unknown or none). */
|
|
82
86
|
export function withUnread(row: InboxRow, unread: boolean, count: number): InboxRow {
|
|
83
|
-
const { id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
84
|
-
return completeRow({ id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
87
|
+
const { id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
88
|
+
return completeRow({ id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
/** Last-activity label in the device's zone: today → the time, yesterday → [yesterday] (the caller passes the localised
|
|
@@ -138,6 +142,7 @@ export function inboxRows(rooms: unknown[], fallbackTitle: string, options: Inbo
|
|
|
138
142
|
subtitle: text(last.summary),
|
|
139
143
|
screenId: business ? BUSINESS_SCREEN : "himi_chat_thread",
|
|
140
144
|
kind: business ? "" : "chatroom",
|
|
145
|
+
business,
|
|
141
146
|
photo: text(object(object(room.displayData).image).url),
|
|
142
147
|
initial: (title[0] ?? "#").toUpperCase(),
|
|
143
148
|
unread: count > 0 || unreadIds?.has(id) === true,
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"size": 14,
|
|
182
182
|
"weight": 400,
|
|
183
183
|
"line": 1.4,
|
|
184
|
-
"letterSpacing":
|
|
184
|
+
"letterSpacing": 0
|
|
185
185
|
},
|
|
186
186
|
"caption": {
|
|
187
187
|
"size": 12,
|
|
@@ -221,6 +221,7 @@
|
|
|
221
221
|
"sm": 10,
|
|
222
222
|
"md": 14,
|
|
223
223
|
"lg": 12,
|
|
224
|
+
"full": 999,
|
|
224
225
|
"pill": 22
|
|
225
226
|
},
|
|
226
227
|
"kit": {
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"size": 14,
|
|
182
182
|
"weight": 400,
|
|
183
183
|
"line": 1.4,
|
|
184
|
-
"letterSpacing":
|
|
184
|
+
"letterSpacing": 0
|
|
185
185
|
},
|
|
186
186
|
"caption": {
|
|
187
187
|
"size": 12,
|
|
@@ -221,6 +221,7 @@
|
|
|
221
221
|
"sm": 2,
|
|
222
222
|
"md": 4,
|
|
223
223
|
"lg": 12,
|
|
224
|
+
"full": 999,
|
|
224
225
|
"pill": 4
|
|
225
226
|
},
|
|
226
227
|
"kit": {
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"size": 14,
|
|
182
182
|
"weight": 400,
|
|
183
183
|
"line": 1.4,
|
|
184
|
-
"letterSpacing":
|
|
184
|
+
"letterSpacing": 0
|
|
185
185
|
},
|
|
186
186
|
"caption": {
|
|
187
187
|
"size": 12,
|
|
@@ -221,6 +221,7 @@
|
|
|
221
221
|
"sm": 10,
|
|
222
222
|
"md": 14,
|
|
223
223
|
"lg": 12,
|
|
224
|
+
"full": 999,
|
|
224
225
|
"pill": 22
|
|
225
226
|
},
|
|
226
227
|
"kit": {
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
"size": 14,
|
|
176
176
|
"weight": 400,
|
|
177
177
|
"line": 1.4,
|
|
178
|
-
"letterSpacing":
|
|
178
|
+
"letterSpacing": 0
|
|
179
179
|
},
|
|
180
180
|
"caption": {
|
|
181
181
|
"size": 12,
|
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"sm": 8,
|
|
213
213
|
"md": 12,
|
|
214
214
|
"lg": 12,
|
|
215
|
+
"full": 999,
|
|
215
216
|
"pill": 20
|
|
216
217
|
},
|
|
217
218
|
"kit": {
|
|
@@ -27,7 +27,10 @@ export interface InboxRow {
|
|
|
27
27
|
/** `chatroom` makes the thread use `id` as the room instead of resolving it as a member id. */
|
|
28
28
|
kind: "chatroom" | "";
|
|
29
29
|
photo: string;
|
|
30
|
-
/**
|
|
30
|
+
/** The business's own room. Set from the room, never from `screenId`, which a host may route elsewhere. */
|
|
31
|
+
business: boolean;
|
|
32
|
+
/** No photo on a member's room: the screen draws grey initials. Always false for the business, which keeps the solid
|
|
33
|
+
* accent avatar (kept with the photo by completeRow). */
|
|
31
34
|
noPhoto: boolean;
|
|
32
35
|
initial: string;
|
|
33
36
|
/** Has unread messages, or the member marked it unread. */
|
|
@@ -61,14 +64,15 @@ export const unreadCountText = (count: number): string => (count > MAX_COUNT ? `
|
|
|
61
64
|
|
|
62
65
|
/** Everything that follows from a row's base fields. The one place a flag is derived, so a row that changes
|
|
63
66
|
* (marked read, archived) can never carry a flag that disagrees with its base fields. */
|
|
64
|
-
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
67
|
+
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "business" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
65
68
|
export function completeRow(base: RowBase): InboxRow {
|
|
66
69
|
const unreadText = unreadCountText(base.unreadCount);
|
|
67
70
|
const showCount = base.unread && unreadText !== "";
|
|
68
71
|
const showDot = base.unread && !showCount;
|
|
69
72
|
return {
|
|
70
73
|
...base,
|
|
71
|
-
|
|
74
|
+
// Grey initials are for members: the business row keeps the solid accent avatar, photo or not.
|
|
75
|
+
noPhoto: !base.photo && !base.business,
|
|
72
76
|
unreadDot: base.unread ? "●" : "",
|
|
73
77
|
unreadText,
|
|
74
78
|
showCount, hideCount: !showCount, showDot, hideDot: !showDot,
|
|
@@ -80,8 +84,8 @@ export function completeRow(base: RowBase): InboxRow {
|
|
|
80
84
|
|
|
81
85
|
/** A row's read state changed: `count` is the server's count (0 = unknown or none). */
|
|
82
86
|
export function withUnread(row: InboxRow, unread: boolean, count: number): InboxRow {
|
|
83
|
-
const { id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
84
|
-
return completeRow({ id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
87
|
+
const { id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
88
|
+
return completeRow({ id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
/** Last-activity label in the device's zone: today → the time, yesterday → [yesterday] (the caller passes the localised
|
|
@@ -138,6 +142,7 @@ export function inboxRows(rooms: unknown[], fallbackTitle: string, options: Inbo
|
|
|
138
142
|
subtitle: text(last.summary),
|
|
139
143
|
screenId: business ? BUSINESS_SCREEN : "himi_chat_thread",
|
|
140
144
|
kind: business ? "" : "chatroom",
|
|
145
|
+
business,
|
|
141
146
|
photo: text(object(object(room.displayData).image).url),
|
|
142
147
|
initial: (title[0] ?? "#").toUpperCase(),
|
|
143
148
|
unread: count > 0 || unreadIds?.has(id) === true,
|
|
@@ -27,7 +27,10 @@ export interface InboxRow {
|
|
|
27
27
|
/** `chatroom` makes the thread use `id` as the room instead of resolving it as a member id. */
|
|
28
28
|
kind: "chatroom" | "";
|
|
29
29
|
photo: string;
|
|
30
|
-
/**
|
|
30
|
+
/** The business's own room. Set from the room, never from `screenId`, which a host may route elsewhere. */
|
|
31
|
+
business: boolean;
|
|
32
|
+
/** No photo on a member's room: the screen draws grey initials. Always false for the business, which keeps the solid
|
|
33
|
+
* accent avatar (kept with the photo by completeRow). */
|
|
31
34
|
noPhoto: boolean;
|
|
32
35
|
initial: string;
|
|
33
36
|
/** Has unread messages, or the member marked it unread. */
|
|
@@ -61,14 +64,15 @@ export const unreadCountText = (count: number): string => (count > MAX_COUNT ? `
|
|
|
61
64
|
|
|
62
65
|
/** Everything that follows from a row's base fields. The one place a flag is derived, so a row that changes
|
|
63
66
|
* (marked read, archived) can never carry a flag that disagrees with its base fields. */
|
|
64
|
-
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
67
|
+
export type RowBase = Pick<InboxRow, "id" | "title" | "subtitle" | "screenId" | "kind" | "business" | "photo" | "initial" | "unread" | "unreadCount" | "dateLabel" | "isArchived" | "isPrivate" | "at">;
|
|
65
68
|
export function completeRow(base: RowBase): InboxRow {
|
|
66
69
|
const unreadText = unreadCountText(base.unreadCount);
|
|
67
70
|
const showCount = base.unread && unreadText !== "";
|
|
68
71
|
const showDot = base.unread && !showCount;
|
|
69
72
|
return {
|
|
70
73
|
...base,
|
|
71
|
-
|
|
74
|
+
// Grey initials are for members: the business row keeps the solid accent avatar, photo or not.
|
|
75
|
+
noPhoto: !base.photo && !base.business,
|
|
72
76
|
unreadDot: base.unread ? "●" : "",
|
|
73
77
|
unreadText,
|
|
74
78
|
showCount, hideCount: !showCount, showDot, hideDot: !showDot,
|
|
@@ -80,8 +84,8 @@ export function completeRow(base: RowBase): InboxRow {
|
|
|
80
84
|
|
|
81
85
|
/** A row's read state changed: `count` is the server's count (0 = unknown or none). */
|
|
82
86
|
export function withUnread(row: InboxRow, unread: boolean, count: number): InboxRow {
|
|
83
|
-
const { id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
84
|
-
return completeRow({ id, title, subtitle, screenId, kind, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
87
|
+
const { id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at } = row;
|
|
88
|
+
return completeRow({ id, title, subtitle, screenId, kind, business, photo, initial, dateLabel, isArchived, isPrivate, at, unread, unreadCount: unread ? count : 0 });
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
/** Last-activity label in the device's zone: today → the time, yesterday → [yesterday] (the caller passes the localised
|
|
@@ -138,6 +142,7 @@ export function inboxRows(rooms: unknown[], fallbackTitle: string, options: Inbo
|
|
|
138
142
|
subtitle: text(last.summary),
|
|
139
143
|
screenId: business ? BUSINESS_SCREEN : "himi_chat_thread",
|
|
140
144
|
kind: business ? "" : "chatroom",
|
|
145
|
+
business,
|
|
141
146
|
photo: text(object(object(room.displayData).image).url),
|
|
142
147
|
initial: (title[0] ?? "#").toUpperCase(),
|
|
143
148
|
unread: count > 0 || unreadIds?.has(id) === true,
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
"size": 14,
|
|
190
190
|
"weight": 400,
|
|
191
191
|
"line": 1.4,
|
|
192
|
-
"letterSpacing":
|
|
192
|
+
"letterSpacing": 0
|
|
193
193
|
},
|
|
194
194
|
"caption": {
|
|
195
195
|
"size": 13,
|
|
@@ -229,6 +229,7 @@
|
|
|
229
229
|
"sm": 12,
|
|
230
230
|
"md": 16,
|
|
231
231
|
"lg": 12,
|
|
232
|
+
"full": 999,
|
|
232
233
|
"pill": 22
|
|
233
234
|
},
|
|
234
235
|
"kit": {
|