@crystallize/design-system 1.16.0 → 1.16.2

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @crystallize/design-system
2
2
 
3
+ ## 1.16.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 56e0a03: Fix the diabled state for the new richtext editor and pass the disabled prop to the component.
8
+
9
+ ## 1.16.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 67b3c9a9: Add isSelected prop to the DropdownMenu.Item component and styles to show the selected state
14
+
3
15
  ## 1.16.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.css CHANGED
@@ -1175,7 +1175,8 @@ button {
1175
1175
  background-color: rgb(var(--c-color-elevate) / var(--tw-bg-opacity));
1176
1176
  padding-left: 1rem;
1177
1177
  padding-right: 1rem;
1178
- padding-top: 0.5rem;
1178
+ padding-bottom: 0.25rem;
1179
+ padding-top: 0.75rem;
1179
1180
  font-family:
1180
1181
  Roboto,
1181
1182
  ui-sans-serif,
@@ -1192,8 +1193,7 @@ button {
1192
1193
  "Segoe UI Emoji",
1193
1194
  "Segoe UI Symbol",
1194
1195
  "Noto Color Emoji";
1195
- font-size: 0.75rem;
1196
- line-height: 1rem;
1196
+ font-size: 11px;
1197
1197
  font-weight: 700;
1198
1198
  --tw-text-opacity: 1;
1199
1199
  color: rgb(var(--c-color-gray-500-400) / var(--tw-text-opacity));
@@ -1209,8 +1209,8 @@ button {
1209
1209
  align-items: center;
1210
1210
  --tw-bg-opacity: 1;
1211
1211
  background-color: rgb(var(--c-color-elevate) / var(--tw-bg-opacity));
1212
- padding-left: 0.75rem;
1213
- padding-right: 0.75rem;
1212
+ padding-left: 1rem;
1213
+ padding-right: 1rem;
1214
1214
  font-family:
1215
1215
  Roboto,
1216
1216
  ui-sans-serif,
@@ -1235,12 +1235,22 @@ button {
1235
1235
  }
1236
1236
  .c-dropdown-menu-item:hover,
1237
1237
  .c-dropdown-menu-item:focus,
1238
- .c-dropdown-menu-item:focus-visible {
1238
+ .c-dropdown-menu-item:focus-visible,
1239
+ .c-dropdown-menu-item:hover.selected,
1240
+ .c-dropdown-menu-item:focus.selected,
1241
+ .c-dropdown-menu-item:focus-visible.selected {
1239
1242
  --tw-bg-opacity: 1;
1240
1243
  background-color: rgb(var(--c-color-gray-50-900) / var(--tw-bg-opacity));
1241
1244
  outline: 2px solid transparent;
1242
1245
  outline-offset: 2px;
1243
1246
  }
1247
+ .c-dropdown-menu-item.selected {
1248
+ --tw-bg-opacity: 1;
1249
+ background-color: rgb(var(--c-color-gray-50-900) / var(--tw-bg-opacity));
1250
+ font-weight: 700;
1251
+ --tw-text-opacity: 1;
1252
+ color: rgb(var(--c-color-green-500-400) / var(--tw-text-opacity));
1253
+ }
1244
1254
  .c-dropdown-menu-item:first-child {
1245
1255
  border-top-left-radius: 0.25rem;
1246
1256
  border-top-right-radius: 0.25rem;
@@ -1351,9 +1361,9 @@ button {
1351
1361
  /* src/dialog/dialog.css */
1352
1362
  .c-dialog {
1353
1363
  position: fixed;
1354
- top: 50%;
1355
1364
  left: 50%;
1356
- z-index: 20;
1365
+ top: 50%;
1366
+ z-index: 100;
1357
1367
  width: auto;
1358
1368
  min-width: 25%;
1359
1369
  max-width: 800px;
@@ -1375,7 +1385,7 @@ button {
1375
1385
  .c-dialog-overlay {
1376
1386
  position: fixed;
1377
1387
  inset: 0px;
1378
- z-index: 10;
1388
+ z-index: 100;
1379
1389
  background-color: rgb(var(--c-color-overlay) / 0.3);
1380
1390
  }
1381
1391
  .c-dialog-icon {
@@ -1399,14 +1409,14 @@ button {
1399
1409
  color: rgb(var(--c-color-gray));
1400
1410
  }
1401
1411
  .c-dialog-description {
1402
- margin-top: 0.25rem;
1403
1412
  margin-bottom: 1.25rem;
1413
+ margin-top: 0.25rem;
1404
1414
  font-weight: 500;
1405
1415
  }
1406
1416
  .c-dialog-close-button {
1407
1417
  position: absolute;
1408
- top: 0px;
1409
1418
  right: 0px;
1419
+ top: 0px;
1410
1420
  display: inline-flex;
1411
1421
  height: 3rem;
1412
1422
  width: 3rem;
@@ -2505,13 +2515,16 @@ button {
2505
2515
  resize: vertical;
2506
2516
  }
2507
2517
  .c-rich-text-editor .c-rte-editor-container {
2508
- background: #fff;
2509
2518
  position: relative;
2510
2519
  margin-top: 0.5rem;
2511
2520
  cursor: text;
2512
2521
  border-bottom-left-radius: 0.375rem;
2513
2522
  border-bottom-right-radius: 0.375rem;
2514
2523
  }
2524
+ .c-rich-text-editor .c-rte-editor-container:not(.disabled) {
2525
+ --tw-bg-opacity: 1;
2526
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
2527
+ }
2515
2528
  .c-rich-text-editor .c-rte-editor {
2516
2529
  position: relative;
2517
2530
  }
@@ -2650,6 +2663,9 @@ button {
2650
2663
  padding-right: var(--c-rte-content-pr, 1.5rem);
2651
2664
  padding-bottom: var(--c-rte-content-pb, 8px);
2652
2665
  }
2666
+ .c-rte-contenteditable-root[contenteditable=false] {
2667
+ background-color: transparent;
2668
+ }
2653
2669
 
2654
2670
  /* src/rich-text-editor/plugins/FloatingLinkEditorPlugin/index.css */
2655
2671
  .c-rte-link-editor {
package/dist/index.d.ts CHANGED
@@ -20,9 +20,10 @@ type ItemProps = HTMLAttributes<HTMLLIElement> & {
20
20
  declare function Item({ children, className, onSelect }: ItemProps): JSX.Element;
21
21
 
22
22
  type DropdownMenuItemProps = DropdownMenuPrimitive.MenuItemProps & {
23
- children: ReactNode;
23
+ children: React.ReactNode;
24
+ isSelected?: boolean;
24
25
  };
25
- declare function DropdownMenuItem({ children, className, ...delegated }: DropdownMenuItemProps): JSX.Element;
26
+ declare function DropdownMenuItem({ children, className, isSelected, ...delegated }: DropdownMenuItemProps): JSX.Element;
26
27
 
27
28
  type DropdownMenuLabelProps = {
28
29
  children: ReactNode;
@@ -412,12 +413,12 @@ type TRichTextBase = {
412
413
  actionsMenuAppend?: CrystallizeRichTextActionMenuItem[];
413
414
  slotPreContent?: ReactNode;
414
415
  maxLength?: number;
415
- editable?: boolean;
416
416
  language?: SupportedLanguages;
417
417
  labelTranslations?: I18N;
418
418
  id?: string;
419
+ disabled?: boolean;
419
420
  };
420
- declare function RichTextEditor({ initialData, editable, language, labelTranslations, ...rest }: TRichTextBase & {
421
+ declare function RichTextEditor({ initialData, language, labelTranslations, ...rest }: TRichTextBase & {
421
422
  initialData?: CrystallizeRichText;
422
423
  }): JSX.Element;
423
424
 
package/dist/index.js CHANGED
@@ -261,10 +261,10 @@ var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
261
261
  var import_class_variance_authority4 = require("class-variance-authority");
262
262
  var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
263
263
  var import_jsx_runtime4 = require("react/jsx-runtime");
264
- function DropdownMenuItem({ children, className, ...delegated }) {
264
+ function DropdownMenuItem({ children, className, isSelected, ...delegated }) {
265
265
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DropdownMenuPrimitive.Item, {
266
266
  ...delegated,
267
- className: (0, import_class_variance_authority4.cx)("c-dropdown-menu-item", className),
267
+ className: (0, import_class_variance_authority4.cx)("c-dropdown-menu-item", isSelected ? "selected" : "", className),
268
268
  children
269
269
  });
270
270
  }
@@ -1791,18 +1791,25 @@ Info.displayName = "InfoIcon";
1791
1791
  var import_react33 = require("react");
1792
1792
  var import_jsx_runtime40 = require("react/jsx-runtime");
1793
1793
  var Key = (0, import_react33.forwardRef)((delegated, ref) => {
1794
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("svg", {
1794
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("svg", {
1795
1795
  ref,
1796
- viewBox: "0 0 24 25",
1797
- width: "24",
1798
- height: "25",
1796
+ viewBox: "0 0 22 22",
1797
+ width: "22",
1798
+ height: "22",
1799
1799
  fill: "none",
1800
1800
  ...delegated,
1801
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("path", {
1802
- fill: "#BFF6F8",
1803
- stroke: "#528693",
1804
- d: "M23.486 5.617a6.308 6.308 0 0 0-2.738-4.03 6.314 6.314 0 0 0-2.335-.942 6.251 6.251 0 0 0-2.51.051c-.928.212-1.799.637-2.545 1.243a6.435 6.435 0 0 0-1.762 2.257 6.617 6.617 0 0 0-.11 5.42 3308.703 3308.703 0 0 1-3.087 3.164l-.042-.043c-.335-.34-1.163-1.187-1.495-1.537-.315-.333-.644-.403-.868-.403-.323 0-.616.138-.868.41-.273.291-.633.671-1.007 1.039-.326.32-.395.657-.396.884 0 .33.135.633.402.9.353.35 1.191 1.208 1.535 1.56l-.545.556-.048-.05c-.331-.337-1.155-1.18-1.484-1.526-.256-.269-.549-.405-.868-.405h-.007c-.222 0-.552.073-.864.409-.312.336-.65.686-1.025 1.058-.319.317-.385.653-.385.878 0 .328.13.625.39.883.355.355 1.195 1.216 1.543 1.573l-.048.05c-.218.221-.443.45-.663.685-.419.449-.65 1.048-.643 1.67a2.41 2.41 0 0 0 1.436 2.181c.284.123.588.187.896.189a2.286 2.286 0 0 0 1.592-.661c.067-.065.127-.127.186-.187l.057-.06 9.604-9.845c.899.388 1.72.562 2.504.528h.017c1.04 0 2.003-.232 2.864-.692a6.458 6.458 0 0 0 2.862-3.016c.595-1.293.75-2.743.455-4.19ZM14.437 7.04c-.016-.738.295-1.487.851-2.056.567-.578 1.312-.9 2.043-.88.755.014 1.475.331 2.003.884.529.553.823 1.298.82 2.072 0 1.631-1.26 2.904-2.866 2.904h-.002c-1.563-.001-2.815-1.283-2.849-2.924Z"
1805
- })
1801
+ children: [
1802
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("path", {
1803
+ d: "M19.8945 5.95026C19.6477 4.73793 18.937 3.69147 17.8935 3.00418C17.3743 2.6618 16.7941 2.42807 16.1865 2.31644C15.5788 2.20481 15.0511 2.19471 14.3527 2.35376C13.5642 2.53331 13.1208 2.75386 12.4919 3.26216C11.8563 3.77585 11.5544 4.17318 11.2039 4.91138C10.8646 5.62576 10.7544 6.19904 10.7405 6.88273C10.7266 7.56642 10.8573 8.24508 11.1235 8.87212C10.2697 9.74839 10.1453 9.89094 9.46986 10.5822C9.21027 10.3192 8.95563 10.0513 8.70158 9.78292C8.47173 9.53937 8.2306 9.48806 8.06702 9.48806C7.83118 9.48806 7.61684 9.5896 7.43247 9.78834C7.23329 10.0008 6.96995 10.2787 6.69709 10.5472C6.45878 10.7806 6.40802 11.0274 6.40766 11.1933C6.40766 11.435 6.50567 11.6562 6.70132 11.8506C6.95902 12.1064 7.46819 12.6368 7.46819 12.6368L6.46693 13.6448C6.46693 13.6448 5.71608 12.8816 5.3473 12.4936C5.1601 12.2966 4.94612 12.1969 4.71274 12.1969H4.70781C4.54564 12.1969 4.30416 12.2507 4.07607 12.4961C3.84798 12.7414 3.60051 12.9973 3.3273 13.2694C3.09392 13.5014 3.04527 13.7464 3.04527 13.9108C3.04527 14.1507 3.14116 14.3679 3.33047 14.5565C3.58993 14.8156 4.20439 15.4454 4.45856 15.7063C4.28469 15.8845 4.10935 16.0613 3.93894 16.2429C3.63263 16.5712 3.46379 17.0092 3.46853 17.4634C3.47328 17.9176 3.65123 18.3519 3.96432 18.6733C4.12254 18.8375 4.31076 18.9681 4.51824 19.0577C4.72571 19.1473 4.94837 19.1941 5.1735 19.1955C5.60732 19.1934 6.02377 19.0206 6.33685 18.7127C8.80299 16.3293 11.1381 13.791 13.5345 11.3369C14.1912 11.6205 14.7909 11.7474 15.3644 11.7232H15.3771C16.1365 11.7232 16.7219 11.6011 17.4701 11.2173C18.526 10.6756 19.127 9.95834 19.562 9.01305C19.997 8.06776 20.1098 7.00829 19.8945 5.95026ZM13.2806 6.98913C13.2818 6.35405 13.4569 5.9388 13.9028 5.48665C14.3486 5.0347 14.761 4.83886 15.3958 4.84381C16.0207 4.84868 16.4251 5.04079 16.86 5.48958C17.3025 5.94622 17.4666 6.36776 17.4592 7.00359C17.4455 8.16811 16.5384 9.12651 15.3648 9.12651H15.3627C14.1974 9.12592 13.2786 8.15439 13.2806 6.98913Z",
1804
+ fill: "#BFF6F8"
1805
+ }),
1806
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("path", {
1807
+ "fill-rule": "evenodd",
1808
+ "clip-rule": "evenodd",
1809
+ d: "M14.2861 2.06126C15.0279 1.89233 15.5969 1.90313 16.2407 2.02139C16.8882 2.14034 17.5061 2.38935 18.0586 2.75375C19.168 3.48444 19.9256 4.59912 20.1884 5.89043C20.4159 7.00773 20.2975 8.13239 19.8345 9.13848C19.375 10.1371 18.7298 10.9082 17.607 11.4842C16.8141 11.891 16.1813 12.0232 15.3771 12.0232H15.3706C14.803 12.0461 14.2219 11.9333 13.6076 11.6916C12.8526 12.4665 12.1015 13.2514 11.3489 14.0378C9.77024 15.6873 8.18529 17.3435 6.54613 18.9277C6.17818 19.2889 5.68752 19.493 5.17496 19.4955L5.17167 19.4955C4.90609 19.4939 4.64362 19.4386 4.3993 19.3331C4.1553 19.2278 3.9344 19.0744 3.74899 18.8822C3.38162 18.5049 3.17408 17.9966 3.16855 17.4666C3.16301 16.9363 3.36003 16.4236 3.7196 16.0382C3.82475 15.9262 4.03922 15.706 4.03922 15.706C4.03922 15.706 3.32162 14.9716 3.11872 14.769C2.88007 14.5311 2.74527 14.2397 2.74527 13.9108C2.74527 13.6833 2.81488 13.3558 3.1158 13.0566C3.38648 12.787 3.63119 12.534 3.85634 12.2918C4.14888 11.9772 4.47429 11.8969 4.7078 11.8969H4.71274C5.04159 11.8969 5.33075 12.0407 5.56473 12.2869C5.74754 12.4792 6.02614 12.7657 6.25999 13.005C6.33588 13.0827 6.4069 13.1553 6.46821 13.2178L7.04848 12.6337C7.02239 12.6067 6.9947 12.5781 6.96596 12.5484C6.80638 12.3838 6.61651 12.1891 6.48996 12.0635C6.24557 11.8206 6.10766 11.5255 6.10766 11.1933C6.10815 10.9628 6.181 10.6329 6.48692 10.3331C6.75501 10.0693 7.01468 9.79536 7.21306 9.58374C7.4447 9.33431 7.73505 9.18807 8.06702 9.18807C8.29928 9.18807 8.62426 9.26401 8.91959 9.57685C9.10286 9.77043 9.28546 9.96275 9.46954 10.1527C9.68431 9.93175 9.83739 9.7722 10.0018 9.60089C10.1998 9.39453 10.4141 9.17111 10.7724 8.8027C10.5401 8.18952 10.4272 7.5352 10.4406 6.87665C10.4552 6.15474 10.5737 5.53909 10.9329 4.7827C11.3015 4.00641 11.6307 3.57251 12.3033 3.02885C12.9666 2.49276 13.4515 2.25131 14.2861 2.06126ZM7.68462 12.4291L7.88748 12.6404L6.4659 14.0716L6.25307 13.8552L6.12971 13.7296C6.05344 13.6519 5.94791 13.5442 5.83082 13.4243C5.59705 13.1851 5.31582 12.8959 5.12984 12.7003C4.98945 12.5525 4.85064 12.4969 4.71274 12.4969H4.7078C4.61699 12.4969 4.45943 12.5243 4.29579 12.7004C4.06482 12.9488 3.81465 13.2074 3.53899 13.482C3.37316 13.6468 3.34527 13.8094 3.34527 13.9108C3.34527 14.0616 3.40239 14.2047 3.54221 14.344C3.80349 14.6049 4.41991 15.2367 4.67344 15.497L4.87754 15.7065L4.6733 15.9158C4.63245 15.9577 4.59185 15.9991 4.55148 16.0404C4.41786 16.1768 4.28682 16.3106 4.15806 16.4478C3.90514 16.719 3.76457 17.0823 3.76851 17.4603C3.77246 17.8385 3.92067 18.1986 4.17922 18.464L4.18033 18.4652C4.31121 18.601 4.46652 18.7086 4.63716 18.7823C4.80725 18.8558 4.98946 18.8941 5.17354 18.8955L5.17203 18.8955L5.17532 18.8955L5.17354 18.8955C5.52759 18.8934 5.8688 18.7522 6.12651 18.4988L6.12836 18.497C7.75985 16.9203 9.33034 15.2792 10.904 13.6348C11.7056 12.7971 12.5081 11.9586 13.3198 11.1273L13.464 10.9797L13.6534 11.0615C14.2788 11.3316 14.8332 11.4453 15.3518 11.4234L15.3644 11.4229L15.3771 11.4232C16.0917 11.4232 16.6298 11.3112 17.3332 10.9504C18.3222 10.443 18.879 9.77955 19.2895 8.88764C19.6965 8.00315 19.8038 7.00887 19.6005 6.01012C19.3698 4.87684 18.7061 3.89862 17.7285 3.25473C17.2427 2.93437 16.7001 2.71582 16.1323 2.61151C15.5607 2.50651 15.0743 2.49712 14.4193 2.64628C13.677 2.81532 13.275 3.01499 12.6805 3.4955C12.082 3.97922 11.8073 4.33997 11.4749 5.04008C11.1556 5.71245 11.0536 6.24336 11.0405 6.88883C11.0274 7.53036 11.15 8.16698 11.3996 8.7549L11.4776 8.93858L11.3384 9.0815C10.9129 9.51811 10.6644 9.77704 10.4358 10.0151C10.2142 10.246 10.0114 10.4572 9.68443 10.7919L9.47093 11.0104L9.25634 10.7929C8.99434 10.5275 8.73781 10.2576 8.48371 9.98917C8.31939 9.81506 8.16187 9.78807 8.06702 9.78807C7.92755 9.78807 7.78942 9.84468 7.6524 9.99238L7.65133 9.99352C7.45148 10.2067 7.1848 10.4882 6.9075 10.761C6.73719 10.9278 6.70794 11.0923 6.70766 11.1936C6.70774 11.3447 6.76592 11.4918 6.91268 11.6377M14.6993 5.26848C14.5063 5.35343 14.3222 5.48871 14.1164 5.69732C13.9122 5.90435 13.7828 6.08986 13.7019 6.28448C13.6211 6.47884 13.5811 6.70037 13.5806 6.98968C13.5789 7.99854 14.3727 8.82602 15.3628 8.82652H15.3648C16.3635 8.82652 17.1473 8.01108 17.1592 7.00008C17.1626 6.70925 17.1266 6.48571 17.0492 6.28946C16.9719 6.09342 16.8461 5.90632 16.6446 5.69836C16.4445 5.49196 16.2651 5.35857 16.0764 5.27398C15.8889 5.18989 15.6744 5.146 15.3935 5.14381C15.109 5.14159 14.8908 5.18419 14.6993 5.26848ZM14.4576 4.71932C14.7424 4.59395 15.0479 4.5411 15.3981 4.54383C15.7422 4.54651 16.0423 4.60112 16.3219 4.7265C16.6004 4.85137 16.8405 5.03842 17.0754 5.28081C17.3164 5.5295 17.4939 5.78148 17.6074 6.06934C17.7208 6.35697 17.7632 6.66212 17.7591 7.00712C17.7437 8.32517 16.7132 9.42652 15.3648 9.42652H15.3627C14.0223 9.42584 12.9783 8.31027 12.9806 6.98862C12.9812 6.64284 13.0294 6.33921 13.1479 6.05413C13.2663 5.76932 13.4475 5.52112 13.6893 5.27599C13.9293 5.03266 14.1742 4.84405 14.4576 4.71932Z",
1810
+ fill: "#528693"
1811
+ })
1812
+ ]
1806
1813
  });
1807
1814
  });
1808
1815
  Key.displayName = "KeyIcon";
@@ -1959,7 +1966,7 @@ var Mushroom = (0, import_react37.forwardRef)((delegated, ref) => {
1959
1966
  clipRule: "evenodd"
1960
1967
  }),
1961
1968
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", {
1962
- fill: "#BFF6F8",
1969
+ fill: "#FFA1DB",
1963
1970
  d: "M17.618 9.944c0 3.195-3.875 4.271-6.712 4.271-5.683 0-6.976-2.556-6.976-4.512 0-2.837 4.138-7.1 6.976-7.1 2.837 0 6.712 3.22 6.712 7.34Z"
1964
1971
  }),
1965
1972
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", {
@@ -5688,97 +5695,98 @@ function TextFormatFloatingToolbar({
5688
5695
  )
5689
5696
  );
5690
5697
  }, [editor, updateTextFormatFloatingToolbar]);
5691
- return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", {
5698
+ if (!editor.isEditable()) {
5699
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", {});
5700
+ }
5701
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", {
5692
5702
  ref: popupCharStylesEditorRef,
5693
5703
  className: "c-rte-floating-text-format-tb-plugin",
5694
- children: editor.isEditable() && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, {
5695
- children: [
5696
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5697
- onClick: () => {
5698
- editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "bold");
5699
- },
5700
- style: { padding: 0, overflow: "hidden" },
5701
- title: tr(IS_APPLE ? "actionFormatAsStrongTitleApple" : "actionFormatAsStrongTitle"),
5702
- "aria-label": tr("actionFormatAsStrongLabel"),
5703
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5704
- className: `c-rte-icon-bold c-rte-floating-text-format-tb-plugin__format-icon ${isBold ? "selected" : ""}`
5705
- })
5706
- }),
5707
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5708
- style: { padding: 0, overflow: "hidden" },
5709
- onClick: () => {
5710
- editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "italic");
5711
- },
5712
- title: tr("actionFormatAsEmphasizedTitle"),
5713
- "aria-label": tr("actionFormatAsEmphasizedLabel"),
5714
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5715
- className: `c-rte-icon-italic c-rte-floating-text-format-tb-plugin__format-icon ${isItalic ? "selected" : ""}`
5716
- })
5717
- }),
5718
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5719
- style: { padding: 0, overflow: "hidden" },
5720
- onClick: () => {
5721
- editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "underline");
5722
- },
5723
- title: tr("actionFormatAsUnderlinedTitle"),
5724
- "aria-label": tr("actionFormatAsUnderlinedLabel"),
5725
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5726
- className: `c-rte-icon-underline c-rte-floating-text-format-tb-plugin__format-icon ${isUnderline ? "selected" : ""}`
5727
- })
5728
- }),
5729
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5730
- style: { padding: 0, overflow: "hidden" },
5731
- onClick: () => {
5732
- editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "strikethrough");
5733
- },
5734
- title: tr("actionFormatWithStrikethroughTitle"),
5735
- "aria-label": tr("actionFormatWithStrikethroughLabel"),
5736
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5737
- className: `c-rte-icon-strikethrough c-rte-floating-text-format-tb-plugin__format-icon ${isStrikethrough ? "selected" : ""}`
5738
- })
5739
- }),
5740
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5741
- style: { padding: 0, overflow: "hidden" },
5742
- onClick: () => {
5743
- editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "subscript");
5744
- },
5745
- title: tr("actionFormatWithSubscriptTitle"),
5746
- "aria-label": tr("actionFormatWithSubscriptLabel"),
5747
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5748
- className: `c-rte-icon-subscript c-rte-floating-text-format-tb-plugin__format-icon ${isSubscript ? "selected" : ""}`
5749
- })
5750
- }),
5751
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5752
- style: { padding: 0, overflow: "hidden" },
5753
- onClick: () => {
5754
- editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "superscript");
5755
- },
5756
- title: tr("actionFormatWithSuperscriptTitle"),
5757
- "aria-label": tr("actionFormatWithSuperscriptLabel"),
5758
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5759
- className: `c-rte-icon-superscript c-rte-floating-text-format-tb-plugin__format-icon ${isSuperscript ? "selected" : ""}`
5760
- })
5761
- }),
5762
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5763
- style: { padding: 0, overflow: "hidden" },
5764
- onClick: () => {
5765
- editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "code");
5766
- },
5767
- "aria-label": tr("actionInsertCodeBlock"),
5768
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5769
- className: `c-rte-icon-code c-rte-floating-text-format-tb-plugin__format-icon ${isCode ? "selected" : ""}`
5770
- })
5771
- }),
5772
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5773
- style: { padding: 0, overflow: "hidden" },
5774
- onClick: insertLink,
5775
- "aria-label": tr("actionInsertlink"),
5776
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5777
- className: `c-rte-icon-link c-rte-floating-text-format-tb-plugin__format-icon ${isLink ? "selected" : ""}`
5778
- })
5704
+ children: [
5705
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5706
+ onClick: () => {
5707
+ editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "bold");
5708
+ },
5709
+ style: { padding: 0, overflow: "hidden" },
5710
+ title: tr(IS_APPLE ? "actionFormatAsStrongTitleApple" : "actionFormatAsStrongTitle"),
5711
+ "aria-label": tr("actionFormatAsStrongLabel"),
5712
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5713
+ className: `c-rte-icon-bold c-rte-floating-text-format-tb-plugin__format-icon ${isBold ? "selected" : ""}`
5779
5714
  })
