@risali/react 0.6.2 → 0.8.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/README.md +2 -2
- package/dist/fonts.d.ts +13 -0
- package/dist/fonts.d.ts.map +1 -0
- package/dist/fonts.js +57 -0
- package/dist/fonts.js.map +1 -0
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +22 -1
- package/dist/page.js.map +1 -1
- package/dist/sections/blocks.d.ts +13 -2
- package/dist/sections/blocks.d.ts.map +1 -1
- package/dist/sections/blocks.js +27 -11
- package/dist/sections/blocks.js.map +1 -1
- package/dist/sections/index.d.ts.map +1 -1
- package/dist/sections/index.js +356 -41
- package/dist/sections/index.js.map +1 -1
- package/dist/sections/tokens.d.ts +55 -0
- package/dist/sections/tokens.d.ts.map +1 -0
- package/dist/sections/tokens.js +159 -0
- package/dist/sections/tokens.js.map +1 -0
- package/dist/style.d.ts +7 -0
- package/dist/style.d.ts.map +1 -1
- package/dist/style.js +43 -2
- package/dist/style.js.map +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -141,9 +141,9 @@ export function HomePage({ content }: { content: RisaliContent | null }) {
|
|
|
141
141
|
|
|
142
142
|
Helpers always validate the block type (a block typed `image` will return `defaultValue` from `getBlockValue`) and `getBlockRichText` always sanitises — including the fallback HTML — so a stored XSS payload can't reach the browser even if the block is missing.
|
|
143
143
|
|
|
144
|
-
### Builder pages (v0.
|
|
144
|
+
### Builder pages (v0.7.0)
|
|
145
145
|
|
|
146
|
-
A page with `render_mode='builder'` in the Risali dashboard is a DB-driven list of sections
|
|
146
|
+
A page with `render_mode='builder'` in the Risali dashboard is a DB-driven list of sections. Built-in section types: `hero`, `text_image`, `features`, `gallery`, `cta`, `contact`, `plain`, plus (v0.7.0) `testimonials`, `pricing`, `faq`, `stats`, `team` and `logo_cloud`. Every section is styled inline from the brand palette (gradients / shadows / radius derived via `color-mix()` from `--risali-color-*`) and is responsive without media queries, so it looks designed even without the host app's Tailwind theme. `<RisaliPage>` renders the whole page server-side; pages still in `code` mode return `notFound`, so a catch-all route coexists with your static routes:
|
|
147
147
|
|
|
148
148
|
```tsx
|
|
149
149
|
// app/[[...rest]]/page.tsx
|
package/dist/fonts.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const RISALI_FONT_FAMILIES: Record<string, string>;
|
|
2
|
+
/** CSS font stack for a catalog font id, or undefined if not in the catalog. */
|
|
3
|
+
export declare function fontStackForId(id: unknown): string | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Self-hosted stylesheet URL for a catalog font id. `base` (derived from a
|
|
6
|
+
* brand font's css_url so it follows the real dashboard origin) is used when it
|
|
7
|
+
* looks like a `…/fonts/` URL, else the production default.
|
|
8
|
+
*/
|
|
9
|
+
export declare function fontCssUrlForId(id: string, base?: string): string | undefined;
|
|
10
|
+
/** Derive the `…/fonts/` base from a brand font's css_url (e.g.
|
|
11
|
+
* "https://app.risali.app/fonts/inter.css" → "https://app.risali.app/fonts/"). */
|
|
12
|
+
export declare function fontBaseFromCssUrl(cssUrl: unknown): string | undefined;
|
|
13
|
+
//# sourceMappingURL=fonts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../src/fonts.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAiBvD,CAAC;AASF,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAI9D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI7E;AAED;kFACkF;AAClF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAItE"}
|
package/dist/fonts.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Minimal mirror of the server FONT_CATALOG (src/lib/brand/fonts.ts) — catalog
|
|
2
|
+
// id → family — for per-element font overrides (full editor). The full editor
|
|
3
|
+
// stores a font as a catalog id in style_overrides.font_family; here we turn it
|
|
4
|
+
// into a CSS font stack + the self-hosted stylesheet URL on the platform
|
|
5
|
+
// origin. Kept in sync MANUALLY with the server catalog (curated + stable;
|
|
6
|
+
// adding a family = append here too). An unknown id resolves to undefined, so
|
|
7
|
+
// it simply renders nothing (falls through to the design font).
|
|
8
|
+
export const RISALI_FONT_FAMILIES = {
|
|
9
|
+
inter: "Inter",
|
|
10
|
+
poppins: "Poppins",
|
|
11
|
+
montserrat: "Montserrat",
|
|
12
|
+
"playfair-display": "Playfair Display",
|
|
13
|
+
lora: "Lora",
|
|
14
|
+
merriweather: "Merriweather",
|
|
15
|
+
"dm-sans": "DM Sans",
|
|
16
|
+
"work-sans": "Work Sans",
|
|
17
|
+
raleway: "Raleway",
|
|
18
|
+
nunito: "Nunito",
|
|
19
|
+
"open-sans": "Open Sans",
|
|
20
|
+
"source-sans-3": "Source Sans 3",
|
|
21
|
+
"cormorant-garamond": "Cormorant Garamond",
|
|
22
|
+
"libre-baskerville": "Libre Baskerville",
|
|
23
|
+
roboto: "Roboto",
|
|
24
|
+
karla: "Karla",
|
|
25
|
+
};
|
|
26
|
+
const ID_RE = /^[a-z0-9-]{1,40}$/;
|
|
27
|
+
// Self-hosted brand fonts live centrally on the dashboard origin (PR 40e,
|
|
28
|
+
// served with Access-Control-Allow-Origin:* for cross-origin client sites).
|
|
29
|
+
const DEFAULT_FONT_BASE = "https://app.risali.app/fonts/";
|
|
30
|
+
const SAFE_BASE_RE = /^https:\/\/[^\s"'<>\\]+\/fonts\/$/;
|
|
31
|
+
/** CSS font stack for a catalog font id, or undefined if not in the catalog. */
|
|
32
|
+
export function fontStackForId(id) {
|
|
33
|
+
if (typeof id !== "string" || !ID_RE.test(id))
|
|
34
|
+
return undefined;
|
|
35
|
+
const family = RISALI_FONT_FAMILIES[id];
|
|
36
|
+
return family ? `"${family}", system-ui, sans-serif` : undefined;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Self-hosted stylesheet URL for a catalog font id. `base` (derived from a
|
|
40
|
+
* brand font's css_url so it follows the real dashboard origin) is used when it
|
|
41
|
+
* looks like a `…/fonts/` URL, else the production default.
|
|
42
|
+
*/
|
|
43
|
+
export function fontCssUrlForId(id, base) {
|
|
44
|
+
if (!RISALI_FONT_FAMILIES[id])
|
|
45
|
+
return undefined;
|
|
46
|
+
const b = typeof base === "string" && SAFE_BASE_RE.test(base) ? base : DEFAULT_FONT_BASE;
|
|
47
|
+
return `${b}${id}.css`;
|
|
48
|
+
}
|
|
49
|
+
/** Derive the `…/fonts/` base from a brand font's css_url (e.g.
|
|
50
|
+
* "https://app.risali.app/fonts/inter.css" → "https://app.risali.app/fonts/"). */
|
|
51
|
+
export function fontBaseFromCssUrl(cssUrl) {
|
|
52
|
+
if (typeof cssUrl !== "string")
|
|
53
|
+
return undefined;
|
|
54
|
+
const m = cssUrl.match(/^(https:\/\/[^\s"'<>\\]+\/fonts\/)[a-z0-9-]+\.css$/);
|
|
55
|
+
return m ? m[1] : undefined;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=fonts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.js","sourceRoot":"","sources":["../src/fonts.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,yEAAyE;AACzE,2EAA2E;AAC3E,8EAA8E;AAC9E,gEAAgE;AAEhE,MAAM,CAAC,MAAM,oBAAoB,GAA2B;IAC1D,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,YAAY;IACxB,kBAAkB,EAAE,kBAAkB;IACtC,IAAI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CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;IAC7E,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9B,CAAC"}
|
package/dist/page.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAC/B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IACxD,gEAAgE;IAChE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,wBAAsB,UAAU,CAAC,KAAK,EAAE,eAAe,+PAiEtD"}
|
package/dist/page.js
CHANGED
|
@@ -14,6 +14,7 @@ import { createElement, Fragment } from "react";
|
|
|
14
14
|
import { getRisaliContent } from "./content.js";
|
|
15
15
|
import { RISALI_SECTION_COMPONENTS, sectionWrapperStyle, } from "./sections/index.js";
|
|
16
16
|
import { sortByPosition } from "./sections/blocks.js";
|
|
17
|
+
import { fontCssUrlForId, fontBaseFromCssUrl } from "./fonts.js";
|
|
17
18
|
export async function RisaliPage(props) {
|
|
18
19
|
const { path, siteSlug, content: providedContent, customSections, notFound } = props;
|
|
19
20
|
const content = providedContent !== undefined
|
|
@@ -25,7 +26,27 @@ export async function RisaliPage(props) {
|
|
|
25
26
|
return notFound ?? null;
|
|
26
27
|
}
|
|
27
28
|
const sections = sortByPosition(content.sections ?? []);
|
|
28
|
-
|
|
29
|
+
// Per-element fonts (full editor): collect the catalog ids used by any block
|
|
30
|
+
// on THIS page (so cross-page font sets never clash) and emit a stylesheet
|
|
31
|
+
// <link> for each, self-hosted on the platform origin. The base follows the
|
|
32
|
+
// brand fonts' css_url when present (real dashboard origin), else the prod
|
|
33
|
+
// default. The block render itself sets font-family from the same catalog.
|
|
34
|
+
const fonts = content.site?.brand?.fonts;
|
|
35
|
+
const fontBase = fontBaseFromCssUrl(fonts?.heading?.css_url) ??
|
|
36
|
+
fontBaseFromCssUrl(fonts?.body?.css_url);
|
|
37
|
+
const usedFontIds = new Set();
|
|
38
|
+
for (const b of content.blocks) {
|
|
39
|
+
const id = b.style_overrides?.font_family;
|
|
40
|
+
if (typeof id === "string")
|
|
41
|
+
usedFontIds.add(id);
|
|
42
|
+
}
|
|
43
|
+
const fontLinks = [];
|
|
44
|
+
for (const id of usedFontIds) {
|
|
45
|
+
const url = fontCssUrlForId(id, fontBase);
|
|
46
|
+
if (url && !fontLinks.includes(url))
|
|
47
|
+
fontLinks.push(url);
|
|
48
|
+
}
|
|
49
|
+
return createElement(Fragment, null, fontLinks.map((href) => createElement("link", { key: href, rel: "stylesheet", href })), sections.map((section) => {
|
|
29
50
|
const Component = customSections?.[section.type] ?? RISALI_SECTION_COMPONENTS[section.type];
|
|
30
51
|
// Unknown type (e.g. a signature section whose component is missing
|
|
31
52
|
// from this deploy) — skip rather than crash the whole page.
|
package/dist/page.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../src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AC,CAAC,IAAI,EAAE,EAAE,CACrB,aAAa,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAC9D,EACD,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACvB,MAAM,SAAS,GACb,cAAc,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,yBAAyB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC5E,oEAAoE;QACpE,6DAA6D;QAC7D,IAAI,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC;QAE5B,MAAM,MAAM,GAAG,cAAc,CAC3B,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,GAAG,CAAC,CACxD,CAAC;QAEF,OAAO,aAAa,CAClB,SAAS,EACT;YACE,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,qBAAqB,EAAE,OAAO,CAAC,GAAG;YAClC,0BAA0B,EAAE,OAAO,CAAC,IAAI;YACxC,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC;SACpC,EACD,aAAa,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAC9C,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
2
2
|
import type { RisaliBlock } from "../types.js";
|
|
3
3
|
export declare function safeButtonHref(href: unknown): string | null;
|
|
4
4
|
/** Sorts builder children by sparse position; blocks without one go last. */
|
|
5
5
|
export declare function sortByPosition<T extends {
|
|
6
6
|
position?: number | null;
|
|
7
7
|
}>(items: readonly T[]): T[];
|
|
8
|
-
|
|
8
|
+
/** A text block rendered as a section heading (an <h2>). */
|
|
9
|
+
export declare function isHeadingBlock(block: RisaliBlock): boolean;
|
|
10
|
+
/** Per-call look tweaks a section can apply to a child it lays out. */
|
|
11
|
+
export type RenderBlockOpts = {
|
|
12
|
+
/** Merged under HEADING_STYLE for `text`/heading blocks. */
|
|
13
|
+
headingStyle?: CSSProperties;
|
|
14
|
+
/** Merged under TEXT_STYLE for plain `text` blocks. */
|
|
15
|
+
textStyle?: CSSProperties;
|
|
16
|
+
/** Merged under IMG_STYLE for `image` blocks (e.g. crop-to-fill a tile). */
|
|
17
|
+
imageStyle?: CSSProperties;
|
|
18
|
+
};
|
|
19
|
+
export declare function renderBlock(block: RisaliBlock, opts?: RenderBlockOpts): ReactNode;
|
|
9
20
|
export declare function renderBlocks(blocks: readonly RisaliBlock[]): ReactNode;
|
|
10
21
|
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/sections/blocks.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/sections/blocks.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAItD,OAAO,KAAK,EAAE,WAAW,EAAuC,MAAM,aAAa,CAAC;AAWpF,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAK3D;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACnE,KAAK,EAAE,SAAS,CAAC,EAAE,GAClB,CAAC,EAAE,CAML;AAED,4DAA4D;AAC5D,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE1D;AAuDD,uEAAuE;AACvE,MAAM,MAAM,eAAe,GAAG;IAC5B,4DAA4D;IAC5D,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,uDAAuD;IACvD,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,4EAA4E;IAC5E,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,SAAS,CAmHjF;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,GAAG,SAAS,CAMtE"}
|
package/dist/sections/blocks.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
// Child-block renderer shared by every builder section (PR 40b).
|
|
1
|
+
// Child-block renderer shared by every builder section (PR 40b; styling L5).
|
|
2
2
|
//
|
|
3
3
|
// Deliberately SYNC (plain createElement, no async components) so the tree
|
|
4
4
|
// returned by an awaited <RisaliPage> can be rendered with
|
|
5
5
|
// react-dom/server's renderToStaticMarkup in tests. Styles use only inline
|
|
6
6
|
// CSS + the --risali-* CSS variables emitted by <RisaliBrand> — zero
|
|
7
7
|
// dependency on the client site's Tailwind setup.
|
|
8
|
+
//
|
|
9
|
+
// renderBlock takes an optional `opts` so a section can tune the look of a
|
|
10
|
+
// child it owns (a hero headline rendered display-size, a stat number, a
|
|
11
|
+
// gallery image cropped to fill a tile) WITHOUT bypassing the single place
|
|
12
|
+
// where data-risali-key markers, href/src whitelisting and user
|
|
13
|
+
// style_overrides are applied. opts is merged UNDER style_overrides, so a
|
|
14
|
+
// client's per-block color / font-size always wins.
|
|
8
15
|
import { createElement, Fragment } from "react";
|
|
9
16
|
import { sanitiseRichText } from "../sanitize.js";
|
|
10
17
|
import { applyStyleOverrides } from "../style.js";
|
|
18
|
+
import { BORDER } from "./tokens.js";
|
|
11
19
|
const SAFE_SRC_RE = /^(https?:\/\/|\/)/;
|
|
12
20
|
// Mirror of src/lib/editor/href.ts on the dashboard side — buttons accept
|
|
13
21
|
// only https://, mailto:, tel: and root-relative paths (never "//", http:,
|
|
@@ -28,33 +36,41 @@ export function sortByPosition(items) {
|
|
|
28
36
|
return [...items].sort((a, b) => (typeof a.position === "number" ? a.position : Number.MAX_SAFE_INTEGER) -
|
|
29
37
|
(typeof b.position === "number" ? b.position : Number.MAX_SAFE_INTEGER));
|
|
30
38
|
}
|
|
39
|
+
/** A text block rendered as a section heading (an <h2>). */
|
|
40
|
+
export function isHeadingBlock(block) {
|
|
41
|
+
return block.type === "text" && block.variant === "heading";
|
|
42
|
+
}
|
|
31
43
|
const HEADING_STYLE = {
|
|
32
44
|
fontFamily: "var(--risali-font-heading, inherit)",
|
|
33
|
-
fontSize: "
|
|
45
|
+
fontSize: "clamp(1.6rem, 1.1rem + 1.4vw, 2rem)",
|
|
34
46
|
lineHeight: 1.2,
|
|
47
|
+
letterSpacing: "-0.02em",
|
|
48
|
+
fontWeight: 700,
|
|
35
49
|
margin: "0 0 0.5em",
|
|
36
50
|
};
|
|
37
51
|
const TEXT_STYLE = {
|
|
52
|
+
lineHeight: 1.65,
|
|
38
53
|
margin: "0 0 1em",
|
|
39
54
|
};
|
|
40
55
|
const IMG_STYLE = {
|
|
41
56
|
maxWidth: "100%",
|
|
42
57
|
height: "auto",
|
|
43
58
|
display: "block",
|
|
44
|
-
borderRadius: "
|
|
59
|
+
borderRadius: "12px",
|
|
45
60
|
};
|
|
46
61
|
const HR_STYLE = {
|
|
47
62
|
border: "none",
|
|
48
|
-
borderTop:
|
|
63
|
+
borderTop: `1px solid ${BORDER}`,
|
|
49
64
|
margin: "1.5em 0",
|
|
50
65
|
};
|
|
51
66
|
const BUTTON_BASE_STYLE = {
|
|
52
67
|
display: "inline-block",
|
|
53
|
-
padding: "0.
|
|
54
|
-
borderRadius: "
|
|
68
|
+
padding: "0.8em 1.6em",
|
|
69
|
+
borderRadius: "10px",
|
|
55
70
|
textDecoration: "none",
|
|
56
71
|
fontWeight: 600,
|
|
57
72
|
cursor: "pointer",
|
|
73
|
+
transition: "opacity 200ms",
|
|
58
74
|
};
|
|
59
75
|
function buttonStyle(variant) {
|
|
60
76
|
if (variant === "secondary") {
|
|
@@ -68,10 +84,10 @@ function buttonStyle(variant) {
|
|
|
68
84
|
return {
|
|
69
85
|
...BUTTON_BASE_STYLE,
|
|
70
86
|
background: "var(--risali-color-primary, #111827)",
|
|
71
|
-
color: "#ffffff",
|
|
87
|
+
color: "var(--risali-on-primary, #ffffff)",
|
|
72
88
|
};
|
|
73
89
|
}
|
|
74
|
-
export function renderBlock(block) {
|
|
90
|
+
export function renderBlock(block, opts) {
|
|
75
91
|
const overrides = block.style_overrides;
|
|
76
92
|
switch (block.type) {
|
|
77
93
|
case "text": {
|
|
@@ -80,13 +96,13 @@ export function renderBlock(block) {
|
|
|
80
96
|
return createElement("h2", {
|
|
81
97
|
key: block.key,
|
|
82
98
|
"data-risali-key": block.key,
|
|
83
|
-
style: applyStyleOverrides(HEADING_STYLE, overrides),
|
|
99
|
+
style: applyStyleOverrides({ ...HEADING_STYLE, ...opts?.headingStyle }, overrides),
|
|
84
100
|
}, value);
|
|
85
101
|
}
|
|
86
102
|
return createElement("p", {
|
|
87
103
|
key: block.key,
|
|
88
104
|
"data-risali-key": block.key,
|
|
89
|
-
style: applyStyleOverrides(TEXT_STYLE, overrides),
|
|
105
|
+
style: applyStyleOverrides({ ...TEXT_STYLE, ...opts?.textStyle }, overrides),
|
|
90
106
|
}, value);
|
|
91
107
|
}
|
|
92
108
|
case "rich_text": {
|
|
@@ -114,7 +130,7 @@ export function renderBlock(block) {
|
|
|
114
130
|
src,
|
|
115
131
|
alt: typeof value.alt === "string" ? value.alt : "",
|
|
116
132
|
loading: "lazy",
|
|
117
|
-
style: IMG_STYLE,
|
|
133
|
+
style: { ...IMG_STYLE, ...opts?.imageStyle },
|
|
118
134
|
});
|
|
119
135
|
}
|
|
120
136
|
case "button": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../src/sections/blocks.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"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EAAqE;YACrE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAA8B;IACzD,OAAO,aAAa,CAClB,QAAQ,EACR,IAAI,EACJ,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAClD,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sections/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sections/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AActD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAkC9D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,aAAa,CAAC;IACvB,+CAA+C;IAC/C,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAC;AAmiB9E,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAc5E,CAAC;AAgBF,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAqCzE"}
|
package/dist/sections/index.js
CHANGED
|
@@ -1,77 +1,358 @@
|
|
|
1
|
-
// Builder section catalog
|
|
2
|
-
// src/lib/sections/catalog.ts in the dashboard repo
|
|
3
|
-
// Keep the `type` keys of the two in sync
|
|
1
|
+
// Builder section catalog v2 (PR 40b; styling + catalog expansion L5) — the
|
|
2
|
+
// render side of src/lib/sections/catalog.ts in the dashboard repo
|
|
3
|
+
// (gallery/defaults). Keep the `type` keys of the two in sync: a type present
|
|
4
|
+
// in one but not the other renders nothing / has no card.
|
|
4
5
|
//
|
|
5
6
|
// Every component is SYNC and content-driven: it lays out the ordered child
|
|
6
|
-
// blocks it receives, nothing more. Signature sections a client repo ships
|
|
7
|
-
//
|
|
8
|
-
//
|
|
7
|
+
// blocks it receives, nothing more. Signature sections a client repo ships in
|
|
8
|
+
// code are passed to <RisaliPage customSections={{...}}> and take precedence
|
|
9
|
+
// over this registry on a type-key collision.
|
|
10
|
+
//
|
|
11
|
+
// Styling is INLINE (see ./tokens.ts for why) + brand-derived, and responsive
|
|
12
|
+
// without media queries via responsiveGrid(). Decorative icons come from
|
|
13
|
+
// lucide-react (fixed per section type, or cycled by index where a per-item
|
|
14
|
+
// icon would otherwise need a data-model change).
|
|
9
15
|
import { createElement } from "react";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
import { Gem, Heart, Quote, Rocket, ShieldCheck, Sparkles, Star, TrendingUp, Users, Zap, } from "lucide-react";
|
|
17
|
+
import { safeColorAlpha } from "../style.js";
|
|
18
|
+
import { isHeadingBlock, renderBlock, renderBlocks, sortByPosition, } from "./blocks.js";
|
|
19
|
+
import { BORDER, buttonRowStyle, cardStyle, CONTAINER_STYLE, C_PRIMARY, DISPLAY_HEADING_STYLE, FAQ_QUESTION_STYLE, LEAD_TEXT_STYLE, MUTED_FG, PRIMARY_CHIP_BG, PRIMARY_SOFT, RADIUS, RADIUS_FULL, RADIUS_XL, responsiveGrid, SECTION_TITLE_STYLE, SHADOW_CARD, STAT_LABEL_STYLE, STAT_NUMBER_STYLE, SURFACE_CARD, TEAM_NAME_STYLE, TEAM_ROLE_STYLE, TITLE_WRAP_STYLE, } from "./tokens.js";
|
|
20
|
+
// Fixed cycle for feature cards: distinct, friendly, brand-tintable icons. A
|
|
21
|
+
// per-feature icon would need a block-level data field — out of scope for L5,
|
|
22
|
+
// so we deterministically cycle (looks intentional, no model change).
|
|
23
|
+
const FEATURE_ICONS = [
|
|
24
|
+
Sparkles,
|
|
25
|
+
Zap,
|
|
26
|
+
ShieldCheck,
|
|
27
|
+
Heart,
|
|
28
|
+
Rocket,
|
|
29
|
+
Gem,
|
|
30
|
+
];
|
|
31
|
+
const STAT_ICONS = [
|
|
32
|
+
TrendingUp,
|
|
33
|
+
Users,
|
|
34
|
+
Star,
|
|
35
|
+
Sparkles,
|
|
36
|
+
Heart,
|
|
37
|
+
ShieldCheck,
|
|
38
|
+
];
|
|
39
|
+
function cycle(list, i) {
|
|
40
|
+
return list[i % list.length] ?? Sparkles;
|
|
41
|
+
}
|
|
42
|
+
/** Brand-tinted rounded chip holding an icon (feature cards). */
|
|
43
|
+
function iconChip(Icon) {
|
|
44
|
+
return createElement("div", {
|
|
45
|
+
key: "chip",
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
style: {
|
|
48
|
+
display: "inline-flex",
|
|
49
|
+
alignItems: "center",
|
|
50
|
+
justifyContent: "center",
|
|
51
|
+
width: "48px",
|
|
52
|
+
height: "48px",
|
|
53
|
+
borderRadius: RADIUS,
|
|
54
|
+
background: PRIMARY_CHIP_BG,
|
|
55
|
+
color: C_PRIMARY,
|
|
56
|
+
marginBottom: "16px",
|
|
57
|
+
},
|
|
58
|
+
}, createElement(Icon, { size: 24, strokeWidth: 1.75 }));
|
|
59
|
+
}
|
|
60
|
+
/** Centered title block above a grid (only when a leading heading exists). */
|
|
61
|
+
function titleBlock(heading) {
|
|
62
|
+
if (!heading)
|
|
63
|
+
return null;
|
|
64
|
+
return createElement("div", { key: "title", style: TITLE_WRAP_STYLE }, renderBlock(heading, { headingStyle: { ...SECTION_TITLE_STYLE, margin: 0 } }));
|
|
65
|
+
}
|
|
66
|
+
/** Splits children into a leading heading (section title) and the rest. */
|
|
67
|
+
function splitLeadingHeading(blocks) {
|
|
68
|
+
const sorted = sortByPosition(blocks);
|
|
69
|
+
const first = sorted[0];
|
|
70
|
+
if (first && isHeadingBlock(first)) {
|
|
71
|
+
return { heading: first, rest: sorted.slice(1) };
|
|
72
|
+
}
|
|
73
|
+
return { heading: null, rest: sorted };
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Groups flat children into an optional section title + heading-led groups —
|
|
77
|
+
* the backbone of stats / faq / team, which need (label, value) or
|
|
78
|
+
* (question, answer) pairs without a nested data model.
|
|
79
|
+
*
|
|
80
|
+
* Rule: a LEADING heading is the section title ONLY when it stands alone (the
|
|
81
|
+
* next block is also a heading, or there is none). Otherwise every heading
|
|
82
|
+
* opens a group and the following non-heading blocks are its body. This stays
|
|
83
|
+
* sensible if the client deletes the title — the first value heading is not
|
|
84
|
+
* mistaken for a title because it is immediately followed by its body.
|
|
85
|
+
*/
|
|
86
|
+
function groupByHeading(blocks) {
|
|
87
|
+
const sorted = sortByPosition(blocks);
|
|
88
|
+
let title = null;
|
|
89
|
+
let start = 0;
|
|
90
|
+
const first = sorted[0];
|
|
91
|
+
const second = sorted[1];
|
|
92
|
+
if (first && isHeadingBlock(first) && (!second || isHeadingBlock(second))) {
|
|
93
|
+
title = first;
|
|
94
|
+
start = 1;
|
|
95
|
+
}
|
|
96
|
+
const groups = [];
|
|
97
|
+
let current = null;
|
|
98
|
+
for (let i = start; i < sorted.length; i++) {
|
|
99
|
+
const b = sorted[i];
|
|
100
|
+
if (!b)
|
|
101
|
+
continue;
|
|
102
|
+
if (isHeadingBlock(b)) {
|
|
103
|
+
current = { head: b, body: [] };
|
|
104
|
+
groups.push(current);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
if (!current) {
|
|
108
|
+
current = { head: null, body: [] };
|
|
109
|
+
groups.push(current);
|
|
110
|
+
}
|
|
111
|
+
current.body.push(b);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return { title, groups };
|
|
22
115
|
}
|
|
116
|
+
// ---------------- sections ----------------
|
|
23
117
|
function HeroSection({ section, blocks }) {
|
|
24
118
|
const centered = section.variant !== "left";
|
|
119
|
+
const sorted = sortByPosition(blocks);
|
|
120
|
+
const buttons = sorted.filter((b) => b.type === "button");
|
|
121
|
+
const rest = sorted.filter((b) => b.type !== "button");
|
|
122
|
+
let headingDone = false;
|
|
123
|
+
const restOut = rest.map((b) => {
|
|
124
|
+
if (!headingDone && isHeadingBlock(b)) {
|
|
125
|
+
headingDone = true;
|
|
126
|
+
return renderBlock(b, { headingStyle: DISPLAY_HEADING_STYLE });
|
|
127
|
+
}
|
|
128
|
+
if (b.type === "text") {
|
|
129
|
+
return renderBlock(b, {
|
|
130
|
+
textStyle: {
|
|
131
|
+
...LEAD_TEXT_STYLE,
|
|
132
|
+
...(centered ? { marginLeft: "auto", marginRight: "auto" } : {}),
|
|
133
|
+
maxWidth: "620px",
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return renderBlock(b);
|
|
138
|
+
});
|
|
25
139
|
return createElement("div", {
|
|
26
140
|
style: {
|
|
27
141
|
...CONTAINER_STYLE,
|
|
142
|
+
maxWidth: "900px",
|
|
28
143
|
textAlign: centered ? "center" : "left",
|
|
29
144
|
},
|
|
30
|
-
},
|
|
145
|
+
}, createElement("div", { key: "body" }, restOut), buttons.length
|
|
146
|
+
? createElement("div", { key: "btns", style: buttonRowStyle(centered) }, buttons.map((b) => renderBlock(b)))
|
|
147
|
+
: null);
|
|
31
148
|
}
|
|
32
149
|
function TextImageSection({ section, blocks }) {
|
|
150
|
+
// Two-column layout: all images go in one column, everything else in the
|
|
151
|
+
// other — so for a section that mixes images with text, the rendered order
|
|
152
|
+
// follows the column layout, not strict block position (by design).
|
|
33
153
|
const sorted = sortByPosition(blocks);
|
|
34
154
|
const images = sorted.filter((b) => b.type === "image");
|
|
35
155
|
const rest = sorted.filter((b) => b.type !== "image");
|
|
36
156
|
const imageLeft = section.settings?.image_side === "left";
|
|
37
|
-
|
|
38
|
-
const
|
|
157
|
+
let headingDone = false;
|
|
158
|
+
const textCol = createElement("div", { key: "text" }, rest.map((b) => {
|
|
159
|
+
if (!headingDone && isHeadingBlock(b)) {
|
|
160
|
+
headingDone = true;
|
|
161
|
+
return renderBlock(b, { headingStyle: SECTION_TITLE_STYLE });
|
|
162
|
+
}
|
|
163
|
+
return renderBlock(b);
|
|
164
|
+
}));
|
|
165
|
+
const imageCol = createElement("div", {
|
|
166
|
+
key: "image",
|
|
167
|
+
style: {
|
|
168
|
+
borderRadius: RADIUS_XL,
|
|
169
|
+
overflow: "hidden",
|
|
170
|
+
boxShadow: SHADOW_CARD,
|
|
171
|
+
},
|
|
172
|
+
}, images.map((b) => renderBlock(b, { imageStyle: { width: "100%", borderRadius: 0 } })));
|
|
39
173
|
return createElement("div", {
|
|
40
174
|
style: {
|
|
41
175
|
...CONTAINER_STYLE,
|
|
42
176
|
display: "grid",
|
|
43
|
-
gridTemplateColumns: "repeat(
|
|
177
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 320px), 1fr))",
|
|
44
178
|
gap: "48px",
|
|
45
179
|
alignItems: "center",
|
|
46
180
|
},
|
|
47
181
|
}, imageLeft ? [imageCol, textCol] : [textCol, imageCol]);
|
|
48
182
|
}
|
|
49
|
-
// Flow model v1: the first heading spans the full width, every following
|
|
50
|
-
// block is one grid cell. Grouped feature items (icon+title+text as a unit)
|
|
51
|
-
// are a planned follow-up.
|
|
52
183
|
function FeaturesSection({ section, blocks }) {
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
const headOut = headingFirst ? renderBlock(first) : null;
|
|
57
|
-
const cells = (headingFirst ? rest : sorted).map((b) => createElement("div", { key: b.key }, renderBlock(b)));
|
|
58
|
-
return createElement("div", { style: CONTAINER_STYLE }, headOut, createElement("div", { style: gridStyle(section.settings?.columns) }, cells));
|
|
184
|
+
const { heading, rest } = splitLeadingHeading(blocks);
|
|
185
|
+
const cells = rest.map((b, i) => createElement("div", { key: b.key, style: cardStyle() }, iconChip(cycle(FEATURE_ICONS, i)), renderBlock(b)));
|
|
186
|
+
return createElement("div", { style: CONTAINER_STYLE }, titleBlock(heading), createElement("div", { style: responsiveGrid(section.settings?.columns) }, cells));
|
|
59
187
|
}
|
|
60
188
|
function GallerySection({ section, blocks }) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
189
|
+
// Non-image children render above the image grid (markers preserved); the
|
|
190
|
+
// grid then collects the images. Mixed-type order follows this layout, not
|
|
191
|
+
// strict block position (by design).
|
|
192
|
+
const { heading, rest } = splitLeadingHeading(blocks);
|
|
193
|
+
const images = rest.filter((b) => b.type === "image");
|
|
194
|
+
const other = rest.filter((b) => b.type !== "image");
|
|
195
|
+
const tiles = images.map((b) => createElement("div", {
|
|
196
|
+
key: b.key,
|
|
197
|
+
style: {
|
|
198
|
+
aspectRatio: "4 / 3",
|
|
199
|
+
overflow: "hidden",
|
|
200
|
+
borderRadius: RADIUS,
|
|
201
|
+
boxShadow: SHADOW_CARD,
|
|
202
|
+
},
|
|
203
|
+
}, renderBlock(b, {
|
|
204
|
+
imageStyle: {
|
|
205
|
+
width: "100%",
|
|
206
|
+
height: "100%",
|
|
207
|
+
objectFit: "cover",
|
|
208
|
+
borderRadius: 0,
|
|
209
|
+
},
|
|
210
|
+
})));
|
|
211
|
+
return createElement("div", { style: CONTAINER_STYLE }, titleBlock(heading), other.map((b) => renderBlock(b)), createElement("div", { style: responsiveGrid(section.settings?.columns, "16px") }, tiles));
|
|
65
212
|
}
|
|
66
213
|
function CtaSection({ blocks }) {
|
|
67
|
-
|
|
214
|
+
const sorted = sortByPosition(blocks);
|
|
215
|
+
const buttons = sorted.filter((b) => b.type === "button");
|
|
216
|
+
const rest = sorted.filter((b) => b.type !== "button");
|
|
217
|
+
let headingDone = false;
|
|
218
|
+
const restOut = rest.map((b) => {
|
|
219
|
+
if (!headingDone && isHeadingBlock(b)) {
|
|
220
|
+
headingDone = true;
|
|
221
|
+
return renderBlock(b, {
|
|
222
|
+
headingStyle: { ...SECTION_TITLE_STYLE, margin: "0 0 0.3em" },
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
return renderBlock(b);
|
|
226
|
+
});
|
|
227
|
+
return createElement("div", { style: CONTAINER_STYLE }, createElement("div", {
|
|
228
|
+
style: {
|
|
229
|
+
background: PRIMARY_SOFT,
|
|
230
|
+
border: `1px solid ${BORDER}`,
|
|
231
|
+
borderRadius: RADIUS_XL,
|
|
232
|
+
padding: "56px 32px",
|
|
233
|
+
textAlign: "center",
|
|
234
|
+
},
|
|
235
|
+
}, createElement("div", { key: "body" }, restOut), buttons.length
|
|
236
|
+
? createElement("div", { key: "btns", style: buttonRowStyle(true) }, buttons.map((b) => renderBlock(b)))
|
|
237
|
+
: null));
|
|
68
238
|
}
|
|
69
239
|
function ContactSection({ blocks }) {
|
|
70
|
-
return createElement("div", { style: { ...CONTAINER_STYLE, maxWidth: "720px" } }, renderBlocks(blocks));
|
|
240
|
+
return createElement("div", { style: { ...CONTAINER_STYLE, maxWidth: "720px" } }, createElement("div", { style: cardStyle({ padding: "36px" }) }, renderBlocks(blocks)));
|
|
71
241
|
}
|
|
72
242
|
function PlainSection({ blocks }) {
|
|
73
243
|
return createElement("div", { style: CONTAINER_STYLE }, renderBlocks(blocks));
|
|
74
244
|
}
|
|
245
|
+
function TestimonialsSection({ section, blocks }) {
|
|
246
|
+
const { heading, rest } = splitLeadingHeading(blocks);
|
|
247
|
+
const cells = rest.map((b) => createElement("div", {
|
|
248
|
+
key: b.key,
|
|
249
|
+
style: cardStyle({ display: "flex", flexDirection: "column", gap: "12px" }),
|
|
250
|
+
}, createElement("div", { key: "q", "aria-hidden": "true", style: { color: C_PRIMARY, opacity: 0.85 } }, createElement(Quote, { size: 30, strokeWidth: 1.5 })), renderBlock(b)));
|
|
251
|
+
return createElement("div", { style: CONTAINER_STYLE }, titleBlock(heading), createElement("div", { style: responsiveGrid(section.settings?.columns) }, cells));
|
|
252
|
+
}
|
|
253
|
+
function PricingSection({ section, blocks }) {
|
|
254
|
+
const { heading, rest } = splitLeadingHeading(blocks);
|
|
255
|
+
// Highlight the middle plan when there are 3+ (the common "recommended" tier).
|
|
256
|
+
const featuredIdx = rest.length >= 3 ? Math.floor(rest.length / 2) : -1;
|
|
257
|
+
const cells = rest.map((b, i) => createElement("div", {
|
|
258
|
+
key: b.key,
|
|
259
|
+
style: cardStyle(i === featuredIdx
|
|
260
|
+
? { border: `2px solid ${C_PRIMARY}`, boxShadow: SHADOW_CARD }
|
|
261
|
+
: {}),
|
|
262
|
+
}, renderBlock(b)));
|
|
263
|
+
return createElement("div", { style: CONTAINER_STYLE }, titleBlock(heading), createElement("div", { style: responsiveGrid(section.settings?.columns) }, cells));
|
|
264
|
+
}
|
|
265
|
+
function FaqSection({ blocks }) {
|
|
266
|
+
const { title, groups } = groupByHeading(blocks);
|
|
267
|
+
const items = groups.map((g, i) => createElement("div", {
|
|
268
|
+
key: g.head?.key ?? `faq-${i}`,
|
|
269
|
+
style: {
|
|
270
|
+
background: SURFACE_CARD,
|
|
271
|
+
border: `1px solid ${BORDER}`,
|
|
272
|
+
borderRadius: RADIUS,
|
|
273
|
+
padding: "20px 24px",
|
|
274
|
+
},
|
|
275
|
+
}, g.head ? renderBlock(g.head, { headingStyle: FAQ_QUESTION_STYLE }) : null, ...g.body.map((b) => renderBlock(b))));
|
|
276
|
+
return createElement("div", { style: { ...CONTAINER_STYLE, maxWidth: "760px" } }, titleBlock(title), createElement("div", { style: { display: "flex", flexDirection: "column", gap: "12px" } }, items));
|
|
277
|
+
}
|
|
278
|
+
function StatsSection({ section, blocks }) {
|
|
279
|
+
const { title, groups } = groupByHeading(blocks);
|
|
280
|
+
const cells = groups.map((g, i) => createElement("div", { key: g.head?.key ?? `stat-${i}`, style: { textAlign: "center" } }, createElement("div", {
|
|
281
|
+
key: "icon",
|
|
282
|
+
"aria-hidden": "true",
|
|
283
|
+
style: { color: C_PRIMARY, marginBottom: "8px" },
|
|
284
|
+
}, createElement(cycle(STAT_ICONS, i), { size: 22, strokeWidth: 1.75 })), g.head ? renderBlock(g.head, { headingStyle: STAT_NUMBER_STYLE }) : null, ...g.body.map((b) => renderBlock(b, { textStyle: STAT_LABEL_STYLE }))));
|
|
285
|
+
return createElement("div", { style: CONTAINER_STYLE }, titleBlock(title), createElement("div", { style: responsiveGrid(section.settings?.columns, "32px") }, cells));
|
|
286
|
+
}
|
|
287
|
+
function TeamSection({ section, blocks }) {
|
|
288
|
+
const { title, groups } = groupByHeading(blocks);
|
|
289
|
+
const cells = groups.map((g, i) => {
|
|
290
|
+
const images = g.body.filter((b) => b.type === "image");
|
|
291
|
+
const texts = g.body.filter((b) => b.type !== "image");
|
|
292
|
+
return createElement("div", {
|
|
293
|
+
key: g.head?.key ?? `team-${i}`,
|
|
294
|
+
style: cardStyle({ textAlign: "center", padding: "24px" }),
|
|
295
|
+
}, images.map((b) => createElement("div", {
|
|
296
|
+
key: b.key,
|
|
297
|
+
style: {
|
|
298
|
+
width: "96px",
|
|
299
|
+
height: "96px",
|
|
300
|
+
borderRadius: RADIUS_FULL,
|
|
301
|
+
overflow: "hidden",
|
|
302
|
+
margin: "0 auto 16px",
|
|
303
|
+
border: `1px solid ${BORDER}`,
|
|
304
|
+
},
|
|
305
|
+
}, renderBlock(b, {
|
|
306
|
+
imageStyle: {
|
|
307
|
+
width: "100%",
|
|
308
|
+
height: "100%",
|
|
309
|
+
objectFit: "cover",
|
|
310
|
+
borderRadius: 0,
|
|
311
|
+
},
|
|
312
|
+
}))), g.head ? renderBlock(g.head, { headingStyle: TEAM_NAME_STYLE }) : null, ...texts.map((b) => renderBlock(b, { textStyle: TEAM_ROLE_STYLE })));
|
|
313
|
+
});
|
|
314
|
+
return createElement("div", { style: CONTAINER_STYLE }, titleBlock(title), createElement("div", { style: responsiveGrid(section.settings?.columns) }, cells));
|
|
315
|
+
}
|
|
316
|
+
function LogoCloudSection({ blocks }) {
|
|
317
|
+
const { heading, rest } = splitLeadingHeading(blocks);
|
|
318
|
+
const images = rest.filter((b) => b.type === "image");
|
|
319
|
+
// Any non-image child (a caption, divider, …) still renders below the heading
|
|
320
|
+
// so its data-risali-key marker is never lost — every section preserves all
|
|
321
|
+
// children; the logos row only collects the images.
|
|
322
|
+
const other = rest.filter((b) => b.type !== "image");
|
|
323
|
+
const logos = images.map((b) => createElement("div", { key: b.key, style: { display: "flex", alignItems: "center" } }, renderBlock(b, {
|
|
324
|
+
imageStyle: {
|
|
325
|
+
maxHeight: "44px",
|
|
326
|
+
width: "auto",
|
|
327
|
+
objectFit: "contain",
|
|
328
|
+
borderRadius: 0,
|
|
329
|
+
filter: "grayscale(1)",
|
|
330
|
+
opacity: 0.7,
|
|
331
|
+
},
|
|
332
|
+
})));
|
|
333
|
+
return createElement("div", { style: CONTAINER_STYLE }, heading
|
|
334
|
+
? createElement("div", { key: "title", style: { textAlign: "center", marginBottom: "28px" } }, renderBlock(heading, {
|
|
335
|
+
headingStyle: {
|
|
336
|
+
fontSize: "0.8rem",
|
|
337
|
+
fontWeight: 600,
|
|
338
|
+
textTransform: "uppercase",
|
|
339
|
+
letterSpacing: "0.12em",
|
|
340
|
+
color: MUTED_FG,
|
|
341
|
+
margin: 0,
|
|
342
|
+
},
|
|
343
|
+
}))
|
|
344
|
+
: null, other.length
|
|
345
|
+
? createElement("div", { key: "other", style: { textAlign: "center", marginBottom: "20px" } }, other.map((b) => renderBlock(b)))
|
|
346
|
+
: null, createElement("div", {
|
|
347
|
+
style: {
|
|
348
|
+
display: "flex",
|
|
349
|
+
flexWrap: "wrap",
|
|
350
|
+
alignItems: "center",
|
|
351
|
+
justifyContent: "center",
|
|
352
|
+
gap: "40px",
|
|
353
|
+
},
|
|
354
|
+
}, logos));
|
|
355
|
+
}
|
|
75
356
|
export const RISALI_SECTION_COMPONENTS = {
|
|
76
357
|
hero: HeroSection,
|
|
77
358
|
text_image: TextImageSection,
|
|
@@ -80,10 +361,20 @@ export const RISALI_SECTION_COMPONENTS = {
|
|
|
80
361
|
cta: CtaSection,
|
|
81
362
|
contact: ContactSection,
|
|
82
363
|
plain: PlainSection,
|
|
364
|
+
testimonials: TestimonialsSection,
|
|
365
|
+
pricing: PricingSection,
|
|
366
|
+
faq: FaqSection,
|
|
367
|
+
stats: StatsSection,
|
|
368
|
+
team: TeamSection,
|
|
369
|
+
logo_cloud: LogoCloudSection,
|
|
83
370
|
};
|
|
84
371
|
// Palette KEY shape — mirrors the content API + dashboard catalog guard.
|
|
85
372
|
// Anything else would be a CSS-variable injection through settings.
|
|
86
373
|
const PALETTE_KEY_RE = /^[a-z][a-z0-9_]{0,40}$/;
|
|
374
|
+
// Defense-in-depth mirror of the dashboard sanitizeImageSrc — https:// or
|
|
375
|
+
// root-relative only, no quotes/spaces/control chars that could break out of
|
|
376
|
+
// the inline url().
|
|
377
|
+
const SAFE_SRC_RE = /^(https:\/\/|\/)[^\s"'<>\\)]+$/;
|
|
87
378
|
const SPACING_PADDING = {
|
|
88
379
|
compact: "24px 16px",
|
|
89
380
|
normal: "48px 16px",
|
|
@@ -91,13 +382,37 @@ const SPACING_PADDING = {
|
|
|
91
382
|
};
|
|
92
383
|
/** Wrapper style for the <section> element from whitelisted settings. */
|
|
93
384
|
export function sectionWrapperStyle(section) {
|
|
385
|
+
const settings = section.settings ?? {};
|
|
94
386
|
const style = {
|
|
95
|
-
padding: SPACING_PADDING[
|
|
387
|
+
padding: SPACING_PADDING[settings.spacing ?? ""] ?? SPACING_PADDING.normal,
|
|
96
388
|
fontFamily: "var(--risali-font-body, inherit)",
|
|
97
389
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
390
|
+
// Background colour: a custom value (full editor) takes precedence over the
|
|
391
|
+
// palette key; otherwise fall back to the palette CSS var.
|
|
392
|
+
const customBg = safeColorAlpha(settings.background_color);
|
|
393
|
+
const bgKey = settings.background;
|
|
394
|
+
if (customBg) {
|
|
395
|
+
style.backgroundColor = customBg;
|
|
396
|
+
}
|
|
397
|
+
else if (typeof bgKey === "string" && PALETTE_KEY_RE.test(bgKey)) {
|
|
398
|
+
style.backgroundColor = `var(--risali-color-${bgKey})`;
|
|
399
|
+
}
|
|
400
|
+
// Background image + optional dark overlay (full editor). The overlay is a
|
|
401
|
+
// gradient layered above the image so foreground text stays legible.
|
|
402
|
+
const img = settings.background_image;
|
|
403
|
+
if (typeof img === "string" && img.length <= 1000 && SAFE_SRC_RE.test(img)) {
|
|
404
|
+
const overlay = typeof settings.overlay === "number" && Number.isFinite(settings.overlay)
|
|
405
|
+
? Math.min(1, Math.max(0, settings.overlay))
|
|
406
|
+
: 0;
|
|
407
|
+
const layers = [];
|
|
408
|
+
if (overlay > 0) {
|
|
409
|
+
const a = overlay.toFixed(2);
|
|
410
|
+
layers.push(`linear-gradient(rgba(0,0,0,${a}),rgba(0,0,0,${a}))`);
|
|
411
|
+
}
|
|
412
|
+
layers.push(`url("${img}")`);
|
|
413
|
+
style.backgroundImage = layers.join(",");
|
|
414
|
+
style.backgroundSize = "cover";
|
|
415
|
+
style.backgroundPosition = "center";
|
|
101
416
|
}
|
|
102
417
|
return style;
|
|
103
418
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sections/index.tsx"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,wEAAwE;AACxE,2CAA2C;AAC3C,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,qEAAqE;AACrE,yDAAyD;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAUxE,MAAM,eAAe,GAAkB;IACrC,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,SAAS,SAAS,CAAC,OAAgB;IACjC,MAAM,CAAC,GACL,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,EAAE,CAAC,EAA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AG,CAAC,EAAE,CAAC;QAC3E,MAAM,OAAO,GACX,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC;YACvE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC5C,CAAC,CAAC,CAAC,CAAC;QACR,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;YAChB,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACpE,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;QAC7B,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzC,KAAK,CAAC,cAAc,GAAG,OAAO,CAAC;QAC/B,KAAK,CAAC,kBAAkB,GAAG,QAAQ,CAAC;IACtC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
export declare const C_PRIMARY = "var(--risali-color-primary, #0f172a)";
|
|
3
|
+
export declare const C_BG = "var(--risali-color-background, #ffffff)";
|
|
4
|
+
export declare const C_FG = "var(--risali-color-text, #0f172a)";
|
|
5
|
+
export declare const C_ACCENT = "var(--risali-color-accent, var(--risali-color-primary, #0f172a))";
|
|
6
|
+
export declare const C_ON_PRIMARY = "var(--risali-on-primary, #ffffff)";
|
|
7
|
+
export declare const SURFACE_CARD = "var(--risali-color-background, #ffffff)";
|
|
8
|
+
export declare const SURFACE_MUTED: string;
|
|
9
|
+
export declare const SURFACE_SECONDARY: string;
|
|
10
|
+
export declare const BORDER: string;
|
|
11
|
+
export declare const MUTED_FG: string;
|
|
12
|
+
export declare const PRIMARY_GLOW: string;
|
|
13
|
+
export declare const PRIMARY_SOFT: string;
|
|
14
|
+
export declare const PRIMARY_CHIP_BG: string;
|
|
15
|
+
export declare const GRADIENT_PRIMARY: string;
|
|
16
|
+
export declare const GRADIENT_HERO: string;
|
|
17
|
+
export declare const SHADOW_SOFT: string;
|
|
18
|
+
export declare const SHADOW_CARD: string;
|
|
19
|
+
export declare const SHADOW_GLOW: string;
|
|
20
|
+
export declare const RADIUS = "0.75rem";
|
|
21
|
+
export declare const RADIUS_LG = "1rem";
|
|
22
|
+
export declare const RADIUS_XL = "1.25rem";
|
|
23
|
+
export declare const RADIUS_FULL = "9999px";
|
|
24
|
+
export declare const CONTAINER_STYLE: CSSProperties;
|
|
25
|
+
/**
|
|
26
|
+
* Intrinsically-responsive grid. `columns` (2|3|4 from section settings) sets
|
|
27
|
+
* the DESIRED density via a per-item min width; auto-fit then fits as many
|
|
28
|
+
* tracks as the viewport allows and wraps to fewer (down to 1) on narrow
|
|
29
|
+
* screens — no media query needed. `min(100%, …)` stops a single wide card
|
|
30
|
+
* from overflowing a phone.
|
|
31
|
+
*/
|
|
32
|
+
export declare function responsiveGrid(columns: unknown, gap?: string): CSSProperties;
|
|
33
|
+
/** Surface card — quiet brand-tinted background, hairline border, soft shadow. */
|
|
34
|
+
export declare function cardStyle(extra?: CSSProperties): CSSProperties;
|
|
35
|
+
/** Flex row for a group of buttons (hero/cta). */
|
|
36
|
+
export declare function buttonRowStyle(centered: boolean): CSSProperties;
|
|
37
|
+
/** Large hero headline. */
|
|
38
|
+
export declare const DISPLAY_HEADING_STYLE: CSSProperties;
|
|
39
|
+
/** Section title (features/testimonials/… headings). */
|
|
40
|
+
export declare const SECTION_TITLE_STYLE: CSSProperties;
|
|
41
|
+
/** Lead paragraph under a hero headline. */
|
|
42
|
+
export declare const LEAD_TEXT_STYLE: CSSProperties;
|
|
43
|
+
/** Big number in a stats cell. */
|
|
44
|
+
export declare const STAT_NUMBER_STYLE: CSSProperties;
|
|
45
|
+
/** Label under a stat number. */
|
|
46
|
+
export declare const STAT_LABEL_STYLE: CSSProperties;
|
|
47
|
+
/** FAQ question. */
|
|
48
|
+
export declare const FAQ_QUESTION_STYLE: CSSProperties;
|
|
49
|
+
/** Team member name. */
|
|
50
|
+
export declare const TEAM_NAME_STYLE: CSSProperties;
|
|
51
|
+
/** Team member role. */
|
|
52
|
+
export declare const TEAM_ROLE_STYLE: CSSProperties;
|
|
53
|
+
/** Centered title block above a grid. */
|
|
54
|
+
export declare const TITLE_WRAP_STYLE: CSSProperties;
|
|
55
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/sections/tokens.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3C,eAAO,MAAM,SAAS,yCAAyC,CAAC;AAChE,eAAO,MAAM,IAAI,4CAA4C,CAAC;AAC9D,eAAO,MAAM,IAAI,sCAAsC,CAAC;AACxD,eAAO,MAAM,QAAQ,qEAC+C,CAAC;AACrE,eAAO,MAAM,YAAY,sCAAsC,CAAC;AAQhE,eAAO,MAAM,YAAY,4CAAO,CAAC;AACjC,eAAO,MAAM,aAAa,QAAqB,CAAC;AAChD,eAAO,MAAM,iBAAiB,QAAqB,CAAC;AACpD,eAAO,MAAM,MAAM,QAAsB,CAAC;AAC1C,eAAO,MAAM,QAAQ,QAAsB,CAAC;AAG5C,eAAO,MAAM,YAAY,QAA8B,CAAC;AACxD,eAAO,MAAM,YAAY,QAA2B,CAAC;AACrD,eAAO,MAAM,eAAe,QAA2B,CAAC;AAGxD,eAAO,MAAM,gBAAgB,QAAmE,CAAC;AACjG,eAAO,MAAM,aAAa,QAA0E,CAAC;AAGrG,eAAO,MAAM,WAAW,QAA+F,CAAC;AACxH,eAAO,MAAM,WAAW,QAAsD,CAAC;AAC/E,eAAO,MAAM,WAAW,QAAwD,CAAC;AAGjF,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,SAAS,SAAS,CAAC;AAChC,eAAO,MAAM,SAAS,YAAY,CAAC;AACnC,eAAO,MAAM,WAAW,WAAW,CAAC;AAIpC,eAAO,MAAM,eAAe,EAAE,aAG7B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,SAAS,GAAG,aAAa,CAS5E;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,aAAa,CAS9D;AAED,kDAAkD;AAClD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,GAAG,aAAa,CAQ/D;AAID,2BAA2B;AAC3B,eAAO,MAAM,qBAAqB,EAAE,aAMnC,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,mBAAmB,EAAE,aAMjC,CAAC;AAEF,4CAA4C;AAC5C,eAAO,MAAM,eAAe,EAAE,aAK7B,CAAC;AAEF,kCAAkC;AAClC,eAAO,MAAM,iBAAiB,EAAE,aAO/B,CAAC;AAEF,iCAAiC;AACjC,eAAO,MAAM,gBAAgB,EAAE,aAI9B,CAAC;AAEF,oBAAoB;AACpB,eAAO,MAAM,kBAAkB,EAAE,aAKhC,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,eAAe,EAAE,aAI7B,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,eAAe,EAAE,aAI7B,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,gBAAgB,EAAE,aAI9B,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// Inline design tokens for builder sections (L5).
|
|
2
|
+
//
|
|
3
|
+
// These mirror the L1 design system (templates/.../globals.css) but are emitted
|
|
4
|
+
// as INLINE CSS strings derived straight from the --risali-color-* variables
|
|
5
|
+
// <RisaliBrand> sets — so a builder section looks branded and "designed" even
|
|
6
|
+
// where the client app's Tailwind / globals.css is not in scope (unit tests
|
|
7
|
+
// with renderToStaticMarkup, or a minimal host).
|
|
8
|
+
//
|
|
9
|
+
// WHY NOT L1 utility classes (bg-primary, shadow-elevated, …)? Tailwind v4 only
|
|
10
|
+
// generates the classes it finds while scanning the APP's source — never ones
|
|
11
|
+
// buried in node_modules/@risali/react — so those utilities would be purged on
|
|
12
|
+
// most client builds. Inline styles always apply, and color-mix() over the same
|
|
13
|
+
// brand vars reproduces the exact L1 look. Tests stay green because color-mix
|
|
14
|
+
// strings are inert text under renderToStaticMarkup.
|
|
15
|
+
//
|
|
16
|
+
// Responsiveness is achieved WITHOUT media queries (impossible inline): grids
|
|
17
|
+
// use `repeat(auto-fit, minmax(min(100%, …), 1fr))`, which collapses to fewer
|
|
18
|
+
// columns as the viewport narrows and never overflows on a phone.
|
|
19
|
+
// Brand color refs with the SAME light-theme fallbacks as globals.css :root,
|
|
20
|
+
// so an un-branded scaffold (or a payload before <RisaliBrand> resolves) still
|
|
21
|
+
// renders something clean instead of `unset`.
|
|
22
|
+
export const C_PRIMARY = "var(--risali-color-primary, #0f172a)";
|
|
23
|
+
export const C_BG = "var(--risali-color-background, #ffffff)";
|
|
24
|
+
export const C_FG = "var(--risali-color-text, #0f172a)";
|
|
25
|
+
export const C_ACCENT = "var(--risali-color-accent, var(--risali-color-primary, #0f172a))";
|
|
26
|
+
export const C_ON_PRIMARY = "var(--risali-on-primary, #ffffff)";
|
|
27
|
+
/** color-mix in oklab — same color space as globals.css. */
|
|
28
|
+
function mix(a, pct, b) {
|
|
29
|
+
return `color-mix(in oklab, ${a} ${pct}%, ${b})`;
|
|
30
|
+
}
|
|
31
|
+
// Derived surfaces (mirror globals.css --card / --secondary / --muted / --border).
|
|
32
|
+
export const SURFACE_CARD = C_BG;
|
|
33
|
+
export const SURFACE_MUTED = mix(C_FG, 4, C_BG);
|
|
34
|
+
export const SURFACE_SECONDARY = mix(C_FG, 6, C_BG);
|
|
35
|
+
export const BORDER = mix(C_FG, 12, C_BG);
|
|
36
|
+
export const MUTED_FG = mix(C_FG, 55, C_BG);
|
|
37
|
+
// Brand tints used for soft panels and icon chips.
|
|
38
|
+
export const PRIMARY_GLOW = mix(C_PRIMARY, 68, "white");
|
|
39
|
+
export const PRIMARY_SOFT = mix(C_PRIMARY, 10, C_BG); // faint brand wash (panels)
|
|
40
|
+
export const PRIMARY_CHIP_BG = mix(C_PRIMARY, 12, C_BG); // icon-chip background
|
|
41
|
+
// Gradients (mirror globals.css --gradient-primary / --gradient-hero).
|
|
42
|
+
export const GRADIENT_PRIMARY = `linear-gradient(135deg, ${C_PRIMARY} 0%, ${PRIMARY_GLOW} 100%)`;
|
|
43
|
+
export const GRADIENT_HERO = `linear-gradient(135deg, ${C_BG} 0%, ${mix(C_PRIMARY, 10, C_BG)} 100%)`;
|
|
44
|
+
// Shadows (mirror globals.css — soft + foreground/brand tinted, never harsh black).
|
|
45
|
+
export const SHADOW_SOFT = `0 1px 2px ${mix(C_FG, 6, "transparent")}, 0 8px 24px -12px ${mix(C_FG, 12, "transparent")}`;
|
|
46
|
+
export const SHADOW_CARD = `0 10px 40px -15px ${mix(C_FG, 16, "transparent")}`;
|
|
47
|
+
export const SHADOW_GLOW = `0 0 60px -10px ${mix(C_PRIMARY, 40, "transparent")}`;
|
|
48
|
+
// Radius scale (globals.css --radius = 0.75rem; here as static rems).
|
|
49
|
+
export const RADIUS = "0.75rem";
|
|
50
|
+
export const RADIUS_LG = "1rem";
|
|
51
|
+
export const RADIUS_XL = "1.25rem";
|
|
52
|
+
export const RADIUS_FULL = "9999px";
|
|
53
|
+
// ---------------- shared layout helpers ----------------
|
|
54
|
+
export const CONTAINER_STYLE = {
|
|
55
|
+
maxWidth: "1100px",
|
|
56
|
+
margin: "0 auto",
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Intrinsically-responsive grid. `columns` (2|3|4 from section settings) sets
|
|
60
|
+
* the DESIRED density via a per-item min width; auto-fit then fits as many
|
|
61
|
+
* tracks as the viewport allows and wraps to fewer (down to 1) on narrow
|
|
62
|
+
* screens — no media query needed. `min(100%, …)` stops a single wide card
|
|
63
|
+
* from overflowing a phone.
|
|
64
|
+
*/
|
|
65
|
+
export function responsiveGrid(columns, gap = "24px") {
|
|
66
|
+
const n = typeof columns === "number" && [2, 3, 4].includes(columns) ? columns : 3;
|
|
67
|
+
const min = n === 2 ? "320px" : n === 3 ? "240px" : "190px";
|
|
68
|
+
return {
|
|
69
|
+
display: "grid",
|
|
70
|
+
gridTemplateColumns: `repeat(auto-fit, minmax(min(100%, ${min}), 1fr))`,
|
|
71
|
+
gap,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/** Surface card — quiet brand-tinted background, hairline border, soft shadow. */
|
|
75
|
+
export function cardStyle(extra) {
|
|
76
|
+
return {
|
|
77
|
+
background: SURFACE_CARD,
|
|
78
|
+
border: `1px solid ${BORDER}`,
|
|
79
|
+
borderRadius: RADIUS_LG,
|
|
80
|
+
padding: "28px",
|
|
81
|
+
boxShadow: SHADOW_SOFT,
|
|
82
|
+
...extra,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** Flex row for a group of buttons (hero/cta). */
|
|
86
|
+
export function buttonRowStyle(centered) {
|
|
87
|
+
return {
|
|
88
|
+
display: "flex",
|
|
89
|
+
flexWrap: "wrap",
|
|
90
|
+
gap: "12px",
|
|
91
|
+
justifyContent: centered ? "center" : "flex-start",
|
|
92
|
+
marginTop: "8px",
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
// ---------------- typography overrides (passed to renderBlock opts) ----------------
|
|
96
|
+
/** Large hero headline. */
|
|
97
|
+
export const DISPLAY_HEADING_STYLE = {
|
|
98
|
+
fontSize: "clamp(2.5rem, 1.5rem + 4vw, 4rem)",
|
|
99
|
+
lineHeight: 1.05,
|
|
100
|
+
letterSpacing: "-0.03em",
|
|
101
|
+
fontWeight: 800,
|
|
102
|
+
margin: "0 0 0.4em",
|
|
103
|
+
};
|
|
104
|
+
/** Section title (features/testimonials/… headings). */
|
|
105
|
+
export const SECTION_TITLE_STYLE = {
|
|
106
|
+
fontSize: "clamp(1.75rem, 1.2rem + 1.5vw, 2.5rem)",
|
|
107
|
+
lineHeight: 1.15,
|
|
108
|
+
letterSpacing: "-0.02em",
|
|
109
|
+
fontWeight: 700,
|
|
110
|
+
margin: "0 0 0.3em",
|
|
111
|
+
};
|
|
112
|
+
/** Lead paragraph under a hero headline. */
|
|
113
|
+
export const LEAD_TEXT_STYLE = {
|
|
114
|
+
fontSize: "1.2rem",
|
|
115
|
+
lineHeight: 1.6,
|
|
116
|
+
color: MUTED_FG,
|
|
117
|
+
margin: "0 0 1.5em",
|
|
118
|
+
};
|
|
119
|
+
/** Big number in a stats cell. */
|
|
120
|
+
export const STAT_NUMBER_STYLE = {
|
|
121
|
+
fontSize: "clamp(2.5rem, 1.5rem + 3vw, 3.5rem)",
|
|
122
|
+
lineHeight: 1,
|
|
123
|
+
letterSpacing: "-0.03em",
|
|
124
|
+
fontWeight: 800,
|
|
125
|
+
color: C_PRIMARY,
|
|
126
|
+
margin: "0 0 0.15em",
|
|
127
|
+
};
|
|
128
|
+
/** Label under a stat number. */
|
|
129
|
+
export const STAT_LABEL_STYLE = {
|
|
130
|
+
fontSize: "0.95rem",
|
|
131
|
+
color: MUTED_FG,
|
|
132
|
+
margin: 0,
|
|
133
|
+
};
|
|
134
|
+
/** FAQ question. */
|
|
135
|
+
export const FAQ_QUESTION_STYLE = {
|
|
136
|
+
fontSize: "1.1rem",
|
|
137
|
+
fontWeight: 600,
|
|
138
|
+
letterSpacing: "-0.01em",
|
|
139
|
+
margin: "0 0 8px",
|
|
140
|
+
};
|
|
141
|
+
/** Team member name. */
|
|
142
|
+
export const TEAM_NAME_STYLE = {
|
|
143
|
+
fontSize: "1.15rem",
|
|
144
|
+
fontWeight: 600,
|
|
145
|
+
margin: "0 0 2px",
|
|
146
|
+
};
|
|
147
|
+
/** Team member role. */
|
|
148
|
+
export const TEAM_ROLE_STYLE = {
|
|
149
|
+
fontSize: "0.9rem",
|
|
150
|
+
color: MUTED_FG,
|
|
151
|
+
margin: 0,
|
|
152
|
+
};
|
|
153
|
+
/** Centered title block above a grid. */
|
|
154
|
+
export const TITLE_WRAP_STYLE = {
|
|
155
|
+
textAlign: "center",
|
|
156
|
+
maxWidth: "640px",
|
|
157
|
+
margin: "0 auto 40px",
|
|
158
|
+
};
|
|
159
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/sections/tokens.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,8EAA8E;AAC9E,4EAA4E;AAC5E,iDAAiD;AACjD,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,+EAA+E;AAC/E,gFAAgF;AAChF,8EAA8E;AAC9E,qDAAqD;AACrD,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,kEAAkE;AAIlE,6EAA6E;AAC7E,+EAA+E;AAC/E,8CAA8C;AAC9C,MAAM,CAAC,MAAM,SAAS,GAAG,sCAAsC,CAAC;AAChE,MAAM,CAAC,MAAM,IAAI,GAAG,yCAAyC,CAAC;AAC9D,MAAM,CAAC,MAAM,IAAI,GAAG,mCAAmC,CAAC;AACxD,MAAM,CAAC,MAAM,QAAQ,GACnB,kEAAkE,CAAC;AACrE,MAAM,CAAC,MAAM,YAAY,GAAG,mCAAmC,CAAC;AAEhE,4DAA4D;AAC5D,SAAS,GAAG,CAAC,CAAS,EAAE,GAAW,EAAE,CAAS;IAC5C,OAAO,uBAAuB,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC;AACnD,CAAC;AAED,mFAAmF;AACnF,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAC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B,CAAC;AAEF,wBAAwB;AACxB,MAAM,CAAC,MAAM,eAAe,GAAkB;IAC5C,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,GAAG;IACf,MAAM,EAAE,SAAS;CAClB,CAAC;AAEF,wBAAwB;AACxB,MAAM,CAAC,MAAM,eAAe,GAAkB;IAC5C,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,CAAC;CACV,CAAC;AAEF,yCAAyC;AACzC,MAAM,CAAC,MAAM,gBAAgB,GAAkB;IAC7C,SAAS,EAAE,QAAQ;IACnB,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,aAAa;CACtB,CAAC"}
|
package/dist/style.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
2
|
import type { RisaliStyleOverrides } from "./types.js";
|
|
3
3
|
export declare function safeColor(value: unknown): string | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Like safeColor but also accepts an 8-digit hex (alpha) and the "transparent"
|
|
6
|
+
* keyword — the canonical output of the editor's normalizeColorAlpha (full
|
|
7
|
+
* editor custom colours). Defense-in-depth: the value was already validated
|
|
8
|
+
* server-side, but we never trust the API payload verbatim.
|
|
9
|
+
*/
|
|
10
|
+
export declare function safeColorAlpha(value: unknown): string | undefined;
|
|
4
11
|
/**
|
|
5
12
|
* Picks a readable foreground (near-black or white) for a brand color using
|
|
6
13
|
* WCAG relative luminance — so brand-tinted surfaces (a primary button, an
|
package/dist/style.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAMvD,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAG5D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKjE;AAYD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,IAAI,SAAY,EAChB,KAAK,SAAY,GAChB,MAAM,GAAG,SAAS,CAYpB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKzE;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,SAAS,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,GACjD,aAAa,GAAG,SAAS,CA0B3B"}
|
package/dist/style.js
CHANGED
|
@@ -1,9 +1,33 @@
|
|
|
1
|
+
import { fontStackForId } from "./fonts.js";
|
|
1
2
|
const HEX_RE = /^#[0-9a-fA-F]{6}$/;
|
|
3
|
+
const HEX_ALPHA_RE = /^#[0-9a-fA-F]{6}(?:[0-9a-fA-F]{2})?$/;
|
|
2
4
|
export function safeColor(value) {
|
|
3
5
|
if (typeof value !== "string")
|
|
4
6
|
return undefined;
|
|
5
7
|
return HEX_RE.test(value) ? value : undefined;
|
|
6
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Like safeColor but also accepts an 8-digit hex (alpha) and the "transparent"
|
|
11
|
+
* keyword — the canonical output of the editor's normalizeColorAlpha (full
|
|
12
|
+
* editor custom colours). Defense-in-depth: the value was already validated
|
|
13
|
+
* server-side, but we never trust the API payload verbatim.
|
|
14
|
+
*/
|
|
15
|
+
export function safeColorAlpha(value) {
|
|
16
|
+
if (typeof value !== "string")
|
|
17
|
+
return undefined;
|
|
18
|
+
const v = value.trim().toLowerCase();
|
|
19
|
+
if (v === "transparent")
|
|
20
|
+
return "transparent";
|
|
21
|
+
return HEX_ALPHA_RE.test(v) ? v : undefined;
|
|
22
|
+
}
|
|
23
|
+
// Block padding presets (full editor) → fixed px. Enum, never raw px.
|
|
24
|
+
const BLOCK_PADDING_PX = {
|
|
25
|
+
none: "0",
|
|
26
|
+
compact: "12px",
|
|
27
|
+
normal: "24px",
|
|
28
|
+
spacious: "48px",
|
|
29
|
+
};
|
|
30
|
+
const TEXT_ALIGNS = new Set(["left", "center", "right"]);
|
|
7
31
|
/**
|
|
8
32
|
* Picks a readable foreground (near-black or white) for a brand color using
|
|
9
33
|
* WCAG relative luminance — so brand-tinted surfaces (a primary button, an
|
|
@@ -35,15 +59,32 @@ export function safeFontSizeMultiplier(value) {
|
|
|
35
59
|
export function applyStyleOverrides(base, overrides) {
|
|
36
60
|
if (!overrides)
|
|
37
61
|
return base;
|
|
38
|
-
const color =
|
|
62
|
+
const color = safeColorAlpha(overrides.color);
|
|
63
|
+
const bg = safeColorAlpha(overrides.background_color);
|
|
39
64
|
const mult = safeFontSizeMultiplier(overrides.font_size_multiplier);
|
|
40
|
-
|
|
65
|
+
const fontStack = fontStackForId(overrides.font_family);
|
|
66
|
+
const align = typeof overrides.text_align === "string" && TEXT_ALIGNS.has(overrides.text_align)
|
|
67
|
+
? overrides.text_align
|
|
68
|
+
: undefined;
|
|
69
|
+
const padding = typeof overrides.padding === "string"
|
|
70
|
+
? BLOCK_PADDING_PX[overrides.padding]
|
|
71
|
+
: undefined;
|
|
72
|
+
if (!color && !bg && !mult && !fontStack && !align && padding === undefined) {
|
|
41
73
|
return base;
|
|
74
|
+
}
|
|
42
75
|
const next = { ...(base || {}) };
|
|
43
76
|
if (color)
|
|
44
77
|
next.color = color;
|
|
78
|
+
if (bg)
|
|
79
|
+
next.backgroundColor = bg;
|
|
45
80
|
if (mult)
|
|
46
81
|
next.fontSize = `${mult}em`;
|
|
82
|
+
if (fontStack)
|
|
83
|
+
next.fontFamily = fontStack;
|
|
84
|
+
if (align)
|
|
85
|
+
next.textAlign = align;
|
|
86
|
+
if (padding !== undefined)
|
|
87
|
+
next.padding = padding;
|
|
47
88
|
return next;
|
|
48
89
|
}
|
|
49
90
|
//# sourceMappingURL=style.js.map
|
package/dist/style.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,MAAM,GAAG,mBAAmB,CAAC;AACnC,MAAM,YAAY,GAAG,sCAAsC,CAAC;AAE5D,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAChD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChD,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,IAAI,CAAC,KAAK,aAAa;QAAE,OAAO,aAAa,CAAC;IAC9C,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9C,CAAC;AAED,sEAAsE;AACtE,MAAM,gBAAgB,GAA2B;IAC/C,IAAI,EAAE,GAAG;IACT,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,MAAM;CACjB,CAAC;AA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AI,CAAC,QAAQ,GAAG,GAAG,IAAI,IAAI,CAAC;IACtC,IAAI,SAAS;QAAE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC3C,IAAI,KAAK;QAAE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAClC,IAAI,OAAO,KAAK,SAAS;QAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export type RisaliBlockType = "text" | "image" | "rich_text" | "html" | "button" | "divider";
|
|
2
2
|
export type RisaliStyleOverrides = {
|
|
3
3
|
color?: string;
|
|
4
|
+
/** Block background colour — custom hex/rgba incl. alpha, or "transparent". */
|
|
5
|
+
background_color?: string;
|
|
6
|
+
/** Per-element font — a font catalog id (e.g. "poppins"). */
|
|
7
|
+
font_family?: string;
|
|
4
8
|
font_size_multiplier?: number;
|
|
9
|
+
text_align?: "left" | "center" | "right" | string;
|
|
10
|
+
padding?: "none" | "compact" | "normal" | "spacious" | string;
|
|
5
11
|
};
|
|
6
12
|
export type RisaliBlock = {
|
|
7
13
|
key: string;
|
|
@@ -18,6 +24,9 @@ export type RisaliBlock = {
|
|
|
18
24
|
};
|
|
19
25
|
export type RisaliSectionSettings = {
|
|
20
26
|
background?: string;
|
|
27
|
+
background_color?: string;
|
|
28
|
+
background_image?: string;
|
|
29
|
+
overlay?: number;
|
|
21
30
|
spacing?: "compact" | "normal" | "spacious" | string;
|
|
22
31
|
columns?: number;
|
|
23
32
|
image_side?: "left" | "right" | string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,OAAO,GACP,WAAW,GACX,MAAM,GACN,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MA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ACF,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;QAC/B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAE5B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,IAAI,CAAC;IACT,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAC3B,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@risali/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "React server components for Risali.app — SSR-fetch editable text/image/rich-text blocks from a client's Risali site.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
"clean": "rm -rf dist",
|
|
24
24
|
"prepublishOnly": "npm run clean && npm run build"
|
|
25
25
|
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"lucide-react": "^1.16.0"
|
|
28
|
+
},
|
|
26
29
|
"peerDependencies": {
|
|
27
30
|
"react": ">=18.0.0",
|
|
28
31
|
"react-dom": ">=18.0.0"
|