@commercetools/nimbus 0.0.0-canary-20250903150359 → 0.0.0-canary-20250903194502

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 (34) hide show
  1. package/dist/chunks/rich-text-input-C5lp1D-D.cjs.js +7 -0
  2. package/dist/chunks/rich-text-input-C5lp1D-D.cjs.js.map +1 -0
  3. package/dist/chunks/{rich-text-input-CgrxAPHc.es.js → rich-text-input-CYlc7Ozc.es.js} +186 -173
  4. package/dist/chunks/rich-text-input-CYlc7Ozc.es.js.map +1 -0
  5. package/dist/chunks/slate-helpers-CcSj-DBm.cjs.js +24 -0
  6. package/dist/chunks/slate-helpers-CcSj-DBm.cjs.js.map +1 -0
  7. package/dist/chunks/slate-helpers-DsTiLoO8.es.js +9042 -0
  8. package/dist/chunks/slate-helpers-DsTiLoO8.es.js.map +1 -0
  9. package/dist/chunks/use-formatting-state-B26nE9CO.es.js +113 -0
  10. package/dist/chunks/use-formatting-state-B26nE9CO.es.js.map +1 -0
  11. package/dist/chunks/use-formatting-state-D7zenGZW.cjs.js +2 -0
  12. package/dist/chunks/use-formatting-state-D7zenGZW.cjs.js.map +1 -0
  13. package/dist/components/components.cjs +1 -1
  14. package/dist/components/components.es.js +1 -1
  15. package/dist/components/hooks.cjs +1 -1
  16. package/dist/components/hooks.es.js +1 -1
  17. package/dist/components/rich-text-input.cjs +1 -1
  18. package/dist/components/rich-text-input.es.js +1 -1
  19. package/dist/components/utils.cjs +1 -1
  20. package/dist/components/utils.es.js +2 -2
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.es.js +2 -2
  23. package/package.json +8 -8
  24. package/dist/chunks/rich-text-input-CItP9BzJ.cjs.js +0 -2
  25. package/dist/chunks/rich-text-input-CItP9BzJ.cjs.js.map +0 -1
  26. package/dist/chunks/rich-text-input-CgrxAPHc.es.js.map +0 -1
  27. package/dist/chunks/slate-helpers-BN_9Hky2.cjs.js +0 -24
  28. package/dist/chunks/slate-helpers-BN_9Hky2.cjs.js.map +0 -1
  29. package/dist/chunks/slate-helpers-DunxggA8.es.js +0 -6919
  30. package/dist/chunks/slate-helpers-DunxggA8.es.js.map +0 -1
  31. package/dist/chunks/use-formatting-state-DVcnyVBl.cjs.js +0 -2
  32. package/dist/chunks/use-formatting-state-DVcnyVBl.cjs.js.map +0 -1
  33. package/dist/chunks/use-formatting-state-DdKYccZs.es.js +0 -247
  34. package/dist/chunks/use-formatting-state-DdKYccZs.es.js.map +0 -1
@@ -1,10 +1,10 @@
1
- import { jsx as o, jsxs as n } from "react/jsx-runtime";
2
- import { forwardRef as ae, useMemo as se, useCallback as M, useImperativeHandle as de, useState as G, useRef as ce, useEffect as he } from "react";
3
- import { defineSlotRecipe as ue, createSlotRecipeContext as pe, useSlotRecipe as fe } from "@chakra-ui/react";
4
- import { e as ge } from "./extractStyleProps-vA4cNUoc.es.js";
5
- import { h as _, j as W, O as N, P as j, k as me, w as ye, l as ve, r as xe, e as Se, g as be, L as we, m as Re, c as B, n as Te, o as Me, u as Y, b as V, f as q, t as De, v as Ie } from "./slate-helpers-DunxggA8.es.js";
6
- import { a as Ce, u as Z, c as Be, b as Le } from "./use-formatting-state-DdKYccZs.es.js";
7
- import { EDITOR_DEFAULTS as I, textStyles as Pe } from "../components/constants.es.js";
1
+ import { jsx as r, jsxs as n } from "react/jsx-runtime";
2
+ import { forwardRef as se, useMemo as de, useCallback as M, useImperativeHandle as ce, useState as G, useRef as ue, useEffect as he } from "react";
3
+ import { defineSlotRecipe as pe, createSlotRecipeContext as fe, useSlotRecipe as ge } from "@chakra-ui/react";
4
+ import { e as me } from "./extractStyleProps-vA4cNUoc.es.js";
5
+ import { j as _, k as W, O as N, P as j, w as ye, l as ve, r as xe, e as Se, g as be, L as we, m as Re, c as P, n as Te, o as Me, u as Z, b as V, f as q, t as De, v as Ie } from "./slate-helpers-DsTiLoO8.es.js";
6
+ import { a as Ce, u as $, c as Pe, b as Be } from "./use-formatting-state-B26nE9CO.es.js";
7
+ import { EDITOR_DEFAULTS as I, textStyles as Le } from "../components/constants.es.js";
8
8
  import { B as b } from "./box-DuBoAZvq.es.js";
