@nice2dev/ui 1.4.2 → 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.
@@ -260,5 +260,6 @@ const ce = [
260
260
  { displayName: "NiceMarkdownEditor" }
261
261
  );
262
262
  export {
263
- he as NiceMarkdownEditor
263
+ he as NiceMarkdownEditor,
264
+ oe as mdToHtml
264
265
  };
@@ -1,172 +1,211 @@
1
- import { jsxs as c, jsx as e, Fragment as q } from "react/jsx-runtime";
2
- import { useNiceAccessMode as V, useNiceTranslation as ee, useControlId as ie, useTreeFocus as te, NiceIcon as s, sanitizeHtml as ne, clickOnActivationKey as ce } from "@nice2dev/ui-core";
3
- import { forwardRef as ae, useState as b, useMemo as re, useCallback as B, useRef as le } from "react";
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 se = [], _e = /* @__PURE__ */ Object.assign(
6
- /* @__PURE__ */ ae(
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: v,
9
- helperText: y,
10
- error: u,
11
- disabled: a,
12
- readOnly: h,
13
- size: H = "md",
14
- id: C,
15
- className: x,
16
- style: K,
17
- accessMode: M,
18
- pages: k = se,
19
- selectedPageId: l,
20
- content: m = "",
21
- contentFormat: R = "html",
22
- editing: w = !1,
23
- onPageSelect: T,
24
- onContentChange: P,
25
- onSave: z,
26
- onCreatePage: p,
27
- onDeletePage: g,
28
- onEditToggle: D,
29
- onVersionHistory: S,
30
- sidebarWidth: Q = 260,
31
- sidebarCollapsed: $ = !1,
32
- onSidebarToggle: _,
33
- searchable: O = !0,
34
- onSearch: A
35
- }, G) => {
36
- const N = V(M, C), I = N === "hidden";
37
- N === "disabled" && (a = !0), N === "readOnly" && (h = !0);
38
- const { t: i } = ee(), J = ie(C), [U, X] = b(""), [o, E] = b(""), [Y, f] = b(!1), r = re(() => {
39
- const n = (d) => {
40
- for (const t of d) {
41
- if (t.id === l)
42
- return t;
43
- if (t.children) {
44
- const j = n(t.children);
45
- if (j)
46
- return j;
47
- }
48
- }
49
- };
50
- return n(k);
51
- }, [k, l]), Z = B(
52
- (n) => {
53
- X(n), A?.(n);
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
- [A]
56
- ), F = B(() => {
57
- o.trim() && (p?.(l ?? null, o.trim()), E(""), f(!1));
58
- }, [o, l, p]), L = le(null);
59
- te(L, { rowSelector: ".nice-wiki__tree-node", onToggle: () => {
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 W = (n, d = 0) => /* @__PURE__ */ e(
100
+ const q = (i, w = 0) => /* @__PURE__ */ e(
62
101
  "ul",
63
102
  {
64
103
  className: "nice-wiki__tree",
65
- role: d > 0 ? "group" : "none",
66
- style: { paddingLeft: d > 0 ? 16 : 0 },
67
- children: n.map((t) => /* @__PURE__ */ c(
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": t.title,
73
- "aria-selected": t.id === l,
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: ce,
81
- className: `nice-wiki__tree-node${t.id === l ? " nice-wiki__tree-node--active" : ""}${t.isDraft ? " nice-wiki__tree-node--draft" : ""}`,
82
- onClick: () => T?.(t),
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(s, { name: t.children?.length ? "folder" : "file", size: 14 }) }),
85
- /* @__PURE__ */ e("span", { className: "nice-wiki__tree-title", children: t.title }),
86
- t.isDraft && /* @__PURE__ */ e("span", { className: "nice-wiki__tree-draft", children: i("draft", "Draft") })
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
- t.children && t.children.length > 0 && W(t.children, d + 1)
129
+ r.children && r.children.length > 0 && q(r.children, w + 1)
91
130
  ]
92
131
  },
93
- t.id
132
+ r.id
94
133
  ))
95
134
  }
96
135
  );
97
- return I ? null : /* @__PURE__ */ c(
136
+ return de ? null : /* @__PURE__ */ c(
98
137
  "div",
99
138
  {
100
- ref: G,
101
- id: J,
102
- className: `nice-wiki nice-size-${H}${x ? ` ${x}` : ""}${a ? " nice-disabled" : ""}`,
103
- style: K,
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
- !$ && /* @__PURE__ */ c("aside", { className: "nice-wiki__sidebar", style: { width: Q }, children: [
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: v ?? i("wiki", "Wiki") }),
108
- _ && /* @__PURE__ */ e(
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: () => _(!0),
114
- "aria-label": i("collapseSidebar", "Collapse sidebar"),
115
- children: /* @__PURE__ */ e(s, { name: "chevron-left", size: 16 })
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
- O && /* @__PURE__ */ e(
158
+ se && /* @__PURE__ */ e(
120
159
  "input",
121
160
  {
122
161
  type: "text",
123
162
  className: "nice-input nice-wiki__search",
124
- value: U,
125
- onChange: (n) => Z(n.target.value),
126
- placeholder: i("searchPages", "Search pages…"),
127
- disabled: a
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: L,
172
+ ref: Q,
134
173
  className: "nice-wiki__page-tree",
135
174
  role: "tree",
136
- "aria-label": v ?? i("wiki", "Wiki"),
137
- children: W(k)
175
+ "aria-label": d ?? n("wiki", "Wiki"),
176
+ children: q(we)
138
177
  }
139
178
  ),
140
- p && !h && /* @__PURE__ */ e("div", { className: "nice-wiki__sidebar-footer", children: Y ? /* @__PURE__ */ c("div", { className: "nice-wiki__create-form", children: [
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: o,
147
- onChange: (n) => E(n.target.value),
148
- placeholder: i("pageTitle", "Page title"),
149
- onKeyDown: (n) => n.key === "Enter" && F(),
150
- disabled: a
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: a || !o.trim(),
158
- onClick: F,
159
- "aria-label": i("create", "Create"),
160
- children: /* @__PURE__ */ e(s, { name: "check", size: 14 })
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: () => f(!1),
168
- "aria-label": i("cancel", "Cancel"),
169
- children: /* @__PURE__ */ e(s, { name: "close", size: 14 })
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: () => f(!0),
178
- disabled: a,
216
+ onClick: () => x(!0),
217
+ disabled: t,
179
218
  children: [
180
- /* @__PURE__ */ e(s, { name: "plus", size: 14 }),
219
+ /* @__PURE__ */ e(o, { name: "plus", size: 14 }),
181
220
  " ",
182
- i("newPage", "New page")
221
+ n("newPage", "New page")
183
222
  ]
184
223
  }
185
224
  ) })
186
225
  ] }),
187
- $ && _ && /* @__PURE__ */ e(
226
+ A && b && /* @__PURE__ */ e(
188
227
  "button",
189
228
  {
190
229
  type: "button",
191
230
  className: "nice-wiki__sidebar-expand",
192
- onClick: () => _(!1),
193
- "aria-label": i("expandSidebar", "Expand sidebar"),
194
- children: /* @__PURE__ */ e(s, { name: "chevron-right", size: 16 })
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: r ? /* @__PURE__ */ c(q, { children: [
198
- /* @__PURE__ */ c("div", { className: "nice-wiki__content-header", children: [
199
- /* @__PURE__ */ e("h1", { className: "nice-wiki__page-title", children: r.title }),
200
- /* @__PURE__ */ c("div", { className: "nice-wiki__content-actions", children: [
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
- disabled: a,
206
- onClick: () => D(!w),
207
- children: w ? i("preview", "Preview") : i("edit", "Edit")
243
+ className: "nice-wiki__breadcrumb",
244
+ onClick: () => F(i),
245
+ children: i.title
208
246
  }
209
247
  ),
210
- S && /* @__PURE__ */ e(
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: a,
215
- onClick: () => S(r.id),
216
- children: i("history", "History")
279
+ disabled: t,
280
+ onClick: () => $(l.id),
281
+ children: n("history", "History")
217
282
  }
218
283
  ),
219
- g && !h && /* @__PURE__ */ e(
284
+ T && !s && /* @__PURE__ */ e(
220
285
  "button",
221
286
  {
222
287
  type: "button",
223
288
  className: "nice-btn--danger",
224
- disabled: a,
225
- onClick: () => g(r.id),
226
- children: i("delete", "Delete")
289
+ disabled: t,
290
+ onClick: () => T(l.id),
291
+ children: n("delete", "Delete")
227
292
  }
228
293
  )
229
294
  ] })
230
295
  ] }),
231
- r.updatedAt && /* @__PURE__ */ c("div", { className: "nice-wiki__page-meta", children: [
232
- r.updatedBy && /* @__PURE__ */ c("span", { children: [
233
- i("lastEditedBy", "Last edited by"),
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
- r.updatedBy
300
+ l.updatedBy
236
301
  ] }),
237
- /* @__PURE__ */ e("span", { children: new Date(r.updatedAt).toLocaleDateString() })
302
+ /* @__PURE__ */ e("span", { children: new Date(l.updatedAt).toLocaleDateString() })
238
303
  ] }),
239
- w ? /* @__PURE__ */ c("div", { className: "nice-wiki__editor", children: [
240
- /* @__PURE__ */ e(
241
- "textarea",
242
- {
243
- className: "nice-wiki__editor-textarea",
244
- value: m,
245
- onChange: (n) => P?.(n.target.value),
246
- disabled: a
247
- }
248
- ),
249
- z && /* @__PURE__ */ e(
250
- "button",
251
- {
252
- type: "button",
253
- className: "nice-btn nice-btn--primary",
254
- disabled: a,
255
- onClick: () => z(r.id, m),
256
- children: i("save", "Save")
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
- dangerouslySetInnerHTML: { __html: ne(m) }
325
+ "data-format": S,
326
+ dangerouslySetInnerHTML: {
327
+ __html: ze(
328
+ S === "html" ? v : We(v)
329
+ )
330
+ }
264
331
  }
265
- ) : /* @__PURE__ */ e("pre", { className: "nice-wiki__markdown", children: m }) })
266
- ] }) : /* @__PURE__ */ e("div", { className: "nice-wiki__empty", children: /* @__PURE__ */ e("p", { children: i("selectPage", "Select a page from the sidebar or create a new one.") }) }) }),
267
- y && /* @__PURE__ */ e("span", { className: "nice-helper-text", children: y }),
268
- u && typeof u == "string" && /* @__PURE__ */ e("span", { className: "nice-error-text", children: u })
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
- _e as NiceWiki
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-CT9hEXpc.cjs"),e=require("./NiceMention-BZEHqPrf.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;
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
- /** Placeholder for the start input. */
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
- /** Content of the currently selected page (HTML or Markdown). */
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 { }