@wix/ditto-codegen-public 1.0.136 → 1.0.138

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 (58) hide show
  1. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/ProductChat.tsx +26 -20
  2. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/page.tsx +12 -11
  3. package/dist/out.js +213 -172
  4. package/package.json +2 -2
  5. package/dist/examples-apps/ai-chatbot/src/backend/api/chat/api.ts +0 -62
  6. package/dist/examples-apps/ai-chatbot/src/backend/api/settings/api.ts +0 -39
  7. package/dist/examples-apps/ai-chatbot/src/backend/database.ts +0 -86
  8. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/page.json +0 -6
  9. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/settings/page.json +0 -6
  10. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/settings/page.tsx +0 -105
  11. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/wix_logo.svg +0 -18
  12. package/dist/examples-apps/ai-chatbot/src/dashboard/utils.ts +0 -27
  13. package/dist/examples-apps/custom-products-catalog/.nvmrc +0 -1
  14. package/dist/examples-apps/custom-products-catalog/README.md +0 -21
  15. package/dist/examples-apps/custom-products-catalog/package-lock.json +0 -8694
  16. package/dist/examples-apps/custom-products-catalog/package.json +0 -33
  17. package/dist/examples-apps/custom-products-catalog/src/dashboard/components/create-product.tsx +0 -54
  18. package/dist/examples-apps/custom-products-catalog/src/dashboard/hooks/stores.ts +0 -60
  19. package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/page.json +0 -5
  20. package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/page.tsx +0 -297
  21. package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/wix_logo.svg +0 -18
  22. package/dist/examples-apps/custom-products-catalog/src/dashboard/withProviders.tsx +0 -16
  23. package/dist/examples-apps/custom-products-catalog/src/env.d.ts +0 -4
  24. package/dist/examples-apps/custom-products-catalog/tsconfig.json +0 -8
  25. package/dist/examples-apps/custom-products-catalog/wix.config.json +0 -5
  26. package/dist/examples-apps/site-popup/.nvmrc +0 -1
  27. package/dist/examples-apps/site-popup/README.md +0 -21
  28. package/dist/examples-apps/site-popup/package.json +0 -51
  29. package/dist/examples-apps/site-popup/src/components/activation-configuration.tsx +0 -49
  30. package/dist/examples-apps/site-popup/src/components/close-button.css +0 -33
  31. package/dist/examples-apps/site-popup/src/components/close-button.tsx +0 -31
  32. package/dist/examples-apps/site-popup/src/components/date-range-picker.tsx +0 -49
  33. package/dist/examples-apps/site-popup/src/components/image-picker.tsx +0 -33
  34. package/dist/examples-apps/site-popup/src/components/popup/index.css +0 -133
  35. package/dist/examples-apps/site-popup/src/components/popup/index.tsx +0 -71
  36. package/dist/examples-apps/site-popup/src/components/site-popup-settings.tsx +0 -120
  37. package/dist/examples-apps/site-popup/src/dashboard/hooks/wix-embeds.ts +0 -33
  38. package/dist/examples-apps/site-popup/src/dashboard/pages/page.tsx +0 -78
  39. package/dist/examples-apps/site-popup/src/dashboard/withProviders.tsx +0 -22
  40. package/dist/examples-apps/site-popup/src/extensions.ts +0 -20
  41. package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/embedded.html +0 -13
  42. package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.css +0 -21
  43. package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.tsx +0 -57
  44. package/dist/examples-apps/site-popup/src/types.ts +0 -14
  45. package/dist/examples-apps/site-popup/tsconfig.json +0 -9
  46. package/dist/examples-apps/site-popup/wix.config.json +0 -5
  47. package/dist/examples-apps/spis-examples/src/dashboard/pages/page.tsx +0 -59
  48. package/dist/examples-apps/spis-examples/src/dashboard/pages/wix_logo.svg +0 -18
  49. package/dist/examples-apps/top-blog-posts/.nvmrc +0 -1
  50. package/dist/examples-apps/top-blog-posts/README.md +0 -21
  51. package/dist/examples-apps/top-blog-posts/package-lock.json +0 -6406
  52. package/dist/examples-apps/top-blog-posts/package.json +0 -31
  53. package/dist/examples-apps/top-blog-posts/src/dashboard/pages/blog-utils.ts +0 -44
  54. package/dist/examples-apps/top-blog-posts/src/dashboard/pages/page.tsx +0 -129
  55. package/dist/examples-apps/top-blog-posts/src/dashboard/pages/wix_logo.svg +0 -18
  56. package/dist/examples-apps/top-blog-posts/src/env.d.ts +0 -4
  57. package/dist/examples-apps/top-blog-posts/tsconfig.json +0 -8
  58. package/dist/examples-apps/top-blog-posts/wix.config.json +0 -5
