@collabchron/notiq 0.3.0 → 1.0.0
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/LICENSE +21 -0
- package/README.md +230 -39
- package/dist/CodeActionMenuPlugin-EINOY4U4.mjs +15 -0
- package/dist/DynamicBlockComponent-NRQJ4WW4.mjs +161 -0
- package/dist/EquationComponent-CB6DFIHV.mjs +154 -0
- package/dist/ExcalidrawComponent-XW6646OH.mjs +528 -0
- package/dist/ExcalidrawPlugin-ZFHT62IF.mjs +14 -0
- package/dist/ExportPlugin-V2RLM63S.mjs +11 -0
- package/dist/FloatingLinkEditorPlugin-TRTCMSP4.mjs +12 -0
- package/dist/FloatingTextFormatToolbarPlugin-F2GY6LMI.mjs +30 -0
- package/dist/HintComponet-BRL6EAMS.mjs +217 -0
- package/dist/InlineImageComponent-UWIUWBHI.mjs +453 -0
- package/dist/MobileToolbar-BOOZAMQE.mjs +268 -0
- package/dist/SlashCommand-GMT5JI33.mjs +28 -0
- package/dist/StoryBuilderComponent-JGDBM5JU.mjs +562 -0
- package/{src/components/editor/plugins/TableCellActionMenuPlugin/index.tsx → dist/TableCellActionMenuPlugin-PGK2K3VG.mjs} +667 -759
- package/{src/components/editor/plugins/TableHoverActionsPlugin/index.tsx → dist/TableHoverActionsPlugin-GJVE6VRW.mjs} +258 -314
- package/dist/TemplatePlugin-ZD3QEVTI.mjs +9 -0
- package/dist/ToolbarPlugin-7TOZRD2R.mjs +1547 -0
- package/dist/babel-JZ2EV6AX.mjs +7233 -0
- package/dist/background-color-XZTYLGO2.mjs +362 -0
- package/dist/block-format-YJCV2DIY.mjs +15 -0
- package/dist/chunk-2FNEAMSP.mjs +127 -0
- package/dist/chunk-3CPBODXA.mjs +84 -0
- package/dist/chunk-3G37YKTV.mjs +83 -0
- package/dist/chunk-3JVFG7ER.mjs +184 -0
- package/dist/chunk-456TN7IM.mjs +110 -0
- package/dist/chunk-4EXYCTGJ.mjs +27 -0
- package/{src/utils/getSelectedNode.ts → dist/chunk-4HBCVSE6.mjs} +26 -27
- package/dist/chunk-4MEDW3T6.mjs +125 -0
- package/dist/chunk-4VWFVWYP.mjs +36 -0
- package/dist/chunk-5BAKY5KN.mjs +84 -0
- package/dist/chunk-5QSNIVIG.mjs +333 -0
- package/dist/chunk-64Z3FI7T.mjs +37 -0
- package/{src/components/editor/nodes/Stepper/index.tsx → dist/chunk-6RNZQOH2.mjs} +214 -260
- package/dist/chunk-77KXU36M.mjs +64 -0
- package/dist/chunk-77UA6HYR.mjs +165 -0
- package/dist/chunk-7NZAPJ4G.mjs +102 -0
- package/dist/chunk-7VUMHWWL.mjs +152 -0
- package/dist/chunk-AMMKBSST.mjs +1256 -0
- package/dist/chunk-BIU7WTLX.mjs +95 -0
- package/dist/chunk-EGMI62PP.mjs +83 -0
- package/dist/chunk-EHNQD5KO.mjs +88 -0
- package/dist/chunk-FSM26655.mjs +37 -0
- package/{src/components/editor/nodes/Hint/index.tsx → dist/chunk-G53GLEAY.mjs} +158 -190
- package/dist/chunk-GK35L7UY.mjs +28 -0
- package/dist/chunk-GXYD4VZM.mjs +193 -0
- package/dist/chunk-GYIOYVCN.mjs +538 -0
- package/dist/chunk-GZPNVR7L.mjs +157 -0
- package/dist/chunk-JXDPPUJI.mjs +52 -0
- package/dist/chunk-K36V4SIW.mjs +141 -0
- package/dist/chunk-KJ6AJ44Q.mjs +128 -0
- package/dist/chunk-KJV3FAZ7.mjs +142 -0
- package/{src/components/editor/plugins/ImagesPlugin/index.tsx → dist/chunk-LGG4IUIA.mjs} +189 -222
- package/dist/chunk-LQN3CMKV.mjs +1906 -0
- package/dist/chunk-N3WN46VL.mjs +236 -0
- package/dist/chunk-PBD6LMLC.mjs +366 -0
- package/dist/chunk-POGRR73N.mjs +33 -0
- package/{src/components/editor/utils/editorFormatting.ts → dist/chunk-PZSUSXQG.mjs} +238 -282
- package/dist/chunk-QEIFVK5M.mjs +29 -0
- package/dist/chunk-QHIQKMVN.mjs +427 -0
- package/dist/chunk-TCYK7DM7.mjs +36 -0
- package/dist/chunk-TTHQCW5F.mjs +47 -0
- package/dist/chunk-U47ABU5Z.mjs +53 -0
- package/dist/chunk-WDG7J2DY.mjs +116 -0
- package/dist/chunk-WJRHXI2C.mjs +733 -0
- package/dist/chunk-XLER2DHM.mjs +357 -0
- package/dist/chunk-XWC4TK2N.mjs +315 -0
- package/dist/chunk-YHPNOWFH.mjs +15 -0
- package/dist/chunk-YKC3SO4Z.mjs +32 -0
- package/dist/chunk-YMBXLRW5.mjs +374 -0
- package/dist/chunk-YPHOEJ46.mjs +64 -0
- package/dist/chunk-YUDCJRJM.mjs +25 -0
- package/dist/chunk-Z4EWP7BI.mjs +65 -0
- package/dist/chunk-ZB5LZQKC.mjs +191 -0
- package/dist/chunk-ZJRKATOJ.mjs +65 -0
- package/dist/color-BPKOPQKN.mjs +12 -0
- package/dist/estree-XC56IUFX.mjs +4414 -0
- package/dist/font-FEZ3GKSF.mjs +13 -0
- package/dist/font-size-EK775WRH.mjs +15 -0
- package/dist/html-S3ACX7NI.mjs +2738 -0
- package/dist/image-2PJIAYAT.mjs +993 -0
- package/dist/index.d.mts +145 -0
- package/dist/index.d.ts +145 -0
- package/dist/index.js +57855 -0
- package/dist/index.mjs +1790 -0
- package/dist/insert-gif-SAIDYURE.mjs +100 -0
- package/dist/insert-image-U3RJN3OW.mjs +259 -0
- package/dist/insert-node-5P2CRJ7S.mjs +201 -0
- package/dist/insert-poll-HCPM7MO6.mjs +33 -0
- package/dist/insert-table-24XYUS2W.mjs +66 -0
- package/dist/markdown-SNVBOSRA.mjs +3487 -0
- package/dist/poll-component-2R4MDLHS.mjs +303 -0
- package/dist/postcss-ONF3VDIM.mjs +5051 -0
- package/dist/standalone-EOIALU3M.mjs +2373 -0
- package/dist/stepper-FSARL6X6.mjs +304 -0
- package/dist/styles/notiq.css +1149 -0
- package/dist/text-align-VLECWO4H.mjs +118 -0
- package/dist/text-format-BG5WOOPZ.mjs +16 -0
- package/dist/typescript-AMPI6OVS.mjs +13135 -0
- package/package.json +66 -11
- package/src/styles/notiq.css +1149 -0
- package/src/styles/tailwind-plugin.ts +134 -0
- package/components.json +0 -21
- package/eslint.config.mjs +0 -16
- package/next.config.ts +0 -12
- package/postcss.config.mjs +0 -5
- package/public/file.svg +0 -1
- package/public/globe.svg +0 -1
- package/public/images/icons/plus.svg +0 -10
- package/public/next.svg +0 -1
- package/public/vercel.svg +0 -1
- package/public/window.svg +0 -1
- package/src/app/actions.ts +0 -2
- package/src/app/api/ai/route.ts +0 -175
- package/src/app/api/edgestore/[...edgestore]/route.ts +0 -28
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +0 -205
- package/src/app/layout.tsx +0 -38
- package/src/app/page.tsx +0 -12
- package/src/components/editor/Core.tsx +0 -220
- package/src/components/editor/hooks/instructions-messages.ts +0 -300
- package/src/components/editor/hooks/use-mobile.ts +0 -19
- package/src/components/editor/hooks/useReport.ts +0 -67
- package/src/components/editor/hooks/useResizeObservert.ts +0 -22
- package/src/components/editor/index.tsx +0 -39
- package/src/components/editor/lexical-on-change.tsx +0 -28
- package/src/components/editor/nodes/CollapsibleNode/CollapsibleContainerNode.ts +0 -92
- package/src/components/editor/nodes/CollapsibleNode/CollapsibleContentNode.ts +0 -65
- package/src/components/editor/nodes/CollapsibleNode/CollapsibleTitleNode.ts +0 -105
- package/src/components/editor/nodes/EquationNode/EquationComponent.tsx +0 -143
- package/src/components/editor/nodes/EquationNode/EquationNode.tsx +0 -170
- package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawComponent.tsx +0 -228
- package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawImage.tsx +0 -137
- package/src/components/editor/nodes/ExcalidrawNode/ImageResizer.tsx +0 -317
- package/src/components/editor/nodes/ExcalidrawNode/index.tsx +0 -204
- package/src/components/editor/nodes/FigmaNode/FigmaNode.tsx +0 -134
- package/src/components/editor/nodes/Hint/HintComponet.tsx +0 -221
- package/src/components/editor/nodes/ImageNode/index.tsx +0 -328
- package/src/components/editor/nodes/InlineImageNode/InlineImageComponent.tsx +0 -383
- package/src/components/editor/nodes/InlineImageNode/InlineImageNode.css +0 -94
- package/src/components/editor/nodes/InlineImageNode/InlineImageNode.tsx +0 -309
- package/src/components/editor/nodes/LayoutNode/LayoutContainerNode.ts +0 -146
- package/src/components/editor/nodes/LayoutNode/LayoutItemNode.ts +0 -79
- package/src/components/editor/nodes/PollNode/index.tsx +0 -204
- package/src/components/editor/nodes/TweetNode/index.tsx +0 -214
- package/src/components/editor/nodes/index.ts +0 -81
- package/src/components/editor/plugins/AutoEmbedPlugin/index.tsx +0 -350
- package/src/components/editor/plugins/AutoLinkPlugin/index.tsx +0 -56
- package/src/components/editor/plugins/CodeActionMenuPlugin/components/CopyButton.tsx +0 -70
- package/src/components/editor/plugins/CodeActionMenuPlugin/components/PrettierButton.tsx +0 -192
- package/src/components/editor/plugins/CodeActionMenuPlugin/index.tsx +0 -217
- package/src/components/editor/plugins/CodeActionMenuPlugin/utils.ts +0 -26
- package/src/components/editor/plugins/CodeHighlightPlugin/index.ts +0 -21
- package/src/components/editor/plugins/CollapsiblePlugin/Collapsible.css +0 -76
- package/src/components/editor/plugins/CollapsiblePlugin/index.ts +0 -228
- package/src/components/editor/plugins/DragDropPastePlugin/index.tsx +0 -44
- package/src/components/editor/plugins/DraggableBlockPlugin/index.tsx +0 -52
- package/src/components/editor/plugins/EquationsPlugin/index.tsx +0 -85
- package/src/components/editor/plugins/ExcalidrawPlugin/index.tsx +0 -98
- package/src/components/editor/plugins/FigmaPlugin/index.tsx +0 -42
- package/src/components/editor/plugins/FloatingLinkEditorPlugin/index.tsx +0 -445
- package/src/components/editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx +0 -275
- package/src/components/editor/plugins/InlineImagePlugin/index.tsx +0 -351
- package/src/components/editor/plugins/LayoutPlugin/index.tsx +0 -238
- package/src/components/editor/plugins/LinkPlugin/index.tsx +0 -36
- package/src/components/editor/plugins/LinkWithMetaData/index.tsx +0 -271
- package/src/components/editor/plugins/MarkdownShortcutPlugin/index.tsx +0 -11
- package/src/components/editor/plugins/MarkdownTransformers/index.tsx +0 -304
- package/src/components/editor/plugins/PollPlugin/index.tsx +0 -49
- package/src/components/editor/plugins/ShortcutsPlugin/index.tsx +0 -180
- package/src/components/editor/plugins/ShortcutsPlugin/shortcuts.ts +0 -253
- package/src/components/editor/plugins/SlashCommand/index.tsx +0 -621
- package/src/components/editor/plugins/SpeechToTextPlugin/index.ts +0 -127
- package/src/components/editor/plugins/TabFocusPlugin/index.ts +0 -58
- package/src/components/editor/plugins/TableCellResizer/index.tsx +0 -438
- package/src/components/editor/plugins/TablePlugin/index.tsx +0 -99
- package/src/components/editor/plugins/ToolbarPlugin/index.tsx +0 -522
- package/src/components/editor/plugins/TwitterPlugin/index.ts +0 -35
- package/src/components/editor/plugins/YouTubeNode/index.tsx +0 -179
- package/src/components/editor/plugins/YouTubePlugin/index.ts +0 -41
- package/src/components/editor/themes/editor-theme.ts +0 -113
- package/src/components/editor/themes/theme.css +0 -377
- package/src/components/editor/utils/ai.ts +0 -291
- package/src/components/editor/utils/canUseDOM.ts +0 -12
- package/src/components/editor/utils/environment.ts +0 -50
- package/src/components/editor/utils/extract-data.ts +0 -166
- package/src/components/editor/utils/getAllLexicalChildren.ts +0 -13
- package/src/components/editor/utils/getDOMRangeRect.ts +0 -27
- package/src/components/editor/utils/getSelectedNode.ts +0 -27
- package/src/components/editor/utils/gif.ts +0 -29
- package/src/components/editor/utils/invariant.ts +0 -15
- package/src/components/editor/utils/setFloatingElemPosition.ts +0 -51
- package/src/components/editor/utils/setFloatingElemPositionForLinkEditor.ts +0 -40
- package/src/components/editor/utils/setNodePlaceholderFromSelection/getNodePlaceholder.ts +0 -51
- package/src/components/editor/utils/setNodePlaceholderFromSelection/setNodePlaceholderFromSelection.ts +0 -15
- package/src/components/editor/utils/setNodePlaceholderFromSelection/setPlaceholderOnSelection.ts +0 -114
- package/src/components/editor/utils/setNodePlaceholderFromSelection/styles.css +0 -6
- package/src/components/editor/utils/url.ts +0 -109
- package/src/components/editor/utils/useLayoutEffect.ts +0 -13
- package/src/components/providers/QueryProvider.tsx +0 -15
- package/src/components/providers/SharedHistoryContext.tsx +0 -28
- package/src/components/providers/ToolbarContext.tsx +0 -123
- package/src/components/providers/theme-provider.tsx +0 -11
- package/src/components/theme/ModeToggle.tsx +0 -40
- package/src/components/ui/FileInput.tsx +0 -40
- package/src/components/ui/Input.css +0 -32
- package/src/components/ui/Select.css +0 -42
- package/src/components/ui/Select.tsx +0 -36
- package/src/components/ui/TextInput.tsx +0 -48
- package/src/components/ui/ai/ai-button.tsx +0 -574
- package/src/components/ui/ai/border.tsx +0 -99
- package/src/components/ui/ai/placeholder-input-vanish.tsx +0 -282
- package/src/components/ui/button.tsx +0 -89
- package/src/components/ui/card.tsx +0 -76
- package/src/components/ui/checkbox.tsx +0 -30
- package/src/components/ui/command.tsx +0 -153
- package/src/components/ui/dialog/Dialog.css +0 -25
- package/src/components/ui/dialog/Dialog.tsx +0 -34
- package/src/components/ui/dialog.tsx +0 -122
- package/src/components/ui/drop-downs/background-color.tsx +0 -183
- package/src/components/ui/drop-downs/block-format.tsx +0 -159
- package/src/components/ui/drop-downs/code.tsx +0 -42
- package/src/components/ui/drop-downs/color.tsx +0 -177
- package/src/components/ui/drop-downs/font-size.tsx +0 -138
- package/src/components/ui/drop-downs/font.tsx +0 -155
- package/src/components/ui/drop-downs/index.tsx +0 -122
- package/src/components/ui/drop-downs/insert-node.tsx +0 -213
- package/src/components/ui/drop-downs/text-align.tsx +0 -123
- package/src/components/ui/drop-downs/text-format.tsx +0 -104
- package/src/components/ui/dropdown-menu.tsx +0 -201
- package/src/components/ui/equation/EquationEditor.css +0 -38
- package/src/components/ui/equation/EquationEditor.tsx +0 -56
- package/src/components/ui/equation/KatexEquationAlterer.css +0 -41
- package/src/components/ui/equation/KatexEquationAlterer.tsx +0 -83
- package/src/components/ui/equation/KatexRenderer.tsx +0 -66
- package/src/components/ui/excalidraw/ExcalidrawModal.css +0 -64
- package/src/components/ui/excalidraw/ExcalidrawModal.tsx +0 -234
- package/src/components/ui/excalidraw/Modal.css +0 -62
- package/src/components/ui/excalidraw/Modal.tsx +0 -110
- package/src/components/ui/hover-card.tsx +0 -29
- package/src/components/ui/image/error-image.tsx +0 -17
- package/src/components/ui/image/file-upload.tsx +0 -240
- package/src/components/ui/image/image-resizer.tsx +0 -297
- package/src/components/ui/image/image-toolbar.tsx +0 -264
- package/src/components/ui/image/index.tsx +0 -408
- package/src/components/ui/image/lazy-image.tsx +0 -68
- package/src/components/ui/image/lazy-video.tsx +0 -71
- package/src/components/ui/input.tsx +0 -22
- package/src/components/ui/models/custom-dialog.tsx +0 -320
- package/src/components/ui/models/insert-gif.tsx +0 -90
- package/src/components/ui/models/insert-image.tsx +0 -52
- package/src/components/ui/models/insert-poll.tsx +0 -29
- package/src/components/ui/models/insert-table.tsx +0 -62
- package/src/components/ui/models/use-model.tsx +0 -91
- package/src/components/ui/poll/poll-component.tsx +0 -304
- package/src/components/ui/popover.tsx +0 -33
- package/src/components/ui/progress.tsx +0 -28
- package/src/components/ui/scroll-area.tsx +0 -48
- package/src/components/ui/separator.tsx +0 -31
- package/src/components/ui/skeleton.tsx +0 -15
- package/src/components/ui/sonner.tsx +0 -31
- package/src/components/ui/stepper/step.tsx +0 -179
- package/src/components/ui/stepper/stepper.tsx +0 -89
- package/src/components/ui/textarea.tsx +0 -22
- package/src/components/ui/toggle.tsx +0 -71
- package/src/components/ui/tooltip.tsx +0 -32
- package/src/components/ui/write/text-format-floting-toolbar.tsx +0 -346
- package/src/lib/edgestore.ts +0 -9
- package/src/lib/pinecone-client.ts +0 -0
- package/src/lib/utils.ts +0 -6
- package/src/utils/docSerialization.ts +0 -77
- package/src/utils/emoji-list.ts +0 -16615
- package/src/utils/getDOMRangeRect.ts +0 -27
- package/src/utils/getThemeSelector.ts +0 -25
- package/src/utils/isMobileWidth.ts +0 -7
- package/src/utils/joinClasses.ts +0 -13
- package/src/utils/setFloatingElemPosition.ts +0 -74
- package/src/utils/setFloatingElemPositionForLinkEditor.ts +0 -46
- package/src/utils/swipe.ts +0 -127
- package/src/utils/url.ts +0 -38
- package/tsconfig.json +0 -27
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_react_shim
|
|
3
|
+
} from "./chunk-77KXU36M.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/editor/plugins/TemplatePlugin/index.tsx
|
|
6
|
+
init_react_shim();
|
|
7
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
8
|
+
import { $convertFromMarkdownString, TRANSFORMERS } from "@lexical/markdown";
|
|
9
|
+
import { COMMAND_PRIORITY_EDITOR, createCommand } from "lexical";
|
|
10
|
+
import { useEffect } from "react";
|
|
11
|
+
var INSERT_TEMPLATE_COMMAND = createCommand("INSERT_TEMPLATE_COMMAND");
|
|
12
|
+
function TemplatePlugin() {
|
|
13
|
+
const [editor] = useLexicalComposerContext();
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
return editor.registerCommand(
|
|
16
|
+
INSERT_TEMPLATE_COMMAND,
|
|
17
|
+
(markdownContent) => {
|
|
18
|
+
editor.update(() => {
|
|
19
|
+
$convertFromMarkdownString(markdownContent, TRANSFORMERS);
|
|
20
|
+
});
|
|
21
|
+
return true;
|
|
22
|
+
},
|
|
23
|
+
COMMAND_PRIORITY_EDITOR
|
|
24
|
+
);
|
|
25
|
+
}, [editor]);
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
INSERT_TEMPLATE_COMMAND,
|
|
31
|
+
TemplatePlugin
|
|
32
|
+
};
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Popover,
|
|
3
|
+
PopoverContent,
|
|
4
|
+
PopoverTrigger
|
|
5
|
+
} from "./chunk-64Z3FI7T.mjs";
|
|
6
|
+
import {
|
|
7
|
+
Label,
|
|
8
|
+
Tabs,
|
|
9
|
+
TabsContent,
|
|
10
|
+
TabsList,
|
|
11
|
+
TabsTrigger
|
|
12
|
+
} from "./chunk-3CPBODXA.mjs";
|
|
13
|
+
import {
|
|
14
|
+
Input
|
|
15
|
+
} from "./chunk-POGRR73N.mjs";
|
|
16
|
+
import {
|
|
17
|
+
Button
|
|
18
|
+
} from "./chunk-BIU7WTLX.mjs";
|
|
19
|
+
import {
|
|
20
|
+
cn
|
|
21
|
+
} from "./chunk-YHPNOWFH.mjs";
|
|
22
|
+
import {
|
|
23
|
+
__spreadProps,
|
|
24
|
+
__spreadValues,
|
|
25
|
+
init_react_shim
|
|
26
|
+
} from "./chunk-77KXU36M.mjs";
|
|
27
|
+
|
|
28
|
+
// src/components/ui/drop-downs/color.tsx
|
|
29
|
+
init_react_shim();
|
|
30
|
+
import { $getSelection } from "lexical";
|
|
31
|
+
import React, { useCallback, useState } from "react";
|
|
32
|
+
import { $patchStyleText } from "@lexical/selection";
|
|
33
|
+
import { useTheme } from "next-themes";
|
|
34
|
+
import { PaletteIcon } from "lucide-react";
|
|
35
|
+
function Color({
|
|
36
|
+
disabled,
|
|
37
|
+
color,
|
|
38
|
+
bgColor,
|
|
39
|
+
editor,
|
|
40
|
+
isTable = false,
|
|
41
|
+
side = "bottom",
|
|
42
|
+
sideOffset = 0,
|
|
43
|
+
style
|
|
44
|
+
}) {
|
|
45
|
+
const { theme } = useTheme();
|
|
46
|
+
const [customColor, setCustomColor] = useState("#000000");
|
|
47
|
+
const [activeTab, setActiveTab] = useState("palette");
|
|
48
|
+
const [recentColors, setRecentColors] = useState([]);
|
|
49
|
+
const applyStyleText = useCallback(
|
|
50
|
+
(styles, skipHistoryStack) => {
|
|
51
|
+
editor.update(
|
|
52
|
+
() => {
|
|
53
|
+
const selection = $getSelection();
|
|
54
|
+
if (selection !== null) {
|
|
55
|
+
$patchStyleText(selection, styles);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
skipHistoryStack ? { tag: "historic" } : {}
|
|
59
|
+
);
|
|
60
|
+
},
|
|
61
|
+
[editor]
|
|
62
|
+
);
|
|
63
|
+
const onFontColorSelect = useCallback(
|
|
64
|
+
(value, skipHistoryStack) => {
|
|
65
|
+
applyStyleText({ color: value }, skipHistoryStack);
|
|
66
|
+
if (value && !recentColors.includes(value) && !value.startsWith("var(--")) {
|
|
67
|
+
setRecentColors((prev) => [value, ...prev.slice(0, 7)]);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
[applyStyleText, recentColors]
|
|
71
|
+
);
|
|
72
|
+
const resetFontColor = useCallback(() => {
|
|
73
|
+
applyStyleText({ color: "" }, true);
|
|
74
|
+
}, [applyStyleText]);
|
|
75
|
+
const handleCustomColorChange = useCallback((value) => {
|
|
76
|
+
setCustomColor(value);
|
|
77
|
+
onFontColorSelect(value, true);
|
|
78
|
+
}, [onFontColorSelect]);
|
|
79
|
+
const hexToRgb = (hex) => {
|
|
80
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
81
|
+
return result ? {
|
|
82
|
+
r: parseInt(result[1], 16),
|
|
83
|
+
g: parseInt(result[2], 16),
|
|
84
|
+
b: parseInt(result[3], 16)
|
|
85
|
+
} : null;
|
|
86
|
+
};
|
|
87
|
+
const rgbToHsl = (r, g, b) => {
|
|
88
|
+
r /= 255;
|
|
89
|
+
g /= 255;
|
|
90
|
+
b /= 255;
|
|
91
|
+
const max = Math.max(r, g, b);
|
|
92
|
+
const min = Math.min(r, g, b);
|
|
93
|
+
let h, s, l = (max + min) / 2;
|
|
94
|
+
if (max === min) {
|
|
95
|
+
h = s = 0;
|
|
96
|
+
} else {
|
|
97
|
+
const d = max - min;
|
|
98
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
99
|
+
switch (max) {
|
|
100
|
+
case r:
|
|
101
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
102
|
+
break;
|
|
103
|
+
case g:
|
|
104
|
+
h = (b - r) / d + 2;
|
|
105
|
+
break;
|
|
106
|
+
case b:
|
|
107
|
+
h = (r - g) / d + 4;
|
|
108
|
+
break;
|
|
109
|
+
default:
|
|
110
|
+
h = 0;
|
|
111
|
+
}
|
|
112
|
+
h /= 6;
|
|
113
|
+
}
|
|
114
|
+
return { h: Math.round(h * 360), s: Math.round(s * 100), l: Math.round(l * 100) };
|
|
115
|
+
};
|
|
116
|
+
const generateShades = (baseColor) => {
|
|
117
|
+
const rgb = hexToRgb(baseColor);
|
|
118
|
+
if (!rgb) return [];
|
|
119
|
+
const shades = [];
|
|
120
|
+
for (let i = 10; i <= 90; i += 10) {
|
|
121
|
+
const factor = i / 100;
|
|
122
|
+
const r = Math.round(rgb.r * factor);
|
|
123
|
+
const g = Math.round(rgb.g * factor);
|
|
124
|
+
const b = Math.round(rgb.b * factor);
|
|
125
|
+
shades.push(`rgb(${r}, ${g}, ${b})`);
|
|
126
|
+
}
|
|
127
|
+
return shades;
|
|
128
|
+
};
|
|
129
|
+
const generateTints = (baseColor) => {
|
|
130
|
+
const rgb = hexToRgb(baseColor);
|
|
131
|
+
if (!rgb) return [];
|
|
132
|
+
const tints = [];
|
|
133
|
+
for (let i = 10; i <= 90; i += 10) {
|
|
134
|
+
const factor = i / 100;
|
|
135
|
+
const r = Math.round(rgb.r + (255 - rgb.r) * factor);
|
|
136
|
+
const g = Math.round(rgb.g + (255 - rgb.g) * factor);
|
|
137
|
+
const b = Math.round(rgb.b + (255 - rgb.b) * factor);
|
|
138
|
+
tints.push(`rgb(${r}, ${g}, ${b})`);
|
|
139
|
+
}
|
|
140
|
+
return tints;
|
|
141
|
+
};
|
|
142
|
+
const colorPalette = React.useMemo(() => ({
|
|
143
|
+
basic: [
|
|
144
|
+
{ name: "Default", value: theme === "dark" ? "white" : "black", isDefault: true },
|
|
145
|
+
{ name: "Gray", value: "var(--font-gray)" },
|
|
146
|
+
{ name: "Brown", value: "var(--font-brown)" },
|
|
147
|
+
{ name: "Orange", value: "var(--font-orange)" },
|
|
148
|
+
{ name: "Yellow", value: "var(--font-yellow)" },
|
|
149
|
+
{ name: "Green", value: "var(--font-green)" },
|
|
150
|
+
{ name: "Blue", value: "var(--font-blue)" },
|
|
151
|
+
{ name: "Purple", value: "var(--font-purple)" },
|
|
152
|
+
{ name: "Pink", value: "var(--font-pink)" },
|
|
153
|
+
{ name: "Red", value: "var(--font-red)" }
|
|
154
|
+
],
|
|
155
|
+
extended: [
|
|
156
|
+
// Reds
|
|
157
|
+
{ name: "Light Red", value: "#ffcccb" },
|
|
158
|
+
{ name: "Red", value: "#ff0000" },
|
|
159
|
+
{ name: "Dark Red", value: "#8b0000" },
|
|
160
|
+
{ name: "Crimson", value: "#dc143c" },
|
|
161
|
+
{ name: "Rose", value: "#ff69b4" },
|
|
162
|
+
// Oranges
|
|
163
|
+
{ name: "Light Orange", value: "#ffd700" },
|
|
164
|
+
{ name: "Orange", value: "#ffa500" },
|
|
165
|
+
{ name: "Dark Orange", value: "#ff8c00" },
|
|
166
|
+
{ name: "Coral", value: "#ff7f50" },
|
|
167
|
+
{ name: "Peach", value: "#ffcba4" },
|
|
168
|
+
// Yellows
|
|
169
|
+
{ name: "Light Yellow", value: "#ffffe0" },
|
|
170
|
+
{ name: "Yellow", value: "#ffff00" },
|
|
171
|
+
{ name: "Gold", value: "#ffd700" },
|
|
172
|
+
{ name: "Amber", value: "#ffbf00" },
|
|
173
|
+
{ name: "Khaki", value: "#f0e68c" },
|
|
174
|
+
// Greens
|
|
175
|
+
{ name: "Light Green", value: "#90ee90" },
|
|
176
|
+
{ name: "Green", value: "#008000" },
|
|
177
|
+
{ name: "Dark Green", value: "#006400" },
|
|
178
|
+
{ name: "Forest", value: "#228b22" },
|
|
179
|
+
{ name: "Emerald", value: "#50c878" },
|
|
180
|
+
// Blues
|
|
181
|
+
{ name: "Light Blue", value: "#add8e6" },
|
|
182
|
+
{ name: "Blue", value: "#0000ff" },
|
|
183
|
+
{ name: "Dark Blue", value: "#00008b" },
|
|
184
|
+
{ name: "Navy", value: "#000080" },
|
|
185
|
+
{ name: "Cyan", value: "#00ffff" },
|
|
186
|
+
// Purples
|
|
187
|
+
{ name: "Light Purple", value: "#dda0dd" },
|
|
188
|
+
{ name: "Purple", value: "#800080" },
|
|
189
|
+
{ name: "Dark Purple", value: "#4b0082" },
|
|
190
|
+
{ name: "Violet", value: "#8a2be2" },
|
|
191
|
+
{ name: "Indigo", value: "#4b0082" },
|
|
192
|
+
// Grays
|
|
193
|
+
{ name: "Light Gray", value: "#d3d3d3" },
|
|
194
|
+
{ name: "Gray", value: "#808080" },
|
|
195
|
+
{ name: "Dark Gray", value: "#696969" },
|
|
196
|
+
{ name: "Silver", value: "#c0c0c0" },
|
|
197
|
+
{ name: "Charcoal", value: "#36454f" }
|
|
198
|
+
]
|
|
199
|
+
}), [theme]);
|
|
200
|
+
const isActiveColor = (colorValue) => {
|
|
201
|
+
return color === colorValue || !color && colorValue === (theme === "dark" ? "white" : "black");
|
|
202
|
+
};
|
|
203
|
+
return /* @__PURE__ */ React.createElement(Popover, null, /* @__PURE__ */ React.createElement(PopoverTrigger, { asChild: true, disabled }, !isTable ? /* @__PURE__ */ React.createElement(
|
|
204
|
+
Button,
|
|
205
|
+
{
|
|
206
|
+
style: __spreadProps(__spreadValues({}, style), {
|
|
207
|
+
color: theme === "dark" && color === "#000" ? "white" : theme !== "dark" && color === "#fff" ? "black" : color
|
|
208
|
+
}),
|
|
209
|
+
variant: "ghost",
|
|
210
|
+
className: cn(
|
|
211
|
+
"relative px-3 py-2 h-9 border border-transparent rounded-md",
|
|
212
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
213
|
+
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
214
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
215
|
+
"transition-all duration-200"
|
|
216
|
+
),
|
|
217
|
+
size: "sm",
|
|
218
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
219
|
+
"aria-label": "Text color options"
|
|
220
|
+
},
|
|
221
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React.createElement(PaletteIcon, { className: "w-4 h-4 dark:text-white" }), /* @__PURE__ */ React.createElement(
|
|
222
|
+
"div",
|
|
223
|
+
{
|
|
224
|
+
className: "w-3 h-1 rounded-sm border border-border/50 ml-1",
|
|
225
|
+
style: { backgroundColor: color || (theme === "dark" ? "white" : "black") }
|
|
226
|
+
}
|
|
227
|
+
))
|
|
228
|
+
) : null), /* @__PURE__ */ React.createElement(
|
|
229
|
+
PopoverContent,
|
|
230
|
+
{
|
|
231
|
+
className: "max-w-60 p-4 z-[250] shadow-lg border-border/50",
|
|
232
|
+
side,
|
|
233
|
+
sideOffset
|
|
234
|
+
},
|
|
235
|
+
/* @__PURE__ */ React.createElement(Tabs, { value: activeTab, onValueChange: setActiveTab, className: "w-full" }, /* @__PURE__ */ React.createElement(TabsList, { className: "grid w-full grid-cols-4" }, /* @__PURE__ */ React.createElement(TabsTrigger, { value: "palette", className: "text-xs" }, "Basic"), /* @__PURE__ */ React.createElement(TabsTrigger, { value: "extended", className: "text-xs" }, "Extended"), /* @__PURE__ */ React.createElement(TabsTrigger, { value: "custom", className: "text-xs" }, "Custom"), /* @__PURE__ */ React.createElement(TabsTrigger, { value: "recent", className: "text-xs" }, "Recent")), /* @__PURE__ */ React.createElement("div", { className: "mt-4" }, /* @__PURE__ */ React.createElement(TabsContent, { value: "palette", className: "mt-0" }, /* @__PURE__ */ React.createElement("div", { className: "space-y-3" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "text-sm font-semibold text-foreground" }, "Basic Colors"), /* @__PURE__ */ React.createElement(
|
|
236
|
+
Button,
|
|
237
|
+
{
|
|
238
|
+
variant: "ghost",
|
|
239
|
+
size: "sm",
|
|
240
|
+
onClick: resetFontColor,
|
|
241
|
+
className: "h-7 px-3 text-xs text-muted-foreground hover:text-foreground"
|
|
242
|
+
},
|
|
243
|
+
"Reset"
|
|
244
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-5 gap-2" }, colorPalette.basic.map((colorItem, index) => /* @__PURE__ */ React.createElement(
|
|
245
|
+
Button,
|
|
246
|
+
{
|
|
247
|
+
key: `${colorItem.name}-${index}`,
|
|
248
|
+
type: "button",
|
|
249
|
+
onClick: () => onFontColorSelect(colorItem.value, true),
|
|
250
|
+
className: cn(
|
|
251
|
+
"w-8 h-8 p-0 rounded-lg border-2 transition-all duration-200",
|
|
252
|
+
"hover:scale-110 hover:shadow-md",
|
|
253
|
+
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
254
|
+
isActiveColor(colorItem.value) ? "border-ring shadow-md scale-105" : "border-border/30 hover:border-border"
|
|
255
|
+
),
|
|
256
|
+
style: {
|
|
257
|
+
backgroundColor: colorItem.value
|
|
258
|
+
},
|
|
259
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
260
|
+
title: colorItem.name
|
|
261
|
+
}
|
|
262
|
+
))))), /* @__PURE__ */ React.createElement(TabsContent, { value: "extended", className: "mt-0" }, /* @__PURE__ */ React.createElement("div", { className: "space-y-3" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "text-sm font-semibold text-foreground" }, "Extended Palette"), /* @__PURE__ */ React.createElement(
|
|
263
|
+
Button,
|
|
264
|
+
{
|
|
265
|
+
variant: "ghost",
|
|
266
|
+
size: "sm",
|
|
267
|
+
onClick: resetFontColor,
|
|
268
|
+
className: "h-7 px-3 text-xs text-muted-foreground hover:text-foreground"
|
|
269
|
+
},
|
|
270
|
+
"Reset"
|
|
271
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-5 gap-1.5 max-h-48 overflow-y-auto scrollbar-none" }, colorPalette.extended.map((colorItem, index) => /* @__PURE__ */ React.createElement(
|
|
272
|
+
Button,
|
|
273
|
+
{
|
|
274
|
+
key: `${colorItem.name}-ext-${index}`,
|
|
275
|
+
type: "button",
|
|
276
|
+
onClick: () => onFontColorSelect(colorItem.value, true),
|
|
277
|
+
className: cn(
|
|
278
|
+
"w-8 h-8 p-0 rounded-md border-2 transition-all duration-200",
|
|
279
|
+
"hover:scale-110 hover:shadow-md",
|
|
280
|
+
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
281
|
+
isActiveColor(colorItem.value) ? "border-ring shadow-md scale-105" : "border-border/30 hover:border-border"
|
|
282
|
+
),
|
|
283
|
+
style: {
|
|
284
|
+
backgroundColor: colorItem.value
|
|
285
|
+
},
|
|
286
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
287
|
+
title: colorItem.name
|
|
288
|
+
}
|
|
289
|
+
))))), /* @__PURE__ */ React.createElement(TabsContent, { value: "custom", className: "mt-0" }, /* @__PURE__ */ React.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "text-sm font-semibold text-foreground" }, "Custom Color"), /* @__PURE__ */ React.createElement(
|
|
290
|
+
Button,
|
|
291
|
+
{
|
|
292
|
+
variant: "ghost",
|
|
293
|
+
size: "sm",
|
|
294
|
+
onClick: resetFontColor,
|
|
295
|
+
className: "h-7 px-3 text-xs text-muted-foreground hover:text-foreground"
|
|
296
|
+
},
|
|
297
|
+
"Reset"
|
|
298
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "space-y-3" }, /* @__PURE__ */ React.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React.createElement(
|
|
299
|
+
Input,
|
|
300
|
+
{
|
|
301
|
+
type: "color",
|
|
302
|
+
value: customColor,
|
|
303
|
+
onChange: (e) => handleCustomColorChange(e.target.value),
|
|
304
|
+
className: "w-16 h-10 p-1 rounded-md cursor-pointer"
|
|
305
|
+
}
|
|
306
|
+
), /* @__PURE__ */ React.createElement(
|
|
307
|
+
Input,
|
|
308
|
+
{
|
|
309
|
+
type: "text",
|
|
310
|
+
value: customColor,
|
|
311
|
+
onChange: (e) => {
|
|
312
|
+
setCustomColor(e.target.value);
|
|
313
|
+
if (/^#[0-9A-F]{6}$/i.test(e.target.value)) {
|
|
314
|
+
onFontColorSelect(e.target.value, true);
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
placeholder: "#000000",
|
|
318
|
+
className: "flex-1 font-mono text-sm"
|
|
319
|
+
}
|
|
320
|
+
)), customColor && /* @__PURE__ */ React.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React.createElement(Label, { className: "text-xs text-muted-foreground" }, "Shades"), /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-6 gap-1" }, generateShades(customColor).map((shade, index) => /* @__PURE__ */ React.createElement(
|
|
321
|
+
Button,
|
|
322
|
+
{
|
|
323
|
+
key: `shade-${index}`,
|
|
324
|
+
type: "button",
|
|
325
|
+
onClick: () => onFontColorSelect(shade, true),
|
|
326
|
+
className: "w-6 h-6 p-0 rounded border hover:scale-110 transition-transform",
|
|
327
|
+
style: { backgroundColor: shade },
|
|
328
|
+
onMouseDown: (e) => e.preventDefault()
|
|
329
|
+
}
|
|
330
|
+
))), /* @__PURE__ */ React.createElement(Label, { className: "text-xs text-muted-foreground" }, "Tints"), /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-6 gap-1" }, generateTints(customColor).map((tint, index) => /* @__PURE__ */ React.createElement(
|
|
331
|
+
Button,
|
|
332
|
+
{
|
|
333
|
+
key: `tint-${index}`,
|
|
334
|
+
type: "button",
|
|
335
|
+
onClick: () => onFontColorSelect(tint, true),
|
|
336
|
+
className: "w-6 h-6 p-0 rounded border hover:scale-110 transition-transform",
|
|
337
|
+
style: { backgroundColor: tint },
|
|
338
|
+
onMouseDown: (e) => e.preventDefault()
|
|
339
|
+
}
|
|
340
|
+
))))))), /* @__PURE__ */ React.createElement(TabsContent, { value: "recent", className: "mt-0" }, /* @__PURE__ */ React.createElement("div", { className: "space-y-3" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "text-sm font-semibold text-foreground" }, "Recent Colors"), /* @__PURE__ */ React.createElement(
|
|
341
|
+
Button,
|
|
342
|
+
{
|
|
343
|
+
variant: "ghost",
|
|
344
|
+
size: "sm",
|
|
345
|
+
onClick: () => setRecentColors([]),
|
|
346
|
+
className: "h-7 px-3 text-xs text-muted-foreground hover:text-foreground",
|
|
347
|
+
disabled: recentColors.length === 0
|
|
348
|
+
},
|
|
349
|
+
"Clear"
|
|
350
|
+
)), recentColors.length > 0 ? /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-4 gap-2" }, recentColors.map((recentColor, index) => /* @__PURE__ */ React.createElement(
|
|
351
|
+
Button,
|
|
352
|
+
{
|
|
353
|
+
key: `recent-${index}`,
|
|
354
|
+
type: "button",
|
|
355
|
+
onClick: () => onFontColorSelect(recentColor, true),
|
|
356
|
+
className: cn(
|
|
357
|
+
"w-12 h-12 p-0 rounded-lg border-2 transition-all duration-200",
|
|
358
|
+
"hover:scale-110 hover:shadow-md",
|
|
359
|
+
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
360
|
+
isActiveColor(recentColor) ? "border-ring shadow-md scale-105" : "border-border/30 hover:border-border"
|
|
361
|
+
),
|
|
362
|
+
style: {
|
|
363
|
+
backgroundColor: recentColor
|
|
364
|
+
},
|
|
365
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
366
|
+
title: recentColor
|
|
367
|
+
}
|
|
368
|
+
))) : /* @__PURE__ */ React.createElement("div", { className: "text-center py-6 text-muted-foreground text-sm" }, "No recent colors")))))
|
|
369
|
+
));
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export {
|
|
373
|
+
Color
|
|
374
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues,
|
|
5
|
+
init_react_shim
|
|
6
|
+
} from "./chunk-77KXU36M.mjs";
|
|
7
|
+
|
|
8
|
+
// src/components/ui/TextInput.tsx
|
|
9
|
+
init_react_shim();
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
function TextInput({
|
|
12
|
+
label,
|
|
13
|
+
value,
|
|
14
|
+
onChange,
|
|
15
|
+
placeholder = "",
|
|
16
|
+
"data-test-id": dataTestId,
|
|
17
|
+
type = "text"
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ React.createElement("div", { className: "Input__wrapper" }, /* @__PURE__ */ React.createElement("label", { className: "Input__label" }, label), /* @__PURE__ */ React.createElement(
|
|
20
|
+
"input",
|
|
21
|
+
{
|
|
22
|
+
type,
|
|
23
|
+
className: "Input__input",
|
|
24
|
+
placeholder,
|
|
25
|
+
value,
|
|
26
|
+
onChange: (e) => {
|
|
27
|
+
onChange(e.target.value);
|
|
28
|
+
},
|
|
29
|
+
"data-test-id": dataTestId
|
|
30
|
+
}
|
|
31
|
+
));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// src/components/ui/Select.tsx
|
|
35
|
+
init_react_shim();
|
|
36
|
+
import * as React2 from "react";
|
|
37
|
+
function Select(_a) {
|
|
38
|
+
var _b = _a, {
|
|
39
|
+
children,
|
|
40
|
+
label,
|
|
41
|
+
className
|
|
42
|
+
} = _b, other = __objRest(_b, [
|
|
43
|
+
"children",
|
|
44
|
+
"label",
|
|
45
|
+
"className"
|
|
46
|
+
]);
|
|
47
|
+
return /* @__PURE__ */ React2.createElement("div", { className: "Input__wrapper" }, /* @__PURE__ */ React2.createElement("label", { style: { marginTop: "-1em" }, className: "Input__label" }, label), /* @__PURE__ */ React2.createElement("select", __spreadProps(__spreadValues({}, other), { className: className || "select" }), children));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// src/components/ui/dialog/Dialog.tsx
|
|
51
|
+
init_react_shim();
|
|
52
|
+
import * as React3 from "react";
|
|
53
|
+
function DialogActions({
|
|
54
|
+
"data-test-id": dataTestId,
|
|
55
|
+
children
|
|
56
|
+
}) {
|
|
57
|
+
return /* @__PURE__ */ React3.createElement("div", { className: "DialogActions", "data-test-id": dataTestId }, children);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
TextInput,
|
|
62
|
+
Select,
|
|
63
|
+
DialogActions
|
|
64
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_react_shim
|
|
3
|
+
} from "./chunk-77KXU36M.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/providers/AIContext.tsx
|
|
6
|
+
init_react_shim();
|
|
7
|
+
import React, { createContext, useContext } from "react";
|
|
8
|
+
var AIContext = createContext({
|
|
9
|
+
apiEndpoint: "/api/ai"
|
|
10
|
+
});
|
|
11
|
+
var useAI = () => useContext(AIContext);
|
|
12
|
+
var AIProvider = ({
|
|
13
|
+
config,
|
|
14
|
+
children
|
|
15
|
+
}) => {
|
|
16
|
+
const value = React.useMemo(() => ({
|
|
17
|
+
apiEndpoint: (config == null ? void 0 : config.apiEndpoint) || "/api/ai"
|
|
18
|
+
}), [config]);
|
|
19
|
+
return /* @__PURE__ */ React.createElement(AIContext.Provider, { value }, children);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
useAI,
|
|
24
|
+
AIProvider
|
|
25
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip,
|
|
3
|
+
TooltipContent,
|
|
4
|
+
TooltipProvider,
|
|
5
|
+
TooltipTrigger
|
|
6
|
+
} from "./chunk-BIU7WTLX.mjs";
|
|
7
|
+
import {
|
|
8
|
+
cn
|
|
9
|
+
} from "./chunk-YHPNOWFH.mjs";
|
|
10
|
+
import {
|
|
11
|
+
__objRest,
|
|
12
|
+
__spreadValues,
|
|
13
|
+
init_react_shim
|
|
14
|
+
} from "./chunk-77KXU36M.mjs";
|
|
15
|
+
|
|
16
|
+
// src/components/ui/toggle.tsx
|
|
17
|
+
init_react_shim();
|
|
18
|
+
import * as React from "react";
|
|
19
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
20
|
+
import { cva } from "class-variance-authority";
|
|
21
|
+
var toggleVariants = cva(
|
|
22
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-zinc-100 hover:text-zinc-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-zinc-950 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-zinc-100 data-[state=on]:text-zinc-900 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 dark:hover:bg-zinc-800 dark:hover:text-zinc-400 dark:focus-visible:ring-zinc-300 dark:data-[state=on]:bg-zinc-800 dark:data-[state=on]:text-zinc-50",
|
|
23
|
+
{
|
|
24
|
+
variants: {
|
|
25
|
+
variant: {
|
|
26
|
+
default: "bg-transparent",
|
|
27
|
+
outline: "border-none cursor-pointer bg-transparent shadow-sm"
|
|
28
|
+
},
|
|
29
|
+
size: {
|
|
30
|
+
default: "h-9 px-2 min-w-9",
|
|
31
|
+
sm: "h-7 rounded-md px-[6px] ",
|
|
32
|
+
lg: "h-10 px-2.5 min-w-10",
|
|
33
|
+
Toolbar: "h-7 w-7 p-3",
|
|
34
|
+
floting: " h-5 w-5 p-3"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
variant: "default",
|
|
39
|
+
size: "default"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
var Toggle = React.forwardRef(
|
|
44
|
+
(_a, ref) => {
|
|
45
|
+
var _b = _a, { className, variant, tip, size } = _b, props = __objRest(_b, ["className", "variant", "tip", "size"]);
|
|
46
|
+
return tip ? /* @__PURE__ */ React.createElement(TooltipProvider, null, /* @__PURE__ */ React.createElement(Tooltip, { delayDuration: 0.2 }, /* @__PURE__ */ React.createElement(TooltipTrigger, { asChild: true }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
|
|
47
|
+
TogglePrimitive.Root,
|
|
48
|
+
__spreadValues({
|
|
49
|
+
ref,
|
|
50
|
+
className: cn(toggleVariants({ variant, size, className }))
|
|
51
|
+
}, props)
|
|
52
|
+
))), /* @__PURE__ */ React.createElement(TooltipContent, { side: "top" }, /* @__PURE__ */ React.createElement("span", null, tip)))) : /* @__PURE__ */ React.createElement(
|
|
53
|
+
TogglePrimitive.Root,
|
|
54
|
+
__spreadValues({
|
|
55
|
+
ref,
|
|
56
|
+
className: cn(toggleVariants({ variant, size, className }))
|
|
57
|
+
}, props)
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
Toggle
|
|
65
|
+
};
|