@wix/himalaya-cli 0.1601.0 → 0.1603.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 +5493 -2188
- package/guides/wix-login-integration.md +2 -0
- 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
|
@@ -68,6 +68,8 @@ node --import tsx tools/auth-bake/bake-auth.ts apps/<app> --ios apps/<app>/ios/<
|
|
|
68
68
|
`auth.json` = `{ providerId, required, gateScreenId?, config }`. Read by `TemplateAppBoot.loadBakedAuth()` (iOS
|
|
69
69
|
and macOS) / `TemplateAuth.boot()` (Android).
|
|
70
70
|
|
|
71
|
+
A binary baked `providerId: "none"` (a `himi dist` build of a release declaring no auth) stays no-auth until it is rebuilt, whatever later releases serve: adding login to a no-auth app needs a new binary.
|
|
72
|
+
|
|
71
73
|
## Step 3 — wire the gate (per platform)
|
|
72
74
|
|
|
73
75
|
### iOS
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1603.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": "3b93e9df5b17cf56b074bfe86e5cb5221719e281d1b61b77363bb6df"
|
|
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,
|