@monolith-forensics/monolith-ui 1.8.1-dev.4 → 1.8.1

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 (170) hide show
  1. package/dist/Button/Button.js +58 -9
  2. package/dist/Calendar/Calendar.d.ts +2 -7
  3. package/dist/Calendar/Calendar.js +49 -226
  4. package/dist/Calendar/CalendarStyles.d.ts +2 -6
  5. package/dist/Calendar/CalendarStyles.js +33 -153
  6. package/dist/Calendar/calendarHelpers.d.ts +2 -6
  7. package/dist/Calendar/calendarHelpers.js +5 -13
  8. package/dist/Charts/BarChart/BarChart.js +28 -14
  9. package/dist/Charts/BarChart/BarChart.styled.d.ts +7 -2
  10. package/dist/Charts/BarChart/BarChart.styled.js +5 -1
  11. package/dist/Charts/BarChart/BarChart.types.d.ts +13 -5
  12. package/dist/Charts/ChartUtils/chartSizing.d.ts +20 -0
  13. package/dist/Charts/ChartUtils/chartSizing.js +83 -0
  14. package/dist/Charts/ChartUtils/index.d.ts +1 -0
  15. package/dist/Charts/ChartUtils/index.js +1 -0
  16. package/dist/Charts/HeatMap/HeatMap.js +28 -7
  17. package/dist/Charts/HeatMap/HeatMap.styled.d.ts +6 -2
  18. package/dist/Charts/HeatMap/HeatMap.styled.js +3 -0
  19. package/dist/Charts/HeatMap/HeatMap.types.d.ts +7 -1
  20. package/dist/Charts/LineChart/LineChart.js +34 -15
  21. package/dist/Charts/LineChart/LineChart.styled.d.ts +7 -2
  22. package/dist/Charts/LineChart/LineChart.styled.js +5 -1
  23. package/dist/Charts/LineChart/LineChart.types.d.ts +13 -5
  24. package/dist/Charts/PieChart/PieChart.js +48 -33
  25. package/dist/Charts/PieChart/PieChart.styled.d.ts +7 -2
  26. package/dist/Charts/PieChart/PieChart.styled.js +6 -1
  27. package/dist/Charts/PieChart/PieChart.types.d.ts +7 -3
  28. package/dist/CheckBox/CheckBox.js +19 -36
  29. package/dist/DateInput/DateInput.js +143 -198
  30. package/dist/DropDownMenu/DropDownMenu.js +15 -25
  31. package/dist/DropDownMenu/components/MenuComponent.js +2 -8
  32. package/dist/DropDownMenu/components/MenuItem.d.ts +0 -2
  33. package/dist/DropDownMenu/components/MenuItem.js +21 -25
  34. package/dist/DropDownMenu/components/MenuItemList.d.ts +0 -3
  35. package/dist/DropDownMenu/components/MenuItemList.js +86 -192
  36. package/dist/DropDownMenu/components/StyledContent.js +2 -1
  37. package/dist/DropDownMenu/components/StyledFloatContainer.js +1 -1
  38. package/dist/DropDownMenu/types.d.ts +0 -3
  39. package/dist/FieldLabel/FieldLabel.js +12 -4
  40. package/dist/FileInputField/FileInputField.js +23 -4
  41. package/dist/FileViewer/viewers/ImageViewer.js +18 -75
  42. package/dist/FormSection/FormSection.js +25 -5
  43. package/dist/IconButton/IconButton.js +16 -2
  44. package/dist/Input/Input.js +56 -7
  45. package/dist/MonolithUIProvider/MonolithUIProvider.d.ts +4 -1
  46. package/dist/Pill/Pill.js +79 -8
  47. package/dist/Popover/Popover.context.d.ts +1 -2
  48. package/dist/Popover/Popover.js +2 -5
  49. package/dist/Popover/Popover.styles.d.ts +6 -1
  50. package/dist/Popover/Popover.styles.js +28 -11
  51. package/dist/Popover/Popover.transitions.d.ts +2 -4
  52. package/dist/Popover/Popover.transitions.js +49 -23
  53. package/dist/Popover/PopoverDropdown.js +8 -6
  54. package/dist/Popover/PopoverTarget.js +3 -6
  55. package/dist/QueryFilter/DefaultOperators.d.ts +76 -0
  56. package/dist/QueryFilter/DefaultOperators.js +21 -0
  57. package/dist/QueryFilter/QueryFilter.d.ts +1 -1
  58. package/dist/QueryFilter/QueryFilter.js +303 -3
  59. package/dist/QueryFilter/index.d.ts +2 -3
  60. package/dist/QueryFilter/index.js +2 -3
  61. package/dist/QueryFilter/types.d.ts +52 -0
  62. package/dist/QueryFilter/types.js +1 -0
  63. package/dist/QueryFilter/useQueryFilter.d.ts +1 -1
  64. package/dist/QueryFilter/useQueryFilter.js +19 -23
  65. package/dist/RichTextEditor/Components/CodeBlockBaseButton.d.ts +18 -0
  66. package/dist/RichTextEditor/Components/CodeBlockBaseButton.js +6 -0
  67. package/dist/RichTextEditor/Components/CodeBlockCopyButton.d.ts +9 -0
  68. package/dist/RichTextEditor/Components/CodeBlockCopyButton.js +42 -0
  69. package/dist/RichTextEditor/Components/CodeBlockFormatButton.d.ts +10 -0
  70. package/dist/RichTextEditor/Components/CodeBlockFormatButton.js +60 -0
  71. package/dist/RichTextEditor/Components/CodeBlockLanguageSelect.d.ts +9 -0
  72. package/dist/RichTextEditor/Components/CodeBlockLanguageSelect.js +30 -0
  73. package/dist/RichTextEditor/Components/CodeBlockNodeView.d.ts +3 -0
  74. package/dist/RichTextEditor/Components/CodeBlockNodeView.js +28 -0
  75. package/dist/RichTextEditor/Components/CodeBlockWrapButton.d.ts +10 -0
  76. package/dist/RichTextEditor/Components/CodeBlockWrapButton.js +17 -0
  77. package/dist/RichTextEditor/Components/LinkEditor.d.ts +8 -0
  78. package/dist/RichTextEditor/Components/LinkEditor.js +94 -0
  79. package/dist/RichTextEditor/Components/TableTools/TableCornerMenu.d.ts +2 -0
  80. package/dist/RichTextEditor/Components/TableTools/TableCornerMenu.js +19 -0
  81. package/dist/RichTextEditor/Components/TableTools/TableInsertControls.d.ts +2 -0
  82. package/dist/RichTextEditor/Components/TableTools/TableInsertControls.js +24 -0
  83. package/dist/RichTextEditor/Components/TableTools/TableRails.d.ts +2 -0
  84. package/dist/RichTextEditor/Components/TableTools/TableRails.js +180 -0
  85. package/dist/RichTextEditor/Components/TableTools/TableToolMenu.d.ts +5 -0
  86. package/dist/RichTextEditor/Components/TableTools/TableToolMenu.js +6 -0
  87. package/dist/RichTextEditor/Components/TableTools/TableTools.actions.d.ts +5 -0
  88. package/dist/RichTextEditor/Components/TableTools/TableTools.actions.js +183 -0
  89. package/dist/RichTextEditor/Components/TableTools/TableTools.commands.d.ts +16 -0
  90. package/dist/RichTextEditor/Components/TableTools/TableTools.commands.js +217 -0
  91. package/dist/RichTextEditor/Components/TableTools/TableTools.constants.d.ts +8 -0
  92. package/dist/RichTextEditor/Components/TableTools/TableTools.constants.js +11 -0
  93. package/dist/RichTextEditor/Components/TableTools/TableTools.d.ts +3 -0
  94. package/dist/RichTextEditor/Components/TableTools/TableTools.geometry.d.ts +23 -0
  95. package/dist/RichTextEditor/Components/TableTools/TableTools.geometry.js +75 -0
  96. package/dist/RichTextEditor/Components/TableTools/TableTools.js +3 -0
  97. package/dist/RichTextEditor/Components/TableTools/TableTools.selectors.d.ts +16 -0
  98. package/dist/RichTextEditor/Components/TableTools/TableTools.selectors.js +53 -0
  99. package/dist/RichTextEditor/Components/TableTools/TableTools.styled.d.ts +40 -0
  100. package/dist/RichTextEditor/Components/TableTools/TableTools.styled.js +167 -0
  101. package/dist/RichTextEditor/Components/TableTools/TableTools.types.d.ts +76 -0
  102. package/dist/RichTextEditor/Components/TableTools/TableTools.types.js +1 -0
  103. package/dist/RichTextEditor/Components/TableTools/TableTools.utils.d.ts +4 -0
  104. package/dist/RichTextEditor/Components/TableTools/TableTools.utils.js +4 -0
  105. package/dist/RichTextEditor/Components/TableTools/TableToolsPopover.d.ts +2 -0
  106. package/dist/RichTextEditor/Components/TableTools/TableToolsPopover.js +12 -0
  107. package/dist/RichTextEditor/Components/TableTools/index.d.ts +3 -0
  108. package/dist/RichTextEditor/Components/TableTools/index.js +2 -0
  109. package/dist/RichTextEditor/Enums/HighlightColors.d.ts +9 -0
  110. package/dist/RichTextEditor/Enums/HighlightColors.js +10 -0
  111. package/dist/RichTextEditor/Extensions/getTiptapExtensions.js +15 -5
  112. package/dist/RichTextEditor/Plugins/ImageActionsPlugin.js +4 -7
  113. package/dist/RichTextEditor/Plugins/UploadImagesPlugin.d.ts +0 -15
  114. package/dist/RichTextEditor/Plugins/UploadImagesPlugin.js +51 -115
  115. package/dist/RichTextEditor/Plugins/index.d.ts +0 -1
  116. package/dist/RichTextEditor/Plugins/index.js +0 -1
  117. package/dist/RichTextEditor/RichTextEditor.d.ts +2 -3
  118. package/dist/RichTextEditor/RichTextEditor.js +35 -309
  119. package/dist/RichTextEditor/Toolbar/Toolbar.js +2 -14
  120. package/dist/RichTextEditor/Utils/codeBlockUtils.d.ts +20 -0
  121. package/dist/RichTextEditor/Utils/codeBlockUtils.js +137 -0
  122. package/dist/RichTextEditor/Utils/codeUtils.d.ts +3 -0
  123. package/dist/RichTextEditor/Utils/codeUtils.js +12 -0
  124. package/dist/RichTextEditor/Utils/linkUtils.d.ts +19 -0
  125. package/dist/RichTextEditor/Utils/linkUtils.js +57 -0
  126. package/dist/RichTextEditor/Utils/tableUtils.d.ts +1 -0
  127. package/dist/RichTextEditor/Utils/tableUtils.js +1 -0
  128. package/dist/SegmentedControl/SegmentedControl.utils.d.ts +2 -2
  129. package/dist/SegmentedControl/SegmentedControl.utils.js +30 -3
  130. package/dist/SelectBox/SelectBox.js +5 -5
  131. package/dist/SelectBox/select-box.styled-components.d.ts +1 -4
  132. package/dist/SelectBox/select-box.styled-components.js +48 -11
  133. package/dist/SelectBox/types.d.ts +0 -1
  134. package/dist/Switch/Switch.d.ts +2 -2
  135. package/dist/Switch/Switch.js +83 -18
  136. package/dist/Table/ColumnResizer.d.ts +9 -6
  137. package/dist/Table/ColumnResizer.js +10 -30
  138. package/dist/Table/StateStorage.d.ts +0 -4
  139. package/dist/Table/StateStorage.js +0 -13
  140. package/dist/Table/Table.js +12 -160
  141. package/dist/Table/TableComponents.d.ts +0 -10
  142. package/dist/Table/TableComponents.js +10 -71
  143. package/dist/Table/TableDefaults.d.ts +0 -7
  144. package/dist/Table/TableDefaults.js +0 -7
  145. package/dist/Table/TableHeader.js +16 -31
  146. package/dist/Table/TableMenu/TableMenu.js +1 -1
  147. package/dist/Table/TableProvider.js +75 -354
  148. package/dist/Table/TableRow.js +16 -28
  149. package/dist/Table/Utils/index.d.ts +1 -0
  150. package/dist/Table/Utils/index.js +1 -0
  151. package/dist/Table/Utils/resizeHandler.d.ts +3 -0
  152. package/dist/Table/Utils/resizeHandler.js +84 -0
  153. package/dist/Table/types.d.ts +19 -70
  154. package/dist/TagBox/TagBox.d.ts +1 -1
  155. package/dist/TagBox/TagBox.js +80 -22
  156. package/dist/TagBox/types.d.ts +0 -1
  157. package/dist/TextArea/TextArea.js +23 -9
  158. package/dist/TextInput/TextInput.js +6 -12
  159. package/dist/Utilities/parseTimestamp.js +6 -11
  160. package/dist/core/ArrowButton.d.ts +0 -2
  161. package/dist/core/ArrowButton.js +3 -7
  162. package/dist/core/ClearButton.d.ts +0 -2
  163. package/dist/core/ClearButton.js +3 -7
  164. package/dist/core/controlSizes.js +9 -9
  165. package/dist/core/index.d.ts +0 -1
  166. package/dist/core/index.js +0 -1
  167. package/dist/index.d.ts +0 -3
  168. package/dist/index.js +0 -2
  169. package/dist/theme/variants.js +8 -2
  170. package/package.json +18 -26
