@wix/himalaya-cli 0.1099.0 → 0.1101.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.
Files changed (55) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/comments-v1/src/extensions.d.ts +13 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk-auto/_shared/runtime.generated.d.ts +27 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk-auto/_shared/types.generated.d.ts +829 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk-auto/comments/categories.generated.d.ts +113 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk-auto/comments/commentContexts.generated.d.ts +43 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk-auto/comments/comments.generated.d.ts +553 -0
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk-auto/comments/contentRevisions.generated.d.ts +100 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk-auto/comments/index.generated.d.ts +7 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk-auto/comments/ratings.generated.d.ts +72 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk-auto/comments/widgets.generated.d.ts +138 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-comments.mjs +280 -7
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/package.json +1 -1
  13. package/dist/cli.mjs +16 -1
  14. package/guides/release-notes.md +9 -0
  15. package/guides/sdk-reference.json +291 -1
  16. package/guides/wix-api-usage.md +34 -1
  17. package/package.json +2 -2
  18. package/templates/beauty-salon/dev/index.ts +394 -514
  19. package/templates/beauty-salon/tier5-src/_shared/collection-contract.ts +8 -1
  20. package/templates/beauty-salon/tier5-src/himi-blog-post/index.ts +14 -4
  21. package/templates/beauty-salon-owner/tier5-src/_shared/collection-contract.ts +8 -1
  22. package/templates/branded-lite/dev/index.ts +394 -514
  23. package/templates/branded-lite/tier5-src/_shared/collection-contract.ts +8 -1
  24. package/templates/branded-lite/tier5-src/himi-blog-post/index.ts +14 -4
  25. package/templates/community-club/tier5-src/_shared/collection-contract.ts +8 -1
  26. package/templates/community-club/tier5-src/himi-blog-post/index.ts +14 -4
  27. package/templates/community-club-owner/tier5-src/_shared/collection-contract.ts +8 -1
  28. package/templates/events-meetups/tier5-src/_shared/collection-contract.ts +8 -1
  29. package/templates/events-meetups/tier5-src/himi-blog-post/index.ts +14 -4
  30. package/templates/events-meetups-owner/tier5-src/_shared/collection-contract.ts +8 -1
  31. package/templates/gym-fitness/dev/index.ts +394 -514
  32. package/templates/gym-fitness/tier5-src/_shared/collection-contract.ts +8 -1
  33. package/templates/gym-fitness/tier5-src/himi-blog-post/index.ts +14 -4
  34. package/templates/gym-fitness-owner/tier5-src/_shared/collection-contract.ts +8 -1
  35. package/templates/nonprofit-cause/tier5-src/_shared/collection-contract.ts +8 -1
  36. package/templates/nonprofit-cause/tier5-src/himi-blog-post/index.ts +14 -4
  37. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-contract.ts +8 -1
  38. package/templates/owner-lite/tier5-src/_shared/collection-contract.ts +8 -1
  39. package/templates/podcast-creator/tier5-src/_shared/collection-contract.ts +8 -1
  40. package/templates/podcast-creator/tier5-src/himi-blog-post/index.ts +14 -4
  41. package/templates/podcast-creator-owner/tier5-src/_shared/collection-contract.ts +8 -1
  42. package/templates/portfolio-creative/dev/index.ts +396 -516
  43. package/templates/portfolio-creative/tier5-src/_shared/collection-contract.ts +8 -1
  44. package/templates/portfolio-creative/tier5-src/himi-blog-post/index.ts +14 -4
  45. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-contract.ts +8 -1
  46. package/templates/restaurant/tier5-src/_shared/collection-contract.ts +8 -1
  47. package/templates/restaurant/tier5-src/himi-blog-post/index.ts +14 -4
  48. package/templates/restaurant-owner/tier5-src/_shared/collection-contract.ts +8 -1
  49. package/templates/retail-store/dev/index.ts +396 -516
  50. package/templates/retail-store/tier5-src/_shared/collection-contract.ts +8 -1
  51. package/templates/retail-store/tier5-src/himi-blog-post/index.ts +14 -4
  52. package/templates/retail-store-owner/tier5-src/_shared/collection-contract.ts +8 -1
  53. package/templates/yoga-studio/tier5-src/_shared/collection-contract.ts +8 -1
  54. package/templates/yoga-studio/tier5-src/himi-blog-post/index.ts +14 -4
  55. package/templates/yoga-studio-owner/tier5-src/_shared/collection-contract.ts +8 -1
