@canva/cli 1.9.0 → 1.11.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 (88) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/cli.js +472 -463
  3. package/lib/cjs/index.cjs +2 -2
  4. package/lib/esm/index.mjs +2 -2
  5. package/lib/index.d.ts +2 -0
  6. package/package.json +1 -1
  7. package/templates/base/package.json +3 -3
  8. package/templates/base/styles/components.css +18 -0
  9. package/templates/base/tsconfig.json +5 -3
  10. package/templates/base/utils/backend/base_backend/create.ts +3 -3
  11. package/templates/base/utils/backend/bearer_middleware/bearer_middleware.ts +2 -4
  12. package/templates/base/utils/backend/jwt_middleware/jwt_middleware.ts +2 -4
  13. package/templates/base/webpack.config.ts +1 -1
  14. package/templates/common/.env.template +1 -1
  15. package/templates/common/utils/backend/base_backend/create.ts +3 -3
  16. package/templates/common/utils/backend/jwt_middleware/jwt_middleware.ts +2 -4
  17. package/templates/dam/backend/routers/dam.ts +35 -17
  18. package/templates/dam/canva-app.json +5 -0
  19. package/templates/dam/package.json +4 -3
  20. package/templates/dam/src/index.tsx +3 -21
  21. package/templates/dam/src/intents/design_editor/index.tsx +25 -0
  22. package/templates/dam/tsconfig.json +5 -3
  23. package/templates/dam/utils/backend/base_backend/create.ts +3 -3
  24. package/templates/dam/utils/backend/jwt_middleware/jwt_middleware.ts +2 -4
  25. package/templates/dam/webpack.config.ts +1 -1
  26. package/templates/data_connector/package.json +4 -3
  27. package/templates/data_connector/src/api/data_sources/designs.tsx +1 -1
  28. package/templates/data_connector/src/api/data_sources/templates.tsx +1 -1
  29. package/templates/data_connector/src/components/header.tsx +1 -1
  30. package/templates/data_connector/src/index.tsx +2 -66
  31. package/templates/data_connector/src/{app.tsx → intents/data_connector/app.tsx} +3 -3
  32. package/templates/data_connector/src/{entrypoint.tsx → intents/data_connector/entrypoint.tsx} +5 -5
  33. package/templates/data_connector/src/{home.tsx → intents/data_connector/home.tsx} +1 -1
  34. package/templates/data_connector/src/intents/data_connector/index.tsx +56 -0
  35. package/templates/data_connector/src/pages/error.tsx +1 -1
  36. package/templates/data_connector/src/pages/login.tsx +1 -1
  37. package/templates/data_connector/src/routes/protected_route.tsx +1 -1
  38. package/templates/data_connector/src/routes/routes.tsx +3 -3
  39. package/templates/data_connector/src/utils/data_table.ts +2 -1
  40. package/templates/data_connector/src/utils/tests/data_table.test.ts +2 -2
  41. package/templates/data_connector/styles/components.css +18 -0
  42. package/templates/data_connector/tsconfig.json +5 -3
  43. package/templates/data_connector/webpack.config.ts +1 -1
  44. package/templates/gen_ai/backend/routers/image.ts +4 -6
  45. package/templates/gen_ai/canva-app.json +5 -0
  46. package/templates/gen_ai/package.json +5 -3
  47. package/templates/gen_ai/src/components/footer.tsx +1 -1
  48. package/templates/gen_ai/src/components/image_grid.tsx +6 -2
  49. package/templates/gen_ai/src/components/loading_results.tsx +1 -1
  50. package/templates/gen_ai/src/components/prompt_input.tsx +5 -2
  51. package/templates/gen_ai/src/index.tsx +3 -14
  52. package/templates/gen_ai/src/{app.tsx → intents/design_editor/app.tsx} +3 -3
  53. package/templates/gen_ai/src/{home.tsx → intents/design_editor/home.tsx} +1 -1
  54. package/templates/gen_ai/src/intents/design_editor/index.tsx +17 -0
  55. package/templates/gen_ai/src/pages/error.tsx +1 -1
  56. package/templates/gen_ai/src/routes/routes.tsx +2 -2
  57. package/templates/gen_ai/styles/components.css +18 -0
  58. package/templates/gen_ai/tsconfig.json +5 -3
  59. package/templates/gen_ai/utils/backend/base_backend/create.ts +3 -3
  60. package/templates/gen_ai/utils/backend/bearer_middleware/bearer_middleware.ts +2 -4
  61. package/templates/gen_ai/webpack.config.ts +1 -1
  62. package/templates/hello_world/canva-app.json +5 -0
  63. package/templates/hello_world/package.json +5 -3
  64. package/templates/hello_world/src/index.tsx +3 -21
  65. package/templates/hello_world/src/{app.tsx → intents/design_editor/app.tsx} +26 -3
  66. package/templates/hello_world/src/intents/design_editor/index.tsx +25 -0
  67. package/templates/hello_world/src/{tests → intents/design_editor/tests}/app.tests.tsx +20 -14
  68. package/templates/hello_world/styles/components.css +18 -0
  69. package/templates/hello_world/tsconfig.json +5 -3
  70. package/templates/hello_world/webpack.config.ts +1 -1
  71. package/templates/optional/AGENTS.md +80 -2
  72. package/templates/optional/CLAUDE.md +80 -2
  73. package/templates/base/utils/use_add_element.ts +0 -48
  74. package/templates/base/utils/use_feature_support.ts +0 -28
  75. package/templates/common/utils/table_wrapper.ts +0 -477
  76. package/templates/common/utils/use_add_element.ts +0 -48
  77. package/templates/common/utils/use_feature_support.ts +0 -28
  78. package/templates/common/utils/use_overlay_hook.ts +0 -74
  79. package/templates/common/utils/use_selection_hook.ts +0 -37
  80. package/templates/hello_world/utils/use_add_element.ts +0 -48
  81. package/templates/hello_world/utils/use_feature_support.ts +0 -28
  82. /package/templates/dam/src/{adapter.ts → intents/design_editor/adapter.ts} +0 -0
  83. /package/templates/dam/src/{app.tsx → intents/design_editor/app.tsx} +0 -0
  84. /package/templates/dam/src/{config.ts → intents/design_editor/config.ts} +0 -0
  85. /package/templates/dam/src/{index.css → intents/design_editor/index.css} +0 -0
  86. /package/templates/data_connector/src/{paths.ts → routes/paths.ts} +0 -0
  87. /package/templates/gen_ai/src/{paths.ts → routes/paths.ts} +0 -0
  88. /package/templates/hello_world/src/{tests → intents/design_editor/tests}/__snapshots__/app.tests.tsx.snap +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.11.0 - 2025-12-08
