superbee 0.4.4-pre.2 → 0.4.4-pre.3
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/publication-bridge.mjs +30 -12
- package/dist/publication.mjs +30 -12
- package/dist/superbee.mjs +4212 -2832
- package/package.json +1 -1
- package/references/author-an-integration.md +78 -1
|
@@ -3418,6 +3418,13 @@ function isExternalHref(href) {
|
|
|
3418
3418
|
return /^[a-z][a-z0-9+.-]*:\/\//i.test(h) || h.startsWith("mailto:") || h.startsWith("#");
|
|
3419
3419
|
}
|
|
3420
3420
|
function extractMarkdownLinks(source, options = {}) {
|
|
3421
|
+
const out = [];
|
|
3422
|
+
for (const span of extractMarkdownLinkSpans(source, options)) {
|
|
3423
|
+
if (!span.image) out.push({ text: span.text, href: span.href });
|
|
3424
|
+
}
|
|
3425
|
+
return out;
|
|
3426
|
+
}
|
|
3427
|
+
function extractMarkdownLinkSpans(source, options = {}) {
|
|
3421
3428
|
const body = options.skipCode ? maskMarkdownCode(source) : source;
|
|
3422
3429
|
const out = [];
|
|
3423
3430
|
let textOpen = -1;
|
|
@@ -3428,12 +3435,16 @@ function extractMarkdownLinks(source, options = {}) {
|
|
|
3428
3435
|
const char = body[cursor];
|
|
3429
3436
|
if (hrefRest) {
|
|
3430
3437
|
if (char === ")") {
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3438
|
+
const image = hrefRest.open > 0 && body[hrefRest.open - 1] === "!";
|
|
3439
|
+
out.push({
|
|
3440
|
+
text: source.slice(hrefRest.open + 1, hrefRest.close),
|
|
3441
|
+
href: source.slice(hrefRest.hrefStart, cursor),
|
|
3442
|
+
start: image ? hrefRest.open - 1 : hrefRest.open,
|
|
3443
|
+
end: cursor + 1,
|
|
3444
|
+
hrefStart: hrefRest.hrefStart,
|
|
3445
|
+
hrefEnd: cursor,
|
|
3446
|
+
image
|
|
3447
|
+
});
|
|
3437
3448
|
textOpen = -1;
|
|
3438
3449
|
afterClose = void 0;
|
|
3439
3450
|
hrefFirst = void 0;
|
|
@@ -3813,12 +3824,13 @@ async function readDocVersioned(backend, id) {
|
|
|
3813
3824
|
function isEnoent(err) {
|
|
3814
3825
|
return typeof err === "object" && err !== null && err.code === "ENOENT";
|
|
3815
3826
|
}
|
|
3816
|
-
async function readManyExisting(backend, ids, onMalformed) {
|
|
3827
|
+
async function readManyExisting(backend, ids, onMalformed, onAliased) {
|
|
3817
3828
|
try {
|
|
3818
3829
|
return await backend.readMany(ids);
|
|
3819
3830
|
} catch (err) {
|
|
3820
|
-
const malformed = err instanceof MalformedDocumentError;
|
|
3821
|
-
|
|
3831
|
+
const malformed = err instanceof MalformedDocumentError && onMalformed !== void 0;
|
|
3832
|
+
const aliased = err instanceof FilesystemIdentityAliasError && onAliased !== void 0;
|
|
3833
|
+
if (!isEnoent(err) && !malformed && !aliased) throw err;
|
|
3822
3834
|
const out = [];
|
|
3823
3835
|
for (const id of ids) {
|
|
3824
3836
|
try {
|
|
@@ -3829,6 +3841,10 @@ async function readManyExisting(backend, ids, onMalformed) {
|
|
|
3829
3841
|
onMalformed({ id, reason: candidate.detail });
|
|
3830
3842
|
continue;
|
|
3831
3843
|
}
|
|
3844
|
+
if (candidate instanceof FilesystemIdentityAliasError && onAliased) {
|
|
3845
|
+
onAliased({ id, reason: candidate.message });
|
|
3846
|
+
continue;
|
|
3847
|
+
}
|
|
3832
3848
|
throw candidate;
|
|
3833
3849
|
}
|
|
3834
3850
|
}
|
|
@@ -4406,6 +4422,11 @@ async function acquireFilesystemIdentityLock(key, identity, options = {}) {
|
|
|
4406
4422
|
return claimLockPath(path.join(lockRoot, `${key}.lock`), owner, waitMs, pollMs, policy);
|
|
4407
4423
|
}
|
|
4408
4424
|
|
|
4425
|
+
// ../core/src/identity-fold.ts
|
|
4426
|
+
function foldSegment(segment) {
|
|
4427
|
+
return segment.normalize("NFKD").toLowerCase().toUpperCase().toLowerCase();
|
|
4428
|
+
}
|
|
4429
|
+
|
|
4409
4430
|
// ../core/src/filesystem-identity.ts
|
|
4410
4431
|
async function replaceExistingLeaf(port, tmp, target, rel) {
|
|
4411
4432
|
try {
|
|
@@ -4451,9 +4472,6 @@ function relSegments(rel) {
|
|
|
4451
4472
|
}
|
|
4452
4473
|
return segments;
|
|
4453
4474
|
}
|
|
4454
|
-
function foldSegment(segment) {
|
|
4455
|
-
return segment.normalize("NFKD").toLowerCase().toUpperCase().toLowerCase();
|
|
4456
|
-
}
|
|
4457
4475
|
async function existingAnchor(resolved) {
|
|
4458
4476
|
const tail = [];
|
|
4459
4477
|
let candidate = resolved;
|
package/dist/publication.mjs
CHANGED
|
@@ -31372,6 +31372,13 @@ function isExternalHref(href) {
|
|
|
31372
31372
|
return /^[a-z][a-z0-9+.-]*:\/\//i.test(h) || h.startsWith("mailto:") || h.startsWith("#");
|
|
31373
31373
|
}
|
|
31374
31374
|
function extractMarkdownLinks(source, options = {}) {
|
|
31375
|
+
const out = [];
|
|
31376
|
+
for (const span of extractMarkdownLinkSpans(source, options)) {
|
|
31377
|
+
if (!span.image) out.push({ text: span.text, href: span.href });
|
|
31378
|
+
}
|
|
31379
|
+
return out;
|
|
31380
|
+
}
|
|
31381
|
+
function extractMarkdownLinkSpans(source, options = {}) {
|
|
31375
31382
|
const body = options.skipCode ? maskMarkdownCode(source) : source;
|
|
31376
31383
|
const out = [];
|
|
31377
31384
|
let textOpen = -1;
|
|
@@ -31382,12 +31389,16 @@ function extractMarkdownLinks(source, options = {}) {
|
|
|
31382
31389
|
const char = body[cursor];
|
|
31383
31390
|
if (hrefRest) {
|
|
31384
31391
|
if (char === ")") {
|
|
31385
|
-
|
|
31386
|
-
|
|
31387
|
-
|
|
31388
|
-
|
|
31389
|
-
|
|
31390
|
-
|
|
31392
|
+
const image = hrefRest.open > 0 && body[hrefRest.open - 1] === "!";
|
|
31393
|
+
out.push({
|
|
31394
|
+
text: source.slice(hrefRest.open + 1, hrefRest.close),
|
|
31395
|
+
href: source.slice(hrefRest.hrefStart, cursor),
|
|
31396
|
+
start: image ? hrefRest.open - 1 : hrefRest.open,
|
|
31397
|
+
end: cursor + 1,
|
|
31398
|
+
hrefStart: hrefRest.hrefStart,
|
|
31399
|
+
hrefEnd: cursor,
|
|
31400
|
+
image
|
|
31401
|
+
});
|
|
31391
31402
|
textOpen = -1;
|
|
31392
31403
|
afterClose = void 0;
|
|
31393
31404
|
hrefFirst = void 0;
|
|
@@ -31767,12 +31778,13 @@ async function readDocVersioned(backend, id) {
|
|
|
31767
31778
|
function isEnoent(err) {
|
|
31768
31779
|
return typeof err === "object" && err !== null && err.code === "ENOENT";
|
|
31769
31780
|
}
|
|
31770
|
-
async function readManyExisting(backend, ids, onMalformed) {
|
|
31781
|
+
async function readManyExisting(backend, ids, onMalformed, onAliased) {
|
|
31771
31782
|
try {
|
|
31772
31783
|
return await backend.readMany(ids);
|
|
31773
31784
|
} catch (err) {
|
|
31774
|
-
const malformed = err instanceof MalformedDocumentError;
|
|
31775
|
-
|
|
31785
|
+
const malformed = err instanceof MalformedDocumentError && onMalformed !== void 0;
|
|
31786
|
+
const aliased = err instanceof FilesystemIdentityAliasError && onAliased !== void 0;
|
|
31787
|
+
if (!isEnoent(err) && !malformed && !aliased) throw err;
|
|
31776
31788
|
const out = [];
|
|
31777
31789
|
for (const id of ids) {
|
|
31778
31790
|
try {
|
|
@@ -31783,6 +31795,10 @@ async function readManyExisting(backend, ids, onMalformed) {
|
|
|
31783
31795
|
onMalformed({ id, reason: candidate.detail });
|
|
31784
31796
|
continue;
|
|
31785
31797
|
}
|
|
31798
|
+
if (candidate instanceof FilesystemIdentityAliasError && onAliased) {
|
|
31799
|
+
onAliased({ id, reason: candidate.message });
|
|
31800
|
+
continue;
|
|
31801
|
+
}
|
|
31786
31802
|
throw candidate;
|
|
31787
31803
|
}
|
|
31788
31804
|
}
|
|
@@ -32360,6 +32376,11 @@ async function acquireFilesystemIdentityLock(key, identity, options = {}) {
|
|
|
32360
32376
|
return claimLockPath(path.join(lockRoot, `${key}.lock`), owner, waitMs, pollMs, policy);
|
|
32361
32377
|
}
|
|
32362
32378
|
|
|
32379
|
+
// ../core/src/identity-fold.ts
|
|
32380
|
+
function foldSegment(segment) {
|
|
32381
|
+
return segment.normalize("NFKD").toLowerCase().toUpperCase().toLowerCase();
|
|
32382
|
+
}
|
|
32383
|
+
|
|
32363
32384
|
// ../core/src/filesystem-identity.ts
|
|
32364
32385
|
async function replaceExistingLeaf(port, tmp, target, rel) {
|
|
32365
32386
|
try {
|
|
@@ -32405,9 +32426,6 @@ function relSegments(rel) {
|
|
|
32405
32426
|
}
|
|
32406
32427
|
return segments;
|
|
32407
32428
|
}
|
|
32408
|
-
function foldSegment(segment) {
|
|
32409
|
-
return segment.normalize("NFKD").toLowerCase().toUpperCase().toLowerCase();
|
|
32410
|
-
}
|
|
32411
32429
|
async function existingAnchor(resolved) {
|
|
32412
32430
|
const tail = [];
|
|
32413
32431
|
let candidate = resolved;
|