@bitcobblers/wod-wiki-core 0.44.2159 → 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.mjs CHANGED
@@ -997,6 +997,45 @@ function blockContentId(content) {
997
997
  return `bc-${(hash >>> 0).toString(16).padStart(8, "0")}`;
998
998
  }
999
999
 
1000
+ // src/models/PagePlacement.ts
1001
+ function comparePlacements(a, b) {
1002
+ const positionA = a.position ?? Infinity;
1003
+ const positionB = b.position ?? Infinity;
1004
+ if (positionA !== positionB) return positionA - positionB;
1005
+ if (a.createdAt !== b.createdAt) return a.createdAt - b.createdAt;
1006
+ return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
1007
+ }
1008
+ function orderPlacements(links) {
1009
+ return [...links].sort(comparePlacements);
1010
+ }
1011
+ function resolvePlacements(links, pages) {
1012
+ const pageById = new Map(pages.map((page) => [page.id, page]));
1013
+ const out = [];
1014
+ for (const link of orderPlacements(links)) {
1015
+ const page = pageById.get(link.pageId);
1016
+ if (!page) continue;
1017
+ out.push({
1018
+ pageId: page.id,
1019
+ noteId: link.noteId,
1020
+ position: link.position,
1021
+ createdAt: link.createdAt,
1022
+ date: page.date,
1023
+ slug: page.slug,
1024
+ title: page.title
1025
+ });
1026
+ }
1027
+ return out;
1028
+ }
1029
+ function projectPlacements(placements) {
1030
+ const projection = {};
1031
+ for (const placement of placements) {
1032
+ if (projection.pageId === void 0) projection.pageId = placement.pageId;
1033
+ if (projection.journalDate === void 0 && placement.date) projection.journalDate = placement.date;
1034
+ if (projection.pageSlug === void 0 && placement.slug && !placement.date) projection.pageSlug = placement.slug;
1035
+ }
1036
+ return projection;
1037
+ }
1038
+
1000
1039
  // src/types/storage.ts
