create-partylayer-app 0.4.0 → 0.5.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 (61) hide show
  1. package/dist/templates.d.ts.map +1 -1
  2. package/dist/templates.js +10 -0
  3. package/dist/templates.js.map +1 -1
  4. package/package.json +1 -1
  5. package/templates/next-ssr/_package.json +4 -3
  6. package/templates/next-ssr/app/page.tsx +4 -4
  7. package/templates/next-ssr/app/providers.tsx +16 -6
  8. package/templates/react-dvp/README.md +128 -0
  9. package/templates/react-dvp/_gitignore +8 -0
  10. package/templates/react-dvp/_package.json +26 -0
  11. package/templates/react-dvp/index.html +12 -0
  12. package/templates/react-dvp/src/App.css +385 -0
  13. package/templates/react-dvp/src/App.tsx +110 -0
  14. package/templates/react-dvp/src/context/DemoContext.tsx +34 -0
  15. package/templates/react-dvp/src/index.css +23 -0
  16. package/templates/react-dvp/src/lib/backend.ts +144 -0
  17. package/templates/react-dvp/src/lib/fixtures.ts +113 -0
  18. package/templates/react-dvp/src/lib/format.ts +59 -0
  19. package/templates/react-dvp/src/lib/invalidate.ts +18 -0
  20. package/templates/react-dvp/src/lib/match.ts +28 -0
  21. package/templates/react-dvp/src/lib/mutation.ts +17 -0
  22. package/templates/react-dvp/src/lib/store.ts +332 -0
  23. package/templates/react-dvp/src/lib/types.ts +35 -0
  24. package/templates/react-dvp/src/main.tsx +18 -0
  25. package/templates/react-dvp/src/sections/Holdings.tsx +51 -0
  26. package/templates/react-dvp/src/sections/MyAllocations.tsx +79 -0
  27. package/templates/react-dvp/src/sections/Trades.tsx +298 -0
  28. package/templates/react-dvp/src/ui/primitives.tsx +91 -0
  29. package/templates/react-dvp/tsconfig.json +20 -0
  30. package/templates/react-dvp/vite.config.ts +7 -0
  31. package/templates/react-tokenization/README.md +133 -0
  32. package/templates/react-tokenization/_gitignore +8 -0
  33. package/templates/react-tokenization/_package.json +26 -0
  34. package/templates/react-tokenization/index.html +12 -0
  35. package/templates/react-tokenization/src/App.css +361 -0
  36. package/templates/react-tokenization/src/App.tsx +111 -0
  37. package/templates/react-tokenization/src/context/DemoContext.tsx +34 -0
  38. package/templates/react-tokenization/src/index.css +23 -0
  39. package/templates/react-tokenization/src/lib/backend.ts +171 -0
  40. package/templates/react-tokenization/src/lib/fixtures.ts +134 -0
  41. package/templates/react-tokenization/src/lib/format.ts +59 -0
  42. package/templates/react-tokenization/src/lib/invalidate.ts +23 -0
  43. package/templates/react-tokenization/src/lib/mutation.ts +17 -0
  44. package/templates/react-tokenization/src/lib/store.ts +219 -0
  45. package/templates/react-tokenization/src/lib/types.ts +27 -0
  46. package/templates/react-tokenization/src/main.tsx +18 -0
  47. package/templates/react-tokenization/src/sections/Allocations.tsx +150 -0
  48. package/templates/react-tokenization/src/sections/Holdings.tsx +51 -0
  49. package/templates/react-tokenization/src/sections/Incoming.tsx +107 -0
  50. package/templates/react-tokenization/src/sections/Issuer.tsx +177 -0
  51. package/templates/react-tokenization/src/sections/Transfer.tsx +112 -0
  52. package/templates/react-tokenization/src/ui/primitives.tsx +91 -0
  53. package/templates/react-tokenization/tsconfig.json +20 -0
  54. package/templates/react-tokenization/vite.config.ts +7 -0
  55. package/templates/react-vite/_package.json +3 -2
  56. package/templates/react-vite/src/App.tsx +1 -1
  57. package/templates/react-vite/src/main.tsx +11 -1
  58. package/templates/vanilla/_package.json +1 -1
  59. package/templates/vue-nuxt-pinia/_package.json +4 -3
  60. package/templates/vue-nuxt-pinia/app.vue +2 -2
  61. package/templates/vue-nuxt-pinia/plugins/partylayer.client.ts +9 -1
@@ -1,14 +1,22 @@
1
+ import { VueQueryPlugin } from '@tanstack/vue-query';
1
2
  import { createPartyLayer } from '@partylayer/sdk';
2
3
  import { createPartyLayerSession } from '@partylayer/vue';
3
4
  import { createCookieStorage } from '@partylayer/session';
4
5
 
5
6
  /**
6
7
  * Client-only plugin: create the PartyLayer client and provide the session store
7
- * app-wide. cookieStorage on the client uses document.cookie — the SAME cookie
8
+ * app-wide. cookieStorage on the client uses document.cookie, the SAME cookie
8
9
  * the server reads for SSR (lib/session.ts). The connected/wallet UI is
9
10
  * client-side; the server-rendered party comes from the cookie directly.
11
+ *
12
+ * VueQueryPlugin supplies the QueryClient that PartyLayer's data composables
13
+ * (useDamlContract, useChoice, the cost composables) build on. It is registered
14
+ * client-side here, so there is no SSR query state to dehydrate; the base session
15
+ * composables work without it, but it is set up so the query composables are
16
+ * ready when you reach for them. For SSR query prefetch, see the Nuxt SSR guide.
10
17
  */
11
18
  export default defineNuxtPlugin((nuxtApp) => {
19
+ nuxtApp.vueApp.use(VueQueryPlugin);
12
20
  const client = createPartyLayer({ network: 'devnet', app: { name: '{{PROJECT_NAME}}' } });
13
21
  nuxtApp.vueApp.use(
14
22
  createPartyLayerSession({