@drghaliasri/butex 8.1.2 → 8.1.5
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/book.d.mts +19 -1
- package/dist/book.d.ts +19 -1
- package/dist/book.js +2501 -2
- package/dist/book.js.map +1 -1
- package/dist/book.mjs +2500 -2
- package/dist/book.mjs.map +1 -1
- package/dist/document-cli.js +222 -1
- package/dist/document-cli.js.map +1 -1
- package/dist/document.d.mts +1 -0
- package/dist/document.d.ts +1 -0
- package/dist/document.js +10 -2
- package/dist/document.js.map +1 -1
- package/dist/document.mjs +10 -2
- package/dist/document.mjs.map +1 -1
- package/dist/react-book.d.mts +1 -0
- package/dist/react-book.d.ts +1 -0
- package/dist/react-book.js +10 -2
- package/dist/react-book.js.map +1 -1
- package/dist/react-book.mjs +10 -2
- package/dist/react-book.mjs.map +1 -1
- package/dist/react-document-preview.d.mts +1 -0
- package/dist/react-document-preview.d.ts +1 -0
- package/dist/react-document-preview.js +10 -2
- package/dist/react-document-preview.js.map +1 -1
- package/dist/react-document-preview.mjs +10 -2
- package/dist/react-document-preview.mjs.map +1 -1
- package/dist/react-document.d.mts +1 -0
- package/dist/react-document.d.ts +1 -0
- package/dist/react-document.js +10 -2
- package/dist/react-document.js.map +1 -1
- package/dist/react-document.mjs +10 -2
- package/dist/react-document.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -531,6 +531,7 @@ type DocumentBookTarget = {
|
|
|
531
531
|
kind: DocumentLabelKind | 'section' | 'subsection' | 'subsubsection' | 'chapter' | 'appendix';
|
|
532
532
|
caption?: string;
|
|
533
533
|
displayLabel?: string;
|
|
534
|
+
ordinal?: string;
|
|
534
535
|
manualKey?: string;
|
|
535
536
|
};
|
|
536
537
|
type DocumentBookContext = {
|
package/dist/react-document.d.ts
CHANGED
|
@@ -531,6 +531,7 @@ type DocumentBookTarget = {
|
|
|
531
531
|
kind: DocumentLabelKind | 'section' | 'subsection' | 'subsubsection' | 'chapter' | 'appendix';
|
|
532
532
|
caption?: string;
|
|
533
533
|
displayLabel?: string;
|
|
534
|
+
ordinal?: string;
|
|
534
535
|
manualKey?: string;
|
|
535
536
|
};
|
|
536
537
|
type DocumentBookContext = {
|
package/dist/react-document.js
CHANGED
|
@@ -11224,6 +11224,11 @@ function remapSelectionAfterRangeMove(selection, direction) {
|
|
|
11224
11224
|
function mathTex(token, equationSide, digitForm) {
|
|
11225
11225
|
return mathTokenSourceForSide(token, equationSide, digitForm, true);
|
|
11226
11226
|
}
|
|
11227
|
+
function projectedBookTarget(options, ownerId, kind) {
|
|
11228
|
+
if (options.mode !== "book-content") return void 0;
|
|
11229
|
+
const book = options.bookContext;
|
|
11230
|
+
return book?.targets?.find((target) => target.unitId === book.unitId && target.ownerId === ownerId && target.kind === kind);
|
|
11231
|
+
}
|
|
11227
11232
|
function previewInlines(field, islands, output, equationSide, document2, previewOptions) {
|
|
11228
11233
|
return field.tokens.map((token) => {
|
|
11229
11234
|
if (token.kind === "text") {
|
|
@@ -11255,7 +11260,8 @@ function previewInlines(field, islands, output, equationSide, document2, preview
|
|
|
11255
11260
|
})
|
|
11256
11261
|
};
|
|
11257
11262
|
}
|
|
11258
|
-
const
|
|
11263
|
+
const projected = projectedBookTarget(previewOptions, token.id, "eq");
|
|
11264
|
+
const number = projected ? void 0 : collectDocumentReferenceTargets(document2).find((target) => target.kind === "eq" && target.ownerId === token.id)?.number;
|
|
11259
11265
|
const island = {
|
|
11260
11266
|
id: token.id,
|
|
11261
11267
|
tex: mathTex(token, equationSide, previewOptions.digitForm),
|
|
@@ -11263,7 +11269,7 @@ function previewInlines(field, islands, output, equationSide, document2, preview
|
|
|
11263
11269
|
output,
|
|
11264
11270
|
editable: token.editable
|
|
11265
11271
|
};
|
|
11266
|
-
const numberLabel = number == null ? void 0 : formatBibliographyNumber(number, {
|
|
11272
|
+
const numberLabel = projected ? projected.ordinal : number == null ? void 0 : formatBibliographyNumber(number, {
|
|
11267
11273
|
documentDirection: previewOptions.documentDirection,
|
|
11268
11274
|
digitForm: previewOptions.digitForm
|
|
11269
11275
|
});
|
|
@@ -11292,6 +11298,8 @@ function textBlockPreview(block, islands, output, equationSide, document2, previ
|
|
|
11292
11298
|
};
|
|
11293
11299
|
}
|
|
11294
11300
|
function floatNumberLabel(document2, ownerId, previewOptions) {
|
|
11301
|
+
const projected = projectedBookTarget(previewOptions, ownerId, "fig") ?? projectedBookTarget(previewOptions, ownerId, "tab");
|
|
11302
|
+
if (projected) return projected.displayLabel;
|
|
11295
11303
|
const hit = collectDocumentReferenceTargets(document2).find((target) => target.ownerId === ownerId);
|
|
11296
11304
|
if (!hit || hit.number === null || hit.kind !== "fig" && hit.kind !== "tab") {
|
|
11297
11305
|
return void 0;
|