@parallelworks/tandem-web 0.183.0 → 0.184.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.
@@ -1359,6 +1359,7 @@ var e = {
1359
1359
  remove: "Remove property",
1360
1360
  empty: "Empty",
1361
1361
  add: "Add property",
1362
+ new: "New property",
1362
1363
  name: "Name",
1363
1364
  kind: "Kind",
1364
1365
  options: "Options, one per line",
@@ -1414,6 +1415,7 @@ var e = {
1414
1415
  meetingTitle: "Meeting notes: {date}",
1415
1416
  meetingNotes: "Meeting notes",
1416
1417
  templates: "Templates",
1418
+ database: "Database",
1417
1419
  noTemplates: "No templates in this space",
1418
1420
  importFiles: "Import Markdown or a zip",
1419
1421
  importFolder: "Import a folder",
@@ -4046,6 +4048,11 @@ var e = {
4046
4048
  views: "Views of sub-pages",
4047
4049
  calendarView: "Calendar view",
4048
4050
  feed: "Feed",
4051
+ tableView: "Table view",
4052
+ boardView: "Board view",
4053
+ listView: "List view",
4054
+ timelineView: "Timeline view",
4055
+ galleryView: "Gallery view",
4049
4056
  addView: "Add a view",
4050
4057
  titleOn: "{title}: {date}",
4051
4058
  untitled: "Untitled",
@@ -4055,6 +4062,15 @@ var e = {
4055
4062
  search: "Search",
4056
4063
  new: "New",
4057
4064
  pickDate: "Pick the date property that puts sub-pages on the calendar.",
4065
+ pickTimelineDate: "Pick the date property that puts sub-pages on the timeline.",
4066
+ pickGroup: "Pick a select or person property to group the board by.",
4067
+ groupBy: "Group by",
4068
+ noGroup: "None",
4069
+ statusName: "Status",
4070
+ statusNotStarted: "Not started",
4071
+ statusInProgress: "In progress",
4072
+ statusDone: "Done",
4073
+ addStatus: "Add a Status property",
4058
4074
  settings: "View settings",
4059
4075
  dateProperty: "Date property",
4060
4076
  noDateProperty: "None",
@@ -1359,6 +1359,7 @@ var e = {
1359
1359
  remove: "Quitar propiedad",
1360
1360
  empty: "Vacío",
1361
1361
  add: "Añadir propiedad",
1362
+ new: "Nueva propiedad",
1362
1363
  name: "Nombre",
1363
1364
  kind: "Tipo",
1364
1365
  options: "Opciones, una por línea",
@@ -1414,6 +1415,7 @@ var e = {
1414
1415
  meetingTitle: "Notas de reunión: {date}",
1415
1416
  meetingNotes: "Notas de reunión",
1416
1417
  templates: "Plantillas",
1418
+ database: "Base de datos",
1417
1419
  noTemplates: "No hay plantillas en este espacio",
1418
1420
  importFiles: "Importar Markdown o un zip",
1419
1421
  importFolder: "Importar una carpeta",
@@ -4046,6 +4048,11 @@ var e = {
4046
4048
  views: "Vistas de subpáginas",
4047
4049
  calendarView: "Vista de calendario",
4048
4050
  feed: "Feed",
4051
+ tableView: "Vista de tabla",
4052
+ boardView: "Vista de tablero",
4053
+ listView: "Vista de lista",
4054
+ timelineView: "Vista de cronología",
4055
+ galleryView: "Vista de galería",
4049
4056
  addView: "Añadir una vista",
4050
4057
  titleOn: "{title}: {date}",
4051
4058
  untitled: "Sin título",
@@ -4055,6 +4062,15 @@ var e = {
4055
4062
  search: "Buscar",
4056
4063
  new: "Nueva",
4057
4064
  pickDate: "Elige la propiedad de fecha que coloca las subpáginas en el calendario.",
4065
+ pickTimelineDate: "Elige la propiedad de fecha que coloca las subpáginas en la cronología.",
4066
+ pickGroup: "Elige una propiedad de selección o de persona para agrupar el tablero.",
4067
+ groupBy: "Agrupar por",
4068
+ noGroup: "Ninguna",
4069
+ statusName: "Estado",
4070
+ statusNotStarted: "Sin empezar",
4071
+ statusInProgress: "En curso",
4072
+ statusDone: "Hecho",
4073
+ addStatus: "Añadir una propiedad Estado",
4058
4074
  settings: "Ajustes de la vista",
4059
4075
  dateProperty: "Propiedad de fecha",
4060
4076
  noDateProperty: "Ninguna",
@@ -1359,6 +1359,7 @@ var e = {
1359
1359
  remove: "プロパティを削除",
1360
1360
  empty: "空",
1361
1361
  add: "プロパティを追加",
1362
+ new: "新しいプロパティ",
1362
1363
  name: "名前",
1363
1364
  kind: "種類",
1364
1365
  options: "選択肢(1 行に 1 つ)",
@@ -1414,6 +1415,7 @@ var e = {
1414
1415
  meetingTitle: "議事録: {date}",
1415
1416
  meetingNotes: "議事録",
1416
1417
  templates: "テンプレート",
1418
+ database: "データベース",
1417
1419
  noTemplates: "このスペースにテンプレートはありません",
1418
1420
  importFiles: "Markdown または zip をインポート",
1419
1421
  importFolder: "フォルダーをインポート",
@@ -4046,6 +4048,11 @@ var e = {
4046
4048
  views: "サブページのビュー",
4047
4049
  calendarView: "カレンダービュー",
4048
4050
  feed: "フィード",
4051
+ tableView: "テーブルビュー",
4052
+ boardView: "ボードビュー",
4053
+ listView: "リストビュー",
4054
+ timelineView: "タイムラインビュー",
4055
+ galleryView: "ギャラリービュー",
4049
4056
  addView: "ビューを追加",
4050
4057
  titleOn: "{title}: {date}",
4051
4058
  untitled: "無題",
@@ -4055,6 +4062,15 @@ var e = {
4055
4062
  search: "検索",
4056
4063
  new: "新規",
4057
4064
  pickDate: "サブページをカレンダーに表示する日付プロパティを選んでください。",
4065
+ pickTimelineDate: "サブページをタイムラインに配置する日付プロパティを選んでください。",
4066
+ pickGroup: "ボードをグループ化する選択またはユーザーのプロパティを選んでください。",
4067
+ groupBy: "グループ化",
4068
+ noGroup: "なし",
4069
+ statusName: "ステータス",
4070
+ statusNotStarted: "未着手",
4071
+ statusInProgress: "進行中",
4072
+ statusDone: "完了",
4073
+ addStatus: "ステータスプロパティを追加",
4058
4074
  settings: "ビューの設定",
4059
4075
  dateProperty: "日付プロパティ",
4060
4076
  noDateProperty: "なし",
@@ -1359,6 +1359,7 @@ var e = {
1359
1359
  remove: "속성 삭제",
1360
1360
  empty: "비어 있음",
1361
1361
  add: "속성 추가",
1362
+ new: "새 속성",
1362
1363
  name: "이름",
1363
1364
  kind: "종류",
1364
1365
  options: "옵션(한 줄에 하나)",
@@ -1414,6 +1415,7 @@ var e = {
1414
1415
  meetingTitle: "회의록: {date}",
1415
1416
  meetingNotes: "회의록",
1416
1417
  templates: "템플릿",
1418
+ database: "데이터베이스",
1417
1419
  noTemplates: "이 공간에 템플릿이 없습니다",
1418
1420
  importFiles: "Markdown 또는 zip 가져오기",
1419
1421
  importFolder: "폴더 가져오기",
@@ -4046,6 +4048,11 @@ var e = {
4046
4048
  views: "하위 페이지 보기",
4047
4049
  calendarView: "캘린더 보기",
4048
4050
  feed: "피드",
4051
+ tableView: "표 보기",
4052
+ boardView: "보드 보기",
4053
+ listView: "목록 보기",
4054
+ timelineView: "타임라인 보기",
4055
+ galleryView: "갤러리 보기",
4049
4056
  addView: "보기 추가",
4050
4057
  titleOn: "{title}: {date}",
4051
4058
  untitled: "제목 없음",
@@ -4055,6 +4062,15 @@ var e = {
4055
4062
  search: "검색",
4056
4063
  new: "새로 만들기",
4057
4064
  pickDate: "하위 페이지를 캘린더에 놓을 날짜 속성을 고르세요.",
4065
+ pickTimelineDate: "하위 페이지를 타임라인에 놓을 날짜 속성을 고르세요.",
4066
+ pickGroup: "보드를 그룹화할 선택 또는 사용자 속성을 고르세요.",
4067
+ groupBy: "그룹화 기준",
4068
+ noGroup: "없음",
4069
+ statusName: "상태",
4070
+ statusNotStarted: "시작 전",
4071
+ statusInProgress: "진행 중",
4072
+ statusDone: "완료",
4073
+ addStatus: "상태 속성 추가",
4058
4074
  settings: "보기 설정",
4059
4075
  dateProperty: "날짜 속성",
4060
4076
  noDateProperty: "없음",
@@ -1359,6 +1359,7 @@ var e = {
1359
1359
  remove: "移除属性",
1360
1360
  empty: "空",
1361
1361
  add: "添加属性",
1362
+ new: "新建属性",
1362
1363
  name: "名称",
1363
1364
  kind: "类型",
1364
1365
  options: "选项(每行一个)",
@@ -1414,6 +1415,7 @@ var e = {
1414
1415
  meetingTitle: "会议记录:{date}",
1415
1416
  meetingNotes: "会议记录",
1416
1417
  templates: "模板",
1418
+ database: "数据库",
1417
1419
  noTemplates: "此空间没有模板",
1418
1420
  importFiles: "导入 Markdown 或 zip",
1419
1421
  importFolder: "导入文件夹",
@@ -4046,6 +4048,11 @@ var e = {
4046
4048
  views: "子页面视图",
4047
4049
  calendarView: "日历视图",
4048
4050
  feed: "动态",
4051
+ tableView: "表格视图",
4052
+ boardView: "看板视图",
4053
+ listView: "列表视图",
4054
+ timelineView: "时间线视图",
4055
+ galleryView: "画廊视图",
4049
4056
  addView: "添加视图",
4050
4057
  titleOn: "{title}:{date}",
4051
4058
  untitled: "无标题",
@@ -4055,6 +4062,15 @@ var e = {
4055
4062
  search: "搜索",
4056
4063
  new: "新建",
4057
4064
  pickDate: "选择把子页面放到日历上的日期属性。",
4065
+ pickTimelineDate: "选择把子页面放到时间线上的日期属性。",
4066
+ pickGroup: "选择一个单选或人员属性来分组看板。",
4067
+ groupBy: "分组依据",
4068
+ noGroup: "无",
4069
+ statusName: "状态",
4070
+ statusNotStarted: "未开始",
4071
+ statusInProgress: "进行中",
4072
+ statusDone: "已完成",
4073
+ addStatus: "添加状态属性",
4058
4074
  settings: "视图设置",
4059
4075
  dateProperty: "日期属性",
4060
4076
  noDateProperty: "无",
@@ -1,17 +1,17 @@
1
- import { docPropertiesQuery as e, propertyKinds as t, spaceScope as n, useDocPropertyActions as r } from "../lib/docProperties.js";
2
- import { usePeople as i } from "../lib/people.js";
3
- import { useCan as a } from "../lib/roles.js";
4
- import { AddIcon as o } from "./icons.js";
5
- import { Button as s, Checkbox as c, ErrorText as l, IconButton as u, Input as d, Popover as f, Select as p, Textarea as m, menuDivider as h, useOpenMenu as g } from "@parallelworks/ui";
6
- import { Link as _ } from "@tanstack/react-router";
7
- import { useEffect as v, useState as y } from "react";
8
- import { useErrorMessage as b } from "@parallelworks/problem/react";
9
- import { useTranslations as x } from "use-intl";
10
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
11
- import { useQuery as w } from "@tanstack/react-query";
1
+ import { docPropertiesQuery as e, hasValue as t, propertyKinds as n, spaceScope as r, useDocPropertyActions as i } from "../lib/docProperties.js";
2
+ import { usePeople as a } from "../lib/people.js";
3
+ import { useCan as o } from "../lib/roles.js";
4
+ import { AddIcon as s } from "./icons.js";
5
+ import { Button as c, Checkbox as l, ErrorText as u, IconButton as d, Input as f, Popover as p, Select as m, Textarea as h, menuDivider as g, useOpenMenu as _ } from "@parallelworks/ui";
6
+ import { Link as v } from "@tanstack/react-router";
7
+ import { useEffect as y, useState as b } from "react";
8
+ import { useErrorMessage as x } from "@parallelworks/problem/react";
9
+ import { useTranslations as S } from "use-intl";
10
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
11
+ import { useQuery as E } from "@tanstack/react-query";
12
12
  // src/components/DocProperties.tsx
13
- function T(e) {
14
- let { nameOf: t } = i(e), n = x("docProperties");
13
+ function D(e) {
14
+ let { nameOf: t } = a(e), n = S("docProperties");
15
15
  return (e, r) => {
16
16
  if (r == null) return "";
17
17
  let i = (t) => e.options.find((e) => e.id === t)?.name ?? String(t);
@@ -24,67 +24,76 @@ function T(e) {
24
24
  }
25
25
  };
26
26
  }
27
- function E({ workspace: t, doc: i, space: o, editable: s }) {
28
- let c = x("docProperties"), u = b(), { data: d = [] } = w(e(t, o)), f = a(t, "manage_labels", n(o)), p = r(t), m = i.properties ?? {};
29
- if (d.length === 0 && !(s && f)) return null;
30
- let h = (e, t) => p.setValues.mutate({
31
- doc: i.key,
27
+ function O({ workspace: n, doc: a, space: s, editable: c }) {
28
+ let l = S("docProperties"), d = x(), { data: f = [] } = E(e(n, s)), p = o(n, "manage_labels", r(s)), m = i(n), h = a.properties ?? {}, [g, _] = b({
29
+ doc: a.key,
30
+ ids: []
31
+ }), v = g.doc === a.key ? g.ids : [], y = f.filter((e) => t(h[e.id]) || v.includes(e.id)), C = f.filter((e) => !y.includes(e)), D = c && (C.length > 0 || p);
32
+ if (y.length === 0 && !D) return null;
33
+ let O = (e, t) => m.setValues.mutate({
34
+ doc: a.key,
32
35
  values: { [e]: t }
33
36
  });
34
- return /* @__PURE__ */ C("section", {
35
- "aria-label": c("title"),
37
+ return /* @__PURE__ */ T("section", {
38
+ "aria-label": l("title"),
36
39
  className: "mt-3 space-y-0.5 text-sm",
37
40
  children: [
38
- d.map((e) => /* @__PURE__ */ C("div", {
41
+ y.map((e) => /* @__PURE__ */ T("div", {
39
42
  className: "flex min-h-8 items-center gap-2",
40
- children: [/* @__PURE__ */ S(D, {
41
- workspace: t,
43
+ children: [/* @__PURE__ */ w(k, {
44
+ workspace: n,
42
45
  property: e,
43
- admin: s && f
44
- }), /* @__PURE__ */ S("div", {
46
+ admin: c && p
47
+ }), /* @__PURE__ */ w("div", {
45
48
  className: "min-w-0 flex-1",
46
- children: /* @__PURE__ */ S(O, {
47
- workspace: t,
49
+ children: /* @__PURE__ */ w(A, {
50
+ workspace: n,
48
51
  property: e,
49
- value: m[e.id],
50
- editable: s,
51
- onChange: (t) => h(e.id, t)
52
+ value: h[e.id],
53
+ editable: c,
54
+ onChange: (t) => O(e.id, t)
52
55
  })
53
56
  })]
54
57
  }, e.id)),
55
- s && f && /* @__PURE__ */ S(A, {
56
- workspace: t,
57
- space: o
58
+ D && /* @__PURE__ */ w(M, {
59
+ workspace: n,
60
+ space: s,
61
+ unset: C,
62
+ admin: p,
63
+ onPick: (e) => _({
64
+ doc: a.key,
65
+ ids: [...v, e]
66
+ })
58
67
  }),
59
- p.setValues.error && /* @__PURE__ */ S(l, { children: u(p.setValues.error) })
68
+ m.setValues.error && /* @__PURE__ */ w(u, { children: d(m.setValues.error) })
60
69
  ]
61
70
  });
62
71
  }
63
- function D({ workspace: e, property: t, admin: n }) {
64
- let i = x("docProperties"), a = g(), o = r(e), [s, c] = y(!1), l = /* @__PURE__ */ S("span", {
72
+ function k({ workspace: e, property: t, admin: n }) {
73
+ let r = S("docProperties"), a = _(), o = i(e), [s, c] = b(!1), l = /* @__PURE__ */ w("span", {
65
74
  className: "truncate",
66
75
  children: t.name
67
76
  });
68
- if (!n) return /* @__PURE__ */ S("span", {
77
+ if (!n) return /* @__PURE__ */ w("span", {
69
78
  className: "flex w-36 shrink-0 text-muted-foreground",
70
79
  children: l
71
80
  });
72
81
  let u = () => [
73
82
  {
74
- label: i("edit"),
83
+ label: r("edit"),
75
84
  onClick: () => c(!0)
76
85
  },
77
- h,
86
+ g,
78
87
  {
79
- label: i("remove"),
88
+ label: r("remove"),
80
89
  destructive: !0,
81
90
  onClick: () => o.remove.mutate(t.id)
82
91
  }
83
92
  ];
84
- return /* @__PURE__ */ S(f, {
93
+ return /* @__PURE__ */ w(p, {
85
94
  open: s,
86
95
  onOpenChange: c,
87
- trigger: /* @__PURE__ */ S("button", {
96
+ trigger: /* @__PURE__ */ w("button", {
88
97
  type: "button",
89
98
  onContextMenu: (e) => a(e, u()),
90
99
  className: "flex h-7 w-36 shrink-0 items-center rounded-md px-1.5 text-left text-muted-foreground hover:bg-muted",
@@ -93,8 +102,8 @@ function D({ workspace: e, property: t, admin: n }) {
93
102
  align: "start",
94
103
  className: "w-72",
95
104
  initialFocus: "first-control",
96
- "aria-label": i("edit"),
97
- children: /* @__PURE__ */ S(j, {
105
+ "aria-label": r("edit"),
106
+ children: /* @__PURE__ */ w(N, {
98
107
  workspace: e,
99
108
  property: t,
100
109
  onDone: () => c(!1),
@@ -104,11 +113,11 @@ function D({ workspace: e, property: t, admin: n }) {
104
113
  })
105
114
  });
106
115
  }
107
- function O({ workspace: e, property: t, value: n, editable: r, onChange: a }) {
108
- let o = x("docProperties"), { members: s } = i(e), l = T(e), u = o("empty");
116
+ function A({ workspace: e, property: t, value: n, editable: r, onChange: i }) {
117
+ let o = S("docProperties"), { members: s } = a(e), c = D(e), u = o("empty");
109
118
  if (!r) {
110
- let r = l(t, n);
111
- return t.kind === "issue" && r ? /* @__PURE__ */ S(_, {
119
+ let r = c(t, n);
120
+ return t.kind === "issue" && r ? /* @__PURE__ */ w(v, {
112
121
  to: "/$workspace/issues/$identifier",
113
122
  params: {
114
123
  workspace: e,
@@ -116,19 +125,19 @@ function O({ workspace: e, property: t, value: n, editable: r, onChange: a }) {
116
125
  },
117
126
  className: "text-primary hover:underline",
118
127
  children: r
119
- }) : t.kind === "url" && r ? /* @__PURE__ */ S("a", {
128
+ }) : t.kind === "url" && r ? /* @__PURE__ */ w("a", {
120
129
  href: r,
121
130
  target: "_blank",
122
131
  rel: "noopener noreferrer",
123
132
  className: "truncate text-primary hover:underline",
124
133
  children: r
125
- }) : /* @__PURE__ */ S("span", {
134
+ }) : /* @__PURE__ */ w("span", {
126
135
  className: r ? "" : "text-muted-foreground",
127
136
  children: r || u
128
137
  });
129
138
  }
130
139
  switch (t.kind) {
131
- case "select": return /* @__PURE__ */ S(p, {
140
+ case "select": return /* @__PURE__ */ w(m, {
132
141
  value: typeof n == "string" ? n : "",
133
142
  items: [{
134
143
  value: "",
@@ -137,25 +146,25 @@ function O({ workspace: e, property: t, value: n, editable: r, onChange: a }) {
137
146
  value: e.id ?? "",
138
147
  label: e.name
139
148
  }))],
140
- onValueChange: (e) => a(e || null),
149
+ onValueChange: (e) => i(e || null),
141
150
  "aria-label": t.name,
142
151
  size: "sm",
143
152
  width: "content"
144
153
  });
145
- case "multi_select": return /* @__PURE__ */ S(p, {
154
+ case "multi_select": return /* @__PURE__ */ w(m, {
146
155
  multiple: !0,
147
156
  value: Array.isArray(n) ? n : [],
148
157
  items: t.options.map((e) => ({
149
158
  value: e.id ?? "",
150
159
  label: e.name
151
160
  })),
152
- onValueChange: (e) => a(e),
161
+ onValueChange: (e) => i(e),
153
162
  placeholder: u,
154
163
  "aria-label": t.name,
155
164
  size: "sm",
156
165
  width: "content"
157
166
  });
158
- case "person": return /* @__PURE__ */ S(p, {
167
+ case "person": return /* @__PURE__ */ w(m, {
159
168
  value: typeof n == "string" ? n : "",
160
169
  items: [{
161
170
  value: "",
@@ -164,37 +173,37 @@ function O({ workspace: e, property: t, value: n, editable: r, onChange: a }) {
164
173
  value: e.user.username,
165
174
  label: e.user.name
166
175
  }))],
167
- onValueChange: (e) => a(e || null),
176
+ onValueChange: (e) => i(e || null),
168
177
  "aria-label": t.name,
169
178
  size: "sm",
170
179
  width: "content"
171
180
  });
172
- case "checkbox": return /* @__PURE__ */ S(c, {
181
+ case "checkbox": return /* @__PURE__ */ w(l, {
173
182
  checked: n === !0,
174
- onCheckedChange: (e) => a(e === !0),
183
+ onCheckedChange: (e) => i(e === !0),
175
184
  "aria-label": t.name
176
185
  });
177
- case "date": return /* @__PURE__ */ S(d, {
186
+ case "date": return /* @__PURE__ */ w(f, {
178
187
  type: "date",
179
188
  value: typeof n == "string" ? n : "",
180
- onChange: (e) => a(e.target.value || null),
189
+ onChange: (e) => i(e.target.value || null),
181
190
  "aria-label": t.name,
182
191
  className: "h-7 px-1.5 w-40"
183
192
  });
184
- default: return /* @__PURE__ */ S(k, {
193
+ default: return /* @__PURE__ */ w(j, {
185
194
  property: t,
186
195
  value: n,
187
- onChange: a
196
+ onChange: i
188
197
  });
189
198
  }
190
199
  }
191
- function k({ property: e, value: t, onChange: n }) {
192
- let r = x("docProperties"), i = t == null ? "" : String(t), [a, o] = y(i);
193
- v(() => o(i), [i]);
200
+ function j({ property: e, value: t, onChange: n }) {
201
+ let r = S("docProperties"), i = t == null ? "" : String(t), [a, o] = b(i);
202
+ y(() => o(i), [i]);
194
203
  let s = () => {
195
204
  a !== i && (a.trim() ? n(e.kind === "number" ? Number(a) : a) : n(null));
196
205
  };
197
- return /* @__PURE__ */ S(d, {
206
+ return /* @__PURE__ */ w(f, {
198
207
  type: e.kind === "number" ? "number" : e.kind === "url" ? "url" : "text",
199
208
  value: a,
200
209
  onChange: (e) => o(e.target.value),
@@ -205,45 +214,59 @@ function k({ property: e, value: t, onChange: n }) {
205
214
  className: "h-7 border-transparent px-1.5 shadow-none hover:border-border"
206
215
  });
207
216
  }
208
- function A({ workspace: e, space: t }) {
209
- let n = x("docProperties"), [r, i] = y(!1);
210
- return /* @__PURE__ */ S(f, {
211
- open: r,
212
- onOpenChange: i,
213
- trigger: /* @__PURE__ */ S(s, {
214
- size: "xs",
215
- variant: "ghost",
216
- icon: /* @__PURE__ */ S(o, {}),
217
- className: "mt-1 text-muted-foreground",
218
- children: n("add")
219
- }),
217
+ function M({ workspace: e, space: t, unset: n, admin: r, onPick: i }) {
218
+ let a = S("docProperties"), o = _(), [l, u] = b(null), d = (e) => {
219
+ if (n.length === 0) {
220
+ u(e);
221
+ return;
222
+ }
223
+ let t = n.map((e) => ({
224
+ label: e.name,
225
+ onClick: () => i(e.id)
226
+ }));
227
+ r && t.push(g, {
228
+ label: a("new"),
229
+ onClick: () => u(e)
230
+ }), o(e, t);
231
+ };
232
+ return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(c, {
233
+ size: "xs",
234
+ variant: "ghost",
235
+ icon: /* @__PURE__ */ w(s, {}),
236
+ className: "mt-1 text-muted-foreground",
237
+ onClick: (e) => d(e.currentTarget),
238
+ children: a("add")
239
+ }), l && /* @__PURE__ */ w(p, {
240
+ open: !0,
241
+ onOpenChange: (e) => !e && u(null),
242
+ at: l,
220
243
  align: "start",
221
244
  className: "w-72",
222
245
  initialFocus: "first-control",
223
- "aria-label": n("add"),
224
- children: /* @__PURE__ */ S(j, {
246
+ "aria-label": a("new"),
247
+ children: /* @__PURE__ */ w(N, {
225
248
  workspace: e,
226
249
  space: t,
227
- onDone: () => i(!1)
250
+ onDone: () => u(null)
228
251
  })
229
- });
252
+ })] });
230
253
  }
231
- function j({ workspace: e, space: n, property: i, onDone: a, onRemove: o }) {
232
- let c = x("docProperties"), f = b(), h = r(e), [g, _] = y(i?.name ?? ""), [v, w] = y(i?.kind ?? "text"), [T, E] = y((i?.options ?? []).map((e) => e.name).join("\n")), D = v === "select" || v === "multi_select", O = () => T.split("\n").map((e) => e.trim()).filter(Boolean).map((e) => {
233
- let t = i?.options.find((t) => t.name === e)?.id;
254
+ function N({ workspace: e, space: t, property: r, onDone: a, onRemove: o }) {
255
+ let s = S("docProperties"), l = x(), p = i(e), [g, _] = b(r?.name ?? ""), [v, y] = b(r?.kind ?? "text"), [C, E] = b((r?.options ?? []).map((e) => e.name).join("\n")), D = v === "select" || v === "multi_select", O = () => C.split("\n").map((e) => e.trim()).filter(Boolean).map((e) => {
256
+ let t = r?.options.find((t) => t.name === e)?.id;
234
257
  return {
235
258
  name: e,
236
259
  ...t && { id: t }
237
260
  };
238
- }), k = i ? h.update : h.create;
239
- return /* @__PURE__ */ C("form", {
261
+ }), k = r ? p.update : p.create;
262
+ return /* @__PURE__ */ T("form", {
240
263
  onSubmit: (e) => {
241
- e.preventDefault(), i ? h.update.mutate({
242
- id: i.id,
264
+ e.preventDefault(), r ? p.update.mutate({
265
+ id: r.id,
243
266
  name: g,
244
267
  ...D && { options: O() }
245
- }, { onSuccess: a }) : h.create.mutate({
246
- ...n && { space: n },
268
+ }, { onSuccess: a }) : p.create.mutate({
269
+ ...t && { space: t },
247
270
  name: g,
248
271
  kind: v,
249
272
  ...D && { options: O() }
@@ -251,9 +274,9 @@ function j({ workspace: e, space: n, property: i, onDone: a, onRemove: o }) {
251
274
  },
252
275
  className: "space-y-3 text-sm",
253
276
  children: [
254
- /* @__PURE__ */ C("label", {
277
+ /* @__PURE__ */ T("label", {
255
278
  className: "block text-xs font-medium text-muted-foreground",
256
- children: [c("name"), /* @__PURE__ */ S(d, {
279
+ children: [s("name"), /* @__PURE__ */ w(f, {
257
280
  value: g,
258
281
  onChange: (e) => _(e.target.value),
259
282
  required: !0,
@@ -261,60 +284,60 @@ function j({ workspace: e, space: n, property: i, onDone: a, onRemove: o }) {
261
284
  className: "mt-1"
262
285
  })]
263
286
  }),
264
- !i && /* @__PURE__ */ C("div", {
287
+ !r && /* @__PURE__ */ T("div", {
265
288
  className: "text-xs font-medium text-muted-foreground",
266
- children: [c("kind"), /* @__PURE__ */ S("div", {
289
+ children: [s("kind"), /* @__PURE__ */ w("div", {
267
290
  className: "mt-1",
268
- children: /* @__PURE__ */ S(p, {
291
+ children: /* @__PURE__ */ w(m, {
269
292
  value: v,
270
- items: t.map((e) => ({
293
+ items: n.map((e) => ({
271
294
  value: e,
272
- label: c(`kinds.${e}`)
295
+ label: s(`kinds.${e}`)
273
296
  })),
274
- onValueChange: w,
275
- "aria-label": c("kind"),
297
+ onValueChange: y,
298
+ "aria-label": s("kind"),
276
299
  width: "fill"
277
300
  })
278
301
  })]
279
302
  }),
280
- D && /* @__PURE__ */ C("label", {
303
+ D && /* @__PURE__ */ T("label", {
281
304
  className: "block text-xs font-medium text-muted-foreground",
282
305
  children: [
283
- c("options"),
284
- /* @__PURE__ */ S(m, {
285
- value: T,
306
+ s("options"),
307
+ /* @__PURE__ */ w(h, {
308
+ value: C,
286
309
  onChange: (e) => E(e.target.value),
287
310
  rows: 4,
288
311
  className: "mt-1"
289
312
  }),
290
- /* @__PURE__ */ S("span", {
313
+ /* @__PURE__ */ w("span", {
291
314
  className: "mt-1 block font-normal",
292
- children: c("optionsHint")
315
+ children: s("optionsHint")
293
316
  })
294
317
  ]
295
318
  }),
296
- k.error && /* @__PURE__ */ S(l, { children: f(k.error) }),
297
- /* @__PURE__ */ C("div", {
319
+ k.error && /* @__PURE__ */ w(u, { children: l(k.error) }),
320
+ /* @__PURE__ */ T("div", {
298
321
  className: "flex justify-between gap-2",
299
- children: [o ? /* @__PURE__ */ S(u, {
322
+ children: [o ? /* @__PURE__ */ w(d, {
300
323
  variant: "ghost",
301
324
  size: "sm",
302
- label: c("remove"),
303
- icon: /* @__PURE__ */ S("span", {
325
+ label: s("remove"),
326
+ icon: /* @__PURE__ */ w("span", {
304
327
  "aria-hidden": !0,
305
328
  children: "×"
306
329
  }),
307
330
  onClick: o
308
- }) : /* @__PURE__ */ S("span", {}), /* @__PURE__ */ S(s, {
331
+ }) : /* @__PURE__ */ w("span", {}), /* @__PURE__ */ w(c, {
309
332
  type: "submit",
310
333
  size: "sm",
311
334
  variant: "primary",
312
335
  loading: k.isPending,
313
336
  disabled: !g.trim(),
314
- children: c(i ? "save" : "add")
337
+ children: s(r ? "save" : "add")
315
338
  })]
316
339
  })
317
340
  ]
318
341
  });
319
342
  }
320
- export { E as DocProperties, O as PropertyField, T as usePropertyText };
343
+ export { O as DocProperties, A as PropertyField, D as usePropertyText };