webspresso 0.0.111 → 0.0.112
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/core/client/adapter/datastar.js +119 -30
- package/core/client/controller.js +120 -11
- package/core/client/forms.js +124 -10
- package/core/client/fragments.js +255 -95
- package/core/client/host.js +5 -1
- package/core/client/lite.js +1 -1
- package/core/client/server-fragments.js +43 -1
- package/index.d.ts +12 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -6429,6 +6429,7 @@ export interface ClientTask<TData = any, TArgs extends unknown[] = any[]> {
|
|
|
6429
6429
|
readonly error: ClientRequestError | Error | null;
|
|
6430
6430
|
readonly stale: boolean;
|
|
6431
6431
|
readonly lastUpdatedAt: number;
|
|
6432
|
+
readonly lastArgs: TArgs;
|
|
6432
6433
|
isStale(): boolean;
|
|
6433
6434
|
run(...args: TArgs): Promise<TData | undefined>;
|
|
6434
6435
|
cancel(): void;
|
|
@@ -6737,8 +6738,12 @@ export interface ClientFormHandle<
|
|
|
6737
6738
|
readonly services: ClientServicesRegistry<TServices>;
|
|
6738
6739
|
readonly pending: boolean;
|
|
6739
6740
|
readonly dirty: boolean;
|
|
6741
|
+
readonly inputRevision: number;
|
|
6742
|
+
readonly draftKey: string;
|
|
6743
|
+
readonly baseline: TValues;
|
|
6740
6744
|
readonly errors: Record<string, string>;
|
|
6741
|
-
readonly formError: string;
|
|
6745
|
+
readonly formError: string | null;
|
|
6746
|
+
readonly lastError: ClientRequestError | Error | null;
|
|
6742
6747
|
readonly fieldErrors: Partial<Record<keyof TValues & string, string>> & Record<string, string>;
|
|
6743
6748
|
disabled: boolean;
|
|
6744
6749
|
values(): TValues;
|
|
@@ -6754,8 +6759,12 @@ export interface ClientFormHandle<
|
|
|
6754
6759
|
saveDraft(): boolean;
|
|
6755
6760
|
restoreDraft(): boolean;
|
|
6756
6761
|
clearDraft(): boolean;
|
|
6762
|
+
setDraftKey(nextKey: string, options?: { restore?: boolean }): this;
|
|
6757
6763
|
readonly hasDraft: boolean;
|
|
6758
6764
|
submit(submitter?: HTMLElement | null | Record<string, unknown>): Promise<ClientFormSubmitResult<TResponse>>;
|
|
6765
|
+
beforeSubmit(
|
|
6766
|
+
callback: (values: TValues, meta: { form: ClientFormHandle<TValues, TResponse, TServices>; submitter?: HTMLElement | null; action: string; method: string }) => boolean | Promise<boolean>
|
|
6767
|
+
): () => void;
|
|
6759
6768
|
onSuccess(
|
|
6760
6769
|
callback: (data: TResponse, meta: ClientFormHookMeta<TValues, TResponse, TServices>) => void | Promise<void>
|
|
6761
6770
|
): () => void;
|
|
@@ -6886,7 +6895,9 @@ export interface ControllerContext<
|
|
|
6886
6895
|
readonly lastError: Error | null;
|
|
6887
6896
|
clearError(): void;
|
|
6888
6897
|
readonly storage: ClientStorage & { readonly global: ClientStorage; readonly root: ClientStorage };
|
|
6898
|
+
readonly persistenceConflicts: Array<Record<string, unknown>>;
|
|
6889
6899
|
clearPersistedState(): void;
|
|
6900
|
+
retryFailedFragments(): Promise<FragmentRefreshResult>;
|
|
6890
6901
|
onError(listener: (err: Error, meta?: ControllerErrorMeta) => void): () => void;
|
|
6891
6902
|
task<TData = any, TArgs extends unknown[] = any[]>(
|
|
6892
6903
|
runFn: (...args: TArgs) => Promise<TData>,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webspresso",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"description": "Minimal, production-ready SSR framework for Node.js with file-based routing, Nunjucks templating, built-in i18n, and CLI tooling",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|