@@ -23,11 +23,7 @@ export const Toolbar = styled(({ className, editor, toolbarOptions }) => {
23
23
  return (_jsx(Button, Object.assign({}, item.options, { children: (_a = item === null || item === void 0 ? void 0 : item.options) === null || _a === void 0 ? void 0 : _a.label }), index));
24
24
  }
25
25
  else if (item.type === "menu") {
26
- return (_jsx(DropDownMenu, Object.assign({ dropDownProps: {
27
- style: {
28
- width: 135,
29
- },
30
- } }, item.options, { children: (_b = item === null || item === void 0 ? void 0 : item.options) === null || _b === void 0 ? void 0 : _b.label }), index));
26
+ return (_jsx(DropDownMenu, Object.assign({}, item.options, { children: (_b = item === null || item === void 0 ? void 0 : item.options) === null || _b === void 0 ? void 0 : _b.label }), index));
31
27
  }
32
28
  }), (controls === null || controls === void 0 ? void 0 : controls.includes(Controls.FONT)) && (_jsx(DropDownMenu, { data: Object.values(Fonts).map((font) => ({
33
29
  label: font,
@@ -35,11 +31,7 @@ export const Toolbar = styled(({ className, editor, toolbarOptions }) => {
35
31
  onClick: () => {
36
32
  setFont(font);
37
33
  },
38
- })), size: "xxs", variant: "outlined", arrow: true, dropDownProps: {
39
- style: {
40
- width: 135,
41
- },
42
- }, buttonProps: {
34
+ })), size: "xxs", variant: "outlined", arrow: true, buttonProps: {
43
35
  title: "Select Font",
44
36
  }, children: (font || Fonts.DEFAULT) })), _jsxs(ControlsGroup, { children: [(controls === null || controls === void 0 ? void 0 : controls.includes(Controls.UNDO)) && _jsx(UndoControl, { editor: editor }), (controls === null || controls === void 0 ? void 0 : controls.includes(Controls.REDO)) && _jsx(RedoControl, { editor: editor })] }), (controls === null || controls === void 0 ? void 0 : controls.includes(Controls.COLOR)) && (_jsx(DropDownMenu, { data: [
45
37
  {
@@ -68,10 +60,6 @@ export const Toolbar = styled(({ className, editor, toolbarOptions }) => {
68
60
  borderRadius: "3px",
69
61
  } }), item.label] })), size: "xxs", variant: "outlined", arrow: true, buttonProps: {
70
62
  title: "Select Color",
71
- }, dropDownProps: {
72
- style: {
73
- width: 100,
74
- },
75
63
  }, children: "Color" })), _jsxs(ControlsGroup, { children: [(controls === null || controls === void 0 ? void 0 : controls.includes(Controls.BOLD)) && _jsx(BoldControl, { editor: editor }), (controls === null || controls === void 0 ? void 0 : controls.includes(Controls.ITALIC)) && (_jsx(ItalicControl, { editor: editor })), (controls === null || controls === void 0 ? void 0 : controls.includes(Controls.UNDERLINE)) && (_jsx(UnderlineControl, { editor: editor })), (controls === null || controls === void 0 ? void 0 : controls.includes(Controls.STRIKE)) && (_jsx(StrikeThroughControl, { editor: editor }))] }), _jsxs(ControlsGroup, { children: [(controls === null || controls === void 0 ? void 0 : controls.includes(Controls.HEADING_1)) && (_jsx(Heading1Control, { editor: editor })), (controls === null || controls === void 0 ? void 0 : controls.includes(Controls.HEADING_2)) && (_jsx(Heading2Control, { editor: editor })), (controls === null || controls === void 0 ? void 0 : controls.includes(Controls.HEADING_3)) && (_jsx(Heading3Control, { editor: editor })), (controls === null || controls === void 0 ? void 0 : controls.includes(Controls.HEADING_4)) && (_jsx(Heading4Control, { editor: editor }))] }), _jsxs(ControlsGroup, { children: [(controls === null || controls === void 0 ? void 0 : controls.includes(Controls.BULLET_LIST)) && (_jsx(BulletListControl, { editor: editor })), (controls === null || controls === void 0 ? void 0 : controls.includes(Controls.ORDERED_LIST)) && (_jsx(OrderedListControl, { editor: editor }))] }), _jsxs(ControlsGroup, { children: [(controls === null || controls === void 0 ? void 0 : controls.includes(Controls.TEXT_ALIGN_LEFT)) && (_jsx(AlignLeftControl, { editor: editor })), (controls === null || controls === void 0 ? void 0 : controls.includes(Controls.TEXT_ALIGN_CENTER)) && (_jsx(AlignCenterControl, { editor: editor })), (controls === null || controls === void 0 ? void 0 : controls.includes(Controls.TEXT_ALIGN_RIGHT)) && (_jsx(AlignRightControl, { editor: editor })), (controls === null || controls === void 0 ? void 0 : controls.includes(Controls.TEXT_ALIGN_JUSTIFIED)) && (_jsx(AlignJustifiedControl, { editor: editor }))] })] }));
