@comet/admin-rte 9.0.0-canary-20251209132220 → 9.0.0-canary-20251211112608

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.
@@ -14,15 +14,15 @@ var Root = exports.Root = (0, _admin.createComponentSlot)("div")({
14
14
  componentName: "RteToolbar",
15
15
  slotName: "root"
16
16
  })(function (_ref) {
17
- var _getRteTheme$colors, _theme$components, _getRteTheme$colors2, _theme$components2;
17
+ var _getRteTheme$colors, _theme$components;
18
18
  var theme = _ref.theme;
19
- return (0, _styles.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: sticky;\n top: 0;\n z-index: 2;\n display: flex;\n flex-wrap: wrap;\n border-top: 1px solid ", ";\n background-color: ", ";\n padding-left: 6px;\n padding-right: 6px;\n overflow: hidden;\n "])), (_getRteTheme$colors = (0, _getRteTheme["default"])((_theme$components = theme.components) === null || _theme$components === void 0 || (_theme$components = _theme$components.CometAdminRte) === null || _theme$components === void 0 ? void 0 : _theme$components.defaultProps).colors) === null || _getRteTheme$colors === void 0 ? void 0 : _getRteTheme$colors.border, (_getRteTheme$colors2 = (0, _getRteTheme["default"])((_theme$components2 = theme.components) === null || _theme$components2 === void 0 || (_theme$components2 = _theme$components2.CometAdminRte) === null || _theme$components2 === void 0 ? void 0 : _theme$components2.defaultProps).colors) === null || _getRteTheme$colors2 === void 0 ? void 0 : _getRteTheme$colors2.toolbarBackground);
19
+ return (0, _styles.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: sticky;\n top: 0;\n z-index: 2;\n display: flex;\n flex-wrap: wrap;\n border-top: 1px solid var(--comet-admin-rte-outer-border-color);\n background-color: ", ";\n padding-left: 6px;\n padding-right: 6px;\n overflow: hidden;\n "])), (_getRteTheme$colors = (0, _getRteTheme["default"])((_theme$components = theme.components) === null || _theme$components === void 0 || (_theme$components = _theme$components.CometAdminRte) === null || _theme$components === void 0 ? void 0 : _theme$components.defaultProps).colors) === null || _getRteTheme$colors === void 0 ? void 0 : _getRteTheme$colors.toolbarBackground);
20
20
  });
21
21
  var Slot = exports.Slot = (0, _admin.createComponentSlot)("div")({
22
22
  componentName: "RteToolbar",
23
23
  slotName: "slot"
24
24
  })(function (_ref2) {
25
- var _getRteTheme$colors3, _theme$components3;
25
+ var _getRteTheme$colors2, _theme$components2;
26
26
  var theme = _ref2.theme;
27
- return (0, _styles.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n flex-shrink: 0;\n flex-grow: 0;\n height: 34px;\n box-sizing: border-box;\n padding-top: 5px;\n padding-bottom: 5px;\n padding-right: 6px;\n margin-right: 5px;\n\n &::before,\n &::after {\n content: \"\";\n position: absolute;\n background-color: ", ";\n }\n\n &::before {\n bottom: 0;\n height: 1px;\n left: -100vw;\n right: -100vw;\n }\n\n &::after {\n top: 8px;\n right: 0;\n bottom: 8px;\n width: 1px;\n }\n\n &:last-child {\n margin-right: 0;\n }\n\n &:last-child::after {\n display: none;\n }\n "])), (_getRteTheme$colors3 = (0, _getRteTheme["default"])((_theme$components3 = theme.components) === null || _theme$components3 === void 0 || (_theme$components3 = _theme$components3.CometAdminRte) === null || _theme$components3 === void 0 ? void 0 : _theme$components3.defaultProps).colors) === null || _getRteTheme$colors3 === void 0 ? void 0 : _getRteTheme$colors3.border);
27
+ return (0, _styles.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n flex-shrink: 0;\n flex-grow: 0;\n height: 34px;\n box-sizing: border-box;\n padding-top: 5px;\n padding-bottom: 5px;\n padding-right: 6px;\n margin-right: 5px;\n\n &::before,\n &::after {\n content: \"\";\n position: absolute;\n background-color: ", ";\n }\n\n &::before {\n bottom: 0;\n height: 1px;\n left: -100vw;\n right: -100vw;\n }\n\n &::after {\n top: 8px;\n right: 0;\n bottom: 8px;\n width: 1px;\n }\n\n &:last-child {\n margin-right: 0;\n }\n\n &:last-child::after {\n display: none;\n }\n "])), (_getRteTheme$colors2 = (0, _getRteTheme["default"])((_theme$components2 = theme.components) === null || _theme$components2 === void 0 || (_theme$components2 = _theme$components2.CometAdminRte) === null || _theme$components2 === void 0 ? void 0 : _theme$components2.defaultProps).colors) === null || _getRteTheme$colors2 === void 0 ? void 0 : _getRteTheme$colors2.border);
28
28
  });
