@nice2dev/ui 1.4.3 → 1.4.4
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/CHANGELOG.md +31 -0
- package/dist/{NiceDataGrid-CrKDzMM1.cjs → NiceDataGrid-mrnaLHQk.cjs} +1 -1
- package/dist/{NiceForm-CT9hEXpc.cjs → NiceForm-O3sv-DNX.cjs} +1 -1
- package/dist/NiceMention-tgJKS8PH.cjs +432 -0
- package/dist/{NiceSavedQueryPanel-C5Ab_NWx.cjs → NiceSavedQueryPanel-BPGpKWN2.cjs} +1 -1
- package/dist/{NiceScheduler-BZQAKEVF.cjs → NiceScheduler-Boo-D1S-.cjs} +1 -1
- package/dist/{core-lazy-VTd5zfoZ.cjs → core-lazy-C_qnVGxE.cjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/editors/pickers/NiceDateRangeBox.mjs +258 -227
- package/dist/editors/pickers/NiceDateTimePicker.mjs +403 -388
- package/dist/editors/rich/NiceMarkdownEditor.mjs +2 -1
- package/dist/editors/rich/NiceWiki.mjs +225 -158
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +29 -7
- package/dist/index.cjs +112 -112
- package/dist/index.d.ts +90 -7
- package/dist/index.mjs +716 -713
- package/dist/style.css +2 -2
- package/dist/tools/NiceThemeGalleryPicker.mjs +362 -0
- package/package.json +4 -4
- package/dist/NiceMention-BZEHqPrf.cjs +0 -432
|
@@ -1,172 +1,211 @@
|
|
|
1
|
-
import { jsxs as c, jsx as e, Fragment as
|
|
2
|
-
import { useNiceAccessMode as
|
|
3
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import { useNiceAccessMode as ve, useNiceTranslation as Ce, useControlId as ye, useControllableState as J, useTreeFocus as Se, NiceIcon as o, sanitizeHtml as ze, clickOnActivationKey as Ee } from "@nice2dev/ui-core";
|
|
3
|
+
import Pe, { forwardRef as xe, useState as N, useMemo as O, useCallback as I, useRef as De } from "react";
|
|
4
|
+
import { NiceHtmlEditor as Ie } from "./NiceHtmlEditor.mjs";
|
|
5
|
+
import { NiceMarkdownEditor as Le, mdToHtml as We } from "./NiceMarkdownEditor.mjs";
|
|
4
6
|
/* empty css */
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
+
const He = [];
|
|
8
|
+
function U(d, h) {
|
|
9
|
+
for (const a of d) {
|
|
10
|
+
if (a.id === h)
|
|
11
|
+
return [a];
|
|
12
|
+
const t = a.children ? U(a.children, h) : [];
|
|
13
|
+
if (t.length > 0)
|
|
14
|
+
return [a, ...t];
|
|
15
|
+
}
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
function X(d, h) {
|
|
19
|
+
const a = h.trim().toLowerCase();
|
|
20
|
+
if (!a)
|
|
21
|
+
return d;
|
|
22
|
+
const t = [];
|
|
23
|
+
for (const s of d) {
|
|
24
|
+
const p = s.children ? X(s.children, a) : [];
|
|
25
|
+
(s.title.toLowerCase().includes(a) || (s.content ?? "").toLowerCase().includes(a) || p.length > 0) && t.push({ ...s, children: p });
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
}
|
|
29
|
+
const Be = /* @__PURE__ */ Object.assign(
|
|
30
|
+
/* @__PURE__ */ xe(
|
|
7
31
|
({
|
|
8
|
-
label:
|
|
9
|
-
helperText:
|
|
10
|
-
error:
|
|
11
|
-
disabled:
|
|
12
|
-
readOnly:
|
|
13
|
-
size:
|
|
14
|
-
id:
|
|
15
|
-
className:
|
|
16
|
-
style:
|
|
17
|
-
accessMode:
|
|
18
|
-
pages:
|
|
19
|
-
selectedPageId:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
32
|
+
label: d,
|
|
33
|
+
helperText: h,
|
|
34
|
+
error: a,
|
|
35
|
+
disabled: t,
|
|
36
|
+
readOnly: s,
|
|
37
|
+
size: p = "md",
|
|
38
|
+
id: y,
|
|
39
|
+
className: L,
|
|
40
|
+
style: Y,
|
|
41
|
+
accessMode: Z,
|
|
42
|
+
pages: m = He,
|
|
43
|
+
selectedPageId: ee,
|
|
44
|
+
defaultSelectedPageId: ie,
|
|
45
|
+
content: W,
|
|
46
|
+
contentFormat: S = "html",
|
|
47
|
+
editing: te,
|
|
48
|
+
defaultEditing: ne,
|
|
49
|
+
onPageSelect: H,
|
|
50
|
+
onContentChange: ce,
|
|
51
|
+
onSave: ae,
|
|
52
|
+
onCreatePage: z,
|
|
53
|
+
onDeletePage: T,
|
|
54
|
+
onEditToggle: le,
|
|
55
|
+
onVersionHistory: $,
|
|
56
|
+
sidebarWidth: re = 260,
|
|
57
|
+
sidebarCollapsed: A = !1,
|
|
58
|
+
onSidebarToggle: b,
|
|
59
|
+
searchable: se = !0,
|
|
60
|
+
onSearch: M
|
|
61
|
+
}, oe) => {
|
|
62
|
+
const E = ve(Z, y), de = E === "hidden";
|
|
63
|
+
E === "disabled" && (t = !0), E === "readOnly" && (s = !0);
|
|
64
|
+
const { t: n } = Ce(), he = ye(y), [P, ue] = N(""), [_, R] = N(""), [me, x] = N(!1), [u, j] = J(
|
|
65
|
+
{
|
|
66
|
+
value: ee,
|
|
67
|
+
defaultValue: ie,
|
|
68
|
+
fallbackValue: m[0]?.id,
|
|
69
|
+
componentName: "NiceWiki"
|
|
70
|
+
}
|
|
71
|
+
), [B, D] = J({
|
|
72
|
+
value: te,
|
|
73
|
+
defaultValue: ne,
|
|
74
|
+
fallbackValue: !1,
|
|
75
|
+
onChange: le,
|
|
76
|
+
componentName: "NiceWiki"
|
|
77
|
+
}), g = W !== void 0, [_e, ke] = N({}), [fe, k] = N(null), f = O(() => U(m, u), [m, u]), l = f[f.length - 1], we = O(() => X(m, P), [m, P]), v = g ? W ?? "" : l ? _e[String(l.id)] ?? l.content ?? "" : "", C = g ? v : fe ?? v, F = I(
|
|
78
|
+
(i) => {
|
|
79
|
+
k(null), j(i.id), H?.(i);
|
|
80
|
+
},
|
|
81
|
+
[H, j]
|
|
82
|
+
), K = (i) => {
|
|
83
|
+
g || k(i), ce?.(i);
|
|
84
|
+
}, Ne = () => {
|
|
85
|
+
k(null), D(!0);
|
|
86
|
+
}, pe = () => {
|
|
87
|
+
k(null), D(!1);
|
|
88
|
+
}, be = () => {
|
|
89
|
+
l && (g || (ke((i) => ({ ...i, [String(l.id)]: C })), k(null)), ae?.(l.id, C), D(!1));
|
|
90
|
+
}, ge = I(
|
|
91
|
+
(i) => {
|
|
92
|
+
ue(i), M?.(i);
|
|
54
93
|
},
|
|
55
|
-
[
|
|
56
|
-
),
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
|
|
94
|
+
[M]
|
|
95
|
+
), V = I(() => {
|
|
96
|
+
_.trim() && (z?.(u ?? null, _.trim()), R(""), x(!1));
|
|
97
|
+
}, [_, u, z]), Q = De(null);
|
|
98
|
+
Se(Q, { rowSelector: ".nice-wiki__tree-node", onToggle: () => {
|
|
60
99
|
} });
|
|
61
|
-
const
|
|
100
|
+
const q = (i, w = 0) => /* @__PURE__ */ e(
|
|
62
101
|
"ul",
|
|
63
102
|
{
|
|
64
103
|
className: "nice-wiki__tree",
|
|
65
|
-
role:
|
|
66
|
-
style: { paddingLeft:
|
|
67
|
-
children:
|
|
104
|
+
role: w > 0 ? "group" : "none",
|
|
105
|
+
style: { paddingLeft: w > 0 ? 16 : 0 },
|
|
106
|
+
children: i.map((r) => /* @__PURE__ */ c(
|
|
68
107
|
"li",
|
|
69
108
|
{
|
|
70
109
|
className: "nice-wiki__tree-item",
|
|
71
110
|
role: "treeitem",
|
|
72
|
-
"aria-label":
|
|
73
|
-
"aria-selected":
|
|
111
|
+
"aria-label": r.title,
|
|
112
|
+
"aria-selected": r.id === u,
|
|
74
113
|
children: [
|
|
75
114
|
/* @__PURE__ */ c(
|
|
76
115
|
"div",
|
|
77
116
|
{
|
|
78
117
|
role: "button",
|
|
79
118
|
tabIndex: 0,
|
|
80
|
-
onKeyDown:
|
|
81
|
-
className: `nice-wiki__tree-node${
|
|
82
|
-
onClick: () =>
|
|
119
|
+
onKeyDown: Ee,
|
|
120
|
+
className: `nice-wiki__tree-node${r.id === u ? " nice-wiki__tree-node--active" : ""}${r.isDraft ? " nice-wiki__tree-node--draft" : ""}`,
|
|
121
|
+
onClick: () => F(r),
|
|
83
122
|
children: [
|
|
84
|
-
/* @__PURE__ */ e("span", { className: "nice-wiki__tree-icon", children: /* @__PURE__ */ e(
|
|
85
|
-
/* @__PURE__ */ e("span", { className: "nice-wiki__tree-title", children:
|
|
86
|
-
|
|
123
|
+
/* @__PURE__ */ e("span", { className: "nice-wiki__tree-icon", children: /* @__PURE__ */ e(o, { name: r.children?.length ? "folder" : "file", size: 14 }) }),
|
|
124
|
+
/* @__PURE__ */ e("span", { className: "nice-wiki__tree-title", children: r.title }),
|
|
125
|
+
r.isDraft && /* @__PURE__ */ e("span", { className: "nice-wiki__tree-draft", children: n("draft", "Draft") })
|
|
87
126
|
]
|
|
88
127
|
}
|
|
89
128
|
),
|
|
90
|
-
|
|
129
|
+
r.children && r.children.length > 0 && q(r.children, w + 1)
|
|
91
130
|
]
|
|
92
131
|
},
|
|
93
|
-
|
|
132
|
+
r.id
|
|
94
133
|
))
|
|
95
134
|
}
|
|
96
135
|
);
|
|
97
|
-
return
|
|
136
|
+
return de ? null : /* @__PURE__ */ c(
|
|
98
137
|
"div",
|
|
99
138
|
{
|
|
100
|
-
ref:
|
|
101
|
-
id:
|
|
102
|
-
className: `nice-wiki nice-size-${
|
|
103
|
-
style:
|
|
139
|
+
ref: oe,
|
|
140
|
+
id: he,
|
|
141
|
+
className: `nice-wiki nice-size-${p}${L ? ` ${L}` : ""}${t ? " nice-disabled" : ""}`,
|
|
142
|
+
style: Y,
|
|
104
143
|
children: [
|
|
105
|
-
|
|
144
|
+
!A && /* @__PURE__ */ c("aside", { className: "nice-wiki__sidebar", style: { width: re }, children: [
|
|
106
145
|
/* @__PURE__ */ c("div", { className: "nice-wiki__sidebar-header", children: [
|
|
107
|
-
/* @__PURE__ */ e("span", { className: "nice-wiki__sidebar-title", children:
|
|
108
|
-
|
|
146
|
+
/* @__PURE__ */ e("span", { className: "nice-wiki__sidebar-title", children: d ?? n("wiki", "Wiki") }),
|
|
147
|
+
b && /* @__PURE__ */ e(
|
|
109
148
|
"button",
|
|
110
149
|
{
|
|
111
150
|
type: "button",
|
|
112
151
|
className: "nice-wiki__sidebar-toggle",
|
|
113
|
-
onClick: () =>
|
|
114
|
-
"aria-label":
|
|
115
|
-
children: /* @__PURE__ */ e(
|
|
152
|
+
onClick: () => b(!0),
|
|
153
|
+
"aria-label": n("collapseSidebar", "Collapse sidebar"),
|
|
154
|
+
children: /* @__PURE__ */ e(o, { name: "chevron-left", size: 16 })
|
|
116
155
|
}
|
|
117
156
|
)
|
|
118
157
|
] }),
|
|
119
|
-
|
|
158
|
+
se && /* @__PURE__ */ e(
|
|
120
159
|
"input",
|
|
121
160
|
{
|
|
122
161
|
type: "text",
|
|
123
162
|
className: "nice-input nice-wiki__search",
|
|
124
|
-
value:
|
|
125
|
-
onChange: (
|
|
126
|
-
placeholder:
|
|
127
|
-
disabled:
|
|
163
|
+
value: P,
|
|
164
|
+
onChange: (i) => ge(i.target.value),
|
|
165
|
+
placeholder: n("searchPages", "Search pages…"),
|
|
166
|
+
disabled: t
|
|
128
167
|
}
|
|
129
168
|
),
|
|
130
169
|
/* @__PURE__ */ e(
|
|
131
170
|
"div",
|
|
132
171
|
{
|
|
133
|
-
ref:
|
|
172
|
+
ref: Q,
|
|
134
173
|
className: "nice-wiki__page-tree",
|
|
135
174
|
role: "tree",
|
|
136
|
-
"aria-label":
|
|
137
|
-
children:
|
|
175
|
+
"aria-label": d ?? n("wiki", "Wiki"),
|
|
176
|
+
children: q(we)
|
|
138
177
|
}
|
|
139
178
|
),
|
|
140
|
-
|
|
179
|
+
z && !s && /* @__PURE__ */ e("div", { className: "nice-wiki__sidebar-footer", children: me ? /* @__PURE__ */ c("div", { className: "nice-wiki__create-form", children: [
|
|
141
180
|
/* @__PURE__ */ e(
|
|
142
181
|
"input",
|
|
143
182
|
{
|
|
144
183
|
type: "text",
|
|
145
184
|
className: "nice-input",
|
|
146
|
-
value:
|
|
147
|
-
onChange: (
|
|
148
|
-
placeholder:
|
|
149
|
-
onKeyDown: (
|
|
150
|
-
disabled:
|
|
185
|
+
value: _,
|
|
186
|
+
onChange: (i) => R(i.target.value),
|
|
187
|
+
placeholder: n("pageTitle", "Page title"),
|
|
188
|
+
onKeyDown: (i) => i.key === "Enter" && V(),
|
|
189
|
+
disabled: t
|
|
151
190
|
}
|
|
152
191
|
),
|
|
153
192
|
/* @__PURE__ */ e(
|
|
154
193
|
"button",
|
|
155
194
|
{
|
|
156
195
|
type: "button",
|
|
157
|
-
disabled:
|
|
158
|
-
onClick:
|
|
159
|
-
"aria-label":
|
|
160
|
-
children: /* @__PURE__ */ e(
|
|
196
|
+
disabled: t || !_.trim(),
|
|
197
|
+
onClick: V,
|
|
198
|
+
"aria-label": n("create", "Create"),
|
|
199
|
+
children: /* @__PURE__ */ e(o, { name: "check", size: 14 })
|
|
161
200
|
}
|
|
162
201
|
),
|
|
163
202
|
/* @__PURE__ */ e(
|
|
164
203
|
"button",
|
|
165
204
|
{
|
|
166
205
|
type: "button",
|
|
167
|
-
onClick: () =>
|
|
168
|
-
"aria-label":
|
|
169
|
-
children: /* @__PURE__ */ e(
|
|
206
|
+
onClick: () => x(!1),
|
|
207
|
+
"aria-label": n("cancel", "Cancel"),
|
|
208
|
+
children: /* @__PURE__ */ e(o, { name: "close", size: 14 })
|
|
170
209
|
}
|
|
171
210
|
)
|
|
172
211
|
] }) : /* @__PURE__ */ c(
|
|
@@ -174,98 +213,126 @@ const se = [], _e = /* @__PURE__ */ Object.assign(
|
|
|
174
213
|
{
|
|
175
214
|
type: "button",
|
|
176
215
|
className: "nice-wiki__add-page",
|
|
177
|
-
onClick: () =>
|
|
178
|
-
disabled:
|
|
216
|
+
onClick: () => x(!0),
|
|
217
|
+
disabled: t,
|
|
179
218
|
children: [
|
|
180
|
-
/* @__PURE__ */ e(
|
|
219
|
+
/* @__PURE__ */ e(o, { name: "plus", size: 14 }),
|
|
181
220
|
" ",
|
|
182
|
-
|
|
221
|
+
n("newPage", "New page")
|
|
183
222
|
]
|
|
184
223
|
}
|
|
185
224
|
) })
|
|
186
225
|
] }),
|
|
187
|
-
|
|
226
|
+
A && b && /* @__PURE__ */ e(
|
|
188
227
|
"button",
|
|
189
228
|
{
|
|
190
229
|
type: "button",
|
|
191
230
|
className: "nice-wiki__sidebar-expand",
|
|
192
|
-
onClick: () =>
|
|
193
|
-
"aria-label":
|
|
194
|
-
children: /* @__PURE__ */ e(
|
|
231
|
+
onClick: () => b(!1),
|
|
232
|
+
"aria-label": n("expandSidebar", "Expand sidebar"),
|
|
233
|
+
children: /* @__PURE__ */ e(o, { name: "chevron-right", size: 16 })
|
|
195
234
|
}
|
|
196
235
|
),
|
|
197
|
-
/* @__PURE__ */ e("main", { className: "nice-wiki__content", children:
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
|
|
201
|
-
D && !h && /* @__PURE__ */ e(
|
|
236
|
+
/* @__PURE__ */ e("main", { className: "nice-wiki__content", children: l ? /* @__PURE__ */ c(G, { children: [
|
|
237
|
+
f.length > 1 && /* @__PURE__ */ e("nav", { className: "nice-wiki__breadcrumbs", "aria-label": d ?? n("wiki", "Wiki"), children: f.map(
|
|
238
|
+
(i, w) => w < f.length - 1 ? /* @__PURE__ */ c(Pe.Fragment, { children: [
|
|
239
|
+
/* @__PURE__ */ e(
|
|
202
240
|
"button",
|
|
203
241
|
{
|
|
204
242
|
type: "button",
|
|
205
|
-
|
|
206
|
-
onClick: () =>
|
|
207
|
-
children:
|
|
243
|
+
className: "nice-wiki__breadcrumb",
|
|
244
|
+
onClick: () => F(i),
|
|
245
|
+
children: i.title
|
|
208
246
|
}
|
|
209
247
|
),
|
|
210
|
-
|
|
248
|
+
/* @__PURE__ */ e(o, { name: "chevron-right", size: 12 })
|
|
249
|
+
] }, i.id) : /* @__PURE__ */ e("span", { className: "nice-wiki__breadcrumb", "aria-current": "page", children: i.title }, i.id)
|
|
250
|
+
) }),
|
|
251
|
+
/* @__PURE__ */ c("div", { className: "nice-wiki__content-header", children: [
|
|
252
|
+
/* @__PURE__ */ e("h1", { className: "nice-wiki__page-title", children: l.title }),
|
|
253
|
+
/* @__PURE__ */ c("div", { className: "nice-wiki__content-actions", children: [
|
|
254
|
+
!s && (B ? /* @__PURE__ */ c(G, { children: [
|
|
255
|
+
/* @__PURE__ */ c(
|
|
256
|
+
"button",
|
|
257
|
+
{
|
|
258
|
+
type: "button",
|
|
259
|
+
className: "nice-btn nice-btn--primary",
|
|
260
|
+
disabled: t,
|
|
261
|
+
onClick: be,
|
|
262
|
+
children: [
|
|
263
|
+
/* @__PURE__ */ e(o, { name: "check", size: 14 }),
|
|
264
|
+
" ",
|
|
265
|
+
n("save", "Save")
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
),
|
|
269
|
+
/* @__PURE__ */ e("button", { type: "button", disabled: t, onClick: pe, children: n("cancel", "Cancel") })
|
|
270
|
+
] }) : /* @__PURE__ */ c("button", { type: "button", disabled: t, onClick: Ne, children: [
|
|
271
|
+
/* @__PURE__ */ e(o, { name: "edit", size: 14 }),
|
|
272
|
+
" ",
|
|
273
|
+
n("edit", "Edit")
|
|
274
|
+
] })),
|
|
275
|
+
$ && /* @__PURE__ */ e(
|
|
211
276
|
"button",
|
|
212
277
|
{
|
|
213
278
|
type: "button",
|
|
214
|
-
disabled:
|
|
215
|
-
onClick: () =>
|
|
216
|
-
children:
|
|
279
|
+
disabled: t,
|
|
280
|
+
onClick: () => $(l.id),
|
|
281
|
+
children: n("history", "History")
|
|
217
282
|
}
|
|
218
283
|
),
|
|
219
|
-
|
|
284
|
+
T && !s && /* @__PURE__ */ e(
|
|
220
285
|
"button",
|
|
221
286
|
{
|
|
222
287
|
type: "button",
|
|
223
288
|
className: "nice-btn--danger",
|
|
224
|
-
disabled:
|
|
225
|
-
onClick: () =>
|
|
226
|
-
children:
|
|
289
|
+
disabled: t,
|
|
290
|
+
onClick: () => T(l.id),
|
|
291
|
+
children: n("delete", "Delete")
|
|
227
292
|
}
|
|
228
293
|
)
|
|
229
294
|
] })
|
|
230
295
|
] }),
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
296
|
+
l.updatedAt && /* @__PURE__ */ c("div", { className: "nice-wiki__page-meta", children: [
|
|
297
|
+
l.updatedBy && /* @__PURE__ */ c("span", { children: [
|
|
298
|
+
n("lastEditedBy", "Last edited by"),
|
|
234
299
|
" ",
|
|
235
|
-
|
|
300
|
+
l.updatedBy
|
|
236
301
|
] }),
|
|
237
|
-
/* @__PURE__ */ e("span", { children: new Date(
|
|
302
|
+
/* @__PURE__ */ e("span", { children: new Date(l.updatedAt).toLocaleDateString() })
|
|
238
303
|
] }),
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
)
|
|
259
|
-
] }) : /* @__PURE__ */ e("div", { className: "nice-wiki__viewer", children: R === "html" ? /* @__PURE__ */ e(
|
|
304
|
+
B && !s ? /* @__PURE__ */ e("div", { className: "nice-wiki__editor", children: S === "markdown" ? /* @__PURE__ */ e(
|
|
305
|
+
Le,
|
|
306
|
+
{
|
|
307
|
+
value: C,
|
|
308
|
+
onChange: K,
|
|
309
|
+
preview: "side",
|
|
310
|
+
minHeight: 320,
|
|
311
|
+
disabled: t
|
|
312
|
+
}
|
|
313
|
+
) : /* @__PURE__ */ e(
|
|
314
|
+
Ie,
|
|
315
|
+
{
|
|
316
|
+
value: C,
|
|
317
|
+
onChange: K,
|
|
318
|
+
height: 320,
|
|
319
|
+
disabled: t
|
|
320
|
+
}
|
|
321
|
+
) }) : /* @__PURE__ */ e("div", { className: "nice-wiki__viewer", children: /* @__PURE__ */ e(
|
|
260
322
|
"div",
|
|
261
323
|
{
|
|
262
324
|
className: "nice-wiki__html",
|
|
263
|
-
|
|
325
|
+
"data-format": S,
|
|
326
|
+
dangerouslySetInnerHTML: {
|
|
327
|
+
__html: ze(
|
|
328
|
+
S === "html" ? v : We(v)
|
|
329
|
+
)
|
|
330
|
+
}
|
|
264
331
|
}
|
|
265
|
-
)
|
|
266
|
-
] }) : /* @__PURE__ */ e("div", { className: "nice-wiki__empty", children: /* @__PURE__ */ e("p", { children:
|
|
267
|
-
|
|
268
|
-
|
|
332
|
+
) })
|
|
333
|
+
] }) : /* @__PURE__ */ e("div", { className: "nice-wiki__empty", children: /* @__PURE__ */ e("p", { children: n("selectPage", "Select a page from the sidebar or create a new one.") }) }) }),
|
|
334
|
+
h && /* @__PURE__ */ e("span", { className: "nice-helper-text", children: h }),
|
|
335
|
+
a && typeof a == "string" && /* @__PURE__ */ e("span", { className: "nice-error-text", children: a })
|
|
269
336
|
]
|
|
270
337
|
}
|
|
271
338
|
);
|
|
@@ -274,5 +341,5 @@ const se = [], _e = /* @__PURE__ */ Object.assign(
|
|
|
274
341
|
{ displayName: "NiceWiki" }
|
|
275
342
|
);
|
|
276
343
|
export {
|
|
277
|
-
|
|
344
|
+
Be as NiceWiki
|
|
278
345
|
};
|
package/dist/editors.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./no-code-B3BHeyG-.cjs"),i=require("./NiceForm-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./no-code-B3BHeyG-.cjs"),i=require("./NiceForm-O3sv-DNX.cjs"),e=require("./NiceMention-tgJKS8PH.cjs"),o=require("./NiceSelect-BNPXs6FQ.cjs"),N=require("./pickerCommons-CwcCc8Qi.cjs"),t=require("./NiceColorPicker-BLwYNSXJ.cjs"),r=require("./NiceHtmlEditor-C1OVtLQ6.cjs"),n=require("./NiceCodeEditor-DhdjnDLV.cjs");exports.NiceCheckbox=c.NiceCheckbox;exports.NiceNumberInput=c.NiceNumberInput;exports.NiceTextInput=c.NiceTextInput;exports.MASK_PRESETS=i.MASK_PRESETS;exports.NiceAutocomplete=i.NiceAutocomplete;exports.NiceCalendar=i.NiceCalendar;exports.NiceCountryPicker=i.NiceCountryPicker;exports.NiceDateTimePicker=i.NiceDateTimePicker;exports.NiceForm=i.NiceForm;exports.NiceMaskedInput=i.NiceMaskedInput;exports.NicePasswordInput=i.NicePasswordInput;exports.NiceRadioGroup=i.NiceRadioGroup;exports.NiceRating=i.NiceRating;exports.NiceSlider=i.NiceSlider;exports.NiceTagBox=i.NiceTagBox;exports.NiceTextArea=i.NiceTextArea;exports.NiceUpload=i.NiceUpload;exports.NICE_COLOR_PRESET_KEYS=e.NICE_COLOR_PRESET_KEYS;exports.NiceAccountPicker=e.NiceAccountPicker;exports.NiceAddressInput=e.NiceAddressInput;exports.NiceCodeEditorAI=e.NiceCodeEditorAI;exports.NiceColorPalette=e.NiceColorPalette;exports.NiceContactPicker=e.NiceContactPicker;exports.NiceCropEditor=e.NiceCropEditor;exports.NiceDateRangeBox=e.NiceDateRangeBox;exports.NiceDocumentEditor=e.NiceDocumentEditor;exports.NiceDropDownBox=e.NiceDropDownBox;exports.NiceEmojiPicker=e.NiceEmojiPicker;exports.NiceGradientPicker=e.NiceGradientPicker;exports.NiceHtmlEditorAI=e.NiceHtmlEditorAI;exports.NiceImageAnnotator=e.NiceImageAnnotator;exports.NiceImageEditor=e.NiceImageEditor;exports.NiceInputOtp=e.NiceInputOtp;exports.NiceInvoiceLineEditor=e.NiceInvoiceLineEditor;exports.NiceKeyValueEditor=e.NiceKeyValueEditor;exports.NiceKnob=e.NiceKnob;exports.NiceLogConsole=e.NiceLogConsole;exports.NiceLookup=e.NiceLookup;exports.NiceMarkdownEditor=e.NiceMarkdownEditor;exports.NiceMention=e.NiceMention;exports.NicePDFAnnotationEditor=e.NicePDFAnnotationEditor;exports.NicePickList=e.NicePickList;exports.NiceRangeSlider=e.NiceRangeSlider;exports.NiceScannerControl=e.NiceScannerControl;exports.NiceScriptRunner=e.NiceScriptRunner;exports.NiceSignature=e.NiceSignature;exports.NiceTreeSelect=e.NiceTreeSelect;exports.NiceWiki=e.NiceWiki;exports.NiceSelect=o.NiceSelect;exports.NiceToggle=N.NiceToggle;exports.NiceColorPicker=t.NiceColorPicker;exports.NiceHtmlEditor=r.NiceHtmlEditor;exports.NiceCodeEditor=n.NiceCodeEditor;
|
package/dist/editors.d.ts
CHANGED
|
@@ -979,9 +979,13 @@ export declare interface NiceDateRangeBoxProps extends NiceFormFieldProps {
|
|
|
979
979
|
max?: string;
|
|
980
980
|
/** Show a clear button. */
|
|
981
981
|
clearable?: boolean;
|
|
982
|
-
/**
|
|
982
|
+
/**
|
|
983
|
+
* Placeholder for the start input. Default: the field's date mask in the locale's order
|
|
984
|
+
* (`DD.MM.YYYY`), so the format to type in shows (1.4.4 — it was "Start date"); with
|
|
985
|
+
* `singleField`, both ends' masks (`DD.MM.YYYY – DD.MM.YYYY`).
|
|
986
|
+
*/
|
|
983
987
|
startPlaceholder?: string;
|
|
984
|
-
/** Placeholder for the end input. */
|
|
988
|
+
/** Placeholder for the end input. Default: the field's date mask, as the start's. */
|
|
985
989
|
endPlaceholder?: string;
|
|
986
990
|
/** Label shown above (or before) the start picker. */
|
|
987
991
|
startLabel?: string;
|
|
@@ -990,7 +994,9 @@ export declare interface NiceDateRangeBoxProps extends NiceFormFieldProps {
|
|
|
990
994
|
/**
|
|
991
995
|
* Collapse the pair into ONE field with ONE popup: the field shows
|
|
992
996
|
* `start – end` and the popup holds a single calendar on which the span is
|
|
993
|
-
* painted in two clicks. Default `false` (two fields, two popups).
|
|
997
|
+
* painted in two clicks. Default `false` (two fields, two popups). Both ends can also be typed
|
|
998
|
+
* into the field through its mask (1.4.4; days, days with a time, months — weeks and times only
|
|
999
|
+
* pick); an end is set once its half is a real date.
|
|
994
1000
|
*/
|
|
995
1001
|
singleField?: boolean;
|
|
996
1002
|
/** Layout direction for the two pickers (default `horizontal`). */
|
|
@@ -2743,6 +2749,10 @@ export declare interface NiceUploadProps extends NiceBaseProps {
|
|
|
2743
2749
|
/**
|
|
2744
2750
|
* {@link NiceWiki} — Wiki module with page tree sidebar, rich content area,
|
|
2745
2751
|
* inline editor (edit mode), page create/delete, and version history hooks.
|
|
2752
|
+
* Works on its own since 1.4.4: each page can carry its `content`, and the selection, the edit
|
|
2753
|
+
* mode and the saved edits are kept inside unless their props are given; the tree filters as
|
|
2754
|
+
* you search, breadcrumbs lead back up, Markdown renders, and edit mode uses NiceMarkdownEditor
|
|
2755
|
+
* or NiceHtmlEditor with Save and Cancel.
|
|
2746
2756
|
*/
|
|
2747
2757
|
export declare const NiceWiki: default_2.ForwardRefExoticComponent<NiceWikiProps & default_2.RefAttributes<HTMLDivElement>> & {
|
|
2748
2758
|
displayName: string;
|
|
@@ -2751,14 +2761,21 @@ export declare const NiceWiki: default_2.ForwardRefExoticComponent<NiceWikiProps
|
|
|
2751
2761
|
export declare interface NiceWikiProps extends NiceFormFieldProps {
|
|
2752
2762
|
/** Page tree. Defaults to none. */
|
|
2753
2763
|
pages?: WikiPage[];
|
|
2754
|
-
/** Currently selected page id. */
|
|
2764
|
+
/** Currently selected page id — **controlled**. Omit it to let the wiki keep its own selection. */
|
|
2755
2765
|
selectedPageId?: string | number;
|
|
2756
|
-
/**
|
|
2766
|
+
/** The page selected first in the uncontrolled mode (1.4.4). Default: the first page. */
|
|
2767
|
+
defaultSelectedPageId?: string | number;
|
|
2768
|
+
/**
|
|
2769
|
+
* Content of the currently selected page (HTML or Markdown) — **controlled**. Omit it and the
|
|
2770
|
+
* wiki shows each page's own `content`, edits it in a draft and keeps what is saved (1.4.4).
|
|
2771
|
+
*/
|
|
2757
2772
|
content?: string;
|
|
2758
|
-
/** Content format. */
|
|
2773
|
+
/** Content format: HTML (edited in NiceHtmlEditor) or Markdown (NiceMarkdownEditor, rendered). */
|
|
2759
2774
|
contentFormat?: 'html' | 'markdown';
|
|
2760
|
-
/** Whether the editor is in edit mode. */
|
|
2775
|
+
/** Whether the editor is in edit mode — **controlled**. Omit it to let the Edit button work alone. */
|
|
2761
2776
|
editing?: boolean;
|
|
2777
|
+
/** Edit mode at first in the uncontrolled mode (1.4.4). Default `false`. */
|
|
2778
|
+
defaultEditing?: boolean;
|
|
2762
2779
|
/** Fires when a page is selected. */
|
|
2763
2780
|
onPageSelect?: (page: WikiPage) => void;
|
|
2764
2781
|
/** Fires when content changes (in edit mode). */
|
|
@@ -2884,6 +2901,11 @@ declare interface WikiPage {
|
|
|
2884
2901
|
updatedBy?: string;
|
|
2885
2902
|
/** Whether this page is a draft. */
|
|
2886
2903
|
isDraft?: boolean;
|
|
2904
|
+
/**
|
|
2905
|
+
* The page's content (in `contentFormat`) — shown, edited and saved inside the wiki when the
|
|
2906
|
+
* `content` prop is not given (1.4.4), so a wiki works from its page data alone.
|
|
2907
|
+
*/
|
|
2908
|
+
content?: string;
|
|
2887
2909
|
}
|
|
2888
2910
|
|
|
2889
2911
|
export { }
|