@pretextbook/import 0.8.0 → 0.10.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/README.md +37 -0
- package/dist/convert-worker.cjs +1 -1
- package/dist/convert-worker.js +1 -1
- package/dist/import-mode-CV7gCDzF.cjs +3 -0
- package/dist/import-mode-DQ8g5P8P.js +122 -0
- package/dist/import.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.ts +10 -6
- package/dist/index.js +524 -214
- package/dist/lib/assets/images.d.ts +49 -0
- package/dist/lib/detect-snippet-format.d.ts +32 -0
- package/dist/lib/import-mode.d.ts +22 -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/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 +45 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react.cjs +2 -2
- package/dist/react.js +655 -498
- package/dist/upload-BnRj1gU1.cjs +135 -0
- package/dist/upload-H_OCZBBn.js +7648 -0
- package/package.json +1 -1
- package/dist/import-mode-BCGuSwkM.js +0 -112
- package/dist/import-mode-D1gOJw3N.cjs +0 -3
- 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 { f as
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
function
|
|
7
|
-
if (
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
var
|
|
12
|
-
if (c !== void 0 && (
|
|
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
13
|
c = {};
|
|
14
|
-
for (var
|
|
15
|
-
|
|
16
|
-
} else c =
|
|
17
|
-
return
|
|
18
|
-
$$typeof:
|
|
19
|
-
type:
|
|
20
|
-
key:
|
|
21
|
-
ref:
|
|
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
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
|
-
case
|
|
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
|
-
|
|
91
|
-
),
|
|
90
|
+
f
|
|
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
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:
|
|
144
|
-
_owner:
|
|
145
|
-
}, (
|
|
142
|
+
key: l,
|
|
143
|
+
props: h,
|
|
144
|
+
_owner: f
|
|
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,125 +159,125 @@ function Le() {
|
|
|
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 (
|
|
173
|
-
if (
|
|
174
|
-
if (
|
|
175
|
-
for (
|
|
176
|
-
|
|
177
|
-
Object.freeze && Object.freeze(
|
|
170
|
+
function T(t, l, h, f, X, H) {
|
|
171
|
+
var b = l.children;
|
|
172
|
+
if (b !== void 0)
|
|
173
|
+
if (f)
|
|
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
|
|
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
|
-
|
|
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} />
|
|
192
192
|
React keys must be passed directly to JSX without using spread:
|
|
193
193
|
let props = %s;
|
|
194
194
|
<%s key={someKey} {...props} />`,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
),
|
|
195
|
+
f,
|
|
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
|
-
|
|
232
|
+
var G, J = {}, se = F.react_stack_bottom_frame.bind(
|
|
233
|
+
F,
|
|
234
234
|
c
|
|
235
|
-
)(),
|
|
236
|
-
|
|
237
|
-
var
|
|
238
|
-
return
|
|
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
|
-
|
|
244
|
-
|
|
243
|
+
f ? Error("react-stack-top-frame") : se,
|
|
244
|
+
f ? te(u(t)) : M
|
|
245
245
|
);
|
|
246
|
-
},
|
|
247
|
-
var
|
|
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
|
-
|
|
254
|
-
|
|
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 Me({
|
|
|
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 Me({
|
|
|
302
302
|
}
|
|
303
303
|
);
|
|
304
304
|
}
|
|
305
|
-
const
|
|
305
|
+
const Oe = [
|
|
306
306
|
".tex",
|
|
307
307
|
".md",
|
|
308
308
|
".markdown",
|
|
@@ -312,185 +312,208 @@ const we = [
|
|
|
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
|
-
|
|
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
|
|
364
368
|
}) {
|
|
365
|
-
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(
|
|
366
370
|
"auto"
|
|
367
|
-
), [
|
|
368
|
-
() =>
|
|
369
|
-
|
|
370
|
-
|
|
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(
|
|
371
382
|
() => new Map(
|
|
372
|
-
|
|
383
|
+
de ? tt(de).map((n) => [n.path, n]) : []
|
|
373
384
|
),
|
|
374
|
-
[
|
|
375
|
-
),
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
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" }
|
|
383
406
|
);
|
|
384
|
-
},
|
|
385
|
-
|
|
407
|
+
}, Me = async (n) => {
|
|
408
|
+
b.current = !1, v({ name: "processing" }), await Ne();
|
|
386
409
|
try {
|
|
387
|
-
const
|
|
388
|
-
path:
|
|
389
|
-
include:
|
|
390
|
-
level:
|
|
391
|
-
})),
|
|
392
|
-
|
|
393
|
-
sourceFormat:
|
|
394
|
-
mainFile:
|
|
395
|
-
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
|
|
396
419
|
});
|
|
397
|
-
"pretextError" in
|
|
398
|
-
} catch (
|
|
399
|
-
if (
|
|
420
|
+
"pretextError" in k ? v({ name: "error", message: k.pretextError }) : v({ name: "review", result: k });
|
|
421
|
+
} catch (i) {
|
|
422
|
+
if (b.current)
|
|
400
423
|
return;
|
|
401
|
-
|
|
424
|
+
v({
|
|
402
425
|
name: "error",
|
|
403
|
-
message:
|
|
426
|
+
message: i instanceof Error ? i.message : "An unexpected error occurred."
|
|
404
427
|
});
|
|
405
428
|
}
|
|
406
|
-
},
|
|
407
|
-
|
|
429
|
+
}, ke = async (n) => {
|
|
430
|
+
b.current = !1, v({ name: "processing" }), await Ne();
|
|
408
431
|
try {
|
|
409
|
-
if (
|
|
410
|
-
const
|
|
411
|
-
if (
|
|
412
|
-
|
|
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 });
|
|
413
436
|
return;
|
|
414
437
|
}
|
|
415
|
-
await
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
438
|
+
await Ne();
|
|
439
|
+
const k = await E.convertPrepared(
|
|
440
|
+
a,
|
|
441
|
+
ge()
|
|
419
442
|
);
|
|
420
|
-
|
|
421
|
-
"pretextError" in
|
|
443
|
+
v(
|
|
444
|
+
"pretextError" in k ? { name: "error", message: k.pretextError } : { name: "review", result: k }
|
|
422
445
|
);
|
|
423
446
|
return;
|
|
424
447
|
}
|
|
425
|
-
const
|
|
426
|
-
"pretextError" in
|
|
427
|
-
} catch (
|
|
428
|
-
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)
|
|
429
452
|
return;
|
|
430
|
-
|
|
453
|
+
v({
|
|
431
454
|
name: "error",
|
|
432
|
-
message:
|
|
455
|
+
message: i instanceof Error ? i.message : "An unexpected error occurred."
|
|
433
456
|
});
|
|
434
457
|
}
|
|
435
|
-
},
|
|
436
|
-
|
|
458
|
+
}, je = () => {
|
|
459
|
+
v({ name: "upload" }), q(x), ie(!1), G(/* @__PURE__ */ new Set()), ce(/* @__PURE__ */ new Set()), z(null), _(null), ee([]), se(null);
|
|
437
460
|
};
|
|
438
|
-
function
|
|
439
|
-
return [...
|
|
461
|
+
function Ee(n, i) {
|
|
462
|
+
return [...n].sort((a, k) => a === i ? -1 : k === i ? 1 : a.localeCompare(k));
|
|
440
463
|
}
|
|
441
|
-
function
|
|
442
|
-
const
|
|
443
|
-
|
|
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());
|
|
444
467
|
}
|
|
445
|
-
function
|
|
446
|
-
|
|
447
|
-
const
|
|
448
|
-
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;
|
|
449
472
|
});
|
|
450
473
|
}
|
|
451
|
-
if (
|
|
474
|
+
if (y.name === "processing")
|
|
452
475
|
return /* @__PURE__ */ e.jsx(
|
|
453
|
-
|
|
476
|
+
ct,
|
|
454
477
|
{
|
|
455
|
-
onCancel:
|
|
478
|
+
onCancel: E.cancel ? () => $e(J) : void 0
|
|
456
479
|
}
|
|
457
480
|
);
|
|
458
|
-
if (
|
|
481
|
+
if (y.name === "error")
|
|
459
482
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
460
483
|
/* @__PURE__ */ e.jsxs("div", { className: "rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-800", children: [
|
|
461
484
|
/* @__PURE__ */ e.jsx("p", { className: "font-semibold", children: "Import failed" }),
|
|
462
|
-
/* @__PURE__ */ e.jsx("p", { className: "mt-1", children:
|
|
485
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1", children: y.message })
|
|
463
486
|
] }),
|
|
464
487
|
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(
|
|
465
488
|
"button",
|
|
466
489
|
{
|
|
467
490
|
type: "button",
|
|
468
|
-
onClick:
|
|
491
|
+
onClick: je,
|
|
469
492
|
className: "rounded bg-blue-700 px-4 py-2 text-sm font-medium text-white hover:bg-blue-600",
|
|
470
493
|
children: "Try Another File"
|
|
471
494
|
}
|
|
472
495
|
) })
|
|
473
496
|
] });
|
|
474
|
-
if (
|
|
475
|
-
const
|
|
497
|
+
if (y.name === "sources") {
|
|
498
|
+
const n = y.prepared, i = we(n), a = i.manifest, k = i.primary?.path ?? "";
|
|
476
499
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
477
500
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
478
501
|
/* @__PURE__ */ e.jsx("h3", { className: "text-sm font-semibold text-slate-700", children: "Choose what to import" }),
|
|
479
502
|
/* @__PURE__ */ e.jsxs("p", { className: "mt-1 text-sm text-slate-500", children: [
|
|
480
|
-
|
|
503
|
+
n.fileName,
|
|
481
504
|
" contains more than one possible starting point."
|
|
482
505
|
] })
|
|
483
506
|
] }),
|
|
484
|
-
|
|
507
|
+
a ? /* @__PURE__ */ e.jsxs("div", { className: "rounded-lg border border-blue-200 bg-blue-50 p-4 text-sm text-blue-900", children: [
|
|
485
508
|
/* @__PURE__ */ e.jsxs("p", { className: "font-medium", children: [
|
|
486
509
|
"Found ",
|
|
487
|
-
|
|
510
|
+
a.manifestPath,
|
|
488
511
|
" — an existing PreTeXt project."
|
|
489
512
|
] }),
|
|
490
513
|
/* @__PURE__ */ e.jsxs("p", { className: "mt-1 text-blue-800", children: [
|
|
491
514
|
"Its publication file, assets, and directory layout will be kept as they are. Targets:",
|
|
492
515
|
" ",
|
|
493
|
-
|
|
516
|
+
a.targets.map((m) => m.name).join(", "),
|
|
494
517
|
"."
|
|
495
518
|
] })
|
|
496
519
|
] }) : null,
|
|
@@ -499,24 +522,24 @@ function Ge({
|
|
|
499
522
|
/* @__PURE__ */ e.jsxs(
|
|
500
523
|
"select",
|
|
501
524
|
{
|
|
502
|
-
value:
|
|
503
|
-
onChange: (
|
|
504
|
-
|
|
525
|
+
value: M,
|
|
526
|
+
onChange: (m) => {
|
|
527
|
+
re(m.currentTarget.value), l(null), f({});
|
|
505
528
|
},
|
|
506
529
|
className: "rounded border border-slate-300 px-2 py-1 text-sm",
|
|
507
530
|
children: [
|
|
508
531
|
/* @__PURE__ */ e.jsxs("option", { value: "auto", children: [
|
|
509
532
|
"Auto detect",
|
|
510
|
-
|
|
533
|
+
i.primary ? ` (${Ae[i.primary.format]})` : ""
|
|
511
534
|
] }),
|
|
512
|
-
|
|
535
|
+
i.formats.map((m) => /* @__PURE__ */ e.jsx("option", { value: m, children: Ae[m] }, m))
|
|
513
536
|
]
|
|
514
537
|
}
|
|
515
538
|
)
|
|
516
539
|
] }) }),
|
|
517
|
-
|
|
540
|
+
i.candidates.length > 1 ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
|
|
518
541
|
/* @__PURE__ */ e.jsx("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: "Main document" }),
|
|
519
|
-
/* @__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(
|
|
520
543
|
"label",
|
|
521
544
|
{
|
|
522
545
|
className: "flex cursor-pointer items-start gap-3 text-sm",
|
|
@@ -526,28 +549,28 @@ function Ge({
|
|
|
526
549
|
{
|
|
527
550
|
type: "radio",
|
|
528
551
|
name: "main-file",
|
|
529
|
-
value:
|
|
530
|
-
checked:
|
|
552
|
+
value: m.path,
|
|
553
|
+
checked: k === m.path,
|
|
531
554
|
onChange: () => {
|
|
532
|
-
|
|
555
|
+
l(m.path), f({});
|
|
533
556
|
},
|
|
534
557
|
className: "mt-0.5"
|
|
535
558
|
}
|
|
536
559
|
),
|
|
537
560
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
538
|
-
/* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs text-slate-900", children:
|
|
539
|
-
/* @__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) })
|
|
540
563
|
] })
|
|
541
564
|
]
|
|
542
565
|
},
|
|
543
|
-
|
|
566
|
+
m.path
|
|
544
567
|
)) })
|
|
545
568
|
] }) : null,
|
|
546
|
-
|
|
569
|
+
i.extraRoots.length > 0 ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
|
|
547
570
|
/* @__PURE__ */ e.jsx("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: "Other documents" }),
|
|
548
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." }),
|
|
549
|
-
/* @__PURE__ */ e.jsx("div", { className: "mt-3 flex flex-col gap-2", children:
|
|
550
|
-
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;
|
|
551
574
|
return /* @__PURE__ */ e.jsxs(
|
|
552
575
|
"div",
|
|
553
576
|
{
|
|
@@ -558,20 +581,20 @@ function Ge({
|
|
|
558
581
|
"input",
|
|
559
582
|
{
|
|
560
583
|
type: "checkbox",
|
|
561
|
-
checked:
|
|
562
|
-
onChange: (
|
|
563
|
-
...
|
|
564
|
-
[
|
|
565
|
-
...
|
|
566
|
-
include:
|
|
584
|
+
checked: L,
|
|
585
|
+
onChange: (W) => f((I) => ({
|
|
586
|
+
...I,
|
|
587
|
+
[m.path]: {
|
|
588
|
+
...I[m.path],
|
|
589
|
+
include: W.currentTarget.checked
|
|
567
590
|
}
|
|
568
591
|
}))
|
|
569
592
|
}
|
|
570
593
|
),
|
|
571
|
-
/* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs text-slate-900", children:
|
|
572
|
-
|
|
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: [
|
|
573
596
|
"— ",
|
|
574
|
-
|
|
597
|
+
m.title
|
|
575
598
|
] }) : null
|
|
576
599
|
] }),
|
|
577
600
|
/* @__PURE__ */ e.jsxs("label", { className: "flex items-center gap-2 text-slate-700", children: [
|
|
@@ -579,13 +602,13 @@ function Ge({
|
|
|
579
602
|
/* @__PURE__ */ e.jsxs(
|
|
580
603
|
"select",
|
|
581
604
|
{
|
|
582
|
-
value:
|
|
583
|
-
disabled: !
|
|
584
|
-
onChange: (
|
|
585
|
-
...
|
|
586
|
-
[
|
|
587
|
-
include:
|
|
588
|
-
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
|
|
589
612
|
}
|
|
590
613
|
})),
|
|
591
614
|
className: "rounded border border-slate-300 px-2 py-1 text-sm disabled:opacity-50",
|
|
@@ -599,7 +622,7 @@ function Ge({
|
|
|
599
622
|
] })
|
|
600
623
|
]
|
|
601
624
|
},
|
|
602
|
-
|
|
625
|
+
m.path
|
|
603
626
|
);
|
|
604
627
|
}) })
|
|
605
628
|
] }) : null,
|
|
@@ -608,7 +631,7 @@ function Ge({
|
|
|
608
631
|
"button",
|
|
609
632
|
{
|
|
610
633
|
type: "button",
|
|
611
|
-
onClick:
|
|
634
|
+
onClick: je,
|
|
612
635
|
className: "px-4 py-2 text-sm text-slate-600 hover:text-slate-900",
|
|
613
636
|
children: "Start Over"
|
|
614
637
|
}
|
|
@@ -617,7 +640,7 @@ function Ge({
|
|
|
617
640
|
"button",
|
|
618
641
|
{
|
|
619
642
|
type: "button",
|
|
620
|
-
onClick: () =>
|
|
643
|
+
onClick: () => Me(n),
|
|
621
644
|
className: "rounded bg-blue-700 px-4 py-2 text-sm font-medium text-white hover:bg-blue-600",
|
|
622
645
|
children: "Continue"
|
|
623
646
|
}
|
|
@@ -625,56 +648,63 @@ function Ge({
|
|
|
625
648
|
] })
|
|
626
649
|
] });
|
|
627
650
|
}
|
|
628
|
-
if (
|
|
629
|
-
let
|
|
630
|
-
|
|
631
|
-
},
|
|
632
|
-
|
|
633
|
-
const
|
|
634
|
-
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;
|
|
635
658
|
});
|
|
636
659
|
};
|
|
637
|
-
const
|
|
638
|
-
Object.keys(
|
|
639
|
-
|
|
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
|
|
640
663
|
);
|
|
641
664
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
642
665
|
/* @__PURE__ */ e.jsxs("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-4", children: [
|
|
643
666
|
/* @__PURE__ */ e.jsx("h3", { className: "mb-3 text-sm font-semibold text-slate-700", children: "Import Summary" }),
|
|
644
667
|
/* @__PURE__ */ e.jsxs("dl", { className: "grid grid-cols-2 gap-x-6 gap-y-2 text-sm", children: [
|
|
645
668
|
/* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Source" }),
|
|
646
|
-
/* @__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 }),
|
|
647
670
|
/* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Detected format" }),
|
|
648
|
-
/* @__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 }),
|
|
649
672
|
/* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Document kind" }),
|
|
650
|
-
/* @__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 }),
|
|
651
674
|
/* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Output files" }),
|
|
652
|
-
/* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900", children:
|
|
653
|
-
|
|
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: [
|
|
654
684
|
/* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Existing project" }),
|
|
655
685
|
/* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900", children: "Kept publication file, assets, and layout" })
|
|
656
686
|
] }) : null,
|
|
657
|
-
|
|
687
|
+
a.attachedRoots.length > 0 ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
658
688
|
/* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Attached" }),
|
|
659
|
-
/* @__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(", ") })
|
|
660
690
|
] }) : null
|
|
661
691
|
] })
|
|
662
692
|
] }),
|
|
663
|
-
|
|
693
|
+
I > 0 ? /* @__PURE__ */ e.jsxs("details", { className: "rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm", children: [
|
|
664
694
|
/* @__PURE__ */ e.jsxs("summary", { className: "cursor-pointer font-semibold text-amber-800", children: [
|
|
665
|
-
|
|
695
|
+
I,
|
|
666
696
|
" conversion",
|
|
667
697
|
" ",
|
|
668
|
-
|
|
698
|
+
I === 1 ? "warning" : "warnings"
|
|
669
699
|
] }),
|
|
670
|
-
/* @__PURE__ */ e.jsx("ul", { className: "mt-3 space-y-1.5 text-amber-700", children:
|
|
671
|
-
/* @__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 }),
|
|
672
702
|
" — ",
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
] },
|
|
703
|
+
s.action === "replace" || s.action === "rewrite" ? `replaced with \`${s.replacement}\`` : s.message ?? s.action,
|
|
704
|
+
s.occurrences > 1 ? ` (×${s.occurrences})` : null
|
|
705
|
+
] }, w)) })
|
|
676
706
|
] }) : /* @__PURE__ */ e.jsx("p", { className: "text-sm text-green-700", children: "No conversion warnings." }),
|
|
677
|
-
|
|
707
|
+
ne && !c ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
|
|
678
708
|
/* @__PURE__ */ e.jsx("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: "Import mode" }),
|
|
679
709
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-col gap-3", children: [
|
|
680
710
|
/* @__PURE__ */ e.jsxs("label", { className: "flex cursor-pointer items-start gap-3 text-sm", children: [
|
|
@@ -684,8 +714,8 @@ function Ge({
|
|
|
684
714
|
type: "radio",
|
|
685
715
|
name: "import-mode",
|
|
686
716
|
value: "converted",
|
|
687
|
-
checked:
|
|
688
|
-
onChange: () =>
|
|
717
|
+
checked: L === "converted",
|
|
718
|
+
onChange: () => n("converted"),
|
|
689
719
|
className: "mt-0.5"
|
|
690
720
|
}
|
|
691
721
|
),
|
|
@@ -701,52 +731,124 @@ function Ge({
|
|
|
701
731
|
type: "radio",
|
|
702
732
|
name: "import-mode",
|
|
703
733
|
value: "native",
|
|
704
|
-
checked:
|
|
705
|
-
onChange: () =>
|
|
734
|
+
checked: L === "native",
|
|
735
|
+
onChange: () => n("native"),
|
|
706
736
|
className: "mt-0.5"
|
|
707
737
|
}
|
|
708
738
|
),
|
|
709
739
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
710
|
-
/* @__PURE__ */ e.
|
|
711
|
-
|
|
740
|
+
/* @__PURE__ */ e.jsxs("span", { className: "font-medium text-slate-900", children: [
|
|
741
|
+
"Keep as ",
|
|
742
|
+
W
|
|
743
|
+
] }),
|
|
744
|
+
/* @__PURE__ */ e.jsxs("span", { className: "block text-slate-500", children: [
|
|
745
|
+
"Preserve the original ",
|
|
746
|
+
W,
|
|
747
|
+
" source. The conversion will not be applied."
|
|
748
|
+
] })
|
|
712
749
|
] })
|
|
713
750
|
] })
|
|
714
751
|
] })
|
|
715
752
|
] }) : null,
|
|
716
|
-
|
|
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: [
|
|
717
819
|
/* @__PURE__ */ e.jsx("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: "Split into files" }),
|
|
718
820
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: [
|
|
719
821
|
Array.from(
|
|
720
|
-
{ length:
|
|
721
|
-
(
|
|
822
|
+
{ length: Ge + 1 },
|
|
823
|
+
(s, w) => /* @__PURE__ */ e.jsx(
|
|
722
824
|
"button",
|
|
723
825
|
{
|
|
724
826
|
type: "button",
|
|
725
|
-
onClick: () =>
|
|
726
|
-
"aria-pressed":
|
|
727
|
-
className:
|
|
728
|
-
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"}`
|
|
729
831
|
},
|
|
730
|
-
|
|
832
|
+
w
|
|
731
833
|
)
|
|
732
834
|
),
|
|
733
835
|
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 text-sm text-slate-500", children: [
|
|
734
|
-
|
|
836
|
+
me.length,
|
|
735
837
|
" file",
|
|
736
|
-
|
|
838
|
+
me.length === 1 ? "" : "s"
|
|
737
839
|
] })
|
|
738
840
|
] }),
|
|
739
|
-
/* @__PURE__ */ e.jsx("ul", { className: "mt-3 max-h-48 overflow-auto font-mono text-xs text-slate-600", children:
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
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,
|
|
743
845
|
" change",
|
|
744
|
-
|
|
846
|
+
U.get(s).fixCount === 1 ? "" : "s"
|
|
745
847
|
] }) : null
|
|
746
|
-
] },
|
|
848
|
+
] }, s)) })
|
|
747
849
|
] }) : null,
|
|
748
|
-
|
|
749
|
-
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);
|
|
750
852
|
return /* @__PURE__ */ e.jsxs(
|
|
751
853
|
"div",
|
|
752
854
|
{
|
|
@@ -756,42 +858,42 @@ function Ge({
|
|
|
756
858
|
"button",
|
|
757
859
|
{
|
|
758
860
|
type: "button",
|
|
759
|
-
onClick: () =>
|
|
861
|
+
onClick: () => Xe(s),
|
|
760
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",
|
|
761
863
|
children: [
|
|
762
|
-
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-slate-400", children:
|
|
763
|
-
/* @__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 }),
|
|
764
866
|
/* @__PURE__ */ e.jsxs("span", { className: "shrink-0 text-slate-400", children: [
|
|
765
|
-
(
|
|
867
|
+
(ve[s].length / 1024).toFixed(1),
|
|
766
868
|
" KB"
|
|
767
869
|
] })
|
|
768
870
|
]
|
|
769
871
|
}
|
|
770
872
|
),
|
|
771
|
-
|
|
772
|
-
|
|
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: [
|
|
773
875
|
/* @__PURE__ */ e.jsx(
|
|
774
876
|
"button",
|
|
775
877
|
{
|
|
776
878
|
type: "button",
|
|
777
|
-
onClick: () =>
|
|
879
|
+
onClick: () => i(s),
|
|
778
880
|
className: "rounded border border-slate-300 px-2 py-0.5 text-xs text-slate-700 hover:bg-slate-50",
|
|
779
|
-
children:
|
|
881
|
+
children: oe.has(s) ? "Show converted file" : "Show what changed"
|
|
780
882
|
}
|
|
781
883
|
),
|
|
782
884
|
/* @__PURE__ */ e.jsxs("span", { className: "text-xs text-slate-500", children: [
|
|
783
885
|
"+",
|
|
784
|
-
|
|
886
|
+
U.get(s).stats.added,
|
|
785
887
|
" −",
|
|
786
|
-
|
|
888
|
+
U.get(s).stats.removed,
|
|
787
889
|
" in the LaTeX source"
|
|
788
890
|
] })
|
|
789
891
|
] }) : null,
|
|
790
|
-
|
|
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] })
|
|
791
893
|
] }) : null
|
|
792
894
|
]
|
|
793
895
|
},
|
|
794
|
-
|
|
896
|
+
s
|
|
795
897
|
);
|
|
796
898
|
}) }) : null,
|
|
797
899
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-3 pt-1", children: [
|
|
@@ -799,17 +901,17 @@ function Ge({
|
|
|
799
901
|
"button",
|
|
800
902
|
{
|
|
801
903
|
type: "button",
|
|
802
|
-
onClick:
|
|
904
|
+
onClick: o ?? je,
|
|
803
905
|
className: "px-4 py-2 text-sm text-slate-600 hover:text-slate-900",
|
|
804
|
-
children:
|
|
906
|
+
children: o ? "Cancel" : "Start Over"
|
|
805
907
|
}
|
|
806
908
|
),
|
|
807
909
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
808
|
-
|
|
910
|
+
J ? /* @__PURE__ */ e.jsx(
|
|
809
911
|
"button",
|
|
810
912
|
{
|
|
811
913
|
type: "button",
|
|
812
|
-
onClick: () =>
|
|
914
|
+
onClick: () => v({ name: "sources", prepared: J }),
|
|
813
915
|
className: "rounded border border-slate-300 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50",
|
|
814
916
|
children: "Change Sources"
|
|
815
917
|
}
|
|
@@ -819,29 +921,29 @@ function Ge({
|
|
|
819
921
|
{
|
|
820
922
|
type: "button",
|
|
821
923
|
onClick: () => {
|
|
822
|
-
|
|
924
|
+
B || Te(a, L), ie((s) => !s);
|
|
823
925
|
},
|
|
824
926
|
className: "rounded border border-slate-300 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50",
|
|
825
|
-
children:
|
|
927
|
+
children: B ? "Hide Preview" : "Preview"
|
|
826
928
|
}
|
|
827
929
|
),
|
|
828
930
|
/* @__PURE__ */ e.jsxs(
|
|
829
931
|
"button",
|
|
830
932
|
{
|
|
831
933
|
type: "button",
|
|
832
|
-
disabled:
|
|
934
|
+
disabled: X,
|
|
833
935
|
onClick: async () => {
|
|
834
|
-
|
|
936
|
+
H(!0);
|
|
835
937
|
try {
|
|
836
|
-
await
|
|
938
|
+
await r(a, L);
|
|
837
939
|
} finally {
|
|
838
|
-
|
|
940
|
+
H(!1);
|
|
839
941
|
}
|
|
840
942
|
},
|
|
841
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",
|
|
842
944
|
children: [
|
|
843
|
-
|
|
844
|
-
|
|
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"
|
|
845
947
|
]
|
|
846
948
|
}
|
|
847
949
|
)
|
|
@@ -850,9 +952,9 @@ function Ge({
|
|
|
850
952
|
] });
|
|
851
953
|
}
|
|
852
954
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
853
|
-
|
|
955
|
+
S.length > 1 ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
|
|
854
956
|
/* @__PURE__ */ e.jsx("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: "Converter" }),
|
|
855
|
-
/* @__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(
|
|
856
958
|
"label",
|
|
857
959
|
{
|
|
858
960
|
className: "flex cursor-pointer items-start gap-3 text-sm",
|
|
@@ -862,29 +964,29 @@ function Ge({
|
|
|
862
964
|
{
|
|
863
965
|
type: "radio",
|
|
864
966
|
name: "import-engine",
|
|
865
|
-
value:
|
|
866
|
-
checked:
|
|
867
|
-
onChange: () =>
|
|
967
|
+
value: n.id,
|
|
968
|
+
checked: V === n.id,
|
|
969
|
+
onChange: () => he(n.id),
|
|
868
970
|
className: "mt-0.5"
|
|
869
971
|
}
|
|
870
972
|
),
|
|
871
973
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
872
|
-
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-slate-900", children:
|
|
873
|
-
|
|
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
|
|
874
976
|
] })
|
|
875
977
|
]
|
|
876
978
|
},
|
|
877
|
-
|
|
979
|
+
n.id
|
|
878
980
|
)) })
|
|
879
981
|
] }) : null,
|
|
880
|
-
|
|
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: [
|
|
881
983
|
/* @__PURE__ */ e.jsx("span", { className: "text-slate-500", children: "Document kind" }),
|
|
882
984
|
/* @__PURE__ */ e.jsxs(
|
|
883
985
|
"select",
|
|
884
986
|
{
|
|
885
|
-
value:
|
|
886
|
-
onChange: (
|
|
887
|
-
|
|
987
|
+
value: D,
|
|
988
|
+
onChange: (n) => Y(
|
|
989
|
+
n.currentTarget.value
|
|
888
990
|
),
|
|
889
991
|
className: "rounded border border-slate-300 px-2 py-1 text-sm",
|
|
890
992
|
children: [
|
|
@@ -900,26 +1002,26 @@ function Ge({
|
|
|
900
1002
|
{
|
|
901
1003
|
role: "button",
|
|
902
1004
|
tabIndex: 0,
|
|
903
|
-
onKeyDown: (
|
|
904
|
-
onClick: () =>
|
|
905
|
-
onDragOver: (
|
|
906
|
-
|
|
1005
|
+
onKeyDown: (n) => n.key === "Enter" && T.current?.click(),
|
|
1006
|
+
onClick: () => T.current?.click(),
|
|
1007
|
+
onDragOver: (n) => {
|
|
1008
|
+
n.preventDefault(), P(!0);
|
|
907
1009
|
},
|
|
908
|
-
onDragLeave: () =>
|
|
909
|
-
onDrop: (
|
|
910
|
-
|
|
911
|
-
const
|
|
912
|
-
|
|
1010
|
+
onDragLeave: () => P(!1),
|
|
1011
|
+
onDrop: (n) => {
|
|
1012
|
+
n.preventDefault(), P(!1);
|
|
1013
|
+
const i = n.dataTransfer.files?.[0];
|
|
1014
|
+
i && ke(i);
|
|
913
1015
|
},
|
|
914
|
-
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"}`,
|
|
915
1017
|
children: [
|
|
916
1018
|
/* @__PURE__ */ e.jsx("p", { className: "text-slate-600", children: "Drop a file here, or click to select." }),
|
|
917
1019
|
/* @__PURE__ */ e.jsx(
|
|
918
1020
|
"button",
|
|
919
1021
|
{
|
|
920
1022
|
type: "button",
|
|
921
|
-
onClick: (
|
|
922
|
-
|
|
1023
|
+
onClick: (n) => {
|
|
1024
|
+
n.stopPropagation(), T.current?.click();
|
|
923
1025
|
},
|
|
924
1026
|
className: "rounded bg-blue-700 px-4 py-2 text-sm font-medium text-white hover:bg-blue-600",
|
|
925
1027
|
children: "Select File"
|
|
@@ -927,18 +1029,18 @@ function Ge({
|
|
|
927
1029
|
),
|
|
928
1030
|
/* @__PURE__ */ e.jsxs("p", { className: "text-xs text-slate-400", children: [
|
|
929
1031
|
"Supports ",
|
|
930
|
-
|
|
1032
|
+
Z.join(", ")
|
|
931
1033
|
] }),
|
|
932
1034
|
/* @__PURE__ */ e.jsx(
|
|
933
1035
|
"input",
|
|
934
1036
|
{
|
|
935
|
-
ref:
|
|
1037
|
+
ref: T,
|
|
936
1038
|
type: "file",
|
|
937
1039
|
hidden: !0,
|
|
938
|
-
accept:
|
|
939
|
-
onChange: (
|
|
940
|
-
const
|
|
941
|
-
|
|
1040
|
+
accept: Z.join(","),
|
|
1041
|
+
onChange: (n) => {
|
|
1042
|
+
const i = n.currentTarget.files?.[0];
|
|
1043
|
+
i && ke(i), n.currentTarget.value = "";
|
|
942
1044
|
}
|
|
943
1045
|
}
|
|
944
1046
|
)
|
|
@@ -947,23 +1049,78 @@ function Ge({
|
|
|
947
1049
|
)
|
|
948
1050
|
] });
|
|
949
1051
|
}
|
|
950
|
-
function
|
|
951
|
-
return
|
|
952
|
-
|
|
953
|
-
|
|
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(
|
|
954
1111
|
"div",
|
|
955
1112
|
{
|
|
956
|
-
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",
|
|
957
1114
|
children: [
|
|
958
|
-
/* @__PURE__ */ e.jsx("span", { className: "mr-2 select-none text-slate-400", children:
|
|
959
|
-
|
|
1115
|
+
/* @__PURE__ */ e.jsx("span", { className: "mr-2 select-none text-slate-400", children: u.op === "add" ? "+" : u.op === "remove" ? "−" : " " }),
|
|
1116
|
+
u.text || " "
|
|
960
1117
|
]
|
|
961
1118
|
},
|
|
962
|
-
|
|
1119
|
+
x
|
|
963
1120
|
))
|
|
964
|
-
] },
|
|
1121
|
+
] }, d)) });
|
|
965
1122
|
}
|
|
966
|
-
const
|
|
1123
|
+
const pt = {
|
|
967
1124
|
title: "Import Source Content",
|
|
968
1125
|
description: "Paste LaTeX, Markdown, or PreTeXt source to convert into PreTeXt.",
|
|
969
1126
|
sourceLabel: "Source",
|
|
@@ -974,37 +1131,37 @@ const Be = {
|
|
|
974
1131
|
successPrefix: "Ready",
|
|
975
1132
|
errorPrefix: "Error"
|
|
976
1133
|
};
|
|
977
|
-
function
|
|
978
|
-
initialSource:
|
|
979
|
-
initialSourceFormat:
|
|
980
|
-
labels:
|
|
981
|
-
disabled:
|
|
982
|
-
onImport:
|
|
1134
|
+
function vt({
|
|
1135
|
+
initialSource: r = "",
|
|
1136
|
+
initialSourceFormat: o,
|
|
1137
|
+
labels: d,
|
|
1138
|
+
disabled: u = !1,
|
|
1139
|
+
onImport: x
|
|
983
1140
|
}) {
|
|
984
|
-
const c =
|
|
985
|
-
() => ({ ...
|
|
986
|
-
[
|
|
987
|
-
), [
|
|
988
|
-
|
|
989
|
-
), [
|
|
1141
|
+
const c = K(
|
|
1142
|
+
() => ({ ...pt, ...d ?? {} }),
|
|
1143
|
+
[d]
|
|
1144
|
+
), [N, C] = g(r), [p, S] = g(
|
|
1145
|
+
o ?? "auto"
|
|
1146
|
+
), [T, y] = g(
|
|
990
1147
|
null
|
|
991
|
-
),
|
|
992
|
-
() =>
|
|
993
|
-
[
|
|
994
|
-
),
|
|
1148
|
+
), v = K(
|
|
1149
|
+
() => Ze(N),
|
|
1150
|
+
[N]
|
|
1151
|
+
), F = u || !N.trim();
|
|
995
1152
|
return /* @__PURE__ */ e.jsx(
|
|
996
1153
|
"form",
|
|
997
1154
|
{
|
|
998
|
-
onSubmit: (
|
|
999
|
-
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1002
|
-
|
|
1155
|
+
onSubmit: (P) => {
|
|
1156
|
+
P.preventDefault();
|
|
1157
|
+
const D = Qe(
|
|
1158
|
+
N,
|
|
1159
|
+
p === "auto" ? void 0 : p
|
|
1003
1160
|
);
|
|
1004
|
-
|
|
1161
|
+
y(D), x(D);
|
|
1005
1162
|
},
|
|
1006
1163
|
"aria-label": "Import source form",
|
|
1007
|
-
children: /* @__PURE__ */ e.jsxs("fieldset", { disabled:
|
|
1164
|
+
children: /* @__PURE__ */ e.jsxs("fieldset", { disabled: u, children: [
|
|
1008
1165
|
/* @__PURE__ */ e.jsx("legend", { children: c.title }),
|
|
1009
1166
|
/* @__PURE__ */ e.jsx("p", { children: c.description }),
|
|
1010
1167
|
/* @__PURE__ */ e.jsxs("label", { children: [
|
|
@@ -1012,8 +1169,8 @@ function Je({
|
|
|
1012
1169
|
/* @__PURE__ */ e.jsx(
|
|
1013
1170
|
"textarea",
|
|
1014
1171
|
{
|
|
1015
|
-
value:
|
|
1016
|
-
onChange: (
|
|
1172
|
+
value: N,
|
|
1173
|
+
onChange: (P) => C(P.currentTarget.value),
|
|
1017
1174
|
placeholder: c.sourcePlaceholder,
|
|
1018
1175
|
rows: 12
|
|
1019
1176
|
}
|
|
@@ -1024,9 +1181,9 @@ function Je({
|
|
|
1024
1181
|
/* @__PURE__ */ e.jsxs(
|
|
1025
1182
|
"select",
|
|
1026
1183
|
{
|
|
1027
|
-
value:
|
|
1028
|
-
onChange: (
|
|
1029
|
-
|
|
1184
|
+
value: p,
|
|
1185
|
+
onChange: (P) => S(
|
|
1186
|
+
P.currentTarget.value
|
|
1030
1187
|
),
|
|
1031
1188
|
children: [
|
|
1032
1189
|
/* @__PURE__ */ e.jsx("option", { value: "auto", children: "Auto detect" }),
|
|
@@ -1040,24 +1197,24 @@ function Je({
|
|
|
1040
1197
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
1041
1198
|
c.detectedFormatPrefix,
|
|
1042
1199
|
": ",
|
|
1043
|
-
/* @__PURE__ */ e.jsx("strong", { children:
|
|
1200
|
+
/* @__PURE__ */ e.jsx("strong", { children: v })
|
|
1044
1201
|
] }),
|
|
1045
|
-
/* @__PURE__ */ e.jsx("button", { type: "submit", disabled:
|
|
1046
|
-
|
|
1202
|
+
/* @__PURE__ */ e.jsx("button", { type: "submit", disabled: F, children: c.convertButton }),
|
|
1203
|
+
T ? "pretextError" in T ? /* @__PURE__ */ e.jsxs("p", { role: "alert", children: [
|
|
1047
1204
|
c.errorPrefix,
|
|
1048
1205
|
": ",
|
|
1049
|
-
|
|
1206
|
+
T.pretextError
|
|
1050
1207
|
] }) : /* @__PURE__ */ e.jsxs("p", { children: [
|
|
1051
1208
|
c.successPrefix,
|
|
1052
1209
|
": ",
|
|
1053
|
-
|
|
1210
|
+
T.pretextSource.length,
|
|
1054
1211
|
" characters of PreTeXt generated."
|
|
1055
1212
|
] }) : null
|
|
1056
1213
|
] })
|
|
1057
1214
|
}
|
|
1058
1215
|
);
|
|
1059
1216
|
}
|
|
1060
|
-
const
|
|
1217
|
+
const ht = {
|
|
1061
1218
|
title: "Upload Source File",
|
|
1062
1219
|
hint: "Supports .tex, .md, .ptx, .xml, .zip, and .tar.gz files.",
|
|
1063
1220
|
selectButton: "Select File",
|
|
@@ -1065,43 +1222,43 @@ const We = {
|
|
|
1065
1222
|
documentKindLabel: "Document kind",
|
|
1066
1223
|
splitSectionsLabel: "Split each chapter into sections"
|
|
1067
1224
|
};
|
|
1068
|
-
function
|
|
1069
|
-
labels:
|
|
1070
|
-
disabled:
|
|
1071
|
-
defaultDocumentKind:
|
|
1072
|
-
importOptions:
|
|
1073
|
-
onImport:
|
|
1225
|
+
function Nt({
|
|
1226
|
+
labels: r,
|
|
1227
|
+
disabled: o = !1,
|
|
1228
|
+
defaultDocumentKind: d = "auto",
|
|
1229
|
+
importOptions: u,
|
|
1230
|
+
onImport: x
|
|
1074
1231
|
}) {
|
|
1075
|
-
const c =
|
|
1076
|
-
() => ({ ...
|
|
1077
|
-
[
|
|
1078
|
-
),
|
|
1232
|
+
const c = K(
|
|
1233
|
+
() => ({ ...ht, ...r ?? {} }),
|
|
1234
|
+
[r]
|
|
1235
|
+
), N = pe(null), [C, p] = g(!1), [S, T] = g(!1), [y, v] = g(
|
|
1079
1236
|
[]
|
|
1080
|
-
), [
|
|
1081
|
-
|
|
1237
|
+
), [F, P] = g(d), [D, Y] = g(!1), R = o || S, z = async (j) => {
|
|
1238
|
+
T(!0);
|
|
1082
1239
|
try {
|
|
1083
|
-
const
|
|
1084
|
-
documentKind:
|
|
1085
|
-
splitSections:
|
|
1240
|
+
const A = await Fe(j, u ?? {
|
|
1241
|
+
documentKind: F === "auto" ? void 0 : F,
|
|
1242
|
+
splitSections: D
|
|
1086
1243
|
});
|
|
1087
|
-
|
|
1244
|
+
v(A.statusMessages), x(A);
|
|
1088
1245
|
} finally {
|
|
1089
|
-
|
|
1246
|
+
T(!1);
|
|
1090
1247
|
}
|
|
1091
1248
|
};
|
|
1092
1249
|
return /* @__PURE__ */ e.jsxs("section", { "aria-label": "Import upload panel", children: [
|
|
1093
1250
|
/* @__PURE__ */ e.jsx("h3", { children: c.title }),
|
|
1094
1251
|
/* @__PURE__ */ e.jsx("p", { children: c.hint }),
|
|
1095
|
-
|
|
1252
|
+
u ? null : /* @__PURE__ */ e.jsxs("div", { className: "import-options", children: [
|
|
1096
1253
|
/* @__PURE__ */ e.jsxs("label", { children: [
|
|
1097
1254
|
c.documentKindLabel,
|
|
1098
1255
|
/* @__PURE__ */ e.jsxs(
|
|
1099
1256
|
"select",
|
|
1100
1257
|
{
|
|
1101
|
-
value:
|
|
1102
|
-
disabled:
|
|
1103
|
-
onChange: (
|
|
1104
|
-
|
|
1258
|
+
value: F,
|
|
1259
|
+
disabled: R,
|
|
1260
|
+
onChange: (j) => P(
|
|
1261
|
+
j.currentTarget.value
|
|
1105
1262
|
),
|
|
1106
1263
|
children: [
|
|
1107
1264
|
/* @__PURE__ */ e.jsx("option", { value: "auto", children: "Auto detect" }),
|
|
@@ -1116,9 +1273,9 @@ function He({
|
|
|
1116
1273
|
"input",
|
|
1117
1274
|
{
|
|
1118
1275
|
type: "checkbox",
|
|
1119
|
-
checked:
|
|
1120
|
-
disabled:
|
|
1121
|
-
onChange: (
|
|
1276
|
+
checked: D,
|
|
1277
|
+
disabled: R,
|
|
1278
|
+
onChange: (j) => Y(j.currentTarget.checked)
|
|
1122
1279
|
}
|
|
1123
1280
|
),
|
|
1124
1281
|
c.splitSectionsLabel
|
|
@@ -1127,15 +1284,15 @@ function He({
|
|
|
1127
1284
|
/* @__PURE__ */ e.jsxs(
|
|
1128
1285
|
"div",
|
|
1129
1286
|
{
|
|
1130
|
-
onDragOver: (
|
|
1131
|
-
|
|
1287
|
+
onDragOver: (j) => {
|
|
1288
|
+
j.preventDefault(), R || p(!0);
|
|
1132
1289
|
},
|
|
1133
|
-
onDragLeave: () =>
|
|
1134
|
-
onDrop: (
|
|
1135
|
-
if (
|
|
1290
|
+
onDragLeave: () => p(!1),
|
|
1291
|
+
onDrop: (j) => {
|
|
1292
|
+
if (j.preventDefault(), p(!1), R)
|
|
1136
1293
|
return;
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1294
|
+
const _ = j.dataTransfer.files?.[0];
|
|
1295
|
+
_ && z(_);
|
|
1139
1296
|
},
|
|
1140
1297
|
children: [
|
|
1141
1298
|
/* @__PURE__ */ e.jsx("p", { children: c.dropHint }),
|
|
@@ -1143,46 +1300,46 @@ function He({
|
|
|
1143
1300
|
"button",
|
|
1144
1301
|
{
|
|
1145
1302
|
type: "button",
|
|
1146
|
-
disabled:
|
|
1147
|
-
onClick: () =>
|
|
1303
|
+
disabled: R,
|
|
1304
|
+
onClick: () => N.current?.click(),
|
|
1148
1305
|
className: "inline-flex items-center gap-2",
|
|
1149
1306
|
children: [
|
|
1150
|
-
|
|
1307
|
+
S ? /* @__PURE__ */ e.jsx(
|
|
1151
1308
|
"span",
|
|
1152
1309
|
{
|
|
1153
1310
|
className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent",
|
|
1154
1311
|
"aria-hidden": "true"
|
|
1155
1312
|
}
|
|
1156
1313
|
) : null,
|
|
1157
|
-
|
|
1314
|
+
S ? "Processing…" : c.selectButton
|
|
1158
1315
|
]
|
|
1159
1316
|
}
|
|
1160
1317
|
),
|
|
1161
1318
|
/* @__PURE__ */ e.jsx(
|
|
1162
1319
|
"input",
|
|
1163
1320
|
{
|
|
1164
|
-
ref:
|
|
1321
|
+
ref: N,
|
|
1165
1322
|
type: "file",
|
|
1166
1323
|
hidden: !0,
|
|
1167
|
-
disabled:
|
|
1324
|
+
disabled: R,
|
|
1168
1325
|
accept: ".tex,.md,.markdown,.ptx,.xml,.zip,.gz,.tar.gz,.tgz",
|
|
1169
|
-
onChange: (
|
|
1170
|
-
const
|
|
1171
|
-
|
|
1326
|
+
onChange: (j) => {
|
|
1327
|
+
const _ = j.currentTarget.files?.[0];
|
|
1328
|
+
_ && z(_), j.currentTarget.value = "";
|
|
1172
1329
|
}
|
|
1173
1330
|
}
|
|
1174
1331
|
)
|
|
1175
1332
|
]
|
|
1176
1333
|
}
|
|
1177
1334
|
),
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
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
|
|
1181
1338
|
] });
|
|
1182
1339
|
}
|
|
1183
1340
|
export {
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1341
|
+
vt as ImportSourceForm,
|
|
1342
|
+
Nt as ImportUploadPanel,
|
|
1343
|
+
jt as ImportWizard,
|
|
1344
|
+
ct as ProcessingPanel
|
|
1188
1345
|
};
|