@canva/cli 1.19.0 → 1.20.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 (231) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1 -9
  3. package/cli.js +408 -409
  4. package/package.json +1 -2
  5. package/templates/base/backend/base_backend/create.ts +0 -114
  6. package/templates/base/backend/database/database.ts +0 -42
  7. package/templates/base/backend/routers/auth.ts +0 -288
  8. package/templates/base/declarations/declarations.d.ts +0 -29
  9. package/templates/base/eslint.config.mjs +0 -14
  10. package/templates/base/package.json +0 -91
  11. package/templates/base/scripts/copy_env.ts +0 -13
  12. package/templates/base/scripts/ssl/ssl.ts +0 -131
  13. package/templates/base/scripts/start/app_runner.ts +0 -223
  14. package/templates/base/scripts/start/context.ts +0 -171
  15. package/templates/base/scripts/start/start.ts +0 -46
  16. package/templates/base/scripts/start.tests.ts +0 -61
  17. package/templates/base/styles/components.css +0 -38
  18. package/templates/base/tsconfig.json +0 -56
  19. package/templates/base/webpack.config.ts +0 -247
  20. package/templates/common/.env.template +0 -6
  21. package/templates/common/.gitignore.template +0 -8
  22. package/templates/common/.nvmrc +0 -1
  23. package/templates/common/.prettierrc +0 -21
  24. package/templates/common/LICENSE.md +0 -48
  25. package/templates/common/README.md +0 -179
  26. package/templates/common/jest.config.mjs +0 -35
  27. package/templates/common/jest.setup.ts +0 -35
  28. package/templates/content_publisher/README.md +0 -58
  29. package/templates/content_publisher/canva-app.json +0 -17
  30. package/templates/content_publisher/declarations/declarations.d.ts +0 -29
  31. package/templates/content_publisher/eslint.config.mjs +0 -14
  32. package/templates/content_publisher/package.json +0 -90
  33. package/templates/content_publisher/scripts/copy_env.ts +0 -13
  34. package/templates/content_publisher/scripts/ssl/ssl.ts +0 -131
  35. package/templates/content_publisher/scripts/start/app_runner.ts +0 -223
  36. package/templates/content_publisher/scripts/start/context.ts +0 -171
  37. package/templates/content_publisher/scripts/start/start.ts +0 -46
  38. package/templates/content_publisher/src/index.tsx +0 -4
  39. package/templates/content_publisher/src/intents/content_publisher/index.tsx +0 -107
  40. package/templates/content_publisher/src/intents/content_publisher/post_preview.tsx +0 -240
  41. package/templates/content_publisher/src/intents/content_publisher/preview_ui.tsx +0 -62
  42. package/templates/content_publisher/src/intents/content_publisher/settings_ui.tsx +0 -81
  43. package/templates/content_publisher/src/intents/content_publisher/types.ts +0 -29
  44. package/templates/content_publisher/styles/components.css +0 -38
  45. package/templates/content_publisher/styles/preview_ui.css +0 -49
  46. package/templates/content_publisher/tsconfig.json +0 -56
  47. package/templates/content_publisher/webpack.config.ts +0 -247
  48. package/templates/dam/backend/routers/dam.ts +0 -108
  49. package/templates/dam/backend/server.ts +0 -65
  50. package/templates/dam/canva-app.json +0 -25
  51. package/templates/dam/declarations/declarations.d.ts +0 -29
  52. package/templates/dam/eslint.config.mjs +0 -14
  53. package/templates/dam/package.json +0 -97
  54. package/templates/dam/scripts/copy_env.ts +0 -13
  55. package/templates/dam/scripts/ssl/ssl.ts +0 -131
  56. package/templates/dam/scripts/start/app_runner.ts +0 -223
  57. package/templates/dam/scripts/start/context.ts +0 -171
  58. package/templates/dam/scripts/start/start.ts +0 -46
  59. package/templates/dam/src/index.tsx +0 -4
  60. package/templates/dam/src/intents/design_editor/adapter.ts +0 -44
  61. package/templates/dam/src/intents/design_editor/app.tsx +0 -35
  62. package/templates/dam/src/intents/design_editor/config.ts +0 -220
  63. package/templates/dam/src/intents/design_editor/index.css +0 -3
  64. package/templates/dam/src/intents/design_editor/index.tsx +0 -25
  65. package/templates/dam/tsconfig.json +0 -56
  66. package/templates/dam/utils/backend/base_backend/create.ts +0 -114
  67. package/templates/dam/webpack.config.ts +0 -247
  68. package/templates/data_connector/README.md +0 -84
  69. package/templates/data_connector/canva-app.json +0 -21
  70. package/templates/data_connector/declarations/declarations.d.ts +0 -29
  71. package/templates/data_connector/eslint.config.mjs +0 -14
  72. package/templates/data_connector/package.json +0 -92
  73. package/templates/data_connector/scripts/copy_env.ts +0 -13
  74. package/templates/data_connector/scripts/ssl/ssl.ts +0 -131
  75. package/templates/data_connector/scripts/start/app_runner.ts +0 -223
  76. package/templates/data_connector/scripts/start/context.ts +0 -171
  77. package/templates/data_connector/scripts/start/start.ts +0 -46
  78. package/templates/data_connector/src/api/connect_client.ts +0 -6
  79. package/templates/data_connector/src/api/data_source.ts +0 -97
  80. package/templates/data_connector/src/api/data_sources/designs.tsx +0 -296
  81. package/templates/data_connector/src/api/data_sources/index.ts +0 -4
  82. package/templates/data_connector/src/api/data_sources/templates.tsx +0 -328
  83. package/templates/data_connector/src/api/fetch_data_table.ts +0 -55
  84. package/templates/data_connector/src/api/index.ts +0 -4
  85. package/templates/data_connector/src/api/oauth.ts +0 -8
  86. package/templates/data_connector/src/api/tests/data_source.test.tsx +0 -99
  87. package/templates/data_connector/src/components/app_error.tsx +0 -15
  88. package/templates/data_connector/src/components/footer.tsx +0 -26
  89. package/templates/data_connector/src/components/header.tsx +0 -40
  90. package/templates/data_connector/src/components/index.ts +0 -3
  91. package/templates/data_connector/src/components/inputs/messages.tsx +0 -95
  92. package/templates/data_connector/src/components/inputs/search_filter.tsx +0 -109
  93. package/templates/data_connector/src/components/inputs/select_field.tsx +0 -26
  94. package/templates/data_connector/src/context/app_context.tsx +0 -125
  95. package/templates/data_connector/src/context/index.ts +0 -2
  96. package/templates/data_connector/src/context/use_app_context.ts +0 -17
  97. package/templates/data_connector/src/index.tsx +0 -4
  98. package/templates/data_connector/src/intents/data_connector/app.tsx +0 -20
  99. package/templates/data_connector/src/intents/data_connector/entrypoint.tsx +0 -70
  100. package/templates/data_connector/src/intents/data_connector/home.tsx +0 -21
  101. package/templates/data_connector/src/intents/data_connector/index.tsx +0 -56
  102. package/templates/data_connector/src/pages/data_source_config.tsx +0 -9
  103. package/templates/data_connector/src/pages/error.tsx +0 -37
  104. package/templates/data_connector/src/pages/index.ts +0 -4
  105. package/templates/data_connector/src/pages/login.tsx +0 -145
  106. package/templates/data_connector/src/pages/select_source.tsx +0 -24
  107. package/templates/data_connector/src/routes/index.ts +0 -2
  108. package/templates/data_connector/src/routes/paths.ts +0 -7
  109. package/templates/data_connector/src/routes/protected_route.tsx +0 -26
  110. package/templates/data_connector/src/routes/routes.tsx +0 -42
  111. package/templates/data_connector/src/utils/data_params.ts +0 -17
  112. package/templates/data_connector/src/utils/data_table.ts +0 -116
  113. package/templates/data_connector/src/utils/fetch_result.ts +0 -36
  114. package/templates/data_connector/src/utils/index.ts +0 -2
  115. package/templates/data_connector/src/utils/tests/data_table.test.ts +0 -133
  116. package/templates/data_connector/styles/components.css +0 -38
  117. package/templates/data_connector/tsconfig.json +0 -56
  118. package/templates/data_connector/webpack.config.ts +0 -247
  119. package/templates/gen_ai/README.md +0 -27
  120. package/templates/gen_ai/backend/routers/image.ts +0 -232
  121. package/templates/gen_ai/backend/server.ts +0 -65
  122. package/templates/gen_ai/canva-app.json +0 -25
  123. package/templates/gen_ai/declarations/declarations.d.ts +0 -29
  124. package/templates/gen_ai/eslint.config.mjs +0 -14
  125. package/templates/gen_ai/package.json +0 -101
  126. package/templates/gen_ai/scripts/copy_env.ts +0 -13
  127. package/templates/gen_ai/scripts/ssl/ssl.ts +0 -131
  128. package/templates/gen_ai/scripts/start/app_runner.ts +0 -223
  129. package/templates/gen_ai/scripts/start/context.ts +0 -171
  130. package/templates/gen_ai/scripts/start/start.ts +0 -46
  131. package/templates/gen_ai/src/api/api.ts +0 -194
  132. package/templates/gen_ai/src/api/index.ts +0 -1
  133. package/templates/gen_ai/src/components/app_error.tsx +0 -18
  134. package/templates/gen_ai/src/components/footer.messages.ts +0 -48
  135. package/templates/gen_ai/src/components/footer.tsx +0 -156
  136. package/templates/gen_ai/src/components/image_grid.tsx +0 -103
  137. package/templates/gen_ai/src/components/index.ts +0 -7
  138. package/templates/gen_ai/src/components/loading_results.tsx +0 -169
  139. package/templates/gen_ai/src/components/prompt_input.messages.ts +0 -14
  140. package/templates/gen_ai/src/components/prompt_input.tsx +0 -154
  141. package/templates/gen_ai/src/components/remaining_credits.tsx +0 -84
  142. package/templates/gen_ai/src/components/report_box.tsx +0 -54
  143. package/templates/gen_ai/src/components/tests/remaining_credit.tests.tsx +0 -47
  144. package/templates/gen_ai/src/config.ts +0 -21
  145. package/templates/gen_ai/src/context/app_context.tsx +0 -153
  146. package/templates/gen_ai/src/context/context.messages.ts +0 -30
  147. package/templates/gen_ai/src/context/index.ts +0 -2
  148. package/templates/gen_ai/src/context/use_app_context.ts +0 -17
  149. package/templates/gen_ai/src/index.tsx +0 -4
  150. package/templates/gen_ai/src/intents/design_editor/app.tsx +0 -19
  151. package/templates/gen_ai/src/intents/design_editor/home.tsx +0 -13
  152. package/templates/gen_ai/src/intents/design_editor/index.tsx +0 -17
  153. package/templates/gen_ai/src/pages/error.tsx +0 -41
  154. package/templates/gen_ai/src/pages/generate.tsx +0 -9
  155. package/templates/gen_ai/src/pages/index.ts +0 -3
  156. package/templates/gen_ai/src/pages/results.tsx +0 -31
  157. package/templates/gen_ai/src/routes/index.ts +0 -1
  158. package/templates/gen_ai/src/routes/paths.ts +0 -4
  159. package/templates/gen_ai/src/routes/routes.tsx +0 -24
  160. package/templates/gen_ai/src/utils/index.ts +0 -1
  161. package/templates/gen_ai/src/utils/obscenity_filter.ts +0 -33
  162. package/templates/gen_ai/styles/components.css +0 -38
  163. package/templates/gen_ai/styles/utils.css +0 -3
  164. package/templates/gen_ai/tsconfig.json +0 -56
  165. package/templates/gen_ai/utils/backend/base_backend/create.ts +0 -114
  166. package/templates/gen_ai/webpack.config.ts +0 -247
  167. package/templates/hello_world/canva-app.json +0 -21
  168. package/templates/hello_world/declarations/declarations.d.ts +0 -29
  169. package/templates/hello_world/eslint.config.mjs +0 -14
  170. package/templates/hello_world/package.json +0 -90
  171. package/templates/hello_world/scripts/copy_env.ts +0 -13
  172. package/templates/hello_world/scripts/ssl/ssl.ts +0 -131
  173. package/templates/hello_world/scripts/start/app_runner.ts +0 -223
  174. package/templates/hello_world/scripts/start/context.ts +0 -171
  175. package/templates/hello_world/scripts/start/start.ts +0 -46
  176. package/templates/hello_world/src/index.tsx +0 -4
  177. package/templates/hello_world/src/intents/design_editor/app.tsx +0 -86
  178. package/templates/hello_world/src/intents/design_editor/index.tsx +0 -25
  179. package/templates/hello_world/src/intents/design_editor/tests/__snapshots__/app.tests.tsx.snap +0 -45
  180. package/templates/hello_world/src/intents/design_editor/tests/app.tests.tsx +0 -92
  181. package/templates/hello_world/styles/components.css +0 -38
  182. package/templates/hello_world/tsconfig.json +0 -56
  183. package/templates/hello_world/webpack.config.ts +0 -247
  184. package/templates/mls/README.md +0 -81
  185. package/templates/mls/canva-app.json +0 -25
  186. package/templates/mls/declarations/declarations.d.ts +0 -29
  187. package/templates/mls/eslint.config.mjs +0 -14
  188. package/templates/mls/jest.config.mjs +0 -36
  189. package/templates/mls/jest.setup.ts +0 -39
  190. package/templates/mls/package.json +0 -117
  191. package/templates/mls/scripts/copy_env.ts +0 -13
  192. package/templates/mls/scripts/ssl/ssl.ts +0 -131
  193. package/templates/mls/scripts/start/app_runner.ts +0 -223
  194. package/templates/mls/scripts/start/context.ts +0 -171
  195. package/templates/mls/scripts/start/start.ts +0 -46
  196. package/templates/mls/src/__tests__/app.tests.tsx +0 -11
  197. package/templates/mls/src/__tests__/office_selection_page.tests.tsx +0 -72
  198. package/templates/mls/src/__tests__/utils.tsx +0 -19
  199. package/templates/mls/src/adapter.ts +0 -126
  200. package/templates/mls/src/components/agent/agent_card.tsx +0 -57
  201. package/templates/mls/src/components/agent/agent_grid.tsx +0 -37
  202. package/templates/mls/src/components/agent/agent_list.tsx +0 -17
  203. package/templates/mls/src/components/agent/agent_search_filters.tsx +0 -88
  204. package/templates/mls/src/components/breadcrumb/breadcrumb.tsx +0 -40
  205. package/templates/mls/src/components/listing/listing_card.tsx +0 -64
  206. package/templates/mls/src/components/listing/listing_grid.tsx +0 -37
  207. package/templates/mls/src/components/listing/listing_list.tsx +0 -21
  208. package/templates/mls/src/components/listing/listing_search_filters.tsx +0 -145
  209. package/templates/mls/src/components/placeholders/placeholders.tsx +0 -65
  210. package/templates/mls/src/data.ts +0 -359
  211. package/templates/mls/src/index.tsx +0 -4
  212. package/templates/mls/src/intents/design_editor/app.tsx +0 -44
  213. package/templates/mls/src/intents/design_editor/index.tsx +0 -25
  214. package/templates/mls/src/pages/agent_details_page/agent_details_page.tsx +0 -175
  215. package/templates/mls/src/pages/list_page/agent_tab_panel.tsx +0 -126
  216. package/templates/mls/src/pages/list_page/list_page.tsx +0 -67
  217. package/templates/mls/src/pages/list_page/listing_tab_panel.tsx +0 -135
  218. package/templates/mls/src/pages/listing_details_page/listing_details_page.tsx +0 -418
  219. package/templates/mls/src/pages/loading_page/loading_page.tsx +0 -152
  220. package/templates/mls/src/pages/office_selection_page/office_selection_page.tsx +0 -144
  221. package/templates/mls/src/real_estate.type.ts +0 -44
  222. package/templates/mls/src/util/use_add_element.tsx +0 -62
  223. package/templates/mls/src/util/use_drag_element.tsx +0 -68
  224. package/templates/mls/styles/components.css +0 -38
  225. package/templates/mls/tsconfig.json +0 -54
  226. package/templates/mls/webpack.config.ts +0 -248
  227. package/templates/optional/.cursor/mcp.json +0 -8
  228. package/templates/optional/.vscode/extensions.json +0 -6
  229. package/templates/optional/.vscode/mcp.json +0 -9
  230. package/templates/optional/AGENTS.md +0 -154
  231. package/templates/optional/CLAUDE.md +0 -154
