@riboseinc/anafero-cli 0.0.57 → 0.0.59
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/CLI.tsx +4 -1
- package/bootstrap.css +32 -9
- package/bootstrap.css.map +3 -3
- package/bootstrap.js +33 -8
- package/bootstrap.js.map +4 -4
- package/build-site.css +32 -9
- package/build-site.mjs +120 -85
- package/package.json +1 -1
package/build-site.css
CHANGED
|
@@ -31748,13 +31748,13 @@ tbody.table_0cdc494a_hm005a_spectrum-Table-body .table_0cdc494a_hm005a_spectrum-
|
|
|
31748
31748
|
@media (prefers-color-scheme: light) {
|
|
31749
31749
|
& {
|
|
31750
31750
|
color-scheme: light;
|
|
31751
|
-
background: rgb(
|
|
31751
|
+
background: rgb(213, 213, 213);
|
|
31752
31752
|
}
|
|
31753
31753
|
}
|
|
31754
31754
|
@media (prefers-color-scheme: dark) {
|
|
31755
31755
|
& {
|
|
31756
31756
|
color-scheme: dark;
|
|
31757
|
-
background: rgb(
|
|
31757
|
+
background: rgb(0, 0, 0);
|
|
31758
31758
|
}
|
|
31759
31759
|
}
|
|
31760
31760
|
}
|
|
@@ -31820,7 +31820,7 @@ tbody.table_0cdc494a_hm005a_spectrum-Table-body .table_0cdc494a_hm005a_spectrum-
|
|
|
31820
31820
|
background-color: #f06;
|
|
31821
31821
|
color: white;
|
|
31822
31822
|
}
|
|
31823
|
-
padding: 0
|
|
31823
|
+
padding: 0;
|
|
31824
31824
|
font-size: 16px;
|
|
31825
31825
|
font-weight: 330;
|
|
31826
31826
|
overflow-x: auto;
|
|
@@ -31859,16 +31859,21 @@ tbody.table_0cdc494a_hm005a_spectrum-Table-body .table_0cdc494a_hm005a_spectrum-
|
|
|
31859
31859
|
}
|
|
31860
31860
|
}
|
|
31861
31861
|
.style_resourceBreadcrumbsNav {
|
|
31862
|
-
margin: 0
|
|
31862
|
+
margin: 0;
|
|
31863
|
+
padding: 0.5em 2em 0 2em;
|
|
31863
31864
|
list-style: none;
|
|
31864
|
-
|
|
31865
|
-
|
|
31865
|
+
background-image:
|
|
31866
|
+
linear-gradient(
|
|
31867
|
+
178deg,
|
|
31868
|
+
transparent,
|
|
31869
|
+
var(--spectrum-alias-highlight-hover) 2rem);
|
|
31870
|
+
color: var(--spectrum-accent-color-1300);
|
|
31866
31871
|
> li {
|
|
31867
31872
|
display: inline-block;
|
|
31868
31873
|
> a {
|
|
31869
31874
|
&:link,
|
|
31870
31875
|
&:visited {
|
|
31871
|
-
color: var(--spectrum-
|
|
31876
|
+
color: var(--spectrum-accent-color-1300);
|
|
31872
31877
|
text-decoration: none;
|
|
31873
31878
|
}
|
|
31874
31879
|
&:hover {
|
|
@@ -31876,7 +31881,7 @@ tbody.table_0cdc494a_hm005a_spectrum-Table-body .table_0cdc494a_hm005a_spectrum-
|
|
|
31876
31881
|
}
|
|
31877
31882
|
}
|
|
31878
31883
|
&:first-child {
|
|
31879
|
-
font-weight:
|
|
31884
|
+
font-weight: bold;
|
|
31880
31885
|
}
|
|
31881
31886
|
&::after {
|
|
31882
31887
|
margin: 0 0.5em;
|
|
@@ -31887,6 +31892,11 @@ tbody.table_0cdc494a_hm005a_spectrum-Table-body .table_0cdc494a_hm005a_spectrum-
|
|
|
31887
31892
|
}
|
|
31888
31893
|
.style_navListView {
|
|
31889
31894
|
background: var(--spectrum-alias-background-color-default);
|
|
31895
|
+
background-image:
|
|
31896
|
+
linear-gradient(
|
|
31897
|
+
100deg,
|
|
31898
|
+
var(--spectrum-alias-background-color-default) 20%,
|
|
31899
|
+
var(--spectrum-alias-pasteboard-background-color) 180%);
|
|
31890
31900
|
border: none;
|
|
31891
31901
|
border-radius: 0;
|
|
31892
31902
|
.style_navListViewItemWithLink {
|
|
@@ -31911,9 +31921,22 @@ tbody.table_0cdc494a_hm005a_spectrum-Table-body .table_0cdc494a_hm005a_spectrum-
|
|
|
31911
31921
|
width: 58px;
|
|
31912
31922
|
display: flex;
|
|
31913
31923
|
flex-flow: column nowrap;
|
|
31914
|
-
background-color: var(--spectrum-alias-background-color
|
|
31924
|
+
background-color: var(--spectrum-alias-pasteboard-background-color);
|
|
31925
|
+
background-image:
|
|
31926
|
+
linear-gradient(
|
|
31927
|
+
91deg,
|
|
31928
|
+
var(--spectrum-alias-background-color-disabled) 10%,
|
|
31929
|
+
transparent 70%);
|
|
31915
31930
|
color: var(--spectrum-alias-text-color);
|
|
31916
31931
|
z-index: 22;
|
|
31932
|
+
&.style_browserBarExpanded {
|
|
31933
|
+
background-color: var(--spectrum-alias-background-color-default);
|
|
31934
|
+
background-image:
|
|
31935
|
+
linear-gradient(
|
|
31936
|
+
91deg,
|
|
31937
|
+
var(--spectrum-alias-background-color-disabled) 10%,
|
|
31938
|
+
transparent 70%);
|
|
31939
|
+
}
|
|
31917
31940
|
.style_browserBarTitle {
|
|
31918
31941
|
flex: 1;
|
|
31919
31942
|
overflow: hidden;
|
package/build-site.mjs
CHANGED
|
@@ -294383,7 +294383,8 @@ var Tasks = function({ tasks }) {
|
|
|
294383
294383
|
};
|
|
294384
294384
|
var TaskTree = function({ task, progress, error: error4, subtasks }) {
|
|
294385
294385
|
const hasProgressEstimate = progress && progress.total !== void 0 && progress.done !== void 0;
|
|
294386
|
-
|
|
294386
|
+
const progressLabel = hasProgressEstimate ? `${task}: ${progress.done} of ${progress.total}` : task;
|
|
294387
|
+
return /* @__PURE__ */ import_react54.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react54.default.createElement(Box_default, { height: hasProgressEstimate ? 2 : 1, flexDirection: "column" }, progress ? /* @__PURE__ */ import_react54.default.createElement(import_react54.default.Fragment, null, /* @__PURE__ */ import_react54.default.createElement(Box_default, { height: 1, gap: 2, flexGrow: 0 }, /* @__PURE__ */ import_react54.default.createElement(Spinner, { label: progressLabel }), /* @__PURE__ */ import_react54.default.createElement(Box_default, { flexGrow: 0 }, /* @__PURE__ */ import_react54.default.createElement(Text, null, progress.state ?? "working\u2026"))), /* @__PURE__ */ import_react54.default.createElement(Box_default, { height: 1, flexGrow: 0 }, hasProgressEstimate ? /* @__PURE__ */ import_react54.default.createElement(ProgressBar, { value: 100 / progress.total * progress.done }) : null)) : error4 ? /* @__PURE__ */ import_react54.default.createElement(StatusMessage, { variant: "error" }, task, ": ", error4) : /* @__PURE__ */ import_react54.default.createElement(StatusMessage, { variant: "success" }, task)), Object.keys(subtasks ?? []).length > 0 ? /* @__PURE__ */ import_react54.default.createElement(Box_default, { marginLeft: 2, flexDirection: "column" }, /* @__PURE__ */ import_react54.default.createElement(Tasks, { tasks: subtasks })) : null);
|
|
294387
294388
|
};
|
|
294388
294389
|
|
|
294389
294390
|
// ../anafero/cache.mts
|
|
@@ -313497,6 +313498,7 @@ __export(anafero_exports, {
|
|
|
313497
313498
|
VersioningSchema: () => VersioningSchema,
|
|
313498
313499
|
dedupeGraph: () => dedupeGraph,
|
|
313499
313500
|
dedupeResourceRelationList: () => dedupeResourceRelationList,
|
|
313501
|
+
extractRelationsForIndexing: () => extractRelationsForIndexing,
|
|
313500
313502
|
fillInLocale: () => fillInLocale,
|
|
313501
313503
|
gatherDescribedResourcesFromJsonifiedProseMirrorNode: () => gatherDescribedResourcesFromJsonifiedProseMirrorNode,
|
|
313502
313504
|
gatherTextFromJsonifiedProseMirrorNode: () => gatherTextFromJsonifiedProseMirrorNode,
|
|
@@ -313505,6 +313507,7 @@ __export(anafero_exports, {
|
|
|
313505
313507
|
isURIString: () => isURIString,
|
|
313506
313508
|
makeDummyInMemoryCache: () => makeDummyInMemoryCache,
|
|
313507
313509
|
parseModuleRef: () => parseModuleRef,
|
|
313510
|
+
preprocessStringForIndexing: () => preprocessStringForIndexing,
|
|
313508
313511
|
resolveChain: () => resolveChain,
|
|
313509
313512
|
stripLeadingSlash: () => stripLeadingSlash,
|
|
313510
313513
|
stripTrailingSlash: () => stripTrailingSlash,
|
|
@@ -313642,6 +313645,17 @@ function getTextContent(graph, subject, partPredicate) {
|
|
|
313642
313645
|
return allSubparts;
|
|
313643
313646
|
}
|
|
313644
313647
|
|
|
313648
|
+
// ../anafero/search.mts
|
|
313649
|
+
init_cjs_shim();
|
|
313650
|
+
function preprocessStringForIndexing(text9) {
|
|
313651
|
+
return text9.normalize("NFKD").replace(/\p{Diacritic}/gu, "").trim();
|
|
313652
|
+
}
|
|
313653
|
+
function extractRelationsForIndexing(uri, graph, isDefinedSubject) {
|
|
313654
|
+
return graph.filter(
|
|
313655
|
+
([s2, p3, o2]) => p3 === "hasPart" && (s2 === uri || s2 === ROOT_SUBJECT) && !o2.startsWith("data:") && (!isURIString(o2) || !isDefinedSubject(o2))
|
|
313656
|
+
);
|
|
313657
|
+
}
|
|
313658
|
+
|
|
313645
313659
|
// ../firelight-gui/loader.mts
|
|
313646
313660
|
init_cjs_shim();
|
|
313647
313661
|
|
|
@@ -316534,6 +316548,7 @@ var style_default = {
|
|
|
316534
316548
|
navListView: "style_navListView",
|
|
316535
316549
|
navListViewItemWithLink: "style_navListViewItemWithLink",
|
|
316536
316550
|
browserBar: "style_browserBar",
|
|
316551
|
+
browserBarExpanded: "style_browserBarExpanded",
|
|
316537
316552
|
browserBarTitle: "style_browserBarTitle",
|
|
316538
316553
|
browserBarTitleLink: "style_browserBarTitleLink",
|
|
316539
316554
|
browserBarToolbar: "style_browserBarToolbar",
|
|
@@ -316569,7 +316584,10 @@ var BrowserBar = function({
|
|
|
316569
316584
|
}
|
|
316570
316585
|
return;
|
|
316571
316586
|
}, [!!loadProgress]);
|
|
316572
|
-
return /* @__PURE__ */ import_react124.default.createElement($7167f8da3cce35e4$export$2881499e37b75b9a, { theme: $bf24a13e98395dd3$export$bca14c5b3b88a9c9, ...providerProps }, /* @__PURE__ */ import_react124.default.createElement("div", { className:
|
|
316587
|
+
return /* @__PURE__ */ import_react124.default.createElement($7167f8da3cce35e4$export$2881499e37b75b9a, { theme: $bf24a13e98395dd3$export$bca14c5b3b88a9c9, ...providerProps }, /* @__PURE__ */ import_react124.default.createElement("div", { className: `
|
|
316588
|
+
${style_default.browserBar}
|
|
316589
|
+
${activeBrowsingMode ? style_default.browserBarExpanded : ""}
|
|
316590
|
+
` }, /* @__PURE__ */ import_react124.default.createElement("header", { className: style_default.browserBarTitle }, /* @__PURE__ */ import_react124.default.createElement("h1", null, /* @__PURE__ */ import_react124.default.createElement("a", { href: rootURL, className: style_default.browserBarTitleLink }, title))), showToolbar ? /* @__PURE__ */ import_react124.default.createElement(
|
|
316573
316591
|
$13c3c67164f4d5be$export$4c260019440d418f,
|
|
316574
316592
|
{
|
|
316575
316593
|
"aria-label": "Tools",
|
|
@@ -316679,6 +316697,7 @@ var Resource = import_react127.default.forwardRef(function({
|
|
|
316679
316697
|
className,
|
|
316680
316698
|
requestedResourceURI,
|
|
316681
316699
|
searchQueryText,
|
|
316700
|
+
hideBreadcrumbs,
|
|
316682
316701
|
useDependency,
|
|
316683
316702
|
locateResource,
|
|
316684
316703
|
document: document2,
|
|
@@ -316830,7 +316849,7 @@ var Resource = import_react127.default.forwardRef(function({
|
|
|
316830
316849
|
className: `${style_default.resource} ${className ?? ""}`,
|
|
316831
316850
|
"aria-selected": ariaSelected
|
|
316832
316851
|
},
|
|
316833
|
-
/* @__PURE__ */ import_react127.default.createElement(ResourceBreadcrumbs, { parents: resourceNav.breadcrumbs }),
|
|
316852
|
+
!hideBreadcrumbs && resourceNav.breadcrumbs.length > 0 ? /* @__PURE__ */ import_react127.default.createElement(ResourceBreadcrumbs, { parents: resourceNav.breadcrumbs }) : null,
|
|
316834
316853
|
content.content ? /* @__PURE__ */ import_react127.default.createElement(ResourceHelmet, { ...content.content }) : null,
|
|
316835
316854
|
/* @__PURE__ */ import_react127.default.createElement(
|
|
316836
316855
|
Layout,
|
|
@@ -317201,6 +317220,7 @@ var makeContentReader = async function(entryPointURI, storeAdapters, findContent
|
|
|
317201
317220
|
if (!cache3.has(`graphs/${resourceURI}`)) {
|
|
317202
317221
|
cache3.add(`graphs/${resourceURI}`, []);
|
|
317203
317222
|
const contentAdapter = getAdapter(resourceURI);
|
|
317223
|
+
const seen = /* @__PURE__ */ new Set();
|
|
317204
317224
|
const queue = [resourceURI];
|
|
317205
317225
|
while (queue.length > 0) {
|
|
317206
317226
|
const currentResource = queue.pop();
|
|
@@ -317218,9 +317238,19 @@ var makeContentReader = async function(entryPointURI, storeAdapters, findContent
|
|
|
317218
317238
|
target
|
|
317219
317239
|
])
|
|
317220
317240
|
);
|
|
317221
|
-
const
|
|
317241
|
+
const rels = relations.filter(({ target }) => isURIString(target)).filter(
|
|
317222
317242
|
(rel) => !isInPageHierarchy(rel.target) && !contentAdapter.crossReferences?.(rel)
|
|
317223
|
-
).filter((rel) => !queue.includes(rel.target))
|
|
317243
|
+
).filter((rel) => !queue.includes(rel.target));
|
|
317244
|
+
const newTargets = [];
|
|
317245
|
+
for (const rel of rels) {
|
|
317246
|
+
const seenKey = JSON.stringify({ currentResource, rel });
|
|
317247
|
+
if (!seen.has(seenKey)) {
|
|
317248
|
+
seen.add(seenKey);
|
|
317249
|
+
newTargets.push(rel.target);
|
|
317250
|
+
} else {
|
|
317251
|
+
console.warn("Duplicate rel", currentResource, rel);
|
|
317252
|
+
}
|
|
317253
|
+
}
|
|
317224
317254
|
queue.push(...newTargets);
|
|
317225
317255
|
}
|
|
317226
317256
|
}
|
|
@@ -317295,10 +317325,12 @@ var makeContentReader = async function(entryPointURI, storeAdapters, findContent
|
|
|
317295
317325
|
function* generateAllPaths() {
|
|
317296
317326
|
for (const path3 of cache3.iterate("all-paths")) {
|
|
317297
317327
|
const resourceURI = getCachedResourceURIForPath(path3);
|
|
317328
|
+
const graph = getResourceGraph(resourceURI);
|
|
317298
317329
|
yield {
|
|
317299
317330
|
path: path3,
|
|
317300
317331
|
resourceURI,
|
|
317301
317332
|
meta: describeResource(resourceURI),
|
|
317333
|
+
graph,
|
|
317302
317334
|
directDescendants: cache3.has(`${path3}/direct-descendants`) ? cache3.list(`${path3}/direct-descendants`).map((path4) => {
|
|
317303
317335
|
const res = getCachedResourceURIForPath(path4);
|
|
317304
317336
|
return [`/${path4}`, res, describeResource(res)];
|
|
@@ -317540,8 +317572,8 @@ ${inject.head ?? ""}`;
|
|
|
317540
317572
|
}
|
|
317541
317573
|
const resourceMap = {};
|
|
317542
317574
|
const resourceGraph = [];
|
|
317575
|
+
const searchableResources = { pages: {}, resources: {} };
|
|
317543
317576
|
const resourceDescriptions = {};
|
|
317544
|
-
const contentCache = {};
|
|
317545
317577
|
const assetsToWrite = {};
|
|
317546
317578
|
const rootMeta = reader.describeRoot();
|
|
317547
317579
|
const maybePrimaryLanguageID = rootMeta.primaryLanguageID ?? "en";
|
|
@@ -317560,7 +317592,7 @@ ${inject.head ?? ""}`;
|
|
|
317560
317592
|
let done11 = 0;
|
|
317561
317593
|
const [allPathProgress, pathSubtask] = reportProgress("build page content", { total: totalPaths, done: done11 });
|
|
317562
317594
|
const hierarchicalResources = reader.generatePaths();
|
|
317563
|
-
for (const { path: path3, resourceURI, meta, parentChain, directDescendants } of hierarchicalResources) {
|
|
317595
|
+
for (const { path: path3, resourceURI, meta, graph, parentChain, directDescendants } of hierarchicalResources) {
|
|
317564
317596
|
done11 += 1;
|
|
317565
317597
|
allPathProgress({ total: totalPaths, done: done11 });
|
|
317566
317598
|
if (path3.startsWith("/")) {
|
|
@@ -317573,62 +317605,89 @@ ${inject.head ?? ""}`;
|
|
|
317573
317605
|
}
|
|
317574
317606
|
const [pathProgress] = pathSubtask(`${resourceURI.replaceAll("|", ":")}`, { state: "resolving relations" });
|
|
317575
317607
|
const resourceMeta = meta;
|
|
317576
|
-
const relations =
|
|
317608
|
+
const relations = graph;
|
|
317577
317609
|
pathProgress({ state: "generating resource page content" });
|
|
317578
|
-
const content = function generateContent(
|
|
317579
|
-
|
|
317580
|
-
|
|
317581
|
-
|
|
317582
|
-
|
|
317583
|
-
|
|
317584
|
-
|
|
317585
|
-
|
|
317586
|
-
|
|
317587
|
-
|
|
317588
|
-
|
|
317589
|
-
|
|
317590
|
-
|
|
317591
|
-
|
|
317592
|
-
|
|
317593
|
-
|
|
317594
|
-
|
|
317595
|
-
|
|
317596
|
-
|
|
317597
|
-
|
|
317598
|
-
|
|
317599
|
-
if (metadata.primaryLanguageID) {
|
|
317600
|
-
allLanguages.add(metadata.primaryLanguageID);
|
|
317601
|
-
}
|
|
317602
|
-
const describedResourceIDs = gatherDescribedResourcesFromJsonifiedProseMirrorNode(content2.contentDoc);
|
|
317603
|
-
for (const inPageResourceID of describedResourceIDs) {
|
|
317604
|
-
if (reader.exists(inPageResourceID)) {
|
|
317605
|
-
const pathWithFragment = `${path3}#${encodeURIComponent(inPageResourceID)}`;
|
|
317606
|
-
resourceMap[pathWithFragment] = inPageResourceID;
|
|
317607
|
-
resourceGraph.push([inPageResourceID, "isDefinedBy", `${path3}/resource.json`]);
|
|
317608
|
-
resourceDescriptions[inPageResourceID] = reader.describe(inPageResourceID);
|
|
317609
|
-
} else {
|
|
317610
|
-
console.warn(
|
|
317611
|
-
"Subresource on page does not exist in the graph",
|
|
317612
|
-
path3,
|
|
317613
|
-
inPageResourceID
|
|
317614
|
-
);
|
|
317615
|
-
}
|
|
317616
|
-
}
|
|
317617
|
-
}
|
|
317610
|
+
const content = function generateContent(uri, metadata, graph2) {
|
|
317611
|
+
let result;
|
|
317612
|
+
let content2;
|
|
317613
|
+
const maybeAdapter = findContentAdapter(uri);
|
|
317614
|
+
if (maybeAdapter) {
|
|
317615
|
+
try {
|
|
317616
|
+
content2 = maybeAdapter[1].generateContent(graph2) ?? null;
|
|
317617
|
+
} catch (e3) {
|
|
317618
|
+
console.error(
|
|
317619
|
+
"Failed to generate resource content",
|
|
317620
|
+
path3,
|
|
317621
|
+
uri,
|
|
317622
|
+
graph2.slice(0, 40).join("\n")
|
|
317623
|
+
);
|
|
317624
|
+
throw e3;
|
|
317625
|
+
}
|
|
317626
|
+
if (content2) {
|
|
317627
|
+
result = {
|
|
317628
|
+
adapterID: maybeAdapter[0],
|
|
317629
|
+
content: { ...metadata, ...content2 }
|
|
317630
|
+
};
|
|
317618
317631
|
} else {
|
|
317619
|
-
console.warn("No
|
|
317620
|
-
|
|
317632
|
+
console.warn("No content was generated", uri);
|
|
317633
|
+
result = null;
|
|
317621
317634
|
}
|
|
317622
317635
|
} else {
|
|
317623
|
-
console.
|
|
317636
|
+
console.warn("No adapter found to render", uri);
|
|
317637
|
+
result = null;
|
|
317624
317638
|
}
|
|
317625
|
-
return
|
|
317626
|
-
}(
|
|
317639
|
+
return result;
|
|
317640
|
+
}(
|
|
317641
|
+
resourceURI,
|
|
317642
|
+
meta,
|
|
317643
|
+
relations
|
|
317644
|
+
);
|
|
317627
317645
|
pathProgress({ state: "generating page content & assets" });
|
|
317628
|
-
if (content
|
|
317646
|
+
if (content?.content) {
|
|
317647
|
+
if (meta.primaryLanguageID) {
|
|
317648
|
+
allLanguages.add(meta.primaryLanguageID);
|
|
317649
|
+
}
|
|
317629
317650
|
resourceMap[path3] = resourceURI;
|
|
317630
317651
|
resourceGraph.push([resourceURI, "isDefinedBy", `${path3}/resource.json`]);
|
|
317631
317652
|
resourceDescriptions[resourceURI] = resourceMeta;
|
|
317653
|
+
searchableResources.pages[resourceURI] = {
|
|
317654
|
+
name: resourceURI,
|
|
317655
|
+
title: preprocessStringForIndexing(meta.labelInPlainText),
|
|
317656
|
+
lang: meta.primaryLanguageID || "",
|
|
317657
|
+
body: preprocessStringForIndexing(
|
|
317658
|
+
extractRelationsForIndexing(resourceURI, relations, reader.exists).join("").trim()
|
|
317659
|
+
)
|
|
317660
|
+
};
|
|
317661
|
+
pathProgress({ state: "processing on-page subresources" });
|
|
317662
|
+
const describedResourceIDs = gatherDescribedResourcesFromJsonifiedProseMirrorNode(
|
|
317663
|
+
content.content.contentDoc
|
|
317664
|
+
);
|
|
317665
|
+
for (const inPageResourceID of describedResourceIDs) {
|
|
317666
|
+
if (reader.exists(inPageResourceID)) {
|
|
317667
|
+
const pathWithFragment = `${path3}#${encodeURIComponent(inPageResourceID)}`;
|
|
317668
|
+
const meta2 = reader.describe(inPageResourceID);
|
|
317669
|
+
const graph2 = reader.resolve(inPageResourceID);
|
|
317670
|
+
resourceMap[pathWithFragment] = inPageResourceID;
|
|
317671
|
+
resourceGraph.push([inPageResourceID, "isDefinedBy", `${path3}/resource.json`]);
|
|
317672
|
+
resourceDescriptions[inPageResourceID] = meta2;
|
|
317673
|
+
if (inPageResourceID !== resourceURI) {
|
|
317674
|
+
searchableResources.resources[inPageResourceID] = {
|
|
317675
|
+
name: inPageResourceID,
|
|
317676
|
+
title: preprocessStringForIndexing(meta2.labelInPlainText),
|
|
317677
|
+
lang: meta2.primaryLanguageID || "",
|
|
317678
|
+
body: preprocessStringForIndexing(
|
|
317679
|
+
extractRelationsForIndexing(inPageResourceID, graph2, reader.exists).join("").trim()
|
|
317680
|
+
)
|
|
317681
|
+
};
|
|
317682
|
+
}
|
|
317683
|
+
} else {
|
|
317684
|
+
console.warn(
|
|
317685
|
+
"Subresource on page does not exist in the graph",
|
|
317686
|
+
path3,
|
|
317687
|
+
inPageResourceID
|
|
317688
|
+
);
|
|
317689
|
+
}
|
|
317690
|
+
}
|
|
317632
317691
|
pathProgress({ state: "processing resource assets" });
|
|
317633
317692
|
for (const [, , o2] of relations) {
|
|
317634
317693
|
if (o2.startsWith("file:")) {
|
|
@@ -317737,44 +317796,20 @@ ${inject.head ?? ""}`;
|
|
|
317737
317796
|
this.ref("name");
|
|
317738
317797
|
this.field("title", { boost: 2 });
|
|
317739
317798
|
this.field("body");
|
|
317799
|
+
this.field("lang");
|
|
317740
317800
|
let done12 = 0;
|
|
317741
|
-
const total = Object.keys(
|
|
317742
|
-
|
|
317743
|
-
console.debug("Index search pipeline functions during", this.searchPipeline._stack.map((f3) => f3.label));
|
|
317744
|
-
const searchableResources = { pages: [], resources: [] };
|
|
317745
|
-
for (const [uri, meta] of Object.entries(resourceDescriptions)) {
|
|
317801
|
+
const total = Object.keys(searchableResources.pages).length + Object.keys(searchableResources.resources).length;
|
|
317802
|
+
for (const entry of Object.values(searchableResources.pages)) {
|
|
317746
317803
|
done12 += 1;
|
|
317747
|
-
indexProgress({ state: "adding entries for
|
|
317748
|
-
const rels = reader.resolve(uri);
|
|
317749
|
-
const relationsExcludingReferences = rels.filter(
|
|
317750
|
-
([s2, p3, o2]) => p3 === "hasPart" && (s2 === ROOT_SUBJECT || s2 === uri) && !o2.startsWith("data:") && (!isURIString(o2) || !reader.exists(o2))
|
|
317751
|
-
);
|
|
317752
|
-
const body = relationsExcludingReferences.map(([, , o2]) => o2).join("").trim().normalize("NFKD").replace(/\p{Diacritic}/gu, "").trim();
|
|
317753
|
-
const title = meta.labelInPlainText.normalize("NFKD").replace(/\p{Diacritic}/gu, "").trim();
|
|
317754
|
-
if (body || title) {
|
|
317755
|
-
const entry = {
|
|
317756
|
-
name: uri,
|
|
317757
|
-
body,
|
|
317758
|
-
title,
|
|
317759
|
-
lang: meta.primaryLanguageID ?? ""
|
|
317760
|
-
};
|
|
317761
|
-
if (contentCache[uri]) {
|
|
317762
|
-
searchableResources.pages.push(entry);
|
|
317763
|
-
} else {
|
|
317764
|
-
searchableResources.resources.push(entry);
|
|
317765
|
-
}
|
|
317766
|
-
} else {
|
|
317767
|
-
}
|
|
317768
|
-
}
|
|
317769
|
-
for (const entry of searchableResources.pages) {
|
|
317804
|
+
indexProgress({ state: "adding entries for pages", total, done: done12 });
|
|
317770
317805
|
this.add(entry, { boost: 2 });
|
|
317771
317806
|
}
|
|
317772
|
-
for (const entry of searchableResources.resources) {
|
|
317807
|
+
for (const entry of Object.values(searchableResources.resources)) {
|
|
317808
|
+
done12 += 1;
|
|
317809
|
+
indexProgress({ state: "adding entries for subresources", total, done: done12 });
|
|
317773
317810
|
this.add(entry);
|
|
317774
317811
|
}
|
|
317775
317812
|
});
|
|
317776
|
-
console.debug("Index pipeline functions after", lunrIndex.pipeline._stack.map((f3) => f3.label));
|
|
317777
|
-
console.debug("Index search pipeline functions after", lunrIndex.searchPipeline?._stack?.map((f3) => f3.label));
|
|
317778
317813
|
indexProgress(null);
|
|
317779
317814
|
yield { "/search-index.json": encoder.encode(JSON.stringify(lunrIndex, null, 4)) };
|
|
317780
317815
|
}
|