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.
- package/dist/templates.d.ts.map +1 -1
- package/dist/templates.js +10 -0
- package/dist/templates.js.map +1 -1
- package/package.json +1 -1
- package/templates/next-ssr/_package.json +4 -3
- package/templates/next-ssr/app/page.tsx +4 -4
- package/templates/next-ssr/app/providers.tsx +16 -6
- package/templates/react-dvp/README.md +128 -0
- package/templates/react-dvp/_gitignore +8 -0
- package/templates/react-dvp/_package.json +26 -0
- package/templates/react-dvp/index.html +12 -0
- package/templates/react-dvp/src/App.css +385 -0
- package/templates/react-dvp/src/App.tsx +110 -0
- package/templates/react-dvp/src/context/DemoContext.tsx +34 -0
- package/templates/react-dvp/src/index.css +23 -0
- package/templates/react-dvp/src/lib/backend.ts +144 -0
- package/templates/react-dvp/src/lib/fixtures.ts +113 -0
- package/templates/react-dvp/src/lib/format.ts +59 -0
- package/templates/react-dvp/src/lib/invalidate.ts +18 -0
- package/templates/react-dvp/src/lib/match.ts +28 -0
- package/templates/react-dvp/src/lib/mutation.ts +17 -0
- package/templates/react-dvp/src/lib/store.ts +332 -0
- package/templates/react-dvp/src/lib/types.ts +35 -0
- package/templates/react-dvp/src/main.tsx +18 -0
- package/templates/react-dvp/src/sections/Holdings.tsx +51 -0
- package/templates/react-dvp/src/sections/MyAllocations.tsx +79 -0
- package/templates/react-dvp/src/sections/Trades.tsx +298 -0
- package/templates/react-dvp/src/ui/primitives.tsx +91 -0
- package/templates/react-dvp/tsconfig.json +20 -0
- package/templates/react-dvp/vite.config.ts +7 -0
- package/templates/react-tokenization/README.md +133 -0
- package/templates/react-tokenization/_gitignore +8 -0
- package/templates/react-tokenization/_package.json +26 -0
- package/templates/react-tokenization/index.html +12 -0
- package/templates/react-tokenization/src/App.css +361 -0
- package/templates/react-tokenization/src/App.tsx +111 -0
- package/templates/react-tokenization/src/context/DemoContext.tsx +34 -0
- package/templates/react-tokenization/src/index.css +23 -0
- package/templates/react-tokenization/src/lib/backend.ts +171 -0
- package/templates/react-tokenization/src/lib/fixtures.ts +134 -0
- package/templates/react-tokenization/src/lib/format.ts +59 -0
- package/templates/react-tokenization/src/lib/invalidate.ts +23 -0
- package/templates/react-tokenization/src/lib/mutation.ts +17 -0
- package/templates/react-tokenization/src/lib/store.ts +219 -0
- package/templates/react-tokenization/src/lib/types.ts +27 -0
- package/templates/react-tokenization/src/main.tsx +18 -0
- package/templates/react-tokenization/src/sections/Allocations.tsx +150 -0
- package/templates/react-tokenization/src/sections/Holdings.tsx +51 -0
- package/templates/react-tokenization/src/sections/Incoming.tsx +107 -0
- package/templates/react-tokenization/src/sections/Issuer.tsx +177 -0
- package/templates/react-tokenization/src/sections/Transfer.tsx +112 -0
- package/templates/react-tokenization/src/ui/primitives.tsx +91 -0
- package/templates/react-tokenization/tsconfig.json +20 -0
- package/templates/react-tokenization/vite.config.ts +7 -0
- package/templates/react-vite/_package.json +3 -2
- package/templates/react-vite/src/App.tsx +1 -1
- package/templates/react-vite/src/main.tsx +11 -1
- package/templates/vanilla/_package.json +1 -1
- package/templates/vue-nuxt-pinia/_package.json +4 -3
- package/templates/vue-nuxt-pinia/app.vue +2 -2
- 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
|
|
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({
|