5780
- ]
5781
- })
5715
+ }),
5716
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5717
+ style: { padding: 0, overflow: "hidden" },
5718
+ onClick: () => {
5719
+ editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "italic");
5720
+ },
5721
+ title: tr("actionFormatAsEmphasizedTitle"),
5722
+ "aria-label": tr("actionFormatAsEmphasizedLabel"),
5723
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5724
+ className: `c-rte-icon-italic c-rte-floating-text-format-tb-plugin__format-icon ${isItalic ? "selected" : ""}`
5725
+ })
5726
+ }),
5727
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5728
+ style: { padding: 0, overflow: "hidden" },
5729
+ onClick: () => {
5730
+ editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "underline");
5731
+ },
5732
+ title: tr("actionFormatAsUnderlinedTitle"),
5733
+ "aria-label": tr("actionFormatAsUnderlinedLabel"),
5734
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5735
+ className: `c-rte-icon-underline c-rte-floating-text-format-tb-plugin__format-icon ${isUnderline ? "selected" : ""}`
5736
+ })
5737
+ }),
5738
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5739
+ style: { padding: 0, overflow: "hidden" },
5740
+ onClick: () => {
5741
+ editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "strikethrough");
5742
+ },
5743
+ title: tr("actionFormatWithStrikethroughTitle"),
5744
+ "aria-label": tr("actionFormatWithStrikethroughLabel"),
5745
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5746
+ className: `c-rte-icon-strikethrough c-rte-floating-text-format-tb-plugin__format-icon ${isStrikethrough ? "selected" : ""}`
5747
+ })
5748
+ }),
5749
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5750
+ style: { padding: 0, overflow: "hidden" },
5751
+ onClick: () => {
5752
+ editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "subscript");
5753
+ },
5754
+ title: tr("actionFormatWithSubscriptTitle"),
5755
+ "aria-label": tr("actionFormatWithSubscriptLabel"),
5756
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5757
+ className: `c-rte-icon-subscript c-rte-floating-text-format-tb-plugin__format-icon ${isSubscript ? "selected" : ""}`
5758
+ })
5759
+ }),
5760
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5761
+ style: { padding: 0, overflow: "hidden" },
5762
+ onClick: () => {
5763
+ editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "superscript");
5764
+ },
5765
+ title: tr("actionFormatWithSuperscriptTitle"),
5766
+ "aria-label": tr("actionFormatWithSuperscriptLabel"),
5767
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5768
+ className: `c-rte-icon-superscript c-rte-floating-text-format-tb-plugin__format-icon ${isSuperscript ? "selected" : ""}`
5769
+ })
5770
+ }),
5771
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5772
+ style: { padding: 0, overflow: "hidden" },
5773
+ onClick: () => {
5774
+ editor.dispatchCommand(import_lexical9.FORMAT_TEXT_COMMAND, "code");
5775
+ },
5776
+ "aria-label": tr("actionInsertCodeBlock"),
5777
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5778
+ className: `c-rte-icon-code c-rte-floating-text-format-tb-plugin__format-icon ${isCode ? "selected" : ""}`
5779
+ })
5780
+ }),
5781
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(IconButton, {
5782
+ style: { padding: 0, overflow: "hidden" },
5783
+ onClick: insertLink,
5784
+ "aria-label": tr("actionInsertlink"),
5785
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("i", {
5786
+ className: `c-rte-icon-link c-rte-floating-text-format-tb-plugin__format-icon ${isLink ? "selected" : ""}`
5787
+ })
5788
+ })
5789
+ ]
5782
5790
  });
