@zaptek/application-livel 0.16.4 → 0.16.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @zaptek/application-livel
2
2
 
3
+ ## 0.16.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @zaptek/resource@0.8.0
9
+
10
+ ## 0.16.5
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [7f5ba1d]
15
+ - Updated dependencies [7f5ba1d]
16
+ - @zaptek/resource@0.7.0
17
+
3
18
  ## 0.16.4
4
19
 
5
20
  ### Patch Changes
@@ -72,7 +87,6 @@
72
87
  Breaking: data tables are gone. `useEntries`, `useEntry`, `useCreateEntry`, `useUpdateEntry`, `useDeleteEntry`, `useTable`, `useTables`, the `@zaptek/application-zadie/data` and `/codegen` entrypoints and `src/zadie-tables.gen.ts` are removed. Files hooks paginate as `PaginatedData` of `@zaptek/resource` (`page_size`, `current_page`).
73
88
 
74
89
  Migration of an existing application:
75
-
76
90
  1. Add `@zaptek/resource` and `drizzle-orm` to the application's dependencies, at the versions of the template.
77
91
  2. Call `developApplication`: Zadie writes `src/zadie-objects.gen.ts` with the workspace's objects. Delete `src/zadie-tables.gen.ts`.
78
92
  3. For each table the application read, declare a resource in `src/lib/resources/<object>.resource.ts` with `defineResource` on the generated table (see `docs/data.md`), then replace `useEntries(slug, { where })` by `Resource.useList(filters)`, `useEntry` by `Resource.useDetail`, `useCreateEntry`, `useUpdateEntry` and `useDeleteEntry` by `Resource.useCreate`, `useUpdate` and `useDelete`. A field of `entry.data.x` becomes the column `row.x` (`x_cents` for an amount, `x_id` for a relation).
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useId, useRef } from "react";
2
+ import { useId, useRef, } from "react";
3
3
  import { getCompletedUploads, useUploadFiles, } from "../../hooks/files.hooks.js";
4
4
  import { useLivelApplication } from "../livel-application.provider.js";
5
5
  /** Lets the user select files and uploads them through Livel's file service. */
@@ -37,5 +37,6 @@ export function FileUploadButton({ accept, multiple = false, uploadOptions, onUp
37
37
  }
38
38
  }, children: upload.isPending
39
39
  ? "Envoi en cours…"
40
- : (children ?? (multiple ? "Ajouter des fichiers" : "Ajouter un fichier")) }), _jsx("input", { ref: inputRef, type: 'file', accept: accept, multiple: multiple, disabled: isDisabled, hidden: true, tabIndex: -1, "aria-hidden": 'true', onChange: event => void handleFileChange(event) }), upload.isError && (_jsxs("span", { id: errorId, role: 'alert', children: ["Impossible d\u2019envoyer ", multiple ? "les fichiers" : "le fichier", "."] }))] }));
40
+ : (children ??
41
+ (multiple ? "Ajouter des fichiers" : "Ajouter un fichier")) }), _jsx("input", { ref: inputRef, type: 'file', accept: accept, multiple: multiple, disabled: isDisabled, hidden: true, tabIndex: -1, "aria-hidden": 'true', onChange: event => void handleFileChange(event) }), upload.isError && (_jsxs("span", { id: errorId, role: 'alert', children: ["Impossible d\u2019envoyer ", multiple ? "les fichiers" : "le fichier", "."] }))] }));
41
42
  }
@@ -1,4 +1,4 @@
1
- export { FileDownloadButton } from "./file-download-button.component.js";
2
1
  export type { FileDownloadButtonProps } from "./file-download-button.component.js";
3
- export { FileUploadButton } from "./file-upload-button.component.js";
2
+ export { FileDownloadButton } from "./file-download-button.component.js";
4
3
  export type { FileUploadButtonProps } from "./file-upload-button.component.js";
4
+ export { FileUploadButton } from "./file-upload-button.component.js";
@@ -1,4 +1,4 @@
1
+ export type { FileDownloadButtonProps, FileUploadButtonProps, } from "./files/index.js";
2
+ export { FileDownloadButton, FileUploadButton } from "./files/index.js";
1
3
  export { LivelApplicationProvider } from "./livel-application.provider.js";
2
4
  export { LivelDataConnectionStatus } from "./livel-data-connection-status.component.js";
3
- export { FileDownloadButton, FileUploadButton } from "./files/index.js";
4
- export type { FileDownloadButtonProps, FileUploadButtonProps, } from "./files/index.js";
@@ -1,3 +1,3 @@
1
+ export { FileDownloadButton, FileUploadButton } from "./files/index.js";
1
2
  export { LivelApplicationProvider } from "./livel-application.provider.js";
2
3
  export { LivelDataConnectionStatus } from "./livel-data-connection-status.component.js";
3
- export { FileDownloadButton, FileUploadButton } from "./files/index.js";
@@ -1,6 +1,6 @@
1
1
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
2
- import { useLivelApplication } from "../components/livel-application.provider.js";
3
2
  import { buildPaginatedResponse } from "@zaptek/resource";