1001
1040
  var KNOWN_OUTPUT_TYPES = [
1002
1041
  "segment",
@@ -1021,7 +1060,7 @@ function isWorkoutSectionType(type) {
1021
1060
  }
1022
1061
 
1023
1062
  // src/types/notebook.ts
1024
- var DEFAULT_NOTEBOOK_SLUGS = ["journal", "playground", "guides"];
1063
+ var DEFAULT_NOTEBOOK_SLUGS = ["journal", "playground", "defaults", "guides"];
1025
1064
  function notebookSlugFromId(slugOrId) {
1026
1065
  const trimmed = slugOrId.trim();
1027
1066
  if (trimmed.startsWith("notebook/")) return trimmed.slice("notebook/".length);
@@ -1031,9 +1070,76 @@ function notebookSlugFromId(slugOrId) {
1031
1070
  function toNotebookId(slugOrId) {
1032
1071
  return `notebook/${notebookSlugFromId(slugOrId)}`;
1033
1072
  }
1034
- function isNoteEditable(note) {
1035
- return note.seedOrigin !== "seed";
1073
+ function isNoteEditable(note, notebookOrigin) {
1074
+ if (notebookOrigin) return notebookOrigin !== "feed";
1075
+ return note.seedOrigin !== "seed" && note.feedOrigin !== "feed";
1036
1076
  }
1077
+ var BUILTIN_NOTEBOOKS = [
1078
+ {
1079
+ slug: "journal",
1080
+ notebookId: "notebook/journal",
1081
+ name: "Journal",
1082
+ description: "Dated training log and scheduled workouts.",
1083
+ icon: "\u{1F4C5}",
1084
+ href: "/journal"
1085
+ },
1086
+ {
1087
+ slug: "playground",
1088
+ notebookId: "notebook/playground",
1089
+ name: "Playground",
1090
+ description: "Scratchpad workouts and timer experiments.",
1091
+ icon: "\u{1F9EA}",
1092
+ href: "/playgrounds"
1093
+ },
1094
+ {
1095
+ slug: "defaults",
1096
+ notebookId: "notebook/defaults",
1097
+ name: "Defaults",
1098
+ description: "Starter notes \u2014 clone any of them into your own notebooks.",
1099
+ icon: "\u{1F4DD}",
1100
+ href: "/notebook/defaults"
1101
+ },
1102
+ {
1103
+ slug: "guides",
1104
+ notebookId: "notebook/guides",
1105
+ name: "Guides",
1106
+ description: "Built-in Whiteboard Language and WQL guides.",
1107
+ icon: "\u{1F4D6}",
1108
+ href: "/notebook/guides",
1109
+ feedEntryId: "core",
1110
+ seedChunkId: "canvas"
1111
+ },
1112
+ {
1113
+ slug: "efforts",
1114
+ notebookId: "notebook/efforts",
1115
+ name: "Efforts",
1116
+ description: "The effort library \u2014 every effort the parser and analytics resolve, across the canonical disciplines.",
1117
+ icon: "\u{1F3CB}\uFE0F",
1118
+ href: "/efforts",
1119
+ feedEntryId: "core",
1120
+ seedChunkId: "efforts"
1121
+ },
1122
+ {
1123
+ slug: "equipment",
1124
+ notebookId: "notebook/equipment",
1125
+ name: "Equipment",
1126
+ description: "The equipment library \u2014 gear definitions the language resolves.",
1127
+ icon: "\u{1F527}",
1128
+ href: "/equipment",
1129
+ feedEntryId: "core",
1130
+ seedChunkId: "equipment"
1131
+ },
1132
+ {
1133
+ slug: "dashboards",
1134
+ notebookId: "notebook/dashboards",
1135
+ name: "Dashboards",
1136
+ description: "Prebuilt WQL dashboards \u2014 query compositions ready to open.",
1137
+ icon: "\u{1F4CA}",
1138
+ href: "/dashboards",
1139
+ feedEntryId: "core",
1140
+ seedChunkId: "dashboards"
1141
+ }
1142
+ ];
1037
1143
  var NOTEBOOK_TAG_PREFIX = "notebook:";
1038
1144
  var toNotebookTag = (notebookId) => `${NOTEBOOK_TAG_PREFIX}${notebookId}`;
1039
1145
  var fromNotebookTag = (tag) => tag.startsWith(NOTEBOOK_TAG_PREFIX) ? tag.slice(NOTEBOOK_TAG_PREFIX.length) : null;
@@ -1432,15 +1538,15 @@ function patchFrontmatterProperty(raw, path, value) {
1432
1538
  }
1433
1539
 
1434
1540
  // src/version.ts
1435
- var VERSION = "0.44.2159";
1436
- var GIT_SHA = "30e43c7";
1437
- var BUILD_TIME = "2026-10-24T23:07:22.311Z";
1541
+ var VERSION = "0.45.2166";
1542
+ var GIT_SHA = "32bda10";
1543
+ var BUILD_TIME = "2026-10-26T20:01:09.868Z";
1438
1544
  var SEMVER = {
1439
- version: "0.44.2159",
1440
- gitSha: "30e43c7",
1441
- buildTime: "2026-10-24T23:07:22.311Z"
1545
+ version: "0.45.2166",
1546
+ gitSha: "32bda10",
1547
+ buildTime: "2026-10-26T20:01:09.868Z"
1442
1548
  };
1443
1549
 
1444
- export { BUILD_TIME, BlockKey, CodeMetadata, CodeStatement, DEFAULT_NOTEBOOK_SLUGS, GIT_SHA, KNOWN_OUTPUT_TYPES, KNOWN_SECTION_WIDGETS, LEGACY_ORIGIN_TO_OWNERSHIP_LAYER, METRIC_OWNERSHIP_LAYER_CHAIN, Metric, MetricContainer, MetricType, NOTEBOOK_TAG_PREFIX, OutputStatement, OwnershipResolver, ParsedCodeStatement, REFERENCE_METADATA_KEY, SEMVER, SYSTEM_DEFAULT_OUTPUT_UNIT, TAG_REFERENCE_METADATA_KEY, UNIT_CATALOG, UnitConversionError, VALID_FENCE_DIALECTS, VERSION, actionableSectionKind, blockContentId, buildRawContent, calculateTotalLines, convertViaCatalog, createMetricOwnershipLedger, createTagIndex, detectScriptBlocks, dimensionKeyOf, extractBlockContent, fieldRefFromKey, fieldRefKey, findBlockAtLine, flattenFieldLeaves, fromNotebookTag, getMetricOwnershipLayer, getReferenceMetadata, getTagReference, isNoteEditable, isNotebookTag, isWorkoutSectionType, lookupUnit, mapNoteBlockChanges, matchDialectFence, normalizeFieldComponent, normalizeFieldPath, notebookSlugFromId, ownershipRank, parseDocumentSections, patchFrontmatterProperty, reconcileNoteBlocks, resolveLayer, runAffordance, systemDefaultUnit, toNotebookId, toNotebookTag, validateNoteBlocks, valueKindOf };
1550
+ export { BUILD_TIME, BUILTIN_NOTEBOOKS, BlockKey, CodeMetadata, CodeStatement, DEFAULT_NOTEBOOK_SLUGS, GIT_SHA, KNOWN_OUTPUT_TYPES, KNOWN_SECTION_WIDGETS, LEGACY_ORIGIN_TO_OWNERSHIP_LAYER, METRIC_OWNERSHIP_LAYER_CHAIN, Metric, MetricContainer, MetricType, NOTEBOOK_TAG_PREFIX, OutputStatement, OwnershipResolver, ParsedCodeStatement, REFERENCE_METADATA_KEY, SEMVER, SYSTEM_DEFAULT_OUTPUT_UNIT, TAG_REFERENCE_METADATA_KEY, UNIT_CATALOG, UnitConversionError, VALID_FENCE_DIALECTS, VERSION, actionableSectionKind, blockContentId, buildRawContent, calculateTotalLines, comparePlacements, convertViaCatalog, createMetricOwnershipLedger, createTagIndex, detectScriptBlocks, dimensionKeyOf, extractBlockContent, fieldRefFromKey, fieldRefKey, findBlockAtLine, flattenFieldLeaves, fromNotebookTag, getMetricOwnershipLayer, getReferenceMetadata, getTagReference, isNoteEditable, isNotebookTag, isWorkoutSectionType, lookupUnit, mapNoteBlockChanges, matchDialectFence, normalizeFieldComponent, normalizeFieldPath, notebookSlugFromId, orderPlacements, ownershipRank, parseDocumentSections, patchFrontmatterProperty, projectPlacements, reconcileNoteBlocks, resolveLayer, resolvePlacements, runAffordance, systemDefaultUnit, toNotebookId, toNotebookTag, validateNoteBlocks, valueKindOf };
1445
1551
  //# sourceMappingURL=index.mjs.map
1446
1552
  //# sourceMappingURL=index.mjs.map