9
9
  import { D as X } from "./divider--BAm3ca4.es.js";
10
10
  import { G as J } from "./group-CqfSQXe7.es.js";
@@ -14,10 +14,10 @@ import { T as v } from "./text-DfQpupDi.es.js";
14
14
  import { b as d } from "./tooltip-B1YdruCE.es.js";
15
15
  import { V as T } from "./visually-hidden-BluyWhUI.es.js";
16
16
  import { T as Q } from "./toggle-button-group-jRdpdYyd.es.js";
17
- import { T as ze } from "./toolbar-hpBfKrTl.es.js";
18
- import { MoreHoriz as He, FormatStrikethrough as Ee, Code as Fe, KeyboardArrowDown as Oe, FormatBold as Ve, FormatItalic as Ae, FormatUnderlined as We, FormatListBulleted as Ne, FormatListNumbered as ke, Undo as Ke, Redo as Ue } from "@commercetools/nimbus-icons";
17
+ import { T as Oe } from "./toolbar-hpBfKrTl.es.js";
18
+ import { MoreHoriz as ze, FormatStrikethrough as He, Code as Ee, KeyboardArrowDown as Fe, FormatBold as Ve, FormatItalic as Ae, FormatUnderlined as We, FormatListBulleted as Ne, FormatListNumbered as ke, Undo as Ke, Redo as Ue } from "@commercetools/nimbus-icons";
19
19
  import { M as g } from "./menu-8g9Hn1nm.es.js";
