@cloudparse/up-backoffice-sdk 0.1.1 → 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/theme.css CHANGED
@@ -8,34 +8,73 @@
8
8
  @source "./";
9
9
 
10
10
  @theme {
11
- /* Colors */
12
- --color-primary: #6366f1;
11
+ /*
12
+ * Colors: the light palette of the Studio (up/frontend globals.css), so a plugin looks native in it. The host
13
+ * stylesheet redefines the same values; both must stay equal.
14
+ */
15
+ --color-primary: #3a35b5;
13
16
  --color-primary-foreground: #ffffff;
17
+ --color-primary-soft: #e6e1ff;
18
+ --color-brand-deep: #23206b;
14
19
 
15
- --color-background: #0f172a;
16
- --color-foreground: #f8fafc;
20
+ --color-background: #f6f3f3;
21
+ --color-foreground: #121214;
22
+ --color-ink: #121214;
17
23
 
18
- --color-card: #1e293b;
19
- --color-card-foreground: #f8fafc;
24
+ --color-card: #ffffff;
25
+ --color-card-foreground: #121214;
20
26
 
21
- --color-muted: #475569;
22
- --color-muted-foreground: #94a3b8;
27
+ --color-muted: #d9d7e0;
28
+ --color-muted-foreground: #55565e;
29
+ --color-subtle: #6e6f78;
30
+ --color-body: #3a3b42;
23
31
 
24
- --color-accent: #38bdf8;
25
- --color-accent-foreground: #0f172a;
32
+ --color-accent: #ff8fc7;
33
+ --color-accent-foreground: #121214;
34
+ --color-accent-ink: #9e1f58;
35
+ --color-accent-soft: #ffe3f1;
26
36
 
27
- --color-success: #10b981;
28
- --color-warning: #f59e0b;
29
- --color-error: #ef4444;
37
+ /* Lines and soft surfaces (borders, table rows, inputs, hover). */
38
+ --color-line: #eceaf0;
39
+ --color-row-line: #f0eef3;
40
+ --color-input-line: #e3e0ea;
41
+ --color-soft: #f2f1f5;
42
+ --color-row-hover: #faf9fb;
43
+
44
+ --color-success: #145c39;
45
+ --color-success-soft: #d9f2e6;
46
+ --color-warning: #b54708;
47
+ --color-warning-soft: #fff1e0;
48
+ --color-error: #b42318;
49
+ --color-error-soft: #fee4e2;
50
+
51
+ /* Dark surface kept inside the light UI (code and response panes of the GraphQL playground). */
52
+ --color-night: #121214;
53
+ --color-night-foreground: #f4f3f8;
30
54
 
31
55
  /* Spacing & Radius */
32
56
  --spacing-container: 2rem;
33
- --radius-lg: 0.75rem;
34
- --radius-md: 0.5rem;
35
- --radius-sm: 0.25rem;
57
+ --radius-lg: 1.5rem;
58
+ --radius-md: 0.875rem;
59
+ --radius-sm: 0.625rem;
60
+
61
+ --shadow-card:
62
+ 0 0 0 1px rgb(18 18 20 / 0.05), 0 8px 24px -16px rgb(35 32 107 / 0.2);
63
+ --shadow-lift:
64
+ 0 0 0 1px rgb(18 18 20 / 0.05), 0 24px 50px -24px rgb(35 32 107 / 0.35);
36
65
 
37
- /* Typography */
66
+ /*
67
+ * Typography: the Up pair of the shell. Figtree for every piece of UI copy
68
+ * (`font-sans`), Bricolage Grotesque for display headings (`font-display`:
69
+ * page, section and modal titles, card headlines). The SDK ships no font file:
70
+ * the host loads both faces (next/font registers them under these family
71
+ * names) and plugins get them through the host stylesheets.
72
+ */
38
73
  --font-sans:
39
- "Outfit", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
74
+ "Figtree", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
40
75
  "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
76
+ --font-display:
77
+ "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system,
78
+ BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
79
+ "Noto Sans", sans-serif;
41
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudparse/up-backoffice-sdk",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "description": "SDK to build Up backoffice plugins: plugin contract, host loader, UI primitives and Vite build plugin",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -41,7 +41,7 @@
41
41
  "*.css"
42
42
  ],
