@cloudparse/up-backoffice-sdk 0.1.1 → 0.2.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.
@@ -1 +1 @@
1
- { "version": "0.1.0" }
1
+ { "version": "0.1.1" }
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: up-backoffice-plugin-builder
3
- description: Build an Up backoffice plugin (a mini-app's admin dashboards) with @cloudparse/up-backoffice-sdk. Use when creating or editing a `backoffice-plugin/` folder, adding an admin page for a mini-app, using the backoffice UI kit (PageHeader, Modal, Table, DangerZone, useDangerZoneDelete, ImageUpload, StatTile...), calling a mini-app backend from the backoffice (miniappApi), or publishing/loading a plugin. Triggers include "backoffice plugin", "backoffice-plugin", "@cloudparse/up-backoffice-sdk", "definePlugin", "miniappApi", "admin dashboard for <mini-app>", "plugin bundle".
3
+ description: Build an Up backoffice plugin (a mini-app's admin dashboards) with @cloudparse/up-backoffice-sdk. Use when creating or editing a `backoffice-plugin/` folder, adding an admin page for a mini-app, using the backoffice UI kit (SectionHeader, Modal, Table, DangerZone, useDangerZoneDelete, ImageUpload, StatTile...), calling a mini-app backend from the backoffice (miniappApi), or publishing/loading a plugin. Triggers include "backoffice plugin", "backoffice-plugin", "@cloudparse/up-backoffice-sdk", "definePlugin", "miniappApi", "admin dashboard for <mini-app>", "plugin bundle".
4
4
  ---
5
5
 
6
6
  # Building an Up backoffice plugin
7
7
 
8
- A backoffice plugin is a mini-app's admin dashboards. It lives in the mini-app repo, in `backoffice-plugin/`, is built into one ES module (`dist/plugin.js`), published to the Up hub backend, and loaded at runtime by the backoffice (`up/backoffice`), which renders its pages inside its own layout. The plugin runs with the admin's session on purpose: it is admin code.
8
+ A backoffice plugin is a mini-app's admin dashboards. It lives in the mini-app repo, in `backoffice-plugin/`, is built into one ES module (`dist/plugin.js`), published to the Up hub backend, and loaded at runtime by the backoffice (`up/backoffice`), which renders its pages in a sandboxed iframe inside its own layout. The plugin never sees the admin's session: its `hubApi` and `miniappApi` calls go through a message bridge and are executed by the host (hub calls limited to its own application's allowlisted routes), so `window.open`, `alert`, cookies and web storage do not work in a plugin (an `https:` link is opened by the host through the bridge's `openExternal`).
9
9
 
10
10
  ## Workflow
11
11
 
@@ -10,5 +10,5 @@ Before saying a plugin change is done:
10
10
  - [ ] Lists: `TableContainer`/`Table*`, `TableEmpty` for no rows, `RowActions` + `IconButton`, `LoadMoreButton` for cursor pages.
11
11
  - [ ] Hard deletes: `useDangerZoneDelete` + `DangerZone` + `confirmModal` + `Banner` for its error.
12
12
  - [ ] Forms: `Modal dismissible={!saving}` + `ModalActions` inside the `<form>`; images through `ImageUpload` (WebP), uploaded on save.
13
- - [ ] Page title through `PageHeader`, with `AuthStatusBadge` when the page depends on the mini-app backend.
13
+ - [ ] No page-level title: the backoffice already shows the plugin name and the selected page tab (no `PageHeader` in plugin pages). No token badge either: the backoffice shows the token state next to the plugin title.
14
14
  - [ ] Published locally (`sp task backoffice plugins`) and checked in the backoffice at `/dashboard/plugins/<applicationUuid>`: pages load, actions work, no console error, the backoffice layout (sidebar) is unchanged.
@@ -33,7 +33,6 @@ const deletion = useDangerZoneDelete({
33
33
  resolveName: (uuid) => collections.find((c) => c.uuid === uuid)?.name ?? null,
34
34
  });
35
35
 
36
- <PageHeader actions={<AuthStatusBadge authError={authError} />} bordered icon={Compass} title="Explore management" />
37
36
  {deletion.error && <Banner message={deletion.error} onClose={deletion.clearError} variant="error" />}
38
37
  <TableContainer>
39
38
  <Table>
@@ -57,7 +56,7 @@ const deletion = useDangerZoneDelete({
57
56
  {deletion.confirmModal}
58
57
  ```
59
58
 
60
- Detect auth problems: `if (isApiError(err) && (err.status === 401 || err.status === 403)) setAuthError(true);`
59
+ No auth-state plumbing for the header: the backoffice shows the token badge itself from the calls it runs. Keep an auth-error state only when the page itself needs it (e.g. `GraphQLPlayground`'s `authError` prop).
61
60
 
62
61
  ## Form in a modal
63
62
 
@@ -143,5 +142,5 @@ The host shows tabs for the pages. Navigate from code with `usePluginHost().navi
143
142
 
144
143
  ## Publish
145
144
 
146
- - Local: add the plugin to the `backoffice-plugins` task of `starter-pack/orgs/up/services.yaml` (`-plugin APP_NAME=../miniapps/<repo>/backoffice-plugin/dist/plugin.js`), then `sp task backoffice plugins`.
145
+ - Local: add the plugin to the `backoffice-plugins` task of `starter-pack/orgs/up/organisations/default/services.yaml` (`-plugin APP_NAME=../miniapps/<repo>/backoffice-plugin/dist/plugin.js`), then `sp task backoffice plugins`.
147
146
  - Any environment: `curl -X POST "$HUB/api/v1/admin/applications/$APP_UUID/backoffice-plugin/artifacts" -H "Authorization: Bearer $ADMIN_TOKEN" -H "X-App-Secret: $APP_SECRET" -F version=1.2.0 -F changelog="..." -F file=@dist/plugin.js` (activates the version; `-F activate=false` to stage it). Manage versions in the backoffice at `/dashboard/plugins`.
@@ -8,7 +8,7 @@
8
8
  4. **No `alert()`, `confirm()`, `prompt()`.** Errors go in a `Banner`; confirmations in `ConfirmModal`; hard deletes through `useDangerZoneDelete` + `DangerZone`.
9
9
  5. **Backend access only through `miniappApi` / `hubApi`.** No `fetch`, no hardcoded URL, no `process.env`/`import.meta.env` backend URL: the base URL is the application's `httpBackendUrl`, configured in the backoffice (Mini-Apps page).
10
10
  6. **`isApiError()`, never `instanceof ApiError`.** Errors are thrown by the host's copy of the SDK.
11
- 7. **Backoffice conventions apply** (it is admin code, not mini-app WebView code): English UI text, Outfit (inherited), typography scale (`PageHeader`/`SectionHeader`/`Badge`...), Tailwind theme tokens, no arbitrary values (`text-[10px]`, `rounded-[2rem]`), no `any`, parallel DTO/model types with typed mappers, one component per file, alphabetical dynamic `Select` options.
11
+ 7. **Backoffice conventions apply** (it is admin code, not mini-app WebView code): English UI text, fonts inherited from the host (Figtree for UI copy, Bricolage Grotesque through `font-display` for page/section/modal titles and card headlines; never load a font in a plugin), typography scale (`SectionHeader`/`Badge`...; no page-level `PageHeader` in a plugin), Tailwind theme tokens, no arbitrary values (`text-[10px]`, `rounded-[2rem]`), no `any`, parallel DTO/model types with typed mappers, one component per file, alphabetical dynamic `Select` options.
12
12
  8. **WebP only** for every image upload (`ImageUpload` or `assertWebp`). Upload on save, never on select.
13
13
  9. **No `next/*` imports**, no Node APIs: the plugin runs in the browser outside Next.js.
14
14
  10. **Stable id.** `definePlugin({ id })` names the plugin's style slot and CSS scope; never change it between versions.
@@ -20,6 +20,6 @@
20
20
  - **"Plugin bundle checksum mismatch"**: the file served differs from the published one. Re-publish; never edit a bundle in storage.
21
21
  - **"Shared module react is not provided"**: the bundle was loaded outside the backoffice, or built without `backofficePlugin()`.
22
22
  - **"Invalid hook call" / two Reacts**: React got bundled (plugin order in `vite.config.ts`, or a `react` import aliased elsewhere). `grep -c __UP_BACKOFFICE_SHARED__ dist/plugin.js` must be 3.
23
- - **401 from the mini-app backend**: the admin scoped token could not be minted (the admin is not admin anymore, or the application UUID is wrong). Show `AuthStatusBadge` and keep the page usable.
23
+ - **401 from the mini-app backend**: the admin scoped token could not be minted (the admin is not admin anymore, or the application UUID is wrong). The backoffice shows "Auth error" next to the plugin title by itself; keep the page usable.
24
24
  - **Empty page and a warning about `httpBackendUrl`**: the application has no backend URL in the hub; set it on the Mini-Apps page.
25
25
  - **SDK not published yet**: depend on a local checkout with `"@cloudparse/up-backoffice-sdk": "file:<path>"` and `install-links=true` in `.npmrc` (a symlink would duplicate React). Re-run `npm install` after each SDK change.
@@ -13,7 +13,7 @@ Import everything a plugin uses from `@cloudparse/up-backoffice-sdk`. `/host` is
13
13
  | `usePluginHost()` | Inside a page: `PluginHost` = `{ application: { uuid, name, httpBackendUrl, wsBackendUrl, iconUrl }, user: { uuid, fullName, admin } \| null, hubApi, miniappApi, getScopeToken(), basePath, navigate(pagePath), contractVersion }` |
14
14
  | `miniappApi` | `HttpClient` on the application's `httpBackendUrl` (ends with `/api/v1`), admin scoped token attached and refreshed by the host. Usable from module-level services once a page is mounted. |
15
15
  | `hubApi` | `HttpClient` on the Up hub backend with the admin session (paths start with `/api/v1/...`). |
16
- | `getScopeToken()` | `Promise<string \| null>`: the current admin scoped token (e.g. for a GraphQL playground "token" state). |
16
+ | `getScopeToken()` | `Promise<string \| null>`: the current admin scoped token, for a raw call that cannot go through `miniappApi`. Not needed for a token badge: the backoffice shows the token state next to the plugin title. |
17
17
  | `HttpClient` | `get<T>(path, { params? })`, `post<T>(path, body?, opts?)`, `put`, `patch`, `delete<T>(path)`, `getBlob(path)`, `getText(path)`, `baseUrl`. JSON by default, `FormData` bodies sent as multipart. Errors throw `ApiError`. |
18
18
  | `ApiService` | `new ApiService(baseUrl)` + `setToken`, `setTokenLoader`, `setUnauthorizedCallback`: the `HttpClient` implementation (hosts and tools; plugins use `miniappApi`/`hubApi`). |
19
19
  | `PLUGIN_CONTRACT_VERSION` | Contract version stamped by `definePlugin`; the host refuses another one. |
@@ -23,11 +23,11 @@ Import everything a plugin uses from `@cloudparse/up-backoffice-sdk`. `/host` is
23
23
 
24
24
  | Component | Props |
25
25
  |---|---|
26
- | `PageHeader` | `title, icon?, description?, eyebrow?, actions?: ReactNode, bordered?` — the page `h1`. |
26
+ | `PageHeader` | `title, icon?, description?, eyebrow?, actions?: ReactNode, bordered?` — the page `h1` of the backoffice itself; plugin pages do not use it (the host shows the plugin name and the page tab). |
27
27
  | `SectionHeader` | `title, icon?, description?, actions?, variant?: "section" \| "label"` — `h2` or the small uppercase label above a list. |
28
28
  | `Card` | `padding?: "lg" \| "md" \| "none", interactive?, variant?: "glass" \| "solid"` + div props. |
29
29
  | `StatTile` | `icon, label, value, hint?, onClick?, active?` — KPI tile; with `onClick` it is a button (tab selector). |
30
- | `AuthStatusBadge` | `authError: boolean` — "Active token" / "Auth error" pill for `PageHeader.actions`. |
30
+ | `AuthStatusBadge` | `authError: boolean` — "Active token" / "Auth error" pill. Not in plugin pages: the backoffice shows the token state next to the plugin title itself (from the mini-app calls it runs). |
31
31
  | `Badge` | `variant?: "primary" \| "accent" \| "success" \| "warning" \| "error" \| "muted" \| "outline"` + span props. |
32
32
  | `Banner` | `message: string, variant: "success" \| "warning" \| "error", onClose?` — every error/success message. |
33
33
  | `EmptyState` | `icon, title, description?, action?` |
@@ -77,7 +77,7 @@ Import everything a plugin uses from `@cloudparse/up-backoffice-sdk`. `/host` is
77
77
 
78
78
  | Export | Use |
79
79
  |---|---|
80
- | `GraphQLPlayground` | `presets: { name, description, query, variables? }[], onExecute(query, variables), title?, description?, hasToken?, authError?, onConfigureToken?` |
80
+ | `GraphQLPlayground` | `presets: { name, description, query, variables? }[], onExecute(query, variables), title?, description?, hasToken?, authError?, onConfigureToken?` — in plugins, do not pass the three token props (they draw a second token badge; the backoffice already shows it next to the title). |
81
81
  | `RemoteImage` | `src` + img props — image with an error placeholder. |
82
82
  | `useCopyToClipboard(resetMs?)` | `{ copied, copy(text) }` |
83
83
  | `useModalLock({ onEscape? })` | Callback ref: scroll lock + focus trap for a custom overlay; nested locks stack (topmost handles Tab/Escape). Prefer `Modal`. |
@@ -3,7 +3,7 @@
3
3
  Backoffice plugin of the __PLUGIN_NAME__ mini-app: its admin dashboards, loaded at runtime by the Up backoffice. Built with `@cloudparse/up-backoffice-sdk`.
4
4
 
5
5
  - Entry: `src/index.tsx` default-exports `definePlugin({ id: "__PLUGIN_ID__", name, pages, styles })`.
6
- - This is backoffice admin code: use the SDK UI kit (`PageHeader`, `Modal`, `Table`, `DangerZone` + `useDangerZoneDelete`, ...), English UI text, Tailwind theme tokens, no arbitrary values, no `any`, never `alert()`/`confirm()`.
6
+ - This is backoffice admin code: use the SDK UI kit (`SectionHeader`, `Modal`, `Table`, `DangerZone` + `useDangerZoneDelete`, ...), English UI text, Tailwind theme tokens, no arbitrary values, no `any`, never `alert()`/`confirm()`. No page-level title (`PageHeader`): the backoffice shows the plugin name and the selected page tab.
7
7
  - Backend calls go through `miniappApi` (base URL = the application's `httpBackendUrl`, already ending with `/api/v1`; admin scoped token minted by the host). Check errors with `isApiError()`, never `instanceof ApiError`.
8
8
  - `npm run build` -> `dist/plugin.js` (one ES module, React provided by the backoffice). Publish it to the hub backend: `POST /api/v1/admin/applications/<applicationUuid>/backoffice-plugin/artifacts` (admin token + `X-App-Secret`), or locally with `sp task backoffice plugins`.
9
9
  - Before finishing: `npm run lint && npm run build`.
@@ -1,14 +1,11 @@
1
1
  import {
2
- AuthStatusBadge,
3
2
  Banner,
4
3
  CopyableUuid,
5
4
  DangerZone,
6
5
  dayjs,
7
6
  IconButton,
8
- isApiError,
9
7
  LoadingState,
10
8
  LoadMoreButton,
11
- PageHeader,
12
9
  RowActions,
13
10
  Table,
14
11
  TableBody,
@@ -22,7 +19,7 @@ import {
22
19
  } from "@cloudparse/up-backoffice-sdk";
23
20
  import type { Item } from "@plugin/features/__PLUGIN_ID__/types";
24
21
  import { __PLUGIN_CAMEL__Service } from "@plugin/services/__PLUGIN_ID__";
25
- import { Inbox, LayoutDashboard, Trash2 } from "lucide-react";
22
+ import { Inbox, Trash2 } from "lucide-react";
26
23
  import { useCallback, useEffect, useState } from "react";
27
24
 
28
25
  export function AdminPage() {
@@ -31,7 +28,6 @@ export function AdminPage() {
31
28
  const [loading, setLoading] = useState(true);
32
29
  const [loadingMore, setLoadingMore] = useState(false);
33
30
  const [error, setError] = useState<string | null>(null);
34
- const [authError, setAuthError] = useState(false);
35
31
 
36
32
  const fetchItems = useCallback(async (cursor?: string) => {
37
33
  if (cursor) setLoadingMore(true);
@@ -41,11 +37,7 @@ export function AdminPage() {
41
37
  const page = await __PLUGIN_CAMEL__Service.list(cursor);
42
38
  setItems((prev) => (cursor ? [...prev, ...page.items] : page.items));
43
39
  setNextCursor(page.nextCursor);
44
- setAuthError(false);
45
40
  } catch (err) {
46
- if (isApiError(err) && (err.status === 401 || err.status === 403)) {
47
- setAuthError(true);
48
- }
49
41
  setError((err as Error).message);
50
42
  } finally {
51
43
  setLoading(false);
@@ -69,14 +61,6 @@ export function AdminPage() {
69
61
 
70
62
  return (
71
63
  <div className="space-y-8">
72
- <PageHeader
73
- actions={<AuthStatusBadge authError={authError} />}
74
- bordered
75
- description="Manage the __PLUGIN_NAME__ items."
76
- icon={LayoutDashboard}
77
- title="__PLUGIN_NAME__ management"
78
- />
79
-
80
64
  {error && <Banner message={error} variant="error" />}
81
65
  {deletion.error && (
82
66
  <Banner
@@ -14,4 +14,4 @@ export {
14
14
  SHARED_MODULES_GLOBAL,
15
15
  SHARED_MODULE_IDS
16
16
  };
17
- //# sourceMappingURL=chunk-PSBYWSHV.js.map
17
+ //# sourceMappingURL=chunk-MP4V2XB6.js.map
@@ -0,0 +1 @@
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 /**\n * Client for the Up hub backend. In the backoffice the calls go through the plugin frame's\n * message bridge and are executed by the host with the admin session, limited to the\n * allowlisted routes of the plugin's own application.\n */\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":[]}
@@ -74,7 +74,11 @@ interface PluginHost {
74
74
  contractVersion: number;
75
75
  application: PluginApplication;
76
76
  user: PluginUser | null;
77
- /** Client for the Up hub backend, authenticated with the admin session. */
77
+ /**
78
+ * Client for the Up hub backend. In the backoffice the calls go through the plugin frame's
79
+ * message bridge and are executed by the host with the admin session, limited to the
80
+ * allowlisted routes of the plugin's own application.
81
+ */
78
82
  hubApi: HttpClient;
79
83
  /**
80
84
  * Client for the mini-app backend (`application.httpBackendUrl`), authenticated
package/dist/host.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as BackofficePluginModule, S as SharedModuleId } from './contract-88aU9QZl.js';
2
- export { P as PLUGIN_CONTRACT_VERSION, a as PluginApplication, b as PluginHost, c as PluginUser, d as SHARED_MODULE_IDS } from './contract-88aU9QZl.js';
1
+ import { B as BackofficePluginModule, S as SharedModuleId } from './contract-BsybHbZ-.js';
2
+ export { P as PLUGIN_CONTRACT_VERSION, a as PluginApplication, b as PluginHost, c as PluginUser, d as SHARED_MODULE_IDS } from './contract-BsybHbZ-.js';
3
3
  import 'react';
4
4
 
5
5
  type SharedRegistry = Record<SharedModuleId, unknown>;
package/dist/host.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  PLUGIN_CONTRACT_VERSION,
4
4
  SHARED_MODULES_GLOBAL,
5
5
  SHARED_MODULE_IDS
6
- } from "./chunk-PSBYWSHV.js";
6
+ } from "./chunk-MP4V2XB6.js";
7
7
 
8
8
  // src/host/index.ts
9
9
  function installSharedModules(modules) {
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference types="dayjs/plugin/localizedFormat" />
2
2
  /// <reference types="dayjs/plugin/relativeTime" />
3
- import { H as HttpClient, b as PluginHost, e as BackofficePluginDefinition, B as BackofficePluginModule, I as IconComponent } from './contract-88aU9QZl.js';
4
- export { A as ApiService, F as FetchOptions, P as PLUGIN_CONTRACT_VERSION, a as PluginApplication, f as PluginPage, c as PluginUser } from './contract-88aU9QZl.js';
3
+ import { H as HttpClient, b as PluginHost, e as BackofficePluginDefinition, B as BackofficePluginModule, I as IconComponent } from './contract-BsybHbZ-.js';
4
+ export { A as ApiService, F as FetchOptions, P as PLUGIN_CONTRACT_VERSION, a as PluginApplication, f as PluginPage, c as PluginUser } from './contract-BsybHbZ-.js';
5
5
  import * as react from 'react';
6
6
  import { ReactNode, HTMLAttributes, ButtonHTMLAttributes, LabelHTMLAttributes, InputHTMLAttributes, ImgHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, TextareaHTMLAttributes } from 'react';
7
7
  import { ClassValue } from 'clsx';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  PLUGIN_CONTRACT_VERSION
4
- } from "./chunk-PSBYWSHV.js";
4
+ } from "./chunk-MP4V2XB6.js";
5
5
 
6
6
  // src/api/ApiError.ts
7
7
  var ApiError = class _ApiError extends Error {
@@ -358,7 +358,7 @@ function ConfirmModal({
358
358
  /* @__PURE__ */ jsxs2(
359
359
  "h2",
360
360
  {
361
- className: "text-2xl font-black tracking-tight uppercase flex items-center gap-3",
361
+ className: "text-2xl font-display font-extrabold tracking-tight uppercase flex items-center gap-3",
362
362
  id: titleId,
363
363
  children: [
364
364
  /* @__PURE__ */ jsx2(
@@ -559,7 +559,7 @@ function definePlugin(definition) {
559
559
  const Page = page.component;
560
560
  return /* @__PURE__ */ jsx4(PluginHostContext.Provider, { value: host, children: /* @__PURE__ */ jsx4(Page, {}) });
561
561
  },
562
- sdkVersion: "0.1.1"
562
+ sdkVersion: "0.2.0"
563
563
  };
564
564
  }
565
565
 
@@ -775,7 +775,7 @@ function DangerZone({
775
775
  id,
776
776
  children: [
777
777
  /* @__PURE__ */ jsxs7("div", { className: "space-y-1", children: [
778
- /* @__PURE__ */ jsxs7("h2", { className: "text-lg font-bold flex items-center gap-2.5 text-error", children: [
778
+ /* @__PURE__ */ jsxs7("h2", { className: "text-lg font-display font-bold flex items-center gap-2.5 text-error", children: [
779
779
  /* @__PURE__ */ jsx12(AlertTriangle3, { className: "w-5 h-5 shrink-0" }),
780
780
  "Danger Zone \u2014 Definitive Deletion"
781
781
  ] }),
@@ -823,7 +823,7 @@ function EmptyState({
823
823
  className: `flex flex-col items-center justify-center text-center gap-2 py-12 ${className}`,
824
824
  children: [
825
825
  /* @__PURE__ */ jsx13(Icon, { className: "w-8 h-8 text-muted-foreground mb-2" }),
826
- /* @__PURE__ */ jsx13("h3", { className: "text-lg font-bold", children: title }),
826
+ /* @__PURE__ */ jsx13("h3", { className: "text-lg font-display font-bold", children: title }),
827
827
  description && /* @__PURE__ */ jsx13("p", { className: "text-sm text-muted-foreground max-w-xs", children: description }),
828
828
  action && /* @__PURE__ */ jsx13("div", { className: "mt-3", children: action })
829
829
  ]
@@ -923,7 +923,7 @@ function GraphQLPlayground({
923
923
  /* @__PURE__ */ jsxs9("div", { className: "space-y-1", children: [
924
924
  /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
925
925
  /* @__PURE__ */ jsx14("span", { className: "p-2 bg-primary/10 rounded-xl text-primary shrink-0", children: /* @__PURE__ */ jsx14(Terminal, { className: "w-5 h-5" }) }),
926
- /* @__PURE__ */ jsx14("h2", { className: "text-2xl font-black tracking-tight uppercase", children: title })
926
+ /* @__PURE__ */ jsx14("h2", { className: "text-2xl font-display font-extrabold tracking-tight uppercase", children: title })
927
927
  ] }),
928
928
  /* @__PURE__ */ jsx14("p", { className: "text-muted-foreground text-xs font-medium max-w-xl", children: description })
929
929
  ] }),
@@ -1414,15 +1414,15 @@ function parseMarkdown(md) {
1414
1414
  );
1415
1415
  html = html.replace(
1416
1416
  /^### (.*$)/gim,
1417
- '<h3 class="text-sm font-bold mt-4 mb-2 text-white">$1</h3>'
1417
+ '<h3 class="text-sm font-display font-bold mt-4 mb-2 text-white">$1</h3>'
1418
1418
  );
1419
1419
  html = html.replace(
1420
1420
  /^## (.*$)/gim,
1421
- '<h2 class="text-base font-black mt-5 mb-2 text-white border-b border-white/5 pb-1">$1</h2>'
1421
+ '<h2 class="text-base font-display font-extrabold mt-5 mb-2 text-white border-b border-white/5 pb-1">$1</h2>'
1422
1422
  );
1423
1423
  html = html.replace(
1424
1424
  /^# (.*$)/gim,
1425
- '<h1 class="text-lg font-black mt-6 mb-3 text-primary">$1</h1>'
1425
+ '<h1 class="text-lg font-display font-extrabold mt-6 mb-3 text-primary">$1</h1>'
1426
1426
  );
1427
1427
  html = html.replace(
1428
1428
  /\*\*([^*]+)\*\*/g,
@@ -1720,7 +1720,7 @@ function Modal({
1720
1720
  /* @__PURE__ */ jsx21(
1721
1721
  "h2",
1722
1722
  {
1723
- className: "text-2xl font-black tracking-tight uppercase",
1723
+ className: "text-2xl font-display font-extrabold tracking-tight uppercase",
1724
1724
  id: titleId,
1725
1725
  children: title
1726
1726
  }
@@ -1816,7 +1816,7 @@ function PageHeader({
1816
1816
  children: [
1817
1817
  /* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-2 min-w-0", children: [
1818
1818
  eyebrow && /* @__PURE__ */ jsx22("p", { className: "text-xs font-black uppercase tracking-widest text-primary", children: eyebrow }),
1819
- /* @__PURE__ */ jsxs15("h1", { className: "text-3xl font-black tracking-tight uppercase flex items-center gap-3", children: [
1819
+ /* @__PURE__ */ jsxs15("h1", { className: "text-3xl font-display font-extrabold tracking-tight uppercase flex items-center gap-3", children: [
1820
1820
  Icon && /* @__PURE__ */ jsx22(Icon, { className: "w-8 h-8 text-primary shrink-0" }),
1821
1821
  title
1822
1822
  ] }),
@@ -1947,7 +1947,7 @@ function SectionHeader({
1947
1947
  {
1948
1948
  className: cn(
1949
1949
  "flex items-center gap-2",
1950
- variant === "section" ? "text-2xl font-black tracking-tight uppercase" : "text-xs font-black uppercase tracking-widest text-muted-foreground"
1950
+ variant === "section" ? "text-2xl font-display font-extrabold tracking-tight uppercase" : "text-xs font-black uppercase tracking-widest text-muted-foreground"
1951
1951
  ),
1952
1952
  children: [
1953
1953
  Icon && /* @__PURE__ */ jsx25(