kandown 0.10.1 → 0.11.1

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.
Files changed (3) hide show
  1. package/bin/tui.js +45 -11
  2. package/dist/index.html +107 -107
  3. package/package.json +1 -1
package/bin/tui.js CHANGED
@@ -57015,7 +57015,7 @@ function columnAccentColor(name) {
57015
57015
  if (/done|archive|closed|complete/.test(normalized)) return "green";
57016
57016
  return "cyan";
57017
57017
  }
57018
- function TaskRow({ task, focused, dragging, colWidth }) {
57018
+ function SingleTaskRow({ task, focused, dragging, colWidth }) {
57019
57019
  const cursor = dragging ? "\u2195" : focused ? "\u25B8" : " ";
57020
57020
  const check2 = task.checked ? "\u2713" : "\u25CB";
57021
57021
  const idStr = task.id;
@@ -57045,6 +57045,43 @@ function TaskRow({ task, focused, dragging, colWidth }) {
57045
57045
  ] })
57046
57046
  ] });
57047
57047
  }
57048
+ function getTitleCategory(title) {
57049
+ const bracket = title.match(/^\[([^\]]+)\]\s*/);
57050
+ if (bracket) return { key: `[${bracket[1].toLowerCase()}]`, label: bracket[1] };
57051
+ const hash = title.match(/#(\w+)/);
57052
+ if (hash) return { key: `#${hash[1].toLowerCase()}`, label: `#${hash[1]}` };
57053
+ return null;
57054
+ }
57055
+ function CategoryTaskRow({ task, focused, dragging, colWidth }) {
57056
+ const cursor = dragging ? "\u2195" : focused ? "\u25B8" : " ";
57057
+ const check2 = task.checked ? "\u2713" : "\u25CB";
57058
+ const idStr = task.id;
57059
+ const category = getTitleCategory(task.title);
57060
+ const titleClean = category ? task.title.slice(task.title.indexOf(category.key) + category.key.length).trim() : task.title;
57061
+ const contentWidth = Math.max(4, colWidth - 2);
57062
+ const titleStr = truncate(titleClean, contentWidth);
57063
+ const bg = dragging ? "yellow" : focused ? "cyan" : "gray";
57064
+ const idColor = dragging ? "yellow" : focused ? "black" : "cyan";
57065
+ const catColor = dragging ? "yellow" : focused ? "white" : "magenta";
57066
+ const ttlColor = dragging ? "yellow" : focused ? "white" : "gray";
57067
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { flexDirection: "column", backgroundColor: bg, children: [
57068
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: idColor, bold: focused || dragging, children: [
57069
+ cursor,
57070
+ " ",
57071
+ check2,
57072
+ " ",
57073
+ idStr
57074
+ ] }),
57075
+ category && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: catColor, bold: focused || dragging, children: [
57076
+ " ",
57077
+ category.label
57078
+ ] }),
57079
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: ttlColor, children: [
57080
+ " ",
57081
+ titleStr
57082
+ ] })
57083
+ ] });
57084
+ }
57048
57085
  function MovePlaceholder({ name, focused, colWidth }) {
57049
57086
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
57050
57087
  Text,
@@ -57077,17 +57114,9 @@ function KanbanColumn({
57077
57114
  const countStr = tasks.length > 0 ? ` (${tasks.length})` : "";
57078
57115
  const rows = [];
57079
57116
  tasks.forEach((task, idx) => {
57117
+ const hasCategory = getTitleCategory(task.title) !== null;
57080
57118
  rows.push(
57081
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
57082
- TaskRow,
57083
- {
57084
- task,
57085
- focused: isFocused && idx === focusedRow,
57086
- dragging: task.id === draggedTaskId,
57087
- colWidth
57088
- },
57089
- task.id
57090
- )
57119
+ hasCategory ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CategoryTaskRow, { task, focused: !!(isFocused && idx === focusedRow), dragging: task.id === draggedTaskId, colWidth }, task.id) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SingleTaskRow, { task, focused: !!(isFocused && idx === focusedRow), dragging: task.id === draggedTaskId, colWidth }, task.id)
57091
57120
  );
57092
57121
  if (contextMenuRow === idx) {
57093
57122
  rows.push(
@@ -57101,6 +57130,11 @@ function KanbanColumn({
57101
57130
  )
57102
57131
  );
57103
57132
  }
57133
+ if (idx < tasks.length - 1) {
57134
+ rows.push(
57135
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: isFocused ? "cyan" : "gray", dimColor: true, children: "\u2500".repeat(colWidth) }, `sep-${task.id}`)
57136
+ );
57137
+ }
57104
57138
  });
57105
57139
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { flexDirection: "column", width: colWidth, marginRight: 1, children: [
57106
57140
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { backgroundColor: headerBg, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: headerColor, bold: true, children: pad(`${name}${countStr}`, colWidth) }) }),