@danxbot/plugin-sdk 0.2.35 → 0.2.36
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 -0
- package/dist/card-kit.d.ts +58 -28
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -41,6 +41,8 @@ export function CardView({ card, mutation }: CardViewProps) {
|
|
|
41
41
|
|
|
42
42
|
`vite build` writes the plugin to `dist/`: `index.js` (the entry), `chunks/` for code splitting, `index.css`, source maps, and `danx-plugin.json`, the manifest listing every file with its size and sha256 and the runtime majors the plugin was built against.
|
|
43
43
|
|
|
44
|
+
A plugin styles itself with its own CSS (import a `.css` file; the build emits it as `index.css`) over the design system's runtime tokens such as `var(--surface)` and `var(--accent)`: the app's stylesheet holds only the utility classes the app's own source uses, so a utility class in a plugin may be missing at run time. A plugin changes cards with the kit's writes (`createCard`, `editCard`, `transitionCard`). A list view about one card type reads its cards with `useCardsOfType(scope, type)`, never by filtering `useBoardLaneState`'s lanes: those hold a window of each status, so cards would go missing.
|
|
45
|
+
|
|
44
46
|
The build refuses to bundle a copy of React, React DOM, `@danxbot/ui` or `react-router`: import only the specifiers above. For routing, use the kit's `Link` and `useNavigate`; `StandardCardPage` reads the plan the page was opened from out of the URL, so a view that wraps it passes only `{card, mutation}`.
|
|
45
47
|
|
|
46
48
|
## The card kit is a contract
|
package/dist/card-kit.d.ts
CHANGED
|
@@ -583,6 +583,7 @@ declare module "@danxbot/card-kit@1" {
|
|
|
583
583
|
interface LiveQueryResult<T> {
|
|
584
584
|
data: T | null;
|
|
585
585
|
loading: boolean;
|
|
586
|
+
refreshing?: boolean;
|
|
586
587
|
error: Error | null;
|
|
587
588
|
connection: ConnectionState;
|
|
588
589
|
refetch: () => void;
|
|
@@ -1177,6 +1178,18 @@ declare module "@danxbot/card-kit@1" {
|
|
|
1177
1178
|
|
|
1178
1179
|
type LifecycleAction = Extract<TransitionAction, "ready" | "unready" | "complete" | "cancel" | "reopen">;
|
|
1179
1180
|
|
|
1181
|
+
interface CardEditPatch {
|
|
1182
|
+
title?: string;
|
|
1183
|
+
description?: string;
|
|
1184
|
+
summary?: string | null;
|
|
1185
|
+
pull_request_url?: string | null;
|
|
1186
|
+
priority?: number;
|
|
1187
|
+
type?: CardTypeKey;
|
|
1188
|
+
parent_id?: string | null;
|
|
1189
|
+
effort_level?: EffortLevelName;
|
|
1190
|
+
content_hash?: string;
|
|
1191
|
+
}
|
|
1192
|
+
function editCard(id: string, patch: CardEditPatch): Promise<void>;
|
|
1180
1193
|
function transitionCard(id: string, action: LifecycleAction | "unblock" | "archive"): Promise<void>;
|
|
1181
1194
|
type PriorityPlacement = {
|
|
1182
1195
|
side: "after" | "before";
|
|
@@ -1213,6 +1226,47 @@ declare module "@danxbot/card-kit@1" {
|
|
|
1213
1226
|
run: (key: string, failureTitle: string, op: () => Promise<void>) => Promise<boolean>;
|
|
1214
1227
|
}
|
|
1215
1228
|
function useCardMutation(): CardMutation;
|
|
1229
|
+
|
|
1230
|
+
type PlanWire = number | {
|
|
1231
|
+
name: string;
|
|
1232
|
+
} | null;
|
|
1233
|
+
|
|
1234
|
+
interface NewCardInput {
|
|
1235
|
+
board: string;
|
|
1236
|
+
type: CardTypeKey;
|
|
1237
|
+
title: string;
|
|
1238
|
+
priority: number;
|
|
1239
|
+
plan: PlanWire;
|
|
1240
|
+
description: string;
|
|
1241
|
+
}
|
|
1242
|
+
function createCard(input: NewCardInput): Promise<string>;
|
|
1243
|
+
|
|
1244
|
+
interface ChildProgress {
|
|
1245
|
+
done: number;
|
|
1246
|
+
total: number;
|
|
1247
|
+
}
|
|
1248
|
+
interface CardStatusPresentation {
|
|
1249
|
+
label: string;
|
|
1250
|
+
icon: string;
|
|
1251
|
+
reason: string | null;
|
|
1252
|
+
live: boolean;
|
|
1253
|
+
isContainer: boolean;
|
|
1254
|
+
childProgress: ChildProgress | null;
|
|
1255
|
+
}
|
|
1256
|
+
type SnoozePresentation = {
|
|
1257
|
+
active: false;
|
|
1258
|
+
} | {
|
|
1259
|
+
active: true;
|
|
1260
|
+
wakeAt: string;
|
|
1261
|
+
wakeAction: "ready" | "review";
|
|
1262
|
+
};
|
|
1263
|
+
interface GateBreakdownEntry {
|
|
1264
|
+
gate: string;
|
|
1265
|
+
label: string;
|
|
1266
|
+
status: GateVerdict;
|
|
1267
|
+
}
|
|
1268
|
+
const defaultNewCardPriority: () => number;
|
|
1269
|
+
type GateVerdict = QualityGateViewV2["status"];
|
|
1216
1270
|
type HideableLane = "Cancelled" | "Backlog";
|
|
1217
1271
|
interface LaneVisibility {
|
|
1218
1272
|
isShown: (lane: IssueStatus$1) => boolean;
|
|
@@ -1249,6 +1303,8 @@ declare module "@danxbot/card-kit@1" {
|
|
|
1249
1303
|
}
|
|
1250
1304
|
function useBoardLaneState(scope: BoardScope): BoardLaneState;
|
|
1251
1305
|
|
|
1306
|
+
function useCardsOfType(scope: BoardScope, type: string): LiveQueryResult<readonly IssueViewV2[]>;
|
|
1307
|
+
|
|
1252
1308
|
function boardCardPath(cardId: string): string;
|
|
1253
1309
|
function planCardPath(planId: number, cardId: string, planSearch?: string): string;
|
|
1254
1310
|
function planPathFromCard(planId: number, cardSearch?: string): string;
|
|
@@ -1276,32 +1332,6 @@ declare module "@danxbot/card-kit@1" {
|
|
|
1276
1332
|
mutation: CardMutation;
|
|
1277
1333
|
}): react.JSX.Element;
|
|
1278
1334
|
|
|
1279
|
-
interface ChildProgress {
|
|
1280
|
-
done: number;
|
|
1281
|
-
total: number;
|
|
1282
|
-
}
|
|
1283
|
-
interface CardStatusPresentation {
|
|
1284
|
-
label: string;
|
|
1285
|
-
icon: string;
|
|
1286
|
-
reason: string | null;
|
|
1287
|
-
live: boolean;
|
|
1288
|
-
isContainer: boolean;
|
|
1289
|
-
childProgress: ChildProgress | null;
|
|
1290
|
-
}
|
|
1291
|
-
type SnoozePresentation = {
|
|
1292
|
-
active: false;
|
|
1293
|
-
} | {
|
|
1294
|
-
active: true;
|
|
1295
|
-
wakeAt: string;
|
|
1296
|
-
wakeAction: "ready" | "review";
|
|
1297
|
-
};
|
|
1298
|
-
interface GateBreakdownEntry {
|
|
1299
|
-
gate: string;
|
|
1300
|
-
label: string;
|
|
1301
|
-
status: GateVerdict;
|
|
1302
|
-
}
|
|
1303
|
-
type GateVerdict = QualityGateViewV2["status"];
|
|
1304
|
-
|
|
1305
1335
|
interface ProblemAttention {
|
|
1306
1336
|
problem: ProblemViewV2;
|
|
1307
1337
|
solutions: SolutionViewV2[];
|
|
@@ -1527,6 +1557,6 @@ declare module "@danxbot/card-kit@1" {
|
|
|
1527
1557
|
readonly cardPath: (cardId: string) => string;
|
|
1528
1558
|
}
|
|
1529
1559
|
|
|
1530
|
-
export { ActivityTab, AttachmentsTab, AttentionZone, CardActionsMenu, CardBoard, CardFace, CardLink, ChecklistsSection, ChildrenSection, DependenciesSection, EditableContext, EditableSummary, EditableTitle, EffortControl, GatesSection, ParentField, PlansField, PriorityControl, ProblemsSection, RetroTab, StandardCardPage, StatusControl, TypeControl, WorkStateControl, boardCardPath, planCardPath, planPathFromCard, requestBoardMove, transitionCard, useAttachmentActions, useBoardLaneState, useIssueDetail as useCard, useCardMutation };
|
|
1531
|
-
export type { AttachmentActions, BoardLaneState, BoardMoveResult, BoardScope, CardFaceProps, CardListViewProps, CardMutation, CardViewProps, IssueViewV2, LaneMoveRequest, LiveQueryResult, StandardCardPageProps };
|
|
1560
|
+
export { ActivityTab, AttachmentsTab, AttentionZone, CardActionsMenu, CardBoard, CardFace, CardLink, ChecklistsSection, ChildrenSection, DependenciesSection, EditableContext, EditableSummary, EditableTitle, EffortControl, GatesSection, ParentField, PlansField, PriorityControl, ProblemsSection, RetroTab, StandardCardPage, StatusControl, TypeControl, WorkStateControl, boardCardPath, createCard, defaultNewCardPriority, editCard, planCardPath, planPathFromCard, requestBoardMove, transitionCard, useAttachmentActions, useBoardLaneState, useIssueDetail as useCard, useCardMutation, useCardsOfType };
|
|
1561
|
+
export type { AttachmentActions, BoardLaneState, BoardMoveResult, BoardScope, CardEditPatch, CardFaceProps, CardListViewProps, CardMutation, CardViewProps, IssueViewV2, LaneMoveRequest, LiveQueryResult, NewCardInput, StandardCardPageProps };
|
|
1532
1562
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danxbot/plugin-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.36",
|
|
4
4
|
"description": "SDK for building 50 Arms card-type plugins (DX-5170): the card kit's type declarations, a Vite preset that builds a plugin against the app's shared runtime and writes its manifest, and the danx-plugin CLI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"test": "vitest run"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@danxbot/ui": "28.
|
|
49
|
+
"@danxbot/ui": "28.5.1",
|
|
50
50
|
"@types/node": "^22.0.0",
|
|
51
51
|
"@types/react": "^19.2.2",
|
|
52
52
|
"esbuild": "^0.25.0",
|