@devfellowship/components 3.2.3 → 3.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/cli.js +132 -10
- package/dist/index.cjs +523 -0
- package/dist/index.d.cts +1061 -1
- package/dist/index.d.ts +1061 -1
- package/dist/index.js +467 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8305,6 +8305,417 @@ function PublishDrawer({
|
|
|
8305
8305
|
) });
|
|
8306
8306
|
}
|
|
8307
8307
|
|
|
8308
|
+
// src/components/organisms/roadmap/contract.ts
|
|
8309
|
+
import { z } from "zod";
|
|
8310
|
+
var ROADMAP_COLUMNS = ["left", "center", "right"];
|
|
8311
|
+
var ROADMAP_TONES = [
|
|
8312
|
+
"primary",
|
|
8313
|
+
"secondary",
|
|
8314
|
+
"accent",
|
|
8315
|
+
"muted",
|
|
8316
|
+
"success",
|
|
8317
|
+
"info",
|
|
8318
|
+
"danger",
|
|
8319
|
+
"neutral"
|
|
8320
|
+
];
|
|
8321
|
+
var ROADMAP_NODE_KINDS = [
|
|
8322
|
+
"topic",
|
|
8323
|
+
"subtopic",
|
|
8324
|
+
"label",
|
|
8325
|
+
"title",
|
|
8326
|
+
"paragraph",
|
|
8327
|
+
"button",
|
|
8328
|
+
"legend"
|
|
8329
|
+
];
|
|
8330
|
+
var ROADMAP_NODE_STATES = ["todo", "done", "learning", "skipped", "locked"];
|
|
8331
|
+
var ROADMAP_EDGE_STYLES = ["solid", "dashed", "dotted"];
|
|
8332
|
+
var ROADMAP_EDGE_ROUTES = ["auto", "straight", "elbow", "curve"];
|
|
8333
|
+
var ROADMAP_ARROWS = ["none", "end", "both"];
|
|
8334
|
+
var ROADMAP_LEGEND_PLACEMENTS = ["top", "bottom", "inline"];
|
|
8335
|
+
var DEFAULT_NODE_SPAN = 1;
|
|
8336
|
+
var DEFAULT_EDGE_STYLE = "dashed";
|
|
8337
|
+
var DEFAULT_EDGE_ROUTE = "auto";
|
|
8338
|
+
var DEFAULT_EDGE_ARROW = "none";
|
|
8339
|
+
var DEFAULT_GROUP_TONE = "neutral";
|
|
8340
|
+
var DEFAULT_LEGEND_PLACEMENT = "top";
|
|
8341
|
+
var DEFAULT_NODE_STATE = "todo";
|
|
8342
|
+
var NODE_KIND_DEFAULT_TONE = {
|
|
8343
|
+
topic: "primary",
|
|
8344
|
+
subtopic: "secondary",
|
|
8345
|
+
button: "primary",
|
|
8346
|
+
label: "neutral",
|
|
8347
|
+
title: "neutral",
|
|
8348
|
+
paragraph: "neutral",
|
|
8349
|
+
legend: "neutral"
|
|
8350
|
+
};
|
|
8351
|
+
var resolveNodeSpan = (node) => node.span ?? DEFAULT_NODE_SPAN;
|
|
8352
|
+
var resolveNodeTone = (node) => node.tone ?? NODE_KIND_DEFAULT_TONE[node.kind];
|
|
8353
|
+
var resolveEdgeStyle = (edge) => edge.style ?? DEFAULT_EDGE_STYLE;
|
|
8354
|
+
var resolveEdgeRoute = (edge) => edge.route ?? DEFAULT_EDGE_ROUTE;
|
|
8355
|
+
var resolveEdgeArrow = (edge) => edge.arrow ?? DEFAULT_EDGE_ARROW;
|
|
8356
|
+
var resolveGroupTone = (group) => group.tone ?? DEFAULT_GROUP_TONE;
|
|
8357
|
+
var resolveGroupColumns = (group) => group.columns && group.columns.length > 0 ? group.columns : [...ROADMAP_COLUMNS];
|
|
8358
|
+
var resolveLegendPlacement = (legend) => legend.placement ?? DEFAULT_LEGEND_PLACEMENT;
|
|
8359
|
+
var resolveNodeState = (node, overlay) => overlay?.nodes[node.id] ?? node.state ?? DEFAULT_NODE_STATE;
|
|
8360
|
+
var ROADMAP_NODE_ID_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
|
|
8361
|
+
var ROADMAP_EDGE_LABEL_MAX = 40;
|
|
8362
|
+
var ROADMAP_LABEL_MAX = 200;
|
|
8363
|
+
var columnSchema = z.enum(ROADMAP_COLUMNS);
|
|
8364
|
+
var toneSchema = z.enum(ROADMAP_TONES);
|
|
8365
|
+
var idSchema = z.string().regex(ROADMAP_NODE_ID_PATTERN, "must match /^[A-Za-z0-9_-]{1,64}$/");
|
|
8366
|
+
var metaSchema = z.record(z.unknown());
|
|
8367
|
+
var roadmapIconSchema = z.object({
|
|
8368
|
+
name: z.string().min(1).max(64),
|
|
8369
|
+
side: z.enum(["left", "right"]),
|
|
8370
|
+
tone: toneSchema.optional()
|
|
8371
|
+
}).strict();
|
|
8372
|
+
var roadmapActionSchema = z.object({
|
|
8373
|
+
label: z.string().min(1).max(80),
|
|
8374
|
+
href: z.string().min(1).optional(),
|
|
8375
|
+
actionId: z.string().min(1).optional(),
|
|
8376
|
+
tone: toneSchema.optional()
|
|
8377
|
+
}).strict().superRefine((action, ctx) => {
|
|
8378
|
+
const given = [action.href, action.actionId].filter((v) => v !== void 0).length;
|
|
8379
|
+
if (given !== 1) {
|
|
8380
|
+
ctx.addIssue({
|
|
8381
|
+
code: z.ZodIssueCode.custom,
|
|
8382
|
+
path: ["href"],
|
|
8383
|
+
message: "an action needs exactly one of `href` or `actionId`"
|
|
8384
|
+
});
|
|
8385
|
+
}
|
|
8386
|
+
});
|
|
8387
|
+
var roadmapLinkSchema = z.object({ label: z.string().min(1).max(120), href: z.string().min(1) }).strict();
|
|
8388
|
+
var roadmapNodeStateSchema = z.enum(ROADMAP_NODE_STATES);
|
|
8389
|
+
var roadmapNodeSchema = z.object({
|
|
8390
|
+
id: idSchema,
|
|
8391
|
+
column: columnSchema,
|
|
8392
|
+
order: z.number().int().min(0),
|
|
8393
|
+
span: z.union([z.literal(1), z.literal(2), z.literal(3)]).optional(),
|
|
8394
|
+
kind: z.enum(ROADMAP_NODE_KINDS),
|
|
8395
|
+
label: z.string().min(1).max(ROADMAP_LABEL_MAX),
|
|
8396
|
+
description: z.string().max(2e3).optional(),
|
|
8397
|
+
tone: toneSchema.optional(),
|
|
8398
|
+
icon: roadmapIconSchema.optional(),
|
|
8399
|
+
badge: z.string().min(1).optional(),
|
|
8400
|
+
state: roadmapNodeStateSchema.optional(),
|
|
8401
|
+
action: roadmapActionSchema.optional(),
|
|
8402
|
+
href: z.string().min(1).optional(),
|
|
8403
|
+
links: z.array(roadmapLinkSchema).optional(),
|
|
8404
|
+
meta: metaSchema.optional()
|
|
8405
|
+
}).strict();
|
|
8406
|
+
var roadmapEdgeSchema = z.object({
|
|
8407
|
+
id: idSchema,
|
|
8408
|
+
source: z.string().min(1),
|
|
8409
|
+
target: z.string().min(1),
|
|
8410
|
+
style: z.enum(ROADMAP_EDGE_STYLES).optional(),
|
|
8411
|
+
label: z.string().min(1).max(ROADMAP_EDGE_LABEL_MAX).optional(),
|
|
8412
|
+
route: z.enum(ROADMAP_EDGE_ROUTES).optional(),
|
|
8413
|
+
arrow: z.enum(ROADMAP_ARROWS).optional(),
|
|
8414
|
+
tone: toneSchema.optional()
|
|
8415
|
+
}).strict();
|
|
8416
|
+
var roadmapGroupSchema = z.object({
|
|
8417
|
+
id: idSchema,
|
|
8418
|
+
title: z.string().min(1).max(ROADMAP_LABEL_MAX).optional(),
|
|
8419
|
+
tone: toneSchema.optional(),
|
|
8420
|
+
from: z.number().int().min(0),
|
|
8421
|
+
to: z.number().int().min(0),
|
|
8422
|
+
columns: z.array(columnSchema).min(1).max(3).optional(),
|
|
8423
|
+
description: z.string().max(2e3).optional()
|
|
8424
|
+
}).strict();
|
|
8425
|
+
var roadmapLegendEntrySchema = z.object({
|
|
8426
|
+
id: idSchema,
|
|
8427
|
+
label: z.string().min(1).max(ROADMAP_LABEL_MAX),
|
|
8428
|
+
tone: toneSchema,
|
|
8429
|
+
icon: z.string().min(1).max(64).optional()
|
|
8430
|
+
}).strict();
|
|
8431
|
+
var roadmapLegendSchema = z.object({
|
|
8432
|
+
entries: z.array(roadmapLegendEntrySchema).min(1),
|
|
8433
|
+
placement: z.enum(ROADMAP_LEGEND_PLACEMENTS).optional()
|
|
8434
|
+
}).strict();
|
|
8435
|
+
function columnsCovered(node) {
|
|
8436
|
+
const span = node.span ?? DEFAULT_NODE_SPAN;
|
|
8437
|
+
if (span === 3) return [...ROADMAP_COLUMNS];
|
|
8438
|
+
const start = ROADMAP_COLUMNS.indexOf(node.column);
|
|
8439
|
+
return ROADMAP_COLUMNS.slice(start, start + span);
|
|
8440
|
+
}
|
|
8441
|
+
var roadmapDocumentBaseSchema = z.object({
|
|
8442
|
+
version: z.literal("roadmap/v1"),
|
|
8443
|
+
title: z.string().min(1).max(ROADMAP_LABEL_MAX).optional(),
|
|
8444
|
+
direction: z.literal("down"),
|
|
8445
|
+
columns: z.literal(3),
|
|
8446
|
+
nodes: z.array(roadmapNodeSchema),
|
|
8447
|
+
edges: z.array(roadmapEdgeSchema),
|
|
8448
|
+
groups: z.array(roadmapGroupSchema),
|
|
8449
|
+
legend: roadmapLegendSchema.optional(),
|
|
8450
|
+
meta: metaSchema.optional()
|
|
8451
|
+
}).strict();
|
|
8452
|
+
var roadmapDocumentSchema = roadmapDocumentBaseSchema.superRefine((doc, ctx) => {
|
|
8453
|
+
const nodeIndexById = /* @__PURE__ */ new Map();
|
|
8454
|
+
doc.nodes.forEach((node, i) => {
|
|
8455
|
+
if (nodeIndexById.has(node.id)) {
|
|
8456
|
+
ctx.addIssue({
|
|
8457
|
+
code: z.ZodIssueCode.custom,
|
|
8458
|
+
path: ["nodes", i, "id"],
|
|
8459
|
+
message: `duplicate node id "${node.id}" (first seen at nodes[${nodeIndexById.get(node.id)}])`
|
|
8460
|
+
});
|
|
8461
|
+
return;
|
|
8462
|
+
}
|
|
8463
|
+
nodeIndexById.set(node.id, i);
|
|
8464
|
+
});
|
|
8465
|
+
const cellOwner = /* @__PURE__ */ new Map();
|
|
8466
|
+
doc.nodes.forEach((node, i) => {
|
|
8467
|
+
const span = node.span ?? DEFAULT_NODE_SPAN;
|
|
8468
|
+
if (span === 2 && node.column === "right") {
|
|
8469
|
+
ctx.addIssue({
|
|
8470
|
+
code: z.ZodIssueCode.custom,
|
|
8471
|
+
path: ["nodes", i, "span"],
|
|
8472
|
+
message: 'a `span: 2` node at column "right" runs past the last track'
|
|
8473
|
+
});
|
|
8474
|
+
return;
|
|
8475
|
+
}
|
|
8476
|
+
for (const column of columnsCovered(node)) {
|
|
8477
|
+
const key = `${column}:${node.order}`;
|
|
8478
|
+
const owner = cellOwner.get(key);
|
|
8479
|
+
if (owner !== void 0) {
|
|
8480
|
+
ctx.addIssue({
|
|
8481
|
+
code: z.ZodIssueCode.custom,
|
|
8482
|
+
path: ["nodes", i, "order"],
|
|
8483
|
+
message: `cell (${column}, ${node.order}) is already taken by nodes[${owner}] ("${doc.nodes[owner].id}")`
|
|
8484
|
+
});
|
|
8485
|
+
continue;
|
|
8486
|
+
}
|
|
8487
|
+
cellOwner.set(key, i);
|
|
8488
|
+
}
|
|
8489
|
+
});
|
|
8490
|
+
const edgeIds = /* @__PURE__ */ new Set();
|
|
8491
|
+
doc.edges.forEach((edge, i) => {
|
|
8492
|
+
if (edgeIds.has(edge.id)) {
|
|
8493
|
+
ctx.addIssue({
|
|
8494
|
+
code: z.ZodIssueCode.custom,
|
|
8495
|
+
path: ["edges", i, "id"],
|
|
8496
|
+
message: `duplicate edge id "${edge.id}"`
|
|
8497
|
+
});
|
|
8498
|
+
}
|
|
8499
|
+
edgeIds.add(edge.id);
|
|
8500
|
+
if (!nodeIndexById.has(edge.source)) {
|
|
8501
|
+
ctx.addIssue({
|
|
8502
|
+
code: z.ZodIssueCode.custom,
|
|
8503
|
+
path: ["edges", i, "source"],
|
|
8504
|
+
message: `edge source "${edge.source}" is not a node in this document`
|
|
8505
|
+
});
|
|
8506
|
+
}
|
|
8507
|
+
if (!nodeIndexById.has(edge.target)) {
|
|
8508
|
+
ctx.addIssue({
|
|
8509
|
+
code: z.ZodIssueCode.custom,
|
|
8510
|
+
path: ["edges", i, "target"],
|
|
8511
|
+
message: `edge target "${edge.target}" is not a node in this document`
|
|
8512
|
+
});
|
|
8513
|
+
}
|
|
8514
|
+
if (edge.source === edge.target) {
|
|
8515
|
+
ctx.addIssue({
|
|
8516
|
+
code: z.ZodIssueCode.custom,
|
|
8517
|
+
path: ["edges", i, "target"],
|
|
8518
|
+
message: `edge "${edge.id}" is a self-loop`
|
|
8519
|
+
});
|
|
8520
|
+
}
|
|
8521
|
+
});
|
|
8522
|
+
const groupIds = /* @__PURE__ */ new Set();
|
|
8523
|
+
doc.groups.forEach((group, i) => {
|
|
8524
|
+
if (groupIds.has(group.id)) {
|
|
8525
|
+
ctx.addIssue({
|
|
8526
|
+
code: z.ZodIssueCode.custom,
|
|
8527
|
+
path: ["groups", i, "id"],
|
|
8528
|
+
message: `duplicate group id "${group.id}"`
|
|
8529
|
+
});
|
|
8530
|
+
}
|
|
8531
|
+
groupIds.add(group.id);
|
|
8532
|
+
if (group.from > group.to) {
|
|
8533
|
+
ctx.addIssue({
|
|
8534
|
+
code: z.ZodIssueCode.custom,
|
|
8535
|
+
path: ["groups", i, "to"],
|
|
8536
|
+
message: `group "${group.id}" has from (${group.from}) greater than to (${group.to})`
|
|
8537
|
+
});
|
|
8538
|
+
}
|
|
8539
|
+
});
|
|
8540
|
+
for (let i = 0; i < doc.groups.length; i += 1) {
|
|
8541
|
+
const a = doc.groups[i];
|
|
8542
|
+
if (a.from > a.to) continue;
|
|
8543
|
+
const aColumns = new Set(resolveGroupColumns(a));
|
|
8544
|
+
for (let j = i + 1; j < doc.groups.length; j += 1) {
|
|
8545
|
+
const b = doc.groups[j];
|
|
8546
|
+
if (b.from > b.to) continue;
|
|
8547
|
+
const rowsOverlap = a.from <= b.to && b.from <= a.to;
|
|
8548
|
+
if (!rowsOverlap) continue;
|
|
8549
|
+
const shared = resolveGroupColumns(b).filter((c) => aColumns.has(c));
|
|
8550
|
+
if (shared.length === 0) continue;
|
|
8551
|
+
ctx.addIssue({
|
|
8552
|
+
code: z.ZodIssueCode.custom,
|
|
8553
|
+
path: ["groups", j, "from"],
|
|
8554
|
+
message: `group "${b.id}" overlaps rows ${a.from}..${a.to} of group "${a.id}" on column(s) ${shared.join(", ")}`
|
|
8555
|
+
});
|
|
8556
|
+
}
|
|
8557
|
+
}
|
|
8558
|
+
const legendIds = /* @__PURE__ */ new Set();
|
|
8559
|
+
doc.legend?.entries.forEach((entry, i) => {
|
|
8560
|
+
if (legendIds.has(entry.id)) {
|
|
8561
|
+
ctx.addIssue({
|
|
8562
|
+
code: z.ZodIssueCode.custom,
|
|
8563
|
+
path: ["legend", "entries", i, "id"],
|
|
8564
|
+
message: `duplicate legend entry id "${entry.id}"`
|
|
8565
|
+
});
|
|
8566
|
+
}
|
|
8567
|
+
legendIds.add(entry.id);
|
|
8568
|
+
});
|
|
8569
|
+
doc.nodes.forEach((node, i) => {
|
|
8570
|
+
if (node.badge === void 0) return;
|
|
8571
|
+
if (!legendIds.has(node.badge)) {
|
|
8572
|
+
ctx.addIssue({
|
|
8573
|
+
code: z.ZodIssueCode.custom,
|
|
8574
|
+
path: ["nodes", i, "badge"],
|
|
8575
|
+
message: `badge "${node.badge}" is not a legend entry of this document`
|
|
8576
|
+
});
|
|
8577
|
+
}
|
|
8578
|
+
});
|
|
8579
|
+
});
|
|
8580
|
+
var roadmapStateOverlaySchema = z.object({
|
|
8581
|
+
version: z.literal("roadmap-state/v1"),
|
|
8582
|
+
nodes: z.record(roadmapNodeStateSchema)
|
|
8583
|
+
}).strict();
|
|
8584
|
+
var roadmapStateSchema = roadmapStateOverlaySchema;
|
|
8585
|
+
function parseRoadmapDocument(input) {
|
|
8586
|
+
return roadmapDocumentSchema.parse(input);
|
|
8587
|
+
}
|
|
8588
|
+
function safeParseRoadmapDocument(input) {
|
|
8589
|
+
return roadmapDocumentSchema.safeParse(input);
|
|
8590
|
+
}
|
|
8591
|
+
function parseRoadmapStateOverlay(input) {
|
|
8592
|
+
return roadmapStateOverlaySchema.parse(input);
|
|
8593
|
+
}
|
|
8594
|
+
function safeParseRoadmapStateOverlay(input) {
|
|
8595
|
+
return roadmapStateOverlaySchema.safeParse(input);
|
|
8596
|
+
}
|
|
8597
|
+
|
|
8598
|
+
// src/components/organisms/roadmap/layout.ts
|
|
8599
|
+
function columnIndex(column) {
|
|
8600
|
+
return ROADMAP_COLUMNS.indexOf(column);
|
|
8601
|
+
}
|
|
8602
|
+
function gridColumnFor(node) {
|
|
8603
|
+
const span = resolveNodeSpan(node);
|
|
8604
|
+
if (span === 3) return { start: 1, span: 3 };
|
|
8605
|
+
return { start: columnIndex(node.column) + 1, span };
|
|
8606
|
+
}
|
|
8607
|
+
function rowsOf(doc) {
|
|
8608
|
+
const rows = /* @__PURE__ */ new Set();
|
|
8609
|
+
for (const node of doc.nodes) rows.add(node.order);
|
|
8610
|
+
return [...rows].sort((a, b) => a - b);
|
|
8611
|
+
}
|
|
8612
|
+
function maxRowOf(doc) {
|
|
8613
|
+
return doc.nodes.reduce((max, node) => Math.max(max, node.order), -1);
|
|
8614
|
+
}
|
|
8615
|
+
function nodesByRow(doc) {
|
|
8616
|
+
const byRow = /* @__PURE__ */ new Map();
|
|
8617
|
+
for (const node of doc.nodes) {
|
|
8618
|
+
const bucket = byRow.get(node.order);
|
|
8619
|
+
if (bucket) bucket.push(node);
|
|
8620
|
+
else byRow.set(node.order, [node]);
|
|
8621
|
+
}
|
|
8622
|
+
for (const bucket of byRow.values()) {
|
|
8623
|
+
bucket.sort((a, b) => {
|
|
8624
|
+
const byColumn = columnIndex(a.column) - columnIndex(b.column);
|
|
8625
|
+
return byColumn !== 0 ? byColumn : a.id.localeCompare(b.id);
|
|
8626
|
+
});
|
|
8627
|
+
}
|
|
8628
|
+
return byRow;
|
|
8629
|
+
}
|
|
8630
|
+
function columnsUsed(doc) {
|
|
8631
|
+
const used = /* @__PURE__ */ new Set();
|
|
8632
|
+
for (const node of doc.nodes) for (const column of columnsCovered(node)) used.add(column);
|
|
8633
|
+
return ROADMAP_COLUMNS.filter((column) => used.has(column));
|
|
8634
|
+
}
|
|
8635
|
+
function groupRanges(doc) {
|
|
8636
|
+
return doc.groups.map((group) => {
|
|
8637
|
+
const columns = resolveGroupColumns(group);
|
|
8638
|
+
const indices = columns.map(columnIndex).sort((a, b) => a - b);
|
|
8639
|
+
const start = indices[0];
|
|
8640
|
+
const end = indices[indices.length - 1];
|
|
8641
|
+
return {
|
|
8642
|
+
id: group.id,
|
|
8643
|
+
from: group.from,
|
|
8644
|
+
to: group.to,
|
|
8645
|
+
columns: ROADMAP_COLUMNS.filter((c) => columns.includes(c)),
|
|
8646
|
+
row: { start: group.from + 1, span: group.to - group.from + 1 },
|
|
8647
|
+
column: { start: start + 1, span: end - start + 1 },
|
|
8648
|
+
fragmented: end - start + 1 !== indices.length
|
|
8649
|
+
};
|
|
8650
|
+
});
|
|
8651
|
+
}
|
|
8652
|
+
function groupColumnRuns(group) {
|
|
8653
|
+
const indices = resolveGroupColumns(group).map(columnIndex).sort((a, b) => a - b);
|
|
8654
|
+
const runs = [];
|
|
8655
|
+
for (const index of indices) {
|
|
8656
|
+
const last = runs[runs.length - 1];
|
|
8657
|
+
if (last && last.start + last.span === index + 1) last.span += 1;
|
|
8658
|
+
else runs.push({ start: index + 1, span: 1 });
|
|
8659
|
+
}
|
|
8660
|
+
return runs;
|
|
8661
|
+
}
|
|
8662
|
+
function validateNoOverlap(doc) {
|
|
8663
|
+
const overlaps = [];
|
|
8664
|
+
const nodeCell = /* @__PURE__ */ new Map();
|
|
8665
|
+
for (const node of doc.nodes) {
|
|
8666
|
+
for (const column of columnsCovered(node)) {
|
|
8667
|
+
const key = `${column}:${node.order}`;
|
|
8668
|
+
const owner = nodeCell.get(key);
|
|
8669
|
+
if (owner !== void 0) {
|
|
8670
|
+
overlaps.push({ kind: "node", column, row: node.order, ids: [owner, node.id] });
|
|
8671
|
+
continue;
|
|
8672
|
+
}
|
|
8673
|
+
nodeCell.set(key, node.id);
|
|
8674
|
+
}
|
|
8675
|
+
}
|
|
8676
|
+
const groupCell = /* @__PURE__ */ new Map();
|
|
8677
|
+
for (const group of doc.groups) {
|
|
8678
|
+
if (group.from > group.to) continue;
|
|
8679
|
+
for (const column of resolveGroupColumns(group)) {
|
|
8680
|
+
for (let row = group.from; row <= group.to; row += 1) {
|
|
8681
|
+
const key = `${column}:${row}`;
|
|
8682
|
+
const owner = groupCell.get(key);
|
|
8683
|
+
if (owner !== void 0) {
|
|
8684
|
+
if (owner !== group.id) {
|
|
8685
|
+
overlaps.push({ kind: "group", column, row, ids: [owner, group.id] });
|
|
8686
|
+
}
|
|
8687
|
+
continue;
|
|
8688
|
+
}
|
|
8689
|
+
groupCell.set(key, group.id);
|
|
8690
|
+
}
|
|
8691
|
+
}
|
|
8692
|
+
}
|
|
8693
|
+
return overlaps;
|
|
8694
|
+
}
|
|
8695
|
+
function placeNodes(doc) {
|
|
8696
|
+
const byRow = nodesByRow(doc);
|
|
8697
|
+
const rows = rowsOf(doc);
|
|
8698
|
+
const placements = [];
|
|
8699
|
+
for (const row of rows) {
|
|
8700
|
+
for (const node of byRow.get(row) ?? []) {
|
|
8701
|
+
placements.push({
|
|
8702
|
+
node,
|
|
8703
|
+
row: { start: node.order + 1, span: 1 },
|
|
8704
|
+
column: gridColumnFor(node)
|
|
8705
|
+
});
|
|
8706
|
+
}
|
|
8707
|
+
}
|
|
8708
|
+
return { placements, rows, rowCount: maxRowOf(doc) + 1 };
|
|
8709
|
+
}
|
|
8710
|
+
function firstFreeRow(taken, columns, from) {
|
|
8711
|
+
let row = from;
|
|
8712
|
+
for (let guard = 0; guard < 1e5; guard += 1) {
|
|
8713
|
+
if (columns.every((column) => !taken.has(`${column}:${row}`))) return row;
|
|
8714
|
+
row += 1;
|
|
8715
|
+
}
|
|
8716
|
+
return row;
|
|
8717
|
+
}
|
|
8718
|
+
|
|
8308
8719
|
// src/hooks/use-iframe-auth.ts
|
|
8309
8720
|
import { useContext as useContext9 } from "react";
|
|
8310
8721
|
function useIframeAuth() {
|
|
@@ -8445,7 +8856,14 @@ export {
|
|
|
8445
8856
|
ContextMenuSubContent,
|
|
8446
8857
|
ContextMenuSubTrigger,
|
|
8447
8858
|
ContextMenuTrigger,
|
|
8859
|
+
DEFAULT_EDGE_ARROW,
|
|
8860
|
+
DEFAULT_EDGE_ROUTE,
|
|
8861
|
+
DEFAULT_EDGE_STYLE,
|
|
8862
|
+
DEFAULT_GROUP_TONE,
|
|
8863
|
+
DEFAULT_LEGEND_PLACEMENT,
|
|
8448
8864
|
DEFAULT_NAME_COL_WIDTH,
|
|
8865
|
+
DEFAULT_NODE_SPAN,
|
|
8866
|
+
DEFAULT_NODE_STATE,
|
|
8449
8867
|
DflRemote,
|
|
8450
8868
|
Dialog,
|
|
8451
8869
|
DialogClose,
|
|
@@ -8523,6 +8941,7 @@ export {
|
|
|
8523
8941
|
MenubarSubContent,
|
|
8524
8942
|
MenubarSubTrigger,
|
|
8525
8943
|
MenubarTrigger,
|
|
8944
|
+
NODE_KIND_DEFAULT_TONE,
|
|
8526
8945
|
NavigationMenu,
|
|
8527
8946
|
NavigationMenuContent,
|
|
8528
8947
|
NavigationMenuIndicator,
|
|
@@ -8546,6 +8965,17 @@ export {
|
|
|
8546
8965
|
Progress,
|
|
8547
8966
|
ProtectedRoute,
|
|
8548
8967
|
PublishDrawer,
|
|
8968
|
+
ROADMAP_ARROWS,
|
|
8969
|
+
ROADMAP_COLUMNS,
|
|
8970
|
+
ROADMAP_EDGE_LABEL_MAX,
|
|
8971
|
+
ROADMAP_EDGE_ROUTES,
|
|
8972
|
+
ROADMAP_EDGE_STYLES,
|
|
8973
|
+
ROADMAP_LABEL_MAX,
|
|
8974
|
+
ROADMAP_LEGEND_PLACEMENTS,
|
|
8975
|
+
ROADMAP_NODE_ID_PATTERN,
|
|
8976
|
+
ROADMAP_NODE_KINDS,
|
|
8977
|
+
ROADMAP_NODE_STATES,
|
|
8978
|
+
ROADMAP_TONES,
|
|
8549
8979
|
RadioGroup4 as RadioGroup,
|
|
8550
8980
|
RadioGroupItem,
|
|
8551
8981
|
RadioGroupRow,
|
|
@@ -8639,19 +9069,55 @@ export {
|
|
|
8639
9069
|
buttonVariants,
|
|
8640
9070
|
clampPct,
|
|
8641
9071
|
cn,
|
|
9072
|
+
columnIndex,
|
|
9073
|
+
columnsCovered,
|
|
9074
|
+
columnsUsed,
|
|
8642
9075
|
filterPublishableAccounts,
|
|
9076
|
+
firstFreeRow,
|
|
8643
9077
|
getInitials,
|
|
9078
|
+
gridColumnFor,
|
|
9079
|
+
groupColumnRuns,
|
|
9080
|
+
groupRanges,
|
|
8644
9081
|
iconButtonVariants,
|
|
8645
9082
|
isAllowedOrigin,
|
|
8646
9083
|
kbdVariants,
|
|
8647
9084
|
labelVariants,
|
|
9085
|
+
maxRowOf,
|
|
8648
9086
|
memberHueIndex,
|
|
8649
9087
|
memberHueVar,
|
|
8650
9088
|
navigationMenuTriggerStyle,
|
|
9089
|
+
nodesByRow,
|
|
9090
|
+
parseRoadmapDocument,
|
|
9091
|
+
parseRoadmapStateOverlay,
|
|
8651
9092
|
parseTags,
|
|
9093
|
+
placeNodes,
|
|
9094
|
+
resolveEdgeArrow,
|
|
9095
|
+
resolveEdgeRoute,
|
|
9096
|
+
resolveEdgeStyle,
|
|
9097
|
+
resolveGroupColumns,
|
|
9098
|
+
resolveGroupTone,
|
|
9099
|
+
resolveLegendPlacement,
|
|
8652
9100
|
resolveNameColWidth,
|
|
9101
|
+
resolveNodeSpan,
|
|
9102
|
+
resolveNodeState,
|
|
9103
|
+
resolveNodeTone,
|
|
8653
9104
|
resolveWeekCount,
|
|
8654
9105
|
resolveWeekLabels,
|
|
9106
|
+
roadmapActionSchema,
|
|
9107
|
+
roadmapDocumentSchema,
|
|
9108
|
+
roadmapEdgeSchema,
|
|
9109
|
+
roadmapGroupSchema,
|
|
9110
|
+
roadmapIconSchema,
|
|
9111
|
+
roadmapLegendEntrySchema,
|
|
9112
|
+
roadmapLegendSchema,
|
|
9113
|
+
roadmapLinkSchema,
|
|
9114
|
+
roadmapNodeSchema,
|
|
9115
|
+
roadmapNodeStateSchema,
|
|
9116
|
+
roadmapStateOverlaySchema,
|
|
9117
|
+
roadmapStateSchema,
|
|
9118
|
+
rowsOf,
|
|
9119
|
+
safeParseRoadmapDocument,
|
|
9120
|
+
safeParseRoadmapStateOverlay,
|
|
8655
9121
|
stageProgress,
|
|
8656
9122
|
toast,
|
|
8657
9123
|
toggleVariants,
|
|
@@ -8665,5 +9131,6 @@ export {
|
|
|
8665
9131
|
useSession,
|
|
8666
9132
|
useSidebar,
|
|
8667
9133
|
useToast,
|
|
9134
|
+
validateNoOverlap,
|
|
8668
9135
|
validatePublishForm
|
|
8669
9136
|
};
|