@linxin666/dsh-client-ui-task-board 0.3.5 → 0.3.6

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/lib/client.js CHANGED
@@ -615,7 +615,6 @@ window.__ModuleLoader__.load({
615
615
  this.notify();
616
616
  }
617
617
  closeBoard() {
618
- if (!this.boardOpen) return;
619
618
  this.boardOpen = false;
620
619
  this.notify();
621
620
  }
@@ -803,6 +802,7 @@ window.__ModuleLoader__.load({
803
802
  * @param sessionId - the execution session to open.
804
803
  */
805
804
  openSession(sessionId) {
805
+ this.closeBoard();
806
806
  this.deps.sessions.open(sessionId);
807
807
  }
808
808
  /**
@@ -1498,6 +1498,95 @@ window.__ModuleLoader__.load({
1498
1498
  }
1499
1499
  ];
1500
1500
  //#endregion
1501
+ //#region src/client/board/TaskForm.tsx
1502
+ /** Modal overlay: closes on backdrop press, submits through the form. */
1503
+ function ModalShell({ ariaLabel, title, error, pending, submitLabel, onSubmit, onClose, children }) {
1504
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1505
+ className: board_module_css_default.modalBackdrop,
1506
+ onMouseDown: (event) => {
1507
+ if (event.target === event.currentTarget) onClose();
1508
+ },
1509
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
1510
+ className: board_module_css_default.modal,
1511
+ role: "dialog",
1512
+ "aria-label": ariaLabel,
1513
+ onSubmit: (event) => {
1514
+ event.preventDefault();
1515
+ onSubmit();
1516
+ },
1517
+ children: [
1518
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
1519
+ className: board_module_css_default.modalTitle,
1520
+ children: title
1521
+ }),
1522
+ children,
1523
+ error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1524
+ className: board_module_css_default.formError,
1525
+ children: error
1526
+ }),
1527
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("footer", {
1528
+ className: board_module_css_default.modalFooter,
1529
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1530
+ type: "button",
1531
+ className: board_module_css_default.ghostButton,
1532
+ onClick: onClose,
1533
+ children: t("new.cancel")
1534
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1535
+ type: "submit",
1536
+ className: board_module_css_default.primaryButton,
1537
+ disabled: pending,
1538
+ children: submitLabel
1539
+ })]
1540
+ })
1541
+ ]
1542
+ })
1543
+ });
1544
+ }
1545
+ /** Title + description + prompt fields shared by the new and edit task forms. */
1546
+ function TaskContentFields({ title, description, prompt, onTitleChange, onDescriptionChange, onPromptChange }) {
1547
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
1548
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1549
+ className: board_module_css_default.field,
1550
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1551
+ className: board_module_css_default.fieldLabel,
1552
+ children: t("new.title")
1553
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1554
+ className: board_module_css_default.input,
1555
+ value: title,
1556
+ autoFocus: true,
1557
+ placeholder: t("new.titlePlaceholder"),
1558
+ onChange: (event) => onTitleChange(event.target.value)
1559
+ })]
1560
+ }),
1561
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1562
+ className: board_module_css_default.field,
1563
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1564
+ className: board_module_css_default.fieldLabel,
1565
+ children: t("new.description")
1566
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
1567
+ className: board_module_css_default.input,
1568
+ rows: 3,
1569
+ value: description,
1570
+ placeholder: t("new.descriptionPlaceholder"),
1571
+ onChange: (event) => onDescriptionChange(event.target.value)
1572
+ })]
1573
+ }),
1574
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1575
+ className: board_module_css_default.field,
1576
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1577
+ className: board_module_css_default.fieldLabel,
1578
+ children: t("new.prompt")
1579
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
1580
+ className: board_module_css_default.input,
1581
+ rows: 4,
1582
+ value: prompt,
1583
+ placeholder: t("new.promptPlaceholder"),
1584
+ onChange: (event) => onPromptChange(event.target.value)
1585
+ })]
1586
+ })
1587
+ ] });
1588
+ }
1589
+ //#endregion
1501
1590
  //#region src/client/board/NewTaskModal.tsx
