@tekki-forge/runtime-admin 0.2.0 → 0.3.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/admin-dashboard.d.ts +16 -0
- package/dist/admin-dashboard.js +60 -0
- package/dist/admin-dashboard.js.map +1 -0
- package/dist/admin-orgs.d.ts +14 -0
- package/dist/admin-orgs.js +75 -0
- package/dist/admin-orgs.js.map +1 -0
- package/dist/admin-shell.d.ts +55 -0
- package/dist/admin-shell.js +141 -0
- package/dist/admin-shell.js.map +1 -0
- package/dist/admin.js +35 -4
- package/dist/admin.js.map +1 -1
- package/dist/app-pages.d.ts +19 -0
- package/dist/app-pages.js +109 -0
- package/dist/app-pages.js.map +1 -0
- package/dist/auth-pages.js +7 -2
- package/dist/auth-pages.js.map +1 -1
- package/dist/charts.d.ts +98 -2
- package/dist/charts.js +264 -24
- package/dist/charts.js.map +1 -1
- package/dist/context.js +32 -1
- package/dist/context.js.map +1 -1
- package/dist/dashboard.d.ts +63 -8
- package/dist/dashboard.js +180 -36
- package/dist/dashboard.js.map +1 -1
- package/dist/i18n/messages/de.js +751 -0
- package/dist/i18n/messages/de.js.map +1 -1
- package/dist/i18n/messages/en.js +751 -0
- package/dist/i18n/messages/en.js.map +1 -1
- package/dist/i18n/messages/es.js +751 -0
- package/dist/i18n/messages/es.js.map +1 -1
- package/dist/i18n/messages/fr.js +751 -0
- package/dist/i18n/messages/fr.js.map +1 -1
- package/dist/i18n/messages/pt.js +751 -0
- package/dist/i18n/messages/pt.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/shell.js +37 -34
- package/dist/shell.js.map +1 -1
- package/dist/site/editor/api.d.ts +74 -0
- package/dist/site/editor/api.js +93 -0
- package/dist/site/editor/api.js.map +1 -0
- package/dist/site/editor/content-page.d.ts +4 -0
- package/dist/site/editor/content-page.js +65 -0
- package/dist/site/editor/content-page.js.map +1 -0
- package/dist/site/editor/inbox-tab.d.ts +4 -0
- package/dist/site/editor/inbox-tab.js +88 -0
- package/dist/site/editor/inbox-tab.js.map +1 -0
- package/dist/site/editor/index.d.ts +1 -0
- package/dist/site/editor/index.js +3 -0
- package/dist/site/editor/index.js.map +1 -0
- package/dist/site/editor/model.d.ts +145 -0
- package/dist/site/editor/model.js +408 -0
- package/dist/site/editor/model.js.map +1 -0
- package/dist/site/editor/page-editor.d.ts +10 -0
- package/dist/site/editor/page-editor.js +257 -0
- package/dist/site/editor/page-editor.js.map +1 -0
- package/dist/site/editor/page-settings.d.ts +9 -0
- package/dist/site/editor/page-settings.js +105 -0
- package/dist/site/editor/page-settings.js.map +1 -0
- package/dist/site/editor/pages-tab.d.ts +5 -0
- package/dist/site/editor/pages-tab.js +108 -0
- package/dist/site/editor/pages-tab.js.map +1 -0
- package/dist/site/editor/posts-tab.d.ts +6 -0
- package/dist/site/editor/posts-tab.js +139 -0
- package/dist/site/editor/posts-tab.js.map +1 -0
- package/dist/site/editor/preview.d.ts +32 -0
- package/dist/site/editor/preview.js +104 -0
- package/dist/site/editor/preview.js.map +1 -0
- package/dist/site/editor/prop-fields.d.ts +53 -0
- package/dist/site/editor/prop-fields.js +233 -0
- package/dist/site/editor/prop-fields.js.map +1 -0
- package/dist/site/editor/section-list.d.ts +14 -0
- package/dist/site/editor/section-list.js +110 -0
- package/dist/site/editor/section-list.js.map +1 -0
- package/dist/site/editor/section-picker.d.ts +12 -0
- package/dist/site/editor/section-picker.js +44 -0
- package/dist/site/editor/section-picker.js.map +1 -0
- package/dist/site/editor/widgets.d.ts +84 -0
- package/dist/site/editor/widgets.js +130 -0
- package/dist/site/editor/widgets.js.map +1 -0
- package/dist/site/format.d.ts +31 -0
- package/dist/site/format.js +106 -0
- package/dist/site/format.js.map +1 -0
- package/dist/site/forms.d.ts +43 -0
- package/dist/site/forms.js +155 -0
- package/dist/site/forms.js.map +1 -0
- package/dist/site/header.d.ts +32 -0
- package/dist/site/header.js +76 -0
- package/dist/site/header.js.map +1 -0
- package/dist/site/icons.d.ts +10 -0
- package/dist/site/icons.js +28 -0
- package/dist/site/icons.js.map +1 -0
- package/dist/site/index.d.ts +11 -0
- package/dist/site/index.js +13 -0
- package/dist/site/index.js.map +1 -0
- package/dist/site/markdown.d.ts +14 -0
- package/dist/site/markdown.js +457 -0
- package/dist/site/markdown.js.map +1 -0
- package/dist/site/page.d.ts +16 -0
- package/dist/site/page.js +65 -0
- package/dist/site/page.js.map +1 -0
- package/dist/site/proxy.d.ts +13 -0
- package/dist/site/proxy.js +43 -0
- package/dist/site/proxy.js.map +1 -0
- package/dist/site/sections.d.ts +43 -0
- package/dist/site/sections.js +560 -0
- package/dist/site/sections.js.map +1 -0
- package/dist/site/server.d.ts +73 -0
- package/dist/site/server.js +235 -0
- package/dist/site/server.js.map +1 -0
- package/dist/site/types.d.ts +137 -0
- package/dist/site/types.js +2 -0
- package/dist/site/types.js.map +1 -0
- package/dist/support.d.ts +29 -0
- package/dist/support.js +165 -0
- package/dist/support.js.map +1 -0
- package/dist/system-config.d.ts +24 -0
- package/dist/system-config.js +37 -0
- package/dist/system-config.js.map +1 -0
- package/dist/system-settings.d.ts +9 -0
- package/dist/system-settings.js +60 -0
- package/dist/system-settings.js.map +1 -0
- package/dist/theme-catalog.d.ts +72 -2
- package/dist/theme-catalog.js +47 -0
- package/dist/theme-catalog.js.map +1 -1
- package/dist/theme-switcher.d.ts +8 -0
- package/dist/theme-switcher.js +39 -4
- package/dist/theme-switcher.js.map +1 -1
- package/dist/theme.js +8 -0
- package/dist/theme.js.map +1 -1
- package/dist/transactions.d.ts +4 -0
- package/dist/transactions.js +60 -0
- package/dist/transactions.js.map +1 -0
- package/package.json +9 -5
- package/styles.css +1089 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SITE_RESERVED_SEGMENTS } from "@tekki-forge/compiler/site";
|
|
2
|
+
const cache = new WeakMap();
|
|
3
|
+
/** First path segments that belong to the app (never the website): reserved routes, entity lists, plugin pages. */
|
|
4
|
+
export function appSegments(app) {
|
|
5
|
+
const known = cache.get(app);
|
|
6
|
+
if (known)
|
|
7
|
+
return known;
|
|
8
|
+
const segments = new Set([
|
|
9
|
+
...SITE_RESERVED_SEGMENTS,
|
|
10
|
+
...app.entities.map((e) => e.path.replace(/^\//, "").split("/")[0]),
|
|
11
|
+
...app.plugins.flatMap((p) => [...p.reservedPaths, ...p.nav.map((n) => n.path)].map((path) => path.replace(/^\//, "").split("/")[0])),
|
|
12
|
+
]);
|
|
13
|
+
cache.set(app, segments);
|
|
14
|
+
return segments;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Where proxy.ts rewrites `pathname` (null: leave the request alone).
|
|
18
|
+
* - Without `site`: `/` for signed-out visitors → `/welcome` when the legacy landing page is on; nothing else changes.
|
|
19
|
+
* - `/` → `/site` for signed-out visitors (signed-in people keep their dashboard).
|
|
20
|
+
* - `<blog base>/rss.xml` → `/site-feed/<kind>`.
|
|
21
|
+
* - Any other path whose first segment is not the app's (sign-in, admin, API, entity and plugin pages) → `/site<path>`.
|
|
22
|
+
* Static files (a dot in the last segment) are left alone.
|
|
23
|
+
*/
|
|
24
|
+
export function siteProxyTarget(app, pathname, signedIn) {
|
|
25
|
+
if (!app.site)
|
|
26
|
+
return pathname === "/" && app.landing && !signedIn ? "/welcome" : null;
|
|
27
|
+
if (pathname === "/" || pathname === "")
|
|
28
|
+
return signedIn ? null : "/site";
|
|
29
|
+
const path = pathname.length > 1 ? pathname.replace(/\/+$/, "") : pathname;
|
|
30
|
+
for (const [kind, base] of Object.entries(app.site.blog)) {
|
|
31
|
+
if (base && path === `${base}/rss.xml`)
|
|
32
|
+
return `/site-feed/${kind}`;
|
|
33
|
+
}
|
|
34
|
+
const segments = path.split("/").filter(Boolean);
|
|
35
|
+
if (!segments.length)
|
|
36
|
+
return null;
|
|
37
|
+
if (appSegments(app).has(segments[0]))
|
|
38
|
+
return null;
|
|
39
|
+
if (segments[segments.length - 1].includes("."))
|
|
40
|
+
return null;
|
|
41
|
+
return `/site${path}`;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../src/site/proxy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AASpE,MAAM,KAAK,GAAG,IAAI,OAAO,EAAuB,CAAC;AAEjD,mHAAmH;AACnH,MAAM,UAAU,WAAW,CAAC,GAAmB;IAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACxB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAS;QAC/B,GAAG,sBAAsB;QACzB,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;QACpE,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC;KACvI,CAAC,CAAC;IACH,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACzB,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;GAOG;AACH,MAA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2
|
+
import type { Messages } from "../i18n/locale.js";
|
|
3
|
+
import { type SiteFormLabels } from "./forms.js";
|
|
4
|
+
import { type SiteT } from "./format.js";
|
|
5
|
+
import type { SectionData, SiteApp, SiteSectionData } from "./types.js";
|
|
6
|
+
export interface SectionContext {
|
|
7
|
+
app: SiteApp;
|
|
8
|
+
section: SiteSectionData;
|
|
9
|
+
data?: SectionData;
|
|
10
|
+
lang: string;
|
|
11
|
+
t: SiteT;
|
|
12
|
+
/** Editor preview: forms don't send, hidden sections show. */
|
|
13
|
+
preview: boolean;
|
|
14
|
+
/** This section opens the page (a hero then carries the page's h1). */
|
|
15
|
+
first: boolean;
|
|
16
|
+
/** Path of the page (contact/newsletter source). */
|
|
17
|
+
pagePath?: string;
|
|
18
|
+
}
|
|
19
|
+
/** Every word of the forms, translated here (the forms are client components). */
|
|
20
|
+
export declare function siteFormLabels(t: SiteT): SiteFormLabels;
|
|
21
|
+
/** Section types the website renders (every type of SECTION_SPECS). */
|
|
22
|
+
export declare const SITE_SECTION_TYPES: string[];
|
|
23
|
+
/** One section inside a page (the page has built the translator). Hidden sections show only in previews, marked. */
|
|
24
|
+
export declare function renderSection(ctx: SectionContext): ReactNode;
|
|
25
|
+
export interface SiteSectionViewProps {
|
|
26
|
+
app: SiteApp;
|
|
27
|
+
section: SiteSectionData;
|
|
28
|
+
/** Resolved data (live stats, records, posts, plans); defaults to `section.data`. */
|
|
29
|
+
data?: SectionData;
|
|
30
|
+
locale?: string;
|
|
31
|
+
messages?: Record<string, Messages>;
|
|
32
|
+
/** Editor preview: forms are disabled, hidden sections are shown (marked). */
|
|
33
|
+
preview?: boolean;
|
|
34
|
+
/** The section opens the page (a hero then renders the page's h1). */
|
|
35
|
+
first?: boolean;
|
|
36
|
+
/** Path of the page the section belongs to. */
|
|
37
|
+
pagePath?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* One section on its own (the admin editor's live preview). Wrapped in a `@container` so its layout follows the
|
|
41
|
+
* width it is given, exactly like the page at that width.
|
|
42
|
+
*/
|
|
43
|
+
export declare function SiteSectionView({ app: baseApp, section, data, locale, messages, preview, first, pagePath }: SiteSectionViewProps): import("react").JSX.Element;
|