@pretextbook/import 0.11.0 → 0.13.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/convert-worker.cjs +1 -1
- package/dist/convert-worker.js +1 -1
- package/dist/engine-routing-ClG81Gp5.cjs +3 -0
- package/dist/engine-routing-UEp8JP8x.js +179 -0
- package/dist/index.cjs +12 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +426 -347
- package/dist/lib/engine-routing.d.ts +65 -0
- package/dist/lib/paste/place-markup.d.ts +26 -4
- package/dist/react/import-wizard.d.ts +9 -3
- package/dist/react.cjs +2 -2
- package/dist/react.js +502 -495
- package/dist/{upload-BnRj1gU1.cjs → upload-B1HDv3IB.cjs} +4 -4
- package/dist/{upload-H_OCZBBn.js → upload-DJuIYze6.js} +65 -64
- package/package.json +1 -1
- package/dist/import-mode-CV7gCDzF.cjs +0 -3
- package/dist/import-mode-DQ8g5P8P.js +0 -122
|
@@ -7568,81 +7568,82 @@ function po(t, r) {
|
|
|
7568
7568
|
return t.startsWith(n) && t.endsWith(".ptx");
|
|
7569
7569
|
}
|
|
7570
7570
|
export {
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7571
|
+
Ut as $,
|
|
7572
|
+
_o as A,
|
|
7573
|
+
va as B,
|
|
7574
7574
|
qi as C,
|
|
7575
7575
|
Nt as D,
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7576
|
+
Ne as E,
|
|
7577
|
+
Ta as F,
|
|
7578
|
+
Ra as G,
|
|
7579
|
+
Oa as H,
|
|
7580
|
+
os as I,
|
|
7581
|
+
Os as J,
|
|
7582
|
+
bs as K,
|
|
7583
7583
|
Dr as L,
|
|
7584
7584
|
ui as M,
|
|
7585
|
-
|
|
7586
|
-
|
|
7585
|
+
ge as N,
|
|
7586
|
+
le as O,
|
|
7587
7587
|
Na as P,
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7588
|
+
Le as Q,
|
|
7589
|
+
qa as R,
|
|
7590
|
+
Je as S,
|
|
7591
|
+
jt as T,
|
|
7592
|
+
We as U,
|
|
7593
|
+
gs as V,
|
|
7594
|
+
Ir as W,
|
|
7595
|
+
Ca as X,
|
|
7596
|
+
vo as Y,
|
|
7597
|
+
Eo as Z,
|
|
7598
|
+
Ot as _,
|
|
7599
7599
|
kr as a,
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7600
|
+
Ze as a0,
|
|
7601
|
+
wo as a1,
|
|
7602
|
+
yo as a2,
|
|
7603
|
+
Xe as a3,
|
|
7604
|
+
So as a4,
|
|
7605
|
+
Er as a5,
|
|
7606
|
+
ms as a6,
|
|
7607
|
+
Yr as a7,
|
|
7608
|
+
ti as a8,
|
|
7609
|
+
en as a9,
|
|
7610
|
+
Io as aa,
|
|
7611
|
+
Fs as ab,
|
|
7612
|
+
Ao as ac,
|
|
7613
|
+
uo as ad,
|
|
7614
|
+
Pr as ae,
|
|
7615
|
+
ko as af,
|
|
7616
|
+
Vr as ag,
|
|
7617
|
+
To as ah,
|
|
7618
|
+
Wt as ai,
|
|
7619
|
+
Xr as aj,
|
|
7620
|
+
ns as ak,
|
|
7621
|
+
Qa as al,
|
|
7622
|
+
Xa as am,
|
|
7623
|
+
pa as an,
|
|
7624
|
+
Jt as b,
|
|
7625
|
+
Cr as c,
|
|
7625
7626
|
zr as d,
|
|
7626
7627
|
ze as e,
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7628
|
+
At as f,
|
|
7629
|
+
Me as g,
|
|
7630
|
+
no as h,
|
|
7630
7631
|
es as i,
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7632
|
+
Ts as j,
|
|
7633
|
+
lo as k,
|
|
7634
|
+
Sr as l,
|
|
7635
|
+
li as m,
|
|
7636
|
+
ha as n,
|
|
7637
|
+
xo as o,
|
|
7637
7638
|
ue as p,
|
|
7638
|
-
|
|
7639
|
+
rs as q,
|
|
7639
7640
|
ia as r,
|
|
7640
7641
|
Mt as s,
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7642
|
+
Ji as t,
|
|
7643
|
+
$s as u,
|
|
7644
|
+
Ls as v,
|
|
7644
7645
|
$e as w,
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7646
|
+
Nr as x,
|
|
7647
|
+
Ur as y,
|
|
7648
|
+
js as z
|
|
7648
7649
|
};
|
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";const p=require("./upload-BnRj1gU1.cjs");function h(e,t){const n=e.length===0?[]:e.split(`
|
|
2
|
-
`),i=t.length===0?[]:t.split(`
|
|
3
|
-
`);if(n.length+i.length>M)return[...n.map((s,f)=>({op:"remove",text:s,beforeLine:f+1})),...i.map((s,f)=>({op:"add",text:s,afterLine:f+1}))];const c=Array.from({length:n.length+1},()=>new Array(i.length+1).fill(0));for(let s=n.length-1;s>=0;s--)for(let f=i.length-1;f>=0;f--)c[s][f]=n[s]===i[f]?c[s+1][f+1]+1:Math.max(c[s+1][f],c[s][f+1]);const a=[];let o=0,r=0;for(;o<n.length&&r<i.length;)n[o]===i[r]?(a.push({op:"keep",text:n[o],beforeLine:o+1,afterLine:r+1}),o++,r++):c[o+1][r]>=c[o][r+1]?(a.push({op:"remove",text:n[o],beforeLine:o+1}),o++):(a.push({op:"add",text:i[r],afterLine:r+1}),r++);for(;o<n.length;)a.push({op:"remove",text:n[o],beforeLine:++o});for(;r<i.length;)a.push({op:"add",text:i[r],afterLine:++r});return a}const M=2e4;function u(e){let t=0,n=0;for(const i of e)i.op==="add"?t++:i.op==="remove"&&n++;return{added:t,removed:n}}function d(e,t=2){const n=e.map((o,r)=>o.op==="keep"?-1:r).filter(o=>o>=0);if(n.length===0)return[];const i=[];let c=Math.max(0,n[0]-t),a=Math.min(e.length-1,n[0]+t);for(const o of n.slice(1)){if(o-t<=a+1){a=Math.min(e.length-1,o+t);continue}i.push({lines:e.slice(c,a+1)}),c=Math.max(0,o-t),a=Math.min(e.length-1,o+t)}return i.push({lines:e.slice(c,a+1)}),i}function L(e,t=e.splitLevel){if(e.cleanChunks.length===0)return[];const n=p.mergeChunksAtLevel(e.cleanChunks,t),i=g(n),{pathByRef:c}=p.serializeProjectToFiles(e.project,{mainSourcePath:e.projectLayout.mainSourcePath,publicationPath:e.projectLayout.publicationPath,projectFilePath:e.projectLayout.projectFilePath,includeScaffold:!e.projectLayout.preserved}),a=[];for(const o of e.project.divisions){const r=c[o.xmlId];if(!r)continue;const s=o.isRoot?n.find(l=>l.kind==="preamble"||l.kind==="lead"):i.get(o.title);if(!s)continue;const f=h(s.before,s.after);a.push({path:r,title:o.title,before:s.before,after:s.after,stats:u(f),hunks:d(f),fixCount:s.fixes.length})}return a.sort((o,r)=>o.path.localeCompare(r.path))}function g(e){const t=new Map;for(const i of e)i.kind!=="division"||!i.title||t.set(i.title,t.has(i.title)?null:i);const n=new Map;for(const[i,c]of t)c&&n.set(i,c);return n}const m="converted";function v(e){return e.nativeOutputFiles!==void 0}function F(e,t=m){return t==="native"&&!v(e)?"converted":t}function I(e,t){return t==="native"?e.nativeProject??e.project:e.project}function j(e,t){return t==="converted"?e.outputFiles:e.nativeOutputFiles??e.files}function k(e,t){return t==="converted"?e.outputAssets:e.assets}function b(e){const t=e.action==="replace"||e.action==="rewrite"?`replaced with \`${e.replacement}\``:e.message??e.action,n=e.occurrences>1?` (x${e.occurrences})`:"";return`[${e.severity}] ${e.macro}: ${t}${n}`}exports.DEFAULT_IMPORT_MODE=m;exports.assetsForImportMode=k;exports.diffHunks=d;exports.diffLines=h;exports.diffStats=u;exports.fileChangesForImport=L;exports.filesForImportMode=j;exports.formatWarningLine=b;exports.hasNativeImportMode=v;exports.projectForImportMode=I;exports.resolveImportMode=F;
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { a1 as p, ak as h } from "./upload-H_OCZBBn.js";
|
|
2
|
-
function u(e, t) {
|
|
3
|
-
const o = e.length === 0 ? [] : e.split(`
|
|
4
|
-
`), i = t.length === 0 ? [] : t.split(`
|
|
5
|
-
`);
|
|
6
|
-
if (o.length + i.length > d)
|
|
7
|
-
return [
|
|
8
|
-
...o.map(
|
|
9
|
-
(s, l) => ({ op: "remove", text: s, beforeLine: l + 1 })
|
|
10
|
-
),
|
|
11
|
-
...i.map((s, l) => ({ op: "add", text: s, afterLine: l + 1 }))
|
|
12
|
-
];
|
|
13
|
-
const a = Array.from(
|
|
14
|
-
{ length: o.length + 1 },
|
|
15
|
-
() => new Array(i.length + 1).fill(0)
|
|
16
|
-
);
|
|
17
|
-
for (let s = o.length - 1; s >= 0; s--)
|
|
18
|
-
for (let l = i.length - 1; l >= 0; l--)
|
|
19
|
-
a[s][l] = o[s] === i[l] ? a[s + 1][l + 1] + 1 : Math.max(a[s + 1][l], a[s][l + 1]);
|
|
20
|
-
const c = [];
|
|
21
|
-
let n = 0, r = 0;
|
|
22
|
-
for (; n < o.length && r < i.length; )
|
|
23
|
-
o[n] === i[r] ? (c.push({
|
|
24
|
-
op: "keep",
|
|
25
|
-
text: o[n],
|
|
26
|
-
beforeLine: n + 1,
|
|
27
|
-
afterLine: r + 1
|
|
28
|
-
}), n++, r++) : a[n + 1][r] >= a[n][r + 1] ? (c.push({ op: "remove", text: o[n], beforeLine: n + 1 }), n++) : (c.push({ op: "add", text: i[r], afterLine: r + 1 }), r++);
|
|
29
|
-
for (; n < o.length; )
|
|
30
|
-
c.push({ op: "remove", text: o[n], beforeLine: ++n });
|
|
31
|
-
for (; r < i.length; ) c.push({ op: "add", text: i[r], afterLine: ++r });
|
|
32
|
-
return c;
|
|
33
|
-
}
|
|
34
|
-
const d = 2e4;
|
|
35
|
-
function m(e) {
|
|
36
|
-
let t = 0, o = 0;
|
|
37
|
-
for (const i of e)
|
|
38
|
-
i.op === "add" ? t++ : i.op === "remove" && o++;
|
|
39
|
-
return { added: t, removed: o };
|
|
40
|
-
}
|
|
41
|
-
function v(e, t = 2) {
|
|
42
|
-
const o = e.map((n, r) => n.op === "keep" ? -1 : r).filter((n) => n >= 0);
|
|
43
|
-
if (o.length === 0) return [];
|
|
44
|
-
const i = [];
|
|
45
|
-
let a = Math.max(0, o[0] - t), c = Math.min(e.length - 1, o[0] + t);
|
|
46
|
-
for (const n of o.slice(1)) {
|
|
47
|
-
if (n - t <= c + 1) {
|
|
48
|
-
c = Math.min(e.length - 1, n + t);
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
i.push({ lines: e.slice(a, c + 1) }), a = Math.max(0, n - t), c = Math.min(e.length - 1, n + t);
|
|
52
|
-
}
|
|
53
|
-
return i.push({ lines: e.slice(a, c + 1) }), i;
|
|
54
|
-
}
|
|
55
|
-
function k(e, t = e.splitLevel) {
|
|
56
|
-
if (e.cleanChunks.length === 0) return [];
|
|
57
|
-
const o = p(e.cleanChunks, t), i = g(o), { pathByRef: a } = h(e.project, {
|
|
58
|
-
mainSourcePath: e.projectLayout.mainSourcePath,
|
|
59
|
-
publicationPath: e.projectLayout.publicationPath,
|
|
60
|
-
projectFilePath: e.projectLayout.projectFilePath,
|
|
61
|
-
includeScaffold: !e.projectLayout.preserved
|
|
62
|
-
}), c = [];
|
|
63
|
-
for (const n of e.project.divisions) {
|
|
64
|
-
const r = a[n.xmlId];
|
|
65
|
-
if (!r) continue;
|
|
66
|
-
const s = n.isRoot ? o.find((f) => f.kind === "preamble" || f.kind === "lead") : i.get(n.title);
|
|
67
|
-
if (!s) continue;
|
|
68
|
-
const l = u(s.before, s.after);
|
|
69
|
-
c.push({
|
|
70
|
-
path: r,
|
|
71
|
-
title: n.title,
|
|
72
|
-
before: s.before,
|
|
73
|
-
after: s.after,
|
|
74
|
-
stats: m(l),
|
|
75
|
-
hunks: v(l),
|
|
76
|
-
fixCount: s.fixes.length
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
return c.sort((n, r) => n.path.localeCompare(r.path));
|
|
80
|
-
}
|
|
81
|
-
function g(e) {
|
|
82
|
-
const t = /* @__PURE__ */ new Map();
|
|
83
|
-
for (const i of e)
|
|
84
|
-
i.kind !== "division" || !i.title || t.set(i.title, t.has(i.title) ? null : i);
|
|
85
|
-
const o = /* @__PURE__ */ new Map();
|
|
86
|
-
for (const [i, a] of t)
|
|
87
|
-
a && o.set(i, a);
|
|
88
|
-
return o;
|
|
89
|
-
}
|
|
90
|
-
const L = "converted";
|
|
91
|
-
function M(e) {
|
|
92
|
-
return e.nativeOutputFiles !== void 0;
|
|
93
|
-
}
|
|
94
|
-
function F(e, t = L) {
|
|
95
|
-
return t === "native" && !M(e) ? "converted" : t;
|
|
96
|
-
}
|
|
97
|
-
function b(e, t) {
|
|
98
|
-
return t === "native" ? e.nativeProject ?? e.project : e.project;
|
|
99
|
-
}
|
|
100
|
-
function x(e, t) {
|
|
101
|
-
return t === "converted" ? e.outputFiles : e.nativeOutputFiles ?? e.files;
|
|
102
|
-
}
|
|
103
|
-
function I(e, t) {
|
|
104
|
-
return t === "converted" ? e.outputAssets : e.assets;
|
|
105
|
-
}
|
|
106
|
-
function y(e) {
|
|
107
|
-
const t = e.action === "replace" || e.action === "rewrite" ? `replaced with \`${e.replacement}\`` : e.message ?? e.action, o = e.occurrences > 1 ? ` (x${e.occurrences})` : "";
|
|
108
|
-
return `[${e.severity}] ${e.macro}: ${t}${o}`;
|
|
109
|
-
}
|
|
110
|
-
export {
|
|
111
|
-
L as D,
|
|
112
|
-
I as a,
|
|
113
|
-
u as b,
|
|
114
|
-
m as c,
|
|
115
|
-
v as d,
|
|
116
|
-
x as e,
|
|
117
|
-
k as f,
|
|
118
|
-
y as g,
|
|
119
|
-
M as h,
|
|
120
|
-
b as p,
|
|
121
|
-
F as r
|
|
122
|
-
};
|