1502
1591
  /**
1503
1592
  * New-task modal: title + description + the prompt that execution will send.
@@ -1547,216 +1636,155 @@ window.__ModuleLoader__.load({
1547
1636
  };
1548
1637
  /** Next-run preview for a valid armed cron (creation-time only). */
1549
1638
  const scheduleNextRun = scheduleEnabled && scheduleCron.trim() !== "" && isValidCron(scheduleCron) ? nextRunAtMs(scheduleCron, Date.now()) : void 0;
1550
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1551
- className: board_module_css_default.modalBackdrop,
1552
- onMouseDown: (event) => {
1553
- if (event.target === event.currentTarget) onClose();
1639
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ModalShell, {
1640
+ ariaLabel: t("board.new"),
1641
+ title: t("board.new"),
1642
+ error,
1643
+ pending,
1644
+ submitLabel: t("new.submit"),
1645
+ onSubmit: () => {
1646
+ submit();
1554
1647
  },
1555
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
1556
- className: board_module_css_default.modal,
1557
- role: "dialog",
1558
- "aria-label": t("board.new"),
1559
- onSubmit: (event) => {
1560
- event.preventDefault();
1561
- submit();
1562
- },
1563
- children: [
1564
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
1565
- className: board_module_css_default.modalTitle,
1566
- children: t("board.new")
1567
- }),
1568
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1569
- className: board_module_css_default.field,
1570
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1571
- className: board_module_css_default.fieldLabel,
1572
- children: t("new.title")
1573
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1574
- className: board_module_css_default.input,
1575
- value: title,
1576
- autoFocus: true,
1577
- placeholder: t("new.titlePlaceholder"),
1578
- onChange: (event) => {
1579
- setTitle(event.target.value);
1580
- setError(void 0);
1581
- }
1582
- })]
1583
- }),
1584
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1585
- className: board_module_css_default.field,
1586
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1587
- className: board_module_css_default.fieldLabel,
1588
- children: t("new.description")
1589
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
1590
- className: board_module_css_default.input,
1591
- rows: 3,
1592
- value: description,
1593
- placeholder: t("new.descriptionPlaceholder"),
1594
- onChange: (event) => {
1595
- setDescription(event.target.value);
1596
- }
1597
- })]
1598
- }),
1599
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1600
- className: board_module_css_default.field,
1601
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1602
- className: board_module_css_default.fieldLabel,
1603
- children: t("new.prompt")
1604
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
1605
- className: board_module_css_default.input,
1606
- rows: 4,
1607
- value: prompt,
1608
- placeholder: t("new.promptPlaceholder"),
1609
- onChange: (event) => {
1610
- setPrompt(event.target.value);
1611
- }
1612
- })]
1613
- }),
1614
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1615
- className: board_module_css_default.field,
1616
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1617
- className: board_module_css_default.fieldLabel,
1618
- children: t("new.workspace")
1619
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
1620
- className: board_module_css_default.select,
1621
- value: workspaceId,
1622
- onChange: (event) => {
1623
- setWorkspaceId(event.target.value);
1624
- },
1625
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1626
- value: "",
1627
- children: t("exec.workspace.recent")
1628
- }), options.workspaces.map((workspace) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1629
- value: workspace.workspaceId,
1630
- children: workspace.title
1631
- }, workspace.workspaceId))]
1632
- })]
1633
- }),
1634
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1635
- className: board_module_css_default.field,
1636
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1637
- className: board_module_css_default.fieldLabel,
1638
- children: t("new.mode")
1639
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
1640
- className: board_module_css_default.select,
1641
- value: mode,
1642
- onChange: (event) => {
1643
- setMode(event.target.value);
1644
- },
1645
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1646
- value: "",
1647
- children: t("exec.mode.default")
1648
- }), options.presets.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
1649
- value: preset.id,
1650
- disabled: preset.broken !== void 0,
1651
- children: [
1652
- preset.name ?? preset.id,
1653
- preset.isDefault ? t("exec.mode.defaultSuffix") : "",
1654
- preset.broken !== void 0 ? t("exec.mode.brokenSuffix") : ""
1655
- ]
1656
- }, preset.id))]
1657
- })]
1658
- }),
1659
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1660
- className: board_module_css_default.field,
1661
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1662
- className: board_module_css_default.fieldLabel,
1663
- children: t("new.permission")
1664
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
1665
- className: board_module_css_default.select,
1666
- value: permission,
1667
- onChange: (event) => {
1668
- setPermission(event.target.value);
1669
- },
1670
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1671
- value: "",
1672
- children: t("exec.permission.default")
1673
- }), TASK_PERMISSIONS.map((id) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1674
- value: id,
1675
- children: t(`exec.permission.${id}`)
1676
- }, id))]
1677
- })]
1678
- }),
1679
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1680
- className: board_module_css_default.detailSection,
1681
- children: [
1682
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", { children: t("detail.schedule") }),
1683
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1684
- className: board_module_css_default.scheduleToggle,
1648
+ onClose,
1649
+ children: [
1650
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaskContentFields, {
1651
+ title,
1652
+ description,
1653
+ prompt,
1654
+ onTitleChange: (value) => {
1655
+ setTitle(value);
1656
+ setError(void 0);
1657
+ },
1658
+ onDescriptionChange: setDescription,
1659
+ onPromptChange: setPrompt
1660
+ }),
1661
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1662
+ className: board_module_css_default.field,
1663
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1664
+ className: board_module_css_default.fieldLabel,
1665
+ children: t("new.workspace")
1666
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
1667
+ className: board_module_css_default.select,
1668
+ value: workspaceId,
1669
+ onChange: (event) => {
1670
+ setWorkspaceId(event.target.value);
1671
+ },
1672
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1673
+ value: "",
1674
+ children: t("exec.workspace.recent")
1675
+ }), options.workspaces.map((workspace) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1676
+ value: workspace.workspaceId,
1677
+ children: workspace.title
1678
+ }, workspace.workspaceId))]
1679
+ })]
1680
+ }),
1681
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1682
+ className: board_module_css_default.field,
1683
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1684
+ className: board_module_css_default.fieldLabel,
1685
+ children: t("new.mode")
1686
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
1687
+ className: board_module_css_default.select,
1688
+ value: mode,
1689
+ onChange: (event) => {
1690
+ setMode(event.target.value);
1691
+ },
1692
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1693
+ value: "",
1694
+ children: t("exec.mode.default")
1695
+ }), options.presets.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
1696
+ value: preset.id,
1697
+ disabled: preset.broken !== void 0,
1698
+ children: [
1699
+ preset.name ?? preset.id,
1700
+ preset.isDefault ? t("exec.mode.defaultSuffix") : "",
1701
+ preset.broken !== void 0 ? t("exec.mode.brokenSuffix") : ""
1702
+ ]
1703
+ }, preset.id))]
1704
+ })]
1705
+ }),
1706
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1707
+ className: board_module_css_default.field,
1708
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1709
+ className: board_module_css_default.fieldLabel,
1710
+ children: t("new.permission")
1711
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
1712
+ className: board_module_css_default.select,
1713
+ value: permission,
1714
+ onChange: (event) => {
1715
+ setPermission(event.target.value);
1716
+ },
1717
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1718
+ value: "",
1719
+ children: t("exec.permission.default")
1720
+ }), TASK_PERMISSIONS.map((id) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1721
+ value: id,
1722
+ children: t(`exec.permission.${id}`)
1723
+ }, id))]
1724
+ })]
1725
+ }),
1726
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1727
+ className: board_module_css_default.detailSection,
1728
+ children: [
1729
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", { children: t("detail.schedule") }),
1730
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1731
+ className: board_module_css_default.scheduleToggle,
1732
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1733
+ type: "checkbox",
1734
+ checked: scheduleEnabled,
1735
+ onChange: (event) => {
1736
+ setScheduleEnabled(event.target.checked);
1737
+ if (!event.target.checked) setScheduleError(void 0);
1738
+ }
1739
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("detail.schedule.enable") })]
1740
+ }),
1741
+ scheduleEnabled && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
1742
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1743
+ className: board_module_css_default.scheduleRow,
1685
1744
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1686
- type: "checkbox",
1687
- checked: scheduleEnabled,
1745
+ className: `${board_module_css_default.input} ${board_module_css_default.scheduleInput}${scheduleError !== void 0 ? ` ${board_module_css_default.scheduleInputInvalid}` : ""}`,
1746
+ value: scheduleCron,
1747
+ placeholder: "0 9 * * *",
1748
+ spellCheck: false,
1749
+ "aria-label": t("detail.schedule.cron"),
1688
1750
  onChange: (event) => {
1689
- setScheduleEnabled(event.target.checked);
1690
- if (!event.target.checked) setScheduleError(void 0);
1751
+ setScheduleCron(event.target.value);
1752
+ setScheduleError(void 0);
1691
1753
  }