76
64
  }) `
77
65
  display: flex;
@@ -0,0 +1,20 @@
1
+ import { Editor } from "@tiptap/react";
2
+ export type CodeBlockLanguage = {
3
+ label: string;
4
+ value: string;
5
+ };
6
+ export declare const DEFAULT_CODE_BLOCK_LANGUAGE = "plaintext";
7
+ export declare const CODE_BLOCK_LANGUAGES: CodeBlockLanguage[];
8
+ export declare const getCodeBlockLanguage: (editor: Editor | null) => string;
9
+ export declare const getCodeBlockLanguageOption: (language?: string) => CodeBlockLanguage;
10
+ export declare const canFormatCodeBlockLanguage: (language?: string) => boolean;
11
+ export declare const formatCodeBlockText: (text: string, language?: string) => Promise<string>;
12
+ export declare const hasSyntaxHighlightedCodeBlock: (editor: Editor | null) => boolean;
13
+ export declare const setCodeBlockLanguage: (editor: Editor | null, language: string) => void;
14
+ export declare const getCodeBlockWrap: (editor: Editor | null) => boolean;
15
+ export declare const toggleCodeBlockWrap: (editor: Editor | null) => void;
16
+ export declare const toggleCodeBlock: (editor: Editor | null) => void;
17
+ export declare const getActiveCodeBlockText: (editor: Editor | null) => string;
18
+ export declare const replaceCodeBlockContent: (editor: Editor, from: number, to: number, text: string) => boolean;
19
+ export declare const formatActiveCodeBlock: (editor: Editor | null) => Promise<void>;
20
+ export declare const copyCodeBlockText: (text: string) => Promise<void>;
@@ -0,0 +1,137 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import prettier from "prettier/standalone";
11
+ import * as prettierBabelPlugin from "prettier/plugins/babel";
12
+ import * as prettierEstreePlugin from "prettier/plugins/estree";
13
+ import * as prettierHtmlPlugin from "prettier/plugins/html";
14
+ import * as prettierMarkdownPlugin from "prettier/plugins/markdown";
15
+ import * as prettierPostcssPlugin from "prettier/plugins/postcss";
16
+ import * as prettierTypescriptPlugin from "prettier/plugins/typescript";
17
+ import * as prettierYamlPlugin from "prettier/plugins/yaml";
18
+ export const DEFAULT_CODE_BLOCK_LANGUAGE = "plaintext";
19
+ export const CODE_BLOCK_LANGUAGES = [
20
+ { label: "Plain Text", value: DEFAULT_CODE_BLOCK_LANGUAGE },
21
+ { label: "JavaScript", value: "javascript" },
22
+ { label: "TypeScript", value: "typescript" },
23
+ { label: "JSX", value: "jsx" },
24
+ { label: "TSX", value: "tsx" },
25
+ { label: "HTML", value: "html" },
26
+ { label: "CSS", value: "css" },
27
+ { label: "JSON", value: "json" },
28
+ { label: "Markdown", value: "markdown" },
29
+ { label: "Bash", value: "bash" },
30
+ { label: "Python", value: "python" },
31
+ { label: "SQL", value: "sql" },
32
+ { label: "YAML", value: "yaml" },
33
+ { label: "XML", value: "xml" },
34
+ ];
35
+ const PRETTIER_PARSERS = {
36
+ javascript: "babel",
37
+ jsx: "babel",
38
+ typescript: "typescript",
39
+ tsx: "typescript",
40
+ html: "html",
41
+ css: "css",
42
+ json: "json",
43
+ markdown: "markdown",
44
+ yaml: "yaml",
45
+ };
46
+ const PRETTIER_PLUGINS = [
47
+ prettierBabelPlugin,
48
+ prettierEstreePlugin,
49
+ prettierHtmlPlugin,
50
+ prettierMarkdownPlugin,
51
+ prettierPostcssPlugin,
52
+ prettierTypescriptPlugin,
53
+ prettierYamlPlugin,
54
+ ];
55
+ export const getCodeBlockLanguage = (editor) => {
56
+ var _a;
57
+ return (((_a = editor === null || editor === void 0 ? void 0 : editor.getAttributes("codeBlock")) === null || _a === void 0 ? void 0 : _a.language) ||
58
+ DEFAULT_CODE_BLOCK_LANGUAGE);
59
+ };
60
+ export const getCodeBlockLanguageOption = (language) => {
61
+ return (CODE_BLOCK_LANGUAGES.find((item) => item.value === language) ||
62
+ CODE_BLOCK_LANGUAGES[0]);
63
+ };
64
+ export const canFormatCodeBlockLanguage = (language) => {
65
+ return Boolean(language && PRETTIER_PARSERS[language]);
66
+ };
67
+ export const formatCodeBlockText = (text, language) => __awaiter(void 0, void 0, void 0, function* () {
68
+ const parser = language ? PRETTIER_PARSERS[language] : undefined;
69
+ if (!parser) {
70
+ throw new Error("Code formatting is not supported for this language.");
71
+ }
72
+ const formatted = yield prettier.format(text, {
73
+ parser,
74
+ plugins: PRETTIER_PLUGINS,
75
+ });
76
+ return formatted.replace(/\n$/, "");
77
+ });
78
+ export const hasSyntaxHighlightedCodeBlock = (editor) => {
79
+ return Boolean(editor === null || editor === void 0 ? void 0 : editor.extensionManager.extensions.find((extension) => { var _a; return extension.name === "codeBlock" && ((_a = extension.options) === null || _a === void 0 ? void 0 : _a.lowlight); }));
80
+ };
81
+ export const setCodeBlockLanguage = (editor, language) => {
82
+ if (!(editor === null || editor === void 0 ? void 0 : editor.isActive("codeBlock")))
83
+ return;
84
+ editor.chain().focus().updateAttributes("codeBlock", { language }).run();
85
+ };
86
+ export const getCodeBlockWrap = (editor) => {
87
+ var _a;
88
+ return Boolean((_a = editor === null || editor === void 0 ? void 0 : editor.getAttributes("codeBlock")) === null || _a === void 0 ? void 0 : _a.wrap);
89
+ };
90
+ export const toggleCodeBlockWrap = (editor) => {
91
+ if (!(editor === null || editor === void 0 ? void 0 : editor.isActive("codeBlock")))
92
+ return;
93
+ editor
94
+ .chain()
95
+ .focus()
96
+ .updateAttributes("codeBlock", { wrap: !getCodeBlockWrap(editor) })
97
+ .run();
98
+ };
99
+ export const toggleCodeBlock = (editor) => {
100
+ if (!editor)
101
+ return;
102
+ editor
103
+ .chain()
104
+ .focus()
105
+ .toggleCodeBlock({ language: DEFAULT_CODE_BLOCK_LANGUAGE })
106
+ .run();
107
+ };
108
+ export const getActiveCodeBlockText = (editor) => {
109
+ if (!(editor === null || editor === void 0 ? void 0 : editor.isActive("codeBlock")))
110
+ return "";
111
+ return editor.state.selection.$from.parent.textContent;
112
+ };
113
+ export const replaceCodeBlockContent = (editor, from, to, text) => {
114
+ return editor.commands.command(({ state, tr }) => {
115
+ if (text.length) {
116
+ tr.replaceWith(from, to, state.schema.text(text));
117
+ }
118
+ else {
119
+ tr.delete(from, to);
120
+ }
121
+ return true;
122
+ });
123
+ };
124
+ export const formatActiveCodeBlock = (editor) => __awaiter(void 0, void 0, void 0, function* () {
125
+ if (!(editor === null || editor === void 0 ? void 0 : editor.isActive("codeBlock")))
126
+ return;
127
+ const language = getCodeBlockLanguage(editor);
128
+ const formatted = yield formatCodeBlockText(getActiveCodeBlockText(editor), language);
129
+ replaceCodeBlockContent(editor, editor.state.selection.$from.start(), editor.state.selection.$from.end(), formatted);
130
+ });
131
+ export const copyCodeBlockText = (text) => __awaiter(void 0, void 0, void 0, function* () {
132
+ var _a;
133
+ if (!((_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.writeText)) {
134
+ throw new Error("Clipboard copying is not supported by this browser.");
135
+ }
136
+ yield navigator.clipboard.writeText(text);
137
+ });
@@ -0,0 +1,3 @@
1
+ import { Editor } from "@tiptap/react";
2
+ export declare const hasInlineCode: (editor: Editor | null) => boolean;
3
+ export declare const toggleInlineCode: (editor: Editor | null) => void;
@@ -0,0 +1,12 @@
1
+ export const hasInlineCode = (editor) => {
2
+ return Boolean(editor === null || editor === void 0 ? void 0 : editor.extensionManager.extensions.find((extension) => extension.name === "code"));
3
+ };
4
+ export const toggleInlineCode = (editor) => {
5
+ if (!editor || !hasInlineCode(editor))
6
+ return;
7
+ if (editor.isActive("code")) {
8
+ editor.chain().focus().unsetCode().run();
9
+ return;
10
+ }
11
+ editor.chain().focus().unsetAllMarks().setCode().run();
12
+ };
@@ -0,0 +1,19 @@
1
+ import { EditorState } from "@tiptap/pm/state";
2
+ export declare const LINK_TARGET = "_blank";
3
+ export declare const LINK_REL = "noopener noreferrer nofollow";
4
+ export type NormalizedLink = {
5
+ href: string;
6
+ isValid: boolean;
7
+ };
8
+ export declare const normalizeLinkUrl: (value?: string | null) => NormalizedLink;
9
+ export declare const getLinkAttributes: (href: string) => {
10
+ href: string;
11
+ target: string;
12
+ rel: string;
13
+ class: string;
14
+ };
15
+ export declare const openLink: (href?: string | null) => void;
16
+ export declare const getLinkRangeAtPosition: (state: EditorState, pos: number) => void | import("@tiptap/core").Range;
17
+ export declare const getLinkAttributesAtPosition: (state: EditorState, pos: number) => {
18
+ href?: string;
19
+ } | undefined;
@@ -0,0 +1,57 @@
1
+ import { getMarkRange } from "@tiptap/core";
2
+ export const LINK_TARGET = "_blank";
3
+ export const LINK_REL = "noopener noreferrer nofollow";
4
+ export const normalizeLinkUrl = (value) => {
5
+ const trimmedValue = (value === null || value === void 0 ? void 0 : value.trim()) || "";
6
+ if (!trimmedValue) {
7
+ return { href: "", isValid: false };
8
+ }
9
+ const href = /^[a-z][a-z0-9+.-]*:/i.test(trimmedValue)
10
+ ? trimmedValue
11
+ : `https://${trimmedValue}`;
12
+ try {
13
+ const url = new URL(href);
14
+ const isValid = url.protocol === "http:" || url.protocol === "https:";
15
+ return {
16
+ href,
17
+ isValid,
18
+ };
19
+ }
20
+ catch (_a) {
21
+ return {
22
+ href,
23
+ isValid: false,
24
+ };
25
+ }
26
+ };
27
+ export const getLinkAttributes = (href) => ({
28
+ href,
29
+ target: LINK_TARGET,
30
+ rel: LINK_REL,
31
+ class: "editor-link",
32
+ });
33
+ export const openLink = (href) => {
34
+ if (!href)
35
+ return;
36
+ const normalizedLink = normalizeLinkUrl(href);
37
+ if (!normalizedLink.isValid)
38
+ return;
39
+ window.open(normalizedLink.href, "_blank", "noopener,noreferrer");
40
+ };
41
+ export const getLinkRangeAtPosition = (state, pos) => {
42
+ const linkMark = state.schema.marks.link;
43
+ if (!linkMark)
44
+ return;
45
+ return getMarkRange(state.doc.resolve(pos), linkMark);
46
+ };
47
+ export const getLinkAttributesAtPosition = (state, pos) => {
48
+ const linkMark = state.schema.marks.link;
49
+ if (!linkMark)
50
+ return;
51
+ const $pos = state.doc.resolve(pos);
52
+ const nextNode = $pos.parent.childAfter($pos.parentOffset).node;
53
+ const previousNode = $pos.parent.childBefore($pos.parentOffset).node;
54
+ const mark = (nextNode === null || nextNode === void 0 ? void 0 : nextNode.marks.find((mark) => mark.type === linkMark)) ||
55
+ (previousNode === null || previousNode === void 0 ? void 0 : previousNode.marks.find((mark) => mark.type === linkMark));
56
+ return mark === null || mark === void 0 ? void 0 : mark.attrs;
57
+ };
@@ -0,0 +1 @@
1
+ export declare const TABLE_CELL_MIN_WIDTH = 120;
@@ -0,0 +1 @@
1
+ export const TABLE_CELL_MIN_WIDTH = 120;
@@ -4,8 +4,8 @@ export declare const resolveActiveColor: (theme: any, activeColor?: string) => {
4
4
  main: any;
5
5
  contrastText: any;
6
6
  };
