pagiera 0.2.0-alpha.33 → 0.2.0-alpha.37

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/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Pagiera
2
2
 
3
- ![Pagiera visual website builder](./thumbnail.png)
3
+ [![Pagiera visual website builder](https://raw.githubusercontent.com/voilabs/pagiera/main/packages/pagiera/thumbnail.png)](https://pagiera.com)
4
+
5
+ [Website](https://pagiera.com) · [GitHub](https://github.com/voilabs/pagiera) · [Issues](https://github.com/voilabs/pagiera/issues)
4
6
 
5
7
  Pagiera is a full-stack visual website builder for React and Next.js. It ships the editor, responsive canvas, page management, reusable components, templates, AI generation, server-side data fetching, publishing runtime, PostgreSQL persistence, and Redis caching as one installable package.
6
8
 
@@ -24,6 +26,7 @@ Design in the editor and render the same document on the server. Published pages
24
26
  - Draft preview and published page rendering
25
27
  - PostgreSQL persistence and optimistic revisions
26
28
  - Redis-backed publishing cache and AI rate limiting
29
+ - GitHub-backed template catalog with browser caching and offline fallbacks
27
30
  - Semantic output including `main`, `section`, `nav`, `header`, `footer`, headings, links, paragraphs, and buttons
28
31
 
29
32
  ## Requirements
@@ -70,6 +73,8 @@ Pagiera creates its required PostgreSQL tables when the server initializes. Redi
70
73
 
71
74
  `full.css` contains the complete studio UI. Use `pagiera/styles.css` only with the smaller `PagieraEditor` API.
72
75
 
76
+ Pagiera uses `@fontsource-variable/figtree` for its editor chrome, including Latin and Latin Extended glyphs. The host application does not need to configure an editor font.
77
+
73
78
  ### 2. Add the font provider
74
79
 
75
80
  The provider makes `next/font` fonts available in **Typography → Site font**. A selection applies to the canvas, preview, and published site.
@@ -78,6 +83,7 @@ The provider makes `next/font` fonts available in **Typography → Site font**.
78
83
  // src/app/layout.tsx
79
84
  import { Geist, Geist_Mono } from "next/font/google";
80
85
  import { PagieraProvider } from "pagiera/provider";
86
+ import type { ReactNode } from "react";
81
87
  import "./globals.css";
82
88
 
83
89
  const geistSans = Geist({
@@ -90,7 +96,7 @@ const geistMono = Geist_Mono({
90
96
  subsets: ["latin"],
91
97
  });
92
98
 
93
- export default function RootLayout({ children }: LayoutProps<"/">) {
99
+ export default function RootLayout({ children }: { children: ReactNode }) {
94
100
  return (
95
101
  <html lang="en">
96
102
  <body>
@@ -311,6 +317,27 @@ export default async function PublishedPage({ params, searchParams }: {
311
317
  }
312
318
  ```
313
319
 
320
+ ## Template registry
321
+
322
+ The editor reads its catalog from the public Pagiera repository by default:
323
+
324
+ ```text
325
+ https://raw.githubusercontent.com/voilabs/pagiera/main/templates/registry.json
326
+ ```
327
+
328
+ This is a static GitHub Raw/CDN request, not the rate-limited GitHub REST API. Registry and template responses are cached in memory and `localStorage` for 15 minutes. The refresh button bypasses the local TTL, and the package keeps bundled fallback entries for offline use.
329
+
330
+ You may point the studio at a fork, branch, or private proxy:
331
+
332
+ ```tsx
333
+ <PagieraStudio
334
+ {...props}
335
+ templateRegistryUrl="https://example.com/pagiera/registry.json"
336
+ />
337
+ ```
338
+
339
+ New templates live under the repository's `templates/` directory. They can be released independently from npm package versions. See [`templates/README.md`](https://github.com/voilabs/pagiera/blob/main/templates/README.md) for the registry schema and contribution workflow.
340
+
314
341
  ## Dynamic routes and request data
315
342
 
316
343
  Page slugs may contain named parameters:
@@ -507,10 +534,10 @@ Use `server.getPublishedPage(...)` or `loadPageData(...)` in a Server Component
507
534
 
508
535
  ## Local package example
509
536
 
510
- This repository includes `package-example`, a standalone consumer that installs the generated `.tgz` instead of importing package source files.
537
+ This repository includes `apps/example`, a standalone workspace consumer of the package.
511
538
 
512
539
  ```bash
513
- cd package-example
540
+ cd apps/example
514
541
  cp .env.example .env.local
515
542
  bun install
516
543
  bun run dev
package/dist/client.d.ts CHANGED
@@ -12,7 +12,7 @@ export declare function createPagieraClient(options?: PagieraClientOptions): {
12
12
  renamePage: (id: string, name: string, slug: string) => Promise<any>;
13
13
  duplicatePage: (id: string, name: string, slug: string) => Promise<any>;
14
14
  deletePage: (id: string) => Promise<any>;
15
- installTemplate: (id: string) => Promise<any>;
15
+ installTemplate: (template: unknown) => Promise<any>;
16
16
  publishPage: (id: string) => Promise<any>;
17
17
  unpublishPage: (id: string) => Promise<any>;
18
18
  previewSource: (source: unknown, sampleQuery: string) => Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CACnC,CAAC;AAYF,sDAAsD;AACtD,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB;yBAOzC,MAAM;uBACR,MAAM;;uBAEN,MAAM,YAAY,OAAO,mBAAmB,MAAM;2BAC9C,MAAM,QAAQ,MAAM;yBACtB,MAAM,QAAQ,MAAM,QAAQ,MAAM;4BAC/B,MAAM,QAAQ,MAAM,QAAQ,MAAM;yBACrC,MAAM;8BACD,MAAM;0BACV,MAAM;4BACJ,MAAM;gCACF,OAAO,eAAe,MAAM;4BAChC,OAAO;;EAGtC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CACnC,CAAC;AAYF,sDAAsD;AACtD,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB;yBAOzC,MAAM;uBACR,MAAM;;uBAEN,MAAM,YAAY,OAAO,mBAAmB,MAAM;2BAC9C,MAAM,QAAQ,MAAM;yBACtB,MAAM,QAAQ,MAAM,QAAQ,MAAM;4BAC/B,MAAM,QAAQ,MAAM,QAAQ,MAAM;yBACrC,MAAM;oCACK,OAAO;0BAGjB,MAAM;4BACJ,MAAM;gCACF,OAAO,eAAe,MAAM;4BAChC,OAAO;;EAGtC"}
package/dist/client.js CHANGED
@@ -22,7 +22,9 @@ export function createPagieraClient(options = {}) {
22
22
  renamePage: (id, name, slug) => call(`/pages/${id}`, "PATCH", { name, slug }),
23
23
  duplicatePage: (id, name, slug) => call(`/pages/${id}/duplicate`, "POST", { name, slug }),
24
24
  deletePage: (id) => call(`/pages/${id}`, "DELETE"),
25
- installTemplate: (id) => call(`/templates/${id}`, "POST"),
25
+ installTemplate: (template) => typeof template === "string"
26
+ ? call(`/templates/${template}`, "POST")
27
+ : call("/templates/install", "POST", { template }),
26
28
  publishPage: (id) => call(`/pages/${id}/publish`, "POST"),
27
29
  unpublishPage: (id) => call(`/pages/${id}/unpublish`, "POST"),
28
30
  previewSource: (source, sampleQuery) => call("/data/preview", "POST", { source, sampleQuery }),
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,KAAK,UAAU,WAAW,CAAC,OAAgC,EAAE,GAAW,EAAE,IAAkB;IACxF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE;QAChC,GAAG,IAAI;QACP,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;KACpE,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,IAAI,+BAA+B,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IACpG,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,mBAAmB,CAAC,UAAgC,EAAE;IAClE,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,cAAc,CA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id: string, name: string, slug: string): Promise<PagieraMutationResult>;
35
35
  deletePage?(id: string): Promise<PagieraMutationResult>;
36
- installTemplate?(id: "nocturne" | "editorial-blog" | "orbit-saas"): Promise<PagieraMutationResult>;
36
+ installTemplate?(template: string | { schemaVersion: 1; id: string; version: string; pages: unknown[] }): Promise<PagieraMutationResult>;
37
37
  publishPage?(id: string): Promise<PagieraMutationResult>;
38
38
  unpublishPage?(id: string, slug: string): Promise<PagieraMutationResult>;
39
39
  navigate?(pageId: string, options?: { replace?: boolean }): void | Promise<void>;
@@ -47,6 +47,7 @@ export type PagieraStudioProps = {
47
47
  pages: Array<{ id: string; name: string; slug: string; published?: boolean }>;
48
48
  library: unknown[];
49
49
  adapters: PagieraStudioAdapters;
50
+ templateRegistryUrl?: string;
50
51
  };
51
52
 
52
53
  export const PagieraStudio: ComponentType<PagieraStudioProps>;