1692
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("detail.schedule.enable") })]
1693
- }),
1694
- scheduleEnabled && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
1695
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1696
- className: board_module_css_default.scheduleRow,
1697
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1698
- className: `${board_module_css_default.input} ${board_module_css_default.scheduleInput}${scheduleError !== void 0 ? ` ${board_module_css_default.scheduleInputInvalid}` : ""}`,
1699
- value: scheduleCron,
1700
- placeholder: "0 9 * * *",
1701
- spellCheck: false,
1702
- "aria-label": t("detail.schedule.cron"),
1703
- onChange: (event) => {
1704
- setScheduleCron(event.target.value);
1705
- setScheduleError(void 0);
1706
- }
1707
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
1708
- className: board_module_css_default.schedulePreset,
1754
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
1755
+ className: board_module_css_default.schedulePreset,
1756
+ value: "",
1757
+ "aria-label": t("detail.schedule.presets"),
1758
+ onChange: (event) => {
1759
+ if (event.target.value === "") return;
1760
+ setScheduleCron(event.target.value);
1761
+ setScheduleError(void 0);
1762
+ },
1763
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
1709
1764
  value: "",
1710
- "aria-label": t("detail.schedule.presets"),
1711
- onChange: (event) => {
1712
- if (event.target.value === "") return;
1713
- setScheduleCron(event.target.value);
1714
- setScheduleError(void 0);
1715
- },
1716
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
1717
- value: "",
1718
- children: [t("detail.schedule.presets"), "…"]
1719
- }), SCHEDULE_PRESETS.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1720
- value: preset.cron,
1721
- children: t(preset.label)
1722
- }, preset.cron))]
1723
- })]
1724
- }),
1725
- scheduleError !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1726
- className: board_module_css_default.formError,
1727
- children: scheduleError
1728
- }),
1729
- scheduleError === void 0 && scheduleNextRun !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
1730
- className: board_module_css_default.scheduleMeta,
1731
- children: [
1732
- t("detail.schedule.nextRun"),
1733
- " ",
1734
- new Date(scheduleNextRun).toLocaleString()
1735
- ]
1736
- })
1737
- ] })
1738
- ]
1739
- }),
1740
- error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1741
- className: board_module_css_default.formError,
1742
- children: error
1743
- }),
1744
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("footer", {
1745
- className: board_module_css_default.modalFooter,
1746
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1747
- type: "button",
1748
- className: board_module_css_default.ghostButton,
1749
- onClick: onClose,
1750
- children: t("new.cancel")
1751
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1752
- type: "submit",
1753
- className: board_module_css_default.primaryButton,
1754
- disabled: pending,
1755
- children: t("new.submit")
1756
- })]
1757
- })
1758
- ]
1759
- })
1765
+ children: [t("detail.schedule.presets"), "…"]
1766
+ }), SCHEDULE_PRESETS.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1767
+ value: preset.cron,
1768
+ children: t(preset.label)
1769
+ }, preset.cron))]
1770
+ })]
1771
+ }),
1772
+ scheduleError !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1773
+ className: board_module_css_default.formError,
1774
+ children: scheduleError
1775
+ }),
1776
+ scheduleError === void 0 && scheduleNextRun !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
1777
+ className: board_module_css_default.scheduleMeta,
1778
+ children: [
1779
+ t("detail.schedule.nextRun"),
1780
+ " ",
1781
+ new Date(scheduleNextRun).toLocaleString()
1782
+ ]
1783
+ })
1784
+ ] })
1785
+ ]
1786
+ })
1787
+ ]
1760
1788
  });