4
+
5
+ ### Changed
6
+
7
+ - Updated all app templates to use intents and put prepare statements in src/intents/[intent]/index.tsx
8
+ - Updated the [design editor intent migration](https://www.canva.dev/docs/apps/upgrades-and-migrations/design-editor-migration-guide/) to move code into a new `src/intents/design_editor` structure
9
+ - Updated `canva apps preview` command to support selecting between multiple intents.
10
+ - Replaced the usage of `use_add_element` hook in app templates with a more accurate inline implementation.
11
+ - Replaced the usage of React utility hooks from `utils` directory in app templates with our brand new [@canva/app-hooks](https://www.npmjs.com/package/@canva/app-hooks) SDK.
12
+ - Updated v2 sdk codemod to import `useFeatureSupport` hook from `@canva/app-hooks` instead of pasting its source code.
13
+ - Updated apps sdk v2 codemod to better handle feature support for element adding.
14
+ - Updated the intents check for the apps doctor command to support the recommended intent code structure.
15
+
16
+ ## v1.10.0 - 2025-11-19
17
+
18
+ ### Changed
19
+
20
+ - Make `tsconfig` stricter to increase runtime type safety.
21
+
22
+ ### Fixed
23
+
24
+ - Removed incorrect `node_modules/@types/` include from tsconfig.json.
25
+
3
26
  ## v1.9.0 - 2025-11-13
4
27
 
5
28
  ### Added