3
+ import { useLivelApplication } from "../components/livel-application.provider.js";
4
4
  import { useRpcQuery } from "./rpc.hooks.js";
5
5
  function normalizePagination(options) {
6
6
  const page = Number.isInteger(options.page) && options.page > 0 ? options.page : 1;
@@ -1,6 +1,6 @@
1
- export { useReportError, useLivelApplication, } from "../components/livel-application.provider.js";
2
1
  export type { LivelApplicationState, LivelApplicationStatus, } from "../components/livel-application.provider.js";
3
- export { useRpcQuery } from "./rpc.hooks.js";
4
- export type { RpcQueryOptions } from "./rpc.hooks.js";
5
- export { getCompletedUploads, useChangeFileVisibility, useDeleteFiles, useDownloadFile, useFile, useFileDownloadUrl, useFiles, useUpdateFile, useUploadFiles, } from "./files.hooks.js";
2
+ export { useLivelApplication, useReportError, } from "../components/livel-application.provider.js";
6
3
  export type { ChangeFileVisibilityInput, FileFilters, FileRecord, PaginationOptions, UpdateFileInput, UploadedFile, UploadFilesInput, } from "./files.hooks.js";
4
+ export { getCompletedUploads, useChangeFileVisibility, useDeleteFiles, useDownloadFile, useFile, useFileDownloadUrl, useFiles, useUpdateFile, useUploadFiles, } from "./files.hooks.js";
5
+ export type { RpcQueryOptions } from "./rpc.hooks.js";
6
+ export { useRpcQuery } from "./rpc.hooks.js";
@@ -1,3 +1,3 @@
1
- export { useReportError, useLivelApplication, } from "../components/livel-application.provider.js";
2
- export { useRpcQuery } from "./rpc.hooks.js";
1
+ export { useLivelApplication, useReportError, } from "../components/livel-application.provider.js";
3
2
  export { getCompletedUploads, useChangeFileVisibility, useDeleteFiles, useDownloadFile, useFile, useFileDownloadUrl, useFiles, useUpdateFile, useUploadFiles, } from "./files.hooks.js";
3
+ export { useRpcQuery } from "./rpc.hooks.js";
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { createLivelApplicationClient, readLivelApplicationConfig, } from "./client/livel-application-client.js";
2
1
  export type { LivelApplicationClient, LivelApplicationConfig, } from "./client/livel-application-client.js";
2
+ export { createLivelApplicationClient, readLivelApplicationConfig, } from "./client/livel-application-client.js";
3
+ export type { LivelDevError, LivelDevErrorEvent, } from "./dev/dev-errors.contract.js";
4
+ export { livelDevErrorsPath } from "./dev/dev-errors.contract.js";
3
5
  export { createEmbeddedHost } from "./host/embedded-host.js";
4
- export type { LivelHost } from "./host/livel-host.js";
5
6
  export type { LivelApplicationError, LivelHostMethods, } from "./host/livel-host.contract.js";
6
- export { createRpcCaller } from "./rpc/rpc-caller.js";
7
+ export type { LivelHost } from "./host/livel-host.js";
7
8
  export type { RpcCaller, RpcCallerOptions } from "./rpc/rpc-caller.js";
8
- export { livelDevErrorsPath } from "./dev/dev-errors.contract.js";
9
- export type { LivelDevError, LivelDevErrorEvent, } from "./dev/dev-errors.contract.js";
9
+ export { createRpcCaller } from "./rpc/rpc-caller.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export { createLivelApplicationClient, readLivelApplicationConfig, } from "./client/livel-application-client.js";
2
+ export { livelDevErrorsPath } from "./dev/dev-errors.contract.js";
2
3
  export { createEmbeddedHost } from "./host/embedded-host.js";
3
4
  export { createRpcCaller } from "./rpc/rpc-caller.js";
4
- export { livelDevErrorsPath } from "./dev/dev-errors.contract.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaptek/application-livel",
3
- "version": "0.16.4",
3
+ "version": "0.16.6",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "UNLICENSED",
@@ -42,7 +42,7 @@
42
42
  "@orpc/client": "^1.16.2",
43
43
  "@supabase/supabase-js": "^2.114.0",
44
44
  "penpal": "^8.0.1",
45
- "@zaptek/resource": "0.6.0"
45
+ "@zaptek/resource": "0.8.0"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@tanstack/react-query": "^5.90.21",
@@ -17,8 +17,8 @@
17
17
  },
18
18
  "packageManager": "pnpm@10.34.0",
19
19
  "dependencies": {
20
- "@zaptek/application-livel": "0.16.4",
21
- "@zaptek/resource": "0.6.0",
20
+ "@zaptek/application-livel": "0.16.6",
21
+ "@zaptek/resource": "0.8.0",
22
22
  "@tanstack/react-query": "catalog:",
23
23
  "zod": "catalog:",
24
24
  "@base-ui/react": "catalog:",