7
- export declare const getSegmentHeight: (size?: Size) => number;
8
- export declare const getSegmentFontSize: (size?: Size) => string;
7
+ export declare const getSegmentHeight: (size?: Size) => 32 | 38 | 22 | 26 | 46 | 56;
8
+ export declare const getSegmentFontSize: (size?: Size) => "11px" | "12px" | "14px" | "16px" | "18px" | "20px";
9
9
  export declare const normalizeSegmentedData: (data: SegmentedControlDataItem[]) => NormalizedSegmentedItem[];
10
10
  export declare const getFirstEnabledIndex: (data: NormalizedSegmentedItem[]) => number;
11
11
  export declare const getNextEnabledIndex: (data: NormalizedSegmentedItem[], startIndex: number, direction: 1 | -1) => number;
@@ -1,4 +1,3 @@
1
- import { getControlSizeTokens } from "../core";
2
1
  export const resolveActiveColor = (theme, activeColor) => {
3
2
  var _a;
4
3
  const fallback = {
@@ -22,10 +21,38 @@ export const resolveActiveColor = (theme, activeColor) => {
22
21
  };
23
22
  };
24
23
  export const getSegmentHeight = (size) => {
25
- return getControlSizeTokens(size).segmentedHeight;
24
+ switch (size) {
25
+ case "xxs":
26
+ return 22;
27
+ case "xs":
28
+ return 26;
29
+ case "md":
30
+ return 38;
31
+ case "lg":
32
+ return 46;
33
+ case "xl":
34
+ return 56;
35
+ case "sm":
36
+ default:
37
+ return 32;
38
+ }
26
39
  };
27
40
  export const getSegmentFontSize = (size) => {
28
- return `${getControlSizeTokens(size).segmentedFontSize}px`;
41
+ switch (size) {
42
+ case "xxs":
43
+ return "11px";
44
+ case "xs":
45
+ return "12px";
46
+ case "md":
47
+ return "16px";
48
+ case "lg":
49
+ return "18px";
50
+ case "xl":
51
+ return "20px";
52
+ case "sm":
53
+ default:
54
+ return "14px";
55
+ }
29
56
  };
30
57
  export const normalizeSegmentedData = (data) => data.map((item) => {
31
58
  var _a;
@@ -10,7 +10,7 @@ import { StyledInputContainer, StyledInnerItemContainer, EmptyComponent, GroupTi
10
10
  // Re-export for backward compatibility
11
11
  export { StyledInputContainer };
12
12
  export const SelectBox = ({ className, data = [], placeholder = "Select...", arrow = true, onChange, onSearch, searchFn, onScroll, loading, defaultValue, value, size = "sm", variant = "outlined", width = "100%", allowCustomValue = false, searchable = false, clearable = false, label, description, required = false, error, openOnFocus = true, renderOption, actionComponent, focused, grouped, OptionTooltip, // Custom tooltip component for search menu items
13
- DropDownProps = {}, debounceTime = 175, sort = false, disabled = false, dynamicOptionHeight,
13
+ DropDownProps = {}, debounceTime = 175, sort = false, disabled = false,
14
14
  // Enhanced focus control props
15
15
  triggerFocus = false, triggerOpen = false, onFocused, onOpened, }) => {
16
16
  var _a, _b, _c, _d, _e, _f;
@@ -276,16 +276,16 @@ triggerFocus = false, triggerOpen = false, onFocused, onOpened, }) => {
276
276
  // ============================================================================
277
277
  // Render Helper Functions
278
278
  // ============================================================================
279
- const renderOptionItem = (item, index) => (_jsx(Tooltip, { content: OptionTooltip ? _jsx(OptionTooltip, { data: item.data }) : null, side: "left", children: _jsx(StyledItem, { className: "mfFloatingItem", onClick: (e) => handleItemClick(e, item), "data-selected": (_value === null || _value === void 0 ? void 0 : _value.value) === item.value, "data-disabled": item.disabled, "$dynamicHeight": dynamicOptionHeight !== null && dynamicOptionHeight !== void 0 ? dynamicOptionHeight : Boolean(renderOption), size: size, children: (renderOption === null || renderOption === void 0 ? void 0 : renderOption(item)) || _jsx(_Fragment, { children: item === null || item === void 0 ? void 0 : item.label }) }, index) }, index));
279
+ const renderOptionItem = (item, index) => (_jsx(Tooltip, { content: OptionTooltip ? _jsx(OptionTooltip, { data: item.data }) : null, side: "left", children: _jsx(StyledItem, { className: "mfFloatingItem", onClick: (e) => handleItemClick(e, item), "data-selected": (_value === null || _value === void 0 ? void 0 : _value.value) === item.value, "data-disabled": item.disabled, size: size, children: (renderOption === null || renderOption === void 0 ? void 0 : renderOption(item)) || _jsx(_Fragment, { children: item === null || item === void 0 ? void 0 : item.label }) }, index) }, index));
280
280
  const renderActionButton = () => {
281
281
  if (clearable && (_value || !!inputValue)) {
282
- return (_jsx(ClearButton, { size: size, className: "input-btn", onClick: handleClear, onMouseDown: (e) => {
282
+ return (_jsx(ClearButton, { className: "input-btn", onClick: handleClear, onMouseDown: (e) => {
283
283
  e.preventDefault();
284
284
  e.stopPropagation();
285
285
  } }));
286
286
  }
287
287
  if (arrow) {
288
- return (_jsx(ArrowButton, { size: size, onClick: (e) => {
288
+ return (_jsx(ArrowButton, { onClick: (e) => {
289
289
  e.preventDefault();
290
290
  }, onMouseDown: (e) => {
291
291
  e.preventDefault();
@@ -393,7 +393,7 @@ triggerFocus = false, triggerOpen = false, onFocused, onOpened, }) => {
393
393
  : "",
394
394
  }, variant: variant, "data-empty": filteredItems.length === 0 }, DropDownProps, { children: [loading && _jsx(Loader, {}), !loading && actionComponent && (_jsx(ActionMenu, { onClick: () => {
395
395
  setIsOpen(false);
396
- }, children: actionComponent })), !loading && filteredItems.length === 0 && (_jsx(EmptyComponent, { size: size, children: getEmptyMessage(allowCustomValue, searchValue) })), !loading && (_jsx(StyledInnerItemContainer, { ref: scrollContainerRef, "data-scroll-active": scrollActive, onScroll: onScroll, children: grouped
396
+ }, children: actionComponent })), !loading && filteredItems.length === 0 && (_jsx(EmptyComponent, { children: getEmptyMessage(allowCustomValue, searchValue) })), !loading && (_jsx(StyledInnerItemContainer, { ref: scrollContainerRef, "data-scroll-active": scrollActive, onScroll: onScroll, children: grouped
397
397
  ? groups.map((group, index) => (_jsxs("div", { children: [_jsx(GroupTitle, { size: size, children: group.label }), group.items.map((item, index) => renderOptionItem(item, index))] }, group.label)))
398
398
  : filteredItems.map((item, index) => renderOptionItem(item, index)) }))] })) }) }))] }));
399
399
  };
@@ -4,9 +4,7 @@ export declare const StyledInputContainer: import("styled-components/dist/types"
4
4
  width?: string | number | null;
5
5
  }>> & string;
6
6
  export declare const StyledInnerItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
7
- export declare const EmptyComponent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
8
- size?: Size;
9
- }>> & string;
7
+ export declare const EmptyComponent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
8
  interface GroupTitleProps {
11
9
  className?: string;
12
10
  children?: ReactNode;
@@ -16,7 +14,6 @@ export declare const GroupTitle: import("styled-components/dist/types").IStyledC
16
14
  export declare const ActionMenu: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
17
15
  export declare const StyledItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
18
16
  size: Size;
19
- $dynamicHeight?: boolean;
20
17
  }>> & string;
21
18
  export declare const StyledContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
22
19
  export {};
@@ -11,7 +11,6 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import styled from "styled-components";
14
- import { getControlSizeTokens } from "../core";
15
14
  export const StyledInputContainer = styled.div `
16
15
  font-family: ${({ theme }) => theme.typography.fontFamily};
17
16
 
@@ -59,7 +58,7 @@ export const EmptyComponent = styled.div `
59
58
  align-items: center;
60
59
  justify-content: center;
61
60
  padding: 5px;
62
- font-size: ${({ size = "sm" }) => `${getControlSizeTokens(size).supportingFontSize}px`};
61
+ font-size: 12px;
63
62
  font-weight: 500;
64
63
  color: ${(props) => props.theme.palette.text.secondary};
65
64
  `;
@@ -75,8 +74,17 @@ export const GroupTitle = styled((_a) => {
75
74
 
76
75
  color: ${(props) => props.theme.palette.text.secondary};
77
76
 
78
- min-height: ${({ size = "sm" }) => `${getControlSizeTokens(size).menuRowHeight}px`};
79
- padding: ${({ size = "sm" }) => `0px ${getControlSizeTokens(size).menuItemPaddingX}px`};
77
+ padding: ${({ size }) => size === "xs"
78
+ ? "2px 8px"
79
+ : size === "sm"
80
+ ? "4px 10px"
81
+ : size === "md"
82
+ ? "4px 12px"
83
+ : size === "lg"
84
+ ? "5px 14px"
85
+ : size === "xl"
86
+ ? "6px 16px"
87
+ : "2px 8px"};
80
88
 
81
89
  .group-label {
82
90
  white-space: nowrap;
@@ -87,7 +95,17 @@ export const GroupTitle = styled((_a) => {
87
95
 
88
96
  font-weight: 500;
89
97
 
90
- font-size: ${({ size = "sm" }) => `${getControlSizeTokens(size).menuGroupFontSize}px`};
98
+ font-size: ${({ size }) => size === "xs"
99
+ ? "11px"
100
+ : size === "sm"
101
+ ? "13px"
102
+ : size === "md"
103
+ ? "15px"
104
+ : size === "lg"
105
+ ? "17px"
106
+ : size === "xl"
107
+ ? "19px"
108
+ : "11px"};
91
109
  }
92
110
 
93
111
  .group-line {
@@ -99,11 +117,10 @@ export const ActionMenu = styled.div ``;
99
117
  export const StyledItem = styled.div `
100
118
  color: ${(props) => props.theme.palette.text.primary};
101
119
  border-radius: 3px;
102
- box-sizing: border-box;
103
120
  display: flex;
104
121
  align-items: center;
105
- min-height: ${({ size }) => `${getControlSizeTokens(size).menuRowHeight}px`};
106
- height: ${({ size, $dynamicHeight }) => $dynamicHeight ? "auto" : `${getControlSizeTokens(size).menuRowHeight}px`};
122
+ min-height: 25px;
123
+ padding: 7px 10px;
107
124
  position: relative;
108
125
  user-select: none;
109
126
  outline: none;
@@ -112,9 +129,29 @@ export const StyledItem = styled.div `
112
129
 
113
130
  font-family: ${({ theme }) => theme.typography.fontFamily};
114
131
 
115
- font-size: ${({ size }) => `${getControlSizeTokens(size).fontSize}px`};
116
-
117
- padding: ${({ size, $dynamicHeight }) => `${$dynamicHeight ? 6 : 0}px ${getControlSizeTokens(size).menuItemPaddingX}px`};
132
+ font-size: ${({ size }) => size === "xs"
133
+ ? "11px"
134
+ : size === "sm"
135
+ ? "13px"
136
+ : size === "md"
137
+ ? "15px"
138
+ : size === "lg"
139
+ ? "17px"
140
+ : size === "xl"
141
+ ? "19px"
142
+ : "11px"};
143
+
144
+ padding: ${({ size }) => size === "xs"
145
+ ? "2px 8px"
146
+ : size === "sm"
147
+ ? "4px 10px"
148
+ : size === "md"
149
+ ? "4px 12px"
150
+ : size === "lg"
151
+ ? "5px 14px"
152
+ : size === "xl"
153
+ ? "6px 16px"
154
+ : "2px 8px"};
118
155
 
119
156
  &:hover {
120
157
  background-color: ${(props) => props.theme.palette.action.hover};
@@ -34,7 +34,6 @@ export type SelectBoxProps = {
34
34
  debounceTime?: number;
35
35
  sort?: boolean;
36
36
  disabled?: boolean;
37
- dynamicOptionHeight?: boolean;
38
37
  renderOption?: (item: Option | string) => React.ReactNode;
39
38
  OptionTooltip?: (props: {
40
39
  data: any;
@@ -2,8 +2,8 @@ import { CSSProperties, ReactNode } from "react";
2
2
  import { Size } from "../core";
3
3
  export type SwitchProps = {
4
4
  className?: string;
5
- onChange: (checked: boolean) => void;
6
- size?: Size;
5
+ onChange: (e: any) => void;
6
+ size?: Exclude<Size, "xxs">;
7
7
  label?: string;
8
8
  labelPosition?: "left" | "right";
9
9
  description?: ReactNode;