@sevenfold/setto-client 0.1.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 +369 -0
- package/dist/SettoBlock.d.ts +10 -0
- package/dist/SettoSection.d.ts +11 -0
- package/dist/T.d.ts +9 -0
- package/dist/admin/App.d.ts +12 -0
- package/dist/edit-mode/auth-gate.d.ts +10 -0
- package/dist/edit-mode/build-status.d.ts +13 -0
- package/dist/edit-mode/constants.d.ts +2 -0
- package/dist/edit-mode/document-layout.d.ts +5 -0
- package/dist/edit-mode/link-hint.d.ts +5 -0
- package/dist/edit-mode/mount.d.ts +14 -0
- package/dist/edit-mode/publish-utils.d.ts +4 -0
- package/dist/edit-mode/section-toolbar.d.ts +1 -0
- package/dist/edit-mode/toolbar.d.ts +1 -0
- package/dist/edit-mode/use-edit-baseline.d.ts +2 -0
- package/dist/index.d.ts +9 -0
- package/dist/lib/api.d.ts +15 -0
- package/dist/lib/color-utils.d.ts +4 -0
- package/dist/lib/i18n-store.d.ts +75 -0
- package/dist/lib/supabase.d.ts +9 -0
- package/dist/lib/theme-store.d.ts +35 -0
- package/dist/provider.d.ts +40 -0
- package/dist/section-context.d.ts +10 -0
- package/dist/section-schema.d.ts +10 -0
- package/dist/setto-client.js +22378 -0
- package/dist/setto-client.js.map +1 -0
- package/dist/theme-target-utils.d.ts +7 -0
- package/dist/types.d.ts +62 -0
- package/dist/use-section-theme.d.ts +2 -0
- package/package.json +49 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CSSProperties, MouseEvent } from 'react';
|
|
2
|
+
/** Returns true when the click target is editable text or Setto UI chrome. */
|
|
3
|
+
export declare function isTextEditClick(target: HTMLElement): boolean;
|
|
4
|
+
/** True when the click landed on a nested theme target inside `container`. */
|
|
5
|
+
export declare function isNestedThemeTarget(target: HTMLElement, container: HTMLElement): boolean;
|
|
6
|
+
export declare function handleThemeTargetClick(e: MouseEvent<HTMLElement>, editMode: boolean, themeId: string, selected: boolean, selectSection: (id: string | null) => void, onClick?: (e: MouseEvent<HTMLElement>) => void): void;
|
|
7
|
+
export declare function themeTargetEditStyle(editMode: boolean, selected: boolean): CSSProperties;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { SectionSchema } from './section-schema';
|
|
2
|
+
export interface BrandColor {
|
|
3
|
+
/** Display name in the swatch picker, e.g. 'Beige'. */
|
|
4
|
+
label: string;
|
|
5
|
+
/** CSS colour value from the site palette, e.g. '#E6DCCF'. */
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SettoConfig {
|
|
9
|
+
/** Stable slug identifying the site, e.g. 'carryon-no'. */
|
|
10
|
+
siteId: string;
|
|
11
|
+
/** Base URL of setto-server, e.g. 'https://api.setto.no'. */
|
|
12
|
+
apiUrl: string;
|
|
13
|
+
/** Supabase project credentials. */
|
|
14
|
+
supabase: {
|
|
15
|
+
url: string;
|
|
16
|
+
anonKey: string;
|
|
17
|
+
};
|
|
18
|
+
/** Bundled section colour theme (used before / outside edit baseline). */
|
|
19
|
+
theme?: Record<string, Record<string, string>>;
|
|
20
|
+
/** GitHub path for the theme file, e.g. 'src/theme/sections.json'. */
|
|
21
|
+
themePath?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Site brand palette — the only colours offered in the section colour toolbar.
|
|
24
|
+
* Must match the tokens used in Tailwind/CSS on the host site.
|
|
25
|
+
*/
|
|
26
|
+
brandColors?: BrandColor[];
|
|
27
|
+
/**
|
|
28
|
+
* Per-section colour field definitions for the edit toolbar.
|
|
29
|
+
* Keys must match `sectionId` on `<SettoSection>`.
|
|
30
|
+
*/
|
|
31
|
+
sectionSchemas?: Record<string, SectionSchema>;
|
|
32
|
+
}
|
|
33
|
+
export interface DeploymentRow {
|
|
34
|
+
id: string;
|
|
35
|
+
site_id: string;
|
|
36
|
+
commit_sha: string;
|
|
37
|
+
vercel_deployment_id: string | null;
|
|
38
|
+
status: 'pending' | 'building' | 'ready' | 'error' | 'canceled';
|
|
39
|
+
url: string | null;
|
|
40
|
+
error_message: string | null;
|
|
41
|
+
started_at: string;
|
|
42
|
+
updated_at: string;
|
|
43
|
+
}
|
|
44
|
+
export interface SiteRow {
|
|
45
|
+
id: string;
|
|
46
|
+
display_name: string;
|
|
47
|
+
repo_owner: string;
|
|
48
|
+
repo_name: string;
|
|
49
|
+
branch: string;
|
|
50
|
+
content_paths: string[];
|
|
51
|
+
vercel_project_id: string;
|
|
52
|
+
allowed_origins: string[];
|
|
53
|
+
}
|
|
54
|
+
export interface ContentFile {
|
|
55
|
+
path: string;
|
|
56
|
+
content: string;
|
|
57
|
+
sha: string;
|
|
58
|
+
}
|
|
59
|
+
export interface PublishResult {
|
|
60
|
+
commitSha: string;
|
|
61
|
+
deploymentId: string;
|
|
62
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sevenfold/setto-client",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"packageManager": "bun@1.3.7",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/nitech/setto-client.git"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/setto-client.js",
|
|
15
|
+
"module": "./dist/setto-client.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/setto-client.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": ["dist"],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "vite build && tsc",
|
|
26
|
+
"dev": "vite build --watch",
|
|
27
|
+
"typecheck": "tsc --noEmit"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"i18next": ">=23.0.0",
|
|
31
|
+
"react": ">=18.0.0",
|
|
32
|
+
"react-dom": ">=18.0.0",
|
|
33
|
+
"react-i18next": ">=14.0.0"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@supabase/supabase-js": "^2.74.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/react": "^19.2.5",
|
|
40
|
+
"@types/react-dom": "^19.2.3",
|
|
41
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
42
|
+
"i18next": "^26.1.0",
|
|
43
|
+
"react": "^19.2.0",
|
|
44
|
+
"react-dom": "^19.2.0",
|
|
45
|
+
"react-i18next": "^17.0.7",
|
|
46
|
+
"typescript": "~5.9.3",
|
|
47
|
+
"vite": "^7.2.4"
|
|
48
|
+
}
|
|
49
|
+
}
|