@pretextbook/import 0.9.0 → 0.11.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/{import-mode-DuPFMu97.cjs → import-mode-CV7gCDzF.cjs} +1 -1
- package/dist/{import-mode-BaaBvzcy.js → import-mode-DQ8g5P8P.js} +1 -1
- package/dist/import.css +1 -1
- package/dist/index.cjs +5 -3
- package/dist/index.d.ts +10 -5
- package/dist/index.js +562 -219
- package/dist/lib/assets/images.d.ts +49 -0
- package/dist/lib/detect-snippet-format.d.ts +32 -0
- package/dist/lib/insert/dedupe-ids.d.ts +36 -0
- package/dist/lib/insert/destination.d.ts +21 -0
- package/dist/lib/insert/index.d.ts +4 -0
- package/dist/lib/insert/prepare.d.ts +44 -0
- package/dist/lib/insert/retarget.d.ts +35 -0
- package/dist/lib/layout/xml-scan.d.ts +28 -0
- package/dist/lib/pandoc/formats.d.ts +40 -0
- package/dist/lib/pandoc/index.d.ts +3 -0
- package/dist/lib/pandoc/pandoc-engine.d.ts +24 -0
- package/dist/lib/pandoc/remote-pandoc.d.ts +74 -0
- package/dist/lib/paste/place-markup.d.ts +41 -0
- package/dist/lib/pool/division-pool.d.ts +5 -0
- package/dist/lib/pool/index.d.ts +5 -1
- package/dist/lib/pool/place-divisions.d.ts +25 -0
- package/dist/lib/pool/placeholders.d.ts +4 -0
- package/dist/lib/pool/refs.d.ts +8 -0
- package/dist/lib/pool/serialize-destination.d.ts +24 -0
- package/dist/lib/pool/serialize-files.d.ts +1 -2
- package/dist/lib/pool/serialize-insert-records.d.ts +22 -0
- package/dist/lib/pool/serialize-insert.d.ts +44 -0
- package/dist/lib/pool/serialize-plus.d.ts +4 -4
- package/dist/lib/pool/serialize-records.d.ts +11 -0
- package/dist/lib/pretext-divisions.d.ts +25 -0
- package/dist/lib/select/divisions.d.ts +44 -0
- package/dist/lib/types.d.ts +82 -2
- package/dist/lib/upload.d.ts +56 -4
- package/dist/react/import-wizard.d.ts +30 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react.cjs +2 -2
- package/dist/react.js +658 -511
- package/dist/upload-BnRj1gU1.cjs +135 -0
- package/dist/upload-H_OCZBBn.js +7648 -0
- package/package.json +5 -5
- package/dist/upload-BmErkg8I.js +0 -7140
- package/dist/upload-BtS22hIH.cjs +0 -135
package/dist/react.js
CHANGED
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { D as
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
function
|
|
7
|
-
if (
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
var
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
for (var
|
|
15
|
-
|
|
16
|
-
} else
|
|
17
|
-
return
|
|
18
|
-
$$typeof:
|
|
19
|
-
type:
|
|
20
|
-
key:
|
|
21
|
-
ref:
|
|
22
|
-
props:
|
|
1
|
+
import Be, { useState as g, useRef as pe, useEffect as We, useMemo as K } from "react";
|
|
2
|
+
import { Y as Fe, a8 as Ke, a3 as Ve, D as qe, m as Ge, j as Je, g as He, h as De, K as Ze, G as Qe } from "./upload-H_OCZBBn.js";
|
|
3
|
+
import { D as et, f as tt, h as Se, r as st, e as Pe } from "./import-mode-DQ8g5P8P.js";
|
|
4
|
+
var xe = { exports: {} }, ae = {};
|
|
5
|
+
var Ce;
|
|
6
|
+
function rt() {
|
|
7
|
+
if (Ce) return ae;
|
|
8
|
+
Ce = 1;
|
|
9
|
+
var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), o = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
10
|
+
function d(u, x, c) {
|
|
11
|
+
var N = null;
|
|
12
|
+
if (c !== void 0 && (N = "" + c), x.key !== void 0 && (N = "" + x.key), "key" in x) {
|
|
13
|
+
c = {};
|
|
14
|
+
for (var C in x)
|
|
15
|
+
C !== "key" && (c[C] = x[C]);
|
|
16
|
+
} else c = x;
|
|
17
|
+
return x = c.ref, {
|
|
18
|
+
$$typeof: r,
|
|
19
|
+
type: u,
|
|
20
|
+
key: N,
|
|
21
|
+
ref: x !== void 0 ? x : null,
|
|
22
|
+
props: c
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
return
|
|
25
|
+
return ae.Fragment = o, ae.jsx = d, ae.jsxs = d, ae;
|
|
26
26
|
}
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
function
|
|
30
|
-
return
|
|
31
|
-
function
|
|
27
|
+
var le = {};
|
|
28
|
+
var Re;
|
|
29
|
+
function nt() {
|
|
30
|
+
return Re || (Re = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
31
|
+
function r(t) {
|
|
32
32
|
if (t == null) return null;
|
|
33
33
|
if (typeof t == "function")
|
|
34
|
-
return t.$$typeof ===
|
|
34
|
+
return t.$$typeof === fe ? null : t.displayName || t.name || null;
|
|
35
35
|
if (typeof t == "string") return t;
|
|
36
36
|
switch (t) {
|
|
37
|
-
case
|
|
37
|
+
case Y:
|
|
38
38
|
return "Fragment";
|
|
39
|
-
case
|
|
39
|
+
case z:
|
|
40
40
|
return "Profiler";
|
|
41
|
-
case
|
|
41
|
+
case R:
|
|
42
42
|
return "StrictMode";
|
|
43
|
-
case
|
|
43
|
+
case ee:
|
|
44
44
|
return "Suspense";
|
|
45
|
-
case
|
|
45
|
+
case oe:
|
|
46
46
|
return "SuspenseList";
|
|
47
|
-
case
|
|
47
|
+
case he:
|
|
48
48
|
return "Activity";
|
|
49
49
|
}
|
|
50
50
|
if (typeof t == "object")
|
|
51
51
|
switch (typeof t.tag == "number" && console.error(
|
|
52
52
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
53
53
|
), t.$$typeof) {
|
|
54
|
-
case
|
|
54
|
+
case D:
|
|
55
55
|
return "Portal";
|
|
56
56
|
case _:
|
|
57
57
|
return t.displayName || "Context";
|
|
58
|
-
case
|
|
58
|
+
case j:
|
|
59
59
|
return (t._context.displayName || "Context") + ".Consumer";
|
|
60
|
-
case
|
|
61
|
-
var
|
|
62
|
-
return t = t.displayName, t || (t =
|
|
63
|
-
case
|
|
64
|
-
return
|
|
65
|
-
case
|
|
66
|
-
|
|
60
|
+
case A:
|
|
61
|
+
var l = t.render;
|
|
62
|
+
return t = t.displayName, t || (t = l.displayName || l.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
63
|
+
case ce:
|
|
64
|
+
return l = t.displayName || null, l !== null ? l : r(t.type) || "Memo";
|
|
65
|
+
case V:
|
|
66
|
+
l = t._payload, t = t._init;
|
|
67
67
|
try {
|
|
68
|
-
return
|
|
68
|
+
return r(t(l));
|
|
69
69
|
} catch {
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function o(t) {
|
|
75
75
|
return "" + t;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function d(t) {
|
|
78
78
|
try {
|
|
79
|
-
|
|
80
|
-
var
|
|
79
|
+
o(t);
|
|
80
|
+
var l = !1;
|
|
81
81
|
} catch {
|
|
82
|
-
|
|
82
|
+
l = !0;
|
|
83
83
|
}
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
var
|
|
87
|
-
return
|
|
88
|
-
|
|
84
|
+
if (l) {
|
|
85
|
+
l = console;
|
|
86
|
+
var h = l.error, f = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
87
|
+
return h.call(
|
|
88
|
+
l,
|
|
89
89
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
90
90
|
f
|
|
91
|
-
),
|
|
91
|
+
), o(t);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
if (t ===
|
|
96
|
-
if (typeof t == "object" && t !== null && t.$$typeof ===
|
|
94
|
+
function u(t) {
|
|
95
|
+
if (t === Y) return "<>";
|
|
96
|
+
if (typeof t == "object" && t !== null && t.$$typeof === V)
|
|
97
97
|
return "<...>";
|
|
98
98
|
try {
|
|
99
|
-
var
|
|
100
|
-
return
|
|
99
|
+
var l = r(t);
|
|
100
|
+
return l ? "<" + l + ">" : "<...>";
|
|
101
101
|
} catch {
|
|
102
102
|
return "<...>";
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
var t =
|
|
105
|
+
function x() {
|
|
106
|
+
var t = q.A;
|
|
107
107
|
return t === null ? null : t.getOwner();
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function c() {
|
|
110
110
|
return Error("react-stack-top-frame");
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
if (
|
|
114
|
-
var
|
|
115
|
-
if (
|
|
112
|
+
function N(t) {
|
|
113
|
+
if (B.call(t, "key")) {
|
|
114
|
+
var l = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
115
|
+
if (l && l.isReactWarning) return !1;
|
|
116
116
|
}
|
|
117
117
|
return t.key !== void 0;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
function
|
|
121
|
-
|
|
119
|
+
function C(t, l) {
|
|
120
|
+
function h() {
|
|
121
|
+
G || (G = !0, console.error(
|
|
122
122
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
123
|
-
|
|
123
|
+
l
|
|
124
124
|
));
|
|
125
125
|
}
|
|
126
|
-
|
|
127
|
-
get:
|
|
126
|
+
h.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
127
|
+
get: h,
|
|
128
128
|
configurable: !0
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
var t =
|
|
133
|
-
return
|
|
131
|
+
function p() {
|
|
132
|
+
var t = r(this.type);
|
|
133
|
+
return J[t] || (J[t] = !0, console.error(
|
|
134
134
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
135
135
|
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
var
|
|
137
|
+
function S(t, l, h, f, X, H) {
|
|
138
|
+
var b = h.ref;
|
|
139
139
|
return t = {
|
|
140
|
-
$$typeof:
|
|
140
|
+
$$typeof: P,
|
|
141
141
|
type: t,
|
|
142
|
-
key:
|
|
143
|
-
props:
|
|
142
|
+
key: l,
|
|
143
|
+
props: h,
|
|
144
144
|
_owner: f
|
|
145
|
-
}, (
|
|
145
|
+
}, (b !== void 0 ? b : null) !== null ? Object.defineProperty(t, "ref", {
|
|
146
146
|
enumerable: !1,
|
|
147
|
-
get:
|
|
147
|
+
get: p
|
|
148
148
|
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
149
149
|
configurable: !1,
|
|
150
150
|
enumerable: !1,
|
|
@@ -159,33 +159,33 @@ function Ye() {
|
|
|
159
159
|
configurable: !1,
|
|
160
160
|
enumerable: !1,
|
|
161
161
|
writable: !0,
|
|
162
|
-
value:
|
|
162
|
+
value: X
|
|
163
163
|
}), Object.defineProperty(t, "_debugTask", {
|
|
164
164
|
configurable: !1,
|
|
165
165
|
enumerable: !1,
|
|
166
166
|
writable: !0,
|
|
167
|
-
value:
|
|
167
|
+
value: H
|
|
168
168
|
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
var
|
|
172
|
-
if (
|
|
170
|
+
function T(t, l, h, f, X, H) {
|
|
171
|
+
var b = l.children;
|
|
172
|
+
if (b !== void 0)
|
|
173
173
|
if (f)
|
|
174
|
-
if (
|
|
175
|
-
for (f = 0; f <
|
|
176
|
-
b
|
|
177
|
-
Object.freeze && Object.freeze(
|
|
174
|
+
if (ie(b)) {
|
|
175
|
+
for (f = 0; f < b.length; f++)
|
|
176
|
+
y(b[f]);
|
|
177
|
+
Object.freeze && Object.freeze(b);
|
|
178
178
|
} else
|
|
179
179
|
console.error(
|
|
180
180
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
181
181
|
);
|
|
182
|
-
else b
|
|
183
|
-
if (
|
|
184
|
-
|
|
185
|
-
var
|
|
186
|
-
return
|
|
182
|
+
else y(b);
|
|
183
|
+
if (B.call(l, "key")) {
|
|
184
|
+
b = r(t);
|
|
185
|
+
var E = Object.keys(l).filter(function(O) {
|
|
186
|
+
return O !== "key";
|
|
187
187
|
});
|
|
188
|
-
f = 0 <
|
|
188
|
+
f = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", re[b + f] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
189
189
|
`A props object containing a "key" prop is being spread into JSX:
|
|
190
190
|
let props = %s;
|
|
191
191
|
<%s {...props} />
|
|
@@ -193,91 +193,91 @@ React keys must be passed directly to JSX without using spread:
|
|
|
193
193
|
let props = %s;
|
|
194
194
|
<%s key={someKey} {...props} />`,
|
|
195
195
|
f,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
),
|
|
196
|
+
b,
|
|
197
|
+
E,
|
|
198
|
+
b
|
|
199
|
+
), re[b + f] = !0);
|
|
200
200
|
}
|
|
201
|
-
if (
|
|
202
|
-
|
|
203
|
-
for (var
|
|
204
|
-
|
|
205
|
-
} else
|
|
206
|
-
return
|
|
207
|
-
|
|
201
|
+
if (b = null, h !== void 0 && (d(h), b = "" + h), N(l) && (d(l.key), b = "" + l.key), "key" in l) {
|
|
202
|
+
h = {};
|
|
203
|
+
for (var Z in l)
|
|
204
|
+
Z !== "key" && (h[Z] = l[Z]);
|
|
205
|
+
} else h = l;
|
|
206
|
+
return b && C(
|
|
207
|
+
h,
|
|
208
208
|
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
209
|
-
),
|
|
209
|
+
), S(
|
|
210
210
|
t,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
211
|
+
b,
|
|
212
|
+
h,
|
|
213
|
+
x(),
|
|
214
|
+
X,
|
|
215
|
+
H
|
|
216
216
|
);
|
|
217
217
|
}
|
|
218
|
-
function
|
|
219
|
-
|
|
218
|
+
function y(t) {
|
|
219
|
+
v(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === V && (t._payload.status === "fulfilled" ? v(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
return typeof t == "object" && t !== null && t.$$typeof ===
|
|
221
|
+
function v(t) {
|
|
222
|
+
return typeof t == "object" && t !== null && t.$$typeof === P;
|
|
223
223
|
}
|
|
224
|
-
var
|
|
224
|
+
var F = Be, P = /* @__PURE__ */ Symbol.for("react.transitional.element"), D = /* @__PURE__ */ Symbol.for("react.portal"), Y = /* @__PURE__ */ Symbol.for("react.fragment"), R = /* @__PURE__ */ Symbol.for("react.strict_mode"), z = /* @__PURE__ */ Symbol.for("react.profiler"), j = /* @__PURE__ */ Symbol.for("react.consumer"), _ = /* @__PURE__ */ Symbol.for("react.context"), A = /* @__PURE__ */ Symbol.for("react.forward_ref"), ee = /* @__PURE__ */ Symbol.for("react.suspense"), oe = /* @__PURE__ */ Symbol.for("react.suspense_list"), ce = /* @__PURE__ */ Symbol.for("react.memo"), V = /* @__PURE__ */ Symbol.for("react.lazy"), he = /* @__PURE__ */ Symbol.for("react.activity"), fe = /* @__PURE__ */ Symbol.for("react.client.reference"), q = F.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, ie = Array.isArray, te = console.createTask ? console.createTask : function() {
|
|
225
225
|
return null;
|
|
226
226
|
};
|
|
227
|
-
|
|
227
|
+
F = {
|
|
228
228
|
react_stack_bottom_frame: function(t) {
|
|
229
229
|
return t();
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
|
-
var
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
)(),
|
|
236
|
-
|
|
237
|
-
var f = 1e4 >
|
|
238
|
-
return
|
|
232
|
+
var G, J = {}, se = F.react_stack_bottom_frame.bind(
|
|
233
|
+
F,
|
|
234
|
+
c
|
|
235
|
+
)(), M = te(u(c)), re = {};
|
|
236
|
+
le.Fragment = Y, le.jsx = function(t, l, h) {
|
|
237
|
+
var f = 1e4 > q.recentlyCreatedOwnerStacks++;
|
|
238
|
+
return T(
|
|
239
239
|
t,
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
l,
|
|
241
|
+
h,
|
|
242
242
|
!1,
|
|
243
|
-
f ? Error("react-stack-top-frame") :
|
|
244
|
-
f ?
|
|
243
|
+
f ? Error("react-stack-top-frame") : se,
|
|
244
|
+
f ? te(u(t)) : M
|
|
245
245
|
);
|
|
246
|
-
},
|
|
247
|
-
var f = 1e4 >
|
|
248
|
-
return
|
|
246
|
+
}, le.jsxs = function(t, l, h) {
|
|
247
|
+
var f = 1e4 > q.recentlyCreatedOwnerStacks++;
|
|
248
|
+
return T(
|
|
249
249
|
t,
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
l,
|
|
251
|
+
h,
|
|
252
252
|
!0,
|
|
253
|
-
f ? Error("react-stack-top-frame") :
|
|
254
|
-
f ?
|
|
253
|
+
f ? Error("react-stack-top-frame") : se,
|
|
254
|
+
f ? te(u(t)) : M
|
|
255
255
|
);
|
|
256
256
|
};
|
|
257
|
-
})()),
|
|
257
|
+
})()), le;
|
|
258
258
|
}
|
|
259
|
-
var
|
|
260
|
-
function
|
|
261
|
-
return
|
|
259
|
+
var _e;
|
|
260
|
+
function at() {
|
|
261
|
+
return _e || (_e = 1, process.env.NODE_ENV === "production" ? xe.exports = rt() : xe.exports = nt()), xe.exports;
|
|
262
262
|
}
|
|
263
|
-
var e =
|
|
264
|
-
function
|
|
265
|
-
const [
|
|
266
|
-
return
|
|
267
|
-
const
|
|
268
|
-
|
|
263
|
+
var e = at();
|
|
264
|
+
function lt() {
|
|
265
|
+
const [r, o] = g(0), d = pe(Date.now());
|
|
266
|
+
return We(() => {
|
|
267
|
+
const u = setInterval(() => {
|
|
268
|
+
o(Math.floor((Date.now() - d.current) / 1e3));
|
|
269
269
|
}, 1e3);
|
|
270
|
-
return () => clearInterval(
|
|
271
|
-
}, []),
|
|
270
|
+
return () => clearInterval(u);
|
|
271
|
+
}, []), r;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
return `${Math.floor(
|
|
273
|
+
function ot(r) {
|
|
274
|
+
return `${Math.floor(r / 60)}:${String(r % 60).padStart(2, "0")}`;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
message:
|
|
278
|
-
onCancel:
|
|
276
|
+
function ct({
|
|
277
|
+
message: r = "Processing your file…",
|
|
278
|
+
onCancel: o
|
|
279
279
|
}) {
|
|
280
|
-
const
|
|
280
|
+
const d = lt();
|
|
281
281
|
return /* @__PURE__ */ e.jsxs(
|
|
282
282
|
"div",
|
|
283
283
|
{
|
|
@@ -286,14 +286,14 @@ function qe({
|
|
|
286
286
|
"aria-live": "polite",
|
|
287
287
|
children: [
|
|
288
288
|
/* @__PURE__ */ e.jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-blue-700 border-t-transparent" }),
|
|
289
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm", children:
|
|
290
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-xs tabular-nums text-slate-500", children:
|
|
291
|
-
|
|
292
|
-
|
|
289
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm", children: r }),
|
|
290
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-xs tabular-nums text-slate-500", children: ot(d) }),
|
|
291
|
+
d >= 10 ? /* @__PURE__ */ e.jsx("p", { className: "max-w-xs text-center text-xs text-slate-500", children: "Large documents can take a while. You can keep working in other tabs." }) : null,
|
|
292
|
+
o ? /* @__PURE__ */ e.jsx(
|
|
293
293
|
"button",
|
|
294
294
|
{
|
|
295
295
|
type: "button",
|
|
296
|
-
onClick:
|
|
296
|
+
onClick: o,
|
|
297
297
|
className: "mt-2 rounded border border-slate-300 px-3 py-1.5 text-xs font-medium text-slate-700 hover:bg-slate-50",
|
|
298
298
|
children: "Cancel"
|
|
299
299
|
}
|
|
@@ -302,7 +302,7 @@ function qe({
|
|
|
302
302
|
}
|
|
303
303
|
);
|
|
304
304
|
}
|
|
305
|
-
const
|
|
305
|
+
const Oe = [
|
|
306
306
|
".tex",
|
|
307
307
|
".md",
|
|
308
308
|
".markdown",
|
|
@@ -312,188 +312,208 @@ const Te = [
|
|
|
312
312
|
".gz",
|
|
313
313
|
".tar.gz",
|
|
314
314
|
".tgz"
|
|
315
|
-
],
|
|
315
|
+
], it = {
|
|
316
316
|
id: "builtin",
|
|
317
317
|
label: "Built-in converter",
|
|
318
318
|
description: "Create a new project starting with LaTeX, Markdown, or PreTeXt files.",
|
|
319
|
-
acceptExtensions:
|
|
320
|
-
convertFile:
|
|
321
|
-
prepare: async (
|
|
322
|
-
const { files:
|
|
319
|
+
acceptExtensions: Oe,
|
|
320
|
+
convertFile: Fe,
|
|
321
|
+
prepare: async (r) => {
|
|
322
|
+
const { files: o, assets: d } = await He(r);
|
|
323
323
|
return {
|
|
324
|
-
fileName:
|
|
325
|
-
files:
|
|
326
|
-
assets:
|
|
327
|
-
analysis:
|
|
324
|
+
fileName: r.name,
|
|
325
|
+
files: o,
|
|
326
|
+
assets: d,
|
|
327
|
+
analysis: De(o)
|
|
328
328
|
};
|
|
329
329
|
},
|
|
330
|
-
convertPrepared: (
|
|
331
|
-
...
|
|
332
|
-
assets:
|
|
330
|
+
convertPrepared: (r, o) => Je(r.files, {
|
|
331
|
+
...o,
|
|
332
|
+
assets: r.assets
|
|
333
333
|
})
|
|
334
334
|
};
|
|
335
|
-
function
|
|
336
|
-
return new Promise((
|
|
335
|
+
function Ne() {
|
|
336
|
+
return new Promise((r) => {
|
|
337
337
|
if (typeof requestAnimationFrame != "function") {
|
|
338
|
-
setTimeout(
|
|
338
|
+
setTimeout(r, 0);
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
|
-
requestAnimationFrame(() => setTimeout(
|
|
341
|
+
requestAnimationFrame(() => setTimeout(r, 0));
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
|
-
const
|
|
344
|
+
const Ae = {
|
|
345
345
|
pretext: "PreTeXt",
|
|
346
346
|
latex: "LaTeX",
|
|
347
347
|
markdown: "Markdown"
|
|
348
348
|
};
|
|
349
|
-
function
|
|
350
|
-
const
|
|
351
|
-
return
|
|
349
|
+
function dt(r) {
|
|
350
|
+
const o = r.reason === "manifest-target" ? `project.ptx target “${r.targetName}”` : r.reason === "latex-root" ? "LaTeX document" : r.reason === "pretext-root" ? "PreTeXt document" : r.reason === "markdown-root" ? "Markdown document" : "possible document";
|
|
351
|
+
return r.title ? `${r.title} — ${o}` : o;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
return
|
|
355
|
-
(
|
|
356
|
-
).length > 1 ? !0 :
|
|
353
|
+
function ut(r) {
|
|
354
|
+
return r.candidates.filter(
|
|
355
|
+
(d) => d.reason === "manifest-target"
|
|
356
|
+
).length > 1 ? !0 : r.manifest && r.primary?.reason === "manifest-target" ? !1 : r.formats.length > 1 || r.candidates.length > 1 || r.extraRoots.length > 0;
|
|
357
357
|
}
|
|
358
|
-
function
|
|
359
|
-
onConfirm:
|
|
360
|
-
onCancel:
|
|
361
|
-
importOptions:
|
|
362
|
-
defaultDocumentKind:
|
|
363
|
-
defaultImportMode:
|
|
364
|
-
lockImportMode:
|
|
365
|
-
onImportModeChange:
|
|
366
|
-
engines:
|
|
358
|
+
function jt({
|
|
359
|
+
onConfirm: r,
|
|
360
|
+
onCancel: o,
|
|
361
|
+
importOptions: d,
|
|
362
|
+
defaultDocumentKind: u = "auto",
|
|
363
|
+
defaultImportMode: x = et,
|
|
364
|
+
lockImportMode: c = !1,
|
|
365
|
+
onImportModeChange: N,
|
|
366
|
+
engines: C,
|
|
367
|
+
insertTarget: p
|
|
367
368
|
}) {
|
|
368
|
-
const
|
|
369
|
+
const S = C && C.length > 0 ? C : [it], T = pe(null), [y, v] = g({ name: "upload" }), [F, P] = g(!1), [D, Y] = g(u), [R, z] = g(null), [j, _] = g(null), [A, ee] = g([]), [oe, ce] = g(/* @__PURE__ */ new Set()), [V, he] = g(S[0].id), [fe, q] = g(x), [B, ie] = g(!1), [te, G] = g(/* @__PURE__ */ new Set()), [J, se] = g(null), [M, re] = g(
|
|
369
370
|
"auto"
|
|
370
|
-
), [
|
|
371
|
-
() => O &&
|
|
372
|
-
|
|
373
|
-
|
|
371
|
+
), [t, l] = g(null), [h, f] = g({}), [X, H] = g(!1), b = pe(!1), E = S.find((n) => n.id === V) ?? S[0], Z = E.acceptExtensions ?? Oe, O = y.name === "review" ? y.result : null, de = K(
|
|
372
|
+
() => O && (R !== null || j !== null || A.length > 0) ? Ke(O, {
|
|
373
|
+
splitLevel: R ?? void 0,
|
|
374
|
+
targetTag: j ?? void 0,
|
|
375
|
+
selection: A
|
|
376
|
+
}) : O,
|
|
377
|
+
[O, R, j, A]
|
|
378
|
+
), be = K(
|
|
379
|
+
() => O ? Ve(O.pretextSource) : [],
|
|
380
|
+
[O]
|
|
381
|
+
), U = K(
|
|
374
382
|
() => new Map(
|
|
375
|
-
|
|
383
|
+
de ? tt(de).map((n) => [n.path, n]) : []
|
|
376
384
|
),
|
|
377
|
-
[
|
|
378
|
-
),
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
385
|
+
[de]
|
|
386
|
+
), ye = K(
|
|
387
|
+
() => p ? {
|
|
388
|
+
kind: "insert",
|
|
389
|
+
targetTag: j ?? p.defaultTargetTag,
|
|
390
|
+
takenIds: new Set(p.takenIds),
|
|
391
|
+
hrefBase: p.hrefBase
|
|
392
|
+
} : void 0,
|
|
393
|
+
[p, j]
|
|
394
|
+
), ge = () => ({
|
|
395
|
+
...d ?? {
|
|
396
|
+
documentKind: D === "auto" ? void 0 : D
|
|
397
|
+
},
|
|
398
|
+
...ye ? { destination: ye } : {},
|
|
399
|
+
...p?.externalDir ? { externalDir: p.externalDir } : {}
|
|
400
|
+
}), we = (n) => De(n.files, {
|
|
401
|
+
sourceFormat: M === "auto" ? void 0 : M,
|
|
402
|
+
mainFile: t ?? void 0
|
|
403
|
+
}), $e = (n) => {
|
|
404
|
+
b.current = !0, E.cancel?.(), v(
|
|
405
|
+
n ? { name: "sources", prepared: n } : { name: "upload" }
|
|
386
406
|
);
|
|
387
|
-
},
|
|
388
|
-
|
|
407
|
+
}, Me = async (n) => {
|
|
408
|
+
b.current = !1, v({ name: "processing" }), await Ne();
|
|
389
409
|
try {
|
|
390
|
-
const
|
|
391
|
-
path:
|
|
392
|
-
include:
|
|
393
|
-
level:
|
|
394
|
-
})),
|
|
395
|
-
...
|
|
396
|
-
sourceFormat:
|
|
397
|
-
mainFile:
|
|
398
|
-
attachRoots:
|
|
410
|
+
const a = we(n).extraRoots.map((m) => ({
|
|
411
|
+
path: m.path,
|
|
412
|
+
include: h[m.path]?.include ?? !0,
|
|
413
|
+
level: h[m.path]?.level
|
|
414
|
+
})), k = await E.convertPrepared(n, {
|
|
415
|
+
...ge(),
|
|
416
|
+
sourceFormat: M === "auto" ? void 0 : M,
|
|
417
|
+
mainFile: t ?? void 0,
|
|
418
|
+
attachRoots: a
|
|
399
419
|
});
|
|
400
|
-
"pretextError" in
|
|
401
|
-
} catch (
|
|
402
|
-
if (
|
|
420
|
+
"pretextError" in k ? v({ name: "error", message: k.pretextError }) : v({ name: "review", result: k });
|
|
421
|
+
} catch (i) {
|
|
422
|
+
if (b.current)
|
|
403
423
|
return;
|
|
404
|
-
|
|
424
|
+
v({
|
|
405
425
|
name: "error",
|
|
406
|
-
message:
|
|
426
|
+
message: i instanceof Error ? i.message : "An unexpected error occurred."
|
|
407
427
|
});
|
|
408
428
|
}
|
|
409
|
-
},
|
|
410
|
-
|
|
429
|
+
}, ke = async (n) => {
|
|
430
|
+
b.current = !1, v({ name: "processing" }), await Ne();
|
|
411
431
|
try {
|
|
412
|
-
if (
|
|
413
|
-
const
|
|
414
|
-
if (
|
|
415
|
-
|
|
432
|
+
if (E.prepare && E.convertPrepared) {
|
|
433
|
+
const a = await E.prepare(n);
|
|
434
|
+
if (se(a), re("auto"), l(null), f({}), ut(a.analysis)) {
|
|
435
|
+
v({ name: "sources", prepared: a });
|
|
416
436
|
return;
|
|
417
437
|
}
|
|
418
|
-
await
|
|
419
|
-
const
|
|
420
|
-
|
|
421
|
-
|
|
438
|
+
await Ne();
|
|
439
|
+
const k = await E.convertPrepared(
|
|
440
|
+
a,
|
|
441
|
+
ge()
|
|
422
442
|
);
|
|
423
|
-
|
|
424
|
-
"pretextError" in
|
|
443
|
+
v(
|
|
444
|
+
"pretextError" in k ? { name: "error", message: k.pretextError } : { name: "review", result: k }
|
|
425
445
|
);
|
|
426
446
|
return;
|
|
427
447
|
}
|
|
428
|
-
const
|
|
429
|
-
"pretextError" in
|
|
430
|
-
} catch (
|
|
431
|
-
if (
|
|
448
|
+
const i = await E.convertFile(n, ge());
|
|
449
|
+
"pretextError" in i ? v({ name: "error", message: i.pretextError }) : v({ name: "review", result: i });
|
|
450
|
+
} catch (i) {
|
|
451
|
+
if (b.current)
|
|
432
452
|
return;
|
|
433
|
-
|
|
453
|
+
v({
|
|
434
454
|
name: "error",
|
|
435
|
-
message:
|
|
455
|
+
message: i instanceof Error ? i.message : "An unexpected error occurred."
|
|
436
456
|
});
|
|
437
457
|
}
|
|
438
|
-
},
|
|
439
|
-
|
|
458
|
+
}, je = () => {
|
|
459
|
+
v({ name: "upload" }), q(x), ie(!1), G(/* @__PURE__ */ new Set()), ce(/* @__PURE__ */ new Set()), z(null), _(null), ee([]), se(null);
|
|
440
460
|
};
|
|
441
|
-
function
|
|
442
|
-
return [...
|
|
461
|
+
function Ee(n, i) {
|
|
462
|
+
return [...n].sort((a, k) => a === i ? -1 : k === i ? 1 : a.localeCompare(k));
|
|
443
463
|
}
|
|
444
|
-
function
|
|
445
|
-
const
|
|
446
|
-
|
|
464
|
+
function Te(n, i) {
|
|
465
|
+
const a = Pe(n, i), k = i === "converted" ? n.projectLayout.mainSourcePath : n.sourcePath, m = Ee(Object.keys(a), k)[0];
|
|
466
|
+
G(m ? /* @__PURE__ */ new Set([m]) : /* @__PURE__ */ new Set());
|
|
447
467
|
}
|
|
448
|
-
function
|
|
449
|
-
|
|
450
|
-
const
|
|
451
|
-
return
|
|
468
|
+
function Xe(n) {
|
|
469
|
+
G((i) => {
|
|
470
|
+
const a = new Set(i);
|
|
471
|
+
return a.has(n) ? a.delete(n) : a.add(n), a;
|
|
452
472
|
});
|
|
453
473
|
}
|
|
454
|
-
if (
|
|
474
|
+
if (y.name === "processing")
|
|
455
475
|
return /* @__PURE__ */ e.jsx(
|
|
456
|
-
|
|
476
|
+
ct,
|
|
457
477
|
{
|
|
458
|
-
onCancel:
|
|
478
|
+
onCancel: E.cancel ? () => $e(J) : void 0
|
|
459
479
|
}
|
|
460
480
|
);
|
|
461
|
-
if (
|
|
481
|
+
if (y.name === "error")
|
|
462
482
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
463
483
|
/* @__PURE__ */ e.jsxs("div", { className: "rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-800", children: [
|
|
464
484
|
/* @__PURE__ */ e.jsx("p", { className: "font-semibold", children: "Import failed" }),
|
|
465
|
-
/* @__PURE__ */ e.jsx("p", { className: "mt-1", children:
|
|
485
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1", children: y.message })
|
|
466
486
|
] }),
|
|
467
487
|
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(
|
|
468
488
|
"button",
|
|
469
489
|
{
|
|
470
490
|
type: "button",
|
|
471
|
-
onClick:
|
|
491
|
+
onClick: je,
|
|
472
492
|
className: "rounded bg-blue-700 px-4 py-2 text-sm font-medium text-white hover:bg-blue-600",
|
|
473
493
|
children: "Try Another File"
|
|
474
494
|
}
|
|
475
495
|
) })
|
|
476
496
|
] });
|
|
477
|
-
if (
|
|
478
|
-
const
|
|
497
|
+
if (y.name === "sources") {
|
|
498
|
+
const n = y.prepared, i = we(n), a = i.manifest, k = i.primary?.path ?? "";
|
|
479
499
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
480
500
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
481
501
|
/* @__PURE__ */ e.jsx("h3", { className: "text-sm font-semibold text-slate-700", children: "Choose what to import" }),
|
|
482
502
|
/* @__PURE__ */ e.jsxs("p", { className: "mt-1 text-sm text-slate-500", children: [
|
|
483
|
-
|
|
503
|
+
n.fileName,
|
|
484
504
|
" contains more than one possible starting point."
|
|
485
505
|
] })
|
|
486
506
|
] }),
|
|
487
|
-
|
|
507
|
+
a ? /* @__PURE__ */ e.jsxs("div", { className: "rounded-lg border border-blue-200 bg-blue-50 p-4 text-sm text-blue-900", children: [
|
|
488
508
|
/* @__PURE__ */ e.jsxs("p", { className: "font-medium", children: [
|
|
489
509
|
"Found ",
|
|
490
|
-
|
|
510
|
+
a.manifestPath,
|
|
491
511
|
" — an existing PreTeXt project."
|
|
492
512
|
] }),
|
|
493
513
|
/* @__PURE__ */ e.jsxs("p", { className: "mt-1 text-blue-800", children: [
|
|
494
514
|
"Its publication file, assets, and directory layout will be kept as they are. Targets:",
|
|
495
515
|
" ",
|
|
496
|
-
|
|
516
|
+
a.targets.map((m) => m.name).join(", "),
|
|
497
517
|
"."
|
|
498
518
|
] })
|
|
499
519
|
] }) : null,
|
|
@@ -502,24 +522,24 @@ function st({
|
|
|
502
522
|
/* @__PURE__ */ e.jsxs(
|
|
503
523
|
"select",
|
|
504
524
|
{
|
|
505
|
-
value:
|
|
506
|
-
onChange: (
|
|
507
|
-
|
|
525
|
+
value: M,
|
|
526
|
+
onChange: (m) => {
|
|
527
|
+
re(m.currentTarget.value), l(null), f({});
|
|
508
528
|
},
|
|
509
529
|
className: "rounded border border-slate-300 px-2 py-1 text-sm",
|
|
510
530
|
children: [
|
|
511
531
|
/* @__PURE__ */ e.jsxs("option", { value: "auto", children: [
|
|
512
532
|
"Auto detect",
|
|
513
|
-
|
|
533
|
+
i.primary ? ` (${Ae[i.primary.format]})` : ""
|
|
514
534
|
] }),
|
|
515
|
-
|
|
535
|
+
i.formats.map((m) => /* @__PURE__ */ e.jsx("option", { value: m, children: Ae[m] }, m))
|
|
516
536
|
]
|
|
517
537
|
}
|
|
518
538
|
)
|
|
519
539
|
] }) }),
|
|
520
|
-
|
|
540
|
+
i.candidates.length > 1 ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
|
|
521
541
|
/* @__PURE__ */ e.jsx("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: "Main document" }),
|
|
522
|
-
/* @__PURE__ */ e.jsx("div", { className: "mt-2 flex flex-col gap-2", children:
|
|
542
|
+
/* @__PURE__ */ e.jsx("div", { className: "mt-2 flex flex-col gap-2", children: i.candidates.map((m) => /* @__PURE__ */ e.jsxs(
|
|
523
543
|
"label",
|
|
524
544
|
{
|
|
525
545
|
className: "flex cursor-pointer items-start gap-3 text-sm",
|
|
@@ -529,28 +549,28 @@ function st({
|
|
|
529
549
|
{
|
|
530
550
|
type: "radio",
|
|
531
551
|
name: "main-file",
|
|
532
|
-
value:
|
|
533
|
-
checked:
|
|
552
|
+
value: m.path,
|
|
553
|
+
checked: k === m.path,
|
|
534
554
|
onChange: () => {
|
|
535
|
-
|
|
555
|
+
l(m.path), f({});
|
|
536
556
|
},
|
|
537
557
|
className: "mt-0.5"
|
|
538
558
|
}
|
|
539
559
|
),
|
|
540
560
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
541
|
-
/* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs text-slate-900", children:
|
|
542
|
-
/* @__PURE__ */ e.jsx("span", { className: "block text-slate-500", children:
|
|
561
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs text-slate-900", children: m.path }),
|
|
562
|
+
/* @__PURE__ */ e.jsx("span", { className: "block text-slate-500", children: dt(m) })
|
|
543
563
|
] })
|
|
544
564
|
]
|
|
545
565
|
},
|
|
546
|
-
|
|
566
|
+
m.path
|
|
547
567
|
)) })
|
|
548
568
|
] }) : null,
|
|
549
|
-
|
|
569
|
+
i.extraRoots.length > 0 ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
|
|
550
570
|
/* @__PURE__ */ e.jsx("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: "Other documents" }),
|
|
551
571
|
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-sm text-slate-500", children: "These files also stand on their own. Attach them to the main document, or leave them out." }),
|
|
552
|
-
/* @__PURE__ */ e.jsx("div", { className: "mt-3 flex flex-col gap-2", children:
|
|
553
|
-
const
|
|
572
|
+
/* @__PURE__ */ e.jsx("div", { className: "mt-3 flex flex-col gap-2", children: i.extraRoots.map((m) => {
|
|
573
|
+
const ne = h[m.path], L = ne?.include ?? !0;
|
|
554
574
|
return /* @__PURE__ */ e.jsxs(
|
|
555
575
|
"div",
|
|
556
576
|
{
|
|
@@ -561,20 +581,20 @@ function st({
|
|
|
561
581
|
"input",
|
|
562
582
|
{
|
|
563
583
|
type: "checkbox",
|
|
564
|
-
checked:
|
|
565
|
-
onChange: (
|
|
566
|
-
...
|
|
567
|
-
[
|
|
568
|
-
...
|
|
569
|
-
include:
|
|
584
|
+
checked: L,
|
|
585
|
+
onChange: (W) => f((I) => ({
|
|
586
|
+
...I,
|
|
587
|
+
[m.path]: {
|
|
588
|
+
...I[m.path],
|
|
589
|
+
include: W.currentTarget.checked
|
|
570
590
|
}
|
|
571
591
|
}))
|
|
572
592
|
}
|
|
573
593
|
),
|
|
574
|
-
/* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs text-slate-900", children:
|
|
575
|
-
|
|
594
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs text-slate-900", children: m.path }),
|
|
595
|
+
m.title ? /* @__PURE__ */ e.jsxs("span", { className: "text-slate-500", children: [
|
|
576
596
|
"— ",
|
|
577
|
-
|
|
597
|
+
m.title
|
|
578
598
|
] }) : null
|
|
579
599
|
] }),
|
|
580
600
|
/* @__PURE__ */ e.jsxs("label", { className: "flex items-center gap-2 text-slate-700", children: [
|
|
@@ -582,13 +602,13 @@ function st({
|
|
|
582
602
|
/* @__PURE__ */ e.jsxs(
|
|
583
603
|
"select",
|
|
584
604
|
{
|
|
585
|
-
value:
|
|
586
|
-
disabled: !
|
|
587
|
-
onChange: (
|
|
588
|
-
...
|
|
589
|
-
[
|
|
590
|
-
include:
|
|
591
|
-
level:
|
|
605
|
+
value: ne?.level ?? "auto",
|
|
606
|
+
disabled: !L,
|
|
607
|
+
onChange: (W) => f((I) => ({
|
|
608
|
+
...I,
|
|
609
|
+
[m.path]: {
|
|
610
|
+
include: I[m.path]?.include ?? !0,
|
|
611
|
+
level: W.currentTarget.value === "auto" ? void 0 : W.currentTarget.value
|
|
592
612
|
}
|
|
593
613
|
})),
|
|
594
614
|
className: "rounded border border-slate-300 px-2 py-1 text-sm disabled:opacity-50",
|
|
@@ -602,7 +622,7 @@ function st({
|
|
|
602
622
|
] })
|
|
603
623
|
]
|
|
604
624
|
},
|
|
605
|
-
|
|
625
|
+
m.path
|
|
606
626
|
);
|
|
607
627
|
}) })
|
|
608
628
|
] }) : null,
|
|
@@ -611,7 +631,7 @@ function st({
|
|
|
611
631
|
"button",
|
|
612
632
|
{
|
|
613
633
|
type: "button",
|
|
614
|
-
onClick:
|
|
634
|
+
onClick: je,
|
|
615
635
|
className: "px-4 py-2 text-sm text-slate-600 hover:text-slate-900",
|
|
616
636
|
children: "Start Over"
|
|
617
637
|
}
|
|
@@ -620,7 +640,7 @@ function st({
|
|
|
620
640
|
"button",
|
|
621
641
|
{
|
|
622
642
|
type: "button",
|
|
623
|
-
onClick: () =>
|
|
643
|
+
onClick: () => Me(n),
|
|
624
644
|
className: "rounded bg-blue-700 px-4 py-2 text-sm font-medium text-white hover:bg-blue-600",
|
|
625
645
|
children: "Continue"
|
|
626
646
|
}
|
|
@@ -628,56 +648,63 @@ function st({
|
|
|
628
648
|
] })
|
|
629
649
|
] });
|
|
630
650
|
}
|
|
631
|
-
if (
|
|
632
|
-
let
|
|
633
|
-
|
|
634
|
-
},
|
|
635
|
-
|
|
636
|
-
const
|
|
637
|
-
return
|
|
651
|
+
if (y.name === "review") {
|
|
652
|
+
let n = function(s) {
|
|
653
|
+
q(s), N?.(s), B && Te(a, s);
|
|
654
|
+
}, i = function(s) {
|
|
655
|
+
ce((w) => {
|
|
656
|
+
const Q = new Set(w);
|
|
657
|
+
return Q.has(s) ? Q.delete(s) : Q.add(s), Q;
|
|
638
658
|
});
|
|
639
659
|
};
|
|
640
|
-
const
|
|
641
|
-
Object.keys(
|
|
642
|
-
|
|
660
|
+
const a = de ?? y.result, k = a.splitLevel, m = A.length > 0, ne = Se(a) && !m, L = ne ? st(a, fe) : "converted", W = a.detectedSourceFormat === "markdown" ? "Markdown" : "LaTeX", I = a.warnings.length, Ue = Object.keys(a.outputFiles).length, $ = a.insert, ue = a.destination.kind === "insert" ? a.destination.targetTag : void 0, Ye = p?.targetTags ?? [...qe], ve = Pe(a, L), ze = L === "converted" ? a.projectLayout.mainSourcePath : a.sourcePath, me = Ee(
|
|
661
|
+
Object.keys(ve),
|
|
662
|
+
ze
|
|
643
663
|
);
|
|
644
664
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
645
665
|
/* @__PURE__ */ e.jsxs("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-4", children: [
|
|
646
666
|
/* @__PURE__ */ e.jsx("h3", { className: "mb-3 text-sm font-semibold text-slate-700", children: "Import Summary" }),
|
|
647
667
|
/* @__PURE__ */ e.jsxs("dl", { className: "grid grid-cols-2 gap-x-6 gap-y-2 text-sm", children: [
|
|
648
668
|
/* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Source" }),
|
|
649
|
-
/* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900", children:
|
|
669
|
+
/* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900", children: a.sourceName }),
|
|
650
670
|
/* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Detected format" }),
|
|
651
|
-
/* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900 capitalize", children:
|
|
671
|
+
/* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900 capitalize", children: a.detectedSourceFormat }),
|
|
652
672
|
/* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Document kind" }),
|
|
653
|
-
/* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900 capitalize", children:
|
|
673
|
+
/* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900 capitalize", children: a.documentKind }),
|
|
654
674
|
/* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Output files" }),
|
|
655
|
-
/* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900", children:
|
|
656
|
-
|
|
675
|
+
/* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900", children: Ue }),
|
|
676
|
+
p ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
677
|
+
/* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Destination" }),
|
|
678
|
+
/* @__PURE__ */ e.jsxs("dd", { className: "font-medium text-slate-900", children: [
|
|
679
|
+
"Inserted into ",
|
|
680
|
+
p.documentLabel
|
|
681
|
+
] })
|
|
682
|
+
] }) : null,
|
|
683
|
+
a.projectLayout.preserved ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
657
684
|
/* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Existing project" }),
|
|
658
685
|
/* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900", children: "Kept publication file, assets, and layout" })
|
|
659
686
|
] }) : null,
|
|
660
|
-
|
|
687
|
+
a.attachedRoots.length > 0 ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
661
688
|
/* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Attached" }),
|
|
662
|
-
/* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900", children:
|
|
689
|
+
/* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900", children: a.attachedRoots.map((s) => `${s.title} (${s.level})`).join(", ") })
|
|
663
690
|
] }) : null
|
|
664
691
|
] })
|
|
665
692
|
] }),
|
|
666
|
-
|
|
693
|
+
I > 0 ? /* @__PURE__ */ e.jsxs("details", { className: "rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm", children: [
|
|
667
694
|
/* @__PURE__ */ e.jsxs("summary", { className: "cursor-pointer font-semibold text-amber-800", children: [
|
|
668
|
-
|
|
695
|
+
I,
|
|
669
696
|
" conversion",
|
|
670
697
|
" ",
|
|
671
|
-
|
|
698
|
+
I === 1 ? "warning" : "warnings"
|
|
672
699
|
] }),
|
|
673
|
-
/* @__PURE__ */ e.jsx("ul", { className: "mt-3 space-y-1.5 text-amber-700", children:
|
|
674
|
-
/* @__PURE__ */ e.jsx("code", { className: "rounded bg-amber-100 px-1 py-0.5 text-xs", children:
|
|
700
|
+
/* @__PURE__ */ e.jsx("ul", { className: "mt-3 space-y-1.5 text-amber-700", children: a.warnings.map((s, w) => /* @__PURE__ */ e.jsxs("li", { children: [
|
|
701
|
+
/* @__PURE__ */ e.jsx("code", { className: "rounded bg-amber-100 px-1 py-0.5 text-xs", children: s.macro }),
|
|
675
702
|
" — ",
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
] },
|
|
703
|
+
s.action === "replace" || s.action === "rewrite" ? `replaced with \`${s.replacement}\`` : s.message ?? s.action,
|
|
704
|
+
s.occurrences > 1 ? ` (×${s.occurrences})` : null
|
|
705
|
+
] }, w)) })
|
|
679
706
|
] }) : /* @__PURE__ */ e.jsx("p", { className: "text-sm text-green-700", children: "No conversion warnings." }),
|
|
680
|
-
|
|
707
|
+
ne && !c ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
|
|
681
708
|
/* @__PURE__ */ e.jsx("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: "Import mode" }),
|
|
682
709
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-col gap-3", children: [
|
|
683
710
|
/* @__PURE__ */ e.jsxs("label", { className: "flex cursor-pointer items-start gap-3 text-sm", children: [
|
|
@@ -688,7 +715,7 @@ function st({
|
|
|
688
715
|
name: "import-mode",
|
|
689
716
|
value: "converted",
|
|
690
717
|
checked: L === "converted",
|
|
691
|
-
onChange: () =>
|
|
718
|
+
onChange: () => n("converted"),
|
|
692
719
|
className: "mt-0.5"
|
|
693
720
|
}
|
|
694
721
|
),
|
|
@@ -705,58 +732,123 @@ function st({
|
|
|
705
732
|
name: "import-mode",
|
|
706
733
|
value: "native",
|
|
707
734
|
checked: L === "native",
|
|
708
|
-
onChange: () =>
|
|
735
|
+
onChange: () => n("native"),
|
|
709
736
|
className: "mt-0.5"
|
|
710
737
|
}
|
|
711
738
|
),
|
|
712
739
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
713
740
|
/* @__PURE__ */ e.jsxs("span", { className: "font-medium text-slate-900", children: [
|
|
714
741
|
"Keep as ",
|
|
715
|
-
|
|
742
|
+
W
|
|
716
743
|
] }),
|
|
717
744
|
/* @__PURE__ */ e.jsxs("span", { className: "block text-slate-500", children: [
|
|
718
745
|
"Preserve the original ",
|
|
719
|
-
|
|
746
|
+
W,
|
|
720
747
|
" source. The conversion will not be applied."
|
|
721
748
|
] })
|
|
722
749
|
] })
|
|
723
750
|
] })
|
|
724
751
|
] })
|
|
725
752
|
] }) : null,
|
|
726
|
-
|
|
753
|
+
be.length > 1 ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
|
|
754
|
+
/* @__PURE__ */ e.jsx("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: "Divisions to import" }),
|
|
755
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-2 text-sm", children: [
|
|
756
|
+
/* @__PURE__ */ e.jsx(
|
|
757
|
+
"button",
|
|
758
|
+
{
|
|
759
|
+
type: "button",
|
|
760
|
+
onClick: () => ee([]),
|
|
761
|
+
className: "rounded border border-slate-300 px-3 py-1 text-slate-700 hover:bg-slate-50",
|
|
762
|
+
children: "Everything"
|
|
763
|
+
}
|
|
764
|
+
),
|
|
765
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-slate-500", children: A.length === 0 ? "The whole document" : `${A.length} of ${Le(be)} divisions` })
|
|
766
|
+
] }),
|
|
767
|
+
/* @__PURE__ */ e.jsx("div", { className: "mt-3 max-h-56 overflow-auto", children: /* @__PURE__ */ e.jsx(
|
|
768
|
+
Ie,
|
|
769
|
+
{
|
|
770
|
+
items: be,
|
|
771
|
+
selection: A,
|
|
772
|
+
onToggle: (s) => ee(
|
|
773
|
+
(w) => w.includes(s) ? w.filter((Q) => Q !== s) : [...w, s].sort(mt)
|
|
774
|
+
)
|
|
775
|
+
}
|
|
776
|
+
) }),
|
|
777
|
+
A.length > 0 ? /* @__PURE__ */ e.jsxs("p", { className: "mt-2 text-sm text-slate-500", children: [
|
|
778
|
+
"A selected division is imported whole, with everything inside it. Divisions above one you selected are kept as structure.",
|
|
779
|
+
Se(y.result) ? " Selecting divisions imports the converted PreTeXt; keeping the original source imports the document whole." : ""
|
|
780
|
+
] }) : null
|
|
781
|
+
] }) : null,
|
|
782
|
+
$ && p ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
|
|
783
|
+
/* @__PURE__ */ e.jsxs("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: [
|
|
784
|
+
"Attach to ",
|
|
785
|
+
p.documentLabel
|
|
786
|
+
] }),
|
|
787
|
+
/* @__PURE__ */ e.jsx("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: Ye.map((s) => /* @__PURE__ */ e.jsxs(
|
|
788
|
+
"button",
|
|
789
|
+
{
|
|
790
|
+
type: "button",
|
|
791
|
+
onClick: () => _(s),
|
|
792
|
+
"aria-pressed": ue === s,
|
|
793
|
+
className: ue === s ? "rounded bg-blue-700 px-3 py-1 text-sm font-medium text-white" : "rounded border border-slate-300 px-3 py-1 text-sm text-slate-700 hover:bg-slate-50",
|
|
794
|
+
children: [
|
|
795
|
+
"<",
|
|
796
|
+
s,
|
|
797
|
+
">"
|
|
798
|
+
]
|
|
799
|
+
},
|
|
800
|
+
s
|
|
801
|
+
)) }),
|
|
802
|
+
/* @__PURE__ */ e.jsxs("p", { className: "mt-3 text-sm text-slate-600", children: [
|
|
803
|
+
$.includes.length === 1 ? `One <${ue}> is added to ${p.documentLabel}, ` : `${$.includes.length} <${ue}> divisions are added to ${p.documentLabel}, `,
|
|
804
|
+
$.includes.length === 1 ? "included from a new file beside it." : "each included from a new file beside it."
|
|
805
|
+
] }),
|
|
806
|
+
$.renamed.length > 0 ? /* @__PURE__ */ e.jsxs("p", { className: "mt-2 text-sm text-amber-700", children: [
|
|
807
|
+
$.renamed.length,
|
|
808
|
+
" id",
|
|
809
|
+
$.renamed.length === 1 ? "" : "s",
|
|
810
|
+
" already used in this project",
|
|
811
|
+
" ",
|
|
812
|
+
$.renamed.length === 1 ? "was" : "were",
|
|
813
|
+
" renamed:",
|
|
814
|
+
" ",
|
|
815
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs", children: $.renamed.map((s) => `${s.from} → ${s.to}`).join(", ") })
|
|
816
|
+
] }) : null
|
|
817
|
+
] }) : null,
|
|
818
|
+
!d && a.cleanChunks.length > 0 ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
|
|
727
819
|
/* @__PURE__ */ e.jsx("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: "Split into files" }),
|
|
728
820
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: [
|
|
729
821
|
Array.from(
|
|
730
|
-
{ length:
|
|
731
|
-
(
|
|
822
|
+
{ length: Ge + 1 },
|
|
823
|
+
(s, w) => /* @__PURE__ */ e.jsx(
|
|
732
824
|
"button",
|
|
733
825
|
{
|
|
734
826
|
type: "button",
|
|
735
|
-
onClick: () =>
|
|
736
|
-
"aria-pressed":
|
|
737
|
-
className:
|
|
738
|
-
children:
|
|
827
|
+
onClick: () => z(w),
|
|
828
|
+
"aria-pressed": k === w,
|
|
829
|
+
className: k === w ? "rounded bg-blue-700 px-3 py-1 text-sm font-medium text-white" : "rounded border border-slate-300 px-3 py-1 text-sm text-slate-700 hover:bg-slate-50",
|
|
830
|
+
children: w === 0 ? "One file" : `${w} level${w === 1 ? "" : "s"}`
|
|
739
831
|
},
|
|
740
|
-
|
|
832
|
+
w
|
|
741
833
|
)
|
|
742
834
|
),
|
|
743
835
|
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 text-sm text-slate-500", children: [
|
|
744
|
-
|
|
836
|
+
me.length,
|
|
745
837
|
" file",
|
|
746
|
-
|
|
838
|
+
me.length === 1 ? "" : "s"
|
|
747
839
|
] })
|
|
748
840
|
] }),
|
|
749
|
-
/* @__PURE__ */ e.jsx("ul", { className: "mt-3 max-h-48 overflow-auto font-mono text-xs text-slate-600", children:
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
841
|
+
/* @__PURE__ */ e.jsx("ul", { className: "mt-3 max-h-48 overflow-auto font-mono text-xs text-slate-600", children: me.map((s) => /* @__PURE__ */ e.jsxs("li", { className: "truncate py-0.5", children: [
|
|
842
|
+
s,
|
|
843
|
+
U.get(s)?.fixCount ? /* @__PURE__ */ e.jsxs("span", { className: "ml-2 text-amber-700", children: [
|
|
844
|
+
U.get(s).fixCount,
|
|
753
845
|
" change",
|
|
754
|
-
|
|
846
|
+
U.get(s).fixCount === 1 ? "" : "s"
|
|
755
847
|
] }) : null
|
|
756
|
-
] },
|
|
848
|
+
] }, s)) })
|
|
757
849
|
] }) : null,
|
|
758
|
-
|
|
759
|
-
const
|
|
850
|
+
B ? /* @__PURE__ */ e.jsx("div", { className: "overflow-hidden rounded-lg border border-slate-200 text-sm", children: me.map((s) => {
|
|
851
|
+
const w = te.has(s);
|
|
760
852
|
return /* @__PURE__ */ e.jsxs(
|
|
761
853
|
"div",
|
|
762
854
|
{
|
|
@@ -766,42 +858,42 @@ function st({
|
|
|
766
858
|
"button",
|
|
767
859
|
{
|
|
768
860
|
type: "button",
|
|
769
|
-
onClick: () =>
|
|
861
|
+
onClick: () => Xe(s),
|
|
770
862
|
className: "flex w-full items-center gap-2 bg-slate-100 px-4 py-2 text-left font-mono text-xs text-slate-700 hover:bg-slate-200",
|
|
771
863
|
children: [
|
|
772
|
-
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-slate-400", children:
|
|
773
|
-
/* @__PURE__ */ e.jsx("span", { className: "flex-1 truncate", children:
|
|
864
|
+
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-slate-400", children: w ? "▾" : "▸" }),
|
|
865
|
+
/* @__PURE__ */ e.jsx("span", { className: "flex-1 truncate", children: s }),
|
|
774
866
|
/* @__PURE__ */ e.jsxs("span", { className: "shrink-0 text-slate-400", children: [
|
|
775
|
-
(
|
|
867
|
+
(ve[s].length / 1024).toFixed(1),
|
|
776
868
|
" KB"
|
|
777
869
|
] })
|
|
778
870
|
]
|
|
779
871
|
}
|
|
780
872
|
),
|
|
781
|
-
|
|
782
|
-
|
|
873
|
+
w ? /* @__PURE__ */ e.jsxs("div", { className: "bg-white", children: [
|
|
874
|
+
U.get(s)?.hunks.length ? /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 border-b border-slate-200 px-4 py-2", children: [
|
|
783
875
|
/* @__PURE__ */ e.jsx(
|
|
784
876
|
"button",
|
|
785
877
|
{
|
|
786
878
|
type: "button",
|
|
787
|
-
onClick: () =>
|
|
879
|
+
onClick: () => i(s),
|
|
788
880
|
className: "rounded border border-slate-300 px-2 py-0.5 text-xs text-slate-700 hover:bg-slate-50",
|
|
789
|
-
children:
|
|
881
|
+
children: oe.has(s) ? "Show converted file" : "Show what changed"
|
|
790
882
|
}
|
|
791
883
|
),
|
|
792
884
|
/* @__PURE__ */ e.jsxs("span", { className: "text-xs text-slate-500", children: [
|
|
793
885
|
"+",
|
|
794
|
-
|
|
886
|
+
U.get(s).stats.added,
|
|
795
887
|
" −",
|
|
796
|
-
|
|
888
|
+
U.get(s).stats.removed,
|
|
797
889
|
" in the LaTeX source"
|
|
798
890
|
] })
|
|
799
891
|
] }) : null,
|
|
800
|
-
|
|
892
|
+
oe.has(s) && U.has(s) ? /* @__PURE__ */ e.jsx(xt, { hunks: U.get(s).hunks }) : /* @__PURE__ */ e.jsx("pre", { className: "m-0 max-h-72 overflow-auto p-4 font-mono text-xs leading-relaxed text-slate-800", children: ve[s] })
|
|
801
893
|
] }) : null
|
|
802
894
|
]
|
|
803
895
|
},
|
|
804
|
-
|
|
896
|
+
s
|
|
805
897
|
);
|
|
806
898
|
}) }) : null,
|
|
807
899
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-3 pt-1", children: [
|
|
@@ -809,17 +901,17 @@ function st({
|
|
|
809
901
|
"button",
|
|
810
902
|
{
|
|
811
903
|
type: "button",
|
|
812
|
-
onClick:
|
|
904
|
+
onClick: o ?? je,
|
|
813
905
|
className: "px-4 py-2 text-sm text-slate-600 hover:text-slate-900",
|
|
814
|
-
children:
|
|
906
|
+
children: o ? "Cancel" : "Start Over"
|
|
815
907
|
}
|
|
816
908
|
),
|
|
817
909
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
818
|
-
|
|
910
|
+
J ? /* @__PURE__ */ e.jsx(
|
|
819
911
|
"button",
|
|
820
912
|
{
|
|
821
913
|
type: "button",
|
|
822
|
-
onClick: () =>
|
|
914
|
+
onClick: () => v({ name: "sources", prepared: J }),
|
|
823
915
|
className: "rounded border border-slate-300 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50",
|
|
824
916
|
children: "Change Sources"
|
|
825
917
|
}
|
|
@@ -829,29 +921,29 @@ function st({
|
|
|
829
921
|
{
|
|
830
922
|
type: "button",
|
|
831
923
|
onClick: () => {
|
|
832
|
-
|
|
924
|
+
B || Te(a, L), ie((s) => !s);
|
|
833
925
|
},
|
|
834
926
|
className: "rounded border border-slate-300 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50",
|
|
835
|
-
children:
|
|
927
|
+
children: B ? "Hide Preview" : "Preview"
|
|
836
928
|
}
|
|
837
929
|
),
|
|
838
930
|
/* @__PURE__ */ e.jsxs(
|
|
839
931
|
"button",
|
|
840
932
|
{
|
|
841
933
|
type: "button",
|
|
842
|
-
disabled:
|
|
934
|
+
disabled: X,
|
|
843
935
|
onClick: async () => {
|
|
844
|
-
|
|
936
|
+
H(!0);
|
|
845
937
|
try {
|
|
846
|
-
await
|
|
938
|
+
await r(a, L);
|
|
847
939
|
} finally {
|
|
848
|
-
|
|
940
|
+
H(!1);
|
|
849
941
|
}
|
|
850
942
|
},
|
|
851
943
|
className: "flex items-center gap-2 rounded bg-blue-700 px-4 py-2 text-sm font-medium text-white hover:bg-blue-600 disabled:opacity-60",
|
|
852
944
|
children: [
|
|
853
|
-
|
|
854
|
-
|
|
945
|
+
X ? /* @__PURE__ */ e.jsx("span", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-white border-t-transparent" }) : null,
|
|
946
|
+
X ? p ? "Inserting…" : "Importing…" : p ? "Confirm Insert" : "Confirm Import"
|
|
855
947
|
]
|
|
856
948
|
}
|
|
857
949
|
)
|
|
@@ -860,9 +952,9 @@ function st({
|
|
|
860
952
|
] });
|
|
861
953
|
}
|
|
862
954
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
863
|
-
|
|
955
|
+
S.length > 1 ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
|
|
864
956
|
/* @__PURE__ */ e.jsx("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: "Converter" }),
|
|
865
|
-
/* @__PURE__ */ e.jsx("div", { className: "mt-2 flex flex-col gap-3", children:
|
|
957
|
+
/* @__PURE__ */ e.jsx("div", { className: "mt-2 flex flex-col gap-3", children: S.map((n) => /* @__PURE__ */ e.jsxs(
|
|
866
958
|
"label",
|
|
867
959
|
{
|
|
868
960
|
className: "flex cursor-pointer items-start gap-3 text-sm",
|
|
@@ -872,29 +964,29 @@ function st({
|
|
|
872
964
|
{
|
|
873
965
|
type: "radio",
|
|
874
966
|
name: "import-engine",
|
|
875
|
-
value:
|
|
876
|
-
checked:
|
|
877
|
-
onChange: () =>
|
|
967
|
+
value: n.id,
|
|
968
|
+
checked: V === n.id,
|
|
969
|
+
onChange: () => he(n.id),
|
|
878
970
|
className: "mt-0.5"
|
|
879
971
|
}
|
|
880
972
|
),
|
|
881
973
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
882
|
-
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-slate-900", children:
|
|
883
|
-
|
|
974
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-slate-900", children: n.label }),
|
|
975
|
+
n.description ? /* @__PURE__ */ e.jsx("span", { className: "block text-slate-500", children: n.description }) : null
|
|
884
976
|
] })
|
|
885
977
|
]
|
|
886
978
|
},
|
|
887
|
-
|
|
979
|
+
n.id
|
|
888
980
|
)) })
|
|
889
981
|
] }) : null,
|
|
890
|
-
|
|
982
|
+
d ? null : /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-4 text-sm", children: /* @__PURE__ */ e.jsxs("label", { className: "flex items-center gap-2 text-slate-700", children: [
|
|
891
983
|
/* @__PURE__ */ e.jsx("span", { className: "text-slate-500", children: "Document kind" }),
|
|
892
984
|
/* @__PURE__ */ e.jsxs(
|
|
893
985
|
"select",
|
|
894
986
|
{
|
|
895
|
-
value:
|
|
896
|
-
onChange: (
|
|
897
|
-
|
|
987
|
+
value: D,
|
|
988
|
+
onChange: (n) => Y(
|
|
989
|
+
n.currentTarget.value
|
|
898
990
|
),
|
|
899
991
|
className: "rounded border border-slate-300 px-2 py-1 text-sm",
|
|
900
992
|
children: [
|
|
@@ -910,26 +1002,26 @@ function st({
|
|
|
910
1002
|
{
|
|
911
1003
|
role: "button",
|
|
912
1004
|
tabIndex: 0,
|
|
913
|
-
onKeyDown: (
|
|
914
|
-
onClick: () =>
|
|
915
|
-
onDragOver: (
|
|
916
|
-
|
|
1005
|
+
onKeyDown: (n) => n.key === "Enter" && T.current?.click(),
|
|
1006
|
+
onClick: () => T.current?.click(),
|
|
1007
|
+
onDragOver: (n) => {
|
|
1008
|
+
n.preventDefault(), P(!0);
|
|
917
1009
|
},
|
|
918
|
-
onDragLeave: () =>
|
|
919
|
-
onDrop: (
|
|
920
|
-
|
|
921
|
-
const
|
|
922
|
-
|
|
1010
|
+
onDragLeave: () => P(!1),
|
|
1011
|
+
onDrop: (n) => {
|
|
1012
|
+
n.preventDefault(), P(!1);
|
|
1013
|
+
const i = n.dataTransfer.files?.[0];
|
|
1014
|
+
i && ke(i);
|
|
923
1015
|
},
|
|
924
|
-
className: `flex cursor-pointer flex-col items-center gap-3 rounded-lg border-2 border-dashed p-10 text-center transition-colors ${
|
|
1016
|
+
className: `flex cursor-pointer flex-col items-center gap-3 rounded-lg border-2 border-dashed p-10 text-center transition-colors ${F ? "border-blue-500 bg-blue-50" : "border-slate-300 bg-slate-50 hover:border-slate-400"}`,
|
|
925
1017
|
children: [
|
|
926
1018
|
/* @__PURE__ */ e.jsx("p", { className: "text-slate-600", children: "Drop a file here, or click to select." }),
|
|
927
1019
|
/* @__PURE__ */ e.jsx(
|
|
928
1020
|
"button",
|
|
929
1021
|
{
|
|
930
1022
|
type: "button",
|
|
931
|
-
onClick: (
|
|
932
|
-
|
|
1023
|
+
onClick: (n) => {
|
|
1024
|
+
n.stopPropagation(), T.current?.click();
|
|
933
1025
|
},
|
|
934
1026
|
className: "rounded bg-blue-700 px-4 py-2 text-sm font-medium text-white hover:bg-blue-600",
|
|
935
1027
|
children: "Select File"
|
|
@@ -937,18 +1029,18 @@ function st({
|
|
|
937
1029
|
),
|
|
938
1030
|
/* @__PURE__ */ e.jsxs("p", { className: "text-xs text-slate-400", children: [
|
|
939
1031
|
"Supports ",
|
|
940
|
-
|
|
1032
|
+
Z.join(", ")
|
|
941
1033
|
] }),
|
|
942
1034
|
/* @__PURE__ */ e.jsx(
|
|
943
1035
|
"input",
|
|
944
1036
|
{
|
|
945
|
-
ref:
|
|
1037
|
+
ref: T,
|
|
946
1038
|
type: "file",
|
|
947
1039
|
hidden: !0,
|
|
948
|
-
accept:
|
|
949
|
-
onChange: (
|
|
950
|
-
const
|
|
951
|
-
|
|
1040
|
+
accept: Z.join(","),
|
|
1041
|
+
onChange: (n) => {
|
|
1042
|
+
const i = n.currentTarget.files?.[0];
|
|
1043
|
+
i && ke(i), n.currentTarget.value = "";
|
|
952
1044
|
}
|
|
953
1045
|
}
|
|
954
1046
|
)
|
|
@@ -957,23 +1049,78 @@ function st({
|
|
|
957
1049
|
)
|
|
958
1050
|
] });
|
|
959
1051
|
}
|
|
960
|
-
function
|
|
961
|
-
return
|
|
962
|
-
|
|
963
|
-
|
|
1052
|
+
function Le(r) {
|
|
1053
|
+
return r.reduce(
|
|
1054
|
+
(o, d) => o + 1 + Le(d.children),
|
|
1055
|
+
0
|
|
1056
|
+
);
|
|
1057
|
+
}
|
|
1058
|
+
function mt(r, o) {
|
|
1059
|
+
const d = r.split(".").map(Number), u = o.split(".").map(Number);
|
|
1060
|
+
for (let x = 0; x < Math.max(d.length, u.length); x++) {
|
|
1061
|
+
const c = (d[x] ?? -1) - (u[x] ?? -1);
|
|
1062
|
+
if (c !== 0)
|
|
1063
|
+
return c;
|
|
1064
|
+
}
|
|
1065
|
+
return 0;
|
|
1066
|
+
}
|
|
1067
|
+
function Ie({
|
|
1068
|
+
items: r,
|
|
1069
|
+
selection: o,
|
|
1070
|
+
onToggle: d
|
|
1071
|
+
}) {
|
|
1072
|
+
return /* @__PURE__ */ e.jsx("ul", { className: "space-y-0.5 text-sm", children: r.map((u) => {
|
|
1073
|
+
const x = o.includes(u.path), c = o.some(
|
|
1074
|
+
(N) => u.path.startsWith(`${N}.`)
|
|
1075
|
+
);
|
|
1076
|
+
return /* @__PURE__ */ e.jsxs("li", { children: [
|
|
1077
|
+
/* @__PURE__ */ e.jsxs("label", { className: "flex items-baseline gap-2", children: [
|
|
1078
|
+
/* @__PURE__ */ e.jsx(
|
|
1079
|
+
"input",
|
|
1080
|
+
{
|
|
1081
|
+
type: "checkbox",
|
|
1082
|
+
checked: x || c,
|
|
1083
|
+
disabled: c,
|
|
1084
|
+
onChange: () => d(u.path)
|
|
1085
|
+
}
|
|
1086
|
+
),
|
|
1087
|
+
/* @__PURE__ */ e.jsxs("span", { className: c ? "text-slate-400" : "text-slate-700", children: [
|
|
1088
|
+
u.title || /* @__PURE__ */ e.jsx("em", { children: "Untitled" }),
|
|
1089
|
+
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono text-xs text-slate-400", children: [
|
|
1090
|
+
"<",
|
|
1091
|
+
u.tag,
|
|
1092
|
+
">"
|
|
1093
|
+
] })
|
|
1094
|
+
] })
|
|
1095
|
+
] }),
|
|
1096
|
+
u.children.length > 0 ? /* @__PURE__ */ e.jsx("div", { className: "ml-5 border-l border-slate-200 pl-3", children: /* @__PURE__ */ e.jsx(
|
|
1097
|
+
Ie,
|
|
1098
|
+
{
|
|
1099
|
+
items: u.children,
|
|
1100
|
+
selection: o,
|
|
1101
|
+
onToggle: d
|
|
1102
|
+
}
|
|
1103
|
+
) }) : null
|
|
1104
|
+
] }, u.path);
|
|
1105
|
+
}) });
|
|
1106
|
+
}
|
|
1107
|
+
function xt({ hunks: r }) {
|
|
1108
|
+
return r.length === 0 ? /* @__PURE__ */ e.jsx("p", { className: "m-0 px-4 py-3 text-xs text-slate-500", children: "Nothing was changed in this file." }) : /* @__PURE__ */ e.jsx("div", { className: "max-h-72 overflow-auto bg-white font-mono text-xs leading-relaxed", children: r.map((o, d) => /* @__PURE__ */ e.jsxs("div", { className: "border-b border-slate-100 last:border-b-0", children: [
|
|
1109
|
+
d > 0 ? /* @__PURE__ */ e.jsx("div", { className: "bg-slate-50 px-4 py-1 text-slate-400", children: "⋯" }) : null,
|
|
1110
|
+
o.lines.map((u, x) => /* @__PURE__ */ e.jsxs(
|
|
964
1111
|
"div",
|
|
965
1112
|
{
|
|
966
|
-
className:
|
|
1113
|
+
className: u.op === "add" ? "bg-green-50 px-4 text-green-900" : u.op === "remove" ? "bg-red-50 px-4 text-red-900" : "px-4 text-slate-600",
|
|
967
1114
|
children: [
|
|
968
|
-
/* @__PURE__ */ e.jsx("span", { className: "mr-2 select-none text-slate-400", children:
|
|
969
|
-
|
|
1115
|
+
/* @__PURE__ */ e.jsx("span", { className: "mr-2 select-none text-slate-400", children: u.op === "add" ? "+" : u.op === "remove" ? "−" : " " }),
|
|
1116
|
+
u.text || " "
|
|
970
1117
|
]
|
|
971
1118
|
},
|
|
972
|
-
|
|
1119
|
+
x
|
|
973
1120
|
))
|
|
974
|
-
] },
|
|
1121
|
+
] }, d)) });
|
|
975
1122
|
}
|
|
976
|
-
const
|
|
1123
|
+
const pt = {
|
|
977
1124
|
title: "Import Source Content",
|
|
978
1125
|
description: "Paste LaTeX, Markdown, or PreTeXt source to convert into PreTeXt.",
|
|
979
1126
|
sourceLabel: "Source",
|
|
@@ -984,59 +1131,59 @@ const Ze = {
|
|
|
984
1131
|
successPrefix: "Ready",
|
|
985
1132
|
errorPrefix: "Error"
|
|
986
1133
|
};
|
|
987
|
-
function
|
|
988
|
-
initialSource:
|
|
989
|
-
initialSourceFormat:
|
|
990
|
-
labels:
|
|
991
|
-
disabled:
|
|
992
|
-
onImport:
|
|
1134
|
+
function vt({
|
|
1135
|
+
initialSource: r = "",
|
|
1136
|
+
initialSourceFormat: o,
|
|
1137
|
+
labels: d,
|
|
1138
|
+
disabled: u = !1,
|
|
1139
|
+
onImport: x
|
|
993
1140
|
}) {
|
|
994
|
-
const
|
|
995
|
-
() => ({ ...
|
|
996
|
-
[
|
|
997
|
-
), [
|
|
998
|
-
|
|
999
|
-
), [
|
|
1141
|
+
const c = K(
|
|
1142
|
+
() => ({ ...pt, ...d ?? {} }),
|
|
1143
|
+
[d]
|
|
1144
|
+
), [N, C] = g(r), [p, S] = g(
|
|
1145
|
+
o ?? "auto"
|
|
1146
|
+
), [T, y] = g(
|
|
1000
1147
|
null
|
|
1001
|
-
),
|
|
1002
|
-
() =>
|
|
1003
|
-
[
|
|
1004
|
-
),
|
|
1148
|
+
), v = K(
|
|
1149
|
+
() => Ze(N),
|
|
1150
|
+
[N]
|
|
1151
|
+
), F = u || !N.trim();
|
|
1005
1152
|
return /* @__PURE__ */ e.jsx(
|
|
1006
1153
|
"form",
|
|
1007
1154
|
{
|
|
1008
|
-
onSubmit: (
|
|
1009
|
-
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1012
|
-
|
|
1155
|
+
onSubmit: (P) => {
|
|
1156
|
+
P.preventDefault();
|
|
1157
|
+
const D = Qe(
|
|
1158
|
+
N,
|
|
1159
|
+
p === "auto" ? void 0 : p
|
|
1013
1160
|
);
|
|
1014
|
-
|
|
1161
|
+
y(D), x(D);
|
|
1015
1162
|
},
|
|
1016
1163
|
"aria-label": "Import source form",
|
|
1017
|
-
children: /* @__PURE__ */ e.jsxs("fieldset", { disabled:
|
|
1018
|
-
/* @__PURE__ */ e.jsx("legend", { children:
|
|
1019
|
-
/* @__PURE__ */ e.jsx("p", { children:
|
|
1164
|
+
children: /* @__PURE__ */ e.jsxs("fieldset", { disabled: u, children: [
|
|
1165
|
+
/* @__PURE__ */ e.jsx("legend", { children: c.title }),
|
|
1166
|
+
/* @__PURE__ */ e.jsx("p", { children: c.description }),
|
|
1020
1167
|
/* @__PURE__ */ e.jsxs("label", { children: [
|
|
1021
|
-
|
|
1168
|
+
c.sourceLabel,
|
|
1022
1169
|
/* @__PURE__ */ e.jsx(
|
|
1023
1170
|
"textarea",
|
|
1024
1171
|
{
|
|
1025
|
-
value:
|
|
1026
|
-
onChange: (
|
|
1027
|
-
placeholder:
|
|
1172
|
+
value: N,
|
|
1173
|
+
onChange: (P) => C(P.currentTarget.value),
|
|
1174
|
+
placeholder: c.sourcePlaceholder,
|
|
1028
1175
|
rows: 12
|
|
1029
1176
|
}
|
|
1030
1177
|
)
|
|
1031
1178
|
] }),
|
|
1032
1179
|
/* @__PURE__ */ e.jsxs("label", { children: [
|
|
1033
|
-
|
|
1180
|
+
c.formatLabel,
|
|
1034
1181
|
/* @__PURE__ */ e.jsxs(
|
|
1035
1182
|
"select",
|
|
1036
1183
|
{
|
|
1037
|
-
value:
|
|
1038
|
-
onChange: (
|
|
1039
|
-
|
|
1184
|
+
value: p,
|
|
1185
|
+
onChange: (P) => S(
|
|
1186
|
+
P.currentTarget.value
|
|
1040
1187
|
),
|
|
1041
1188
|
children: [
|
|
1042
1189
|
/* @__PURE__ */ e.jsx("option", { value: "auto", children: "Auto detect" }),
|
|
@@ -1048,26 +1195,26 @@ function at({
|
|
|
1048
1195
|
)
|
|
1049
1196
|
] }),
|
|
1050
1197
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
1051
|
-
|
|
1198
|
+
c.detectedFormatPrefix,
|
|
1052
1199
|
": ",
|
|
1053
|
-
/* @__PURE__ */ e.jsx("strong", { children:
|
|
1200
|
+
/* @__PURE__ */ e.jsx("strong", { children: v })
|
|
1054
1201
|
] }),
|
|
1055
|
-
/* @__PURE__ */ e.jsx("button", { type: "submit", disabled:
|
|
1056
|
-
|
|
1057
|
-
|
|
1202
|
+
/* @__PURE__ */ e.jsx("button", { type: "submit", disabled: F, children: c.convertButton }),
|
|
1203
|
+
T ? "pretextError" in T ? /* @__PURE__ */ e.jsxs("p", { role: "alert", children: [
|
|
1204
|
+
c.errorPrefix,
|
|
1058
1205
|
": ",
|
|
1059
|
-
|
|
1206
|
+
T.pretextError
|
|
1060
1207
|
] }) : /* @__PURE__ */ e.jsxs("p", { children: [
|
|
1061
|
-
|
|
1208
|
+
c.successPrefix,
|
|
1062
1209
|
": ",
|
|
1063
|
-
|
|
1210
|
+
T.pretextSource.length,
|
|
1064
1211
|
" characters of PreTeXt generated."
|
|
1065
1212
|
] }) : null
|
|
1066
1213
|
] })
|
|
1067
1214
|
}
|
|
1068
1215
|
);
|
|
1069
1216
|
}
|
|
1070
|
-
const
|
|
1217
|
+
const ht = {
|
|
1071
1218
|
title: "Upload Source File",
|
|
1072
1219
|
hint: "Supports .tex, .md, .ptx, .xml, .zip, and .tar.gz files.",
|
|
1073
1220
|
selectButton: "Select File",
|
|
@@ -1075,43 +1222,43 @@ const Qe = {
|
|
|
1075
1222
|
documentKindLabel: "Document kind",
|
|
1076
1223
|
splitSectionsLabel: "Split each chapter into sections"
|
|
1077
1224
|
};
|
|
1078
|
-
function
|
|
1079
|
-
labels:
|
|
1080
|
-
disabled:
|
|
1081
|
-
defaultDocumentKind:
|
|
1082
|
-
importOptions:
|
|
1083
|
-
onImport:
|
|
1225
|
+
function Nt({
|
|
1226
|
+
labels: r,
|
|
1227
|
+
disabled: o = !1,
|
|
1228
|
+
defaultDocumentKind: d = "auto",
|
|
1229
|
+
importOptions: u,
|
|
1230
|
+
onImport: x
|
|
1084
1231
|
}) {
|
|
1085
|
-
const
|
|
1086
|
-
() => ({ ...
|
|
1087
|
-
[
|
|
1088
|
-
),
|
|
1232
|
+
const c = K(
|
|
1233
|
+
() => ({ ...ht, ...r ?? {} }),
|
|
1234
|
+
[r]
|
|
1235
|
+
), N = pe(null), [C, p] = g(!1), [S, T] = g(!1), [y, v] = g(
|
|
1089
1236
|
[]
|
|
1090
|
-
), [
|
|
1091
|
-
|
|
1237
|
+
), [F, P] = g(d), [D, Y] = g(!1), R = o || S, z = async (j) => {
|
|
1238
|
+
T(!0);
|
|
1092
1239
|
try {
|
|
1093
|
-
const
|
|
1094
|
-
documentKind:
|
|
1095
|
-
splitSections:
|
|
1240
|
+
const A = await Fe(j, u ?? {
|
|
1241
|
+
documentKind: F === "auto" ? void 0 : F,
|
|
1242
|
+
splitSections: D
|
|
1096
1243
|
});
|
|
1097
|
-
|
|
1244
|
+
v(A.statusMessages), x(A);
|
|
1098
1245
|
} finally {
|
|
1099
|
-
|
|
1246
|
+
T(!1);
|
|
1100
1247
|
}
|
|
1101
1248
|
};
|
|
1102
1249
|
return /* @__PURE__ */ e.jsxs("section", { "aria-label": "Import upload panel", children: [
|
|
1103
|
-
/* @__PURE__ */ e.jsx("h3", { children:
|
|
1104
|
-
/* @__PURE__ */ e.jsx("p", { children:
|
|
1105
|
-
|
|
1250
|
+
/* @__PURE__ */ e.jsx("h3", { children: c.title }),
|
|
1251
|
+
/* @__PURE__ */ e.jsx("p", { children: c.hint }),
|
|
1252
|
+
u ? null : /* @__PURE__ */ e.jsxs("div", { className: "import-options", children: [
|
|
1106
1253
|
/* @__PURE__ */ e.jsxs("label", { children: [
|
|
1107
|
-
|
|
1254
|
+
c.documentKindLabel,
|
|
1108
1255
|
/* @__PURE__ */ e.jsxs(
|
|
1109
1256
|
"select",
|
|
1110
1257
|
{
|
|
1111
|
-
value:
|
|
1112
|
-
disabled:
|
|
1113
|
-
onChange: (
|
|
1114
|
-
|
|
1258
|
+
value: F,
|
|
1259
|
+
disabled: R,
|
|
1260
|
+
onChange: (j) => P(
|
|
1261
|
+
j.currentTarget.value
|
|
1115
1262
|
),
|
|
1116
1263
|
children: [
|
|
1117
1264
|
/* @__PURE__ */ e.jsx("option", { value: "auto", children: "Auto detect" }),
|
|
@@ -1126,73 +1273,73 @@ function nt({
|
|
|
1126
1273
|
"input",
|
|
1127
1274
|
{
|
|
1128
1275
|
type: "checkbox",
|
|
1129
|
-
checked:
|
|
1130
|
-
disabled:
|
|
1131
|
-
onChange: (
|
|
1276
|
+
checked: D,
|
|
1277
|
+
disabled: R,
|
|
1278
|
+
onChange: (j) => Y(j.currentTarget.checked)
|
|
1132
1279
|
}
|
|
1133
1280
|
),
|
|
1134
|
-
|
|
1281
|
+
c.splitSectionsLabel
|
|
1135
1282
|
] })
|
|
1136
1283
|
] }),
|
|
1137
1284
|
/* @__PURE__ */ e.jsxs(
|
|
1138
1285
|
"div",
|
|
1139
1286
|
{
|
|
1140
|
-
onDragOver: (
|
|
1141
|
-
|
|
1287
|
+
onDragOver: (j) => {
|
|
1288
|
+
j.preventDefault(), R || p(!0);
|
|
1142
1289
|
},
|
|
1143
|
-
onDragLeave: () =>
|
|
1144
|
-
onDrop: (
|
|
1145
|
-
if (
|
|
1290
|
+
onDragLeave: () => p(!1),
|
|
1291
|
+
onDrop: (j) => {
|
|
1292
|
+
if (j.preventDefault(), p(!1), R)
|
|
1146
1293
|
return;
|
|
1147
|
-
const _ =
|
|
1148
|
-
_ &&
|
|
1294
|
+
const _ = j.dataTransfer.files?.[0];
|
|
1295
|
+
_ && z(_);
|
|
1149
1296
|
},
|
|
1150
1297
|
children: [
|
|
1151
|
-
/* @__PURE__ */ e.jsx("p", { children:
|
|
1298
|
+
/* @__PURE__ */ e.jsx("p", { children: c.dropHint }),
|
|
1152
1299
|
/* @__PURE__ */ e.jsxs(
|
|
1153
1300
|
"button",
|
|
1154
1301
|
{
|
|
1155
1302
|
type: "button",
|
|
1156
|
-
disabled:
|
|
1157
|
-
onClick: () =>
|
|
1303
|
+
disabled: R,
|
|
1304
|
+
onClick: () => N.current?.click(),
|
|
1158
1305
|
className: "inline-flex items-center gap-2",
|
|
1159
1306
|
children: [
|
|
1160
|
-
|
|
1307
|
+
S ? /* @__PURE__ */ e.jsx(
|
|
1161
1308
|
"span",
|
|
1162
1309
|
{
|
|
1163
1310
|
className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent",
|
|
1164
1311
|
"aria-hidden": "true"
|
|
1165
1312
|
}
|
|
1166
1313
|
) : null,
|
|
1167
|
-
|
|
1314
|
+
S ? "Processing…" : c.selectButton
|
|
1168
1315
|
]
|
|
1169
1316
|
}
|
|
1170
1317
|
),
|
|
1171
1318
|
/* @__PURE__ */ e.jsx(
|
|
1172
1319
|
"input",
|
|
1173
1320
|
{
|
|
1174
|
-
ref:
|
|
1321
|
+
ref: N,
|
|
1175
1322
|
type: "file",
|
|
1176
1323
|
hidden: !0,
|
|
1177
|
-
disabled:
|
|
1324
|
+
disabled: R,
|
|
1178
1325
|
accept: ".tex,.md,.markdown,.ptx,.xml,.zip,.gz,.tar.gz,.tgz",
|
|
1179
|
-
onChange: (
|
|
1180
|
-
const _ =
|
|
1181
|
-
_ &&
|
|
1326
|
+
onChange: (j) => {
|
|
1327
|
+
const _ = j.currentTarget.files?.[0];
|
|
1328
|
+
_ && z(_), j.currentTarget.value = "";
|
|
1182
1329
|
}
|
|
1183
1330
|
}
|
|
1184
1331
|
)
|
|
1185
1332
|
]
|
|
1186
1333
|
}
|
|
1187
1334
|
),
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1335
|
+
S ? /* @__PURE__ */ e.jsx("p", { role: "status", "aria-live": "polite", children: "Converting your file — this can take a while for a long document." }) : null,
|
|
1336
|
+
y.length > 0 ? /* @__PURE__ */ e.jsx("ul", { "aria-live": "polite", children: y.map((j, _) => /* @__PURE__ */ e.jsx("li", { children: j.message }, `${j.type}-${_}`)) }) : null,
|
|
1337
|
+
C && !R ? /* @__PURE__ */ e.jsx("p", { children: "Release to upload the file." }) : null
|
|
1191
1338
|
] });
|
|
1192
1339
|
}
|
|
1193
1340
|
export {
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1341
|
+
vt as ImportSourceForm,
|
|
1342
|
+
Nt as ImportUploadPanel,
|
|
1343
|
+
jt as ImportWizard,
|
|
1344
|
+
ct as ProcessingPanel
|
|
1198
1345
|
};
|