@keboola/design 3.2.3 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +68 -5
- package/COMPONENT-API.md +77 -81
- package/README.md +8 -8
- package/dist/constants-D3gaMY-W.d.cts +39 -0
- package/dist/constants-D3gaMY-W.d.ts +39 -0
- package/dist/editors.cjs +1950 -0
- package/dist/editors.cjs.map +1 -0
- package/dist/editors.d.cts +111 -0
- package/dist/editors.d.ts +111 -0
- package/dist/editors.js +1922 -0
- package/dist/editors.js.map +1 -0
- package/dist/icons.cjs.map +1 -1
- package/dist/icons.js.map +1 -1
- package/dist/index.cjs +3522 -1994
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +414 -510
- package/dist/index.d.ts +414 -510
- package/dist/index.js +3312 -1783
- package/dist/index.js.map +1 -1
- package/dist/markdown-editor.cjs +21 -35
- package/dist/markdown-editor.cjs.map +1 -1
- package/dist/markdown-editor.d.cts +4 -3
- package/dist/markdown-editor.d.ts +4 -3
- package/dist/markdown-editor.js +21 -35
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.cjs +4 -18
- package/dist/mermaid.cjs.map +1 -1
- package/dist/mermaid.js +4 -18
- package/dist/mermaid.js.map +1 -1
- package/dist/styles.css +2 -2
- package/dist/testing.cjs +1 -1
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/package.json +81 -65
- package/src/styles.css +70 -13
package/dist/markdown-editor.cjs
CHANGED
|
@@ -245,7 +245,6 @@ var init_TooltipContent = __esm({
|
|
|
245
245
|
TooltipContent = ({
|
|
246
246
|
className,
|
|
247
247
|
variant,
|
|
248
|
-
argo,
|
|
249
248
|
keepOpenOnPointerDownOutside = false,
|
|
250
249
|
children,
|
|
251
250
|
onPointerDownOutside,
|
|
@@ -256,7 +255,7 @@ var init_TooltipContent = __esm({
|
|
|
256
255
|
...rest
|
|
257
256
|
}) => {
|
|
258
257
|
const isLegacy = useIsLegacyBrand();
|
|
259
|
-
const renderArgo = !isLegacy
|
|
258
|
+
const renderArgo = !isLegacy;
|
|
260
259
|
const handlePointerDownOutside = (event) => {
|
|
261
260
|
if (keepOpenOnPointerDownOutside) event.preventDefault();
|
|
262
261
|
onPointerDownOutside?.(event);
|
|
@@ -345,7 +344,6 @@ var init_Tooltip = __esm({
|
|
|
345
344
|
className,
|
|
346
345
|
keepOpenOnTriggerClick = false,
|
|
347
346
|
variant,
|
|
348
|
-
argo,
|
|
349
347
|
placement = "right",
|
|
350
348
|
forceHide = false,
|
|
351
349
|
forceShow = false,
|
|
@@ -384,7 +382,6 @@ var init_Tooltip = __esm({
|
|
|
384
382
|
{
|
|
385
383
|
className,
|
|
386
384
|
variant: resolvedVariant,
|
|
387
|
-
argo,
|
|
388
385
|
placement,
|
|
389
386
|
keepOpenOnPointerDownOutside: keepOpenOnTriggerClick,
|
|
390
387
|
children: tooltip
|
|
@@ -874,14 +871,13 @@ var init_Button = __esm({
|
|
|
874
871
|
isLoading = false,
|
|
875
872
|
asChild = false,
|
|
876
873
|
onClick,
|
|
877
|
-
argo = false,
|
|
878
874
|
variant = "primary",
|
|
879
875
|
size = "medium",
|
|
880
876
|
block = false,
|
|
881
877
|
...buttonProps
|
|
882
878
|
}) => {
|
|
883
879
|
const isLegacy = useIsLegacyBrand();
|
|
884
|
-
const renderArgo = !isLegacy
|
|
880
|
+
const renderArgo = !isLegacy;
|
|
885
881
|
const Comp = asChild ? reactSlot.Root : "button";
|
|
886
882
|
const isIconOnly = String(size).startsWith("icon");
|
|
887
883
|
const classNames = renderArgo ? argoVariants({ variant, size, block, className }) : variants({ size, variant, block, className });
|
|
@@ -1204,17 +1200,8 @@ var init_ZoomableSvg = __esm({
|
|
|
1204
1200
|
className: "tw-absolute tw-right-1 tw-top-1 tw-flex tw-gap-1 tw-opacity-0 tw-transition-opacity group-hover/zoom:tw-opacity-100",
|
|
1205
1201
|
onClick: stopPropagation,
|
|
1206
1202
|
children: [
|
|
1207
|
-
isZoomed && /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { tooltip: "Reset zoom", placement: "top", triggerAsChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "small", variant: "outline", onClick: handleReset,
|
|
1208
|
-
copyText && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1209
|
-
ClipboardButton,
|
|
1210
|
-
{
|
|
1211
|
-
text: copyText,
|
|
1212
|
-
tooltip: "Copy code",
|
|
1213
|
-
size: "icon-sm",
|
|
1214
|
-
variant: "outline",
|
|
1215
|
-
argo: true
|
|
1216
|
-
}
|
|
1217
|
-
),
|
|
1203
|
+
isZoomed && /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { tooltip: "Reset zoom", placement: "top", triggerAsChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "small", variant: "outline", onClick: handleReset, children: "Reset" }) }),
|
|
1204
|
+
copyText && /* @__PURE__ */ jsxRuntime.jsx(ClipboardButton, { text: copyText, tooltip: "Copy code", size: "icon-sm", variant: "outline" }),
|
|
1218
1205
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1219
1206
|
Tooltip,
|
|
1220
1207
|
{
|
|
@@ -1228,7 +1215,6 @@ var init_ZoomableSvg = __esm({
|
|
|
1228
1215
|
variant: "outline",
|
|
1229
1216
|
"aria-label": isFullscreen ? "Exit fullscreen" : "Fullscreen",
|
|
1230
1217
|
onClick: () => setIsFullscreen((f) => !f),
|
|
1231
|
-
argo: true,
|
|
1232
1218
|
children: isFullscreen ? /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Minimize2, { className: "tw-size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Maximize2, { className: "tw-size-4" })
|
|
1233
1219
|
}
|
|
1234
1220
|
)
|
|
@@ -1873,11 +1859,10 @@ var ToastRoot = ({
|
|
|
1873
1859
|
duration = Infinity,
|
|
1874
1860
|
variant = "info",
|
|
1875
1861
|
loading = false,
|
|
1876
|
-
icon: iconProp
|
|
1877
|
-
argo
|
|
1862
|
+
icon: iconProp
|
|
1878
1863
|
}) => {
|
|
1879
1864
|
const isLegacy = useIsLegacyBrand();
|
|
1880
|
-
const renderArgo = !isLegacy
|
|
1865
|
+
const renderArgo = !isLegacy;
|
|
1881
1866
|
const icon = (() => {
|
|
1882
1867
|
if (loading) return /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Loader2, { className: "tw-animate-spin" });
|
|
1883
1868
|
if (iconProp) return iconProp;
|
|
@@ -2216,9 +2201,7 @@ var CUSTOM_TRANSFORMERS = [
|
|
|
2216
2201
|
MERMAID,
|
|
2217
2202
|
...markdown.TRANSFORMERS
|
|
2218
2203
|
];
|
|
2219
|
-
var SINGLE_LINE_TRANSFORMERS =
|
|
2220
|
-
(t) => t.type === "text-format" || t.type === "text-match"
|
|
2221
|
-
);
|
|
2204
|
+
var SINGLE_LINE_TRANSFORMERS = [];
|
|
2222
2205
|
var TABLE_FENCE_LANG = "__kbc_table__";
|
|
2223
2206
|
var isTableLine = (line) => {
|
|
2224
2207
|
const trimmed = line.trim();
|
|
@@ -2265,6 +2248,7 @@ var postprocessMarkdown = (markdown) => {
|
|
|
2265
2248
|
const regex = new RegExp(`\`\`\`${TABLE_FENCE_LANG}\\n([\\s\\S]*?)\\n\`\`\``, "g");
|
|
2266
2249
|
return markdown.replace(regex, "$1");
|
|
2267
2250
|
};
|
|
2251
|
+
var unescapeMarkdownText = (markdown) => markdown.replace(/\\([*_`~\\])/g, "$1");
|
|
2268
2252
|
|
|
2269
2253
|
// src/components/MarkdownEditor/plugins/MarkdownSyncPlugin.tsx
|
|
2270
2254
|
var IMPORT_TAG = "markdown-import";
|
|
@@ -2272,7 +2256,8 @@ var MarkdownSyncPlugin = ({
|
|
|
2272
2256
|
value,
|
|
2273
2257
|
editable,
|
|
2274
2258
|
onChange,
|
|
2275
|
-
transformers = CUSTOM_TRANSFORMERS
|
|
2259
|
+
transformers = CUSTOM_TRANSFORMERS,
|
|
2260
|
+
singleLine = false
|
|
2276
2261
|
}) => {
|
|
2277
2262
|
const [editor] = LexicalComposerContext.useLexicalComposerContext();
|
|
2278
2263
|
const lastExportedRef = react.useRef(value);
|
|
@@ -2280,6 +2265,8 @@ var MarkdownSyncPlugin = ({
|
|
|
2280
2265
|
onChangeRef.current = onChange;
|
|
2281
2266
|
const transformersRef = react.useRef(transformers);
|
|
2282
2267
|
transformersRef.current = transformers;
|
|
2268
|
+
const singleLineRef = react.useRef(singleLine);
|
|
2269
|
+
singleLineRef.current = singleLine;
|
|
2283
2270
|
react.useEffect(() => {
|
|
2284
2271
|
editor.setEditable(editable);
|
|
2285
2272
|
}, [editor, editable]);
|
|
@@ -2298,7 +2285,7 @@ var MarkdownSyncPlugin = ({
|
|
|
2298
2285
|
if (tags.has(IMPORT_TAG)) return;
|
|
2299
2286
|
editor.getEditorState().read(() => {
|
|
2300
2287
|
const raw = markdown.$convertToMarkdownString(transformersRef.current);
|
|
2301
|
-
const markdown$1 = postprocessMarkdown(raw);
|
|
2288
|
+
const markdown$1 = singleLineRef.current ? unescapeMarkdownText(raw) : postprocessMarkdown(raw);
|
|
2302
2289
|
if (markdown$1 !== lastExportedRef.current) {
|
|
2303
2290
|
lastExportedRef.current = markdown$1;
|
|
2304
2291
|
onChangeRef.current?.(markdown$1);
|
|
@@ -2884,11 +2871,10 @@ var DropdownMenuTrigger = ({
|
|
|
2884
2871
|
var DropdownMenu = ({
|
|
2885
2872
|
// change a default value to false, for modal property, as it is not used in most cases
|
|
2886
2873
|
modal = false,
|
|
2887
|
-
variant,
|
|
2888
2874
|
...props
|
|
2889
2875
|
}) => {
|
|
2890
2876
|
const isLegacy = useIsLegacyBrand();
|
|
2891
|
-
const effectiveVariant = !isLegacy
|
|
2877
|
+
const effectiveVariant = !isLegacy ? "argo" : "default";
|
|
2892
2878
|
const contextValue = react.useMemo(() => ({ variant: effectiveVariant }), [effectiveVariant]);
|
|
2893
2879
|
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuContext, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive3.Root, { ...props, modal }) });
|
|
2894
2880
|
};
|
|
@@ -3196,7 +3182,6 @@ var InputGroupButton = ({
|
|
|
3196
3182
|
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3197
3183
|
Button,
|
|
3198
3184
|
{
|
|
3199
|
-
argo: true,
|
|
3200
3185
|
...props,
|
|
3201
3186
|
tabIndex,
|
|
3202
3187
|
ref,
|
|
@@ -3494,7 +3479,7 @@ var InputGroupRoot = ({
|
|
|
3494
3479
|
...props
|
|
3495
3480
|
}) => {
|
|
3496
3481
|
const isLegacy = useIsLegacyBrand();
|
|
3497
|
-
const effectiveVariant = !isLegacy
|
|
3482
|
+
const effectiveVariant = !isLegacy ? "argo" : variant;
|
|
3498
3483
|
const effectiveSizing = effectiveVariant === "argo" ? "medium" : sizing;
|
|
3499
3484
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3500
3485
|
"div",
|
|
@@ -4512,10 +4497,10 @@ var MarkdownEditor = ({
|
|
|
4512
4497
|
// adjacent-sibling selector for paragraph spacing so single-paragraph blocks (titles,
|
|
4513
4498
|
// short descriptions) stay tight while multi-paragraph blocks still breathe.
|
|
4514
4499
|
compact && "[&_p]:tw-m-0 [&_p+p]:tw-mt-2",
|
|
4515
|
-
// Display-state clamp: 2 lines
|
|
4516
|
-
//
|
|
4517
|
-
//
|
|
4518
|
-
clampDisplay && "[&:not(:focus-within)]:tw-line-clamp-2
|
|
4500
|
+
// Display-state clamp: 2 lines, dropped in focus-within so editing expands to full
|
|
4501
|
+
// height. line-clamp is self-gating (no effect below 3 lines), so short/empty content
|
|
4502
|
+
// renders clean; a CSS fade can't gate on overflow without JS, so it's omitted.
|
|
4503
|
+
clampDisplay && "[&:not(:focus-within)]:tw-line-clamp-2",
|
|
4519
4504
|
className
|
|
4520
4505
|
),
|
|
4521
4506
|
onBlur: handleBlur,
|
|
@@ -4572,7 +4557,8 @@ var MarkdownEditor = ({
|
|
|
4572
4557
|
value,
|
|
4573
4558
|
editable,
|
|
4574
4559
|
onChange,
|
|
4575
|
-
transformers
|
|
4560
|
+
transformers,
|
|
4561
|
+
singleLine
|
|
4576
4562
|
}
|
|
4577
4563
|
),
|
|
4578
4564
|
/* @__PURE__ */ jsxRuntime.jsx(ImagePastePlugin, { onImageUpload }),
|