chore: move dependencies out of root

This commit is contained in:
sbplat
2024-02-05 13:28:46 -05:00
parent e7b4c93481
commit da32769463
4 changed files with 12 additions and 44 deletions

View File

@@ -6,12 +6,12 @@ import i18next from "i18next";
function Dynamic() {
const operators = ["impose"]; // TODO: Make this dynamic
function selectionChanged(s: BaseSyntheticEvent) {
const selectedValue = s.target.value;
if(selectedValue == "none") return;
i18next.loadNamespaces("impose", (err, t) => {
i18next.loadNamespaces("impose", (err, t) => {
if (err) throw err;
const LoadingModule = import(`@stirling-pdf/shared-operations/src/functions/${selectedValue}`) as Promise<{ [key: string]: typeof Operator }>;
@@ -19,9 +19,9 @@ function Dynamic() {
const Operator = Module[capitalizeFirstLetter(selectedValue)];
const description = Operator.schema.describe();
console.log("abc", description);
console.log(description);
// TODO: use description to generate fields
});
});
});
}
@@ -35,19 +35,19 @@ function Dynamic() {
<input type="file" id="pdfFile" accept=".pdf" multiple />
<br />
<br />
<textarea name="workflow" id="workflow"></textarea>
<br />
<select id="pdfOptions" onChange={selectionChanged}>
<option value="none">none</option>
{ operators.map((operator, i) => {
return (<option value={operator}>{operator}</option>)
{ operators.map((operator, i) => {
return (<option value={operator}>{operator}</option>)
}) }
</select>
<button id="loadButton">Load</button>
<br />
<br />
<button id="doneButton">Done</button>
@@ -59,4 +59,4 @@ function Dynamic() {
}
export default Dynamic;
export default Dynamic;