@@ -1,65 +0,0 @@
1
- import {
2
- Box,
3
- Column,
4
- Columns,
5
- Placeholder,
6
- Rows,
7
- TextPlaceholder,
8
- TitlePlaceholder,
9
- } from "@canva/app-ui-kit";
10
- import React from "react";
11
-
12
- export const ListPlaceholder = () => (
13
- <Columns spacing="2u" align="start" alignY="stretch">
14
- <Column width="content">
15
- <Box width="full" height="full">
16
- <div
17
- style={{
18
- height: "60px",
19
- width: "60px",
20
- paddingLeft: "var(--ui-kit-space-050)",
21
- }}
22
- >
23
- <Placeholder shape="rectangle" />
24
- </div>
25
- </Box>
26
- </Column>
27
- <Column width="fluid">
28
- <Rows spacing="0">
29
- <TitlePlaceholder />
30
- <TextPlaceholder />
31
- </Rows>
32
- </Column>
33
- </Columns>
34
- );
35
-
36
- export const GridPlaceholder = () => (
37
- <Columns spacing="2u" alignY="stretch">
38
- <Column width="1/2">
39
- <Rows spacing="1u">
40
- <Box width="full" height="full">
41
- <div style={{ height: "120px" }}>
42
- <Placeholder shape="rectangle" />
43
- </div>
44
- </Box>
45
- <Rows spacing="0">
46
- <TitlePlaceholder />
47
- <TitlePlaceholder size="small" />
48
- </Rows>
49
- </Rows>
50
- </Column>
51
- <Column width="1/2">
52
- <Rows spacing="1u">
53
- <Box width="full" height="full">
54
- <div style={{ height: "120px" }}>
55
- <Placeholder shape="rectangle" />
56
- </div>
57
- </Box>
58
- <Rows spacing="0">
59
- <TitlePlaceholder />
60
- <TitlePlaceholder size="small" />
61
- </Rows>
62
- </Rows>
63
- </Column>
64
- </Columns>
65
- );
@@ -1,359 +0,0 @@
1
- import type { Agent, Office, Property } from "./real_estate.type";
2
- // Example Real Estate data
3
-
4
- // TODO: replace these with assets from your CDN
5
- const RealEstateAgentThumbnail1 =
6
- "https://res.cloudinary.com/dxwoiemnu/image/upload/v1742444454/real-estate-agent-1_zhrimx.png";
7
- const RealEstateAgentThumbnail2 =
8
- "https://res.cloudinary.com/dxwoiemnu/image/upload/v1742444454/real-estate-agent-2_fcculq.png";
9
-
10
- const RealEstateListing1 =
11
- "https://res.cloudinary.com/dxwoiemnu/image/upload/v1742444456/real-estate-listing-1_inyeny.png";
12
- const RealEstateListing2 =
13
- "https://res.cloudinary.com/dxwoiemnu/image/upload/v1742444455/real-estate-listing-2_zqaa97.png";
14
- const RealEstateListing3 =
15
- "https://res.cloudinary.com/dxwoiemnu/image/upload/v1742444456/real-estate-listing-3_arbr7e.png";
16
- const RealEstateListing4 =
17
- "https://res.cloudinary.com/dxwoiemnu/image/upload/v1742444456/real-estate-listing-4_b9upex.png";
18
- const RealEstateListing5 =
19
- "https://res.cloudinary.com/dxwoiemnu/image/upload/v1742444463/real-estate-listing-5_isg9x1.png";
20
- const RealEstateListing6 =
21
- "https://res.cloudinary.com/dxwoiemnu/image/upload/v1742444457/real-estate-listing-6_k7divw.png";
22
-
23
- const RealEstateAvatar = "https://i.pravatar.cc/300?img=33";
24
-
25
- export const offices: Office[] = [
26
- { id: "office1", name: "Murray Street" },
27
- { id: "office2", name: "Jermaine Street" },
28
- { id: "office3", name: "Brett Street" },
29
- { id: "empty-office", name: "Empty Office" },
30
- { id: "error-office", name: "Error Office" },
31
- { id: "agents-only-office", name: "Agents Only Office" },
32
- { id: "listings-only-office", name: "Listings Only Office" },
33
- ];
34
-
35
- const getRandomAgent = () => {
36
- const randomIndex = Math.floor(Math.random() * agents.length);
37
- return agents[randomIndex];
38
- };
39
-
40
- export const agents: Agent[] = [
41
- {
42
- id: "agent1",
43
- name: "Alice",
44
- officeId: "office1",
45
- phoneNumber: "+61 2 1234 5678",
46
- roleTitle: "Senior Property Consultant",
47
- headshots: [
48
- {
49
- url: RealEstateAgentThumbnail1,
50
- width: 400,
51
- height: 400,
52
- },
53
- ],
54
- },
55
- {
56
- id: "agent2",
57
- name: "Bob",
58
- officeId: "office2",
59
- phoneNumber: "+61 2 8765 4321",
60
- roleTitle: "Property Manager",
61
- headshots: [
62
- {
63
- url: RealEstateAgentThumbnail2,
64
- width: 400,
65
- height: 400,
66
- },
67
- ],
68
- },
69
- {
70
- id: "agent3",
71
- name: "Carol",
72
- officeId: "office3",
73
- phoneNumber: "+61 2 2468 1357",
74
- roleTitle: "Real Estate Agent",
75
- headshots: [
76
- {
77
- url: RealEstateAgentThumbnail1,
78
- width: 400,
79
- height: 400,
80
- },
81
- ],
82
- },
83
- ];
84
-
85
- export const listings: Property[] = [
86
- {
87
- id: "listing1",
88
- agent: getRandomAgent(),
89
- url: "/listings/123-ocean-view-drive",
90
- title: "Stunning Beachfront Property with Panoramic Views",
91
- name: "Luxury Ocean View House",
92
- description: "Beautiful house with stunning ocean views in Beachside",
93
- address: "123 Ocean View Drive",
94
- suburb: "Beachside",
95
- price: "$2,450,000",
96
- listingType: "House",
97
- thumbnail: {
98
- url: RealEstateListing1,
99
- width: 800,
100
- height: 600,
101
- },
102
- listing_images: [
103
- {
104
- url: RealEstateListing1,
105
- alt: "Front view of the house",
106
- width: 1920,
107
- height: 1080,
108
- },
109
- {
110
- url: RealEstateListing2,
111
- alt: "Backyard view",
112
- width: 1920,
113
- height: 1080,
114
- },
115
- {
116
- url: RealEstateListing3,
117
- alt: "Kitchen interior",
118
- width: 1920,
119
- height: 1080,
120
- },
121
- {
122
- url: RealEstateListing4,
123
- alt: "Living room",
124
- width: 1920,
125
- height: 1080,
126
- },
127
- ],
128
- },
129
- {
130
- id: "listing2",
131
- agent: getRandomAgent(),
132
- url: "/listings/45-mountain-road",
133
- title: "Spacious Family Home with Mountain Vistas",
134
- name: "Mountain View Family Home",
135
- description: "Spacious family home with mountain views in Highland Park",
136
- address: "45 Mountain Road",
137
- suburb: "Highland Park",
138
- price: "$1,850,000",
139
- listingType: "House",
140
- thumbnail: {
141
- url: RealEstateListing2,
142
- width: 800,
143
- height: 600,
144
- },
145
- listing_images: [
146
- {
147
- url: RealEstateListing2,
148
- alt: "Front view of the house",
149
- width: 1920,
150
- height: 1080,
151
- },
152
- {
153
- url: RealEstateListing3,
154
- alt: "Mountain view from balcony",
155
- width: 1920,
156
- height: 1080,
157
- },
158
- {
159
- url: RealEstateListing4,
160
- alt: "Family room",
161
- width: 1920,
162
- height: 1080,
163
- },
164
- {
165
- url: RealEstateListing5,
166
- alt: "Master bedroom",
167
- width: 1920,
168
- height: 1080,
169
- },
170
- ],
171
- },
172
- {
173
- id: "listing3",
174
- agent: getRandomAgent(),
175
- url: "/listings/789-city-center-ave",
176
- title: "Modern Apartment in Prime Downtown Location",
177
- name: "Modern Downtown Apartment",
178
- description: "Contemporary apartment in the heart of downtown",
179
- address: "789 City Center Ave",
180
- suburb: "Downtown",
181
- price: "$950,000",
182
- listingType: "Apartment",
183
- thumbnail: {
184
- url: RealEstateListing3,
185
- width: 800,
186
- height: 600,
187
- },
188
- listing_images: [
189
- {
190
- url: RealEstateListing3,
191
- alt: "Front view of the apartment",
192
- width: 1920,
193
- height: 1080,
194
- },
195
- {
196
- url: RealEstateListing4,
197
- alt: "City view from balcony",
198
- width: 1920,
199
- height: 1080,
200
- },
201
- {
202
- url: RealEstateListing5,
203
- alt: "Modern kitchen",
204
- width: 1920,
205
- height: 1080,
206
- },
207
- {
208
- url: RealEstateListing6,
209
- alt: "Open plan living area",
210
- width: 1920,
211
- height: 1080,
212
- },
213
- ],
214
- },
215
- {
216
- id: "listing4",
217
- agent: getRandomAgent(),
218
- url: "/listings/321-riverside-lane",
219
- title: "Elegant Townhouse with River Views",
220
- name: "Riverside Townhouse",
221
- description: "Elegant townhouse with river views in Waterfront",
222
- address: "321 Riverside Lane",
223
- suburb: "Waterfront",
224
- price: "$1,650,000",
225
- listingType: "Townhouse",
226
- thumbnail: {
227
- url: RealEstateListing4,
228
- width: 800,
229
- height: 600,
230
- },
231
- listing_images: [
232
- {
233
- url: RealEstateListing4,
234
- alt: "Front view of the townhouse",
235
- width: 1920,
236
- height: 1080,
237
- },
238
- {
239
- url: RealEstateListing5,
240
- alt: "River view from deck",
241
- width: 1920,
242
- height: 1080,
243
- },
244
- {
245
- url: RealEstateListing6,
246
- alt: "Gourmet kitchen",
247
- width: 1920,
248
- height: 1080,
249
- },
250
- {
251
- url: RealEstateListing1,
252
- alt: "Master suite",
253
- width: 1920,
254
- height: 1080,
255
- },
256
- ],
257
- },
258
- {
259
- id: "listing5",
260
- agent: getRandomAgent(),
261
- url: "/listings/567-park-view-court",
262
- title: "Luxury Villa Overlooking City Park",
263
- name: "Park View Villa",
264
- description:
265
- "Luxurious villa overlooking the city park with modern amenities",
266
- address: "567 Park View Court",
267
- suburb: "Parkview",
268
- price: "$2,750,000",
269
- listingType: "House",
270
- thumbnail: {
271
- url: RealEstateListing5,
272
- width: 800,
273
- height: 600,
274
- },
275
- listing_images: [
276
- {
277
- url: RealEstateListing5,
278
- alt: "Front view of the villa",
279
- width: 1920,
280
- height: 1080,
281
- },
282
- {
283
- url: RealEstateListing6,
284
- alt: "Park view from terrace",
285
- width: 1920,
286
- height: 1080,
287
- },
288
- {
289
- url: RealEstateListing1,
290
- alt: "Infinity pool",
291
- width: 1920,
292
- height: 1080,
293
- },
294
- {
295
- url: RealEstateListing2,
296
- alt: "Entertainment area",
297
- width: 1920,
298
- height: 1080,
299
- },
300
- ],
301
- },
302
- {
303
- id: "listing6",
304
- agent: getRandomAgent(),
305
- url: "/listings/890-garden-heights",
306
- title: "Grand Estate with Manicured Gardens",
307
- name: "Garden Heights Estate",
308
- description: "Sprawling estate with manicured gardens and pool",
309
- address: "890 Garden Heights Road",
310
- suburb: "Garden Heights",
311
- price: "$3,250,000",
312
- listingType: "House",
313
- thumbnail: {
314
- url: RealEstateListing6,
315
- width: 800,
316
- height: 600,
317
- },
318
- listing_images: [
319
- {
320
- url: RealEstateListing6,
321
- alt: "Front view of the estate",
322
- width: 1920,
323
- height: 1080,
324
- },
325
- {
326
- url: RealEstateListing1,
327
- alt: "Manicured gardens",
328
- width: 1920,
329
- height: 1080,
330
- },
331
- {
332
- url: RealEstateListing2,
333
- alt: "Swimming pool",
334
- width: 1920,
335
- height: 1080,
336
- },
337
- {
338
- url: RealEstateListing3,
339
- alt: "Grand entrance",
340
- width: 1920,
341
- height: 1080,
342
- },
343
- ],
344
- },
345
- ];
346
-
347
- export const mockUserData = {
348
- userName: "Alex Chen",
349
- userEmail: "alex.chen@example.com",
350
- userAvatarUrl: RealEstateAvatar,
351
- };
352
-
353
- export const mockAgentData = {
354
- agentName: "${agentName}",
355
- roleTitle: "${agentRoleTitle}",
356
- phoneNumber: "${agentPhoneNumber}",
357
- emailAddress: "${agentEmailAddress}",
358
- branch: "${agentBranch}",
359
- };
@@ -1,4 +0,0 @@
1
- import { prepareDesignEditor } from "@canva/intents/design";
2
- import designEditor from "./intents/design_editor";
3
-
4
- prepareDesignEditor(designEditor);
@@ -1,44 +0,0 @@
1
- import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
2
- import React from "react";
3
- import {
4
- MemoryRouter as Router,
5
- Navigate,
6
- Route,
7
- Routes,
8
- } from "react-router-dom";
9
- import * as styles from "styles/components.css";
10
- import { AgentDetailsPage } from "../../pages/agent_details_page/agent_details_page";
11
- import { ListPage } from "../../pages/list_page/list_page";
12
- import { ListingDetailsPage as ListingDetailsPage } from "../../pages/listing_details_page/listing_details_page";
13
- import { LoadingPage } from "../../pages/loading_page/loading_page";
14
- import { OfficeSelectionPage } from "../../pages/office_selection_page/office_selection_page";
15
-
16
- const queryClient = new QueryClient({
17
- defaultOptions: {
18
- queries: {
19
- refetchOnWindowFocus: false,
20
- staleTime: 1000 * 60 * 1, // 1 minute
21
- retryOnMount: false,
22
- retry: false,
23
- },
24
- },
25
- });
26
-
27
- export function App() {
28
- return (
29
- <QueryClientProvider client={queryClient}>
30
- <Router>
31
- <div className={styles.scrollContainer}>
32
- <Routes>
33
- <Route path="/" element={<Navigate to="/entry" replace />} />
34
- <Route path="/entry" element={<OfficeSelectionPage />} />
35
- <Route path="/loading" element={<LoadingPage />} />
36
- <Route path="/list/:tab?" element={<ListPage />} />
37
- <Route path="/details/listing" element={<ListingDetailsPage />} />
38
- <Route path="/details/agent" element={<AgentDetailsPage />} />
39
- </Routes>
40
- </div>
41
- </Router>
42
- </QueryClientProvider>
43
- );
44
- }
@@ -1,25 +0,0 @@
1
- import "@canva/app-ui-kit/styles.css";
2
- import { AppI18nProvider } from "@canva/app-i18n-kit";
3
- import { AppUiProvider } from "@canva/app-ui-kit";
4
- import type { DesignEditorIntent } from "@canva/intents/design";
5
- import { createRoot } from "react-dom/client";
6
- import { App } from "./app";
7
-
8
- async function render() {
9
- const root = createRoot(document.getElementById("root") as Element);
10
-
11
- root.render(
12
- <AppI18nProvider>
13
- <AppUiProvider>
14
- <App />
15
- </AppUiProvider>
16
- </AppI18nProvider>,
17
- );
18
- }
19
-
20
- const designEditor: DesignEditorIntent = { render };
21
- export default designEditor;
22
-
23
- if (module.hot) {
24
- module.hot.accept("./app", render);
25
- }
@@ -1,175 +0,0 @@
1
- import {
2
- ArrowLeftIcon,
3
- Box,
4
- Button,
5
- Column,
6
- Columns,
7
- ImageCard,
8
- Rows,
9
- Text,
10
- TypographyCard,
11
- } from "@canva/app-ui-kit";
12
- import { useIntl } from "react-intl";
13
- import { useLocation, useNavigate } from "react-router-dom";
14
- import type { Agent } from "../../real_estate.type";
15
- import { useAddElement } from "../../util/use_add_element";
16
- import { useDragElement } from "../../util/use_drag_element";
17
-
18
- export const AgentDetailsPage = () => {
19
- const navigate = useNavigate();
20
- const agent = (useLocation().state as { agent: Agent })?.agent;
21
- const intl = useIntl();
22
-
23
- const { addText, addImage } = useAddElement();
24
-
25
- const { dragText, dragImage } = useDragElement();
26
-
27
- if (!agent) {
28
- navigate(-1);
29
- }
30
-
31
- return (
32
- <Box paddingY="2u" height="full">
33
- <Rows spacing="2u">
34
- <Columns spacing="1u" alignY="center">
35
- <Column width="content">
36
- <Button
37
- icon={ArrowLeftIcon}
38
- size="small"
39
- type="button"
40
- variant="tertiary"
41
- onClick={() => navigate(-1)}
42
- />
43
- </Column>
44
- <Column>
45
- <Text variant="bold">
46
- {intl.formatMessage({
47
- defaultMessage: "Agent Details",
48
- description: "Page title for agent details page",
49
- })}
50
- </Text>
51
- </Column>
52
- </Columns>
53
-
54
- <Rows spacing="2u">
55
- {agent.headshots && (
56
- <Box>
57
- <Rows spacing="1u">
58
- <Text variant="bold">
59
- {intl.formatMessage({
60
- defaultMessage: "Headshots",
61
- description: "Label for agent headshots section",
62
- })}
63
- </Text>
64
- <Columns spacing="2u" alignY="stretch">
65
- {agent.headshots.map((headshot, index) => (
66
- <Column key={index} width="1/2">
67
- <ImageCard
68
- selectable
69
- thumbnailUrl={headshot.url}
70
- alt={intl.formatMessage({
71
- defaultMessage: "Agent photo",
72
- description: "Alt text for agent photo",
73
- })}
74
- thumbnailHeight={150}
75
- onClick={async () => {
76
- await addImage(
77
- headshot.url,
78
- intl.formatMessage({
79
- defaultMessage: "Agent photo",
80
- description: "Alt text for agent photo",
81
- }),
82
- );
83
- }}
84
- onDragStart={(e) => {
85
- dragImage(
86
- e,
87
- headshot.url,
88
- intl.formatMessage({
89
- defaultMessage: "Agent photo",
90
- description: "Alt text for agent photo",
91
- }),
92
- headshot.width,
93
- headshot.height,
94
- );
95
- }}
96
- />
97
- </Column>
98
- ))}
99
- </Columns>
100
- </Rows>
101
- </Box>
102
- )}
103
-
104
- <Rows spacing="2u">
105
- <Box>
106
- <Rows spacing="1u">
107
- <Text variant="bold">
108
- {intl.formatMessage({
109
- defaultMessage: "Name",
110
- description: "Label for agent name field",
111
- })}
112
- </Text>
113
- <TypographyCard
114
- ariaLabel={intl.formatMessage({
115
- defaultMessage: "Add agent name to design",
116
- description:
117
- "Accessibility label for adding agent name to design",
118
- })}
119
- onClick={() => addText(agent.name)}
120
- onDragStart={(e) => dragText(e, agent.name)}
121
- >
122
- <Text>{agent.name}</Text>
123
- </TypographyCard>
124
- </Rows>
125
- </Box>
126
-
127
- <Box>
128
- <Rows spacing="1u">
129
- <Text variant="bold">
130
- {intl.formatMessage({
131
- defaultMessage: "Title",
132
- description: "Label for agent role title field",
133
- })}
134
- </Text>
135
- <TypographyCard
136
- ariaLabel={intl.formatMessage({
137
- defaultMessage: "Add agent title to design",
138
- description:
139
- "Accessibility label for adding agent title to design",
140
- })}
141
- onClick={() => addText(agent.roleTitle || "")}
142
- onDragStart={(e) => dragText(e, agent.roleTitle || "")}
143
- >
144
- <Text>{agent.roleTitle}</Text>
145
- </TypographyCard>
146
- </Rows>
147
- </Box>
148
-
149
- <Box>
150
- <Rows spacing="0.5u">
151
- <Text variant="bold">
152
- {intl.formatMessage({
153
- defaultMessage: "Phone number",
154
- description: "Label for agent phone number field",
155
- })}
156
- </Text>
157
- <TypographyCard
158
- ariaLabel={intl.formatMessage({
159
- defaultMessage: "Add agent phone to design",
160
- description:
161
- "Accessibility label for adding agent phone to design",
162
- })}
163
- onClick={() => addText(agent.phoneNumber || "")}
164
- onDragStart={(e) => dragText(e, agent.phoneNumber || "")}
165
- >
166
- <Text>{agent.phoneNumber}</Text>
167
- </TypographyCard>
168
- </Rows>
169
- </Box>
170
- </Rows>
171
- </Rows>
172
- </Rows>
173
- </Box>
174
- );
175
- };