@drghaliasri/butex 8.1.3 → 8.2.0
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 +12 -1
- package/dist/react-book.d.ts +12 -1
- package/dist/react-book.js +2632 -1917
- package/dist/react-book.js.map +1 -1
- package/dist/react-book.mjs +2475 -1760
- package/dist/react-book.mjs.map +1 -1
- package/dist/react-document-preview.d.mts +2 -1
- package/dist/react-document-preview.d.ts +2 -1
- package/dist/react-document-preview.js +16 -112
- package/dist/react-document-preview.js.map +1 -1
- package/dist/react-document-preview.mjs +16 -112
- package/dist/react-document-preview.mjs.map +1 -1
- package/dist/react-document.d.mts +5 -3
- package/dist/react-document.d.ts +5 -3
- package/dist/react-document.js +1818 -1455
- package/dist/react-document.js.map +1 -1
- package/dist/react-document.mjs +1709 -1346
- package/dist/react-document.mjs.map +1 -1
- package/dist/react.js +1274 -818
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1232 -776
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/document.d.mts
CHANGED
|
@@ -1089,6 +1089,7 @@ type DocumentBookTarget = {
|
|
|
1089
1089
|
kind: DocumentLabelKind | 'section' | 'subsection' | 'subsubsection' | 'chapter' | 'appendix';
|
|
1090
1090
|
caption?: string;
|
|
1091
1091
|
displayLabel?: string;
|
|
1092
|
+
ordinal?: string;
|
|
1092
1093
|
manualKey?: string;
|
|
1093
1094
|
};
|
|
1094
1095
|
type DocumentBookContext = {
|
package/dist/document.d.ts
CHANGED
|
@@ -1089,6 +1089,7 @@ type DocumentBookTarget = {
|
|
|
1089
1089
|
kind: DocumentLabelKind | 'section' | 'subsection' | 'subsubsection' | 'chapter' | 'appendix';
|
|
1090
1090
|
caption?: string;
|
|
1091
1091
|
displayLabel?: string;
|
|
1092
|
+
ordinal?: string;
|
|
1092
1093
|
manualKey?: string;
|
|
1093
1094
|
};
|
|
1094
1095
|
type DocumentBookContext = {
|
package/dist/document.js
CHANGED
|
@@ -9107,6 +9107,11 @@ function remapSelectionAfterRangeMove(selection, direction) {
|
|
|
9107
9107
|
function mathTex(token, equationSide, digitForm) {
|
|
9108
9108
|
return mathTokenSourceForSide(token, equationSide, digitForm, true);
|
|
9109
9109
|
}
|
|
9110
|
+
function projectedBookTarget(options, ownerId, kind) {
|
|
9111
|
+
if (options.mode !== "book-content") return void 0;
|
|
9112
|
+
const book = options.bookContext;
|
|
9113
|
+
return book?.targets?.find((target) => target.unitId === book.unitId && target.ownerId === ownerId && target.kind === kind);
|
|
9114
|
+
}
|
|
9110
9115
|
function previewInlines(field, islands, output, equationSide, document2, previewOptions) {
|
|
9111
9116
|
return field.tokens.map((token) => {
|
|
9112
9117
|
if (token.kind === "text") {
|
|
@@ -9138,7 +9143,8 @@ function previewInlines(field, islands, output, equationSide, document2, preview
|
|
|
9138
9143
|
})
|
|
9139
9144
|
};
|
|
9140
9145
|
}
|
|
9141
|
-
const
|
|
9146
|
+
const projected = projectedBookTarget(previewOptions, token.id, "eq");
|
|
9147
|
+
const number = projected ? void 0 : collectDocumentReferenceTargets(document2).find((target) => target.kind === "eq" && target.ownerId === token.id)?.number;
|
|
9142
9148
|
const island = {
|
|
9143
9149
|
id: token.id,
|
|
9144
9150
|
tex: mathTex(token, equationSide, previewOptions.digitForm),
|
|
@@ -9146,7 +9152,7 @@ function previewInlines(field, islands, output, equationSide, document2, preview
|
|
|
9146
9152
|
output,
|
|
9147
9153
|
editable: token.editable
|
|
9148
9154
|
};
|
|
9149
|
-
const numberLabel = number == null ? void 0 : formatBibliographyNumber(number, {
|
|
9155
|
+
const numberLabel = projected ? projected.ordinal : number == null ? void 0 : formatBibliographyNumber(number, {
|
|
9150
9156
|
documentDirection: previewOptions.documentDirection,
|
|
9151
9157
|
digitForm: previewOptions.digitForm
|
|
9152
9158
|
});
|
|
@@ -9175,6 +9181,8 @@ function textBlockPreview(block, islands, output, equationSide, document2, previ
|
|
|
9175
9181
|
};
|
|
9176
9182
|
}
|
|
9177
9183
|
function floatNumberLabel(document2, ownerId, previewOptions) {
|
|
9184
|
+
const projected = projectedBookTarget(previewOptions, ownerId, "fig") ?? projectedBookTarget(previewOptions, ownerId, "tab");
|
|
9185
|
+
if (projected) return projected.displayLabel;
|
|
9178
9186
|
const hit = collectDocumentReferenceTargets(document2).find((target) => target.ownerId === ownerId);
|
|
9179
9187
|
if (!hit || hit.number === null || hit.kind !== "fig" && hit.kind !== "tab") {
|
|
9180
9188
|
return void 0;
|