@wix/himalaya-cli 0.1600.0 → 0.1602.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 +0 -2
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/himi-blog-post/index.ts +7 -6
- package/templates/branded-lite/l10n/en.json +1 -1
- package/templates/branded-lite/tier5-src/himi-blog-post/index.ts +7 -6
- package/templates/community-club/tier5-src/himi-blog-post/index.ts +7 -6
- package/templates/events-meetups/tier5-src/himi-blog-post/index.ts +7 -6
- package/templates/gym-fitness/tier5-src/himi-blog-post/index.ts +7 -6
- package/templates/nonprofit-cause/tier5-src/himi-blog-post/index.ts +7 -6
- package/templates/podcast-creator/tier5-src/himi-blog-post/index.ts +7 -6
- package/templates/portfolio-creative/tier5-src/himi-blog-post/index.ts +7 -6
- package/templates/restaurant/tier5-src/himi-blog-post/index.ts +7 -6
- package/templates/retail-store/tier5-src/himi-blog-post/index.ts +7 -6
- package/templates/yoga-studio/tier5-src/himi-blog-post/index.ts +7 -6
package/dist/cli.mjs
CHANGED
|
@@ -15065,7 +15065,6 @@ function webViewOriginAllowed(url, origins) {
|
|
|
15065
15065
|
}
|
|
15066
15066
|
var init_webview_origin = __esm({
|
|
15067
15067
|
"../../core/ts/src/webview-origin.ts"() {
|
|
15068
|
-
"use strict";
|
|
15069
15068
|
init_define_HHP_CATALOG();
|
|
15070
15069
|
}
|
|
15071
15070
|
});
|
|
@@ -27635,7 +27634,6 @@ function resolveIdiom(tokens2, ctx = {}) {
|
|
|
27635
27634
|
var IDIOM_CONTEXTS, UNSAFE_KEYS;
|
|
27636
27635
|
var init_idiom = __esm({
|
|
27637
27636
|
"../../core/ts/src/idiom.ts"() {
|
|
27638
|
-
"use strict";
|
|
27639
27637
|
init_define_HHP_CATALOG();
|
|
27640
27638
|
IDIOM_CONTEXTS = {
|
|
27641
27639
|
ios: { native: ["ios"] },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1602.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"artifactId": "himalaya-cli"
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
"falconPackageHash": "
|
|
75
|
+
"falconPackageHash": "912a018c8faa872ff500b38a18a77faf8eded63603ce4eecaf8822e7"
|
|
76
76
|
}
|
|
@@ -6,7 +6,7 @@ import { comments, BLOG_COMMENTS_APP_ID, blogCommentRow, listBlogComments, type
|
|
|
6
6
|
import { get, type DbEntity } from "@himalaya/local-db";
|
|
7
7
|
import { isSavedId, toggleSavedId } from "../_shared/himi-blog-saved";
|
|
8
8
|
import { hideId, isHiddenId, unhideId } from "../_shared/himi-blog-hidden";
|
|
9
|
-
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
9
|
+
import { stashCopy, copyParam, copyPlural, copyTemplate } from "../_shared/himi-copy.js";
|
|
10
10
|
import { formatDateMedium, formatMonthDay } from "../_shared/engine-intl.js";
|
|
11
11
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
12
12
|
import { richBody, ROW_IMAGE_WIDTH } from "../_shared/rich-body.js";
|
|
@@ -119,8 +119,8 @@ function countsLineOf(post: PostWithExtras): string {
|
|
|
119
119
|
const likes = post.metrics?.likeCount ?? post.metrics?.likes ?? 0;
|
|
120
120
|
const comments = post.metrics?.totalComments ?? post.metrics?.commentCount ?? post.metrics?.comments ?? 0;
|
|
121
121
|
const bits: string[] = [];
|
|
122
|
-
if (likes > 0) bits.push(
|
|
123
|
-
if (comments > 0) bits.push(
|
|
122
|
+
if (likes > 0) bits.push(copyPlural("blogPost.likesCount", "{n, plural, one {# like} other {# likes}}", likes));
|
|
123
|
+
if (comments > 0) bits.push(copyPlural("blogPost.commentsCount", "{n, plural, one {# comment} other {# comments}}", comments));
|
|
124
124
|
return bits.join(" · ");
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -172,7 +172,7 @@ function subtitle(post: WixPost): string {
|
|
|
172
172
|
if (post.firstPublishedDate) {
|
|
173
173
|
bits.push(formatDateMedium(new Date(post.firstPublishedDate)));
|
|
174
174
|
}
|
|
175
|
-
if (post.minutesToRead) bits.push(
|
|
175
|
+
if (post.minutesToRead) bits.push(copyPlural("blogPost.minRead", "{n, plural, one {# min read} other {# min read}}", post.minutesToRead));
|
|
176
176
|
return bits.join(" · ");
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -187,10 +187,11 @@ function commentMeta(row: WixBlogCommentRow): string {
|
|
|
187
187
|
|
|
188
188
|
function toCommentRow(row: WixBlogCommentRow): CommentRow {
|
|
189
189
|
// The plain text is the document's own (runs joined as written, not space-separated) when it has one.
|
|
190
|
-
|
|
190
|
+
// `forum.commentCta` is the app's one "Comment": the pack forwards that single key to this screen (see the prefixes).
|
|
191
|
+
const { bodyJson, bodyText } = richBody(row.richContent, row.text || copyParam("forum.commentCta", "Comment"), ROW_IMAGE_WIDTH);
|
|
191
192
|
return {
|
|
192
193
|
id: row.id,
|
|
193
|
-
authorName: row.authorName || "Member",
|
|
194
|
+
authorName: row.authorName || copyParam("blogPost.memberFallback", "Member"),
|
|
194
195
|
text: bodyText,
|
|
195
196
|
meta: commentMeta(row),
|
|
196
197
|
bodyJson,
|
|
@@ -6,7 +6,7 @@ import { comments, BLOG_COMMENTS_APP_ID, blogCommentRow, listBlogComments, type
|
|
|
6
6
|
import { get, type DbEntity } from "@himalaya/local-db";
|
|
7
7
|
import { isSavedId, toggleSavedId } from "../_shared/himi-blog-saved";
|
|
8
8
|
import { hideId, isHiddenId, unhideId } from "../_shared/himi-blog-hidden";
|
|
9
|
-
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
9
|
+
import { stashCopy, copyParam, copyPlural, copyTemplate } from "../_shared/himi-copy.js";
|
|
10
10
|
import { formatDateMedium, formatMonthDay } from "../_shared/engine-intl.js";
|
|
11
11
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
12
12
|
import { richBody, ROW_IMAGE_WIDTH } from "../_shared/rich-body.js";
|
|
@@ -119,8 +119,8 @@ function countsLineOf(post: PostWithExtras): string {
|
|
|
119
119
|
const likes = post.metrics?.likeCount ?? post.metrics?.likes ?? 0;
|
|
120
120
|
const comments = post.metrics?.totalComments ?? post.metrics?.commentCount ?? post.metrics?.comments ?? 0;
|
|
121
121
|
const bits: string[] = [];
|
|
122
|
-
if (likes > 0) bits.push(
|
|
123
|
-
if (comments > 0) bits.push(
|
|
122
|
+
if (likes > 0) bits.push(copyPlural("blogPost.likesCount", "{n, plural, one {# like} other {# likes}}", likes));
|
|
123
|
+
if (comments > 0) bits.push(copyPlural("blogPost.commentsCount", "{n, plural, one {# comment} other {# comments}}", comments));
|
|
124
124
|
return bits.join(" · ");
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -172,7 +172,7 @@ function subtitle(post: WixPost): string {
|
|
|
172
172
|
if (post.firstPublishedDate) {
|
|
173
173
|
bits.push(formatDateMedium(new Date(post.firstPublishedDate)));
|
|
174
174
|
}
|
|
175
|
-
if (post.minutesToRead) bits.push(
|
|
175
|
+
if (post.minutesToRead) bits.push(copyPlural("blogPost.minRead", "{n, plural, one {# min read} other {# min read}}", post.minutesToRead));
|
|
176
176
|
return bits.join(" · ");
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -187,10 +187,11 @@ function commentMeta(row: WixBlogCommentRow): string {
|
|
|
187
187
|
|
|
188
188
|
function toCommentRow(row: WixBlogCommentRow): CommentRow {
|
|
189
189
|
// The plain text is the document's own (runs joined as written, not space-separated) when it has one.
|
|
190
|
-
|
|
190
|
+
// `forum.commentCta` is the app's one "Comment": the pack forwards that single key to this screen (see the prefixes).
|
|
191
|
+
const { bodyJson, bodyText } = richBody(row.richContent, row.text || copyParam("forum.commentCta", "Comment"), ROW_IMAGE_WIDTH);
|
|
191
192
|
return {
|
|
192
193
|
id: row.id,
|
|
193
|
-
authorName: row.authorName || "Member",
|
|
194
|
+
authorName: row.authorName || copyParam("blogPost.memberFallback", "Member"),
|
|
194
195
|
text: bodyText,
|
|
195
196
|
meta: commentMeta(row),
|
|
196
197
|
bodyJson,
|
|
@@ -6,7 +6,7 @@ import { comments, BLOG_COMMENTS_APP_ID, blogCommentRow, listBlogComments, type
|
|
|
6
6
|
import { get, type DbEntity } from "@himalaya/local-db";
|
|
7
7
|
import { isSavedId, toggleSavedId } from "../_shared/himi-blog-saved";
|
|
8
8
|
import { hideId, isHiddenId, unhideId } from "../_shared/himi-blog-hidden";
|
|
9
|
-
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
9
|
+
import { stashCopy, copyParam, copyPlural, copyTemplate } from "../_shared/himi-copy.js";
|
|
10
10
|
import { formatDateMedium, formatMonthDay } from "../_shared/engine-intl.js";
|
|
11
11
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
12
12
|
import { richBody, ROW_IMAGE_WIDTH } from "../_shared/rich-body.js";
|
|
@@ -119,8 +119,8 @@ function countsLineOf(post: PostWithExtras): string {
|
|
|
119
119
|
const likes = post.metrics?.likeCount ?? post.metrics?.likes ?? 0;
|
|
120
120
|
const comments = post.metrics?.totalComments ?? post.metrics?.commentCount ?? post.metrics?.comments ?? 0;
|
|
121
121
|
const bits: string[] = [];
|
|
122
|
-
if (likes > 0) bits.push(
|
|
123
|
-
if (comments > 0) bits.push(
|
|
122
|
+
if (likes > 0) bits.push(copyPlural("blogPost.likesCount", "{n, plural, one {# like} other {# likes}}", likes));
|
|
123
|
+
if (comments > 0) bits.push(copyPlural("blogPost.commentsCount", "{n, plural, one {# comment} other {# comments}}", comments));
|
|
124
124
|
return bits.join(" · ");
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -172,7 +172,7 @@ function subtitle(post: WixPost): string {
|
|
|
172
172
|
if (post.firstPublishedDate) {
|
|
173
173
|
bits.push(formatDateMedium(new Date(post.firstPublishedDate)));
|
|
174
174
|
}
|
|
175
|
-
if (post.minutesToRead) bits.push(
|
|
175
|
+
if (post.minutesToRead) bits.push(copyPlural("blogPost.minRead", "{n, plural, one {# min read} other {# min read}}", post.minutesToRead));
|
|
176
176
|
return bits.join(" · ");
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -187,10 +187,11 @@ function commentMeta(row: WixBlogCommentRow): string {
|
|
|
187
187
|
|
|
188
188
|
function toCommentRow(row: WixBlogCommentRow): CommentRow {
|
|
189
189
|
// The plain text is the document's own (runs joined as written, not space-separated) when it has one.
|
|
190
|
-
|
|
190
|
+
// `forum.commentCta` is the app's one "Comment": the pack forwards that single key to this screen (see the prefixes).
|
|
191
|
+
const { bodyJson, bodyText } = richBody(row.richContent, row.text || copyParam("forum.commentCta", "Comment"), ROW_IMAGE_WIDTH);
|
|
191
192
|
return {
|
|
192
193
|
id: row.id,
|
|
193
|
-
authorName: row.authorName || "Member",
|
|
194
|
+
authorName: row.authorName || copyParam("blogPost.memberFallback", "Member"),
|
|
194
195
|
text: bodyText,
|
|
195
196
|
meta: commentMeta(row),
|
|
196
197
|
bodyJson,
|
|
@@ -6,7 +6,7 @@ import { comments, BLOG_COMMENTS_APP_ID, blogCommentRow, listBlogComments, type
|
|
|
6
6
|
import { get, type DbEntity } from "@himalaya/local-db";
|
|
7
7
|
import { isSavedId, toggleSavedId } from "../_shared/himi-blog-saved";
|
|
8
8
|
import { hideId, isHiddenId, unhideId } from "../_shared/himi-blog-hidden";
|
|
9
|
-
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
9
|
+
import { stashCopy, copyParam, copyPlural, copyTemplate } from "../_shared/himi-copy.js";
|
|
10
10
|
import { formatDateMedium, formatMonthDay } from "../_shared/engine-intl.js";
|
|
11
11
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
12
12
|
import { richBody, ROW_IMAGE_WIDTH } from "../_shared/rich-body.js";
|
|
@@ -119,8 +119,8 @@ function countsLineOf(post: PostWithExtras): string {
|
|
|
119
119
|
const likes = post.metrics?.likeCount ?? post.metrics?.likes ?? 0;
|
|
120
120
|
const comments = post.metrics?.totalComments ?? post.metrics?.commentCount ?? post.metrics?.comments ?? 0;
|
|
121
121
|
const bits: string[] = [];
|
|
122
|
-
if (likes > 0) bits.push(
|
|
123
|
-
if (comments > 0) bits.push(
|
|
122
|
+
if (likes > 0) bits.push(copyPlural("blogPost.likesCount", "{n, plural, one {# like} other {# likes}}", likes));
|
|
123
|
+
if (comments > 0) bits.push(copyPlural("blogPost.commentsCount", "{n, plural, one {# comment} other {# comments}}", comments));
|
|
124
124
|
return bits.join(" · ");
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -172,7 +172,7 @@ function subtitle(post: WixPost): string {
|
|
|
172
172
|
if (post.firstPublishedDate) {
|
|
173
173
|
bits.push(formatDateMedium(new Date(post.firstPublishedDate)));
|
|
174
174
|
}
|
|
175
|
-
if (post.minutesToRead) bits.push(
|
|
175
|
+
if (post.minutesToRead) bits.push(copyPlural("blogPost.minRead", "{n, plural, one {# min read} other {# min read}}", post.minutesToRead));
|
|
176
176
|
return bits.join(" · ");
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -187,10 +187,11 @@ function commentMeta(row: WixBlogCommentRow): string {
|
|
|
187
187
|
|
|
188
188
|
function toCommentRow(row: WixBlogCommentRow): CommentRow {
|
|
189
189
|
// The plain text is the document's own (runs joined as written, not space-separated) when it has one.
|
|
190
|
-
|
|
190
|
+
// `forum.commentCta` is the app's one "Comment": the pack forwards that single key to this screen (see the prefixes).
|
|
191
|
+
const { bodyJson, bodyText } = richBody(row.richContent, row.text || copyParam("forum.commentCta", "Comment"), ROW_IMAGE_WIDTH);
|
|
191
192
|
return {
|
|
192
193
|
id: row.id,
|
|
193
|
-
authorName: row.authorName || "Member",
|
|
194
|
+
authorName: row.authorName || copyParam("blogPost.memberFallback", "Member"),
|
|
194
195
|
text: bodyText,
|
|
195
196
|
meta: commentMeta(row),
|
|
196
197
|
bodyJson,
|
|
@@ -6,7 +6,7 @@ import { comments, BLOG_COMMENTS_APP_ID, blogCommentRow, listBlogComments, type
|
|
|
6
6
|
import { get, type DbEntity } from "@himalaya/local-db";
|
|
7
7
|
import { isSavedId, toggleSavedId } from "../_shared/himi-blog-saved";
|
|
8
8
|
import { hideId, isHiddenId, unhideId } from "../_shared/himi-blog-hidden";
|
|
9
|
-
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
9
|
+
import { stashCopy, copyParam, copyPlural, copyTemplate } from "../_shared/himi-copy.js";
|
|
10
10
|
import { formatDateMedium, formatMonthDay } from "../_shared/engine-intl.js";
|
|
11
11
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
12
12
|
import { richBody, ROW_IMAGE_WIDTH } from "../_shared/rich-body.js";
|
|
@@ -119,8 +119,8 @@ function countsLineOf(post: PostWithExtras): string {
|
|
|
119
119
|
const likes = post.metrics?.likeCount ?? post.metrics?.likes ?? 0;
|
|
120
120
|
const comments = post.metrics?.totalComments ?? post.metrics?.commentCount ?? post.metrics?.comments ?? 0;
|
|
121
121
|
const bits: string[] = [];
|
|
122
|
-
if (likes > 0) bits.push(
|
|
123
|
-
if (comments > 0) bits.push(
|
|
122
|
+
if (likes > 0) bits.push(copyPlural("blogPost.likesCount", "{n, plural, one {# like} other {# likes}}", likes));
|
|
123
|
+
if (comments > 0) bits.push(copyPlural("blogPost.commentsCount", "{n, plural, one {# comment} other {# comments}}", comments));
|
|
124
124
|
return bits.join(" · ");
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -172,7 +172,7 @@ function subtitle(post: WixPost): string {
|
|
|
172
172
|
if (post.firstPublishedDate) {
|
|
173
173
|
bits.push(formatDateMedium(new Date(post.firstPublishedDate)));
|
|
174
174
|
}
|
|
175
|
-
if (post.minutesToRead) bits.push(
|
|
175
|
+
if (post.minutesToRead) bits.push(copyPlural("blogPost.minRead", "{n, plural, one {# min read} other {# min read}}", post.minutesToRead));
|
|
176
176
|
return bits.join(" · ");
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -187,10 +187,11 @@ function commentMeta(row: WixBlogCommentRow): string {
|
|
|
187
187
|
|
|
188
188
|
function toCommentRow(row: WixBlogCommentRow): CommentRow {
|
|
189
189
|
// The plain text is the document's own (runs joined as written, not space-separated) when it has one.
|
|
190
|
-
|
|
190
|
+
// `forum.commentCta` is the app's one "Comment": the pack forwards that single key to this screen (see the prefixes).
|
|
191
|
+
const { bodyJson, bodyText } = richBody(row.richContent, row.text || copyParam("forum.commentCta", "Comment"), ROW_IMAGE_WIDTH);
|
|
191
192
|
return {
|
|
192
193
|
id: row.id,
|
|
193
|
-
authorName: row.authorName || "Member",
|
|
194
|
+
authorName: row.authorName || copyParam("blogPost.memberFallback", "Member"),
|
|
194
195
|
text: bodyText,
|
|
195
196
|
meta: commentMeta(row),
|
|
196
197
|
bodyJson,
|
|
@@ -6,7 +6,7 @@ import { comments, BLOG_COMMENTS_APP_ID, blogCommentRow, listBlogComments, type
|
|
|
6
6
|
import { get, type DbEntity } from "@himalaya/local-db";
|
|
7
7
|
import { isSavedId, toggleSavedId } from "../_shared/himi-blog-saved";
|
|
8
8
|
import { hideId, isHiddenId, unhideId } from "../_shared/himi-blog-hidden";
|
|
9
|
-
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
9
|
+
import { stashCopy, copyParam, copyPlural, copyTemplate } from "../_shared/himi-copy.js";
|
|
10
10
|
import { formatDateMedium, formatMonthDay } from "../_shared/engine-intl.js";
|
|
11
11
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
12
12
|
import { richBody, ROW_IMAGE_WIDTH } from "../_shared/rich-body.js";
|
|
@@ -119,8 +119,8 @@ function countsLineOf(post: PostWithExtras): string {
|
|
|
119
119
|
const likes = post.metrics?.likeCount ?? post.metrics?.likes ?? 0;
|
|
120
120
|
const comments = post.metrics?.totalComments ?? post.metrics?.commentCount ?? post.metrics?.comments ?? 0;
|
|
121
121
|
const bits: string[] = [];
|
|
122
|
-
if (likes > 0) bits.push(
|
|
123
|
-
if (comments > 0) bits.push(
|
|
122
|
+
if (likes > 0) bits.push(copyPlural("blogPost.likesCount", "{n, plural, one {# like} other {# likes}}", likes));
|
|
123
|
+
if (comments > 0) bits.push(copyPlural("blogPost.commentsCount", "{n, plural, one {# comment} other {# comments}}", comments));
|
|
124
124
|
return bits.join(" · ");
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -172,7 +172,7 @@ function subtitle(post: WixPost): string {
|
|
|
172
172
|
if (post.firstPublishedDate) {
|
|
173
173
|
bits.push(formatDateMedium(new Date(post.firstPublishedDate)));
|
|
174
174
|
}
|
|
175
|
-
if (post.minutesToRead) bits.push(
|
|
175
|
+
if (post.minutesToRead) bits.push(copyPlural("blogPost.minRead", "{n, plural, one {# min read} other {# min read}}", post.minutesToRead));
|
|
176
176
|
return bits.join(" · ");
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -187,10 +187,11 @@ function commentMeta(row: WixBlogCommentRow): string {
|
|
|
187
187
|
|
|
188
188
|
function toCommentRow(row: WixBlogCommentRow): CommentRow {
|
|
189
189
|
// The plain text is the document's own (runs joined as written, not space-separated) when it has one.
|
|
190
|
-
|
|
190
|
+
// `forum.commentCta` is the app's one "Comment": the pack forwards that single key to this screen (see the prefixes).
|
|
191
|
+
const { bodyJson, bodyText } = richBody(row.richContent, row.text || copyParam("forum.commentCta", "Comment"), ROW_IMAGE_WIDTH);
|
|
191
192
|
return {
|
|
192
193
|
id: row.id,
|
|
193
|
-
authorName: row.authorName || "Member",
|
|
194
|
+
authorName: row.authorName || copyParam("blogPost.memberFallback", "Member"),
|
|
194
195
|
text: bodyText,
|
|
195
196
|
meta: commentMeta(row),
|
|
196
197
|
bodyJson,
|
|
@@ -6,7 +6,7 @@ import { comments, BLOG_COMMENTS_APP_ID, blogCommentRow, listBlogComments, type
|
|
|
6
6
|
import { get, type DbEntity } from "@himalaya/local-db";
|
|
7
7
|
import { isSavedId, toggleSavedId } from "../_shared/himi-blog-saved";
|
|
8
8
|
import { hideId, isHiddenId, unhideId } from "../_shared/himi-blog-hidden";
|
|
9
|
-
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
9
|
+
import { stashCopy, copyParam, copyPlural, copyTemplate } from "../_shared/himi-copy.js";
|
|
10
10
|
import { formatDateMedium, formatMonthDay } from "../_shared/engine-intl.js";
|
|
11
11
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
12
12
|
import { richBody, ROW_IMAGE_WIDTH } from "../_shared/rich-body.js";
|
|
@@ -119,8 +119,8 @@ function countsLineOf(post: PostWithExtras): string {
|
|
|
119
119
|
const likes = post.metrics?.likeCount ?? post.metrics?.likes ?? 0;
|
|
120
120
|
const comments = post.metrics?.totalComments ?? post.metrics?.commentCount ?? post.metrics?.comments ?? 0;
|
|
121
121
|
const bits: string[] = [];
|
|
122
|
-
if (likes > 0) bits.push(
|
|
123
|
-
if (comments > 0) bits.push(
|
|
122
|
+
if (likes > 0) bits.push(copyPlural("blogPost.likesCount", "{n, plural, one {# like} other {# likes}}", likes));
|
|
123
|
+
if (comments > 0) bits.push(copyPlural("blogPost.commentsCount", "{n, plural, one {# comment} other {# comments}}", comments));
|
|
124
124
|
return bits.join(" · ");
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -172,7 +172,7 @@ function subtitle(post: WixPost): string {
|
|
|
172
172
|
if (post.firstPublishedDate) {
|
|
173
173
|
bits.push(formatDateMedium(new Date(post.firstPublishedDate)));
|
|
174
174
|
}
|
|
175
|
-
if (post.minutesToRead) bits.push(
|
|
175
|
+
if (post.minutesToRead) bits.push(copyPlural("blogPost.minRead", "{n, plural, one {# min read} other {# min read}}", post.minutesToRead));
|
|
176
176
|
return bits.join(" · ");
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -187,10 +187,11 @@ function commentMeta(row: WixBlogCommentRow): string {
|
|
|
187
187
|
|
|
188
188
|
function toCommentRow(row: WixBlogCommentRow): CommentRow {
|
|
189
189
|
// The plain text is the document's own (runs joined as written, not space-separated) when it has one.
|
|
190
|
-
|
|
190
|
+
// `forum.commentCta` is the app's one "Comment": the pack forwards that single key to this screen (see the prefixes).
|
|
191
|
+
const { bodyJson, bodyText } = richBody(row.richContent, row.text || copyParam("forum.commentCta", "Comment"), ROW_IMAGE_WIDTH);
|
|
191
192
|
return {
|
|
192
193
|
id: row.id,
|
|
193
|
-
authorName: row.authorName || "Member",
|
|
194
|
+
authorName: row.authorName || copyParam("blogPost.memberFallback", "Member"),
|
|
194
195
|
text: bodyText,
|
|
195
196
|
meta: commentMeta(row),
|
|
196
197
|
bodyJson,
|
|
@@ -6,7 +6,7 @@ import { comments, BLOG_COMMENTS_APP_ID, blogCommentRow, listBlogComments, type
|
|
|
6
6
|
import { get, type DbEntity } from "@himalaya/local-db";
|
|
7
7
|
import { isSavedId, toggleSavedId } from "../_shared/himi-blog-saved";
|
|
8
8
|
import { hideId, isHiddenId, unhideId } from "../_shared/himi-blog-hidden";
|
|
9
|
-
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
9
|
+
import { stashCopy, copyParam, copyPlural, copyTemplate } from "../_shared/himi-copy.js";
|
|
10
10
|
import { formatDateMedium, formatMonthDay } from "../_shared/engine-intl.js";
|
|
11
11
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
12
12
|
import { richBody, ROW_IMAGE_WIDTH } from "../_shared/rich-body.js";
|
|
@@ -119,8 +119,8 @@ function countsLineOf(post: PostWithExtras): string {
|
|
|
119
119
|
const likes = post.metrics?.likeCount ?? post.metrics?.likes ?? 0;
|
|
120
120
|
const comments = post.metrics?.totalComments ?? post.metrics?.commentCount ?? post.metrics?.comments ?? 0;
|
|
121
121
|
const bits: string[] = [];
|
|
122
|
-
if (likes > 0) bits.push(
|
|
123
|
-
if (comments > 0) bits.push(
|
|
122
|
+
if (likes > 0) bits.push(copyPlural("blogPost.likesCount", "{n, plural, one {# like} other {# likes}}", likes));
|
|
123
|
+
if (comments > 0) bits.push(copyPlural("blogPost.commentsCount", "{n, plural, one {# comment} other {# comments}}", comments));
|
|
124
124
|
return bits.join(" · ");
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -172,7 +172,7 @@ function subtitle(post: WixPost): string {
|
|
|
172
172
|
if (post.firstPublishedDate) {
|
|
173
173
|
bits.push(formatDateMedium(new Date(post.firstPublishedDate)));
|
|
174
174
|
}
|
|
175
|
-
if (post.minutesToRead) bits.push(
|
|
175
|
+
if (post.minutesToRead) bits.push(copyPlural("blogPost.minRead", "{n, plural, one {# min read} other {# min read}}", post.minutesToRead));
|
|
176
176
|
return bits.join(" · ");
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -187,10 +187,11 @@ function commentMeta(row: WixBlogCommentRow): string {
|
|
|
187
187
|
|
|
188
188
|
function toCommentRow(row: WixBlogCommentRow): CommentRow {
|
|
189
189
|
// The plain text is the document's own (runs joined as written, not space-separated) when it has one.
|
|
190
|
-
|
|
190
|
+
// `forum.commentCta` is the app's one "Comment": the pack forwards that single key to this screen (see the prefixes).
|
|
191
|
+
const { bodyJson, bodyText } = richBody(row.richContent, row.text || copyParam("forum.commentCta", "Comment"), ROW_IMAGE_WIDTH);
|
|
191
192
|
return {
|
|
192
193
|
id: row.id,
|
|
193
|
-
authorName: row.authorName || "Member",
|
|
194
|
+
authorName: row.authorName || copyParam("blogPost.memberFallback", "Member"),
|
|
194
195
|
text: bodyText,
|
|
195
196
|
meta: commentMeta(row),
|
|
196
197
|
bodyJson,
|
|
@@ -6,7 +6,7 @@ import { comments, BLOG_COMMENTS_APP_ID, blogCommentRow, listBlogComments, type
|
|
|
6
6
|
import { get, type DbEntity } from "@himalaya/local-db";
|
|
7
7
|
import { isSavedId, toggleSavedId } from "../_shared/himi-blog-saved";
|
|
8
8
|
import { hideId, isHiddenId, unhideId } from "../_shared/himi-blog-hidden";
|
|
9
|
-
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
9
|
+
import { stashCopy, copyParam, copyPlural, copyTemplate } from "../_shared/himi-copy.js";
|
|
10
10
|
import { formatDateMedium, formatMonthDay } from "../_shared/engine-intl.js";
|
|
11
11
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
12
12
|
import { richBody, ROW_IMAGE_WIDTH } from "../_shared/rich-body.js";
|
|
@@ -119,8 +119,8 @@ function countsLineOf(post: PostWithExtras): string {
|
|
|
119
119
|
const likes = post.metrics?.likeCount ?? post.metrics?.likes ?? 0;
|
|
120
120
|
const comments = post.metrics?.totalComments ?? post.metrics?.commentCount ?? post.metrics?.comments ?? 0;
|
|
121
121
|
const bits: string[] = [];
|
|
122
|
-
if (likes > 0) bits.push(
|
|
123
|
-
if (comments > 0) bits.push(
|
|
122
|
+
if (likes > 0) bits.push(copyPlural("blogPost.likesCount", "{n, plural, one {# like} other {# likes}}", likes));
|
|
123
|
+
if (comments > 0) bits.push(copyPlural("blogPost.commentsCount", "{n, plural, one {# comment} other {# comments}}", comments));
|
|
124
124
|
return bits.join(" · ");
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -172,7 +172,7 @@ function subtitle(post: WixPost): string {
|
|
|
172
172
|
if (post.firstPublishedDate) {
|
|
173
173
|
bits.push(formatDateMedium(new Date(post.firstPublishedDate)));
|
|
174
174
|
}
|
|
175
|
-
if (post.minutesToRead) bits.push(
|
|
175
|
+
if (post.minutesToRead) bits.push(copyPlural("blogPost.minRead", "{n, plural, one {# min read} other {# min read}}", post.minutesToRead));
|
|
176
176
|
return bits.join(" · ");
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -187,10 +187,11 @@ function commentMeta(row: WixBlogCommentRow): string {
|
|
|
187
187
|
|
|
188
188
|
function toCommentRow(row: WixBlogCommentRow): CommentRow {
|
|
189
189
|
// The plain text is the document's own (runs joined as written, not space-separated) when it has one.
|
|
190
|
-
|
|
190
|
+
// `forum.commentCta` is the app's one "Comment": the pack forwards that single key to this screen (see the prefixes).
|
|
191
|
+
const { bodyJson, bodyText } = richBody(row.richContent, row.text || copyParam("forum.commentCta", "Comment"), ROW_IMAGE_WIDTH);
|
|
191
192
|
return {
|
|
192
193
|
id: row.id,
|
|
193
|
-
authorName: row.authorName || "Member",
|
|
194
|
+
authorName: row.authorName || copyParam("blogPost.memberFallback", "Member"),
|
|
194
195
|
text: bodyText,
|
|
195
196
|
meta: commentMeta(row),
|
|
196
197
|
bodyJson,
|
|
@@ -6,7 +6,7 @@ import { comments, BLOG_COMMENTS_APP_ID, blogCommentRow, listBlogComments, type
|
|
|
6
6
|
import { get, type DbEntity } from "@himalaya/local-db";
|
|
7
7
|
import { isSavedId, toggleSavedId } from "../_shared/himi-blog-saved";
|
|
8
8
|
import { hideId, isHiddenId, unhideId } from "../_shared/himi-blog-hidden";
|
|
9
|
-
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
9
|
+
import { stashCopy, copyParam, copyPlural, copyTemplate } from "../_shared/himi-copy.js";
|
|
10
10
|
import { formatDateMedium, formatMonthDay } from "../_shared/engine-intl.js";
|
|
11
11
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
12
12
|
import { richBody, ROW_IMAGE_WIDTH } from "../_shared/rich-body.js";
|
|
@@ -119,8 +119,8 @@ function countsLineOf(post: PostWithExtras): string {
|
|
|
119
119
|
const likes = post.metrics?.likeCount ?? post.metrics?.likes ?? 0;
|
|
120
120
|
const comments = post.metrics?.totalComments ?? post.metrics?.commentCount ?? post.metrics?.comments ?? 0;
|
|
121
121
|
const bits: string[] = [];
|
|
122
|
-
if (likes > 0) bits.push(
|
|
123
|
-
if (comments > 0) bits.push(
|
|
122
|
+
if (likes > 0) bits.push(copyPlural("blogPost.likesCount", "{n, plural, one {# like} other {# likes}}", likes));
|
|
123
|
+
if (comments > 0) bits.push(copyPlural("blogPost.commentsCount", "{n, plural, one {# comment} other {# comments}}", comments));
|
|
124
124
|
return bits.join(" · ");
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -172,7 +172,7 @@ function subtitle(post: WixPost): string {
|
|
|
172
172
|
if (post.firstPublishedDate) {
|
|
173
173
|
bits.push(formatDateMedium(new Date(post.firstPublishedDate)));
|
|
174
174
|
}
|
|
175
|
-
if (post.minutesToRead) bits.push(
|
|
175
|
+
if (post.minutesToRead) bits.push(copyPlural("blogPost.minRead", "{n, plural, one {# min read} other {# min read}}", post.minutesToRead));
|
|
176
176
|
return bits.join(" · ");
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -187,10 +187,11 @@ function commentMeta(row: WixBlogCommentRow): string {
|
|
|
187
187
|
|
|
188
188
|
function toCommentRow(row: WixBlogCommentRow): CommentRow {
|
|
189
189
|
// The plain text is the document's own (runs joined as written, not space-separated) when it has one.
|
|
190
|
-
|
|
190
|
+
// `forum.commentCta` is the app's one "Comment": the pack forwards that single key to this screen (see the prefixes).
|
|
191
|
+
const { bodyJson, bodyText } = richBody(row.richContent, row.text || copyParam("forum.commentCta", "Comment"), ROW_IMAGE_WIDTH);
|
|
191
192
|
return {
|
|
192
193
|
id: row.id,
|
|
193
|
-
authorName: row.authorName || "Member",
|
|
194
|
+
authorName: row.authorName || copyParam("blogPost.memberFallback", "Member"),
|
|
194
195
|
text: bodyText,
|
|
195
196
|
meta: commentMeta(row),
|
|
196
197
|
bodyJson,
|
|
@@ -6,7 +6,7 @@ import { comments, BLOG_COMMENTS_APP_ID, blogCommentRow, listBlogComments, type
|
|
|
6
6
|
import { get, type DbEntity } from "@himalaya/local-db";
|
|
7
7
|
import { isSavedId, toggleSavedId } from "../_shared/himi-blog-saved";
|
|
8
8
|
import { hideId, isHiddenId, unhideId } from "../_shared/himi-blog-hidden";
|
|
9
|
-
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
9
|
+
import { stashCopy, copyParam, copyPlural, copyTemplate } from "../_shared/himi-copy.js";
|
|
10
10
|
import { formatDateMedium, formatMonthDay } from "../_shared/engine-intl.js";
|
|
11
11
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
12
12
|
import { richBody, ROW_IMAGE_WIDTH } from "../_shared/rich-body.js";
|
|
@@ -119,8 +119,8 @@ function countsLineOf(post: PostWithExtras): string {
|
|
|
119
119
|
const likes = post.metrics?.likeCount ?? post.metrics?.likes ?? 0;
|
|
120
120
|
const comments = post.metrics?.totalComments ?? post.metrics?.commentCount ?? post.metrics?.comments ?? 0;
|
|
121
121
|
const bits: string[] = [];
|
|
122
|
-
if (likes > 0) bits.push(
|
|
123
|
-
if (comments > 0) bits.push(
|
|
122
|
+
if (likes > 0) bits.push(copyPlural("blogPost.likesCount", "{n, plural, one {# like} other {# likes}}", likes));
|
|
123
|
+
if (comments > 0) bits.push(copyPlural("blogPost.commentsCount", "{n, plural, one {# comment} other {# comments}}", comments));
|
|
124
124
|
return bits.join(" · ");
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -172,7 +172,7 @@ function subtitle(post: WixPost): string {
|
|
|
172
172
|
if (post.firstPublishedDate) {
|
|
173
173
|
bits.push(formatDateMedium(new Date(post.firstPublishedDate)));
|
|
174
174
|
}
|
|
175
|
-
if (post.minutesToRead) bits.push(
|
|
175
|
+
if (post.minutesToRead) bits.push(copyPlural("blogPost.minRead", "{n, plural, one {# min read} other {# min read}}", post.minutesToRead));
|
|
176
176
|
return bits.join(" · ");
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -187,10 +187,11 @@ function commentMeta(row: WixBlogCommentRow): string {
|
|
|
187
187
|
|
|
188
188
|
function toCommentRow(row: WixBlogCommentRow): CommentRow {
|
|
189
189
|
// The plain text is the document's own (runs joined as written, not space-separated) when it has one.
|
|
190
|
-
|
|
190
|
+
// `forum.commentCta` is the app's one "Comment": the pack forwards that single key to this screen (see the prefixes).
|
|
191
|
+
const { bodyJson, bodyText } = richBody(row.richContent, row.text || copyParam("forum.commentCta", "Comment"), ROW_IMAGE_WIDTH);
|
|
191
192
|
return {
|
|
192
193
|
id: row.id,
|
|
193
|
-
authorName: row.authorName || "Member",
|
|
194
|
+
authorName: row.authorName || copyParam("blogPost.memberFallback", "Member"),
|
|
194
195
|
text: bodyText,
|
|
195
196
|
meta: commentMeta(row),
|
|
196
197
|
bodyJson,
|