20
- const $ = /* @__PURE__ */ ue({
20
+ const ee = /* @__PURE__ */ pe({
21
21
  slots: ["root", "toolbar", "editable"],
22
22
  className: "nimbus-rich-text-input",
23
23
  base: {
@@ -137,22 +137,35 @@ const $ = /* @__PURE__ */ ue({
137
137
  }
138
138
  },
139
139
  variants: {}
140
- }), { withProvider: Ge, withContext: ee } = /* @__PURE__ */ pe({
141
- recipe: $
142
- }), _e = /* @__PURE__ */ Ge("div", "root"), je = /* @__PURE__ */ ee("div", "toolbar"), qe = /* @__PURE__ */ ee("div", "editable");
143
- var Xe = {
140
+ }), { withProvider: Ge, withContext: te } = /* @__PURE__ */ fe({
141
+ recipe: ee
142
+ }), _e = /* @__PURE__ */ Ge("div", "root"), je = /* @__PURE__ */ te("div", "toolbar"), qe = /* @__PURE__ */ te("div", "editable");
143
+ /*!
144
+ * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
145
+ *
146
+ * Copyright (c) 2014-2017, Jon Schlinkert.
147
+ * Released under the MIT License.
148
+ */
149
+ function Y(e) {
150
+ return Object.prototype.toString.call(e) === "[object Object]";
151
+ }
152
+ function Xe(e) {
153
+ var t, o;
154
+ return Y(e) === !1 ? !1 : (t = e.constructor, t === void 0 ? !0 : (o = t.prototype, !(Y(o) === !1 || o.hasOwnProperty("isPrototypeOf") === !1)));
155
+ }
156
+ var Je = {
144
157
  /**
145
158
  * Check if a value is a `History` object.
146
159
  */
147
160
  isHistory(e) {
148
- return me(e) && Array.isArray(e.redos) && Array.isArray(e.undos) && (e.redos.length === 0 || N.isOperationList(e.redos[0].operations)) && (e.undos.length === 0 || N.isOperationList(e.undos[0].operations));
161
+ return Xe(e) && Array.isArray(e.redos) && Array.isArray(e.undos) && (e.redos.length === 0 || N.isOperationList(e.redos[0].operations)) && (e.undos.length === 0 || N.isOperationList(e.undos[0].operations));
149
162
  }
150
163
  }, A = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), m = {
151
164
  /**
152
165
  * Check if a value is a `HistoryEditor` object.
153
166
  */
154
167
  isHistoryEditor(e) {
155
- return Xe.isHistory(e.history) && W.isEditor(e);
168
+ return Je.isHistory(e.history) && W.isEditor(e);
156
169
  },
157
170
  /**
158
171
  * Get the merge flag's current value.
@@ -192,8 +205,8 @@ var Xe = {
192
205
  * be merged into the previous history.
193
206
  */
194
207
  withMerging(e, t) {
195
- var i = m.isMerging(e);
196
- S.set(e, !0), t(), S.set(e, i);
208
+ var o = m.isMerging(e);
209
+ S.set(e, !0), t(), S.set(e, o);
197
210
  },
198
211
  /**
199
212
  * Apply a series of changes inside a synchronous `fn`, ensuring that the first
@@ -201,33 +214,33 @@ var Xe = {
201
214
  * merged as usual.
202
215
  */
203
216
  withNewBatch(e, t) {
204
- var i = m.isMerging(e);
205
- S.set(e, !0), C.set(e, !0), t(), S.set(e, i), C.delete(e);
217
+ var o = m.isMerging(e);
218
+ S.set(e, !0), C.set(e, !0), t(), S.set(e, o), C.delete(e);
206
219
  },
207
220
  /**
208
221
  * Apply a series of changes inside a synchronous `fn`, without merging any of
209
222
  * the new operations into previous save point in the history.
210
223
  */
211
224
  withoutMerging(e, t) {
212
- var i = m.isMerging(e);
213
- S.set(e, !1), t(), S.set(e, i);
225
+ var o = m.isMerging(e);
226
+ S.set(e, !1), t(), S.set(e, o);
214
227
  },
215
228
  /**
216
229
  * Apply a series of changes inside a synchronous `fn`, without saving any of
217
230
  * their operations into the history.
218
231
  */
219
232
  withoutSaving(e, t) {
220
- var i = m.isSaving(e);
233
+ var o = m.isSaving(e);
221
234
  A.set(e, !1);
222
235
  try {
223
236
  t();
224
237
  } finally {
225
- A.set(e, i);
238
+ A.set(e, o);
226
239
  }
227
240
  }
228
- }, Je = (e) => {
241
+ }, Qe = (e) => {
229
242
  var t = e, {
230
- apply: i
243
+ apply: o
231
244
  } = t;
232
245
  return t.history = {
233
246
  undos: [],
@@ -258,8 +271,8 @@ var Xe = {
258
271
  m.withoutSaving(t, () => {
259
272
  W.withoutNormalizing(t, () => {
260
273
  var c = s.operations.map(N.inverse).reverse();
261
- for (var h of c)
262
- t.apply(h);
274
+ for (var u of c)
275
+ t.apply(u);
263
276
  s.selectionBefore && _.setSelection(t, s.selectionBefore);
264
277
  });
265
278
  }), t.writeHistory("redos", s), a.undos.pop();
@@ -270,79 +283,79 @@ var Xe = {
270
283
  history: s
271
284
  } = t, {
272
285
  undos: c
273
- } = s, h = c[c.length - 1], y = h && h.operations[h.operations.length - 1], f = m.isSaving(t), u = m.isMerging(t);
274
- if (f == null && (f = Ye(a)), f) {
275
- if (u == null && (h == null ? u = !1 : l.length !== 0 ? u = !0 : u = Qe(a, y)), m.isSplittingOnce(t) && (u = !1, m.setSplittingOnce(t, void 0)), h && u)
276
- h.operations.push(a);
286
+ } = s, u = c[c.length - 1], y = u && u.operations[u.operations.length - 1], f = m.isSaving(t), h = m.isMerging(t);
287
+ if (f == null && (f = Ze(a)), f) {
288
+ if (h == null && (u == null ? h = !1 : l.length !== 0 ? h = !0 : h = Ye(a, y)), m.isSplittingOnce(t) && (h = !1, m.setSplittingOnce(t, void 0)), u && h)
289
+ u.operations.push(a);
277
290
  else {
278
- var r = {
291
+ var i = {
279
292
  operations: [a],
280
293
  selectionBefore: t.selection
281
294
  };
282
- t.writeHistory("undos", r);
295
+ t.writeHistory("undos", i);
283
296
  }
284
297
  for (; c.length > 100; )
285
298
  c.shift();
286
299
  s.redos = [];
287
300
  }
288
- i(a);
301
+ o(a);
289
302
  }, t.writeHistory = (a, l) => {
290
303
  t.history[a].push(l);
291
304
  }, t;
292
- }, Qe = (e, t) => !!(t && e.type === "insert_text" && t.type === "insert_text" && e.offset === t.offset + t.text.length && j.equals(e.path, t.path) || t && e.type === "remove_text" && t.type === "remove_text" && e.offset + e.text.length === t.offset && j.equals(e.path, t.path)), Ye = (e, t) => e.type !== "set_selection";
293
- const te = /* @__PURE__ */ ae((e, t) => {
305
+ }, Ye = (e, t) => !!(t && e.type === "insert_text" && t.type === "insert_text" && e.offset === t.offset + t.text.length && j.equals(e.path, t.path) || t && e.type === "remove_text" && t.type === "remove_text" && e.offset + e.text.length === t.offset && j.equals(e.path, t.path)), Ze = (e, t) => e.type !== "set_selection";
306
+ const re = /* @__PURE__ */ se((e, t) => {
294
307
  const {
295
- value: i,
308
+ value: o,
296
309
  onChange: a,
297
310
  onFocus: l,
298
311
  onBlur: s,
299
312
  placeholder: c = I.placeholder,
300
- isDisabled: h = I.isDisabled,
313
+ isDisabled: u = I.isDisabled,
301
314
  isReadOnly: y = I.isReadOnly,
302
315
  autoFocus: f = I.autoFocus,
303
- toolbar: u
304
- } = e, r = se(() => {
316
+ toolbar: h
317
+ } = e, i = de(() => {
305
318
  const p = Me();
306
- return ye(Je(ve(p)));
307
- }, []), { handleKeyDown: L } = Ce({ editor: r }), P = M(
319
+ return ye(Qe(ve(p)));
320
+ }, []), { handleKeyDown: B } = Ce({ editor: i }), L = M(
308
321
  (p) => {
309
322
  l && l(p);
310
323
  },
311
324
  [l]
312
- ), z = M(
325
+ ), O = M(
313
326
  (p) => {
314
327
  s && s(p);
315
328
  },
316
329
  [s]
317
330
  );
318
- de(
331
+ ce(
319
332
  t,
320
333
  () => ({
321
- focus: () => Se(r),
322
- resetValue: (p) => xe(r, p)
334
+ focus: () => Se(i),
335
+ resetValue: (p) => xe(i, p)
323
336
  }),
324
- [r]
337
+ [i]
325
338
  );
326
- const H = M(
327
- (p) => /* @__PURE__ */ o(be, { ...p }),
339
+ const z = M(
340
+ (p) => /* @__PURE__ */ r(be, { ...p }),
328
341
  []
329
- ), E = M(
330
- (p) => /* @__PURE__ */ o(we, { ...p }),
342
+ ), H = M(
343
+ (p) => /* @__PURE__ */ r(we, { ...p }),
331
344
  []
332
- ), F = B(), O = Array.isArray(i) && i.length > 0 ? i : F;
333
- return /* @__PURE__ */ n(Re, { editor: r, value: O, onChange: a, children: [
334
- u && /* @__PURE__ */ o(je, { children: u }),
335
- /* @__PURE__ */ o(qe, { asChild: !0, children: /* @__PURE__ */ o(
345
+ ), E = P(), F = Array.isArray(o) && o.length > 0 ? o : E;
346
+ return /* @__PURE__ */ n(Re, { editor: i, initialValue: F, onChange: a, children: [
347
+ h && /* @__PURE__ */ r(je, { children: h }),
348
+ /* @__PURE__ */ r(qe, { asChild: !0, children: /* @__PURE__ */ r(
336
349
  Te,
337
350
  {
338
- renderElement: H,
339
- renderLeaf: E,
351
+ renderElement: z,
352
+ renderLeaf: H,
340
353
  placeholder: c,
341
354
  autoFocus: f,
342
- readOnly: y || h,
343
- onKeyDown: L,
344
- onFocus: P,
345
- onBlur: z,
355
+ readOnly: y || u,
356
+ onKeyDown: B,
357
+ onFocus: L,
358
+ onBlur: O,
346
359
  "aria-label": "Rich text editor",
347
360
  role: "textbox",
348
361
  "aria-multiline": "true"
@@ -350,10 +363,10 @@ const te = /* @__PURE__ */ ae((e, t) => {
350
363
  ) })
351
364
  ] });
352
365
  });
353
- te.displayName = "RichTextEditor";
354
- const Ze = ({ isDisabled: e = !1 }) => {
355
- const t = Y(), i = Z(t), { allSelectedKeys: a, handleAllSelectionChange: l } = Be({
356
- withPreservedSelection: i
366
+ re.displayName = "RichTextEditor";
367
+ const $e = ({ isDisabled: e = !1 }) => {
368
+ const t = Z(), o = $(t), { allSelectedKeys: a, handleAllSelectionChange: l } = Pe({
369
+ withPreservedSelection: o
357
370
  });
358
371
  return /* @__PURE__ */ n(
359
372
  g.Root,
@@ -363,7 +376,7 @@ const Ze = ({ isDisabled: e = !1 }) => {
363
376
  onSelectionChange: l,
364
377
  children: [
365
378
  /* @__PURE__ */ n(d.Root, { delay: 0, closeDelay: 0, children: [
366
- /* @__PURE__ */ o(g.Trigger, { asChild: !0, children: /* @__PURE__ */ o(
379
+ /* @__PURE__ */ r(g.Trigger, { asChild: !0, children: /* @__PURE__ */ r(
367
380
  k,
368
381
  {
369
382
  size: "xs",
@@ -371,27 +384,27 @@ const Ze = ({ isDisabled: e = !1 }) => {
371
384
  "aria-label": "More formatting options",
372
385
  isDisabled: e,
373
386
  onMouseDown: (s) => s.preventDefault(),
374
- children: /* @__PURE__ */ o(He, {})
387
+ children: /* @__PURE__ */ r(ze, {})
375
388
  }
376
389
  ) }),
377
- /* @__PURE__ */ o(d.Content, { placement: "top", children: "More styles" })
390
+ /* @__PURE__ */ r(d.Content, { placement: "top", children: "More styles" })
378
391
  ] }),
379
392
  /* @__PURE__ */ n(g.Content, { children: [
380
- /* @__PURE__ */ o(g.Item, { id: "strikethrough", children: /* @__PURE__ */ n(b, { slot: "label", display: "flex", alignItems: "center", gap: "200", children: [
381
- /* @__PURE__ */ o(Ee, {}),
382
- /* @__PURE__ */ o(v, { textStyle: "sm", children: "Strikethrough" })
393
+ /* @__PURE__ */ r(g.Item, { id: "strikethrough", children: /* @__PURE__ */ n(b, { slot: "label", display: "flex", alignItems: "center", gap: "200", children: [
394
+ /* @__PURE__ */ r(He, {}),
395
+ /* @__PURE__ */ r(v, { textStyle: "sm", children: "Strikethrough" })
383
396
  ] }) }),
384
- /* @__PURE__ */ o(g.Item, { id: "code", children: /* @__PURE__ */ n(b, { slot: "label", display: "flex", alignItems: "center", gap: "200", children: [
385
- /* @__PURE__ */ o(Fe, {}),
386
- /* @__PURE__ */ o(v, { textStyle: "sm", children: "Code" })
397
+ /* @__PURE__ */ r(g.Item, { id: "code", children: /* @__PURE__ */ n(b, { slot: "label", display: "flex", alignItems: "center", gap: "200", children: [
398
+ /* @__PURE__ */ r(Ee, {}),
399
+ /* @__PURE__ */ r(v, { textStyle: "sm", children: "Code" })
387
400
  ] }) }),
388
- /* @__PURE__ */ o(g.Item, { id: "superscript", children: /* @__PURE__ */ n(b, { slot: "label", display: "flex", alignItems: "center", gap: "200", children: [
389
- /* @__PURE__ */ o(v, { children: "X²" }),
390
- /* @__PURE__ */ o(v, { textStyle: "sm", children: "Superscript" })
401
+ /* @__PURE__ */ r(g.Item, { id: "superscript", children: /* @__PURE__ */ n(b, { slot: "label", display: "flex", alignItems: "center", gap: "200", children: [
402
+ /* @__PURE__ */ r(v, { children: "X²" }),
403
+ /* @__PURE__ */ r(v, { textStyle: "sm", children: "Superscript" })
391
404
  ] }) }),
392
- /* @__PURE__ */ o(g.Item, { id: "subscript", children: /* @__PURE__ */ n(b, { slot: "label", display: "flex", alignItems: "center", gap: "200", children: [
393
- /* @__PURE__ */ o(v, { children: "X₂" }),
394
- /* @__PURE__ */ o(v, { textStyle: "sm", children: "Subscript" })
405
+ /* @__PURE__ */ r(g.Item, { id: "subscript", children: /* @__PURE__ */ n(b, { slot: "label", display: "flex", alignItems: "center", gap: "200", children: [
406
+ /* @__PURE__ */ r(v, { children: "X₂" }),
407
+ /* @__PURE__ */ r(v, { textStyle: "sm", children: "Subscript" })
395
408
  ] }) })
396
409
  ] })
397
410
  ]
@@ -400,18 +413,18 @@ const Ze = ({ isDisabled: e = !1 }) => {
400
413
  }, oe = ({
401
414
  isDisabled: e = !1
402
415
  }) => {
403
- const t = Y(), i = Z(t), {
416
+ const t = Z(), o = $(t), {
404
417
  currentTextStyle: a,
405
418
  selectedTextStyleLabel: l,
406
419
  handleTextStyleChange: s,
407
420
  handleListToggle: c,
408
- selectedFormatKeys: h,
421
+ selectedFormatKeys: u,
409
422
  selectedListKeys: y,
410
423
  hasUndos: f,
411
- hasRedos: u
412
- } = Le({ withPreservedSelection: i });
424
+ hasRedos: h
425
+ } = Be({ withPreservedSelection: o });
413
426
  return /* @__PURE__ */ n(
414
- ze,
427
+ Oe,
415
428
  {
416
429
  orientation: "horizontal",
417
430
  "aria-label": "Text formatting",
@@ -419,13 +432,13 @@ const Ze = ({ isDisabled: e = !1 }) => {
419
432
  overflow: "hidden",
420
433
  size: "xs",
421
434
  children: [
422
- /* @__PURE__ */ o(J, { children: /* @__PURE__ */ n(
435
+ /* @__PURE__ */ r(J, { children: /* @__PURE__ */ n(
423
436
  g.Root,
424
437
  {
425
- onAction: (r) => s(String(r)),
438
+ onAction: (i) => s(String(i)),
426
439
  children: [
427
440
  /* @__PURE__ */ n(d.Root, { delay: 0, closeDelay: 0, children: [
428
- /* @__PURE__ */ o(
441
+ /* @__PURE__ */ r(
429
442
  g.Trigger,
430
443
  {
431
444
  height: "800",
@@ -434,36 +447,36 @@ const Ze = ({ isDisabled: e = !1 }) => {
434
447
  borderRadius: "200",
435
448
  _hover: { bg: "primary.2" },
436
449
  isDisabled: e,
437
- onMouseDown: (r) => r.preventDefault(),
450
+ onMouseDown: (i) => i.preventDefault(),
438
451
  "aria-label": "Text style menu",
439
452
  children: /* @__PURE__ */ n(b, { display: "flex", alignItems: "center", gap: "200", px: "200", children: [
440
- /* @__PURE__ */ o(b, { display: "flex", alignItems: "center", gap: "200", flexGrow: "1", children: /* @__PURE__ */ o(v, { my: "auto", textStyle: "sm", fontWeight: "500", children: l }) }),
441
- /* @__PURE__ */ o(Oe, {})
453
+ /* @__PURE__ */ r(b, { display: "flex", alignItems: "center", gap: "200", flexGrow: "1", children: /* @__PURE__ */ r(v, { my: "auto", textStyle: "sm", fontWeight: "500", children: l }) }),
454
+ /* @__PURE__ */ r(Fe, {})
442
455
  ] })
443
456
  }
444
457
  ),
445
- /* @__PURE__ */ o(d.Content, { placement: "top", children: "Text style" })
458
+ /* @__PURE__ */ r(d.Content, { placement: "top", children: "Text style" })
446
459
  ] }),
447
- /* @__PURE__ */ o(g.Content, { children: Pe.map((r) => /* @__PURE__ */ o(
460
+ /* @__PURE__ */ r(g.Content, { children: Le.map((i) => /* @__PURE__ */ r(
448
461
  g.Item,
449
462
  {
450
- id: r.id,
451
- ...a === r.id && {
463
+ id: i.id,
464
+ ...a === i.id && {
452
465
  "data-state": "checked"
453
466
  },
454
- children: /* @__PURE__ */ o(v, { ...r.props, children: r.label })
467
+ children: /* @__PURE__ */ r(v, { ...i.props, children: i.label })
455
468
  },
456
- r.id
469
+ i.id
457
470
  )) })
458
471
  ]
459
472
  }
460
473
  ) }),
461
- /* @__PURE__ */ o(X, { orientation: "vertical" }),
474
+ /* @__PURE__ */ r(X, { orientation: "vertical" }),
462
475
  /* @__PURE__ */ n(
463
476
  Q.Root,
464
477
  {
465
478
  selectionMode: "multiple",
466
- selectedKeys: h,
479
+ selectedKeys: u,
467
480
  isDisabled: e,
468
481
  children: [
469
482
  /* @__PURE__ */ n(d.Root, { delay: 0, closeDelay: 0, children: [
@@ -475,15 +488,15 @@ const Ze = ({ isDisabled: e = !1 }) => {
475
488
  variant: "ghost",
476
489
  "aria-label": "Bold",
477
490
  isDisabled: e,
478
- onMouseDown: (r) => r.preventDefault(),
479
- onPress: i(() => V(t, "bold")),
491
+ onMouseDown: (i) => i.preventDefault(),
492
+ onPress: o(() => V(t, "bold")),
480
493
  children: [
481
- /* @__PURE__ */ o(Ve, {}),
482
- /* @__PURE__ */ o(T, { children: "Bold" })
494
+ /* @__PURE__ */ r(Ve, {}),
495
+ /* @__PURE__ */ r(T, { children: "Bold" })
483
496
  ]
484
497
  }
485
498
  ),
486
- /* @__PURE__ */ o(d.Content, { placement: "top", children: "Bold" })
499
+ /* @__PURE__ */ r(d.Content, { placement: "top", children: "Bold" })
487
500
  ] }),
488
501
  /* @__PURE__ */ n(d.Root, { delay: 0, closeDelay: 0, children: [
489
502
  /* @__PURE__ */ n(
@@ -494,15 +507,15 @@ const Ze = ({ isDisabled: e = !1 }) => {
494
507
  variant: "ghost",
495
508
  "aria-label": "Italic",
496
509
  isDisabled: e,
497
- onMouseDown: (r) => r.preventDefault(),
498
- onPress: i(() => V(t, "italic")),
510
+ onMouseDown: (i) => i.preventDefault(),
511
+ onPress: o(() => V(t, "italic")),
499
512
  children: [
500
- /* @__PURE__ */ o(Ae, {}),
501
- /* @__PURE__ */ o(T, { children: "Italic" })
513
+ /* @__PURE__ */ r(Ae, {}),
514
+ /* @__PURE__ */ r(T, { children: "Italic" })
502
515
  ]
503
516
  }
504
517
  ),
505
- /* @__PURE__ */ o(d.Content, { placement: "top", children: "Italic" })
518
+ /* @__PURE__ */ r(d.Content, { placement: "top", children: "Italic" })
506
519
  ] }),
507
520
  /* @__PURE__ */ n(d.Root, { delay: 0, closeDelay: 0, children: [
508
521
  /* @__PURE__ */ n(
@@ -513,23 +526,23 @@ const Ze = ({ isDisabled: e = !1 }) => {
513
526
  variant: "ghost",
514
527
  "aria-label": "Underline",
515
528
  isDisabled: e,
516
- onMouseDown: (r) => r.preventDefault(),
517
- onPress: i(
529
+ onMouseDown: (i) => i.preventDefault(),
530
+ onPress: o(
518
531
  () => V(t, "underline")
519
532
  ),
520
533
  children: [
521
- /* @__PURE__ */ o(We, {}),
522
- /* @__PURE__ */ o(T, { children: "Underline" })
534
+ /* @__PURE__ */ r(We, {}),
535
+ /* @__PURE__ */ r(T, { children: "Underline" })
523
536
  ]
524
537
  }
525
538
  ),
526
- /* @__PURE__ */ o(d.Content, { placement: "top", children: "Underline" })
539
+ /* @__PURE__ */ r(d.Content, { placement: "top", children: "Underline" })
527
540
  ] })
528
541
  ]
529
542
  }
530
543
  ),
531
- /* @__PURE__ */ o(Ze, { isDisabled: e }),
532
- /* @__PURE__ */ o(X, { orientation: "vertical" }),
544
+ /* @__PURE__ */ r($e, { isDisabled: e }),
545
+ /* @__PURE__ */ r(X, { orientation: "vertical" }),
533
546
  /* @__PURE__ */ n(
534
547
  Q.Root,
535
548
  {
@@ -540,7 +553,7 @@ const Ze = ({ isDisabled: e = !1 }) => {
540
553
  isDisabled: e,
541
554
  children: [
542
555
  /* @__PURE__ */ n(d.Root, { delay: 0, closeDelay: 0, children: [
543
- /* @__PURE__ */ o(
556
+ /* @__PURE__ */ r(
544
557
  R,
545
558
  {
546
559
  id: "bulleted-list",
@@ -548,14 +561,14 @@ const Ze = ({ isDisabled: e = !1 }) => {
548
561
  variant: "ghost",
549
562
  "aria-label": "Bulleted List",
550
563
  isDisabled: e,
551
- onMouseDown: (r) => r.preventDefault(),
552
- children: /* @__PURE__ */ o(Ne, {})
564
+ onMouseDown: (i) => i.preventDefault(),
565
+ children: /* @__PURE__ */ r(Ne, {})
553
566
  }
554
567
  ),
555
- /* @__PURE__ */ o(d.Content, { placement: "top", children: "Bulleted list" })
568
+ /* @__PURE__ */ r(d.Content, { placement: "top", children: "Bulleted list" })
556
569
  ] }),
557
570
  /* @__PURE__ */ n(d.Root, { delay: 0, closeDelay: 0, children: [
558
- /* @__PURE__ */ o(
571
+ /* @__PURE__ */ r(
559
572
  R,
560
573
  {
561
574
  id: "numbered-list",
@@ -563,16 +576,16 @@ const Ze = ({ isDisabled: e = !1 }) => {
563
576
  variant: "ghost",
564
577
  "aria-label": "Numbered List",
565
578
  isDisabled: e,
566
- onMouseDown: (r) => r.preventDefault(),
567
- children: /* @__PURE__ */ o(ke, {})
579
+ onMouseDown: (i) => i.preventDefault(),
580
+ children: /* @__PURE__ */ r(ke, {})
568
581
  }
569
582
  ),
570
- /* @__PURE__ */ o(d.Content, { placement: "top", children: "Numbered list" })
583
+ /* @__PURE__ */ r(d.Content, { placement: "top", children: "Numbered list" })
571
584
  ] })
572
585
  ]
573
586
  }
574
587
  ),
575
- /* @__PURE__ */ o(b, { flexGrow: "1" }),
588
+ /* @__PURE__ */ r(b, { flexGrow: "1" }),
576
589
  /* @__PURE__ */ n(J, { children: [
577
590
  /* @__PURE__ */ n(d.Root, { delay: 0, closeDelay: 0, children: [
578
591
  /* @__PURE__ */ n(
@@ -582,15 +595,15 @@ const Ze = ({ isDisabled: e = !1 }) => {
582
595
  variant: "ghost",
583
596
  "aria-label": "Undo",
584
597
  isDisabled: !f || e,
585
- onPress: i(() => t.undo()),
586
- onMouseDown: (r) => r.preventDefault(),
598
+ onPress: o(() => t.undo()),
599
+ onMouseDown: (i) => i.preventDefault(),
587
600
  children: [
588
- /* @__PURE__ */ o(Ke, {}),
589
- /* @__PURE__ */ o(T, { children: "Undo" })
601
+ /* @__PURE__ */ r(Ke, {}),
602
+ /* @__PURE__ */ r(T, { children: "Undo" })
590
603
  ]
591
604
  }
592
605
  ),
593
- /* @__PURE__ */ o(d.Content, { placement: "top", children: "Undo" })
606
+ /* @__PURE__ */ r(d.Content, { placement: "top", children: "Undo" })
594
607
  ] }),
595
608
  /* @__PURE__ */ n(d.Root, { delay: 0, closeDelay: 0, children: [
596
609
  /* @__PURE__ */ n(
@@ -599,16 +612,16 @@ const Ze = ({ isDisabled: e = !1 }) => {
599
612
  size: "xs",
600
613
  variant: "ghost",
601
614
  "aria-label": "Redo",
602
- isDisabled: !u || e,
603
- onPress: i(() => t.redo()),
604
- onMouseDown: (r) => r.preventDefault(),
615
+ isDisabled: !h || e,
616
+ onPress: o(() => t.redo()),
617
+ onMouseDown: (i) => i.preventDefault(),
605
618
  children: [
606
- /* @__PURE__ */ o(Ue, {}),
607
- /* @__PURE__ */ o(T, { children: "Redo" })
619
+ /* @__PURE__ */ r(Ue, {}),
620
+ /* @__PURE__ */ r(T, { children: "Redo" })
608
621
  ]
609
622
  }
610
623
  ),
611
- /* @__PURE__ */ o(d.Content, { placement: "top", children: "Redo" })
624
+ /* @__PURE__ */ r(d.Content, { placement: "top", children: "Redo" })
612
625
  ] })
613
626
  ] })
614
627
  ]
@@ -616,76 +629,76 @@ const Ze = ({ isDisabled: e = !1 }) => {
616
629
  );
617
630
  };
618
631
  oe.displayName = "RichTextToolbar";
619
- const $e = (e) => {
632
+ const et = (e) => {
620
633
  const {
621
634
  ref: t,
622
- value: i,
635
+ value: o,
623
636
  defaultValue: a,
624
637
  onChange: l,
625
638
  onFocus: s,
626
639
  onBlur: c,
627
- placeholder: h = "",
640
+ placeholder: u = "",
628
641
  isDisabled: y = !1,
629
642
  isReadOnly: f = !1,
630
- isInvalid: u = !1,
631
- autoFocus: r = !1,
632
- ...L
633
- } = e, P = fe({ recipe: $ }), [z, H] = P.splitVariantProps({
643
+ isInvalid: h = !1,
644
+ autoFocus: i = !1,
645
+ ...B
646
+ } = e, L = ge({ recipe: ee }), [O, z] = L.splitVariantProps({
634
647
  // Only semantic variants go here (none currently defined)
635
- ...L
636
- }), [E, F] = ge(H), O = {
648
+ ...B
649
+ }), [H, E] = me(z), F = {
637
650
  "data-disabled": y ? "true" : void 0,
638
- "data-invalid": u ? "true" : void 0,
651
+ "data-invalid": h ? "true" : void 0,
639
652
  "data-readonly": f ? "true" : void 0
640
653
  }, [p, K] = G(() => {
641
- const x = i ?? a ?? "";
654
+ const x = o ?? a ?? "";
642
655
  try {
643
- return x ? q(x) : B();
656
+ return x ? q(x) : P();
644
657
  } catch (w) {
645
- return console.warn("Failed to parse initial HTML, using empty value:", w), B();
658
+ return console.warn("Failed to parse initial HTML, using empty value:", w), P();
646
659
  }
647
- }), [D, U] = G(() => i ?? a ?? ""), re = ce(null);
660
+ }), [D, U] = G(() => o ?? a ?? ""), ie = ue(null);
648
661
  he(() => {
649
- if (i !== void 0 && i !== D) {
650
- const x = i ? q(i) : B();
651
- K(x), U(i);
662
+ if (o !== void 0 && o !== D) {
663
+ const x = o ? q(o) : P();
664
+ K(x), U(o);
652
665
  }
653
- }, [i, D]);
654
- const ie = M(
666
+ }, [o, D]);
667
+ const ne = M(
655
668
  (x) => {
656
- const w = De(x), le = w !== D;
657
- K(x), U(w), le && l && l(w);
669
+ const w = De(x), ae = w !== D;
670
+ K(x), U(w), ae && l && l(w);
658
671
  },
659
672
  [D, l]
660
- ), ne = Ie(p);
661
- return /* @__PURE__ */ o(
673
+ ), le = Ie(p);
674
+ return /* @__PURE__ */ r(
662
675
  _e,
663
676
  {
664
- ...z,
677
+ ...O,
678
+ ...H,
665
679
  ...E,
666
680
  ...F,
667
- ...O,
668
681
  ref: t,
669
- children: /* @__PURE__ */ o(
670
- te,
682
+ children: /* @__PURE__ */ r(
683
+ re,
671
684
  {
672
- ref: re,
673
- value: ne,
674
- onChange: ie,
685
+ ref: ie,
686
+ value: le,
687
+ onChange: ne,
675
688
  onFocus: s,
676
689
  onBlur: c,
677
- placeholder: h,
690
+ placeholder: u,
678
691
  isDisabled: y,
679
692
  isReadOnly: f,
680
- autoFocus: r,
681
- toolbar: f ? null : /* @__PURE__ */ o(oe, { isDisabled: y })
693
+ autoFocus: i,
694
+ toolbar: f ? null : /* @__PURE__ */ r(oe, { isDisabled: y })
682
695
  }
683
696
  )
684
697
  }
685
698
  );
686
699
  };
687
- $e.displayName = "RichTextInput";
700
+ et.displayName = "RichTextInput";
688
701
  export {
689
- $e as R
702
+ et as R
690
703
  };
691
- //# sourceMappingURL=rich-text-input-CgrxAPHc.es.js.map
704
+ //# sourceMappingURL=rich-text-input-CYlc7Ozc.es.js.map