@drghaliasri/butex 8.1.3 → 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 +1 -0
- package/dist/book.d.ts +1 -0
- package/dist/book.js +17 -1
- package/dist/book.js.map +1 -1
- package/dist/book.mjs +17 -1
- package/dist/book.mjs.map +1 -1
- package/dist/document-cli.js +16 -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
package/dist/document.mjs
CHANGED
|
@@ -8932,6 +8932,11 @@ function remapSelectionAfterRangeMove(selection, direction) {
|
|
|
8932
8932
|
function mathTex(token, equationSide, digitForm) {
|
|
8933
8933
|
return mathTokenSourceForSide(token, equationSide, digitForm, true);
|
|
8934
8934
|
}
|
|
8935
|
+
function projectedBookTarget(options, ownerId, kind) {
|
|
8936
|
+
if (options.mode !== "book-content") return void 0;
|
|
8937
|
+
const book = options.bookContext;
|
|
8938
|
+
return book?.targets?.find((target) => target.unitId === book.unitId && target.ownerId === ownerId && target.kind === kind);
|
|
8939
|
+
}
|
|
8935
8940
|
function previewInlines(field, islands, output, equationSide, document2, previewOptions) {
|
|
8936
8941
|
return field.tokens.map((token) => {
|
|
8937
8942
|
if (token.kind === "text") {
|
|
@@ -8963,7 +8968,8 @@ function previewInlines(field, islands, output, equationSide, document2, preview
|
|
|
8963
8968
|
})
|
|
8964
8969
|
};
|
|
8965
8970
|
}
|
|
8966
|
-
const
|
|
8971
|
+
const projected = projectedBookTarget(previewOptions, token.id, "eq");
|
|
8972
|
+
const number = projected ? void 0 : collectDocumentReferenceTargets(document2).find((target) => target.kind === "eq" && target.ownerId === token.id)?.number;
|
|
8967
8973
|
const island = {
|
|
8968
8974
|
id: token.id,
|
|
8969
8975
|
tex: mathTex(token, equationSide, previewOptions.digitForm),
|
|
@@ -8971,7 +8977,7 @@ function previewInlines(field, islands, output, equationSide, document2, preview
|
|
|
8971
8977
|
output,
|
|
8972
8978
|
editable: token.editable
|
|
8973
8979
|
};
|
|
8974
|
-
const numberLabel = number == null ? void 0 : formatBibliographyNumber(number, {
|
|
8980
|
+
const numberLabel = projected ? projected.ordinal : number == null ? void 0 : formatBibliographyNumber(number, {
|
|
8975
8981
|
documentDirection: previewOptions.documentDirection,
|
|
8976
8982
|
digitForm: previewOptions.digitForm
|
|
8977
8983
|
});
|
|
@@ -9000,6 +9006,8 @@ function textBlockPreview(block, islands, output, equationSide, document2, previ
|
|
|
9000
9006
|
};
|
|
9001
9007
|
}
|
|
9002
9008
|
function floatNumberLabel(document2, ownerId, previewOptions) {
|
|
9009
|
+
const projected = projectedBookTarget(previewOptions, ownerId, "fig") ?? projectedBookTarget(previewOptions, ownerId, "tab");
|
|
9010
|
+
if (projected) return projected.displayLabel;
|
|
9003
9011
|
const hit = collectDocumentReferenceTargets(document2).find((target) => target.ownerId === ownerId);
|
|
9004
9012
|
if (!hit || hit.number === null || hit.kind !== "fig" && hit.kind !== "tab") {
|
|
9005
9013
|
return void 0;
|