43
43
  "engines": {
44
- "node": ">=22"
44
+ "node": ">=26"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugin/contract.ts"],"sourcesContent":["import type { ComponentType, ReactElement } from \"react\";\nimport type { HttpClient } from \"../api/ApiService\";\n\n/**\n * Version of the host <-> plugin contract. The host refuses a plugin built\n * against another major contract. Bump only on a breaking change of the types\n * below (and bump the SDK major version with it).\n */\nexport const PLUGIN_CONTRACT_VERSION = 1;\n\n/** Global the backoffice host fills with the modules it shares with plugins. */\nexport const SHARED_MODULES_GLOBAL = \"__UP_BACKOFFICE_SHARED__\";\n\n/** Modules a plugin never bundles: the host provides its own instance at runtime. */\nexport const SHARED_MODULE_IDS = [\n \"react\",\n \"react-dom\",\n \"react/jsx-runtime\",\n] as const;\n\nexport type SharedModuleId = (typeof SHARED_MODULE_IDS)[number];\n\nexport type IconComponent = ComponentType<{ className?: string }>;\n\n/** Mini-app the plugin belongs to, as registered in the Up backend. */\nexport interface PluginApplication {\n uuid: string;\n name: string;\n /** Base URL of the mini-app backend, e.g. `https://api.explore.up.cloudparse.fr/api/v1`. */\n httpBackendUrl: string | null;\n wsBackendUrl: string | null;\n iconUrl: string | null;\n}\n\n/** Admin currently logged into the backoffice. */\nexport interface PluginUser {\n uuid: string;\n fullName: string;\n admin: boolean;\n}\n\n/** Everything the backoffice host gives a plugin when it renders one of its pages. */\nexport interface PluginHost {\n contractVersion: number;\n application: PluginApplication;\n user: PluginUser | null;\n /** Client for the Up hub backend, authenticated with the admin session. */\n hubApi: HttpClient;\n /**\n * Client for the mini-app backend (`application.httpBackendUrl`), authenticated\n * with an admin scoped token minted and refreshed by the host.\n */\n miniappApi: HttpClient;\n /** Returns a valid admin scoped token for the mini-app (refreshed when expired). */\n getScopeToken(): Promise<string | null>;\n /** Absolute backoffice path of the plugin root, e.g. `/dashboard/plugins/<uuid>`. */\n basePath: string;\n /** Navigates to a page of this plugin (`\"\"` is the root page). */\n navigate(pagePath: string): void;\n}\n\n/** One page of a plugin, reachable at `<basePath>/<path>`. */\nexport interface PluginPage {\n /** Path relative to the plugin root, without leading slash. `\"\"` is the root page. */\n path: string;\n title: string;\n description?: string;\n icon?: IconComponent;\n /** Short label shown on the page card (e.g. \"Backoffice CRUD\"). */\n badge?: string;\n component: ComponentType;\n}\n\n/** What a plugin author passes to `definePlugin`. */\nexport interface BackofficePluginDefinition {\n /** Stable identifier, lowercase (e.g. `explore`). */\n id: string;\n name: string;\n description?: string;\n icon?: IconComponent;\n pages: PluginPage[];\n /** Compiled CSS of the plugin, injected by the host (`import styles from \"./styles.css?inline\"`). */\n styles?: string;\n}\n\n/** Default export of a built plugin bundle, as the host receives it. */\nexport interface BackofficePluginModule\n extends Omit<BackofficePluginDefinition, \"pages\"> {\n contractVersion: number;\n sdkVersion: string;\n pages: Omit<PluginPage, \"component\">[];\n /** Renders a page wrapped in the plugin's own SDK context. */\n renderPage(pagePath: string, host: PluginHost): ReactElement | null;\n}\n"],"mappings":";;;AAQO,IAAM,0BAA0B;AAGhC,IAAM,wBAAwB;AAG9B,IAAM,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACF;","names":[]}