@void/vue 0.7.6 → 0.7.7

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.
@@ -31,8 +31,8 @@ declare function useForm<U extends ActionUrl & string>(url: U, defaults: Resolve
31
31
  put(opts?: FormSubmitOptions): Promise<void>;
32
32
  patch(opts?: FormSubmitOptions): Promise<void>;
33
33
  delete(opts?: FormSubmitOptions): Promise<void>;
34
- reset(...fields: Array<keyof ResolveActionBody<U> & string>): void;
35
- clearErrors(...fields: Array<keyof ResolveActionBody<U> & string>): void;
34
+ reset(...fields: ReadonlyArray<keyof ResolveActionBody<U> & string>): void;
35
+ clearErrors(...fields: ReadonlyArray<keyof ResolveActionBody<U> & string>): void;
36
36
  clearError(): void;
37
37
  };
38
38
  //#endregion
@@ -40,7 +40,7 @@ declare function useForm<U extends ActionUrl & string>(url: U, defaults: Resolve
40
40
  declare function useNavigation(): NavigationState;
41
41
  //#endregion
42
42
  //#region src/runtime/use-island-form.d.ts
43
- interface IslandFormReturn<T extends Record<string, unknown>> {
43
+ type IslandFormReturn<T extends Record<string, unknown>> = Readonly<{
44
44
  data: T;
45
45
  errors: Record<string, string>;
46
46
  error: VoidActionError | null;
@@ -53,10 +53,10 @@ interface IslandFormReturn<T extends Record<string, unknown>> {
53
53
  put(url: string): Promise<void>;
54
54
  patch(url: string): Promise<void>;
55
55
  delete(url: string): Promise<void>;
56
- reset(...fields: Array<keyof T & string>): void;
57
- clearErrors(...fields: Array<string>): void;
56
+ reset(...fields: ReadonlyArray<keyof T & string>): void;
57
+ clearErrors(...fields: ReadonlyArray<string>): void;
58
58
  clearError(): void;
59
- }
59
+ }>;
60
60
  /**
61
61
  * Form composable for island pages. Uses fetch + page reload instead of the
62
62
  * Void Router (which is not available in island mode).
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as useIslandForm, c as useShared, d as Link, i as setActionRouter, l as useParams, n as InferProps, o as useNavigation, r as action, s as useForm, t as Deferred, u as useRouter } from "./index-DjrFKwuZ.mjs";
1
+ import { a as useIslandForm, c as useShared, d as Link, i as setActionRouter, l as useParams, n as InferProps, o as useNavigation, r as action, s as useForm, t as Deferred, u as useRouter } from "./index-B-rddAws.mjs";
2
2
  export { Deferred, InferProps, Link, action, setActionRouter, useForm, useIslandForm, useNavigation, useParams, useRouter, useShared };
package/dist/plugin.d.mts CHANGED
@@ -2,10 +2,10 @@ import vue from "@vitejs/plugin-vue";
2
2
  import { Plugin } from "vite";
3
3
 
4
4
  //#region src/plugin.d.ts
5
- interface VoidVueOptions {
5
+ type VoidVueOptions = Readonly<{
6
6
  vue?: Parameters<typeof vue>[0];
7
7
  viewTransitions?: boolean;
8
- }
9
- declare function voidVue(options?: VoidVueOptions): Array<Plugin>;
8
+ }>;
9
+ declare function voidVue(options?: VoidVueOptions): ReadonlyArray<Plugin>;
10
10
  //#endregion
11
11
  export { VoidVueOptions, voidVue };
package/dist/plugin.mjs CHANGED
@@ -187,17 +187,17 @@ function islandsPlugin(pagesDir) {
187
187
  pageScan = await scanPages(root);
188
188
  const importAttrRe = /import\s+\w+\s+from\s+("[^"]+"|'[^']+')\s+with\s*\{\s*island\s*:\s*("[^"]+"|'[^']+')\s*\}/g;
189
189
  const filesToScan = [
190
- ...pageScan.pages.map((p) => ({
191
- filePath: p.componentPath,
192
- island: p.island
190
+ ...pageScan.pages.map((page) => ({
191
+ filePath: page.componentPath,
192
+ island: page.island
193
193
  })),
194
- ...pageScan.layouts.map((l) => ({
195
- filePath: l.filePath,
196
- island: l.island
194
+ ...pageScan.layouts.map((layout) => ({
195
+ filePath: layout.filePath,
196
+ island: layout.island
197
197
  })),
198
- ...pageScan.namedLayouts.map((nl) => ({
199
- filePath: nl.filePath,
200
- island: nl.island
198
+ ...pageScan.namedLayouts.map((namedLayout) => ({
199
+ filePath: namedLayout.filePath,
200
+ island: namedLayout.island
201
201
  }))
202
202
  ];
203
203
  for (const entry of filesToScan) {
@@ -206,10 +206,10 @@ function islandsPlugin(pagesDir) {
206
206
  const code = readFileSync(filePath, "utf-8");
207
207
  const importerDir = dirname(filePath);
208
208
  importAttrRe.lastIndex = 0;
209
- let m;
210
- while ((m = importAttrRe.exec(code)) !== null) {
211
- const spec = m[1].slice(1, -1);
212
- const strategy = m[2].slice(1, -1);
209
+ let importMatch;
210
+ while ((importMatch = importAttrRe.exec(code)) !== null) {
211
+ const spec = importMatch[1].slice(1, -1);
212
+ const strategy = importMatch[2].slice(1, -1);
213
213
  const absPath = resolveSpecifier(spec, importerDir, COMPONENT_EXTENSIONS);
214
214
  if (absPath) {
215
215
  const islandId = normalizePath(relative(root, absPath)).replace(/\.[^.]+$/, "");
@@ -248,7 +248,7 @@ function islandsPlugin(pagesDir) {
248
248
  handler(id) {
249
249
  if (id === "\0" + ISLANDS_RENDERER_ID) {
250
250
  if (!pageScan) return "export function renderIslandPage() { throw new Error('No pages found'); }";
251
- const mdPlugin = resolvedConfig?.plugins?.find((p) => p.name === "void-md");
251
+ const mdPlugin = resolvedConfig?.plugins?.find((plugin) => plugin.name === "void-md");
252
252
  const mdScriptIds = new Set(mdPlugin?.api?.getClientScripts?.()?.keys() ?? []);
253
253
  const needsJS = computePagesNeedingClientJS$1();
254
254
  return generateIslandRenderer(pageScan, pagesDir, mdScriptIds, needsJS);
@@ -1,2 +1,2 @@
1
- import { a as useIslandForm, c as useShared, d as Link, i as setActionRouter, l as useParams, n as InferProps, o as useNavigation, r as action, s as useForm, t as Deferred, u as useRouter } from "../index-DjrFKwuZ.mjs";
1
+ import { a as useIslandForm, c as useShared, d as Link, i as setActionRouter, l as useParams, n as InferProps, o as useNavigation, r as action, s as useForm, t as Deferred, u as useRouter } from "../index-B-rddAws.mjs";
2
2
  export { Deferred, InferProps, Link, action, setActionRouter, useForm, useIslandForm, useNavigation, useParams, useRouter, useShared };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@void/vue",
3
- "version": "0.7.6",
3
+ "version": "0.7.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/voidzero-dev/void.git",
@@ -44,12 +44,12 @@
44
44
  "vite": "npm:@voidzero-dev/vite-plus-core@0.1.20",
45
45
  "vite-plus": "^0.1.20",
46
46
  "vue": "^3.5.34",
47
- "void": "0.7.6"
47
+ "void": "0.7.7"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "vite": "npm:@voidzero-dev/vite-plus-core@0.1.20",
51
51
  "vue": "^3.5.0",
52
- "void": "0.7.6"
52
+ "void": "0.7.7"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "vp pack",