@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
|
@@ -57,9 +57,10 @@ type MarkdownEditorProps = {
|
|
|
57
57
|
*/
|
|
58
58
|
singleLine?: boolean;
|
|
59
59
|
/**
|
|
60
|
-
* Clamps content to
|
|
61
|
-
* focus expands the editor to full height (no clamp).
|
|
62
|
-
*
|
|
60
|
+
* Clamps content to 2 lines (truncating with an ellipsis) in the display (not-focused)
|
|
61
|
+
* state; focus expands the editor to full height (no clamp). `line-clamp` is self-gating,
|
|
62
|
+
* so short/empty content renders fully with no truncation. Per the inline-editable-text
|
|
63
|
+
* pattern spec for description-style slots.
|
|
63
64
|
*/
|
|
64
65
|
clampDisplay?: boolean;
|
|
65
66
|
/**
|
|
@@ -57,9 +57,10 @@ type MarkdownEditorProps = {
|
|
|
57
57
|
*/
|
|
58
58
|
singleLine?: boolean;
|
|
59
59
|
/**
|
|
60
|
-
* Clamps content to
|
|
61
|
-
* focus expands the editor to full height (no clamp).
|
|
62
|
-
*
|
|
60
|
+
* Clamps content to 2 lines (truncating with an ellipsis) in the display (not-focused)
|
|
61
|
+
* state; focus expands the editor to full height (no clamp). `line-clamp` is self-gating,
|
|
62
|
+
* so short/empty content renders fully with no truncation. Per the inline-editable-text
|
|
63
|
+
* pattern spec for description-style slots.
|
|
63
64
|
*/
|
|
64
65
|
clampDisplay?: boolean;
|
|
65
66
|
/**
|
package/dist/markdown-editor.js
CHANGED
|
@@ -216,7 +216,6 @@ var init_TooltipContent = __esm({
|
|
|
216
216
|
TooltipContent = ({
|
|
217
217
|
className,
|
|
218
218
|
variant,
|
|
219
|
-
argo,
|
|
220
219
|
keepOpenOnPointerDownOutside = false,
|
|
221
220
|
children,
|
|
222
221
|
onPointerDownOutside,
|
|
@@ -227,7 +226,7 @@ var init_TooltipContent = __esm({
|
|
|
227
226
|
...rest
|
|
228
227
|
}) => {
|
|
229
228
|
const isLegacy = useIsLegacyBrand();
|
|
230
|
-
const renderArgo = !isLegacy
|
|
229
|
+
const renderArgo = !isLegacy;
|
|
231
230
|
const handlePointerDownOutside = (event) => {
|
|
232
231
|
if (keepOpenOnPointerDownOutside) event.preventDefault();
|
|
233
232
|
onPointerDownOutside?.(event);
|
|
@@ -316,7 +315,6 @@ var init_Tooltip = __esm({
|
|
|
316
315
|
className,
|
|
317
316
|
keepOpenOnTriggerClick = false,
|
|
318
317
|
variant,
|
|
319
|
-
argo,
|
|
320
318
|
placement = "right",
|
|
321
319
|
forceHide = false,
|
|
322
320
|
forceShow = false,
|
|
@@ -355,7 +353,6 @@ var init_Tooltip = __esm({
|
|
|
355
353
|
{
|
|
356
354
|
className,
|
|
357
355
|
variant: resolvedVariant,
|
|
358
|
-
argo,
|
|
359
356
|
placement,
|
|
360
357
|
keepOpenOnPointerDownOutside: keepOpenOnTriggerClick,
|
|
361
358
|
children: tooltip
|
|
@@ -845,14 +842,13 @@ var init_Button = __esm({
|
|
|
845
842
|
isLoading = false,
|
|
846
843
|
asChild = false,
|
|
847
844
|
onClick,
|
|
848
|
-
argo = false,
|
|
849
845
|
variant = "primary",
|
|
850
846
|
size = "medium",
|
|
851
847
|
block = false,
|
|
852
848
|
...buttonProps
|
|
853
849
|
}) => {
|
|
854
850
|
const isLegacy = useIsLegacyBrand();
|
|
855
|
-
const renderArgo = !isLegacy
|
|
851
|
+
const renderArgo = !isLegacy;
|
|
856
852
|
const Comp = asChild ? Root$2 : "button";
|
|
857
853
|
const isIconOnly = String(size).startsWith("icon");
|
|
858
854
|
const classNames = renderArgo ? argoVariants({ variant, size, block, className }) : variants({ size, variant, block, className });
|
|
@@ -1175,17 +1171,8 @@ var init_ZoomableSvg = __esm({
|
|
|
1175
1171
|
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",
|
|
1176
1172
|
onClick: stopPropagation,
|
|
1177
1173
|
children: [
|
|
1178
|
-
isZoomed && /* @__PURE__ */ jsx(Tooltip, { tooltip: "Reset zoom", placement: "top", triggerAsChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "outline", onClick: handleReset,
|
|
1179
|
-
copyText && /* @__PURE__ */ jsx(
|
|
1180
|
-
ClipboardButton,
|
|
1181
|
-
{
|
|
1182
|
-
text: copyText,
|
|
1183
|
-
tooltip: "Copy code",
|
|
1184
|
-
size: "icon-sm",
|
|
1185
|
-
variant: "outline",
|
|
1186
|
-
argo: true
|
|
1187
|
-
}
|
|
1188
|
-
),
|
|
1174
|
+
isZoomed && /* @__PURE__ */ jsx(Tooltip, { tooltip: "Reset zoom", placement: "top", triggerAsChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "outline", onClick: handleReset, children: "Reset" }) }),
|
|
1175
|
+
copyText && /* @__PURE__ */ jsx(ClipboardButton, { text: copyText, tooltip: "Copy code", size: "icon-sm", variant: "outline" }),
|
|
1189
1176
|
/* @__PURE__ */ jsx(
|
|
1190
1177
|
Tooltip,
|
|
1191
1178
|
{
|
|
@@ -1199,7 +1186,6 @@ var init_ZoomableSvg = __esm({
|
|
|
1199
1186
|
variant: "outline",
|
|
1200
1187
|
"aria-label": isFullscreen ? "Exit fullscreen" : "Fullscreen",
|
|
1201
1188
|
onClick: () => setIsFullscreen((f) => !f),
|
|
1202
|
-
argo: true,
|
|
1203
1189
|
children: isFullscreen ? /* @__PURE__ */ jsx(icons_exports.Minimize2, { className: "tw-size-4" }) : /* @__PURE__ */ jsx(icons_exports.Maximize2, { className: "tw-size-4" })
|
|
1204
1190
|
}
|
|
1205
1191
|
)
|
|
@@ -1844,11 +1830,10 @@ var ToastRoot = ({
|
|
|
1844
1830
|
duration = Infinity,
|
|
1845
1831
|
variant = "info",
|
|
1846
1832
|
loading = false,
|
|
1847
|
-
icon: iconProp
|
|
1848
|
-
argo
|
|
1833
|
+
icon: iconProp
|
|
1849
1834
|
}) => {
|
|
1850
1835
|
const isLegacy = useIsLegacyBrand();
|
|
1851
|
-
const renderArgo = !isLegacy
|
|
1836
|
+
const renderArgo = !isLegacy;
|
|
1852
1837
|
const icon = (() => {
|
|
1853
1838
|
if (loading) return /* @__PURE__ */ jsx(icons_exports.Loader2, { className: "tw-animate-spin" });
|
|
1854
1839
|
if (iconProp) return iconProp;
|
|
@@ -2187,9 +2172,7 @@ var CUSTOM_TRANSFORMERS = [
|
|
|
2187
2172
|
MERMAID,
|
|
2188
2173
|
...TRANSFORMERS
|
|
2189
2174
|
];
|
|
2190
|
-
var SINGLE_LINE_TRANSFORMERS =
|
|
2191
|
-
(t) => t.type === "text-format" || t.type === "text-match"
|
|
2192
|
-
);
|
|
2175
|
+
var SINGLE_LINE_TRANSFORMERS = [];
|
|
2193
2176
|
var TABLE_FENCE_LANG = "__kbc_table__";
|
|
2194
2177
|
var isTableLine = (line) => {
|
|
2195
2178
|
const trimmed = line.trim();
|
|
@@ -2236,6 +2219,7 @@ var postprocessMarkdown = (markdown) => {
|
|
|
2236
2219
|
const regex = new RegExp(`\`\`\`${TABLE_FENCE_LANG}\\n([\\s\\S]*?)\\n\`\`\``, "g");
|
|
2237
2220
|
return markdown.replace(regex, "$1");
|
|
2238
2221
|
};
|
|
2222
|
+
var unescapeMarkdownText = (markdown) => markdown.replace(/\\([*_`~\\])/g, "$1");
|
|
2239
2223
|
|
|
2240
2224
|
// src/components/MarkdownEditor/plugins/MarkdownSyncPlugin.tsx
|
|
2241
2225
|
var IMPORT_TAG = "markdown-import";
|
|
@@ -2243,7 +2227,8 @@ var MarkdownSyncPlugin = ({
|
|
|
2243
2227
|
value,
|
|
2244
2228
|
editable,
|
|
2245
2229
|
onChange,
|
|
2246
|
-
transformers = CUSTOM_TRANSFORMERS
|
|
2230
|
+
transformers = CUSTOM_TRANSFORMERS,
|
|
2231
|
+
singleLine = false
|
|
2247
2232
|
}) => {
|
|
2248
2233
|
const [editor] = useLexicalComposerContext();
|
|
2249
2234
|
const lastExportedRef = useRef(value);
|
|
@@ -2251,6 +2236,8 @@ var MarkdownSyncPlugin = ({
|
|
|
2251
2236
|
onChangeRef.current = onChange;
|
|
2252
2237
|
const transformersRef = useRef(transformers);
|
|
2253
2238
|
transformersRef.current = transformers;
|
|
2239
|
+
const singleLineRef = useRef(singleLine);
|
|
2240
|
+
singleLineRef.current = singleLine;
|
|
2254
2241
|
useEffect(() => {
|
|
2255
2242
|
editor.setEditable(editable);
|
|
2256
2243
|
}, [editor, editable]);
|
|
@@ -2269,7 +2256,7 @@ var MarkdownSyncPlugin = ({
|
|
|
2269
2256
|
if (tags.has(IMPORT_TAG)) return;
|
|
2270
2257
|
editor.getEditorState().read(() => {
|
|
2271
2258
|
const raw = $convertToMarkdownString(transformersRef.current);
|
|
2272
|
-
const markdown = postprocessMarkdown(raw);
|
|
2259
|
+
const markdown = singleLineRef.current ? unescapeMarkdownText(raw) : postprocessMarkdown(raw);
|
|
2273
2260
|
if (markdown !== lastExportedRef.current) {
|
|
2274
2261
|
lastExportedRef.current = markdown;
|
|
2275
2262
|
onChangeRef.current?.(markdown);
|
|
@@ -2855,11 +2842,10 @@ var DropdownMenuTrigger = ({
|
|
|
2855
2842
|
var DropdownMenu = ({
|
|
2856
2843
|
// change a default value to false, for modal property, as it is not used in most cases
|
|
2857
2844
|
modal = false,
|
|
2858
|
-
variant,
|
|
2859
2845
|
...props
|
|
2860
2846
|
}) => {
|
|
2861
2847
|
const isLegacy = useIsLegacyBrand();
|
|
2862
|
-
const effectiveVariant = !isLegacy
|
|
2848
|
+
const effectiveVariant = !isLegacy ? "argo" : "default";
|
|
2863
2849
|
const contextValue = useMemo(() => ({ variant: effectiveVariant }), [effectiveVariant]);
|
|
2864
2850
|
return /* @__PURE__ */ jsx(DropdownMenuContext, { value: contextValue, children: /* @__PURE__ */ jsx(Root$1, { ...props, modal }) });
|
|
2865
2851
|
};
|
|
@@ -3167,7 +3153,6 @@ var InputGroupButton = ({
|
|
|
3167
3153
|
}) => /* @__PURE__ */ jsx(
|
|
3168
3154
|
Button,
|
|
3169
3155
|
{
|
|
3170
|
-
argo: true,
|
|
3171
3156
|
...props,
|
|
3172
3157
|
tabIndex,
|
|
3173
3158
|
ref,
|
|
@@ -3465,7 +3450,7 @@ var InputGroupRoot = ({
|
|
|
3465
3450
|
...props
|
|
3466
3451
|
}) => {
|
|
3467
3452
|
const isLegacy = useIsLegacyBrand();
|
|
3468
|
-
const effectiveVariant = !isLegacy
|
|
3453
|
+
const effectiveVariant = !isLegacy ? "argo" : variant;
|
|
3469
3454
|
const effectiveSizing = effectiveVariant === "argo" ? "medium" : sizing;
|
|
3470
3455
|
return /* @__PURE__ */ jsx(
|
|
3471
3456
|
"div",
|
|
@@ -4483,10 +4468,10 @@ var MarkdownEditor = ({
|
|
|
4483
4468
|
// adjacent-sibling selector for paragraph spacing so single-paragraph blocks (titles,
|
|
4484
4469
|
// short descriptions) stay tight while multi-paragraph blocks still breathe.
|
|
4485
4470
|
compact && "[&_p]:tw-m-0 [&_p+p]:tw-mt-2",
|
|
4486
|
-
// Display-state clamp: 2 lines
|
|
4487
|
-
//
|
|
4488
|
-
//
|
|
4489
|
-
clampDisplay && "[&:not(:focus-within)]:tw-line-clamp-2
|
|
4471
|
+
// Display-state clamp: 2 lines, dropped in focus-within so editing expands to full
|
|
4472
|
+
// height. line-clamp is self-gating (no effect below 3 lines), so short/empty content
|
|
4473
|
+
// renders clean; a CSS fade can't gate on overflow without JS, so it's omitted.
|
|
4474
|
+
clampDisplay && "[&:not(:focus-within)]:tw-line-clamp-2",
|
|
4490
4475
|
className
|
|
4491
4476
|
),
|
|
4492
4477
|
onBlur: handleBlur,
|
|
@@ -4543,7 +4528,8 @@ var MarkdownEditor = ({
|
|
|
4543
4528
|
value,
|
|
4544
4529
|
editable,
|
|
4545
4530
|
onChange,
|
|
4546
|
-
transformers
|
|
4531
|
+
transformers,
|
|
4532
|
+
singleLine
|
|
4547
4533
|
}
|
|
4548
4534
|
),
|
|
4549
4535
|
/* @__PURE__ */ jsx(ImagePastePlugin, { onImageUpload }),
|