1761
1789
  }
1762
1790
  //#endregion
@@ -1953,89 +1981,26 @@ window.__ModuleLoader__.load({
1953
1981
  setPending(false);
1954
1982
  setError(controller.getSnapshot().transportError ?? t("new.required"));
1955
1983
  };
1956
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1957
- className: board_module_css_default.modalBackdrop,
1958
- onMouseDown: (event) => {
1959
- if (event.target === event.currentTarget) onClose();
1984
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalShell, {
1985
+ ariaLabel: t("edit.title"),
1986
+ title: t("edit.title"),
1987
+ error,
1988
+ pending,
1989
+ submitLabel: t("edit.save"),
1990
+ onSubmit: () => {
1991
+ submit();
1960
1992
  },
1961
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
1962
- className: board_module_css_default.modal,
1963
- role: "dialog",
1964
- "aria-label": t("edit.title"),
1965
- onSubmit: (event) => {
1966
- event.preventDefault();
1967
- submit();
1993
+ onClose,
1994
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaskContentFields, {
1995
+ title,
1996
+ description,
1997
+ prompt,
1998
+ onTitleChange: (value) => {
1999
+ setTitle(value);
2000
+ setError(void 0);
1968
2001
  },
1969
- children: [
1970
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
1971
- className: board_module_css_default.modalTitle,
1972
- children: t("edit.title")
1973
- }),
1974
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1975
- className: board_module_css_default.field,
1976
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1977
- className: board_module_css_default.fieldLabel,
1978
- children: t("new.title")
1979
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1980
- className: board_module_css_default.input,
1981
- value: title,
1982
- autoFocus: true,
1983
- placeholder: t("new.titlePlaceholder"),
1984
- onChange: (event) => {
1985
- setTitle(event.target.value);
1986
- setError(void 0);
1987
- }
1988
- })]
1989
- }),
1990
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1991
- className: board_module_css_default.field,
1992
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1993
- className: board_module_css_default.fieldLabel,
1994
- children: t("new.description")
1995
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
1996
- className: board_module_css_default.input,
1997
- rows: 3,
1998
- value: description,
1999
- placeholder: t("new.descriptionPlaceholder"),
2000
- onChange: (event) => {
2001
- setDescription(event.target.value);
2002
- }
2003
- })]
2004
- }),
2005
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
2006
- className: board_module_css_default.field,
2007
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2008
- className: board_module_css_default.fieldLabel,
2009
- children: t("new.prompt")
2010
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
2011
- className: board_module_css_default.input,
2012
- rows: 4,
2013
- value: prompt,
2014
- placeholder: t("new.promptPlaceholder"),
2015
- onChange: (event) => {
2016
- setPrompt(event.target.value);
2017
- }
2018
- })]
2019
- }),
2020
- error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2021
- className: board_module_css_default.formError,
2022
- children: error
2023
- }),
2024
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("footer", {
2025
- className: board_module_css_default.modalFooter,
2026
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2027
- type: "button",
2028
- className: board_module_css_default.ghostButton,
2029
- onClick: onClose,
2030
- children: t("new.cancel")
2031
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2032
- type: "submit",
2033
- className: board_module_css_default.primaryButton,
2034
- disabled: pending,
2035
- children: t("edit.save")
2036
- })]
2037
- })
2038
- ]
2002
+ onDescriptionChange: setDescription,
2003
+ onPromptChange: setPrompt
2039
2004
  })
2040
2005
  });
2041
2006
  }
@@ -2774,7 +2739,13 @@ window.__ModuleLoader__.load({
2774
2739
  let root;
2775
2740
  let container;
2776
2741
  const ensure = () => {
2777
- if (container !== void 0) return;
2742
+ if (container !== void 0) {
2743
+ if (container.isConnected) return;
2744
+ root?.unmount();
2745
+ root = void 0;
2746
+ container.remove();
2747
+ container = void 0;
2748
+ }
2778
2749
  const column = conversationColumn();
2779
2750
  if (column === void 0) return;
2780
2751
  container = document.createElement("div");
@@ -3873,7 +3844,7 @@ window.__ModuleLoader__.load({
3873
3844
  /** The building package's version, when the bundle carries it. */
3874
3845
  function bakedVersion() {
3875
3846
  try {
3876
- return "0.3.5";
3847
+ return "0.3.6";
3877
3848
  } catch {
3878
3849
  return;
3879
3850
  }