@@ -1,31 +0,0 @@
1
- {
2
- "name": "top-blog-posts",
3
- "version": "1.0.0",
4
- "private": true,
5
- "dependencies": {
6
- "@wix/blog": "^1.0.468",
7
- "@wix/dashboard": "^1.3.36",
8
- "@wix/design-system": "^1.0.0",
9
- "@wix/wix-ui-icons-common": "^3.0.0"
10
- },
11
- "devDependencies": {
12
- "@types/react": "^16.0.0",
13
- "@types/react-dom": "^16.0.0",
14
- "@wix/cli": "^1.1.112",
15
- "@wix/cli-app": "^1.1.112",
16
- "@wix/sdk-types": "^1.0.0",
17
- "react": "16.14.0",
18
- "react-dom": "16.14.0",
19
- "typescript": "~5.8.2"
20
- },
21
- "scripts": {
22
- "wix": "wix",
23
- "build": "wix app build",
24
- "release": "wix app release",
25
- "dev": "wix app dev",
26
- "preview": "wix app preview",
27
- "generate": "wix app generate",
28
- "logs": "wix app logs",
29
- "typecheck": "tsc --noEmit"
30
- }
31
- }
@@ -1,44 +0,0 @@
1
- import { posts } from "@wix/blog";
2
-
3
- interface ViewedBlogPost {
4
- post: posts.Post;
5
- views: number;
6
- }
7
-
8
- interface LikedBlogPost {
9
- post: posts.Post;
10
- likes: number;
11
- }
12
-
13
- interface TopBlogPosts {
14
- mostViewed: ViewedBlogPost;
15
- mostLiked: LikedBlogPost;
16
- }
17
-
18
- export async function getTopBlogPosts(): Promise<TopBlogPosts> {
19
- const mostLikedPosts = await posts
20
- .queryPosts()
21
- .descending("metrics.likes")
22
- .find();
23
- const mostViewedPosts = await posts
24
- .queryPosts()
25
- .descending("metrics.views")
26
- .find();
27
-
28
- const mostLiked = mostLikedPosts.items[0];
29
- const mostViewed = mostViewedPosts.items[0];
30
-
31
- const mostLikedMetrics = await posts.getPostMetrics(mostLiked._id);
32
- const mostViewedMetrics = await posts.getPostMetrics(mostViewed._id);
33
-
34
- return {
35
- mostViewed: {
36
- post: mostViewed,
37
- views: mostViewedMetrics.metrics.views,
38
- },
39
- mostLiked: {
40
- post: mostLiked,
41
- likes: mostLikedMetrics.metrics.likes,
42
- },
43
- };
44
- }
@@ -1,129 +0,0 @@
1
- import {
2
- Button,
3
- Card,
4
- Heading,
5
- Text,
6
- Page,
7
- WixDesignSystemProvider,
8
- Box,
9
- Loader,
10
- } from "@wix/design-system";
11
- import "@wix/design-system/styles.global.css";
12
- import * as Icons from "@wix/wix-ui-icons-common";
13
- import React, { useEffect, useState } from "react";
14
- import { dashboard } from "@wix/dashboard";
15
- import { getTopBlogPosts } from "./blog-utils";
16
- import { posts } from "@wix/blog";
17
-
18
- interface ViewedBlogPost {
19
- post: posts.Post;
20
- views: number;
21
- }
22
- interface LikedBlogPost {
23
- post: posts.Post;
24
- likes: number;
25
- }
26
- export default function Index() {
27
- const { navigate } = dashboard;
28
- const [mostViewed, setMostViewed] = useState<ViewedBlogPost | null>(null);
29
- const [mostLiked, setMostLiked] = useState<LikedBlogPost | null>(null);
30
- const [mostViewedPublishedDate, setMostViewedPublishedDate] = useState<
31
- string | null
32
- >(null);
33
- const [mostLikedPublishedDate, setMostLikedPublishedDate] = useState<
34
- string | null
35
- >(null);
36
- useEffect(() => {
37
- async function fetchBlogPosts() {
38
- try {
39
- const { mostViewed, mostLiked } = await getTopBlogPosts();
40
- console.log("mostViewed", mostViewed);
41
- setMostViewed(mostViewed);
42
- setMostLiked(mostLiked);
43
- setMostViewedPublishedDate(
44
- new Date(mostViewed.post.lastPublishedDate).toDateString(),
45
- );
46
- setMostLikedPublishedDate(
47
- new Date(mostLiked.post.lastPublishedDate).toDateString(),
48
- );
49
- } catch (error) {
50
- console.log("Failed to fetch blog post data.", error);
51
- }
52
- }
53
- fetchBlogPosts();
54
- }, []);
55
-
56
- if (!mostViewed || !mostLiked) {
57
- return (
58
- <Box align="center" verticalAlign="middle">
59
- <Loader text="Loading..." />
60
- </Box>
61
- );
62
- }
63
- return (
64
- <WixDesignSystemProvider>
65
- <Page>
66
- <Page.Header
67
- title="Top Blog Posts"
68
- subtitle="These are the top blog posts on your site."
69
- actionsBar={
70
- <Button
71
- prefixIcon={<Icons.Edit />}
72
- onClick={() => navigate("a7f877e0-69ac-459f-8b5b-eb7c5e25bad2")}
73
- >
74
- Edit Your Blog
75
- </Button>
76
- }
77
- />
78
- <Page.Content>
79
- <Box gap="5px" direction="vertical">
80
- <Card>
81
- <Card.Header
82
- title={
83
- <Heading size="medium" as="h2">
84
- Most Viewed
85
- </Heading>
86
- }
87
- />
88
- <Card.Divider />
89
- <Card.Content>
90
- <Heading size="small" as="h3">
91
- Title: {mostViewed.post.title}
92
- </Heading>
93
- <Text>Excerpt: {mostViewed.post.excerpt}</Text>
94
- <div>
95
- <Text>Last published: {mostViewedPublishedDate}</Text>
96
- </div>
97
- <div>
98
- <Text>Views: {mostViewed.views}</Text>
99
- </div>
100
- </Card.Content>
101
- </Card>
102
- <Card>
103
- <Card.Header
104
- title={
105
- <Heading size="medium" as="h2">
106
- Most Liked
107
- </Heading>
108
- }
109
- />
110
- <Card.Divider />
111
- <Card.Content>
112
- <Heading size="small" as="h3">
113
- Title: {mostLiked.post.title}
114
- </Heading>
115
- <Text>Excerpt: {mostLiked.post.excerpt}</Text>
116
- <div>
117
- <Text>Last published: {mostLikedPublishedDate}</Text>
118
- </div>
119
- <div>
120
- <Text>Likes: {mostLiked.likes}</Text>
121
- </div>
122
- </Card.Content>
123
- </Card>
124
- </Box>
125
- </Page.Content>
126
- </Page>
127
- </WixDesignSystemProvider>
128
- );
129
- }
@@ -1,18 +0,0 @@
1
- <svg width="166" height="64" viewBox="0 0 166 64" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g clip-path="url(#clip0_14809_9463)">
3
- <path
4
- d="M165.304 0H156.173C153.64 0 151.273 1.25433 149.85 3.35199L137.639 21.3662C137.313 21.844 136.608 21.844 136.283 21.3662L124.071 3.35199C122.651 1.25433 120.281 0 117.748 0H108.617L130.371 32.0894L108.737 64H117.868C120.401 64 122.769 62.7457 124.192 60.648L136.283 42.8126C136.608 42.3349 137.313 42.3349 137.639 42.8126L149.73 60.648C151.15 62.7457 153.52 64 156.053 64H165.184L143.551 32.0894L165.304 0Z"
5
- fill="black" />
6
- <path
7
- d="M89.8281 6.54652V64H94.1922C97.8088 64 100.74 61.0697 100.74 57.4535V0H96.3755C92.7588 0 89.8281 2.93032 89.8281 6.54652Z"
8
- fill="black" />
9
- <path
10
- d="M81.8276 0H77.944C73.6681 0 69.9633 2.95701 69.0158 7.12564L60.3278 45.3185L52.7234 9.66632C51.3168 3.0771 44.5559 -1.36641 37.6375 0.544431C33.2307 1.76139 29.9637 5.48434 29.0108 9.95455L21.4839 45.2705L12.8118 7.12831C11.8616 2.95968 8.15687 0 3.88092 0H0L14.5548 63.9973H20.0692C25.0738 63.9973 29.3978 60.4986 30.4415 55.604L39.7461 11.9401C39.8608 11.3984 40.3466 11.006 40.8991 11.006C41.4516 11.006 41.9374 11.3984 42.0522 11.9401L51.3648 55.6067C52.4084 60.5012 56.7324 63.9973 61.7371 63.9973H67.2702L81.8276 0Z"
11
- fill="black" />
12
- </g>
13
- <defs>
14
- <clipPath id="clip0_14809_9463">
15
- <rect width="165.305" height="64" fill="white" />
16
- </clipPath>
17
- </defs>
18
- </svg>
@@ -1,4 +0,0 @@
1
- /// <reference types="@wix/cli-app/client" />
2
- /// <reference types="@wix/sdk-types/client" />
3
-
4
- // NOTE: This file should not be edited. This is an auto-generated file.
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "@wix/cli-app/tsconfig.app.json",
3
- "compilerOptions": {
4
- "rootDir": "src",
5
- "types": ["react"]
6
- },
7
- "include": ["src"]
8
- }
@@ -1,5 +0,0 @@
1
- {
2
- "$schema": "https://dev.wix.com/wix-cli/schemas/wix-config.json",
3
- "appId": "3e3862c8-7e28-48f9-bc4d-49c0c5c92dbf",
4
- "projectId": "top-blog-posts"
5
- }