package/lib/core/Rte.d.ts CHANGED
@@ -2,8 +2,9 @@ import "draft-js/dist/Draft.css";
2
2
  import { type ThemedComponentBaseProps } from "@comet/admin";
3
3
  import { type ComponentsOverrides, type Theme } from "@mui/material";
4
4
  import { type DraftBlockType, type EditorProps as DraftJsEditorProps, type EditorState } from "draft-js";
5
- import { type CSSProperties, type ForwardRefExoticComponent, type PropsWithoutRef, type RefAttributes } from "react";
5
+ import { type ForwardRefExoticComponent, type PropsWithoutRef, type RefAttributes } from "react";
6
6
  import { type CustomInlineStyles, type IBlocktypeMap, type ICustomBlockTypeMap_Deprecated, type ToolbarButtonComponent } from "./types";
7
+ import { type RteThemeColors } from "./utils/getRteTheme";
7
8
  export type SupportedThings = "bold" | "italic" | "underline" | "strikethrough" | "sub" | "sup" | "header-one" | "header-two" | "header-three" | "header-four" | "header-five" | "header-six" | "ordered-list" | "unordered-list" | "blockquote" | "history" | "link" | "links-remove" | "non-breaking-space" | "soft-hyphen";
8
9
  export interface IRteOptions {
9
10
  supports: SupportedThings[];
@@ -35,15 +36,7 @@ export interface RteProps extends ThemedComponentBaseProps<{
35
36
  options?: IOptions;
36
37
  disabled?: boolean;
37
38
  minHeight?: number;
38
- colors?: {
39
- border?: CSSProperties["color"];
40
- toolbarBackground?: CSSProperties["color"];
41
- buttonIcon?: CSSProperties["color"];
42
- buttonIconDisabled?: CSSProperties["color"];
43
- buttonBackgroundHover?: CSSProperties["color"];
44
- buttonBorderHover?: CSSProperties["color"];
45
- buttonBorderDisabled?: CSSProperties["color"];
46
- };
39
+ colors?: Partial<RteThemeColors>;
47
40
  }
48
41
  export declare const defaultOptions: IRteOptions;
49
42
  export interface IRteRef {
@@ -1 +1 @@
1
-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HANGED
@@ -246,9 +246,9 @@ var Root = (0, _admin.createComponentSlot)("div")({
246
246
  return [ownerState.disabled && "disabled"];
247
247
  }
248
248
  })(function (_ref3) {
249
- var _theme$components;
249
+ var _theme$components, _theme$components2, _theme$components3;
250
250
  var theme = _ref3.theme;
251
- return (0, _material.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n border-top-width: 0;\n background-color: #fff;\n "])), (0, _getRteTheme["default"])((_theme$components = theme.components) === null || _theme$components === void 0 || (_theme$components = _theme$components.CometAdminRte) === null || _theme$components === void 0 ? void 0 : _theme$components.defaultProps).colors.border);
251
+ return (0, _material.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n --comet-admin-rte-outer-border-color: ", ";\n border: 1px solid var(--comet-admin-rte-outer-border-color);\n border-top-width: 0; // To prevent the top border from being hidden, when to toolbar is sticky, the top border must be handled by the Toolbar itself\n background-color: #fff;\n border-radius: 2px;\n\n &:hover {\n --comet-admin-rte-outer-border-color: ", ";\n }\n\n &:focus-within {\n --comet-admin-rte-outer-border-color: ", ";\n }\n "])), (0, _getRteTheme["default"])((_theme$components = theme.components) === null || _theme$components === void 0 || (_theme$components = _theme$components.CometAdminRte) === null || _theme$components === void 0 ? void 0 : _theme$components.defaultProps).colors.border, (0, _getRteTheme["default"])((_theme$components2 = theme.components) === null || _theme$components2 === void 0 || (_theme$components2 = _theme$components2.CometAdminRte) === null || _theme$components2 === void 0 ? void 0 : _theme$components2.defaultProps).colors.outerBorderOnHover, (0, _getRteTheme["default"])((_theme$components3 = theme.components) === null || _theme$components3 === void 0 || (_theme$components3 = _theme$components3.CometAdminRte) === null || _theme$components3 === void 0 ? void 0 : _theme$components3.defaultProps).colors.outerBorderOnFocus);
252
252
  });
253
253
  var Editor = (0, _admin.createComponentSlot)("div")({
254
254
  componentName: "Rte",
@@ -1,15 +1,18 @@
1
1
  import { type CSSProperties } from "react";
2
2
  import { type RteProps } from "../Rte";
3
+ export type RteThemeColors = {
4
+ border: CSSProperties["color"];
5
+ outerBorderOnHover: CSSProperties["color"];
6
+ outerBorderOnFocus: CSSProperties["color"];
7
+ toolbarBackground: CSSProperties["color"];
8
+ buttonIcon: CSSProperties["color"];
9
+ buttonIconDisabled: CSSProperties["color"];
10
+ buttonBackgroundHover: CSSProperties["color"];
11
+ buttonBorderHover: CSSProperties["color"];
12
+ buttonBorderDisabled: CSSProperties["color"];
13
+ };
3
14
  interface RteTheme {
4
- colors: {
5
- border: CSSProperties["color"];
6
- toolbarBackground: CSSProperties["color"];
7
- buttonIcon: CSSProperties["color"];
8
- buttonIconDisabled: CSSProperties["color"];
9
- buttonBackgroundHover: CSSProperties["color"];
10
- buttonBorderHover: CSSProperties["color"];
11
- buttonBorderDisabled: CSSProperties["color"];
12
- };
15
+ colors: RteThemeColors;
13
16
  }
14
17
  declare const _default: (themeProps: Partial<RteProps> | undefined) => RteTheme;
15
18
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"getRteTheme.d.ts","sourceRoot":"","sources":["../../../src/core/utils/getRteTheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,UAAU,QAAQ;IACd,MAAM,EAAE;QACJ,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QAC/B,iBAAiB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QAC1C,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QACnC,kBAAkB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QAC3C,qBAAqB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QAC9C,iBAAiB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QAC1C,oBAAoB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;KAChD,CAAC;CACL;yBAEe,YAAY,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,KAAG,QAAQ;AAApE,wBAYE"}
1
+ {"version":3,"file":"getRteTheme.d.ts","sourceRoot":"","sources":["../../../src/core/utils/getRteTheme.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,MAAM,cAAc,GAAG;IACzB,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/B,kBAAkB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3C,kBAAkB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3C,iBAAiB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACnC,kBAAkB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3C,qBAAqB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,iBAAiB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,oBAAoB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CAChD,CAAC;AAEF,UAAU,QAAQ;IACd,MAAM,EAAE,cAAc,CAAC;CAC1B;yBAEe,YAAY,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,KAAG,QAAQ;AAApE,wBAcE"}
@@ -4,18 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
+ var _admin = require("@comet/admin");
7
8
  var _colors = require("@mui/material/colors");
8
9
  var _default = exports["default"] = function _default(themeProps) {
9
- var _themeProps$colors, _themeProps$colors2, _themeProps$colors3, _themeProps$colors4, _themeProps$colors5, _themeProps$colors6, _themeProps$colors7;
10
+ var _themeProps$colors, _themeProps$colors2, _themeProps$colors3, _themeProps$colors4, _themeProps$colors5, _themeProps$colors6, _themeProps$colors7, _themeProps$colors8, _themeProps$colors9;
10
11
  return {
11
12
  colors: {
12
- border: themeProps !== null && themeProps !== void 0 && (_themeProps$colors = themeProps.colors) !== null && _themeProps$colors !== void 0 && _themeProps$colors.border ? themeProps.colors.border : _colors.grey[400],
13
- toolbarBackground: themeProps !== null && themeProps !== void 0 && (_themeProps$colors2 = themeProps.colors) !== null && _themeProps$colors2 !== void 0 && _themeProps$colors2.toolbarBackground ? themeProps.colors.toolbarBackground : _colors.grey[100],
14
- buttonIcon: themeProps !== null && themeProps !== void 0 && (_themeProps$colors3 = themeProps.colors) !== null && _themeProps$colors3 !== void 0 && _themeProps$colors3.buttonIcon ? themeProps.colors.buttonIcon : _colors.grey[600],
15
- buttonIconDisabled: themeProps !== null && themeProps !== void 0 && (_themeProps$colors4 = themeProps.colors) !== null && _themeProps$colors4 !== void 0 && _themeProps$colors4.buttonIconDisabled ? themeProps.colors.buttonIconDisabled : _colors.grey[300],
16
- buttonBackgroundHover: themeProps !== null && themeProps !== void 0 && (_themeProps$colors5 = themeProps.colors) !== null && _themeProps$colors5 !== void 0 && _themeProps$colors5.buttonBackgroundHover ? themeProps.colors.buttonBackgroundHover : _colors.grey[200],
17
- buttonBorderHover: themeProps !== null && themeProps !== void 0 && (_themeProps$colors6 = themeProps.colors) !== null && _themeProps$colors6 !== void 0 && _themeProps$colors6.buttonBorderHover ? themeProps.colors.buttonBorderHover : _colors.grey[400],
18
- buttonBorderDisabled: themeProps !== null && themeProps !== void 0 && (_themeProps$colors7 = themeProps.colors) !== null && _themeProps$colors7 !== void 0 && _themeProps$colors7.buttonBorderDisabled ? themeProps.colors.buttonBorderDisabled : _colors.grey[100]
13
+ border: themeProps !== null && themeProps !== void 0 && (_themeProps$colors = themeProps.colors) !== null && _themeProps$colors !== void 0 && _themeProps$colors.border ? themeProps.colors.border : _admin.greyPalette[100],
14
+ outerBorderOnHover: themeProps !== null && themeProps !== void 0 && (_themeProps$colors2 = themeProps.colors) !== null && _themeProps$colors2 !== void 0 && _themeProps$colors2.outerBorderOnHover ? themeProps.colors.outerBorderOnHover : _admin.greyPalette[200],
15
+ outerBorderOnFocus: themeProps !== null && themeProps !== void 0 && (_themeProps$colors3 = themeProps.colors) !== null && _themeProps$colors3 !== void 0 && _themeProps$colors3.outerBorderOnFocus ? themeProps.colors.outerBorderOnFocus : _admin.primaryPalette.main,
16
+ toolbarBackground: themeProps !== null && themeProps !== void 0 && (_themeProps$colors4 = themeProps.colors) !== null && _themeProps$colors4 !== void 0 && _themeProps$colors4.toolbarBackground ? themeProps.colors.toolbarBackground : _colors.grey[100],
17
+ buttonIcon: themeProps !== null && themeProps !== void 0 && (_themeProps$colors5 = themeProps.colors) !== null && _themeProps$colors5 !== void 0 && _themeProps$colors5.buttonIcon ? themeProps.colors.buttonIcon : _colors.grey[600],
18
+ buttonIconDisabled: themeProps !== null && themeProps !== void 0 && (_themeProps$colors6 = themeProps.colors) !== null && _themeProps$colors6 !== void 0 && _themeProps$colors6.buttonIconDisabled ? themeProps.colors.buttonIconDisabled : _colors.grey[300],
19
+ buttonBackgroundHover: themeProps !== null && themeProps !== void 0 && (_themeProps$colors7 = themeProps.colors) !== null && _themeProps$colors7 !== void 0 && _themeProps$colors7.buttonBackgroundHover ? themeProps.colors.buttonBackgroundHover : _colors.grey[200],
20
+ buttonBorderHover: themeProps !== null && themeProps !== void 0 && (_themeProps$colors8 = themeProps.colors) !== null && _themeProps$colors8 !== void 0 && _themeProps$colors8.buttonBorderHover ? themeProps.colors.buttonBorderHover : _colors.grey[400],
21
+ buttonBorderDisabled: themeProps !== null && themeProps !== void 0 && (_themeProps$colors9 = themeProps.colors) !== null && _themeProps$colors9 !== void 0 && _themeProps$colors9.buttonBorderDisabled ? themeProps.colors.buttonBorderDisabled : _colors.grey[100]
19
22
  }
20
23
  };
21
24
  };
package/lib/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export { BlockElement, RteBlockElementClassKey, RteBlockElementProps } from "./core/BlockElement";
2
- export { default as BlockTypesControls, RteBlockTypeControlsClassKey } from "./core/Controls/BlockTypesControls";
3
- export { ControlButton, IProps as IControlButtonProps, RteControlButtonClassKey } from "./core/Controls/ControlButton";
4
- export { FeaturesButtonGroup, RteFeaturesButtonGroupClassKey } from "./core/Controls/FeaturesButtonGroup";
5
- export { default as LinkControls, RteLinkControlsClassKey, RteLinkControlsProps } from "./core/Controls/LinkControls";
1
+ export { BlockElement, type RteBlockElementClassKey, type RteBlockElementProps } from "./core/BlockElement";
2
+ export { default as BlockTypesControls, type RteBlockTypeControlsClassKey } from "./core/Controls/BlockTypesControls";
3
+ export { ControlButton, type IProps as IControlButtonProps, type RteControlButtonClassKey } from "./core/Controls/ControlButton";
4
+ export { FeaturesButtonGroup, type RteFeaturesButtonGroupClassKey } from "./core/Controls/FeaturesButtonGroup";
5
+ export { default as LinkControls, type RteLinkControlsClassKey, type RteLinkControlsProps } from "./core/Controls/LinkControls";
6
6
  export { Toolbar } from "./core/Controls/Toolbar/Toolbar";
7
- export { RteToolbarClassKey } from "./core/Controls/Toolbar/Toolbar.styles";
7
+ export type { RteToolbarClassKey } from "./core/Controls/Toolbar/Toolbar.styles";
8
8
  export { default as LinkDecorator } from "./core/extension/Link/Decorator";
9
9
  export { default as NonBreakingSpaceDecorator } from "./core/extension/NonBreakingSpace/Decorator";
10
10
  export { default as SoftHyphenDecorator } from "./core/extension/SoftHyphen/Decorator";
@@ -16,13 +16,14 @@ export { default as filterEditorUtilsUnstyleBlocks } from "./core/filterEditor/u
16
16
  export { default as filterEditorUtilsManipulateEntityData } from "./core/filterEditor/utils/manipulateEntityData";
17
17
  export { default as filterEditorUtilsRemoveEntities } from "./core/filterEditor/utils/removeEntities";
18
18
  export { default as filterEditorUtilsRemoveInlineStyles } from "./core/filterEditor/utils/removeInlineStyles";
19
- export { IMakeRteApiProps, IRteApiProps, default as makeRteApi, OnDebouncedContentChangeFn } from "./core/makeRteApi";
20
- export { FilterEditorStateBeforeUpdateFn, IOptions as IRteOptions, IRteRef, Rte, RteClassKey, RteProps } from "./core/Rte";
21
- export { IOptions as IRteReadOnlyOptions, IProps as IRteReadOnlyProps, default as RteReadOnly } from "./core/RteReadOnly";
19
+ export { type IMakeRteApiProps, type IRteApiProps, default as makeRteApi, type OnDebouncedContentChangeFn } from "./core/makeRteApi";
20
+ export { type FilterEditorStateBeforeUpdateFn, type IOptions as IRteOptions, type IRteRef, Rte, type RteClassKey, type RteProps } from "./core/Rte";
21
+ export { type IOptions as IRteReadOnlyOptions, type IProps as IRteReadOnlyProps, default as RteReadOnly } from "./core/RteReadOnly";
22
22
  export { stateToHtml } from "./core/translation/stateToHtml";
23
23
  export { default as findEntityInCurrentSelection } from "./core/utils/findEntityInCurrentSelection";
24
24
  export { default as findTextInCurrentSelection } from "./core/utils/findTextInCurrentSelection";
25
25
  export { pasteAndFilterText } from "./core/utils/pasteAndFilterText";
26
26
  export { default as selectionIsInOneBlock } from "./core/utils/selectionIsInOneBlock";
27
27
  export { default as createFinalFormRte } from "./field/createFinalFormRte";
28
+ export { requiredValidator } from "./utils/requiredValidator";
28
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AACjH,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACvH,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAC1G,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACtH,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAA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(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -28,54 +27,6 @@ Object.defineProperty(exports, "FeaturesButtonGroup", {
28
27
  return _FeaturesButtonGroup.FeaturesButtonGroup;
29
28
  }
30
29
  });
31
- Object.defineProperty(exports, "FilterEditorStateBeforeUpdateFn", {
32
- enumerable: true,
33
- get: function get() {
34
- return _Rte.FilterEditorStateBeforeUpdateFn;
35
- }
36
- });
37
- Object.defineProperty(exports, "IControlButtonProps", {
38
- enumerable: true,
39
- get: function get() {
40
- return _ControlButton.IProps;
41
- }
42
- });
43
- Object.defineProperty(exports, "IMakeRteApiProps", {
44
- enumerable: true,
45
- get: function get() {
46
- return _makeRteApi.IMakeRteApiProps;
47
- }
48
- });
49
- Object.defineProperty(exports, "IRteApiProps", {
50
- enumerable: true,
51
- get: function get() {
52
- return _makeRteApi.IRteApiProps;
53
- }
54
- });
55
- Object.defineProperty(exports, "IRteOptions", {
56
- enumerable: true,
57
- get: function get() {
58
- return _Rte.IOptions;
59
- }
60
- });
61
- Object.defineProperty(exports, "IRteReadOnlyOptions", {
62
- enumerable: true,
63
- get: function get() {
64
- return _RteReadOnly.IOptions;
65
- }
66
- });
67
- Object.defineProperty(exports, "IRteReadOnlyProps", {
68
- enumerable: true,
69
- get: function get() {
70
- return _RteReadOnly.IProps;
71
- }
72
- });
73
- Object.defineProperty(exports, "IRteRef", {
74
- enumerable: true,
75
- get: function get() {
76
- return _Rte.IRteRef;
77
- }
78
- });
79
30
  Object.defineProperty(exports, "LinkControls", {
80
31
  enumerable: true,
81
32
  get: function get() {
@@ -94,84 +45,18 @@ Object.defineProperty(exports, "NonBreakingSpaceDecorator", {
94
45
  return _Decorator2["default"];
95
46
  }
96
47
  });
97
- Object.defineProperty(exports, "OnDebouncedContentChangeFn", {
98
- enumerable: true,
99
- get: function get() {
100
- return _makeRteApi.OnDebouncedContentChangeFn;
101
- }
102
- });
103
48
  Object.defineProperty(exports, "Rte", {
104
49
  enumerable: true,
105
50
  get: function get() {
106
51
  return _Rte.Rte;
107
52
  }
108
53
  });
109
- Object.defineProperty(exports, "RteBlockElementClassKey", {
110
- enumerable: true,
111
- get: function get() {
112
- return _BlockElement.RteBlockElementClassKey;
113
- }
114
- });
115
- Object.defineProperty(exports, "RteBlockElementProps", {
116
- enumerable: true,
117
- get: function get() {
118
- return _BlockElement.RteBlockElementProps;
119
- }
120
- });
121
- Object.defineProperty(exports, "RteBlockTypeControlsClassKey", {
122
- enumerable: true,
123
- get: function get() {
124
- return _BlockTypesControls.RteBlockTypeControlsClassKey;
125
- }
126
- });
127
- Object.defineProperty(exports, "RteClassKey", {
128
- enumerable: true,
129
- get: function get() {
130
- return _Rte.RteClassKey;
131
- }
132
- });
133
- Object.defineProperty(exports, "RteControlButtonClassKey", {
134
- enumerable: true,
135
- get: function get() {
136
- return _ControlButton.RteControlButtonClassKey;
137
- }
138
- });
139
- Object.defineProperty(exports, "RteFeaturesButtonGroupClassKey", {
140
- enumerable: true,
141
- get: function get() {
142
- return _FeaturesButtonGroup.RteFeaturesButtonGroupClassKey;
143
- }
144
- });
145
- Object.defineProperty(exports, "RteLinkControlsClassKey", {
146
- enumerable: true,
147
- get: function get() {
148
- return _LinkControls.RteLinkControlsClassKey;
149
- }
150
- });
151
- Object.defineProperty(exports, "RteLinkControlsProps", {
152
- enumerable: true,
153
- get: function get() {
154
- return _LinkControls.RteLinkControlsProps;
155
- }
156
- });
157
- Object.defineProperty(exports, "RteProps", {
158
- enumerable: true,
159
- get: function get() {
160
- return _Rte.RteProps;
161
- }
162
- });
163
54
  Object.defineProperty(exports, "RteReadOnly", {
164
55
  enumerable: true,
165
56
  get: function get() {
166
57
  return _RteReadOnly["default"];
167
58
  }
168
59
  });
169
- Object.defineProperty(exports, "RteToolbarClassKey", {
170
- enumerable: true,
171
- get: function get() {
172
- return _Toolbar2.RteToolbarClassKey;
173
- }
174
- });
175
60
  Object.defineProperty(exports, "SoftHyphenDecorator", {
176
61
  enumerable: true,
177
62
  get: function get() {
@@ -262,6 +147,12 @@ Object.defineProperty(exports, "pasteAndFilterText", {
262
147
  return _pasteAndFilterText.pasteAndFilterText;
263
148
  }
264
149
  });
150
+ Object.defineProperty(exports, "requiredValidator", {
151
+ enumerable: true,
152
+ get: function get() {
153
+ return _requiredValidator.requiredValidator;
154
+ }
155
+ });
265
156
  Object.defineProperty(exports, "selectionIsInOneBlock", {
266
157
  enumerable: true,
267
158
  get: function get() {
@@ -275,12 +166,11 @@ Object.defineProperty(exports, "stateToHtml", {
275
166
  }
276
167
  });
277
168
  var _BlockElement = require("./core/BlockElement");
278
- var _BlockTypesControls = _interopRequireWildcard(require("./core/Controls/BlockTypesControls"));
169
+ var _BlockTypesControls = _interopRequireDefault(require("./core/Controls/BlockTypesControls"));
279
170
  var _ControlButton = require("./core/Controls/ControlButton");
280
171
  var _FeaturesButtonGroup = require("./core/Controls/FeaturesButtonGroup");
281
- var _LinkControls = _interopRequireWildcard(require("./core/Controls/LinkControls"));
172
+ var _LinkControls = _interopRequireDefault(require("./core/Controls/LinkControls"));
282
173
  var _Toolbar = require("./core/Controls/Toolbar/Toolbar");
283
- var _Toolbar2 = require("./core/Controls/Toolbar/Toolbar.styles");
284
174
  var _Decorator = _interopRequireDefault(require("./core/extension/Link/Decorator"));
285
175
  var _Decorator2 = _interopRequireDefault(require("./core/extension/NonBreakingSpace/Decorator"));
286
176
  var _Decorator3 = _interopRequireDefault(require("./core/extension/SoftHyphen/Decorator"));
@@ -292,14 +182,14 @@ var _changeBlockType = _interopRequireDefault(require("./core/filterEditor/utils
292
182
  var _manipulateEntityData = _interopRequireDefault(require("./core/filterEditor/utils/manipulateEntityData"));
293
183
  var _removeEntities = _interopRequireDefault(require("./core/filterEditor/utils/removeEntities"));
294
184
  var _removeInlineStyles = _interopRequireDefault(require("./core/filterEditor/utils/removeInlineStyles"));
295
- var _makeRteApi = _interopRequireWildcard(require("./core/makeRteApi"));
185
+ var _makeRteApi = _interopRequireDefault(require("./core/makeRteApi"));
296
186
  var _Rte = require("./core/Rte");
297
- var _RteReadOnly = _interopRequireWildcard(require("./core/RteReadOnly"));
187
+ var _RteReadOnly = _interopRequireDefault(require("./core/RteReadOnly"));
298
188
  var _stateToHtml = require("./core/translation/stateToHtml");
299
189
  var _findEntityInCurrentSelection = _interopRequireDefault(require("./core/utils/findEntityInCurrentSelection"));
300
190
  var _findTextInCurrentSelection = _interopRequireDefault(require("./core/utils/findTextInCurrentSelection"));
301
191
  var _pasteAndFilterText = require("./core/utils/pasteAndFilterText");
302
192
  var _selectionIsInOneBlock = _interopRequireDefault(require("./core/utils/selectionIsInOneBlock"));
303
193
  var _createFinalFormRte = _interopRequireDefault(require("./field/createFinalFormRte"));
304
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
305
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
194
+ var _requiredValidator = require("./utils/requiredValidator");
195
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
@@ -0,0 +1,4 @@
1
+ import { type RawDraftContentState } from "draft-js";
2
+ import { type FieldValidator } from "final-form";
3
+ export declare const requiredValidator: FieldValidator<string | RawDraftContentState | undefined>;
4
+ //# sourceMappingURL=requiredValidator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requiredValidator.d.ts","sourceRoot":"","sources":["../../src/utils/requiredValidator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAKjD,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,MAAM,GAAG,oBAAoB,GAAG,SAAS,CASvF,CAAC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.requiredValidator = void 0;
7
+ var _draftJs = require("draft-js");
8
+ var _reactIntl = require("react-intl");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ var requiredMessage = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
11
+ id: "comet.form.required",
12
+ defaultMessage: "Required"
13
+ });
14
+ var requiredValidator = exports.requiredValidator = function requiredValidator(value) {
15
+ if (value === undefined) {
16
+ return requiredMessage;
17
+ }
18
+ var rawState = typeof value === "string" ? JSON.parse(value) : value;
19
+ var contentState = (0, _draftJs.convertFromRaw)(rawState);
20
+ var hasText = contentState.hasText();
21
+ return hasText ? undefined : requiredMessage;
22
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/admin-rte",
3
- "version": "9.0.0-canary-20251209132220",
3
+ "version": "9.0.0-canary-20251211112608",
4
4
  "description": "Comet Admin Rich Text Editor component",
5
5
  "repository": {
6
6
  "directory": "packages/admin/admin-rte",
@@ -20,14 +20,14 @@
20
20
  "draft-js-import-html": "^1.4.1",
21
21
  "draftjs-conductor": "^3.0.0",
22
22
  "immutable": "~3.8.2",
23
- "@comet/admin": "9.0.0-canary-20251209132220",
24
- "@comet/admin-icons": "9.0.0-canary-20251209132220"
23
+ "@comet/admin": "9.0.0-canary-20251211112608",
24
+ "@comet/admin-icons": "9.0.0-canary-20251211112608"
25
25
  },
26
26
  "devDependencies": {
27
- "@babel/cli": "^7.28.0",
28
- "@babel/core": "^7.28.0",
29
- "@mui/material": "^7.2.0",
30
- "@types/draft-js": "^0.11.18",
27
+ "@babel/cli": "^7.28.3",
28
+ "@babel/core": "^7.28.5",
29
+ "@mui/material": "^7.3.5",
30
+ "@types/draft-js": "^0.11.20",
31
31
  "@types/jest": "^29.5.14",
32
32
  "@types/react": "^18.3.23",
33
33
  "@types/react-dom": "^18.3.7",
@@ -42,11 +42,11 @@
42
42
  "react-dom": "^18.3.1",
43
43
  "react-final-form": "^6.5.9",
44
44
  "react-intl": "^7.1.11",
45
- "rimraf": "^6.0.1",
45
+ "rimraf": "^6.1.2",
46
46
  "ts-jest": "^29.4.0",
47
47
  "typescript": "5.9.3",
48
- "@comet/admin-babel-preset": "9.0.0-canary-20251209132220",
49
- "@comet/eslint-config": "9.0.0-canary-20251209132220"
48
+ "@comet/admin-babel-preset": "9.0.0-canary-20251211112608",
49
+ "@comet/eslint-config": "9.0.0-canary-20251211112608"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@mui/material": "^7.0.0",
@@ -70,6 +70,7 @@
70
70
  "build:types": "tsc --project ./tsconfig.json --emitDeclarationOnly",
71
71
  "clean": "rimraf lib",
72
72
  "lint": "run-p lint:prettier lint:eslint lint:tsc",
73
+ "lint:ci": "pnpm run lint",
73
74
  "lint:eslint": "eslint --max-warnings 0 src/ **/*.json --no-warn-ignored",
74
75
  "lint:prettier": "pnpm exec prettier --check './**/*.{js,json,md,yml,yaml}'",
75
76
  "lint:tsc": "tsc --noEmit",