ct-rich-text-editor 1.3.22 → 1.3.23
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/README.md +233 -233
- package/dist/App.d.ts +3 -2
- package/dist/Provider/EditorProvider.d.ts +27 -26
- package/dist/Provider/LexicalProvider.d.ts +6 -5
- package/dist/api/ai/index.d.ts +31 -31
- package/dist/api/auth.d.ts +108 -108
- package/dist/api/config/axios.d.ts +2 -1
- package/dist/api/config/endpoints.d.ts +18 -18
- package/dist/api/featureSuggestion.d.ts +23 -23
- package/dist/api/transcript/index.d.ts +1 -1
- package/dist/assets/style.css +5211 -5220
- package/dist/{babel-d3085146.js → babel-d155920e.js} +3278 -3551
- package/dist/babel-d155920e.js.map +1 -0
- package/dist/components/AiPlugin/index.d.ts +6 -6
- package/dist/components/AlignMenu/AlignMenu.d.ts +9 -8
- package/dist/components/AlignMenu/AlignMenuDrop.d.ts +3 -2
- package/dist/components/AlignMenu/index.d.ts +1 -1
- package/dist/components/AutoExpandingDemo.d.ts +6 -5
- package/dist/components/BlockFormatMenu/BlockFormatMenu.d.ts +3 -2
- package/dist/components/BlockFormatMenu/constants.d.ts +14 -14
- package/dist/components/BlockFormatMenu/index.d.ts +1 -1
- package/dist/components/ChartEditDialog.d.ts +9 -8
- package/dist/components/ChartInsertDialog.d.ts +8 -7
- package/dist/components/CodeActionMenuPlugin/components/CopyButton/index.d.ts +7 -6
- package/dist/components/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +9 -8
- package/dist/components/CodeActionMenuPlugin/index.d.ts +5 -4
- package/dist/components/CodeActionMenuPlugin/utils.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +3 -2
- package/dist/components/ColorPicker/index.d.ts +1 -1
- package/dist/components/CommentSidebar/CommentSidebar.d.ts +8 -7
- package/dist/components/CommentSidebar/index.d.ts +1 -1
- package/dist/components/CommentToggle/CommentToggle.d.ts +8 -7
- package/dist/components/CommentToggle/index.d.ts +1 -1
- package/dist/components/CommentView/CommentView.d.ts +9 -8
- package/dist/components/CommentView/index.d.ts +1 -1
- package/dist/components/ConfigurableEditorWithAuth.d.ts +13 -12
- package/dist/components/DatePicker/DatePickerWidget.d.ts +7 -6
- package/dist/components/EmojiPickerWidget/EmojiPickerWidget.d.ts +3 -2
- package/dist/components/EmojiPickerWidget/index.d.ts +1 -1
- package/dist/components/FeatureSuggestionDialog/index.d.ts +6 -6
- package/dist/components/FileUpload/InsertFileDialog.d.ts +7 -7
- package/dist/components/FileUpload/InsertFileUploadedDialogBody.d.ts +5 -4
- package/dist/components/FileView/index.d.ts +9 -8
- package/dist/components/FontFamilySelect/FontFamilyMenu.d.ts +7 -6
- package/dist/components/FontSizePicker/FontSizeControl.d.ts +3 -2
- package/dist/components/FormatTextMenu/FormatTextMenu.d.ts +3 -2
- package/dist/components/FormatTextMenu/FormatTextMenuDrop.d.ts +3 -2
- package/dist/components/FormatTextMenu/index.d.ts +1 -1
- package/dist/components/HighlightColorPicker/HighlightColorPicker.d.ts +7 -6
- package/dist/components/HtmlViewDisplay.d.ts +3 -2
- package/dist/components/ImageComparisonDialog/index.d.ts +11 -10
- package/dist/components/ImageGenerationDialog/ImageGenerationManager.d.ts +11 -10
- package/dist/components/ImageGenerationDialog/index.d.ts +11 -10
- package/dist/components/ImageInsertTest.d.ts +3 -2
- package/dist/components/ImageView/ImageDialog/ImageUploadDialogBody.d.ts +9 -8
- package/dist/components/ImageView/ImageDialog/index.d.ts +6 -5
- package/dist/components/ImageView/ImageResizer.d.ts +16 -15
- package/dist/components/ImageView/index.d.ts +16 -15
- package/dist/components/InsertMenu/InsertMenu.d.ts +9 -8
- package/dist/components/InsertMenu/InsertMenuDrop.d.ts +9 -8
- package/dist/components/InsertMenu/index.d.ts +1 -1
- package/dist/components/LanguageSelectorDialog/index.d.ts +8 -7
- package/dist/components/NotePanelMenu/NotePanelMenu.d.ts +6 -5
- package/dist/components/NotePanelMenu/index.d.ts +1 -1
- package/dist/components/NotePanelView/NotePanelView.d.ts +9 -8
- package/dist/components/NotePanelView/index.d.ts +1 -1
- package/dist/components/Placeholder/Placeholder.d.ts +3 -2
- package/dist/components/Placeholder/index.d.ts +1 -1
- package/dist/components/Placeholder/styles.d.ts +1 -1
- package/dist/components/ScopedEditor.d.ts +8 -8
- package/dist/components/SignatureCaption/index.d.ts +6 -5
- package/dist/components/TableColorPicker/index.d.ts +8 -7
- package/dist/components/TableModal/TableModal.d.ts +10 -9
- package/dist/components/TextEnhanceDialog/index.d.ts +10 -9
- package/dist/components/ToneAdjustDialog/index.d.ts +8 -7
- package/dist/components/Toolbar/Toolbar.d.ts +3 -2
- package/dist/components/Toolbar/index.d.ts +1 -1
- package/dist/components/Toolbar/styles.d.ts +6 -6
- package/dist/components/ui/avatar.d.ts +6 -6
- package/dist/components/ui/badge.d.ts +9 -8
- package/dist/components/ui/button.d.ts +11 -10
- package/dist/components/ui/calendar.d.ts +8 -7
- package/dist/components/ui/card.d.ts +8 -8
- package/dist/components/ui/checkbox.d.ts +4 -4
- package/dist/components/ui/dialog.d.ts +19 -19
- package/dist/components/ui/dropdown-menu.d.ts +27 -27
- package/dist/components/ui/input.d.ts +3 -3
- package/dist/components/ui/label.d.ts +4 -4
- package/dist/components/ui/popover.d.ts +7 -7
- package/dist/components/ui/select.d.ts +13 -13
- package/dist/components/ui/separator.d.ts +4 -4
- package/dist/components/ui/sheet.d.ts +24 -24
- package/dist/components/ui/skeleton.d.ts +3 -3
- package/dist/components/ui/tabs.d.ts +7 -7
- package/dist/components/ui/textarea.d.ts +3 -3
- package/dist/components/ui/tooltip.d.ts +7 -7
- package/dist/constants.d.ts +22 -21
- package/dist/context/CommentContext.d.ts +43 -42
- package/dist/context/HtmlViewContext.d.ts +17 -16
- package/dist/context/ToolbarContext.d.ts +56 -55
- package/dist/editorConfig.d.ts +48 -48
- package/dist/{estree-164983f6.js → estree-b1fff53b.js} +1778 -1763
- package/dist/estree-b1fff53b.js.map +1 -0
- package/dist/hooks/useAutoExpandingHeight.d.ts +15 -15
- package/dist/hooks/useBlockFormat.d.ts +17 -16
- package/dist/hooks/useColorPicker.d.ts +6 -6
- package/dist/hooks/useCustomCommands.d.ts +3 -2
- package/dist/hooks/useDebounce.d.ts +1 -1
- package/dist/hooks/useEditorToolbar.d.ts +10 -9
- package/dist/hooks/useInsertMenu.d.ts +9 -9
- package/dist/hooks/useModal.d.ts +5 -5
- package/dist/hooks/useS3Uploader.d.ts +11 -11
- package/dist/hooks/useVoiceToText.d.ts +15 -15
- package/dist/{html-5586dbf6.js → html-f95ee5dc.js} +656 -701
- package/dist/html-f95ee5dc.js.map +1 -0
- package/dist/{html2pdf.bundle-3699b235.js → html2pdf.bundle-026397bd.js} +2 -2
- package/dist/html2pdf.bundle-026397bd.js.map +1 -0
- package/dist/{html2pdf.bundle.min-83517dc2.js → html2pdf.bundle.min-49ff1939.js} +2 -2
- package/dist/html2pdf.bundle.min-49ff1939.js.map +1 -0
- package/dist/{index-bf836d7a.js → index-b8db2529.js} +2 -2
- package/dist/index-b8db2529.js.map +1 -0
- package/dist/{index-9a8a49b6.js → index-b9ad2974.js} +430 -812
- package/dist/index-b9ad2974.js.map +1 -0
- package/dist/{index-84187412.js → index-cea164e5.js} +4 -4
- package/dist/index-cea164e5.js.map +1 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +1 -1
- package/dist/lib/utils.d.ts +2 -1
- package/dist/main.d.ts +1 -0
- package/dist/{markdown-d513479b.js → markdown-1d9e6c3f.js} +1789 -1836
- package/dist/markdown-1d9e6c3f.js.map +1 -0
- package/dist/nodes/ChartNode.d.ts +41 -40
- package/dist/nodes/CommentNode.d.ts +34 -33
- package/dist/nodes/CommentedTextNode.d.ts +29 -28
- package/dist/nodes/EmbedNode.d.ts +26 -25
- package/dist/nodes/FileNode.d.ts +32 -31
- package/dist/nodes/ImageNode.d.ts +59 -58
- package/dist/nodes/MentionNode.d.ts +75 -74
- package/dist/nodes/NotePanelNode.d.ts +31 -30
- package/dist/pages/ConfigurableEditor/ConfigurableEditor.d.ts +25 -24
- package/dist/pages/ConfigurableEditor/index.d.ts +2 -2
- package/dist/pages/NotFound.d.ts +2 -2
- package/dist/pages/RichTextEditor.d.ts +6 -6
- package/dist/pages/TextareaEditor.d.ts +6 -6
- package/dist/pages/styles.d.ts +5 -5
- package/dist/plugins/AIChatPlugin.d.ts +11 -10
- package/dist/plugins/AndroidKeyboardFixPlugin.d.ts +16 -16
- package/dist/plugins/AutocompletePlugin.d.ts +22 -22
- package/dist/plugins/CodeBlockNormalizerPlugin.d.ts +8 -8
- package/dist/plugins/CodeBlockSelectAllPlugin.d.ts +8 -8
- package/dist/plugins/CodeHighlightPlugin.d.ts +3 -2
- package/dist/plugins/CombinedAutocompletGrammarPlugin.d.ts +21 -20
- package/dist/plugins/CommentBubblePlugin.d.ts +3 -2
- package/dist/plugins/CommentPlugin.d.ts +7 -6
- package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRuleNode.d.ts +29 -28
- package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRulePlugin.d.ts +3 -3
- package/dist/plugins/CustomHorizontalRulePlugin/HorizontalRuleCustomizationDialog.d.ts +7 -6
- package/dist/plugins/CustomHorizontalRulePlugin/index.d.ts +3 -3
- package/dist/plugins/DragDropPastePlugin/index.d.ts +8 -8
- package/dist/plugins/EmbedPreviewPlugin/FloatingEmbedMenuPlugin.d.ts +4 -3
- package/dist/plugins/EmbedPreviewPlugin/index.d.ts +6 -5
- package/dist/plugins/FilePlugin.d.ts +8 -7
- package/dist/plugins/FloatingEnhanceButton/index.d.ts +4 -3
- package/dist/plugins/FloatingLinkEditorPlugin/index.d.ts +6 -5
- package/dist/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +26 -25
- package/dist/plugins/GrammarCheckPlugin.d.ts +2 -1
- package/dist/plugins/HtmlCodeViewPlugin/index.d.ts +2 -2
- package/dist/plugins/HtmlImportPlugin.d.ts +5 -5
- package/dist/plugins/HtmlSyncPlugin.d.ts +3 -3
- package/dist/plugins/ImagePlugin.d.ts +7 -6
- package/dist/plugins/LinkPlugin/index.d.ts +6 -5
- package/dist/plugins/LinkPreviewPlugin/index.d.ts +2 -2
- package/dist/plugins/LocalStoragePlugin.d.ts +7 -6
- package/dist/plugins/MentionsPlugin/index.d.ts +7 -6
- package/dist/plugins/NotePanelPlugin.d.ts +7 -6
- package/dist/plugins/RichTextPastePlugin/index.d.ts +15 -15
- package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasDialog.d.ts +6 -5
- package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasPlugin.d.ts +9 -9
- package/dist/plugins/SignatureCanvasPlugin/index.d.ts +2 -2
- package/dist/plugins/SlashCommandPlugin/index.d.ts +2 -2
- package/dist/plugins/TableActionMenuPlugin/index.d.ts +6 -5
- package/dist/plugins/TableCellResizer/index.d.ts +2 -1
- package/dist/plugins/TableHoverActionsPlugin/index.d.ts +4 -4
- package/dist/plugins/TablePlugin.d.ts +3 -2
- package/dist/plugins/Tableimageautoresizeplugin.d.ts +1 -1
- package/dist/plugins/TextEnhancePlugin.d.ts +6 -6
- package/dist/plugins/TreeViewPlugin.d.ts +3 -2
- package/dist/plugins/UsageTrackingPlugin.d.ts +15 -15
- package/dist/plugins/VoiceTranscriptPlugin.d.ts +21 -21
- package/dist/plugins/WordCountPlugin.d.ts +3 -2
- package/dist/{postcss-f084f74d.js → postcss-c2592f3f.js} +1357 -1378
- package/dist/postcss-c2592f3f.js.map +1 -0
- package/dist/standalone-bcc7f37a.js +2649 -0
- package/dist/standalone-bcc7f37a.js.map +1 -0
- package/dist/styles/PlaygroundEditorTheme.d.ts +3 -2
- package/dist/types.d.ts +148 -147
- package/dist/typescript-48c10f50.js +13601 -0
- package/dist/typescript-48c10f50.js.map +1 -0
- package/dist/ui/ColorPicker.d.ts +14 -13
- package/dist/ui/Icons.d.ts +47 -47
- package/dist/ui/TextInput.d.ts +11 -10
- package/dist/utils/dateFormats.d.ts +33 -33
- package/dist/utils/debounce.d.ts +6 -5
- package/dist/utils/editorStyleConverter.d.ts +17 -16
- package/dist/utils/export.d.ts +2 -1
- package/dist/utils/getDOMRangeRect.d.ts +13 -13
- package/dist/utils/getSelectedNode.d.ts +3 -2
- package/dist/utils/helper.d.ts +3 -3
- package/dist/utils/index.d.ts +4 -3
- package/dist/utils/invarient.d.ts +1 -1
- package/dist/utils/setFloatingElemPosition.d.ts +8 -8
- package/dist/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -1
- package/dist/utils/url.d.ts +9 -9
- package/package.json +127 -127
- package/dist/babel-d3085146.js.map +0 -1
- package/dist/estree-164983f6.js.map +0 -1
- package/dist/html-5586dbf6.js.map +0 -1
- package/dist/html2pdf.bundle-3699b235.js.map +0 -1
- package/dist/html2pdf.bundle.min-83517dc2.js.map +0 -1
- package/dist/index-84187412.js.map +0 -1
- package/dist/index-9a8a49b6.js.map +0 -1
- package/dist/index-bf836d7a.js.map +0 -1
- package/dist/markdown-d513479b.js.map +0 -1
- package/dist/postcss-f084f74d.js.map +0 -1
- package/dist/standalone-5a8c6b7e.js +0 -2518
- package/dist/standalone-5a8c6b7e.js.map +0 -1
- package/dist/typescript-b1005db4.js +0 -13705
- package/dist/typescript-b1005db4.js.map +0 -1
|
@@ -83,6 +83,7 @@ const getApiEndpoint = () => {
|
|
|
83
83
|
return DEFAULT_API_ENDPOINT;
|
|
84
84
|
};
|
|
85
85
|
const verifyApiKey = async (apiKey) => {
|
|
86
|
+
var _a;
|
|
86
87
|
try {
|
|
87
88
|
const endpoint = getApiEndpoint();
|
|
88
89
|
const response = await axios.post(
|
|
@@ -96,6 +97,12 @@ const verifyApiKey = async (apiKey) => {
|
|
|
96
97
|
);
|
|
97
98
|
return response.data;
|
|
98
99
|
} catch (error) {
|
|
100
|
+
if ((_a = error.response) == null ? void 0 : _a.data) {
|
|
101
|
+
const customError = new Error(error.response.data.message || "Failed to verify API key");
|
|
102
|
+
customError.response = error.response;
|
|
103
|
+
customError.code = error.response.data.code;
|
|
104
|
+
throw customError;
|
|
105
|
+
}
|
|
99
106
|
throw new Error("Failed to verify API key");
|
|
100
107
|
}
|
|
101
108
|
};
|
|
@@ -1471,7 +1478,7 @@ const AiTextTransform = async ({ content, apiKey }) => {
|
|
|
1471
1478
|
const AI_ACTION_COMMAND = createCommand(
|
|
1472
1479
|
"AI_ACTION_COMMAND"
|
|
1473
1480
|
);
|
|
1474
|
-
const ImageView = React__default.lazy(() => import("./index-
|
|
1481
|
+
const ImageView = React__default.lazy(() => import("./index-cea164e5.js"));
|
|
1475
1482
|
function isGoogleDocCheckboxImg(img) {
|
|
1476
1483
|
return img.parentElement != null && img.parentElement.tagName === "LI" && img.previousSibling === null && img.getAttribute("aria-roledescription") === "checkbox";
|
|
1477
1484
|
}
|
|
@@ -1743,18 +1750,18 @@ const ImagePlugin = ({
|
|
|
1743
1750
|
}, [captionsEnabled, editor]);
|
|
1744
1751
|
return null;
|
|
1745
1752
|
};
|
|
1746
|
-
function setRef(ref, value) {
|
|
1753
|
+
function setRef$1(ref, value) {
|
|
1747
1754
|
if (typeof ref === "function") {
|
|
1748
1755
|
return ref(value);
|
|
1749
1756
|
} else if (ref !== null && ref !== void 0) {
|
|
1750
1757
|
ref.current = value;
|
|
1751
1758
|
}
|
|
1752
1759
|
}
|
|
1753
|
-
function composeRefs(...refs) {
|
|
1760
|
+
function composeRefs$1(...refs) {
|
|
1754
1761
|
return (node) => {
|
|
1755
1762
|
let hasCleanup = false;
|
|
1756
1763
|
const cleanups = refs.map((ref) => {
|
|
1757
|
-
const cleanup = setRef(ref, node);
|
|
1764
|
+
const cleanup = setRef$1(ref, node);
|
|
1758
1765
|
if (!hasCleanup && typeof cleanup == "function") {
|
|
1759
1766
|
hasCleanup = true;
|
|
1760
1767
|
}
|
|
@@ -1767,34 +1774,31 @@ function composeRefs(...refs) {
|
|
|
1767
1774
|
if (typeof cleanup == "function") {
|
|
1768
1775
|
cleanup();
|
|
1769
1776
|
} else {
|
|
1770
|
-
setRef(refs[i2], null);
|
|
1777
|
+
setRef$1(refs[i2], null);
|
|
1771
1778
|
}
|
|
1772
1779
|
}
|
|
1773
1780
|
};
|
|
1774
1781
|
}
|
|
1775
1782
|
};
|
|
1776
1783
|
}
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
var REACT_LAZY_TYPE$3 = Symbol.for("react.lazy");
|
|
1781
|
-
var use$3 = React$1[" use ".trim().toString()];
|
|
1782
|
-
function isPromiseLike$3(value) {
|
|
1784
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
1785
|
+
var use = React$1[" use ".trim().toString()];
|
|
1786
|
+
function isPromiseLike(value) {
|
|
1783
1787
|
return typeof value === "object" && value !== null && "then" in value;
|
|
1784
1788
|
}
|
|
1785
|
-
function isLazyComponent
|
|
1786
|
-
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE
|
|
1789
|
+
function isLazyComponent(element) {
|
|
1790
|
+
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
1787
1791
|
}
|
|
1788
1792
|
// @__NO_SIDE_EFFECTS__
|
|
1789
|
-
function createSlot$
|
|
1790
|
-
const SlotClone = /* @__PURE__ */ createSlotClone$
|
|
1793
|
+
function createSlot$1(ownerName) {
|
|
1794
|
+
const SlotClone = /* @__PURE__ */ createSlotClone$1(ownerName);
|
|
1791
1795
|
const Slot2 = React$1.forwardRef((props, forwardedRef) => {
|
|
1792
1796
|
let { children, ...slotProps } = props;
|
|
1793
|
-
if (isLazyComponent
|
|
1794
|
-
children = use
|
|
1797
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
1798
|
+
children = use(children._payload);
|
|
1795
1799
|
}
|
|
1796
1800
|
const childrenArray = React$1.Children.toArray(children);
|
|
1797
|
-
const slottable = childrenArray.find(isSlottable$
|
|
1801
|
+
const slottable = childrenArray.find(isSlottable$1);
|
|
1798
1802
|
if (slottable) {
|
|
1799
1803
|
const newElement = slottable.props.children;
|
|
1800
1804
|
const newChildren = childrenArray.map((child) => {
|
|
@@ -1813,19 +1817,19 @@ function createSlot$4(ownerName) {
|
|
|
1813
1817
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
1814
1818
|
return Slot2;
|
|
1815
1819
|
}
|
|
1816
|
-
var Slot$4 = /* @__PURE__ */ createSlot$
|
|
1820
|
+
var Slot$4 = /* @__PURE__ */ createSlot$1("Slot");
|
|
1817
1821
|
// @__NO_SIDE_EFFECTS__
|
|
1818
|
-
function createSlotClone$
|
|
1822
|
+
function createSlotClone$1(ownerName) {
|
|
1819
1823
|
const SlotClone = React$1.forwardRef((props, forwardedRef) => {
|
|
1820
1824
|
let { children, ...slotProps } = props;
|
|
1821
|
-
if (isLazyComponent
|
|
1822
|
-
children = use
|
|
1825
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
1826
|
+
children = use(children._payload);
|
|
1823
1827
|
}
|
|
1824
1828
|
if (React$1.isValidElement(children)) {
|
|
1825
|
-
const childrenRef = getElementRef$
|
|
1826
|
-
const props2 = mergeProps$
|
|
1829
|
+
const childrenRef = getElementRef$2(children);
|
|
1830
|
+
const props2 = mergeProps$1(slotProps, children.props);
|
|
1827
1831
|
if (children.type !== React$1.Fragment) {
|
|
1828
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
1832
|
+
props2.ref = forwardedRef ? composeRefs$1(forwardedRef, childrenRef) : childrenRef;
|
|
1829
1833
|
}
|
|
1830
1834
|
return React$1.cloneElement(children, props2);
|
|
1831
1835
|
}
|
|
@@ -1834,11 +1838,11 @@ function createSlotClone$4(ownerName) {
|
|
|
1834
1838
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
1835
1839
|
return SlotClone;
|
|
1836
1840
|
}
|
|
1837
|
-
var SLOTTABLE_IDENTIFIER$
|
|
1838
|
-
function isSlottable$
|
|
1839
|
-
return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$
|
|
1841
|
+
var SLOTTABLE_IDENTIFIER$1 = Symbol("radix.slottable");
|
|
1842
|
+
function isSlottable$1(child) {
|
|
1843
|
+
return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$1;
|
|
1840
1844
|
}
|
|
1841
|
-
function mergeProps$
|
|
1845
|
+
function mergeProps$1(slotProps, childProps) {
|
|
1842
1846
|
const overrideProps = { ...childProps };
|
|
1843
1847
|
for (const propName in childProps) {
|
|
1844
1848
|
const slotPropValue = slotProps[propName];
|
|
@@ -1862,7 +1866,7 @@ function mergeProps$4(slotProps, childProps) {
|
|
|
1862
1866
|
}
|
|
1863
1867
|
return { ...slotProps, ...overrideProps };
|
|
1864
1868
|
}
|
|
1865
|
-
function getElementRef$
|
|
1869
|
+
function getElementRef$2(element) {
|
|
1866
1870
|
var _a, _b;
|
|
1867
1871
|
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
1868
1872
|
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
@@ -1937,28 +1941,7 @@ const cva = (base, config) => (props) => {
|
|
|
1937
1941
|
}, []);
|
|
1938
1942
|
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
1939
1943
|
};
|
|
1940
|
-
const concatArrays = (array1, array2) => {
|
|
1941
|
-
const combinedArray = new Array(array1.length + array2.length);
|
|
1942
|
-
for (let i2 = 0; i2 < array1.length; i2++) {
|
|
1943
|
-
combinedArray[i2] = array1[i2];
|
|
1944
|
-
}
|
|
1945
|
-
for (let i2 = 0; i2 < array2.length; i2++) {
|
|
1946
|
-
combinedArray[array1.length + i2] = array2[i2];
|
|
1947
|
-
}
|
|
1948
|
-
return combinedArray;
|
|
1949
|
-
};
|
|
1950
|
-
const createClassValidatorObject = (classGroupId, validator) => ({
|
|
1951
|
-
classGroupId,
|
|
1952
|
-
validator
|
|
1953
|
-
});
|
|
1954
|
-
const createClassPartObject = (nextPart = /* @__PURE__ */ new Map(), validators = null, classGroupId) => ({
|
|
1955
|
-
nextPart,
|
|
1956
|
-
validators,
|
|
1957
|
-
classGroupId
|
|
1958
|
-
});
|
|
1959
1944
|
const CLASS_PART_SEPARATOR = "-";
|
|
1960
|
-
const EMPTY_CONFLICTS = [];
|
|
1961
|
-
const ARBITRARY_PROPERTY_PREFIX = "arbitrary..";
|
|
1962
1945
|
const createClassGroupUtils = (config) => {
|
|
1963
1946
|
const classMap = createClassMap(config);
|
|
1964
1947
|
const {
|
|
@@ -1966,135 +1949,104 @@ const createClassGroupUtils = (config) => {
|
|
|
1966
1949
|
conflictingClassGroupModifiers
|
|
1967
1950
|
} = config;
|
|
1968
1951
|
const getClassGroupId = (className) => {
|
|
1969
|
-
if (className.startsWith("[") && className.endsWith("]")) {
|
|
1970
|
-
return getGroupIdForArbitraryProperty(className);
|
|
1971
|
-
}
|
|
1972
1952
|
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
1973
|
-
|
|
1974
|
-
|
|
1953
|
+
if (classParts[0] === "" && classParts.length !== 1) {
|
|
1954
|
+
classParts.shift();
|
|
1955
|
+
}
|
|
1956
|
+
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
|
|
1975
1957
|
};
|
|
1976
1958
|
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
if (modifierConflicts) {
|
|
1981
|
-
if (baseConflicts) {
|
|
1982
|
-
return concatArrays(baseConflicts, modifierConflicts);
|
|
1983
|
-
}
|
|
1984
|
-
return modifierConflicts;
|
|
1985
|
-
}
|
|
1986
|
-
return baseConflicts || EMPTY_CONFLICTS;
|
|
1959
|
+
const conflicts = conflictingClassGroups[classGroupId] || [];
|
|
1960
|
+
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
|
|
1961
|
+
return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
|
|
1987
1962
|
}
|
|
1988
|
-
return
|
|
1963
|
+
return conflicts;
|
|
1989
1964
|
};
|
|
1990
1965
|
return {
|
|
1991
1966
|
getClassGroupId,
|
|
1992
1967
|
getConflictingClassGroupIds
|
|
1993
1968
|
};
|
|
1994
1969
|
};
|
|
1995
|
-
const getGroupRecursive = (classParts,
|
|
1996
|
-
|
|
1997
|
-
if (
|
|
1970
|
+
const getGroupRecursive = (classParts, classPartObject) => {
|
|
1971
|
+
var _a;
|
|
1972
|
+
if (classParts.length === 0) {
|
|
1998
1973
|
return classPartObject.classGroupId;
|
|
1999
1974
|
}
|
|
2000
|
-
const currentClassPart = classParts[
|
|
1975
|
+
const currentClassPart = classParts[0];
|
|
2001
1976
|
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
return result;
|
|
1977
|
+
const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : void 0;
|
|
1978
|
+
if (classGroupFromNextClassPart) {
|
|
1979
|
+
return classGroupFromNextClassPart;
|
|
2006
1980
|
}
|
|
2007
|
-
|
|
2008
|
-
if (validators === null) {
|
|
1981
|
+
if (classPartObject.validators.length === 0) {
|
|
2009
1982
|
return void 0;
|
|
2010
1983
|
}
|
|
2011
|
-
const classRest =
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
1984
|
+
const classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
1985
|
+
return (_a = classPartObject.validators.find(({
|
|
1986
|
+
validator
|
|
1987
|
+
}) => validator(classRest))) == null ? void 0 : _a.classGroupId;
|
|
1988
|
+
};
|
|
1989
|
+
const arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
1990
|
+
const getGroupIdForArbitraryProperty = (className) => {
|
|
1991
|
+
if (arbitraryPropertyRegex.test(className)) {
|
|
1992
|
+
const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
|
|
1993
|
+
const property = arbitraryPropertyClassName == null ? void 0 : arbitraryPropertyClassName.substring(0, arbitraryPropertyClassName.indexOf(":"));
|
|
1994
|
+
if (property) {
|
|
1995
|
+
return "arbitrary.." + property;
|
|
2017
1996
|
}
|
|
2018
1997
|
}
|
|
2019
|
-
return void 0;
|
|
2020
1998
|
};
|
|
2021
|
-
const getGroupIdForArbitraryProperty = (className) => className.slice(1, -1).indexOf(":") === -1 ? void 0 : (() => {
|
|
2022
|
-
const content = className.slice(1, -1);
|
|
2023
|
-
const colonIndex = content.indexOf(":");
|
|
2024
|
-
const property = content.slice(0, colonIndex);
|
|
2025
|
-
return property ? ARBITRARY_PROPERTY_PREFIX + property : void 0;
|
|
2026
|
-
})();
|
|
2027
1999
|
const createClassMap = (config) => {
|
|
2028
2000
|
const {
|
|
2029
2001
|
theme: theme2,
|
|
2030
2002
|
classGroups
|
|
2031
2003
|
} = config;
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2004
|
+
const classMap = {
|
|
2005
|
+
nextPart: /* @__PURE__ */ new Map(),
|
|
2006
|
+
validators: []
|
|
2007
|
+
};
|
|
2036
2008
|
for (const classGroupId in classGroups) {
|
|
2037
|
-
|
|
2038
|
-
processClassesRecursively(group, classMap, classGroupId, theme2);
|
|
2009
|
+
processClassesRecursively(classGroups[classGroupId], classMap, classGroupId, theme2);
|
|
2039
2010
|
}
|
|
2040
2011
|
return classMap;
|
|
2041
2012
|
};
|
|
2042
2013
|
const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme2) => {
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
}
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
}
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
};
|
|
2064
|
-
const processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme2) => {
|
|
2065
|
-
if (isThemeGetter(classDefinition)) {
|
|
2066
|
-
processClassesRecursively(classDefinition(theme2), classPartObject, classGroupId, theme2);
|
|
2067
|
-
return;
|
|
2068
|
-
}
|
|
2069
|
-
if (classPartObject.validators === null) {
|
|
2070
|
-
classPartObject.validators = [];
|
|
2071
|
-
}
|
|
2072
|
-
classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));
|
|
2073
|
-
};
|
|
2074
|
-
const processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme2) => {
|
|
2075
|
-
const entries = Object.entries(classDefinition);
|
|
2076
|
-
const len = entries.length;
|
|
2077
|
-
for (let i2 = 0; i2 < len; i2++) {
|
|
2078
|
-
const [key, value] = entries[i2];
|
|
2079
|
-
processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme2);
|
|
2080
|
-
}
|
|
2014
|
+
classGroup.forEach((classDefinition) => {
|
|
2015
|
+
if (typeof classDefinition === "string") {
|
|
2016
|
+
const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
|
|
2017
|
+
classPartObjectToEdit.classGroupId = classGroupId;
|
|
2018
|
+
return;
|
|
2019
|
+
}
|
|
2020
|
+
if (typeof classDefinition === "function") {
|
|
2021
|
+
if (isThemeGetter(classDefinition)) {
|
|
2022
|
+
processClassesRecursively(classDefinition(theme2), classPartObject, classGroupId, theme2);
|
|
2023
|
+
return;
|
|
2024
|
+
}
|
|
2025
|
+
classPartObject.validators.push({
|
|
2026
|
+
validator: classDefinition,
|
|
2027
|
+
classGroupId
|
|
2028
|
+
});
|
|
2029
|
+
return;
|
|
2030
|
+
}
|
|
2031
|
+
Object.entries(classDefinition).forEach(([key, classGroup2]) => {
|
|
2032
|
+
processClassesRecursively(classGroup2, getPart(classPartObject, key), classGroupId, theme2);
|
|
2033
|
+
});
|
|
2034
|
+
});
|
|
2081
2035
|
};
|
|
2082
2036
|
const getPart = (classPartObject, path) => {
|
|
2083
|
-
let
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
next = createClassPartObject();
|
|
2091
|
-
current.nextPart.set(part, next);
|
|
2037
|
+
let currentClassPartObject = classPartObject;
|
|
2038
|
+
path.split(CLASS_PART_SEPARATOR).forEach((pathPart) => {
|
|
2039
|
+
if (!currentClassPartObject.nextPart.has(pathPart)) {
|
|
2040
|
+
currentClassPartObject.nextPart.set(pathPart, {
|
|
2041
|
+
nextPart: /* @__PURE__ */ new Map(),
|
|
2042
|
+
validators: []
|
|
2043
|
+
});
|
|
2092
2044
|
}
|
|
2093
|
-
|
|
2094
|
-
}
|
|
2095
|
-
return
|
|
2045
|
+
currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
|
|
2046
|
+
});
|
|
2047
|
+
return currentClassPartObject;
|
|
2096
2048
|
};
|
|
2097
|
-
const isThemeGetter = (func) =>
|
|
2049
|
+
const isThemeGetter = (func) => func.isThemeGetter;
|
|
2098
2050
|
const createLruCache = (maxCacheSize) => {
|
|
2099
2051
|
if (maxCacheSize < 1) {
|
|
2100
2052
|
return {
|
|
@@ -2104,31 +2056,31 @@ const createLruCache = (maxCacheSize) => {
|
|
|
2104
2056
|
};
|
|
2105
2057
|
}
|
|
2106
2058
|
let cacheSize = 0;
|
|
2107
|
-
let cache = /* @__PURE__ */
|
|
2108
|
-
let previousCache = /* @__PURE__ */
|
|
2059
|
+
let cache = /* @__PURE__ */ new Map();
|
|
2060
|
+
let previousCache = /* @__PURE__ */ new Map();
|
|
2109
2061
|
const update = (key, value) => {
|
|
2110
|
-
cache
|
|
2062
|
+
cache.set(key, value);
|
|
2111
2063
|
cacheSize++;
|
|
2112
2064
|
if (cacheSize > maxCacheSize) {
|
|
2113
2065
|
cacheSize = 0;
|
|
2114
2066
|
previousCache = cache;
|
|
2115
|
-
cache = /* @__PURE__ */
|
|
2067
|
+
cache = /* @__PURE__ */ new Map();
|
|
2116
2068
|
}
|
|
2117
2069
|
};
|
|
2118
2070
|
return {
|
|
2119
2071
|
get(key) {
|
|
2120
|
-
let value = cache
|
|
2072
|
+
let value = cache.get(key);
|
|
2121
2073
|
if (value !== void 0) {
|
|
2122
2074
|
return value;
|
|
2123
2075
|
}
|
|
2124
|
-
if ((value = previousCache
|
|
2076
|
+
if ((value = previousCache.get(key)) !== void 0) {
|
|
2125
2077
|
update(key, value);
|
|
2126
2078
|
return value;
|
|
2127
2079
|
}
|
|
2128
2080
|
},
|
|
2129
2081
|
set(key, value) {
|
|
2130
|
-
if (key
|
|
2131
|
-
cache
|
|
2082
|
+
if (cache.has(key)) {
|
|
2083
|
+
cache.set(key, value);
|
|
2132
2084
|
} else {
|
|
2133
2085
|
update(key, value);
|
|
2134
2086
|
}
|
|
@@ -2137,14 +2089,7 @@ const createLruCache = (maxCacheSize) => {
|
|
|
2137
2089
|
};
|
|
2138
2090
|
const IMPORTANT_MODIFIER = "!";
|
|
2139
2091
|
const MODIFIER_SEPARATOR = ":";
|
|
2140
|
-
const
|
|
2141
|
-
const createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({
|
|
2142
|
-
modifiers,
|
|
2143
|
-
hasImportantModifier,
|
|
2144
|
-
baseClassName,
|
|
2145
|
-
maybePostfixModifierPosition,
|
|
2146
|
-
isExternal
|
|
2147
|
-
});
|
|
2092
|
+
const MODIFIER_SEPARATOR_LENGTH = MODIFIER_SEPARATOR.length;
|
|
2148
2093
|
const createParseClassName = (config) => {
|
|
2149
2094
|
const {
|
|
2150
2095
|
prefix,
|
|
@@ -2156,13 +2101,12 @@ const createParseClassName = (config) => {
|
|
|
2156
2101
|
let parenDepth = 0;
|
|
2157
2102
|
let modifierStart = 0;
|
|
2158
2103
|
let postfixModifierPosition;
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
const currentCharacter = className[index2];
|
|
2104
|
+
for (let index2 = 0; index2 < className.length; index2++) {
|
|
2105
|
+
let currentCharacter = className[index2];
|
|
2162
2106
|
if (bracketDepth === 0 && parenDepth === 0) {
|
|
2163
2107
|
if (currentCharacter === MODIFIER_SEPARATOR) {
|
|
2164
2108
|
modifiers.push(className.slice(modifierStart, index2));
|
|
2165
|
-
modifierStart = index2 +
|
|
2109
|
+
modifierStart = index2 + MODIFIER_SEPARATOR_LENGTH;
|
|
2166
2110
|
continue;
|
|
2167
2111
|
}
|
|
2168
2112
|
if (currentCharacter === "/") {
|
|
@@ -2170,38 +2114,37 @@ const createParseClassName = (config) => {
|
|
|
2170
2114
|
continue;
|
|
2171
2115
|
}
|
|
2172
2116
|
}
|
|
2173
|
-
if (currentCharacter === "[")
|
|
2117
|
+
if (currentCharacter === "[") {
|
|
2174
2118
|
bracketDepth++;
|
|
2175
|
-
else if (currentCharacter === "]")
|
|
2119
|
+
} else if (currentCharacter === "]") {
|
|
2176
2120
|
bracketDepth--;
|
|
2177
|
-
else if (currentCharacter === "(")
|
|
2121
|
+
} else if (currentCharacter === "(") {
|
|
2178
2122
|
parenDepth++;
|
|
2179
|
-
else if (currentCharacter === ")")
|
|
2123
|
+
} else if (currentCharacter === ")") {
|
|
2180
2124
|
parenDepth--;
|
|
2125
|
+
}
|
|
2181
2126
|
}
|
|
2182
|
-
const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
if (baseClassNameWithImportantModifier.endsWith(IMPORTANT_MODIFIER)) {
|
|
2186
|
-
baseClassName = baseClassNameWithImportantModifier.slice(0, -1);
|
|
2187
|
-
hasImportantModifier = true;
|
|
2188
|
-
} else if (
|
|
2189
|
-
/**
|
|
2190
|
-
* In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
|
|
2191
|
-
* @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
|
|
2192
|
-
*/
|
|
2193
|
-
baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)
|
|
2194
|
-
) {
|
|
2195
|
-
baseClassName = baseClassNameWithImportantModifier.slice(1);
|
|
2196
|
-
hasImportantModifier = true;
|
|
2197
|
-
}
|
|
2127
|
+
const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
|
|
2128
|
+
const baseClassName = stripImportantModifier(baseClassNameWithImportantModifier);
|
|
2129
|
+
const hasImportantModifier = baseClassName !== baseClassNameWithImportantModifier;
|
|
2198
2130
|
const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
|
|
2199
|
-
return
|
|
2131
|
+
return {
|
|
2132
|
+
modifiers,
|
|
2133
|
+
hasImportantModifier,
|
|
2134
|
+
baseClassName,
|
|
2135
|
+
maybePostfixModifierPosition
|
|
2136
|
+
};
|
|
2200
2137
|
};
|
|
2201
2138
|
if (prefix) {
|
|
2202
2139
|
const fullPrefix = prefix + MODIFIER_SEPARATOR;
|
|
2203
2140
|
const parseClassNameOriginal = parseClassName;
|
|
2204
|
-
parseClassName = (className) => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.
|
|
2141
|
+
parseClassName = (className) => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.substring(fullPrefix.length)) : {
|
|
2142
|
+
isExternal: true,
|
|
2143
|
+
modifiers: [],
|
|
2144
|
+
hasImportantModifier: false,
|
|
2145
|
+
baseClassName: className,
|
|
2146
|
+
maybePostfixModifierPosition: void 0
|
|
2147
|
+
};
|
|
2205
2148
|
}
|
|
2206
2149
|
if (experimentalParseClassName) {
|
|
2207
2150
|
const parseClassNameOriginal = parseClassName;
|
|
@@ -2212,35 +2155,36 @@ const createParseClassName = (config) => {
|
|
|
2212
2155
|
}
|
|
2213
2156
|
return parseClassName;
|
|
2214
2157
|
};
|
|
2158
|
+
const stripImportantModifier = (baseClassName) => {
|
|
2159
|
+
if (baseClassName.endsWith(IMPORTANT_MODIFIER)) {
|
|
2160
|
+
return baseClassName.substring(0, baseClassName.length - 1);
|
|
2161
|
+
}
|
|
2162
|
+
if (baseClassName.startsWith(IMPORTANT_MODIFIER)) {
|
|
2163
|
+
return baseClassName.substring(1);
|
|
2164
|
+
}
|
|
2165
|
+
return baseClassName;
|
|
2166
|
+
};
|
|
2215
2167
|
const createSortModifiers = (config) => {
|
|
2216
|
-
const
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
const
|
|
2222
|
-
let
|
|
2223
|
-
|
|
2224
|
-
const
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
if (currentSegment.length > 0) {
|
|
2229
|
-
currentSegment.sort();
|
|
2230
|
-
result.push(...currentSegment);
|
|
2231
|
-
currentSegment = [];
|
|
2232
|
-
}
|
|
2233
|
-
result.push(modifier);
|
|
2168
|
+
const orderSensitiveModifiers = Object.fromEntries(config.orderSensitiveModifiers.map((modifier) => [modifier, true]));
|
|
2169
|
+
const sortModifiers = (modifiers) => {
|
|
2170
|
+
if (modifiers.length <= 1) {
|
|
2171
|
+
return modifiers;
|
|
2172
|
+
}
|
|
2173
|
+
const sortedModifiers = [];
|
|
2174
|
+
let unsortedModifiers = [];
|
|
2175
|
+
modifiers.forEach((modifier) => {
|
|
2176
|
+
const isPositionSensitive = modifier[0] === "[" || orderSensitiveModifiers[modifier];
|
|
2177
|
+
if (isPositionSensitive) {
|
|
2178
|
+
sortedModifiers.push(...unsortedModifiers.sort(), modifier);
|
|
2179
|
+
unsortedModifiers = [];
|
|
2234
2180
|
} else {
|
|
2235
|
-
|
|
2181
|
+
unsortedModifiers.push(modifier);
|
|
2236
2182
|
}
|
|
2237
|
-
}
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
result.push(...currentSegment);
|
|
2241
|
-
}
|
|
2242
|
-
return result;
|
|
2183
|
+
});
|
|
2184
|
+
sortedModifiers.push(...unsortedModifiers.sort());
|
|
2185
|
+
return sortedModifiers;
|
|
2243
2186
|
};
|
|
2187
|
+
return sortModifiers;
|
|
2244
2188
|
};
|
|
2245
2189
|
const createConfigUtils = (config) => ({
|
|
2246
2190
|
cache: createLruCache(config.cacheSize),
|
|
@@ -2286,10 +2230,10 @@ const mergeClassList = (classList, configUtils) => {
|
|
|
2286
2230
|
}
|
|
2287
2231
|
hasPostfixModifier = false;
|
|
2288
2232
|
}
|
|
2289
|
-
const variantModifier =
|
|
2233
|
+
const variantModifier = sortModifiers(modifiers).join(":");
|
|
2290
2234
|
const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
2291
2235
|
const classId = modifierId + classGroupId;
|
|
2292
|
-
if (classGroupsInConflict.
|
|
2236
|
+
if (classGroupsInConflict.includes(classId)) {
|
|
2293
2237
|
continue;
|
|
2294
2238
|
}
|
|
2295
2239
|
classGroupsInConflict.push(classId);
|
|
@@ -2302,13 +2246,13 @@ const mergeClassList = (classList, configUtils) => {
|
|
|
2302
2246
|
}
|
|
2303
2247
|
return result;
|
|
2304
2248
|
};
|
|
2305
|
-
|
|
2249
|
+
function twJoin() {
|
|
2306
2250
|
let index2 = 0;
|
|
2307
2251
|
let argument;
|
|
2308
2252
|
let resolvedValue;
|
|
2309
2253
|
let string = "";
|
|
2310
|
-
while (index2 <
|
|
2311
|
-
if (argument =
|
|
2254
|
+
while (index2 < arguments.length) {
|
|
2255
|
+
if (argument = arguments[index2++]) {
|
|
2312
2256
|
if (resolvedValue = toValue(argument)) {
|
|
2313
2257
|
string && (string += " ");
|
|
2314
2258
|
string += resolvedValue;
|
|
@@ -2316,7 +2260,7 @@ const twJoin = (...classLists) => {
|
|
|
2316
2260
|
}
|
|
2317
2261
|
}
|
|
2318
2262
|
return string;
|
|
2319
|
-
}
|
|
2263
|
+
}
|
|
2320
2264
|
const toValue = (mix) => {
|
|
2321
2265
|
if (typeof mix === "string") {
|
|
2322
2266
|
return mix;
|
|
@@ -2333,20 +2277,20 @@ const toValue = (mix) => {
|
|
|
2333
2277
|
}
|
|
2334
2278
|
return string;
|
|
2335
2279
|
};
|
|
2336
|
-
|
|
2280
|
+
function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
2337
2281
|
let configUtils;
|
|
2338
2282
|
let cacheGet;
|
|
2339
2283
|
let cacheSet;
|
|
2340
|
-
let functionToCall;
|
|
2341
|
-
|
|
2284
|
+
let functionToCall = initTailwindMerge;
|
|
2285
|
+
function initTailwindMerge(classList) {
|
|
2342
2286
|
const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
|
|
2343
2287
|
configUtils = createConfigUtils(config);
|
|
2344
2288
|
cacheGet = configUtils.cache.get;
|
|
2345
2289
|
cacheSet = configUtils.cache.set;
|
|
2346
2290
|
functionToCall = tailwindMerge;
|
|
2347
2291
|
return tailwindMerge(classList);
|
|
2348
|
-
}
|
|
2349
|
-
|
|
2292
|
+
}
|
|
2293
|
+
function tailwindMerge(classList) {
|
|
2350
2294
|
const cachedResult = cacheGet(classList);
|
|
2351
2295
|
if (cachedResult) {
|
|
2352
2296
|
return cachedResult;
|
|
@@ -2354,13 +2298,13 @@ const createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
|
|
|
2354
2298
|
const result = mergeClassList(classList, configUtils);
|
|
2355
2299
|
cacheSet(classList, result);
|
|
2356
2300
|
return result;
|
|
2301
|
+
}
|
|
2302
|
+
return function callTailwindMerge() {
|
|
2303
|
+
return functionToCall(twJoin.apply(null, arguments));
|
|
2357
2304
|
};
|
|
2358
|
-
|
|
2359
|
-
return (...args) => functionToCall(twJoin(...args));
|
|
2360
|
-
};
|
|
2361
|
-
const fallbackThemeArr = [];
|
|
2305
|
+
}
|
|
2362
2306
|
const fromTheme = (key) => {
|
|
2363
|
-
const themeGetter = (theme2) => theme2[key] ||
|
|
2307
|
+
const themeGetter = (theme2) => theme2[key] || [];
|
|
2364
2308
|
themeGetter.isThemeGetter = true;
|
|
2365
2309
|
return themeGetter;
|
|
2366
2310
|
};
|
|
@@ -5002,6 +4946,40 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
5002
4946
|
}
|
|
5003
4947
|
};
|
|
5004
4948
|
}
|
|
4949
|
+
function setRef(ref, value) {
|
|
4950
|
+
if (typeof ref === "function") {
|
|
4951
|
+
return ref(value);
|
|
4952
|
+
} else if (ref !== null && ref !== void 0) {
|
|
4953
|
+
ref.current = value;
|
|
4954
|
+
}
|
|
4955
|
+
}
|
|
4956
|
+
function composeRefs(...refs) {
|
|
4957
|
+
return (node) => {
|
|
4958
|
+
let hasCleanup = false;
|
|
4959
|
+
const cleanups = refs.map((ref) => {
|
|
4960
|
+
const cleanup = setRef(ref, node);
|
|
4961
|
+
if (!hasCleanup && typeof cleanup == "function") {
|
|
4962
|
+
hasCleanup = true;
|
|
4963
|
+
}
|
|
4964
|
+
return cleanup;
|
|
4965
|
+
});
|
|
4966
|
+
if (hasCleanup) {
|
|
4967
|
+
return () => {
|
|
4968
|
+
for (let i2 = 0; i2 < cleanups.length; i2++) {
|
|
4969
|
+
const cleanup = cleanups[i2];
|
|
4970
|
+
if (typeof cleanup == "function") {
|
|
4971
|
+
cleanup();
|
|
4972
|
+
} else {
|
|
4973
|
+
setRef(refs[i2], null);
|
|
4974
|
+
}
|
|
4975
|
+
}
|
|
4976
|
+
};
|
|
4977
|
+
}
|
|
4978
|
+
};
|
|
4979
|
+
}
|
|
4980
|
+
function useComposedRefs(...refs) {
|
|
4981
|
+
return React$1.useCallback(composeRefs(...refs), refs);
|
|
4982
|
+
}
|
|
5005
4983
|
function createContext2(rootComponentName, defaultContext) {
|
|
5006
4984
|
const Context2 = React$1.createContext(defaultContext);
|
|
5007
4985
|
const Provider2 = (props) => {
|
|
@@ -5020,7 +4998,7 @@ function createContext2(rootComponentName, defaultContext) {
|
|
|
5020
4998
|
}
|
|
5021
4999
|
return [Provider2, useContext2];
|
|
5022
5000
|
}
|
|
5023
|
-
function createContextScope
|
|
5001
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
5024
5002
|
let defaultContexts = [];
|
|
5025
5003
|
function createContext3(rootComponentName, defaultContext) {
|
|
5026
5004
|
const BaseContext = React$1.createContext(defaultContext);
|
|
@@ -5059,9 +5037,9 @@ function createContextScope$1(scopeName, createContextScopeDeps = []) {
|
|
|
5059
5037
|
};
|
|
5060
5038
|
};
|
|
5061
5039
|
createScope.scopeName = scopeName;
|
|
5062
|
-
return [createContext3, composeContextScopes
|
|
5040
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
5063
5041
|
}
|
|
5064
|
-
function composeContextScopes
|
|
5042
|
+
function composeContextScopes(...scopes) {
|
|
5065
5043
|
const baseScope = scopes[0];
|
|
5066
5044
|
if (scopes.length === 1)
|
|
5067
5045
|
return baseScope;
|
|
@@ -5161,12 +5139,12 @@ function isFunction(value) {
|
|
|
5161
5139
|
return typeof value === "function";
|
|
5162
5140
|
}
|
|
5163
5141
|
// @__NO_SIDE_EFFECTS__
|
|
5164
|
-
function createSlot
|
|
5165
|
-
const SlotClone = /* @__PURE__ */ createSlotClone
|
|
5142
|
+
function createSlot(ownerName) {
|
|
5143
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
5166
5144
|
const Slot2 = React$1.forwardRef((props, forwardedRef) => {
|
|
5167
5145
|
const { children, ...slotProps } = props;
|
|
5168
5146
|
const childrenArray = React$1.Children.toArray(children);
|
|
5169
|
-
const slottable = childrenArray.find(isSlottable
|
|
5147
|
+
const slottable = childrenArray.find(isSlottable);
|
|
5170
5148
|
if (slottable) {
|
|
5171
5149
|
const newElement = slottable.props.children;
|
|
5172
5150
|
const newChildren = childrenArray.map((child) => {
|
|
@@ -5186,12 +5164,12 @@ function createSlot$3(ownerName) {
|
|
|
5186
5164
|
return Slot2;
|
|
5187
5165
|
}
|
|
5188
5166
|
// @__NO_SIDE_EFFECTS__
|
|
5189
|
-
function createSlotClone
|
|
5167
|
+
function createSlotClone(ownerName) {
|
|
5190
5168
|
const SlotClone = React$1.forwardRef((props, forwardedRef) => {
|
|
5191
5169
|
const { children, ...slotProps } = props;
|
|
5192
5170
|
if (React$1.isValidElement(children)) {
|
|
5193
|
-
const childrenRef = getElementRef$
|
|
5194
|
-
const props2 = mergeProps
|
|
5171
|
+
const childrenRef = getElementRef$1(children);
|
|
5172
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
5195
5173
|
if (children.type !== React$1.Fragment) {
|
|
5196
5174
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
5197
5175
|
}
|
|
@@ -5202,20 +5180,20 @@ function createSlotClone$3(ownerName) {
|
|
|
5202
5180
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
5203
5181
|
return SlotClone;
|
|
5204
5182
|
}
|
|
5205
|
-
var SLOTTABLE_IDENTIFIER
|
|
5183
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
5206
5184
|
// @__NO_SIDE_EFFECTS__
|
|
5207
5185
|
function createSlottable(ownerName) {
|
|
5208
5186
|
const Slottable2 = ({ children }) => {
|
|
5209
5187
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
5210
5188
|
};
|
|
5211
5189
|
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
5212
|
-
Slottable2.__radixId = SLOTTABLE_IDENTIFIER
|
|
5190
|
+
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
5213
5191
|
return Slottable2;
|
|
5214
5192
|
}
|
|
5215
|
-
function isSlottable
|
|
5216
|
-
return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER
|
|
5193
|
+
function isSlottable(child) {
|
|
5194
|
+
return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
5217
5195
|
}
|
|
5218
|
-
function mergeProps
|
|
5196
|
+
function mergeProps(slotProps, childProps) {
|
|
5219
5197
|
const overrideProps = { ...childProps };
|
|
5220
5198
|
for (const propName in childProps) {
|
|
5221
5199
|
const slotPropValue = slotProps[propName];
|
|
@@ -5239,7 +5217,7 @@ function mergeProps$3(slotProps, childProps) {
|
|
|
5239
5217
|
}
|
|
5240
5218
|
return { ...slotProps, ...overrideProps };
|
|
5241
5219
|
}
|
|
5242
|
-
function getElementRef$
|
|
5220
|
+
function getElementRef$1(element) {
|
|
5243
5221
|
var _a, _b;
|
|
5244
5222
|
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
5245
5223
|
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
@@ -5253,7 +5231,7 @@ function getElementRef$4(element) {
|
|
|
5253
5231
|
}
|
|
5254
5232
|
return element.props.ref || element.ref;
|
|
5255
5233
|
}
|
|
5256
|
-
var NODES
|
|
5234
|
+
var NODES = [
|
|
5257
5235
|
"a",
|
|
5258
5236
|
"button",
|
|
5259
5237
|
"div",
|
|
@@ -5272,8 +5250,8 @@ var NODES$3 = [
|
|
|
5272
5250
|
"svg",
|
|
5273
5251
|
"ul"
|
|
5274
5252
|
];
|
|
5275
|
-
var Primitive
|
|
5276
|
-
const Slot2 = /* @__PURE__ */ createSlot
|
|
5253
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
5254
|
+
const Slot2 = /* @__PURE__ */ createSlot(`Primitive.${node}`);
|
|
5277
5255
|
const Node2 = React$1.forwardRef((props, forwardedRef) => {
|
|
5278
5256
|
const { asChild, ...primitiveProps } = props;
|
|
5279
5257
|
const Comp = asChild ? Slot2 : node;
|
|
@@ -5406,7 +5384,7 @@ var DismissableLayer = React$1.forwardRef(
|
|
|
5406
5384
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
5407
5385
|
}, []);
|
|
5408
5386
|
return /* @__PURE__ */ jsx(
|
|
5409
|
-
Primitive
|
|
5387
|
+
Primitive.div,
|
|
5410
5388
|
{
|
|
5411
5389
|
...layerProps,
|
|
5412
5390
|
ref: composedRefs,
|
|
@@ -5439,7 +5417,7 @@ var DismissableLayerBranch = React$1.forwardRef((props, forwardedRef) => {
|
|
|
5439
5417
|
};
|
|
5440
5418
|
}
|
|
5441
5419
|
}, [context.branches]);
|
|
5442
|
-
return /* @__PURE__ */ jsx(Primitive
|
|
5420
|
+
return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });
|
|
5443
5421
|
});
|
|
5444
5422
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
5445
5423
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
@@ -5648,7 +5626,7 @@ var FocusScope = React$1.forwardRef((props, forwardedRef) => {
|
|
|
5648
5626
|
},
|
|
5649
5627
|
[loop, trapped, focusScope.paused]
|
|
5650
5628
|
);
|
|
5651
|
-
return /* @__PURE__ */ jsx(Primitive
|
|
5629
|
+
return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
5652
5630
|
});
|
|
5653
5631
|
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
5654
5632
|
function focusFirst$2(candidates, { select = false } = {}) {
|
|
@@ -5745,7 +5723,7 @@ var Portal$5 = React$1.forwardRef((props, forwardedRef) => {
|
|
|
5745
5723
|
const [mounted, setMounted] = React$1.useState(false);
|
|
5746
5724
|
useLayoutEffect2(() => setMounted(true), []);
|
|
5747
5725
|
const container = containerProp || mounted && ((_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body);
|
|
5748
|
-
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive
|
|
5726
|
+
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
5749
5727
|
});
|
|
5750
5728
|
Portal$5.displayName = PORTAL_NAME$6;
|
|
5751
5729
|
function useStateMachine(initialState, machine) {
|
|
@@ -5758,7 +5736,7 @@ var Presence = (props) => {
|
|
|
5758
5736
|
const { present, children } = props;
|
|
5759
5737
|
const presence = usePresence(present);
|
|
5760
5738
|
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React$1.Children.only(children);
|
|
5761
|
-
const ref = useComposedRefs(presence.ref, getElementRef
|
|
5739
|
+
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
|
5762
5740
|
const forceMount = typeof children === "function";
|
|
5763
5741
|
return forceMount || presence.isPresent ? React$1.cloneElement(child, { ref }) : null;
|
|
5764
5742
|
};
|
|
@@ -5857,7 +5835,7 @@ function usePresence(present) {
|
|
|
5857
5835
|
function getAnimationName(styles) {
|
|
5858
5836
|
return (styles == null ? void 0 : styles.animationName) || "none";
|
|
5859
5837
|
}
|
|
5860
|
-
function getElementRef
|
|
5838
|
+
function getElementRef(element) {
|
|
5861
5839
|
var _a, _b;
|
|
5862
5840
|
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
5863
5841
|
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
@@ -6680,7 +6658,7 @@ var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
|
6680
6658
|
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
6681
6659
|
};
|
|
6682
6660
|
var DIALOG_NAME = "Dialog";
|
|
6683
|
-
var [createDialogContext, createDialogScope] = createContextScope
|
|
6661
|
+
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
6684
6662
|
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
6685
6663
|
var Dialog$1 = (props) => {
|
|
6686
6664
|
const {
|
|
@@ -6724,7 +6702,7 @@ var DialogTrigger = React$1.forwardRef(
|
|
|
6724
6702
|
const context = useDialogContext(TRIGGER_NAME$5, __scopeDialog);
|
|
6725
6703
|
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
6726
6704
|
return /* @__PURE__ */ jsx(
|
|
6727
|
-
Primitive
|
|
6705
|
+
Primitive.button,
|
|
6728
6706
|
{
|
|
6729
6707
|
type: "button",
|
|
6730
6708
|
"aria-haspopup": "dialog",
|
|
@@ -6759,7 +6737,7 @@ var DialogOverlay$1 = React$1.forwardRef(
|
|
|
6759
6737
|
}
|
|
6760
6738
|
);
|
|
6761
6739
|
DialogOverlay$1.displayName = OVERLAY_NAME;
|
|
6762
|
-
var Slot$3 = /* @__PURE__ */ createSlot
|
|
6740
|
+
var Slot$3 = /* @__PURE__ */ createSlot("DialogOverlay.RemoveScroll");
|
|
6763
6741
|
var DialogOverlayImpl = React$1.forwardRef(
|
|
6764
6742
|
(props, forwardedRef) => {
|
|
6765
6743
|
const { __scopeDialog, ...overlayProps } = props;
|
|
@@ -6768,7 +6746,7 @@ var DialogOverlayImpl = React$1.forwardRef(
|
|
|
6768
6746
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
6769
6747
|
// ie. when `Overlay` and `Content` are siblings
|
|
6770
6748
|
/* @__PURE__ */ jsx(RemoveScroll, { as: Slot$3, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(
|
|
6771
|
-
Primitive
|
|
6749
|
+
Primitive.div,
|
|
6772
6750
|
{
|
|
6773
6751
|
"data-state": getState$1(context.open),
|
|
6774
6752
|
...overlayProps,
|
|
@@ -6913,7 +6891,7 @@ var DialogTitle$1 = React$1.forwardRef(
|
|
|
6913
6891
|
(props, forwardedRef) => {
|
|
6914
6892
|
const { __scopeDialog, ...titleProps } = props;
|
|
6915
6893
|
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
6916
|
-
return /* @__PURE__ */ jsx(Primitive
|
|
6894
|
+
return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
|
6917
6895
|
}
|
|
6918
6896
|
);
|
|
6919
6897
|
DialogTitle$1.displayName = TITLE_NAME;
|
|
@@ -6922,7 +6900,7 @@ var DialogDescription$1 = React$1.forwardRef(
|
|
|
6922
6900
|
(props, forwardedRef) => {
|
|
6923
6901
|
const { __scopeDialog, ...descriptionProps } = props;
|
|
6924
6902
|
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
6925
|
-
return /* @__PURE__ */ jsx(Primitive
|
|
6903
|
+
return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
|
6926
6904
|
}
|
|
6927
6905
|
);
|
|
6928
6906
|
DialogDescription$1.displayName = DESCRIPTION_NAME;
|
|
@@ -6932,7 +6910,7 @@ var DialogClose = React$1.forwardRef(
|
|
|
6932
6910
|
const { __scopeDialog, ...closeProps } = props;
|
|
6933
6911
|
const context = useDialogContext(CLOSE_NAME$1, __scopeDialog);
|
|
6934
6912
|
return /* @__PURE__ */ jsx(
|
|
6935
|
-
Primitive
|
|
6913
|
+
Primitive.button,
|
|
6936
6914
|
{
|
|
6937
6915
|
type: "button",
|
|
6938
6916
|
...closeProps,
|
|
@@ -7928,7 +7906,7 @@ const DialogContent = React$1.forwardRef(({ className, children, ...props }, ref
|
|
|
7928
7906
|
/* @__PURE__ */ jsxs(
|
|
7929
7907
|
Close,
|
|
7930
7908
|
{
|
|
7931
|
-
className: "closeDialog cteditor-absolute cteditor-right-4 cteditor-top-4 cteditor-rounded-full cteditor-bg-secondary cteditor-p-1 cteditor-opacity-70 cteditor-transition-opacity focus:cteditor-outline-none cteditor-disabled:pointer-events-none data-[state=open]:cteditor-bg-accent data-[state=open]:cteditor-text-muted-foreground hover:cteditor-opacity-100\n",
|
|
7909
|
+
className: "closeDialog cteditor-absolute cteditor-right-4 cteditor-top-4 cteditor-rounded-full cteditor-bg-secondary cteditor-p-1 cteditor-opacity-70 cteditor-transition-opacity focus:cteditor-outline-none cteditor-disabled:pointer-events-none data-[state=open]:cteditor-bg-accent data-[state=open]:cteditor-text-muted-foreground hover:cteditor-opacity-100\r\n",
|
|
7932
7910
|
children: [
|
|
7933
7911
|
/* @__PURE__ */ jsx(X$1, { className: "cteditor-h-4 cteditor-w-4" }),
|
|
7934
7912
|
/* @__PURE__ */ jsx("span", { className: "!cteditor-sr-only", children: "Close" })
|
|
@@ -8006,140 +7984,10 @@ const Input$1 = React$1.forwardRef(
|
|
|
8006
7984
|
}
|
|
8007
7985
|
);
|
|
8008
7986
|
Input$1.displayName = "Input";
|
|
8009
|
-
var REACT_LAZY_TYPE$2 = Symbol.for("react.lazy");
|
|
8010
|
-
var use$2 = React$1[" use ".trim().toString()];
|
|
8011
|
-
function isPromiseLike$2(value) {
|
|
8012
|
-
return typeof value === "object" && value !== null && "then" in value;
|
|
8013
|
-
}
|
|
8014
|
-
function isLazyComponent$2(element) {
|
|
8015
|
-
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE$2 && "_payload" in element && isPromiseLike$2(element._payload);
|
|
8016
|
-
}
|
|
8017
|
-
// @__NO_SIDE_EFFECTS__
|
|
8018
|
-
function createSlot$2(ownerName) {
|
|
8019
|
-
const SlotClone = /* @__PURE__ */ createSlotClone$2(ownerName);
|
|
8020
|
-
const Slot2 = React$1.forwardRef((props, forwardedRef) => {
|
|
8021
|
-
let { children, ...slotProps } = props;
|
|
8022
|
-
if (isLazyComponent$2(children) && typeof use$2 === "function") {
|
|
8023
|
-
children = use$2(children._payload);
|
|
8024
|
-
}
|
|
8025
|
-
const childrenArray = React$1.Children.toArray(children);
|
|
8026
|
-
const slottable = childrenArray.find(isSlottable$2);
|
|
8027
|
-
if (slottable) {
|
|
8028
|
-
const newElement = slottable.props.children;
|
|
8029
|
-
const newChildren = childrenArray.map((child) => {
|
|
8030
|
-
if (child === slottable) {
|
|
8031
|
-
if (React$1.Children.count(newElement) > 1)
|
|
8032
|
-
return React$1.Children.only(null);
|
|
8033
|
-
return React$1.isValidElement(newElement) ? newElement.props.children : null;
|
|
8034
|
-
} else {
|
|
8035
|
-
return child;
|
|
8036
|
-
}
|
|
8037
|
-
});
|
|
8038
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React$1.isValidElement(newElement) ? React$1.cloneElement(newElement, void 0, newChildren) : null });
|
|
8039
|
-
}
|
|
8040
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
8041
|
-
});
|
|
8042
|
-
Slot2.displayName = `${ownerName}.Slot`;
|
|
8043
|
-
return Slot2;
|
|
8044
|
-
}
|
|
8045
|
-
// @__NO_SIDE_EFFECTS__
|
|
8046
|
-
function createSlotClone$2(ownerName) {
|
|
8047
|
-
const SlotClone = React$1.forwardRef((props, forwardedRef) => {
|
|
8048
|
-
let { children, ...slotProps } = props;
|
|
8049
|
-
if (isLazyComponent$2(children) && typeof use$2 === "function") {
|
|
8050
|
-
children = use$2(children._payload);
|
|
8051
|
-
}
|
|
8052
|
-
if (React$1.isValidElement(children)) {
|
|
8053
|
-
const childrenRef = getElementRef$2(children);
|
|
8054
|
-
const props2 = mergeProps$2(slotProps, children.props);
|
|
8055
|
-
if (children.type !== React$1.Fragment) {
|
|
8056
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
8057
|
-
}
|
|
8058
|
-
return React$1.cloneElement(children, props2);
|
|
8059
|
-
}
|
|
8060
|
-
return React$1.Children.count(children) > 1 ? React$1.Children.only(null) : null;
|
|
8061
|
-
});
|
|
8062
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
8063
|
-
return SlotClone;
|
|
8064
|
-
}
|
|
8065
|
-
var SLOTTABLE_IDENTIFIER$2 = Symbol("radix.slottable");
|
|
8066
|
-
function isSlottable$2(child) {
|
|
8067
|
-
return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$2;
|
|
8068
|
-
}
|
|
8069
|
-
function mergeProps$2(slotProps, childProps) {
|
|
8070
|
-
const overrideProps = { ...childProps };
|
|
8071
|
-
for (const propName in childProps) {
|
|
8072
|
-
const slotPropValue = slotProps[propName];
|
|
8073
|
-
const childPropValue = childProps[propName];
|
|
8074
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
8075
|
-
if (isHandler) {
|
|
8076
|
-
if (slotPropValue && childPropValue) {
|
|
8077
|
-
overrideProps[propName] = (...args) => {
|
|
8078
|
-
const result = childPropValue(...args);
|
|
8079
|
-
slotPropValue(...args);
|
|
8080
|
-
return result;
|
|
8081
|
-
};
|
|
8082
|
-
} else if (slotPropValue) {
|
|
8083
|
-
overrideProps[propName] = slotPropValue;
|
|
8084
|
-
}
|
|
8085
|
-
} else if (propName === "style") {
|
|
8086
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
8087
|
-
} else if (propName === "className") {
|
|
8088
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
8089
|
-
}
|
|
8090
|
-
}
|
|
8091
|
-
return { ...slotProps, ...overrideProps };
|
|
8092
|
-
}
|
|
8093
|
-
function getElementRef$2(element) {
|
|
8094
|
-
var _a, _b;
|
|
8095
|
-
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
8096
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
8097
|
-
if (mayWarn) {
|
|
8098
|
-
return element.ref;
|
|
8099
|
-
}
|
|
8100
|
-
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
8101
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
8102
|
-
if (mayWarn) {
|
|
8103
|
-
return element.props.ref;
|
|
8104
|
-
}
|
|
8105
|
-
return element.props.ref || element.ref;
|
|
8106
|
-
}
|
|
8107
|
-
var NODES$2 = [
|
|
8108
|
-
"a",
|
|
8109
|
-
"button",
|
|
8110
|
-
"div",
|
|
8111
|
-
"form",
|
|
8112
|
-
"h2",
|
|
8113
|
-
"h3",
|
|
8114
|
-
"img",
|
|
8115
|
-
"input",
|
|
8116
|
-
"label",
|
|
8117
|
-
"li",
|
|
8118
|
-
"nav",
|
|
8119
|
-
"ol",
|
|
8120
|
-
"p",
|
|
8121
|
-
"select",
|
|
8122
|
-
"span",
|
|
8123
|
-
"svg",
|
|
8124
|
-
"ul"
|
|
8125
|
-
];
|
|
8126
|
-
var Primitive$2 = NODES$2.reduce((primitive, node) => {
|
|
8127
|
-
const Slot2 = /* @__PURE__ */ createSlot$2(`Primitive.${node}`);
|
|
8128
|
-
const Node2 = React$1.forwardRef((props, forwardedRef) => {
|
|
8129
|
-
const { asChild, ...primitiveProps } = props;
|
|
8130
|
-
const Comp = asChild ? Slot2 : node;
|
|
8131
|
-
if (typeof window !== "undefined") {
|
|
8132
|
-
window[Symbol.for("radix-ui")] = true;
|
|
8133
|
-
}
|
|
8134
|
-
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
8135
|
-
});
|
|
8136
|
-
Node2.displayName = `Primitive.${node}`;
|
|
8137
|
-
return { ...primitive, [node]: Node2 };
|
|
8138
|
-
}, {});
|
|
8139
7987
|
var NAME$4 = "Label";
|
|
8140
7988
|
var Label$3 = React$1.forwardRef((props, forwardedRef) => {
|
|
8141
7989
|
return /* @__PURE__ */ jsx(
|
|
8142
|
-
Primitive
|
|
7990
|
+
Primitive.label,
|
|
8143
7991
|
{
|
|
8144
7992
|
...props,
|
|
8145
7993
|
ref: forwardedRef,
|
|
@@ -9213,16 +9061,16 @@ function CopyButton({ editor, getCodeDOMNode }) {
|
|
|
9213
9061
|
}
|
|
9214
9062
|
const index$7 = "";
|
|
9215
9063
|
const PRETTIER_PARSER_MODULES = {
|
|
9216
|
-
css: [() => import("./postcss-
|
|
9217
|
-
html: [() => import("./html-
|
|
9064
|
+
css: [() => import("./postcss-c2592f3f.js")],
|
|
9065
|
+
html: [() => import("./html-f95ee5dc.js")],
|
|
9218
9066
|
js: [
|
|
9219
|
-
() => import("./babel-
|
|
9220
|
-
() => import("./estree-
|
|
9067
|
+
() => import("./babel-d155920e.js"),
|
|
9068
|
+
() => import("./estree-b1fff53b.js")
|
|
9221
9069
|
],
|
|
9222
|
-
markdown: [() => import("./markdown-
|
|
9070
|
+
markdown: [() => import("./markdown-1d9e6c3f.js")],
|
|
9223
9071
|
typescript: [
|
|
9224
|
-
() => import("./typescript-
|
|
9225
|
-
() => import("./estree-
|
|
9072
|
+
() => import("./typescript-48c10f50.js"),
|
|
9073
|
+
() => import("./estree-b1fff53b.js")
|
|
9226
9074
|
]
|
|
9227
9075
|
};
|
|
9228
9076
|
async function loadPrettierParserByLang(lang) {
|
|
@@ -9233,7 +9081,7 @@ async function loadPrettierParserByLang(lang) {
|
|
|
9233
9081
|
return modules;
|
|
9234
9082
|
}
|
|
9235
9083
|
async function loadPrettierFormat() {
|
|
9236
|
-
const { format } = await import("./standalone-
|
|
9084
|
+
const { format } = await import("./standalone-bcc7f37a.js");
|
|
9237
9085
|
return format;
|
|
9238
9086
|
}
|
|
9239
9087
|
const PRETTIER_OPTIONS_BY_LANG = {
|
|
@@ -9710,199 +9558,6 @@ function $createCommentedTextNode(text, commentId, commentText, commentAuthor, c
|
|
|
9710
9558
|
function $isCommentedTextNode(node) {
|
|
9711
9559
|
return node instanceof CommentedTextNode;
|
|
9712
9560
|
}
|
|
9713
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
9714
|
-
let defaultContexts = [];
|
|
9715
|
-
function createContext3(rootComponentName, defaultContext) {
|
|
9716
|
-
const BaseContext = React$1.createContext(defaultContext);
|
|
9717
|
-
BaseContext.displayName = rootComponentName + "Context";
|
|
9718
|
-
const index2 = defaultContexts.length;
|
|
9719
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
9720
|
-
const Provider2 = (props) => {
|
|
9721
|
-
var _a;
|
|
9722
|
-
const { scope, children, ...context } = props;
|
|
9723
|
-
const Context2 = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
|
|
9724
|
-
const value = React$1.useMemo(() => context, Object.values(context));
|
|
9725
|
-
return /* @__PURE__ */ jsx(Context2.Provider, { value, children });
|
|
9726
|
-
};
|
|
9727
|
-
Provider2.displayName = rootComponentName + "Provider";
|
|
9728
|
-
function useContext2(consumerName, scope) {
|
|
9729
|
-
var _a;
|
|
9730
|
-
const Context2 = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
|
|
9731
|
-
const context = React$1.useContext(Context2);
|
|
9732
|
-
if (context)
|
|
9733
|
-
return context;
|
|
9734
|
-
if (defaultContext !== void 0)
|
|
9735
|
-
return defaultContext;
|
|
9736
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
9737
|
-
}
|
|
9738
|
-
return [Provider2, useContext2];
|
|
9739
|
-
}
|
|
9740
|
-
const createScope = () => {
|
|
9741
|
-
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
9742
|
-
return React$1.createContext(defaultContext);
|
|
9743
|
-
});
|
|
9744
|
-
return function useScope(scope) {
|
|
9745
|
-
const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
|
|
9746
|
-
return React$1.useMemo(
|
|
9747
|
-
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
9748
|
-
[scope, contexts]
|
|
9749
|
-
);
|
|
9750
|
-
};
|
|
9751
|
-
};
|
|
9752
|
-
createScope.scopeName = scopeName;
|
|
9753
|
-
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
9754
|
-
}
|
|
9755
|
-
function composeContextScopes(...scopes) {
|
|
9756
|
-
const baseScope = scopes[0];
|
|
9757
|
-
if (scopes.length === 1)
|
|
9758
|
-
return baseScope;
|
|
9759
|
-
const createScope = () => {
|
|
9760
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
9761
|
-
useScope: createScope2(),
|
|
9762
|
-
scopeName: createScope2.scopeName
|
|
9763
|
-
}));
|
|
9764
|
-
return function useComposedScopes(overrideScopes) {
|
|
9765
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
9766
|
-
const scopeProps = useScope(overrideScopes);
|
|
9767
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
9768
|
-
return { ...nextScopes2, ...currentScope };
|
|
9769
|
-
}, {});
|
|
9770
|
-
return React$1.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
9771
|
-
};
|
|
9772
|
-
};
|
|
9773
|
-
createScope.scopeName = baseScope.scopeName;
|
|
9774
|
-
return createScope;
|
|
9775
|
-
}
|
|
9776
|
-
var REACT_LAZY_TYPE$1 = Symbol.for("react.lazy");
|
|
9777
|
-
var use$1 = React$1[" use ".trim().toString()];
|
|
9778
|
-
function isPromiseLike$1(value) {
|
|
9779
|
-
return typeof value === "object" && value !== null && "then" in value;
|
|
9780
|
-
}
|
|
9781
|
-
function isLazyComponent$1(element) {
|
|
9782
|
-
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE$1 && "_payload" in element && isPromiseLike$1(element._payload);
|
|
9783
|
-
}
|
|
9784
|
-
// @__NO_SIDE_EFFECTS__
|
|
9785
|
-
function createSlot$1(ownerName) {
|
|
9786
|
-
const SlotClone = /* @__PURE__ */ createSlotClone$1(ownerName);
|
|
9787
|
-
const Slot2 = React$1.forwardRef((props, forwardedRef) => {
|
|
9788
|
-
let { children, ...slotProps } = props;
|
|
9789
|
-
if (isLazyComponent$1(children) && typeof use$1 === "function") {
|
|
9790
|
-
children = use$1(children._payload);
|
|
9791
|
-
}
|
|
9792
|
-
const childrenArray = React$1.Children.toArray(children);
|
|
9793
|
-
const slottable = childrenArray.find(isSlottable$1);
|
|
9794
|
-
if (slottable) {
|
|
9795
|
-
const newElement = slottable.props.children;
|
|
9796
|
-
const newChildren = childrenArray.map((child) => {
|
|
9797
|
-
if (child === slottable) {
|
|
9798
|
-
if (React$1.Children.count(newElement) > 1)
|
|
9799
|
-
return React$1.Children.only(null);
|
|
9800
|
-
return React$1.isValidElement(newElement) ? newElement.props.children : null;
|
|
9801
|
-
} else {
|
|
9802
|
-
return child;
|
|
9803
|
-
}
|
|
9804
|
-
});
|
|
9805
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React$1.isValidElement(newElement) ? React$1.cloneElement(newElement, void 0, newChildren) : null });
|
|
9806
|
-
}
|
|
9807
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
9808
|
-
});
|
|
9809
|
-
Slot2.displayName = `${ownerName}.Slot`;
|
|
9810
|
-
return Slot2;
|
|
9811
|
-
}
|
|
9812
|
-
// @__NO_SIDE_EFFECTS__
|
|
9813
|
-
function createSlotClone$1(ownerName) {
|
|
9814
|
-
const SlotClone = React$1.forwardRef((props, forwardedRef) => {
|
|
9815
|
-
let { children, ...slotProps } = props;
|
|
9816
|
-
if (isLazyComponent$1(children) && typeof use$1 === "function") {
|
|
9817
|
-
children = use$1(children._payload);
|
|
9818
|
-
}
|
|
9819
|
-
if (React$1.isValidElement(children)) {
|
|
9820
|
-
const childrenRef = getElementRef$1(children);
|
|
9821
|
-
const props2 = mergeProps$1(slotProps, children.props);
|
|
9822
|
-
if (children.type !== React$1.Fragment) {
|
|
9823
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
9824
|
-
}
|
|
9825
|
-
return React$1.cloneElement(children, props2);
|
|
9826
|
-
}
|
|
9827
|
-
return React$1.Children.count(children) > 1 ? React$1.Children.only(null) : null;
|
|
9828
|
-
});
|
|
9829
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
9830
|
-
return SlotClone;
|
|
9831
|
-
}
|
|
9832
|
-
var SLOTTABLE_IDENTIFIER$1 = Symbol("radix.slottable");
|
|
9833
|
-
function isSlottable$1(child) {
|
|
9834
|
-
return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$1;
|
|
9835
|
-
}
|
|
9836
|
-
function mergeProps$1(slotProps, childProps) {
|
|
9837
|
-
const overrideProps = { ...childProps };
|
|
9838
|
-
for (const propName in childProps) {
|
|
9839
|
-
const slotPropValue = slotProps[propName];
|
|
9840
|
-
const childPropValue = childProps[propName];
|
|
9841
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
9842
|
-
if (isHandler) {
|
|
9843
|
-
if (slotPropValue && childPropValue) {
|
|
9844
|
-
overrideProps[propName] = (...args) => {
|
|
9845
|
-
const result = childPropValue(...args);
|
|
9846
|
-
slotPropValue(...args);
|
|
9847
|
-
return result;
|
|
9848
|
-
};
|
|
9849
|
-
} else if (slotPropValue) {
|
|
9850
|
-
overrideProps[propName] = slotPropValue;
|
|
9851
|
-
}
|
|
9852
|
-
} else if (propName === "style") {
|
|
9853
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
9854
|
-
} else if (propName === "className") {
|
|
9855
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
9856
|
-
}
|
|
9857
|
-
}
|
|
9858
|
-
return { ...slotProps, ...overrideProps };
|
|
9859
|
-
}
|
|
9860
|
-
function getElementRef$1(element) {
|
|
9861
|
-
var _a, _b;
|
|
9862
|
-
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
9863
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
9864
|
-
if (mayWarn) {
|
|
9865
|
-
return element.ref;
|
|
9866
|
-
}
|
|
9867
|
-
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
9868
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
9869
|
-
if (mayWarn) {
|
|
9870
|
-
return element.props.ref;
|
|
9871
|
-
}
|
|
9872
|
-
return element.props.ref || element.ref;
|
|
9873
|
-
}
|
|
9874
|
-
var NODES$1 = [
|
|
9875
|
-
"a",
|
|
9876
|
-
"button",
|
|
9877
|
-
"div",
|
|
9878
|
-
"form",
|
|
9879
|
-
"h2",
|
|
9880
|
-
"h3",
|
|
9881
|
-
"img",
|
|
9882
|
-
"input",
|
|
9883
|
-
"label",
|
|
9884
|
-
"li",
|
|
9885
|
-
"nav",
|
|
9886
|
-
"ol",
|
|
9887
|
-
"p",
|
|
9888
|
-
"select",
|
|
9889
|
-
"span",
|
|
9890
|
-
"svg",
|
|
9891
|
-
"ul"
|
|
9892
|
-
];
|
|
9893
|
-
var Primitive$1 = NODES$1.reduce((primitive, node) => {
|
|
9894
|
-
const Slot2 = /* @__PURE__ */ createSlot$1(`Primitive.${node}`);
|
|
9895
|
-
const Node2 = React$1.forwardRef((props, forwardedRef) => {
|
|
9896
|
-
const { asChild, ...primitiveProps } = props;
|
|
9897
|
-
const Comp = asChild ? Slot2 : node;
|
|
9898
|
-
if (typeof window !== "undefined") {
|
|
9899
|
-
window[Symbol.for("radix-ui")] = true;
|
|
9900
|
-
}
|
|
9901
|
-
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
9902
|
-
});
|
|
9903
|
-
Node2.displayName = `Primitive.${node}`;
|
|
9904
|
-
return { ...primitive, [node]: Node2 };
|
|
9905
|
-
}, {});
|
|
9906
9561
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
9907
9562
|
function getDefaultExportFromCjs(x2) {
|
|
9908
9563
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
@@ -9988,7 +9643,7 @@ var Avatar$1 = React$1.forwardRef(
|
|
|
9988
9643
|
scope: __scopeAvatar,
|
|
9989
9644
|
imageLoadingStatus,
|
|
9990
9645
|
onImageLoadingStatusChange: setImageLoadingStatus,
|
|
9991
|
-
children: /* @__PURE__ */ jsx(Primitive
|
|
9646
|
+
children: /* @__PURE__ */ jsx(Primitive.span, { ...avatarProps, ref: forwardedRef })
|
|
9992
9647
|
}
|
|
9993
9648
|
);
|
|
9994
9649
|
}
|
|
@@ -10010,7 +9665,7 @@ var AvatarImage$1 = React$1.forwardRef(
|
|
|
10010
9665
|
handleLoadingStatusChange(imageLoadingStatus);
|
|
10011
9666
|
}
|
|
10012
9667
|
}, [imageLoadingStatus, handleLoadingStatusChange]);
|
|
10013
|
-
return imageLoadingStatus === "loaded" ? /* @__PURE__ */ jsx(Primitive
|
|
9668
|
+
return imageLoadingStatus === "loaded" ? /* @__PURE__ */ jsx(Primitive.img, { ...imageProps, ref: forwardedRef, src }) : null;
|
|
10014
9669
|
}
|
|
10015
9670
|
);
|
|
10016
9671
|
AvatarImage$1.displayName = IMAGE_NAME;
|
|
@@ -10026,7 +9681,7 @@ var AvatarFallback$1 = React$1.forwardRef(
|
|
|
10026
9681
|
return () => window.clearTimeout(timerId);
|
|
10027
9682
|
}
|
|
10028
9683
|
}, [delayMs]);
|
|
10029
|
-
return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ jsx(Primitive
|
|
9684
|
+
return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ jsx(Primitive.span, { ...fallbackProps, ref: forwardedRef }) : null;
|
|
10030
9685
|
}
|
|
10031
9686
|
);
|
|
10032
9687
|
AvatarFallback$1.displayName = FALLBACK_NAME;
|
|
@@ -10171,136 +9826,6 @@ const CardFooter = React$1.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
10171
9826
|
}
|
|
10172
9827
|
));
|
|
10173
9828
|
CardFooter.displayName = "CardFooter";
|
|
10174
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
10175
|
-
var use = React$1[" use ".trim().toString()];
|
|
10176
|
-
function isPromiseLike(value) {
|
|
10177
|
-
return typeof value === "object" && value !== null && "then" in value;
|
|
10178
|
-
}
|
|
10179
|
-
function isLazyComponent(element) {
|
|
10180
|
-
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
10181
|
-
}
|
|
10182
|
-
// @__NO_SIDE_EFFECTS__
|
|
10183
|
-
function createSlot(ownerName) {
|
|
10184
|
-
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
10185
|
-
const Slot2 = React$1.forwardRef((props, forwardedRef) => {
|
|
10186
|
-
let { children, ...slotProps } = props;
|
|
10187
|
-
if (isLazyComponent(children) && typeof use === "function") {
|
|
10188
|
-
children = use(children._payload);
|
|
10189
|
-
}
|
|
10190
|
-
const childrenArray = React$1.Children.toArray(children);
|
|
10191
|
-
const slottable = childrenArray.find(isSlottable);
|
|
10192
|
-
if (slottable) {
|
|
10193
|
-
const newElement = slottable.props.children;
|
|
10194
|
-
const newChildren = childrenArray.map((child) => {
|
|
10195
|
-
if (child === slottable) {
|
|
10196
|
-
if (React$1.Children.count(newElement) > 1)
|
|
10197
|
-
return React$1.Children.only(null);
|
|
10198
|
-
return React$1.isValidElement(newElement) ? newElement.props.children : null;
|
|
10199
|
-
} else {
|
|
10200
|
-
return child;
|
|
10201
|
-
}
|
|
10202
|
-
});
|
|
10203
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React$1.isValidElement(newElement) ? React$1.cloneElement(newElement, void 0, newChildren) : null });
|
|
10204
|
-
}
|
|
10205
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
10206
|
-
});
|
|
10207
|
-
Slot2.displayName = `${ownerName}.Slot`;
|
|
10208
|
-
return Slot2;
|
|
10209
|
-
}
|
|
10210
|
-
// @__NO_SIDE_EFFECTS__
|
|
10211
|
-
function createSlotClone(ownerName) {
|
|
10212
|
-
const SlotClone = React$1.forwardRef((props, forwardedRef) => {
|
|
10213
|
-
let { children, ...slotProps } = props;
|
|
10214
|
-
if (isLazyComponent(children) && typeof use === "function") {
|
|
10215
|
-
children = use(children._payload);
|
|
10216
|
-
}
|
|
10217
|
-
if (React$1.isValidElement(children)) {
|
|
10218
|
-
const childrenRef = getElementRef(children);
|
|
10219
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
10220
|
-
if (children.type !== React$1.Fragment) {
|
|
10221
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
10222
|
-
}
|
|
10223
|
-
return React$1.cloneElement(children, props2);
|
|
10224
|
-
}
|
|
10225
|
-
return React$1.Children.count(children) > 1 ? React$1.Children.only(null) : null;
|
|
10226
|
-
});
|
|
10227
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
10228
|
-
return SlotClone;
|
|
10229
|
-
}
|
|
10230
|
-
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
10231
|
-
function isSlottable(child) {
|
|
10232
|
-
return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
10233
|
-
}
|
|
10234
|
-
function mergeProps(slotProps, childProps) {
|
|
10235
|
-
const overrideProps = { ...childProps };
|
|
10236
|
-
for (const propName in childProps) {
|
|
10237
|
-
const slotPropValue = slotProps[propName];
|
|
10238
|
-
const childPropValue = childProps[propName];
|
|
10239
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
10240
|
-
if (isHandler) {
|
|
10241
|
-
if (slotPropValue && childPropValue) {
|
|
10242
|
-
overrideProps[propName] = (...args) => {
|
|
10243
|
-
const result = childPropValue(...args);
|
|
10244
|
-
slotPropValue(...args);
|
|
10245
|
-
return result;
|
|
10246
|
-
};
|
|
10247
|
-
} else if (slotPropValue) {
|
|
10248
|
-
overrideProps[propName] = slotPropValue;
|
|
10249
|
-
}
|
|
10250
|
-
} else if (propName === "style") {
|
|
10251
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
10252
|
-
} else if (propName === "className") {
|
|
10253
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
10254
|
-
}
|
|
10255
|
-
}
|
|
10256
|
-
return { ...slotProps, ...overrideProps };
|
|
10257
|
-
}
|
|
10258
|
-
function getElementRef(element) {
|
|
10259
|
-
var _a, _b;
|
|
10260
|
-
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
10261
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
10262
|
-
if (mayWarn) {
|
|
10263
|
-
return element.ref;
|
|
10264
|
-
}
|
|
10265
|
-
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
10266
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
10267
|
-
if (mayWarn) {
|
|
10268
|
-
return element.props.ref;
|
|
10269
|
-
}
|
|
10270
|
-
return element.props.ref || element.ref;
|
|
10271
|
-
}
|
|
10272
|
-
var NODES = [
|
|
10273
|
-
"a",
|
|
10274
|
-
"button",
|
|
10275
|
-
"div",
|
|
10276
|
-
"form",
|
|
10277
|
-
"h2",
|
|
10278
|
-
"h3",
|
|
10279
|
-
"img",
|
|
10280
|
-
"input",
|
|
10281
|
-
"label",
|
|
10282
|
-
"li",
|
|
10283
|
-
"nav",
|
|
10284
|
-
"ol",
|
|
10285
|
-
"p",
|
|
10286
|
-
"select",
|
|
10287
|
-
"span",
|
|
10288
|
-
"svg",
|
|
10289
|
-
"ul"
|
|
10290
|
-
];
|
|
10291
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
10292
|
-
const Slot2 = /* @__PURE__ */ createSlot(`Primitive.${node}`);
|
|
10293
|
-
const Node2 = React$1.forwardRef((props, forwardedRef) => {
|
|
10294
|
-
const { asChild, ...primitiveProps } = props;
|
|
10295
|
-
const Comp = asChild ? Slot2 : node;
|
|
10296
|
-
if (typeof window !== "undefined") {
|
|
10297
|
-
window[Symbol.for("radix-ui")] = true;
|
|
10298
|
-
}
|
|
10299
|
-
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
10300
|
-
});
|
|
10301
|
-
Node2.displayName = `Primitive.${node}`;
|
|
10302
|
-
return { ...primitive, [node]: Node2 };
|
|
10303
|
-
}, {});
|
|
10304
9829
|
var NAME$3 = "Separator";
|
|
10305
9830
|
var DEFAULT_ORIENTATION = "horizontal";
|
|
10306
9831
|
var ORIENTATIONS = ["horizontal", "vertical"];
|
|
@@ -10427,7 +9952,7 @@ const SheetDescription = React$1.forwardRef(({ className, ...props }, ref) => /*
|
|
|
10427
9952
|
SheetDescription.displayName = Description.displayName;
|
|
10428
9953
|
function createCollection(name) {
|
|
10429
9954
|
const PROVIDER_NAME2 = name + "CollectionProvider";
|
|
10430
|
-
const [createCollectionContext, createCollectionScope2] = createContextScope
|
|
9955
|
+
const [createCollectionContext, createCollectionScope2] = createContextScope(PROVIDER_NAME2);
|
|
10431
9956
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
10432
9957
|
PROVIDER_NAME2,
|
|
10433
9958
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
@@ -10440,7 +9965,7 @@ function createCollection(name) {
|
|
|
10440
9965
|
};
|
|
10441
9966
|
CollectionProvider.displayName = PROVIDER_NAME2;
|
|
10442
9967
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
10443
|
-
const CollectionSlotImpl = /* @__PURE__ */ createSlot
|
|
9968
|
+
const CollectionSlotImpl = /* @__PURE__ */ createSlot(COLLECTION_SLOT_NAME);
|
|
10444
9969
|
const CollectionSlot = React__default.forwardRef(
|
|
10445
9970
|
(props, forwardedRef) => {
|
|
10446
9971
|
const { scope, children } = props;
|
|
@@ -10452,7 +9977,7 @@ function createCollection(name) {
|
|
|
10452
9977
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
10453
9978
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
10454
9979
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
10455
|
-
const CollectionItemSlotImpl = /* @__PURE__ */ createSlot
|
|
9980
|
+
const CollectionItemSlotImpl = /* @__PURE__ */ createSlot(ITEM_SLOT_NAME);
|
|
10456
9981
|
const CollectionItemSlot = React__default.forwardRef(
|
|
10457
9982
|
(props, forwardedRef) => {
|
|
10458
9983
|
const { scope, children, ...itemData } = props;
|
|
@@ -10497,7 +10022,7 @@ var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
|
10497
10022
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
10498
10023
|
var GROUP_NAME$3 = "RovingFocusGroup";
|
|
10499
10024
|
var [Collection$2, useCollection$2, createCollectionScope$2] = createCollection(GROUP_NAME$3);
|
|
10500
|
-
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope
|
|
10025
|
+
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
|
|
10501
10026
|
GROUP_NAME$3,
|
|
10502
10027
|
[createCollectionScope$2]
|
|
10503
10028
|
);
|
|
@@ -10564,7 +10089,7 @@ var RovingFocusGroupImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
|
10564
10089
|
[]
|
|
10565
10090
|
),
|
|
10566
10091
|
children: /* @__PURE__ */ jsx(
|
|
10567
|
-
Primitive
|
|
10092
|
+
Primitive.div,
|
|
10568
10093
|
{
|
|
10569
10094
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
10570
10095
|
"data-orientation": orientation,
|
|
@@ -10629,7 +10154,7 @@ var RovingFocusGroupItem = React$1.forwardRef(
|
|
|
10629
10154
|
focusable,
|
|
10630
10155
|
active,
|
|
10631
10156
|
children: /* @__PURE__ */ jsx(
|
|
10632
|
-
Primitive
|
|
10157
|
+
Primitive.span,
|
|
10633
10158
|
{
|
|
10634
10159
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
10635
10160
|
"data-orientation": context.orientation,
|
|
@@ -10714,7 +10239,7 @@ function wrapArray$2(array, startIndex) {
|
|
|
10714
10239
|
var Root$2 = RovingFocusGroup;
|
|
10715
10240
|
var Item$1 = RovingFocusGroupItem;
|
|
10716
10241
|
var TABS_NAME = "Tabs";
|
|
10717
|
-
var [createTabsContext, createTabsScope] = createContextScope
|
|
10242
|
+
var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [
|
|
10718
10243
|
createRovingFocusGroupScope
|
|
10719
10244
|
]);
|
|
10720
10245
|
var useRovingFocusGroupScope$1 = createRovingFocusGroupScope();
|
|
@@ -10749,7 +10274,7 @@ var Tabs$1 = React$1.forwardRef(
|
|
|
10749
10274
|
dir: direction,
|
|
10750
10275
|
activationMode,
|
|
10751
10276
|
children: /* @__PURE__ */ jsx(
|
|
10752
|
-
Primitive
|
|
10277
|
+
Primitive.div,
|
|
10753
10278
|
{
|
|
10754
10279
|
dir: direction,
|
|
10755
10280
|
"data-orientation": orientation,
|
|
@@ -10777,7 +10302,7 @@ var TabsList$1 = React$1.forwardRef(
|
|
|
10777
10302
|
dir: context.dir,
|
|
10778
10303
|
loop,
|
|
10779
10304
|
children: /* @__PURE__ */ jsx(
|
|
10780
|
-
Primitive
|
|
10305
|
+
Primitive.div,
|
|
10781
10306
|
{
|
|
10782
10307
|
role: "tablist",
|
|
10783
10308
|
"aria-orientation": context.orientation,
|
|
@@ -10807,7 +10332,7 @@ var TabsTrigger$1 = React$1.forwardRef(
|
|
|
10807
10332
|
focusable: !disabled,
|
|
10808
10333
|
active: isSelected,
|
|
10809
10334
|
children: /* @__PURE__ */ jsx(
|
|
10810
|
-
Primitive
|
|
10335
|
+
Primitive.button,
|
|
10811
10336
|
{
|
|
10812
10337
|
type: "button",
|
|
10813
10338
|
role: "tab",
|
|
@@ -10857,7 +10382,7 @@ var TabsContent$1 = React$1.forwardRef(
|
|
|
10857
10382
|
return () => cancelAnimationFrame(rAF);
|
|
10858
10383
|
}, []);
|
|
10859
10384
|
return /* @__PURE__ */ jsx(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsx(
|
|
10860
|
-
Primitive
|
|
10385
|
+
Primitive.div,
|
|
10861
10386
|
{
|
|
10862
10387
|
"data-state": isSelected ? "active" : "inactive",
|
|
10863
10388
|
"data-orientation": context.orientation,
|
|
@@ -13279,7 +12804,7 @@ var NAME$2 = "Arrow";
|
|
|
13279
12804
|
var Arrow$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
13280
12805
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
13281
12806
|
return /* @__PURE__ */ jsx(
|
|
13282
|
-
Primitive
|
|
12807
|
+
Primitive.svg,
|
|
13283
12808
|
{
|
|
13284
12809
|
...arrowProps,
|
|
13285
12810
|
ref: forwardedRef,
|
|
@@ -13328,7 +12853,7 @@ function useSize(element) {
|
|
|
13328
12853
|
return size2;
|
|
13329
12854
|
}
|
|
13330
12855
|
var POPPER_NAME = "Popper";
|
|
13331
|
-
var [createPopperContext, createPopperScope] = createContextScope
|
|
12856
|
+
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
13332
12857
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
13333
12858
|
var Popper = (props) => {
|
|
13334
12859
|
const { __scopePopper, children } = props;
|
|
@@ -13351,7 +12876,7 @@ var PopperAnchor = React$1.forwardRef(
|
|
|
13351
12876
|
context.onAnchorChange(anchorRef.current);
|
|
13352
12877
|
}
|
|
13353
12878
|
});
|
|
13354
|
-
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive
|
|
12879
|
+
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
13355
12880
|
}
|
|
13356
12881
|
);
|
|
13357
12882
|
PopperAnchor.displayName = ANCHOR_NAME$2;
|
|
@@ -13480,7 +13005,7 @@ var PopperContent = React$1.forwardRef(
|
|
|
13480
13005
|
arrowY,
|
|
13481
13006
|
shouldHideArrow: cannotCenterArrow,
|
|
13482
13007
|
children: /* @__PURE__ */ jsx(
|
|
13483
|
-
Primitive
|
|
13008
|
+
Primitive.div,
|
|
13484
13009
|
{
|
|
13485
13010
|
"data-side": placedSide,
|
|
13486
13011
|
"data-align": placedAlign,
|
|
@@ -13616,7 +13141,7 @@ var NAME$1 = "VisuallyHidden";
|
|
|
13616
13141
|
var VisuallyHidden = React$1.forwardRef(
|
|
13617
13142
|
(props, forwardedRef) => {
|
|
13618
13143
|
return /* @__PURE__ */ jsx(
|
|
13619
|
-
Primitive
|
|
13144
|
+
Primitive.span,
|
|
13620
13145
|
{
|
|
13621
13146
|
...props,
|
|
13622
13147
|
ref: forwardedRef,
|
|
@@ -13627,7 +13152,7 @@ var VisuallyHidden = React$1.forwardRef(
|
|
|
13627
13152
|
);
|
|
13628
13153
|
VisuallyHidden.displayName = NAME$1;
|
|
13629
13154
|
var Root = VisuallyHidden;
|
|
13630
|
-
var [createTooltipContext, createTooltipScope] = createContextScope
|
|
13155
|
+
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
13631
13156
|
createPopperScope
|
|
13632
13157
|
]);
|
|
13633
13158
|
var usePopperScope$3 = createPopperScope();
|
|
@@ -13788,7 +13313,7 @@ var TooltipTrigger$1 = React$1.forwardRef(
|
|
|
13788
13313
|
return () => document.removeEventListener("pointerup", handlePointerUp);
|
|
13789
13314
|
}, [handlePointerUp]);
|
|
13790
13315
|
return /* @__PURE__ */ jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(
|
|
13791
|
-
Primitive
|
|
13316
|
+
Primitive.button,
|
|
13792
13317
|
{
|
|
13793
13318
|
"aria-describedby": context.open ? context.contentId : void 0,
|
|
13794
13319
|
"data-state": context.stateAttribute,
|
|
@@ -14140,7 +13665,7 @@ const CommentToggle = ({
|
|
|
14140
13665
|
return /* @__PURE__ */ jsx(
|
|
14141
13666
|
"div",
|
|
14142
13667
|
{
|
|
14143
|
-
className: "cteditor-flex cteditor-bg-background cteditor-text-foreground cteditor-px-2.5 cteditor-py-[7px] cteditor-rounded-lg cteditor-h-11 cteditor-items-center cteditor-justify-center cteditor-ml-2\n",
|
|
13668
|
+
className: "cteditor-flex cteditor-bg-background cteditor-text-foreground cteditor-px-2.5 cteditor-py-[7px] cteditor-rounded-lg cteditor-h-11 cteditor-items-center cteditor-justify-center cteditor-ml-2\r\n",
|
|
14144
13669
|
children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
14145
13670
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
14146
13671
|
Button,
|
|
@@ -14411,7 +13936,7 @@ const HtmlViewDisplay = () => {
|
|
|
14411
13936
|
onBlur: handleTextareaBlur,
|
|
14412
13937
|
onClick: handleTextareaClick,
|
|
14413
13938
|
onKeyDown: handleTextareaKeyDown,
|
|
14414
|
-
className: " cteditor-w-full cteditor-flex-1\n cteditor-font-mono cteditor-text-[13px] \n cteditor-p-3 \n cteditor-border cteditor-rounded-lg \n cteditor-resize-y cteditor-leading-[1.4] \n cteditor-outline-none cteditor-transition-colors cteditor-duration-200 \n cteditor-whitespace-pre-wrap cteditor-break-words\n",
|
|
13939
|
+
className: " cteditor-w-full cteditor-flex-1\r\n cteditor-font-mono cteditor-text-[13px] \r\n cteditor-p-3 \r\n cteditor-border cteditor-rounded-lg \r\n cteditor-resize-y cteditor-leading-[1.4] \r\n cteditor-outline-none cteditor-transition-colors cteditor-duration-200 \r\n cteditor-whitespace-pre-wrap cteditor-break-words\r\n",
|
|
14415
13940
|
placeholder: "HTML content will appear here... Edit and click 'Sync to Editor' to apply changes."
|
|
14416
13941
|
}
|
|
14417
13942
|
)
|
|
@@ -15363,7 +14888,7 @@ const EmbedComponent = ({ url, displayType, alignment, nodeKey }) => {
|
|
|
15363
14888
|
}
|
|
15364
14889
|
);
|
|
15365
14890
|
};
|
|
15366
|
-
const FileComponent = React$1.lazy(() => import("./index-
|
|
14891
|
+
const FileComponent = React$1.lazy(() => import("./index-b8db2529.js"));
|
|
15367
14892
|
function convertFileElement(domNode) {
|
|
15368
14893
|
if (domNode instanceof HTMLDivElement) {
|
|
15369
14894
|
const dataUrl = domNode.getAttribute("data-lexical-file-src");
|
|
@@ -15846,7 +15371,7 @@ var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"];
|
|
|
15846
15371
|
var SELECTION_KEYS$1 = [" ", "Enter"];
|
|
15847
15372
|
var SELECT_NAME = "Select";
|
|
15848
15373
|
var [Collection$1, useCollection$1, createCollectionScope$1] = createCollection(SELECT_NAME);
|
|
15849
|
-
var [createSelectContext, createSelectScope] = createContextScope
|
|
15374
|
+
var [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [
|
|
15850
15375
|
createCollectionScope$1,
|
|
15851
15376
|
createPopperScope
|
|
15852
15377
|
]);
|
|
@@ -15983,7 +15508,7 @@ var SelectTrigger$1 = React$1.forwardRef(
|
|
|
15983
15508
|
}
|
|
15984
15509
|
};
|
|
15985
15510
|
return /* @__PURE__ */ jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(
|
|
15986
|
-
Primitive
|
|
15511
|
+
Primitive.button,
|
|
15987
15512
|
{
|
|
15988
15513
|
type: "button",
|
|
15989
15514
|
role: "combobox",
|
|
@@ -16044,7 +15569,7 @@ var SelectValue$1 = React$1.forwardRef(
|
|
|
16044
15569
|
onValueNodeHasChildrenChange(hasChildren);
|
|
16045
15570
|
}, [onValueNodeHasChildrenChange, hasChildren]);
|
|
16046
15571
|
return /* @__PURE__ */ jsx(
|
|
16047
|
-
Primitive
|
|
15572
|
+
Primitive.span,
|
|
16048
15573
|
{
|
|
16049
15574
|
...valueProps,
|
|
16050
15575
|
ref: composedRefs,
|
|
@@ -16059,7 +15584,7 @@ var ICON_NAME = "SelectIcon";
|
|
|
16059
15584
|
var SelectIcon = React$1.forwardRef(
|
|
16060
15585
|
(props, forwardedRef) => {
|
|
16061
15586
|
const { __scopeSelect, children, ...iconProps } = props;
|
|
16062
|
-
return /* @__PURE__ */ jsx(Primitive
|
|
15587
|
+
return /* @__PURE__ */ jsx(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "▼" });
|
|
16063
15588
|
}
|
|
16064
15589
|
);
|
|
16065
15590
|
SelectIcon.displayName = ICON_NAME;
|
|
@@ -16090,7 +15615,7 @@ SelectContent$1.displayName = CONTENT_NAME$3;
|
|
|
16090
15615
|
var CONTENT_MARGIN = 10;
|
|
16091
15616
|
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME$3);
|
|
16092
15617
|
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
16093
|
-
var Slot$2 = /* @__PURE__ */ createSlot
|
|
15618
|
+
var Slot$2 = /* @__PURE__ */ createSlot("SelectContent.RemoveScroll");
|
|
16094
15619
|
var SelectContentImpl = React$1.forwardRef(
|
|
16095
15620
|
(props, forwardedRef) => {
|
|
16096
15621
|
const {
|
|
@@ -16479,7 +16004,7 @@ var SelectItemAlignedPosition = React$1.forwardRef((props, forwardedRef) => {
|
|
|
16479
16004
|
zIndex: contentZIndex
|
|
16480
16005
|
},
|
|
16481
16006
|
children: /* @__PURE__ */ jsx(
|
|
16482
|
-
Primitive
|
|
16007
|
+
Primitive.div,
|
|
16483
16008
|
{
|
|
16484
16009
|
...popperProps,
|
|
16485
16010
|
ref: composedRefs,
|
|
@@ -16553,7 +16078,7 @@ var SelectViewport = React$1.forwardRef(
|
|
|
16553
16078
|
}
|
|
16554
16079
|
),
|
|
16555
16080
|
/* @__PURE__ */ jsx(Collection$1.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(
|
|
16556
|
-
Primitive
|
|
16081
|
+
Primitive.div,
|
|
16557
16082
|
{
|
|
16558
16083
|
"data-radix-select-viewport": "",
|
|
16559
16084
|
role: "presentation",
|
|
@@ -16608,7 +16133,7 @@ var SelectGroup = React$1.forwardRef(
|
|
|
16608
16133
|
(props, forwardedRef) => {
|
|
16609
16134
|
const { __scopeSelect, ...groupProps } = props;
|
|
16610
16135
|
const groupId = useId();
|
|
16611
|
-
return /* @__PURE__ */ jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx(Primitive
|
|
16136
|
+
return /* @__PURE__ */ jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx(Primitive.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
|
|
16612
16137
|
}
|
|
16613
16138
|
);
|
|
16614
16139
|
SelectGroup.displayName = GROUP_NAME$2;
|
|
@@ -16617,7 +16142,7 @@ var SelectLabel$1 = React$1.forwardRef(
|
|
|
16617
16142
|
(props, forwardedRef) => {
|
|
16618
16143
|
const { __scopeSelect, ...labelProps } = props;
|
|
16619
16144
|
const groupContext = useSelectGroupContext(LABEL_NAME$2, __scopeSelect);
|
|
16620
|
-
return /* @__PURE__ */ jsx(Primitive
|
|
16145
|
+
return /* @__PURE__ */ jsx(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
|
|
16621
16146
|
}
|
|
16622
16147
|
);
|
|
16623
16148
|
SelectLabel$1.displayName = LABEL_NAME$2;
|
|
@@ -16676,7 +16201,7 @@ var SelectItem$1 = React$1.forwardRef(
|
|
|
16676
16201
|
disabled,
|
|
16677
16202
|
textValue,
|
|
16678
16203
|
children: /* @__PURE__ */ jsx(
|
|
16679
|
-
Primitive
|
|
16204
|
+
Primitive.div,
|
|
16680
16205
|
{
|
|
16681
16206
|
role: "option",
|
|
16682
16207
|
"aria-labelledby": textId,
|
|
@@ -16764,7 +16289,7 @@ var SelectItemText = React$1.forwardRef(
|
|
|
16764
16289
|
return () => onNativeOptionRemove(nativeOption);
|
|
16765
16290
|
}, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);
|
|
16766
16291
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16767
|
-
/* @__PURE__ */ jsx(Primitive
|
|
16292
|
+
/* @__PURE__ */ jsx(Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),
|
|
16768
16293
|
itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM.createPortal(itemTextProps.children, context.valueNode) : null
|
|
16769
16294
|
] });
|
|
16770
16295
|
}
|
|
@@ -16775,7 +16300,7 @@ var SelectItemIndicator = React$1.forwardRef(
|
|
|
16775
16300
|
(props, forwardedRef) => {
|
|
16776
16301
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
16777
16302
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME$1, __scopeSelect);
|
|
16778
|
-
return itemContext.isSelected ? /* @__PURE__ */ jsx(Primitive
|
|
16303
|
+
return itemContext.isSelected ? /* @__PURE__ */ jsx(Primitive.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
|
|
16779
16304
|
}
|
|
16780
16305
|
);
|
|
16781
16306
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME$1;
|
|
@@ -16866,7 +16391,7 @@ var SelectScrollButtonImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
|
16866
16391
|
(_a = activeItem == null ? void 0 : activeItem.ref.current) == null ? void 0 : _a.scrollIntoView({ block: "nearest" });
|
|
16867
16392
|
}, [getItems]);
|
|
16868
16393
|
return /* @__PURE__ */ jsx(
|
|
16869
|
-
Primitive
|
|
16394
|
+
Primitive.div,
|
|
16870
16395
|
{
|
|
16871
16396
|
"aria-hidden": true,
|
|
16872
16397
|
...scrollIndicatorProps,
|
|
@@ -16894,7 +16419,7 @@ var SEPARATOR_NAME$2 = "SelectSeparator";
|
|
|
16894
16419
|
var SelectSeparator$1 = React$1.forwardRef(
|
|
16895
16420
|
(props, forwardedRef) => {
|
|
16896
16421
|
const { __scopeSelect, ...separatorProps } = props;
|
|
16897
|
-
return /* @__PURE__ */ jsx(Primitive
|
|
16422
|
+
return /* @__PURE__ */ jsx(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
|
|
16898
16423
|
}
|
|
16899
16424
|
);
|
|
16900
16425
|
SelectSeparator$1.displayName = SEPARATOR_NAME$2;
|
|
@@ -16932,7 +16457,7 @@ var SelectBubbleInput = React$1.forwardRef(
|
|
|
16932
16457
|
}
|
|
16933
16458
|
}, [prevValue, value]);
|
|
16934
16459
|
return /* @__PURE__ */ jsx(
|
|
16935
|
-
Primitive
|
|
16460
|
+
Primitive.select,
|
|
16936
16461
|
{
|
|
16937
16462
|
...props,
|
|
16938
16463
|
style: { ...VISUALLY_HIDDEN_STYLES, ...props.style },
|
|
@@ -19158,6 +18683,7 @@ function AIChatDialog({
|
|
|
19158
18683
|
const [provider, setProvider] = useState$1("chatgpt");
|
|
19159
18684
|
const [costPerPrompt, setCostPerPrompt] = useState$1(1);
|
|
19160
18685
|
const [remainingCredits, setRemainingCredits] = useState$1(0);
|
|
18686
|
+
const [purchasedCredits, setPurchasedCredits] = useState$1(0);
|
|
19161
18687
|
useEffect$1(() => {
|
|
19162
18688
|
if (open && initialText) {
|
|
19163
18689
|
setInputValue(initialText);
|
|
@@ -19190,11 +18716,13 @@ function AIChatDialog({
|
|
|
19190
18716
|
if (isMounted && info) {
|
|
19191
18717
|
setCostPerPrompt(Number(info.costPerPrompt ?? 1));
|
|
19192
18718
|
setRemainingCredits(Number(info.remainingCredits ?? 0));
|
|
18719
|
+
setPurchasedCredits(Number(info.purchasedCredits ?? 0));
|
|
19193
18720
|
}
|
|
19194
18721
|
} catch (_) {
|
|
19195
18722
|
if (isMounted) {
|
|
19196
18723
|
setCostPerPrompt(1);
|
|
19197
18724
|
setRemainingCredits(0);
|
|
18725
|
+
setPurchasedCredits(0);
|
|
19198
18726
|
}
|
|
19199
18727
|
}
|
|
19200
18728
|
};
|
|
@@ -19203,24 +18731,58 @@ function AIChatDialog({
|
|
|
19203
18731
|
isMounted = false;
|
|
19204
18732
|
};
|
|
19205
18733
|
}, [apiKey]);
|
|
18734
|
+
const isImageGenerationRequest = (prompt) => {
|
|
18735
|
+
const lowerPrompt = prompt.toLowerCase();
|
|
18736
|
+
const imageKeywords = [
|
|
18737
|
+
"generate image",
|
|
18738
|
+
"generate an image",
|
|
18739
|
+
"create image",
|
|
18740
|
+
"create an image",
|
|
18741
|
+
"make image",
|
|
18742
|
+
"make an image",
|
|
18743
|
+
"draw",
|
|
18744
|
+
"illustration",
|
|
18745
|
+
"picture of",
|
|
18746
|
+
"image of",
|
|
18747
|
+
"photo of",
|
|
18748
|
+
"generate picture",
|
|
18749
|
+
"create picture",
|
|
18750
|
+
"visualize",
|
|
18751
|
+
"render image",
|
|
18752
|
+
"design image",
|
|
18753
|
+
"produce image"
|
|
18754
|
+
];
|
|
18755
|
+
return imageKeywords.some((keyword) => lowerPrompt.includes(keyword));
|
|
18756
|
+
};
|
|
19206
18757
|
const handleSubmit = async () => {
|
|
19207
18758
|
var _a, _b;
|
|
19208
18759
|
if (!inputValue.trim() || isLoading)
|
|
19209
18760
|
return;
|
|
19210
18761
|
setIsLoading(true);
|
|
19211
18762
|
setErrorMessage(null);
|
|
18763
|
+
const isImageRequest = isImageGenerationRequest(inputValue);
|
|
19212
18764
|
try {
|
|
19213
18765
|
const response = await AiEditorAction({ content: inputValue, provider, apiKey });
|
|
19214
18766
|
const htmlString = response.data;
|
|
19215
|
-
|
|
19216
|
-
|
|
19217
|
-
|
|
19218
|
-
|
|
19219
|
-
|
|
19220
|
-
|
|
19221
|
-
|
|
19222
|
-
|
|
19223
|
-
|
|
18767
|
+
const parser = new DOMParser();
|
|
18768
|
+
const dom = parser.parseFromString(htmlString.trim(), "text/html");
|
|
18769
|
+
const imgElement = dom.querySelector("img");
|
|
18770
|
+
if (isImageRequest && imgElement && imgElement.src) {
|
|
18771
|
+
editor.dispatchCommand(INSERT_IMAGE_COMMAND, {
|
|
18772
|
+
src: imgElement.src,
|
|
18773
|
+
altText: imgElement.alt || "AI generated image",
|
|
18774
|
+
originalPrompt: inputValue
|
|
18775
|
+
// Store the prompt for refinement
|
|
18776
|
+
});
|
|
18777
|
+
} else {
|
|
18778
|
+
editor.update(() => {
|
|
18779
|
+
const nodes = $generateNodesFromDOM(editor, dom);
|
|
18780
|
+
const currentSelection = $getSelection();
|
|
18781
|
+
if (currentSelection) {
|
|
18782
|
+
$insertNodes(nodes);
|
|
18783
|
+
}
|
|
18784
|
+
});
|
|
18785
|
+
}
|
|
19224
18786
|
handleClose();
|
|
19225
18787
|
setIsLoading(false);
|
|
19226
18788
|
} catch (error) {
|
|
@@ -19279,8 +18841,12 @@ function AIChatDialog({
|
|
|
19279
18841
|
] })
|
|
19280
18842
|
] }),
|
|
19281
18843
|
/* @__PURE__ */ jsxs("span", { className: "cteditor-inline-flex cteditor-items-center cteditor-gap-1 cteditor-rounded-md cteditor-bg-accent cteditor-px-2 cteditor-py-0.5", children: [
|
|
19282
|
-
/* @__PURE__ */ jsx("span", { className: "cteditor-opacity-70", children: "
|
|
19283
|
-
/* @__PURE__ */ jsx("span", { className: "cteditor-font-medium", children: remainingCredits })
|
|
18844
|
+
/* @__PURE__ */ jsx("span", { className: "cteditor-opacity-70", children: "Total" }),
|
|
18845
|
+
/* @__PURE__ */ jsx("span", { className: "cteditor-font-medium", children: remainingCredits + purchasedCredits })
|
|
18846
|
+
] }),
|
|
18847
|
+
purchasedCredits > 0 && /* @__PURE__ */ jsxs("span", { className: "cteditor-inline-flex cteditor-items-center cteditor-gap-1 cteditor-rounded-md cteditor-bg-green-500/10 cteditor-px-2 cteditor-py-0.5", children: [
|
|
18848
|
+
/* @__PURE__ */ jsx("span", { className: "cteditor-opacity-70", children: "Purchased" }),
|
|
18849
|
+
/* @__PURE__ */ jsx("span", { className: "cteditor-font-medium cteditor-text-green-600", children: purchasedCredits })
|
|
19284
18850
|
] })
|
|
19285
18851
|
] })
|
|
19286
18852
|
] }),
|
|
@@ -19460,6 +19026,7 @@ function InlineAIPrompt({
|
|
|
19460
19026
|
const [provider, setProvider] = useState$1(initialProvider);
|
|
19461
19027
|
const [inputValue, setInputValue] = useState$1("");
|
|
19462
19028
|
const [isLoading, setIsLoading] = useState$1(false);
|
|
19029
|
+
const [status, setStatus] = useState$1("idle");
|
|
19463
19030
|
const inputRef = useRef(null);
|
|
19464
19031
|
const [selectedText, setSelectedText] = useState$1(initialSelectedText);
|
|
19465
19032
|
useEffect$1(() => {
|
|
@@ -19470,6 +19037,7 @@ function InlineAIPrompt({
|
|
|
19470
19037
|
const newSelectedText = selection.getTextContent();
|
|
19471
19038
|
if (newSelectedText.trim() !== "") {
|
|
19472
19039
|
setSelectedText(newSelectedText);
|
|
19040
|
+
setStatus("idle");
|
|
19473
19041
|
}
|
|
19474
19042
|
}
|
|
19475
19043
|
});
|
|
@@ -19483,23 +19051,56 @@ function InlineAIPrompt({
|
|
|
19483
19051
|
inputRef.current.focus();
|
|
19484
19052
|
}
|
|
19485
19053
|
}, []);
|
|
19054
|
+
const isImageGenerationRequest = (prompt) => {
|
|
19055
|
+
const lowerPrompt = prompt.toLowerCase();
|
|
19056
|
+
const imageKeywords = [
|
|
19057
|
+
"generate image",
|
|
19058
|
+
"generate an image",
|
|
19059
|
+
"create image",
|
|
19060
|
+
"create an image",
|
|
19061
|
+
"make image",
|
|
19062
|
+
"make an image",
|
|
19063
|
+
"draw",
|
|
19064
|
+
"illustration",
|
|
19065
|
+
"picture of",
|
|
19066
|
+
"image of",
|
|
19067
|
+
"photo of",
|
|
19068
|
+
"generate picture",
|
|
19069
|
+
"create picture",
|
|
19070
|
+
"visualize",
|
|
19071
|
+
"render image",
|
|
19072
|
+
"design image",
|
|
19073
|
+
"produce image"
|
|
19074
|
+
];
|
|
19075
|
+
return imageKeywords.some((keyword) => lowerPrompt.includes(keyword));
|
|
19076
|
+
};
|
|
19486
19077
|
const handleSubmit = async () => {
|
|
19487
19078
|
var _a, _b;
|
|
19488
19079
|
if (!inputValue.trim() || isLoading)
|
|
19489
19080
|
return;
|
|
19490
|
-
|
|
19081
|
+
const isImageRequest = isImageGenerationRequest(inputValue) || selectedText && isImageGenerationRequest(selectedText);
|
|
19082
|
+
if (!isImageRequest && (!selectedText || selectedText.trim() === "")) {
|
|
19491
19083
|
toast.error("Please select some text first");
|
|
19492
19084
|
return;
|
|
19493
19085
|
}
|
|
19494
19086
|
setIsLoading(true);
|
|
19495
|
-
|
|
19087
|
+
let finalPrompt;
|
|
19088
|
+
if (isImageRequest) {
|
|
19089
|
+
if (selectedText && selectedText.trim()) {
|
|
19090
|
+
finalPrompt = `${inputValue}: ${selectedText}`;
|
|
19091
|
+
} else {
|
|
19092
|
+
finalPrompt = inputValue;
|
|
19093
|
+
}
|
|
19094
|
+
} else {
|
|
19095
|
+
finalPrompt = `${inputValue}
|
|
19496
19096
|
|
|
19497
19097
|
IMPORTANT: Return ONLY the modified/transformed text. Do NOT include any labels, prefixes, explanations, or formatting like "Simplified:", "Result:", "Here is", etc. Just return the pure result text.
|
|
19498
19098
|
|
|
19499
19099
|
Text to transform:
|
|
19500
19100
|
"${selectedText}"`;
|
|
19101
|
+
}
|
|
19501
19102
|
try {
|
|
19502
|
-
const response = await AiEditorAction({ content:
|
|
19103
|
+
const response = await AiEditorAction({ content: finalPrompt, provider, apiKey });
|
|
19503
19104
|
let htmlString = response.data;
|
|
19504
19105
|
if (typeof htmlString === "string") {
|
|
19505
19106
|
htmlString = htmlString.trim();
|
|
@@ -19507,22 +19108,34 @@ Text to transform:
|
|
|
19507
19108
|
htmlString = htmlString.slice(1, -1);
|
|
19508
19109
|
}
|
|
19509
19110
|
}
|
|
19510
|
-
|
|
19511
|
-
|
|
19512
|
-
|
|
19513
|
-
|
|
19514
|
-
|
|
19515
|
-
|
|
19516
|
-
|
|
19517
|
-
|
|
19518
|
-
|
|
19111
|
+
const parser = new DOMParser();
|
|
19112
|
+
const dom = parser.parseFromString(htmlString.trim(), "text/html");
|
|
19113
|
+
const imgElement = dom.querySelector("img");
|
|
19114
|
+
if (isImageRequest && imgElement && imgElement.src) {
|
|
19115
|
+
editor.dispatchCommand(INSERT_IMAGE_COMMAND, {
|
|
19116
|
+
src: imgElement.src,
|
|
19117
|
+
altText: imgElement.alt || "AI generated image",
|
|
19118
|
+
originalPrompt: finalPrompt
|
|
19119
|
+
// Store the prompt for refinement
|
|
19120
|
+
});
|
|
19121
|
+
} else {
|
|
19122
|
+
editor.update(() => {
|
|
19123
|
+
const nodes = $generateNodesFromDOM(editor, dom);
|
|
19124
|
+
const currentSelection = $getSelection();
|
|
19125
|
+
if (currentSelection) {
|
|
19126
|
+
$insertNodes(nodes);
|
|
19127
|
+
}
|
|
19128
|
+
});
|
|
19129
|
+
}
|
|
19519
19130
|
setInputValue("");
|
|
19520
19131
|
setSelectedText("");
|
|
19132
|
+
setStatus("success");
|
|
19521
19133
|
} catch (error) {
|
|
19522
19134
|
console.error("Error processing AI action:", error);
|
|
19523
19135
|
const apiMessage = ((_b = (_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) ?? (error instanceof Error ? error.message : null);
|
|
19524
19136
|
const safeMessage = apiMessage && !/^Request failed with status code \d+/.test(apiMessage) ? apiMessage : "Error processing your request. Please try again.";
|
|
19525
19137
|
toast.error(safeMessage);
|
|
19138
|
+
setStatus("error");
|
|
19526
19139
|
} finally {
|
|
19527
19140
|
setIsLoading(false);
|
|
19528
19141
|
}
|
|
@@ -19537,6 +19150,7 @@ Text to transform:
|
|
|
19537
19150
|
}
|
|
19538
19151
|
};
|
|
19539
19152
|
const hasSelectedText = selectedText && selectedText.trim() !== "";
|
|
19153
|
+
const isCurrentInputImageRequest = isImageGenerationRequest(inputValue);
|
|
19540
19154
|
const displayText = hasSelectedText ? selectedText.length > 50 ? selectedText.substring(0, 50) + "..." : selectedText : "";
|
|
19541
19155
|
return /* @__PURE__ */ jsxs(
|
|
19542
19156
|
"div",
|
|
@@ -19566,20 +19180,20 @@ Text to transform:
|
|
|
19566
19180
|
alignItems: "center",
|
|
19567
19181
|
gap: "8px",
|
|
19568
19182
|
padding: "6px 10px",
|
|
19569
|
-
backgroundColor: hasSelectedText ? "#2a2a2a" : "#3a2a2a",
|
|
19183
|
+
backgroundColor: status === "success" ? "#1a2e1a" : status === "error" ? "#2e1a1a" : hasSelectedText ? "#2a2a2a" : isCurrentInputImageRequest ? "#2a3a2a" : "#3a2a2a",
|
|
19570
19184
|
borderRadius: "6px",
|
|
19571
19185
|
fontSize: "12px",
|
|
19572
19186
|
color: "#999",
|
|
19573
|
-
border: hasSelectedText ? "none" : "1px solid #5a3a3a"
|
|
19187
|
+
border: status === "success" ? "1px solid #3a5a3a" : status === "error" ? "1px solid #5a3a3a" : hasSelectedText ? "none" : isCurrentInputImageRequest ? "1px solid #3a5a3a" : "1px solid #5a3a3a"
|
|
19574
19188
|
},
|
|
19575
|
-
children: hasSelectedText ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
19189
|
+
children: status === "success" ? /* @__PURE__ */ jsx("span", { style: { color: "#4ade80" }, children: "✓ Content inserted! Select new text or enter another prompt" }) : status === "error" ? /* @__PURE__ */ jsx("span", { style: { color: "#f87171" }, children: "✗ Request failed. Try again or select different text" }) : hasSelectedText ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
19576
19190
|
/* @__PURE__ */ jsx("span", { style: { color: "#666" }, children: "Selected:" }),
|
|
19577
19191
|
/* @__PURE__ */ jsxs("span", { style: { color: "#ccc", fontStyle: "italic" }, children: [
|
|
19578
19192
|
'"',
|
|
19579
19193
|
displayText,
|
|
19580
19194
|
'"'
|
|
19581
19195
|
] })
|
|
19582
|
-
] }) : /* @__PURE__ */ jsx("span", { style: { color: "#f87171" }, children: "⚠ Please select some text
|
|
19196
|
+
] }) : isCurrentInputImageRequest ? /* @__PURE__ */ jsx("span", { style: { color: "#4ade80" }, children: "🖼️ Image generation mode - no text selection required" }) : /* @__PURE__ */ jsx("span", { style: { color: "#f87171" }, children: "⚠ Please select some text or enter an image generation prompt" })
|
|
19583
19197
|
}
|
|
19584
19198
|
),
|
|
19585
19199
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
@@ -19615,9 +19229,13 @@ Text to transform:
|
|
|
19615
19229
|
ref: inputRef,
|
|
19616
19230
|
type: "text",
|
|
19617
19231
|
value: inputValue,
|
|
19618
|
-
onChange: (e) =>
|
|
19232
|
+
onChange: (e) => {
|
|
19233
|
+
setInputValue(e.target.value);
|
|
19234
|
+
if (status !== "idle")
|
|
19235
|
+
setStatus("idle");
|
|
19236
|
+
},
|
|
19619
19237
|
onKeyDown: handleKeyDown,
|
|
19620
|
-
placeholder: hasSelectedText ? "What do you want to do with this text?" : "
|
|
19238
|
+
placeholder: hasSelectedText ? "What do you want to do with this text?" : "Generate image of... or select text",
|
|
19621
19239
|
disabled: isLoading,
|
|
19622
19240
|
style: {
|
|
19623
19241
|
width: "280px",
|
|
@@ -20386,10 +20004,10 @@ const PDF_CONFIG = {
|
|
|
20386
20004
|
};
|
|
20387
20005
|
const loadHtml2Pdf = async () => {
|
|
20388
20006
|
try {
|
|
20389
|
-
const mod = await import("./html2pdf.bundle.min-
|
|
20007
|
+
const mod = await import("./html2pdf.bundle.min-49ff1939.js").then((n) => n.h);
|
|
20390
20008
|
return (mod == null ? void 0 : mod.default) || mod;
|
|
20391
20009
|
} catch {
|
|
20392
|
-
const mod2 = await import("./html2pdf.bundle-
|
|
20010
|
+
const mod2 = await import("./html2pdf.bundle-026397bd.js").then((n) => n.h);
|
|
20393
20011
|
return (mod2 == null ? void 0 : mod2.default) || mod2;
|
|
20394
20012
|
}
|
|
20395
20013
|
};
|
|
@@ -21141,7 +20759,7 @@ var SUB_CLOSE_KEYS = {
|
|
|
21141
20759
|
};
|
|
21142
20760
|
var MENU_NAME = "Menu";
|
|
21143
20761
|
var [Collection, useCollection, createCollectionScope] = createCollection(MENU_NAME);
|
|
21144
|
-
var [createMenuContext, createMenuScope] = createContextScope
|
|
20762
|
+
var [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [
|
|
21145
20763
|
createCollectionScope,
|
|
21146
20764
|
createPopperScope,
|
|
21147
20765
|
createRovingFocusGroupScope
|
|
@@ -21266,7 +20884,7 @@ var MenuRootContentNonModal = React$1.forwardRef((props, forwardedRef) => {
|
|
|
21266
20884
|
}
|
|
21267
20885
|
);
|
|
21268
20886
|
});
|
|
21269
|
-
var Slot$1 = /* @__PURE__ */ createSlot
|
|
20887
|
+
var Slot$1 = /* @__PURE__ */ createSlot("MenuContent.ScrollLock");
|
|
21270
20888
|
var MenuContentImpl = React$1.forwardRef(
|
|
21271
20889
|
(props, forwardedRef) => {
|
|
21272
20890
|
const {
|
|
@@ -21468,7 +21086,7 @@ var GROUP_NAME$1 = "MenuGroup";
|
|
|
21468
21086
|
var MenuGroup = React$1.forwardRef(
|
|
21469
21087
|
(props, forwardedRef) => {
|
|
21470
21088
|
const { __scopeMenu, ...groupProps } = props;
|
|
21471
|
-
return /* @__PURE__ */ jsx(Primitive
|
|
21089
|
+
return /* @__PURE__ */ jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
21472
21090
|
}
|
|
21473
21091
|
);
|
|
21474
21092
|
MenuGroup.displayName = GROUP_NAME$1;
|
|
@@ -21476,7 +21094,7 @@ var LABEL_NAME$1 = "MenuLabel";
|
|
|
21476
21094
|
var MenuLabel = React$1.forwardRef(
|
|
21477
21095
|
(props, forwardedRef) => {
|
|
21478
21096
|
const { __scopeMenu, ...labelProps } = props;
|
|
21479
|
-
return /* @__PURE__ */ jsx(Primitive
|
|
21097
|
+
return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
21480
21098
|
}
|
|
21481
21099
|
);
|
|
21482
21100
|
MenuLabel.displayName = LABEL_NAME$1;
|
|
@@ -21556,7 +21174,7 @@ var MenuItemImpl = React$1.forwardRef(
|
|
|
21556
21174
|
disabled,
|
|
21557
21175
|
textValue: textValue ?? textContent,
|
|
21558
21176
|
children: /* @__PURE__ */ jsx(Item$1, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx(
|
|
21559
|
-
Primitive
|
|
21177
|
+
Primitive.div,
|
|
21560
21178
|
{
|
|
21561
21179
|
role: "menuitem",
|
|
21562
21180
|
"data-highlighted": isFocused ? "" : void 0,
|
|
@@ -21667,7 +21285,7 @@ var MenuItemIndicator = React$1.forwardRef(
|
|
|
21667
21285
|
{
|
|
21668
21286
|
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
21669
21287
|
children: /* @__PURE__ */ jsx(
|
|
21670
|
-
Primitive
|
|
21288
|
+
Primitive.span,
|
|
21671
21289
|
{
|
|
21672
21290
|
...itemIndicatorProps,
|
|
21673
21291
|
ref: forwardedRef,
|
|
@@ -21684,7 +21302,7 @@ var MenuSeparator = React$1.forwardRef(
|
|
|
21684
21302
|
(props, forwardedRef) => {
|
|
21685
21303
|
const { __scopeMenu, ...separatorProps } = props;
|
|
21686
21304
|
return /* @__PURE__ */ jsx(
|
|
21687
|
-
Primitive
|
|
21305
|
+
Primitive.div,
|
|
21688
21306
|
{
|
|
21689
21307
|
role: "separator",
|
|
21690
21308
|
"aria-orientation": "horizontal",
|
|
@@ -21944,7 +21562,7 @@ var Arrow2 = MenuArrow;
|
|
|
21944
21562
|
var SubTrigger = MenuSubTrigger;
|
|
21945
21563
|
var SubContent = MenuSubContent;
|
|
21946
21564
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
21947
|
-
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope
|
|
21565
|
+
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(
|
|
21948
21566
|
DROPDOWN_MENU_NAME,
|
|
21949
21567
|
[createMenuScope]
|
|
21950
21568
|
);
|
|
@@ -21991,7 +21609,7 @@ var DropdownMenuTrigger$1 = React$1.forwardRef(
|
|
|
21991
21609
|
const context = useDropdownMenuContext(TRIGGER_NAME$1, __scopeDropdownMenu);
|
|
21992
21610
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
21993
21611
|
return /* @__PURE__ */ jsx(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx(
|
|
21994
|
-
Primitive
|
|
21612
|
+
Primitive.button,
|
|
21995
21613
|
{
|
|
21996
21614
|
type: "button",
|
|
21997
21615
|
id: context.triggerId,
|
|
@@ -22328,13 +21946,13 @@ const AlignMenu = () => {
|
|
|
22328
21946
|
{
|
|
22329
21947
|
variant: "ghost",
|
|
22330
21948
|
size: "sm",
|
|
22331
|
-
className: "cteditor-flex cteditor-items-center cteditor-gap-2 cteditor-h-7 cteditor-rounded-sm cteditor-px-2\n",
|
|
21949
|
+
className: "cteditor-flex cteditor-items-center cteditor-gap-2 cteditor-h-7 cteditor-rounded-sm cteditor-px-2\r\n",
|
|
22332
21950
|
children: [
|
|
22333
21951
|
/* @__PURE__ */ jsx(AlignLeft, { className: "!cteditor-size-4" }),
|
|
22334
21952
|
/* @__PURE__ */ jsx(
|
|
22335
21953
|
ChevronDown,
|
|
22336
21954
|
{
|
|
22337
|
-
className: "!cteditor-size-4 cteditor-opacity-50\n"
|
|
21955
|
+
className: "!cteditor-size-4 cteditor-opacity-50\r\n"
|
|
22338
21956
|
}
|
|
22339
21957
|
)
|
|
22340
21958
|
]
|
|
@@ -22829,7 +22447,7 @@ var V = "undefined" != typeof window ? useLayoutEffect$1 : useEffect$1, $ = func
|
|
|
22829
22447
|
return React__default.createElement(U, u({}, r2, { colorModel: W }));
|
|
22830
22448
|
};
|
|
22831
22449
|
var POPOVER_NAME = "Popover";
|
|
22832
|
-
var [createPopoverContext, createPopoverScope] = createContextScope
|
|
22450
|
+
var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
|
|
22833
22451
|
createPopperScope
|
|
22834
22452
|
]);
|
|
22835
22453
|
var usePopperScope = createPopperScope();
|
|
@@ -22893,7 +22511,7 @@ var PopoverTrigger$1 = React$1.forwardRef(
|
|
|
22893
22511
|
const popperScope = usePopperScope(__scopePopover);
|
|
22894
22512
|
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
22895
22513
|
const trigger = /* @__PURE__ */ jsx(
|
|
22896
|
-
Primitive
|
|
22514
|
+
Primitive.button,
|
|
22897
22515
|
{
|
|
22898
22516
|
type: "button",
|
|
22899
22517
|
"aria-haspopup": "dialog",
|
|
@@ -22929,7 +22547,7 @@ var PopoverContent$1 = React$1.forwardRef(
|
|
|
22929
22547
|
}
|
|
22930
22548
|
);
|
|
22931
22549
|
PopoverContent$1.displayName = CONTENT_NAME;
|
|
22932
|
-
var Slot = /* @__PURE__ */ createSlot
|
|
22550
|
+
var Slot = /* @__PURE__ */ createSlot("PopoverContent.RemoveScroll");
|
|
22933
22551
|
var PopoverContentModal = React$1.forwardRef(
|
|
22934
22552
|
(props, forwardedRef) => {
|
|
22935
22553
|
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
@@ -23086,7 +22704,7 @@ var PopoverClose = React$1.forwardRef(
|
|
|
23086
22704
|
const { __scopePopover, ...closeProps } = props;
|
|
23087
22705
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
23088
22706
|
return /* @__PURE__ */ jsx(
|
|
23089
|
-
Primitive
|
|
22707
|
+
Primitive.button,
|
|
23090
22708
|
{
|
|
23091
22709
|
type: "button",
|
|
23092
22710
|
...closeProps,
|
|
@@ -23322,7 +22940,7 @@ const ColorPicker$2 = ({
|
|
|
23322
22940
|
"button",
|
|
23323
22941
|
{
|
|
23324
22942
|
onClick: () => setShowAdvanced(!showAdvanced),
|
|
23325
|
-
className: "cteditor-text-xs cteditor-text-primary/90 hover:cteditor-text-primary cteditor-transition-colors cteditor-flex cteditor-items-center cteditor-gap-2\n",
|
|
22943
|
+
className: "cteditor-text-xs cteditor-text-primary/90 hover:cteditor-text-primary cteditor-transition-colors cteditor-flex cteditor-items-center cteditor-gap-2\r\n",
|
|
23326
22944
|
children: [
|
|
23327
22945
|
/* @__PURE__ */ jsx("span", { className: "cteditor-text-xs", children: showAdvanced ? "▼" : "▶" }),
|
|
23328
22946
|
showAdvanced ? "Hide Advanced" : "Show Advanced"
|
|
@@ -34503,7 +34121,7 @@ function TableActionMenu({
|
|
|
34503
34121
|
/* @__PURE__ */ jsxs(
|
|
34504
34122
|
"div",
|
|
34505
34123
|
{
|
|
34506
|
-
className: "dropdown table-drop cteditor-z-[100]\n cteditor-flex\n cteditor-flex-col\n cteditor-fixed\n cteditor-min-h-[40px]\n cteditor-min-w-[200px]\n cteditor-p-[6px]\n cteditor-overflow-y-auto\n cteditor-overflow-x-hidden \n cteditor-shadow-xl\n cteditor-rounded-lg\n cteditor-border\n cteditor-border-border\n cteditor-bg-background \n cteditor-backdrop-blur-md\n cteditor-space-y-0.5\n ",
|
|
34124
|
+
className: "dropdown table-drop cteditor-z-[100]\r\n cteditor-flex\r\n cteditor-flex-col\r\n cteditor-fixed\r\n cteditor-min-h-[40px]\r\n cteditor-min-w-[200px]\r\n cteditor-p-[6px]\r\n cteditor-overflow-y-auto\r\n cteditor-overflow-x-hidden \r\n cteditor-shadow-xl\r\n cteditor-rounded-lg\r\n cteditor-border\r\n cteditor-border-border\r\n cteditor-bg-background \r\n cteditor-backdrop-blur-md\r\n cteditor-space-y-0.5\r\n ",
|
|
34507
34125
|
ref: dropDownRef,
|
|
34508
34126
|
onClick: (e) => {
|
|
34509
34127
|
e.stopPropagation();
|
|
@@ -38571,4 +38189,4 @@ export {
|
|
|
38571
38189
|
useHtmlView as u,
|
|
38572
38190
|
verifyApiKey as v
|
|
38573
38191
|
};
|
|
38574
|
-
//# sourceMappingURL=index-
|
|
38192
|
+
//# sourceMappingURL=index-b9ad2974.js.map
|