@bitcobblers/wod-wiki-core 0.44.2160 → 0.45.2166
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/index.cjs +120 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +157 -24
- package/dist/index.d.ts +157 -24
- package/dist/index.mjs +116 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -999,6 +999,45 @@ function blockContentId(content) {
|
|
|
999
999
|
return `bc-${(hash >>> 0).toString(16).padStart(8, "0")}`;
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
1002
|
+
// src/models/PagePlacement.ts
|
|
1003
|
+
function comparePlacements(a, b) {
|
|
1004
|
+
const positionA = a.position ?? Infinity;
|
|
1005
|
+
const positionB = b.position ?? Infinity;
|
|
1006
|
+
if (positionA !== positionB) return positionA - positionB;
|
|
1007
|
+
if (a.createdAt !== b.createdAt) return a.createdAt - b.createdAt;
|
|
1008
|
+
return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
1009
|
+
}
|
|
1010
|
+
function orderPlacements(links) {
|
|
1011
|
+
return [...links].sort(comparePlacements);
|
|
1012
|
+
}
|
|
1013
|
+
function resolvePlacements(links, pages) {
|
|
1014
|
+
const pageById = new Map(pages.map((page) => [page.id, page]));
|
|
1015
|
+
const out = [];
|
|
1016
|
+
for (const link of orderPlacements(links)) {
|
|
1017
|
+
const page = pageById.get(link.pageId);
|
|
1018
|
+
if (!page) continue;
|
|
1019
|
+
out.push({
|
|
1020
|
+
pageId: page.id,
|
|
1021
|
+
noteId: link.noteId,
|
|
1022
|
+
position: link.position,
|
|
1023
|
+
createdAt: link.createdAt,
|
|
1024
|
+
date: page.date,
|
|
1025
|
+
slug: page.slug,
|
|
1026
|
+
title: page.title
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
return out;
|
|
1030
|
+
}
|
|
1031
|
+
function projectPlacements(placements) {
|
|
1032
|
+
const projection = {};
|
|
1033
|
+
for (const placement of placements) {
|
|
1034
|
+
if (projection.pageId === void 0) projection.pageId = placement.pageId;
|
|
1035
|
+
if (projection.journalDate === void 0 && placement.date) projection.journalDate = placement.date;
|
|
1036
|
+
if (projection.pageSlug === void 0 && placement.slug && !placement.date) projection.pageSlug = placement.slug;
|
|
1037
|
+
}
|
|
1038
|
+
return projection;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1002
1041
|
// src/types/storage.ts
|
|
1003
1042
|
var KNOWN_OUTPUT_TYPES = [
|
|
1004
1043
|
"segment",
|
|
@@ -1023,7 +1062,7 @@ function isWorkoutSectionType(type) {
|
|
|
1023
1062
|
}
|
|
1024
1063
|
|
|
1025
1064
|
// src/types/notebook.ts
|
|
1026
|
-
var DEFAULT_NOTEBOOK_SLUGS = ["journal", "playground", "guides"];
|
|
1065
|
+
var DEFAULT_NOTEBOOK_SLUGS = ["journal", "playground", "defaults", "guides"];
|
|
1027
1066
|
function notebookSlugFromId(slugOrId) {
|
|
1028
1067
|
const trimmed = slugOrId.trim();
|
|
1029
1068
|
if (trimmed.startsWith("notebook/")) return trimmed.slice("notebook/".length);
|
|
@@ -1033,9 +1072,76 @@ function notebookSlugFromId(slugOrId) {
|
|
|
1033
1072
|
function toNotebookId(slugOrId) {
|
|
1034
1073
|
return `notebook/${notebookSlugFromId(slugOrId)}`;
|
|
1035
1074
|
}
|
|
1036
|
-
function isNoteEditable(note) {
|
|
1037
|
-
return
|
|
1075
|
+
function isNoteEditable(note, notebookOrigin) {
|
|
1076
|
+
if (notebookOrigin) return notebookOrigin !== "feed";
|
|
1077
|
+
return note.seedOrigin !== "seed" && note.feedOrigin !== "feed";
|
|
1038
1078
|
}
|
|
1079
|
+
var BUILTIN_NOTEBOOKS = [
|
|
1080
|
+
{
|
|
1081
|
+
slug: "journal",
|
|
1082
|
+
notebookId: "notebook/journal",
|
|
1083
|
+
name: "Journal",
|
|
1084
|
+
description: "Dated training log and scheduled workouts.",
|
|
1085
|
+
icon: "\u{1F4C5}",
|
|
1086
|
+
href: "/journal"
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
slug: "playground",
|
|
1090
|
+
notebookId: "notebook/playground",
|
|
1091
|
+
name: "Playground",
|
|
1092
|
+
description: "Scratchpad workouts and timer experiments.",
|
|
1093
|
+
icon: "\u{1F9EA}",
|
|
1094
|
+
href: "/playgrounds"
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
slug: "defaults",
|
|
1098
|
+
notebookId: "notebook/defaults",
|
|
1099
|
+
name: "Defaults",
|
|
1100
|
+
description: "Starter notes \u2014 clone any of them into your own notebooks.",
|
|
1101
|
+
icon: "\u{1F4DD}",
|
|
1102
|
+
href: "/notebook/defaults"
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
slug: "guides",
|
|
1106
|
+
notebookId: "notebook/guides",
|
|
1107
|
+
name: "Guides",
|
|
1108
|
+
description: "Built-in Whiteboard Language and WQL guides.",
|
|
1109
|
+
icon: "\u{1F4D6}",
|
|
1110
|
+
href: "/notebook/guides",
|
|
1111
|
+
feedEntryId: "core",
|
|
1112
|
+
seedChunkId: "canvas"
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
slug: "efforts",
|
|
1116
|
+
notebookId: "notebook/efforts",
|
|
1117
|
+
name: "Efforts",
|
|
1118
|
+
description: "The effort library \u2014 every effort the parser and analytics resolve, across the canonical disciplines.",
|
|
1119
|
+
icon: "\u{1F3CB}\uFE0F",
|
|
1120
|
+
href: "/efforts",
|
|
1121
|
+
feedEntryId: "core",
|
|
1122
|
+
seedChunkId: "efforts"
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
slug: "equipment",
|
|
1126
|
+
notebookId: "notebook/equipment",
|
|
1127
|
+
name: "Equipment",
|
|
1128
|
+
description: "The equipment library \u2014 gear definitions the language resolves.",
|
|
1129
|
+
icon: "\u{1F527}",
|
|
1130
|
+
href: "/equipment",
|
|
1131
|
+
feedEntryId: "core",
|
|
1132
|
+
seedChunkId: "equipment"
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
slug: "dashboards",
|
|
1136
|
+
notebookId: "notebook/dashboards",
|
|
1137
|
+
name: "Dashboards",
|
|
1138
|
+
description: "Prebuilt WQL dashboards \u2014 query compositions ready to open.",
|
|
1139
|
+
icon: "\u{1F4CA}",
|
|
1140
|
+
href: "/dashboards",
|
|
1141
|
+
feedEntryId: "core",
|
|
1142
|
+
seedChunkId: "dashboards"
|
|
1143
|
+
}
|
|
1144
|
+
];
|
|
1039
1145
|
var NOTEBOOK_TAG_PREFIX = "notebook:";
|
|
1040
1146
|
var toNotebookTag = (notebookId) => `${NOTEBOOK_TAG_PREFIX}${notebookId}`;
|
|
1041
1147
|
var fromNotebookTag = (tag) => tag.startsWith(NOTEBOOK_TAG_PREFIX) ? tag.slice(NOTEBOOK_TAG_PREFIX.length) : null;
|
|
@@ -1434,16 +1540,17 @@ function patchFrontmatterProperty(raw, path, value) {
|
|
|
1434
1540
|
}
|
|
1435
1541
|
|
|
1436
1542
|
// src/version.ts
|
|
1437
|
-
var VERSION = "0.
|
|
1438
|
-
var GIT_SHA = "
|
|
1439
|
-
var BUILD_TIME = "2026-10-
|
|
1543
|
+
var VERSION = "0.45.2166";
|
|
1544
|
+
var GIT_SHA = "32bda10";
|
|
1545
|
+
var BUILD_TIME = "2026-10-26T20:01:09.868Z";
|
|
1440
1546
|
var SEMVER = {
|
|
1441
|
-
version: "0.
|
|
1442
|
-
gitSha: "
|
|
1443
|
-
buildTime: "2026-10-
|
|
1547
|
+
version: "0.45.2166",
|
|
1548
|
+
gitSha: "32bda10",
|
|
1549
|
+
buildTime: "2026-10-26T20:01:09.868Z"
|
|
1444
1550
|
};
|
|
1445
1551
|
|
|
1446
1552
|
exports.BUILD_TIME = BUILD_TIME;
|
|
1553
|
+
exports.BUILTIN_NOTEBOOKS = BUILTIN_NOTEBOOKS;
|
|
1447
1554
|
exports.BlockKey = BlockKey;
|
|
1448
1555
|
exports.CodeMetadata = CodeMetadata;
|
|
1449
1556
|
exports.CodeStatement = CodeStatement;
|
|
@@ -1472,6 +1579,7 @@ exports.actionableSectionKind = actionableSectionKind;
|
|
|
1472
1579
|
exports.blockContentId = blockContentId;
|
|
1473
1580
|
exports.buildRawContent = buildRawContent;
|
|
1474
1581
|
exports.calculateTotalLines = calculateTotalLines;
|
|
1582
|
+
exports.comparePlacements = comparePlacements;
|
|
1475
1583
|
exports.convertViaCatalog = convertViaCatalog;
|
|
1476
1584
|
exports.createMetricOwnershipLedger = createMetricOwnershipLedger;
|
|
1477
1585
|
exports.createTagIndex = createTagIndex;
|
|
@@ -1495,11 +1603,14 @@ exports.matchDialectFence = matchDialectFence;
|
|
|
1495
1603
|
exports.normalizeFieldComponent = normalizeFieldComponent;
|
|
1496
1604
|
exports.normalizeFieldPath = normalizeFieldPath;
|
|
1497
1605
|
exports.notebookSlugFromId = notebookSlugFromId;
|
|
1606
|
+
exports.orderPlacements = orderPlacements;
|
|
1498
1607
|
exports.ownershipRank = ownershipRank;
|
|
1499
1608
|
exports.parseDocumentSections = parseDocumentSections;
|
|
1500
1609
|
exports.patchFrontmatterProperty = patchFrontmatterProperty;
|
|
1610
|
+
exports.projectPlacements = projectPlacements;
|
|
1501
1611
|
exports.reconcileNoteBlocks = reconcileNoteBlocks;
|
|
1502
1612
|
exports.resolveLayer = resolveLayer;
|
|
1613
|
+
exports.resolvePlacements = resolvePlacements;
|
|
1503
1614
|
exports.runAffordance = runAffordance;
|
|
1504
1615
|
exports.systemDefaultUnit = systemDefaultUnit;
|
|
1505
1616
|
exports.toNotebookId = toNotebookId;
|