@wix/ditto-codegen-public 1.0.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 (170) hide show
  1. package/dist/examples-apps/ai-chatbot/.nvmrc +1 -0
  2. package/dist/examples-apps/ai-chatbot/README.md +21 -0
  3. package/dist/examples-apps/ai-chatbot/package-lock.json +7266 -0
  4. package/dist/examples-apps/ai-chatbot/package.json +35 -0
  5. package/dist/examples-apps/ai-chatbot/src/backend/api/chat/api.ts +62 -0
  6. package/dist/examples-apps/ai-chatbot/src/backend/api/settings/api.ts +39 -0
  7. package/dist/examples-apps/ai-chatbot/src/backend/database.ts +86 -0
  8. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/ProductChat.module.css +3 -0
  9. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/ProductChat.tsx +99 -0
  10. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/page.json +6 -0
  11. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/page.tsx +99 -0
  12. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/settings/page.json +6 -0
  13. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/settings/page.tsx +105 -0
  14. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/wix_logo.svg +18 -0
  15. package/dist/examples-apps/ai-chatbot/src/dashboard/utils.ts +27 -0
  16. package/dist/examples-apps/ai-chatbot/src/dashboard/withProviders.tsx +15 -0
  17. package/dist/examples-apps/ai-chatbot/src/env.d.ts +4 -0
  18. package/dist/examples-apps/ai-chatbot/src/types.ts +4 -0
  19. package/dist/examples-apps/ai-chatbot/tsconfig.json +8 -0
  20. package/dist/examples-apps/ai-chatbot/wix.config.json +5 -0
  21. package/dist/examples-apps/chart-widget/.nvmrc +1 -0
  22. package/dist/examples-apps/chart-widget/README.md +21 -0
  23. package/dist/examples-apps/chart-widget/assets/chart-widget/thumbnail.png +0 -0
  24. package/dist/examples-apps/chart-widget/package-lock.json +6329 -0
  25. package/dist/examples-apps/chart-widget/package.json +30 -0
  26. package/dist/examples-apps/chart-widget/src/env.d.ts +4 -0
  27. package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/common.ts +20 -0
  28. package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/element/bar-chart.tsx +53 -0
  29. package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/element/pie-chart.tsx +40 -0
  30. package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/element.json +20 -0
  31. package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/element.tsx +53 -0
  32. package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/panel/chart-type.tsx +47 -0
  33. package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/panel/slice.tsx +72 -0
  34. package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/panel.tsx +90 -0
  35. package/dist/examples-apps/chart-widget/tsconfig.json +8 -0
  36. package/dist/examples-apps/chart-widget/wix.config.json +5 -0
  37. package/dist/examples-apps/custom-products-catalog/.nvmrc +1 -0
  38. package/dist/examples-apps/custom-products-catalog/README.md +21 -0
  39. package/dist/examples-apps/custom-products-catalog/package-lock.json +8694 -0
  40. package/dist/examples-apps/custom-products-catalog/package.json +33 -0
  41. package/dist/examples-apps/custom-products-catalog/src/dashboard/components/create-product.tsx +54 -0
  42. package/dist/examples-apps/custom-products-catalog/src/dashboard/hooks/stores.ts +60 -0
  43. package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/page.json +5 -0
  44. package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/page.tsx +297 -0
  45. package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/wix_logo.svg +18 -0
  46. package/dist/examples-apps/custom-products-catalog/src/dashboard/withProviders.tsx +16 -0
  47. package/dist/examples-apps/custom-products-catalog/src/env.d.ts +4 -0
  48. package/dist/examples-apps/custom-products-catalog/tsconfig.json +8 -0
  49. package/dist/examples-apps/custom-products-catalog/wix.config.json +5 -0
  50. package/dist/examples-apps/inventory-countdown/.nvmrc +1 -0
  51. package/dist/examples-apps/inventory-countdown/README.md +21 -0
  52. package/dist/examples-apps/inventory-countdown/package-lock.json +7457 -0
  53. package/dist/examples-apps/inventory-countdown/package.json +33 -0
  54. package/dist/examples-apps/inventory-countdown/src/assets/stock-counter/site-plugin-logo.svg +27 -0
  55. package/dist/examples-apps/inventory-countdown/src/env.d.ts +4 -0
  56. package/dist/examples-apps/inventory-countdown/src/site/plugins/custom-elements/stock-counter/consts.ts +1 -0
  57. package/dist/examples-apps/inventory-countdown/src/site/plugins/custom-elements/stock-counter/panel.tsx +81 -0
  58. package/dist/examples-apps/inventory-countdown/src/site/plugins/custom-elements/stock-counter/plugin.json +24 -0
  59. package/dist/examples-apps/inventory-countdown/src/site/plugins/custom-elements/stock-counter/plugin.module.css +4 -0
  60. package/dist/examples-apps/inventory-countdown/src/site/plugins/custom-elements/stock-counter/plugin.tsx +132 -0
  61. package/dist/examples-apps/inventory-countdown/tsconfig.json +8 -0
  62. package/dist/examples-apps/inventory-countdown/wix.config.json +5 -0
  63. package/dist/examples-apps/mixpanel-analytics/.nvmrc +1 -0
  64. package/dist/examples-apps/mixpanel-analytics/README.md +21 -0
  65. package/dist/examples-apps/mixpanel-analytics/package-lock.json +6357 -0
  66. package/dist/examples-apps/mixpanel-analytics/package.json +31 -0
  67. package/dist/examples-apps/mixpanel-analytics/src/dashboard/components/ProjectToken.tsx +60 -0
  68. package/dist/examples-apps/mixpanel-analytics/src/dashboard/hooks/wix-embeds.ts +33 -0
  69. package/dist/examples-apps/mixpanel-analytics/src/dashboard/pages/page.json +5 -0
  70. package/dist/examples-apps/mixpanel-analytics/src/dashboard/pages/page.tsx +39 -0
  71. package/dist/examples-apps/mixpanel-analytics/src/dashboard/withProviders.tsx +19 -0
  72. package/dist/examples-apps/mixpanel-analytics/src/env.d.ts +4 -0
  73. package/dist/examples-apps/mixpanel-analytics/src/site/embedded-scripts/mixpanel-analytics/embedded.html +13 -0
  74. package/dist/examples-apps/mixpanel-analytics/src/site/embedded-scripts/mixpanel-analytics/embedded.json +7 -0
  75. package/dist/examples-apps/mixpanel-analytics/tsconfig.json +8 -0
  76. package/dist/examples-apps/mixpanel-analytics/wix.config.json +5 -0
  77. package/dist/examples-apps/my-locations-app/.nvmrc +1 -0
  78. package/dist/examples-apps/my-locations-app/README.md +21 -0
  79. package/dist/examples-apps/my-locations-app/package-lock.json +6351 -0
  80. package/dist/examples-apps/my-locations-app/package.json +31 -0
  81. package/dist/examples-apps/my-locations-app/src/dashboard/pages/page.json +5 -0
  82. package/dist/examples-apps/my-locations-app/src/dashboard/pages/page.tsx +89 -0
  83. package/dist/examples-apps/my-locations-app/src/dashboard/pages/wix_logo.svg +18 -0
  84. package/dist/examples-apps/my-locations-app/src/env.d.ts +4 -0
  85. package/dist/examples-apps/my-locations-app/tsconfig.json +8 -0
  86. package/dist/examples-apps/my-locations-app/wix.config.json +5 -0
  87. package/dist/examples-apps/site-popup/.nvmrc +1 -0
  88. package/dist/examples-apps/site-popup/README.md +21 -0
  89. package/dist/examples-apps/site-popup/package-lock.json +8033 -0
  90. package/dist/examples-apps/site-popup/package.json +34 -0
  91. package/dist/examples-apps/site-popup/postcss.config.js +7 -0
  92. package/dist/examples-apps/site-popup/src/components/activation-configuration.tsx +49 -0
  93. package/dist/examples-apps/site-popup/src/components/close-button.tsx +30 -0
  94. package/dist/examples-apps/site-popup/src/components/date-range-picker.tsx +49 -0
  95. package/dist/examples-apps/site-popup/src/components/image-picker.tsx +33 -0
  96. package/dist/examples-apps/site-popup/src/components/popup/index.css +3 -0
  97. package/dist/examples-apps/site-popup/src/components/popup/index.tsx +71 -0
  98. package/dist/examples-apps/site-popup/src/components/site-popup-settings.tsx +120 -0
  99. package/dist/examples-apps/site-popup/src/dashboard/hooks/wix-embeds.ts +33 -0
  100. package/dist/examples-apps/site-popup/src/dashboard/pages/page.tsx +78 -0
  101. package/dist/examples-apps/site-popup/src/dashboard/withProviders.tsx +19 -0
  102. package/dist/examples-apps/site-popup/src/env.d.ts +4 -0
  103. package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/embedded.html +12 -0
  104. package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/embedded.json +7 -0
  105. package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/params.dev.json +7 -0
  106. package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.css +3 -0
  107. package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.tsx +58 -0
  108. package/dist/examples-apps/site-popup/src/types.ts +14 -0
  109. package/dist/examples-apps/site-popup/tailwind.config.js +8 -0
  110. package/dist/examples-apps/site-popup/tsconfig.json +9 -0
  111. package/dist/examples-apps/site-popup/wix.config.json +5 -0
  112. package/dist/examples-apps/spis-examples/.nvmrc +1 -0
  113. package/dist/examples-apps/spis-examples/README.md +21 -0
  114. package/dist/examples-apps/spis-examples/package-lock.json +6903 -0
  115. package/dist/examples-apps/spis-examples/package.json +31 -0
  116. package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-additional-fees/additional-fees/plugin.json +5 -0
  117. package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-additional-fees/additional-fees/plugin.ts +24 -0
  118. package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-discounts-trigger/discount-triggers/plugin.json +5 -0
  119. package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-discounts-trigger/discount-triggers/plugin.ts +42 -0
  120. package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-shipping-rates/shipping-rates/plugin.json +7 -0
  121. package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-shipping-rates/shipping-rates/plugin.ts +34 -0
  122. package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-validations/validations/plugin.json +6 -0
  123. package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-validations/validations/plugin.ts +24 -0
  124. package/dist/examples-apps/spis-examples/src/backend/service-plugins/gift-cards-provider/gift-cards/plugin.json +5 -0
  125. package/dist/examples-apps/spis-examples/src/backend/service-plugins/gift-cards-provider/gift-cards/plugin.ts +38 -0
  126. package/dist/examples-apps/spis-examples/src/dashboard/pages/page.tsx +59 -0
  127. package/dist/examples-apps/spis-examples/src/dashboard/pages/wix_logo.svg +18 -0
  128. package/dist/examples-apps/spis-examples/src/env.d.ts +4 -0
  129. package/dist/examples-apps/spis-examples/tsconfig.json +8 -0
  130. package/dist/examples-apps/spis-examples/wix.config.json +5 -0
  131. package/dist/examples-apps/top-blog-posts/.nvmrc +1 -0
  132. package/dist/examples-apps/top-blog-posts/README.md +21 -0
  133. package/dist/examples-apps/top-blog-posts/package-lock.json +6406 -0
  134. package/dist/examples-apps/top-blog-posts/package.json +31 -0
  135. package/dist/examples-apps/top-blog-posts/src/dashboard/pages/blog-utils.ts +44 -0
  136. package/dist/examples-apps/top-blog-posts/src/dashboard/pages/page.tsx +129 -0
  137. package/dist/examples-apps/top-blog-posts/src/dashboard/pages/wix_logo.svg +18 -0
  138. package/dist/examples-apps/top-blog-posts/src/env.d.ts +4 -0
  139. package/dist/examples-apps/top-blog-posts/tsconfig.json +8 -0
  140. package/dist/examples-apps/top-blog-posts/wix.config.json +5 -0
  141. package/dist/out.js +1365 -0
  142. package/dist/wix-cli-templates/.nvmrc +1 -0
  143. package/dist/wix-cli-templates/README.md +21 -0
  144. package/dist/wix-cli-templates/package-lock.json +7118 -0
  145. package/dist/wix-cli-templates/package.json +35 -0
  146. package/dist/wix-cli-templates/src/assets/my-widget/thumbnail.png +0 -0
  147. package/dist/wix-cli-templates/src/backend/api/my-api/api.ts +29 -0
  148. package/dist/wix-cli-templates/src/backend/events/my-event/event.ts +16 -0
  149. package/dist/wix-cli-templates/src/backend/my-web-method.web.ts +21 -0
  150. package/dist/wix-cli-templates/src/backend/service-plugins/ecom-additional-fees/my-service-plugin/plugin.ts +9 -0
  151. package/dist/wix-cli-templates/src/backend/service-plugins/ecom-discounts-trigger/my-service-plugin/plugin.ts +14 -0
  152. package/dist/wix-cli-templates/src/backend/service-plugins/ecom-payment-settings/my-service-plugin/plugin.ts +12 -0
  153. package/dist/wix-cli-templates/src/backend/service-plugins/ecom-shipping-rates/my-service-plugin/plugin.ts +9 -0
  154. package/dist/wix-cli-templates/src/backend/service-plugins/ecom-validations/my-service-plugin/plugin.ts +9 -0
  155. package/dist/wix-cli-templates/src/backend/service-plugins/gift-cards-provider/my-service-plugin/plugin.ts +23 -0
  156. package/dist/wix-cli-templates/src/dashboard/modals/my-modal/modal.tsx +40 -0
  157. package/dist/wix-cli-templates/src/dashboard/pages/page.tsx +59 -0
  158. package/dist/wix-cli-templates/src/dashboard/pages/wix_logo.svg +18 -0
  159. package/dist/wix-cli-templates/src/env.d.ts +4 -0
  160. package/dist/wix-cli-templates/src/site/embedded-scripts/my-script/embedded.html +2 -0
  161. package/dist/wix-cli-templates/src/site/embedded-scripts/my-script/embedded.json +7 -0
  162. package/dist/wix-cli-templates/src/site/embedded-scripts/my-script/logger.ts +1 -0
  163. package/dist/wix-cli-templates/src/site/embedded-scripts/my-script/params.dev.json +3 -0
  164. package/dist/wix-cli-templates/src/site/widgets/custom-elements/my-widget/element.json +27 -0
  165. package/dist/wix-cli-templates/src/site/widgets/custom-elements/my-widget/element.module.css +32 -0
  166. package/dist/wix-cli-templates/src/site/widgets/custom-elements/my-widget/element.tsx +36 -0
  167. package/dist/wix-cli-templates/src/site/widgets/custom-elements/my-widget/panel.tsx +54 -0
  168. package/dist/wix-cli-templates/tsconfig.json +8 -0
  169. package/dist/wix-cli-templates/wix.config.json +5 -0
  170. package/package.json +28 -0
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "spis-examples",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "dependencies": {
6
+ "@wix/dashboard": "^1.3.36",
7
+ "@wix/design-system": "^1.0.0",
8
+ "@wix/wix-ui-icons-common": "^3.0.0",
9
+ "@wix/ecom": "^1.0.668"
10
+ },
11
+ "devDependencies": {
12
+ "@types/react": "^16.0.0",
13
+ "@types/react-dom": "^16.0.0",
14
+ "@wix/cli": "^1.0.0",
15
+ "@wix/cli-app": "^1.0.0",
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
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://dev.wix.com/wix-cli/schemas/ecom-additional-fees.json",
3
+ "id": "5df39c87-4817-4068-8362-cf974424bdeb",
4
+ "name": "additional-fees"
5
+ }
@@ -0,0 +1,24 @@
1
+ import { additionalFees } from "@wix/ecom/service-plugins";
2
+
3
+ additionalFees.provideHandlers({
4
+ calculateAdditionalFees: async (payload) => {
5
+ const { request, metadata } = payload;
6
+ // Use the `request` and `metadata` received from Wix and
7
+ // apply custom logic.
8
+ return {
9
+ // Return your response exactly as documented to integrate with Wix.
10
+ // Return value example:
11
+ additionalFees: [
12
+ {
13
+ code: "subscription-fee",
14
+ name: "Subscription Fee",
15
+ price: "5",
16
+ taxDetails: {
17
+ taxable: true,
18
+ },
19
+ },
20
+ ],
21
+ currency: metadata.currency || "ILS",
22
+ };
23
+ },
24
+ });
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://dev.wix.com/wix-cli/schemas/ecom-discounts-trigger.json",
3
+ "id": "fa7c55a9-44d6-4149-a0e7-b25355bfe024",
4
+ "name": "discount-triggers"
5
+ }
@@ -0,0 +1,42 @@
1
+ import { customTriggers } from "@wix/ecom/service-plugins";
2
+
3
+ customTriggers.provideHandlers({
4
+ getEligibleTriggers: async (payload) => {
5
+ const { request, metadata } = payload;
6
+ // Use the `request` and `metadata` received from Wix and
7
+ // apply custom logic.
8
+ return {
9
+ // Return your response exactly as documented to integrate with Wix.
10
+ // Return value example:
11
+ eligibleTriggers: [
12
+ {
13
+ customTriggerId: "my-happy-hour-trigger",
14
+ identifier: "123",
15
+ },
16
+ {
17
+ customTriggerId: "my-digital-sale-trigger",
18
+ identifier: "234",
19
+ },
20
+ ],
21
+ };
22
+ },
23
+ listTriggers: async (payload) => {
24
+ const { request, metadata } = payload;
25
+ // Use the `request` and `metadata` received from Wix and
26
+ // apply custom logic.
27
+ return {
28
+ // Return your response exactly as documented to integrate with Wix.
29
+ // Return value example:
30
+ customTriggers: [
31
+ {
32
+ _id: "my-happy-hour-trigger",
33
+ name: "Happy Hour 16:00-18:00",
34
+ },
35
+ {
36
+ _id: "my-digital-sale-trigger",
37
+ name: "Digital products discount",
38
+ },
39
+ ],
40
+ };
41
+ },
42
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "https://dev.wix.com/wix-cli/schemas/ecom-shipping-rates.json",
3
+ "id": "953e197b-52d2-4e1a-851a-e78eac024886",
4
+ "name": "Shipping Rates Provider",
5
+ "description": "Short description about this shipping provider",
6
+ "fallbackDefinitionMandatory": false
7
+ }
@@ -0,0 +1,34 @@
1
+ import { shippingRates } from "@wix/ecom/service-plugins";
2
+ import { ChargeType } from "@wix/auto_sdk_ecom_shipping-rates";
3
+
4
+ shippingRates.provideHandlers({
5
+ getShippingRates: async (payload) => {
6
+ const { request, metadata } = payload;
7
+ // Use the `request` and `metadata` received from Wix and
8
+ // apply custom logic.
9
+ return {
10
+ // Return your response exactly as documented to integrate with Wix.
11
+ // Return value example:
12
+ shippingRates: [
13
+ {
14
+ code: "usps-international",
15
+ title: "USPS - International",
16
+ logistics: {
17
+ deliveryTime: "2-5 days",
18
+ },
19
+ cost: {
20
+ price: "15",
21
+ currency: metadata.currency || "ILS",
22
+ additionalCharges: [
23
+ {
24
+ price: "10",
25
+ type: ChargeType.HANDLING_FEE,
26
+ details: "Handling fee of $5 applied for fragile items.",
27
+ },
28
+ ],
29
+ },
30
+ },
31
+ ],
32
+ };
33
+ },
34
+ });
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://dev.wix.com/wix-cli/schemas/ecom-validations.json",
3
+ "id": "6c03b52e-9f8e-49e6-97fe-d7040d3a7712",
4
+ "name": "validations",
5
+ "validateInCart": false
6
+ }
@@ -0,0 +1,24 @@
1
+ import { validations } from "@wix/ecom/service-plugins";
2
+
3
+ validations.provideHandlers({
4
+ getValidationViolations: async (payload) => {
5
+ const { request, metadata } = payload;
6
+ // Use the `request` and `metadata` received from Wix and
7
+ // apply custom logic.
8
+ return {
9
+ // Return your response exactly as documented to integrate with Wix.
10
+ // Return value example:
11
+ violations: [
12
+ {
13
+ description: "You must purchase at least 100 items.",
14
+ severity: validations.Severity.WARNING,
15
+ target: {
16
+ other: {
17
+ name: validations.NameInOther.OTHER_DEFAULT,
18
+ },
19
+ },
20
+ },
21
+ ],
22
+ };
23
+ },
24
+ });
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://dev.wix.com/wix-cli/schemas/gift-cards-provider.json",
3
+ "id": "a96ae458-3a80-447c-b247-88251e59db5d",
4
+ "name": "gift-cards"
5
+ }
@@ -0,0 +1,38 @@
1
+ import { giftVouchersProvider } from '@wix/ecom/service-plugins';
2
+
3
+ giftVouchersProvider.provideHandlers({
4
+ redeem: async (payload) => {
5
+ const { request, metadata } = payload;
6
+ // Use the `request` and `metadata` received from Wix and
7
+ // apply custom logic.
8
+ return {
9
+ // Return your response exactly as documented to integrate with Wix.
10
+ // Return value example:
11
+ remainingBalance: 80.00,
12
+ currencyCode: metadata.currency || "ILS",
13
+ transactionId: "00000000-0000-0000-0000-000000000001",
14
+ };
15
+ },
16
+ _void: async (payload) => {
17
+ const { request, metadata } = payload;
18
+ // Use the `request` and `metadata` received from Wix and
19
+ // apply custom logic.
20
+ return {
21
+ // Return your response exactly as documented to integrate with Wix.
22
+ // Return value example:
23
+ remainingBalance: 100.00,
24
+ currencyCode: metadata.currency || "ILS",
25
+ };
26
+ },
27
+ getBalance: async (payload) => {
28
+ const { request, metadata } = payload;
29
+ // Use the `request` and `metadata` received from Wix and
30
+ // apply custom logic.
31
+ return {
32
+ // Return your response exactly as documented to integrate with Wix.
33
+ // Return value example:
34
+ balance: 100.00,
35
+ currencyCode: metadata.currency || "ILS",
36
+ };
37
+ },
38
+ });
@@ -0,0 +1,59 @@
1
+ import React, { type FC } from 'react';
2
+ import { dashboard } from '@wix/dashboard';
3
+ import {
4
+ Button,
5
+ EmptyState,
6
+ Image,
7
+ Page,
8
+ TextButton,
9
+ WixDesignSystemProvider,
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 wixLogo from './wix_logo.svg';
14
+
15
+ const Index: FC = () => {
16
+ return (
17
+ <WixDesignSystemProvider features={{ newColorsBranding: true }}>
18
+ <Page>
19
+ <Page.Header
20
+ title="Dashboard Page"
21
+ subtitle="Add management capabilities to your app."
22
+ actionsBar={
23
+ <Button
24
+ onClick={() => {
25
+ dashboard.showToast({
26
+ message: 'Your first toast message!',
27
+ });
28
+ }}
29
+ prefixIcon={<Icons.GetStarted />}
30
+ >
31
+ Show a toast
32
+ </Button>
33
+ }
34
+ />
35
+ <Page.Content>
36
+ <EmptyState
37
+ image={
38
+ <Image fit="contain" height="100px" src={wixLogo} transparent />
39
+ }
40
+ title="Start editing this dashboard page"
41
+ subtitle="Learn how to work with dashboard pages and how to add functionality to them using Wix APIs."
42
+ skin="page"
43
+ >
44
+ <TextButton
45
+ as="a"
46
+ href="https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/dashboard-extensions/dashboard-pages/add-dashboard-page-extensions-with-the-cli#add-dashboard-page-extensions-with-the-cli"
47
+ target="_blank"
48
+ prefixIcon={<Icons.ExternalLink />}
49
+ >
50
+ Dashboard pages documentation
51
+ </TextButton>
52
+ </EmptyState>
53
+ </Page.Content>
54
+ </Page>
55
+ </WixDesignSystemProvider>
56
+ );
57
+ };
58
+
59
+ export default Index;
@@ -0,0 +1,18 @@
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>
@@ -0,0 +1,4 @@
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.
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "@wix/cli-app/tsconfig.app.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "types": ["react"]
6
+ },
7
+ "include": ["src"]
8
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://dev.wix.com/wix-cli/schemas/wix-config.json",
3
+ "appId": "05b5b65d-5071-4821-a13c-ba88cae3bee4",
4
+ "projectId": "spis-examples"
5
+ }
@@ -0,0 +1 @@
1
+ 22.10.0
@@ -0,0 +1,21 @@
1
+ # top-blog-posts
2
+
3
+ This project was bootstrapped with [Create Wix App](https://www.npmjs.com/package/@wix/create-app).
4
+ Read more about it in the [Wix CLI for Apps
5
+ documentation](https://dev.wix.com/docs/build-apps/developer-tools/cli/get-started/about-the-wix-cli-for-apps).
6
+
7
+ ## Setup 🔧
8
+
9
+ ##### Install dependencies:
10
+
11
+ ```console
12
+ npm install
13
+ ```
14
+
15
+ ## Available Scripts
16
+
17
+ In the project directory, you can run:
18
+
19
+ ```console
20
+ npm run dev
21
+ ```