@@ -37,6 +37,13 @@ export interface CollectionConfig {
37
37
  * `screenId` opens that screen with the row id; without it the verb reuses the
38
38
  * row's own tap action (the detail screen that owns the verb). */
39
39
  primaryVerb?: { label: string; screenId?: string };
40
+ /** A catalog card whose one expected per-item action is "favorite".
41
+ * The ellipsis overflow is replaced by an always-visible heart toggle wired to
42
+ * the same `collectionSave` reducer. A dropdown `Menu` anchored inside a
43
+ * list/grid row renders clipped inside the row's own bounds, so on a product
44
+ * card the overflow's items were unreachable AND the wrong pattern: shoppers
45
+ * expect a heart, not a 3-item menu two taps deep. */
46
+ favoriteToggle?: boolean;
40
47
  /** A state field the DOMAIN narrows `rows` by (e.g. a category picker). While it is set,
41
48
  * zero rows is a filtered result, not an empty source. */
42
49
  narrowedBy?: string;
@@ -45,7 +52,7 @@ export interface CollectionConfig {
45
52
  * page, the list/grid toggle, Refine, chips, search and count are noise. */
46
53
  export const COLLECTION_CHROME_MIN_ITEMS = 4;
47
54
  export const COLLECTIONS: Record<string, CollectionConfig> = {
48
- himiStoreShop: { rows: 'results', title: 'name', subtitle: 'subtitle', image: 'image', view: 'grid', backendQuery: true, countNoun: ['product', 'products'] },
55
+ himiStoreShop: { rows: 'results', title: 'name', subtitle: 'subtitle', image: 'image', view: 'grid', backendQuery: true, countNoun: ['product', 'products'], favoriteToggle: true },
49
56
  himiBookingServices: { rows: 'results', title: 'name', subtitle: 'subtitle', image: 'image', filter: 'category', view: 'grid', backendQuery: true, searchPlaceholder: 'Search services', countNoun: ['service', 'services'], primaryVerb: { label: 'Book', screenId: 'himi_time' } },
50
57
  himiBookingBookings: { rows: 'rows', title: 'title', subtitle: 'subtitle', metadata: ['status'], view: 'list', backendQuery: true,
51
58
  defaultFilter: 'value:Upcoming', searchPlaceholder: 'Search by booking ID', countNoun: ['booking', 'bookings'], filterValues: ['Upcoming', 'Past', 'Cancelled'],
@@ -2,7 +2,7 @@
2
2
  import { defineService } from "@himalaya/state";
3
3
  import { share as shareSheet } from "@himalaya/share";
4
4
  import { getPost, likePost, unlikePost, type WixPost } from "@himalaya/wix-blog";
5
- import { createBlogComment, listBlogComments, type WixBlogCommentRow } from "@himalaya/wix-comments";
5
+ import { comments, BLOG_COMMENTS_APP_ID, blogCommentRow, listBlogComments, type WixBlogCommentRow } from "@himalaya/wix-comments";
6
6
  import { wixMediaUrl, WIX_DETAIL_IMAGE } from "@himalaya/wix-media";
7
7
  import { get, type DbEntity } from "@himalaya/local-db";
8
8
  import { isSavedId, toggleSavedId } from "../_shared/himi-blog-saved";
@@ -240,6 +240,12 @@ function toCommentRow(row: WixBlogCommentRow): CommentRow {
240
240
  };
241
241
  }
242
242
 
243
+ /** The comment text as Ricos rich content, typed against the auto tier's REST types. */
244
+ const commentRichContent = (text: string): comments.RichContent => ({
245
+ nodes: [{ type: "PARAGRAPH", id: "himi-blog-comment", nodes: [{ type: "TEXT", id: "himi-blog-comment-text", textData: { text } }] }],
246
+ metadata: { version: 1 },
247
+ });
248
+
243
249
  function derive(s: S): S {
244
250
  const isLoading = s.status === "loading";
245
251
  const errored = s.status === "error";
@@ -423,12 +429,16 @@ const svc = defineService<S, {
423
429
  const text = s.commentDraft.trim();
424
430
  if (!text) return derive({ ...s, actionMessage: copyParam("blogPost.commentValidation", "Write a comment first.") });
425
431
  try {
426
- const created = await createBlogComment(s.id, text);
427
- const comments = [toCommentRow(created), ...s.comments];
432
+ const { comment } = await comments.createComment({
433
+ comment: { appId: BLOG_COMMENTS_APP_ID, contextId: s.id, resourceId: s.id, content: { richContent: commentRichContent(text) } },
434
+ });
435
+ const created = blogCommentRow(comment);
436
+ // Named to avoid shadowing the `comments` namespace import in this same block scope.
437
+ const updatedComments = [toCommentRow(created), ...s.comments];
428
438
  return derive({
429
439
  ...s,
430
440
  commentDraft: "",
431
- comments,
441
+ comments: updatedComments,
432
442
  commentsUnavailable: false,
433
443
  commentStatusText: "",
434
444
  actionMessage: copyParam("blogPost.commentPosted", "Comment posted"),
@@ -37,6 +37,13 @@ export interface CollectionConfig {
37
37
  * `screenId` opens that screen with the row id; without it the verb reuses the
38
38
  * row's own tap action (the detail screen that owns the verb). */
39
39
  primaryVerb?: { label: string; screenId?: string };
40
+ /** A catalog card whose one expected per-item action is "favorite".
41
+ * The ellipsis overflow is replaced by an always-visible heart toggle wired to
42
+ * the same `collectionSave` reducer. A dropdown `Menu` anchored inside a
43
+ * list/grid row renders clipped inside the row's own bounds, so on a product
44
+ * card the overflow's items were unreachable AND the wrong pattern: shoppers
45
+ * expect a heart, not a 3-item menu two taps deep. */
46
+ favoriteToggle?: boolean;
40
47
  /** A state field the DOMAIN narrows `rows` by (e.g. a category picker). While it is set,
41
48
  * zero rows is a filtered result, not an empty source. */
42
49
  narrowedBy?: string;
@@ -45,7 +52,7 @@ export interface CollectionConfig {
45
52
  * page, the list/grid toggle, Refine, chips, search and count are noise. */
46
53
  export const COLLECTION_CHROME_MIN_ITEMS = 4;
47
54
  export const COLLECTIONS: Record<string, CollectionConfig> = {
48
- himiStoreShop: { rows: 'results', title: 'name', subtitle: 'subtitle', image: 'image', view: 'grid', backendQuery: true, countNoun: ['product', 'products'] },
55
+ himiStoreShop: { rows: 'results', title: 'name', subtitle: 'subtitle', image: 'image', view: 'grid', backendQuery: true, countNoun: ['product', 'products'], favoriteToggle: true },
49
56
  himiBookingServices: { rows: 'results', title: 'name', subtitle: 'subtitle', image: 'image', filter: 'category', view: 'grid', backendQuery: true, searchPlaceholder: 'Search services', countNoun: ['service', 'services'], primaryVerb: { label: 'Book', screenId: 'himi_time' } },
50
57
  himiBookingBookings: { rows: 'rows', title: 'title', subtitle: 'subtitle', metadata: ['status'], view: 'list', backendQuery: true,
51
58
  defaultFilter: 'value:Upcoming', searchPlaceholder: 'Search by booking ID', countNoun: ['booking', 'bookings'], filterValues: ['Upcoming', 'Past', 'Cancelled'],
@@ -37,6 +37,13 @@ export interface CollectionConfig {
37
37
  * `screenId` opens that screen with the row id; without it the verb reuses the
38
38
  * row's own tap action (the detail screen that owns the verb). */
39
39
  primaryVerb?: { label: string; screenId?: string };
40
+ /** A catalog card whose one expected per-item action is "favorite".
41
+ * The ellipsis overflow is replaced by an always-visible heart toggle wired to
42
+ * the same `collectionSave` reducer. A dropdown `Menu` anchored inside a
43
+ * list/grid row renders clipped inside the row's own bounds, so on a product
44
+ * card the overflow's items were unreachable AND the wrong pattern: shoppers
45
+ * expect a heart, not a 3-item menu two taps deep. */
46
+ favoriteToggle?: boolean;
40
47
  /** A state field the DOMAIN narrows `rows` by (e.g. a category picker). While it is set,
41
48
  * zero rows is a filtered result, not an empty source. */
42
49
  narrowedBy?: string;
@@ -45,7 +52,7 @@ export interface CollectionConfig {
45
52
  * page, the list/grid toggle, Refine, chips, search and count are noise. */
46
53
  export const COLLECTION_CHROME_MIN_ITEMS = 4;
47
54
  export const COLLECTIONS: Record<string, CollectionConfig> = {
48
- himiStoreShop: { rows: 'results', title: 'name', subtitle: 'subtitle', image: 'image', view: 'grid', backendQuery: true, countNoun: ['product', 'products'] },
55
+ himiStoreShop: { rows: 'results', title: 'name', subtitle: 'subtitle', image: 'image', view: 'grid', backendQuery: true, countNoun: ['product', 'products'], favoriteToggle: true },
49
56
  himiBookingServices: { rows: 'results', title: 'name', subtitle: 'subtitle', image: 'image', filter: 'category', view: 'grid', backendQuery: true, searchPlaceholder: 'Search services', countNoun: ['service', 'services'], primaryVerb: { label: 'Book', screenId: 'himi_time' } },
50
57
  himiBookingBookings: { rows: 'rows', title: 'title', subtitle: 'subtitle', metadata: ['status'], view: 'list', backendQuery: true,
51
58
  defaultFilter: 'value:Upcoming', searchPlaceholder: 'Search by booking ID', countNoun: ['booking', 'bookings'], filterValues: ['Upcoming', 'Past', 'Cancelled'],
@@ -2,7 +2,7 @@
2
2
  import { defineService } from "@himalaya/state";
3
3
  import { share as shareSheet } from "@himalaya/share";
4
4
  import { getPost, likePost, unlikePost, type WixPost } from "@himalaya/wix-blog";
5
- import { createBlogComment, listBlogComments, type WixBlogCommentRow } from "@himalaya/wix-comments";
5
+ import { comments, BLOG_COMMENTS_APP_ID, blogCommentRow, listBlogComments, type WixBlogCommentRow } from "@himalaya/wix-comments";
6
6
  import { wixMediaUrl, WIX_DETAIL_IMAGE } from "@himalaya/wix-media";
7
7
  import { get, type DbEntity } from "@himalaya/local-db";
8
8
  import { isSavedId, toggleSavedId } from "../_shared/himi-blog-saved";
@@ -240,6 +240,12 @@ function toCommentRow(row: WixBlogCommentRow): CommentRow {
240
240
  };
241
241
  }
242
242
 
243
+ /** The comment text as Ricos rich content, typed against the auto tier's REST types. */
244
+ const commentRichContent = (text: string): comments.RichContent => ({
245
+ nodes: [{ type: "PARAGRAPH", id: "himi-blog-comment", nodes: [{ type: "TEXT", id: "himi-blog-comment-text", textData: { text } }] }],
246
+ metadata: { version: 1 },
247
+ });
248
+
243
249
  function derive(s: S): S {
244
250
  const isLoading = s.status === "loading";
245
251
  const errored = s.status === "error";
@@ -423,12 +429,16 @@ const svc = defineService<S, {
423
429
  const text = s.commentDraft.trim();
424
430
  if (!text) return derive({ ...s, actionMessage: copyParam("blogPost.commentValidation", "Write a comment first.") });
425
431
  try {
426
- const created = await createBlogComment(s.id, text);
427
- const comments = [toCommentRow(created), ...s.comments];
432
+ const { comment } = await comments.createComment({
433
+ comment: { appId: BLOG_COMMENTS_APP_ID, contextId: s.id, resourceId: s.id, content: { richContent: commentRichContent(text) } },
434
+ });
435
+ const created = blogCommentRow(comment);
436
+ // Named to avoid shadowing the `comments` namespace import in this same block scope.
437
+ const updatedComments = [toCommentRow(created), ...s.comments];
428
438
  return derive({
429
439
  ...s,
430
440
  commentDraft: "",
431
- comments,
441
+ comments: updatedComments,
432
442
  commentsUnavailable: false,
433
443
  commentStatusText: "",
434
444
  actionMessage: copyParam("blogPost.commentPosted", "Comment posted"),
@@ -37,6 +37,13 @@ export interface CollectionConfig {
37
37
  * `screenId` opens that screen with the row id; without it the verb reuses the
38
38
  * row's own tap action (the detail screen that owns the verb). */
39
39
  primaryVerb?: { label: string; screenId?: string };
40
+ /** A catalog card whose one expected per-item action is "favorite".
41
+ * The ellipsis overflow is replaced by an always-visible heart toggle wired to
42
+ * the same `collectionSave` reducer. A dropdown `Menu` anchored inside a
43
+ * list/grid row renders clipped inside the row's own bounds, so on a product
44
+ * card the overflow's items were unreachable AND the wrong pattern: shoppers
45
+ * expect a heart, not a 3-item menu two taps deep. */
46
+ favoriteToggle?: boolean;
40
47
  /** A state field the DOMAIN narrows `rows` by (e.g. a category picker). While it is set,
41
48
  * zero rows is a filtered result, not an empty source. */
42
49
  narrowedBy?: string;
@@ -45,7 +52,7 @@ export interface CollectionConfig {
45
52
  * page, the list/grid toggle, Refine, chips, search and count are noise. */
46
53
  export const COLLECTION_CHROME_MIN_ITEMS = 4;
47
54
  export const COLLECTIONS: Record<string, CollectionConfig> = {
48
- himiStoreShop: { rows: 'results', title: 'name', subtitle: 'subtitle', image: 'image', view: 'grid', backendQuery: true, countNoun: ['product', 'products'] },
55
+ himiStoreShop: { rows: 'results', title: 'name', subtitle: 'subtitle', image: 'image', view: 'grid', backendQuery: true, countNoun: ['product', 'products'], favoriteToggle: true },
49
56
  himiBookingServices: { rows: 'results', title: 'name', subtitle: 'subtitle', image: 'image', filter: 'category', view: 'grid', backendQuery: true, searchPlaceholder: 'Search services', countNoun: ['service', 'services'], primaryVerb: { label: 'Book', screenId: 'himi_time' } },
50
57
  himiBookingBookings: { rows: 'rows', title: 'title', subtitle: 'subtitle', metadata: ['status'], view: 'list', backendQuery: true,
51
58
  defaultFilter: 'value:Upcoming', searchPlaceholder: 'Search by booking ID', countNoun: ['booking', 'bookings'], filterValues: ['Upcoming', 'Past', 'Cancelled'],