5783
5791
  }
5784
5792
  function useFloatingTextFormatToolbar(editor, anchorElem) {
@@ -7222,16 +7230,15 @@ var CrystallizeRTEditorTheme_default = theme;
7222
7230
  var import_jsx_runtime102 = require("react/jsx-runtime");
7223
7231
  function RichTextEditor({
7224
7232
  initialData,
7225
- editable = true,
7226
7233
  language = "en",
7227
7234
  labelTranslations,
7228
7235
  ...rest
7229
7236
  }) {
7230
7237
  return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_LexicalComposer.LexicalComposer, {
7231
7238
  initialConfig: {
7239
+ editable: !rest.disabled,
7232
7240
  namespace: "crystallize-rich-text-editor",
7233
7241
  nodes: [...BaseNodes],
7234
- editable,
7235
7242
  onError: (error) => {
7236
7243
  throw error;
7237
7244
  },
@@ -7247,8 +7254,7 @@ function RichTextEditor({
7247
7254
  children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", {
7248
7255
  className: "c-rich-text-editor",
7249
7256
  children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(RichTextEditorWithoutContext, {
7250
- ...rest,
7251
- editable
7257
+ ...rest
7252
7258
  })
7253
7259
  })
7254
7260
  })
@@ -7264,9 +7270,10 @@ function RichTextEditorWithoutContext({
7264
7270
  actionsMenuAppend,
7265
7271
  slotPreContent,
7266
7272
  maxLength,
7267
- editable,
7273
+ disabled,
7268
7274
  id
7269
7275
  }) {
7276
+ const editable = !disabled;
7270
7277
  const { historyState } = useSharedHistoryContext();
7271
7278
  const placeholder = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", {
7272
7279
  className: "c-rte-placeholder",
@@ -7307,7 +7314,7 @@ function RichTextEditorWithoutContext({
7307
7314
  }),
7308
7315
  slotPreContent,
7309
7316
  /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", {
7310
- className: "c-rte-editor-container",
7317
+ className: `c-rte-editor-container ${disabled ? "disabled" : ""}`,
7311
7318
  children: [
7312
7319
  maxLength != null ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(MaxLengthPlugin, {
7313
7320
  maxLength