@keboola/design 2.1.0 → 3.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/README.md +8 -5
- package/dist/icons.cjs +13 -737
- package/dist/icons.cjs.map +1 -1
- package/dist/icons.d.cts +2 -1
- package/dist/icons.d.ts +2 -1
- package/dist/icons.js +8 -2
- package/dist/icons.js.map +1 -1
- package/dist/index.cjs +13144 -12282
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4824 -4546
- package/dist/index.d.ts +4824 -4546
- package/dist/index.js +13010 -12179
- package/dist/index.js.map +1 -1
- package/dist/markdown-editor.cjs +120 -53
- package/dist/markdown-editor.cjs.map +1 -1
- package/dist/markdown-editor.js +120 -54
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.cjs +67 -5
- package/dist/mermaid.cjs.map +1 -1
- package/dist/mermaid.js +50 -7
- package/dist/mermaid.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/testing.cjs +106 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +19 -0
- package/dist/testing.d.ts +19 -0
- package/dist/testing.js +104 -0
- package/dist/testing.js.map +1 -0
- package/package.json +24 -15
- package/dist/icon-names.cjs +0 -18
- package/dist/icon-names.cjs.map +0 -1
- package/dist/icon-names.d.cts +0 -7
- package/dist/icon-names.d.ts +0 -7
- package/dist/icon-names.js +0 -16
- package/dist/icon-names.js.map +0 -1
package/dist/markdown-editor.cjs
CHANGED
|
@@ -6,7 +6,7 @@ var reactTooltip = require('@radix-ui/react-tooltip');
|
|
|
6
6
|
var classVarianceAuthority = require('class-variance-authority');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
8
|
var react = require('react');
|
|
9
|
-
var
|
|
9
|
+
var lucide_react_star = require('lucide-react');
|
|
10
10
|
var reactSlot = require('@radix-ui/react-slot');
|
|
11
11
|
var beautifulMermaid = require('beautiful-mermaid');
|
|
12
12
|
var colors = require('@keboola/tailwind-config/colors');
|
|
@@ -32,7 +32,6 @@ var richText = require('@lexical/rich-text');
|
|
|
32
32
|
var lexical = require('lexical');
|
|
33
33
|
var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
|
|
34
34
|
var sonner = require('sonner');
|
|
35
|
-
var reactFontawesome = require('@fortawesome/react-fontawesome');
|
|
36
35
|
var reactDom = require('react-dom');
|
|
37
36
|
var utils = require('@lexical/utils');
|
|
38
37
|
var DropdownMenuPrimitive3 = require('@radix-ui/react-dropdown-menu');
|
|
@@ -60,6 +59,7 @@ function _interopNamespace(e) {
|
|
|
60
59
|
return Object.freeze(n);
|
|
61
60
|
}
|
|
62
61
|
|
|
62
|
+
var lucide_react_star__namespace = /*#__PURE__*/_interopNamespace(lucide_react_star);
|
|
63
63
|
var colors__default = /*#__PURE__*/_interopDefault(colors);
|
|
64
64
|
var DropdownMenuPrimitive3__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive3);
|
|
65
65
|
var ScrollAreaPrimitive2__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive2);
|
|
@@ -67,7 +67,9 @@ var TextareaAutosize__default = /*#__PURE__*/_interopDefault(TextareaAutosize);
|
|
|
67
67
|
var RLabel__namespace = /*#__PURE__*/_interopNamespace(RLabel);
|
|
68
68
|
|
|
69
69
|
var __defProp = Object.defineProperty;
|
|
70
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
70
71
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
72
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
71
73
|
var __esm = (fn, res) => function __init() {
|
|
72
74
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
73
75
|
};
|
|
@@ -75,6 +77,15 @@ var __export = (target, all) => {
|
|
|
75
77
|
for (var name in all)
|
|
76
78
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
77
79
|
};
|
|
80
|
+
var __copyProps = (to, from, except, desc) => {
|
|
81
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
82
|
+
for (let key of __getOwnPropNames(from))
|
|
83
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
84
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
85
|
+
}
|
|
86
|
+
return to;
|
|
87
|
+
};
|
|
88
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget);
|
|
78
89
|
var twMerge, cn;
|
|
79
90
|
var init_classNames = __esm({
|
|
80
91
|
"src/utils/classNames.ts"() {
|
|
@@ -411,6 +422,28 @@ var init_isMac = __esm({
|
|
|
411
422
|
getIsMac();
|
|
412
423
|
}
|
|
413
424
|
});
|
|
425
|
+
|
|
426
|
+
// src/utils/legacyIcon.tsx
|
|
427
|
+
var isFAIconValue, registeredRenderer, warnedOnce, renderLegacyIcon;
|
|
428
|
+
var init_legacyIcon = __esm({
|
|
429
|
+
"src/utils/legacyIcon.tsx"() {
|
|
430
|
+
isFAIconValue = (value) => typeof value === "string" || Array.isArray(value) && value.length === 2 && typeof value[0] === "string" && typeof value[1] === "string";
|
|
431
|
+
registeredRenderer = null;
|
|
432
|
+
warnedOnce = false;
|
|
433
|
+
renderLegacyIcon = (value) => {
|
|
434
|
+
if (!isFAIconValue(value)) return value;
|
|
435
|
+
if (registeredRenderer) return registeredRenderer(value);
|
|
436
|
+
if (!warnedOnce) {
|
|
437
|
+
warnedOnce = true;
|
|
438
|
+
console.warn(
|
|
439
|
+
"[@keboola/design] renderLegacyIcon received a legacy FontAwesome icon value but no renderer is registered. Call setLegacyIconRenderer at app boot. Returning null.",
|
|
440
|
+
value
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
return null;
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
});
|
|
414
447
|
var init_useSHA256 = __esm({
|
|
415
448
|
"src/utils/useSHA256.ts"() {
|
|
416
449
|
}
|
|
@@ -477,8 +510,42 @@ var init_Skeleton = __esm({
|
|
|
477
510
|
};
|
|
478
511
|
}
|
|
479
512
|
});
|
|
513
|
+
var Keboola;
|
|
514
|
+
var init_Keboola = __esm({
|
|
515
|
+
"src/icons/Keboola.tsx"() {
|
|
516
|
+
init_utils();
|
|
517
|
+
Keboola = react.forwardRef(
|
|
518
|
+
({ size = 24, color = "currentColor", className, children, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
519
|
+
"svg",
|
|
520
|
+
{
|
|
521
|
+
ref,
|
|
522
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
523
|
+
width: size,
|
|
524
|
+
height: size,
|
|
525
|
+
viewBox: "0 0 300 512",
|
|
526
|
+
fill: color,
|
|
527
|
+
className: cn("lucide", className),
|
|
528
|
+
...rest,
|
|
529
|
+
children: [
|
|
530
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M152 320C79.7 320 24.5 233.9 24.5 124.7C24.5 15.6 70.5 0 152 0s123.6 15.6 123.6 124.7C275.5 233.9 217.7 320 152 320zm-8.7-50.5c0-11.2-9.5-20.3-21.2-20.3s-21.2 9.1-21.2 20.3c0 11.2 9.5 20.3 21.2 20.3s21.2-9.1 21.2-20.3zm55.7 0c0-11.2-9.5-20.3-21.2-20.3s-21.2 9.1-21.2 20.3c0 11.2 9.5 20.3 21.2 20.3s21.2-9.1 21.2-20.3zm68.9 115.1c10.2 9.3 20.2 20.5 29 35c5.9 9.7 2.6 22.1-7.5 27.8c-3.4 1.9-7.1 2.8-10.7 2.8c-7.2 0-14.3-3.6-18.3-10c-6.8-11.1-13.8-18.9-21.7-26.1c-7.3-6.7-15.6-12.7-24.9-19.5c-.7-.5-1.4-1-2.1-1.5c-5-3.6-10-6.8-14.9-9.4c.6 1 1.2 2.1 1.8 3.2c14.4 26.4 29.2 63.1 29.2 104.9c0 11.2-9.5 20.3-21.2 20.3c-11.7 0-21.2-9.1-21.2-20.3c.1-31.8-11.6-62.3-23.8-84.9c-4-7.4-8-13.9-11.6-19.3c-3.4 5.2-7.2 11.3-11 18.3c-12.5 22.7-24.5 53.8-24.4 86c0 11.2-9.5 20.3-21.2 20.3s-21.2-9.1-21.2-20.3c.1-41.8 14.9-78.4 29.2-104.9c.6-1.1 1.2-2.1 1.8-3.2c-5 2.7-9.9 5.8-14.9 9.4c-.6 .5-1.3 .9-1.9 1.4c-9.5 6.9-17.8 12.9-25.1 19.7c-7.9 7.2-14.9 15.1-21.7 26.1c-5.9 9.7-18.9 12.9-29 7.2C.5 441.8-2.9 429.3 3.1 419.7c8.9-14.4 18.8-25.7 29-35c9.2-8.4 18.5-15.1 27.6-21.7c1-.7 2-1.4 3-2.2c4.7-3.5 9.6-6.7 14.6-9.6c-5-2.9-9.8-6.1-14.6-9.6C39.8 325 19.9 302.5 3.1 275.1c-5.9-9.7-2.6-22.1 7.5-27.8c10.1-5.7 23.1-2.5 29 7.2c14.6 23.7 31.1 42 48.7 54.9c18.9 13.7 37.4 20.5 56.5 21.5c1.7-.1 3.5-.1 5.2-.1c1.8 0 3.5 .1 5.2 .1c0 0 0 0 0 0c19.1-1.1 37.6-7.9 56.5-21.5c17.6-12.8 34.2-31.2 48.7-54.9c6-9.7 18.9-12.9 29-7.2c10.1 5.7 13.4 18.1 7.5 27.8c-16.8 27.4-36.7 49.9-59.6 66.6c-4.7 3.5-9.6 6.7-14.5 9.6c4.9 2.9 9.8 6.1 14.5 9.6c.9 .7 1.8 1.3 2.7 2c9.2 6.7 18.5 13.5 27.9 22z" }),
|
|
531
|
+
children
|
|
532
|
+
]
|
|
533
|
+
}
|
|
534
|
+
)
|
|
535
|
+
);
|
|
536
|
+
Keboola.displayName = "Keboola";
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
// src/icons/index.ts
|
|
541
|
+
var icons_exports = {};
|
|
542
|
+
__export(icons_exports, {
|
|
543
|
+
Keboola: () => Keboola
|
|
544
|
+
});
|
|
480
545
|
var init_icons = __esm({
|
|
481
546
|
"src/icons/index.ts"() {
|
|
547
|
+
__reExport(icons_exports, lucide_react_star__namespace);
|
|
548
|
+
init_Keboola();
|
|
482
549
|
}
|
|
483
550
|
});
|
|
484
551
|
var variants, argoVariants;
|
|
@@ -810,7 +877,7 @@ var init_Button = __esm({
|
|
|
810
877
|
onClick: handleClick,
|
|
811
878
|
className: cn(classNames),
|
|
812
879
|
children: [
|
|
813
|
-
isLoading && /* @__PURE__ */ jsxRuntime.jsx(
|
|
880
|
+
isLoading && /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Loader2, { className: "tw-size-4 tw-shrink-0 tw-animate-spin" }),
|
|
814
881
|
/* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slottable, { children: isLoading && isIconOnly ? null : children })
|
|
815
882
|
]
|
|
816
883
|
}
|
|
@@ -833,7 +900,7 @@ var init_ButtonInline = __esm({
|
|
|
833
900
|
"disabled:tw-no-underline",
|
|
834
901
|
"[&_svg]:disabled:tw-text-neutral-400",
|
|
835
902
|
// Default size for nested Lucide icons; callers can override on the icon.
|
|
836
|
-
"[&_svg:not([class*='tw-size-'])]:tw-size-4",
|
|
903
|
+
"[&_svg.lucide:not([class*='tw-size-'])]:tw-size-4",
|
|
837
904
|
"[&_svg]:tw-shrink-0"
|
|
838
905
|
],
|
|
839
906
|
{
|
|
@@ -954,7 +1021,7 @@ var init_ClipboardButton = __esm({
|
|
|
954
1021
|
init_Button2();
|
|
955
1022
|
init_Clipboard2();
|
|
956
1023
|
init_icons();
|
|
957
|
-
DEFAULT_ICON = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1024
|
+
DEFAULT_ICON = /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Copy, {});
|
|
958
1025
|
ClipboardButton = ({
|
|
959
1026
|
// clipboard props
|
|
960
1027
|
text,
|
|
@@ -1133,7 +1200,7 @@ var init_ZoomableSvg = __esm({
|
|
|
1133
1200
|
"aria-label": isFullscreen ? "Exit fullscreen" : "Fullscreen",
|
|
1134
1201
|
onClick: () => setIsFullscreen((f) => !f),
|
|
1135
1202
|
argo: true,
|
|
1136
|
-
children: isFullscreen ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1203
|
+
children: isFullscreen ? /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Minimize2, { className: "tw-size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Maximize2, { className: "tw-size-4" })
|
|
1137
1204
|
}
|
|
1138
1205
|
)
|
|
1139
1206
|
}
|
|
@@ -1576,9 +1643,7 @@ init_utils();
|
|
|
1576
1643
|
// src/components/Toast/ToastRoot.tsx
|
|
1577
1644
|
init_icons();
|
|
1578
1645
|
init_utils();
|
|
1579
|
-
|
|
1580
|
-
var isFAIconValue = (value) => typeof value === "string" || Array.isArray(value) && value.length === 2 && typeof value[0] === "string" && typeof value[1] === "string";
|
|
1581
|
-
var renderLegacyIcon = (value) => isFAIconValue(value) ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: value }) : value;
|
|
1646
|
+
init_legacyIcon();
|
|
1582
1647
|
|
|
1583
1648
|
// src/components/Toast/ToastAction.tsx
|
|
1584
1649
|
init_utils();
|
|
@@ -1668,7 +1733,7 @@ var ToastDismiss = ({
|
|
|
1668
1733
|
type: "button",
|
|
1669
1734
|
...rest,
|
|
1670
1735
|
children: [
|
|
1671
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1736
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons_exports.X, {}),
|
|
1672
1737
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-sr-only", children: "Dismiss" })
|
|
1673
1738
|
]
|
|
1674
1739
|
}
|
|
@@ -1776,10 +1841,10 @@ var variants2 = classVarianceAuthority.cva(
|
|
|
1776
1841
|
}
|
|
1777
1842
|
);
|
|
1778
1843
|
var DEFAULT_VARIANT_ICON = {
|
|
1779
|
-
error: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1780
|
-
info: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1781
|
-
success: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1782
|
-
warning: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1844
|
+
error: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.AlertTriangle, {}),
|
|
1845
|
+
info: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Info, {}),
|
|
1846
|
+
success: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.CircleCheck, {}),
|
|
1847
|
+
warning: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.AlertCircle, {})
|
|
1783
1848
|
};
|
|
1784
1849
|
var ToastRoot = ({
|
|
1785
1850
|
id,
|
|
@@ -1792,7 +1857,7 @@ var ToastRoot = ({
|
|
|
1792
1857
|
icon: iconProp
|
|
1793
1858
|
}) => {
|
|
1794
1859
|
const icon = (() => {
|
|
1795
|
-
if (loading) return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1860
|
+
if (loading) return /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Loader2, { className: "tw-animate-spin" });
|
|
1796
1861
|
if (iconProp) return renderLegacyIcon(iconProp);
|
|
1797
1862
|
if (variant === "default" || variant === null) return null;
|
|
1798
1863
|
return DEFAULT_VARIANT_ICON[variant];
|
|
@@ -2292,9 +2357,9 @@ var DropdownMenuItemIndicator = ({
|
|
|
2292
2357
|
...rest
|
|
2293
2358
|
}) => {
|
|
2294
2359
|
const IconComp = (() => {
|
|
2295
|
-
if (variant === "switch") return
|
|
2296
|
-
if (variant === "radio") return
|
|
2297
|
-
return
|
|
2360
|
+
if (variant === "switch") return icons_exports.ToggleRight;
|
|
2361
|
+
if (variant === "radio") return icons_exports.Circle;
|
|
2362
|
+
return icons_exports.Check;
|
|
2298
2363
|
})();
|
|
2299
2364
|
const forceMount = (() => {
|
|
2300
2365
|
if (forceMountProp) return true;
|
|
@@ -2415,7 +2480,7 @@ var DropdownMenuCheckboxItem = ({
|
|
|
2415
2480
|
...props
|
|
2416
2481
|
}) => {
|
|
2417
2482
|
const isAtStart = indicatorAlign === "start";
|
|
2418
|
-
const indicatorEle = isLoading ? /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { className: isAtStart ? "" : "tw-ml-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2483
|
+
const indicatorEle = isLoading ? /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { className: isAtStart ? "" : "tw-ml-auto", children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Loader2, { className: "tw-animate-spin" }) }) : /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItemIndicator, { variant: indicator, className: isAtStart ? "" : "tw-ml-auto" });
|
|
2419
2484
|
const handleSelect = (event) => {
|
|
2420
2485
|
if (!closeOnSelect) event.preventDefault();
|
|
2421
2486
|
onSelect?.(event);
|
|
@@ -2550,6 +2615,7 @@ var DropdownMenuContent = ({
|
|
|
2550
2615
|
// src/components/DropdownMenu/DropdownMenuItem.tsx
|
|
2551
2616
|
init_icons();
|
|
2552
2617
|
init_utils();
|
|
2618
|
+
init_legacyIcon();
|
|
2553
2619
|
var DropdownMenuItem = ({
|
|
2554
2620
|
ref,
|
|
2555
2621
|
className,
|
|
@@ -2565,7 +2631,7 @@ var DropdownMenuItem = ({
|
|
|
2565
2631
|
...props
|
|
2566
2632
|
}) => {
|
|
2567
2633
|
const Comp = asChild ? reactSlot.Root : "div";
|
|
2568
|
-
const adornment = isLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2634
|
+
const adornment = isLoading ? /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Loader2, { className: "tw-animate-spin" }) : renderLegacyIcon(icon);
|
|
2569
2635
|
const handleOnSelect = (event) => {
|
|
2570
2636
|
if (asModalTrigger) event.preventDefault();
|
|
2571
2637
|
onSelect?.(event);
|
|
@@ -2667,6 +2733,7 @@ var DropdownMenuRadioGroup = ({
|
|
|
2667
2733
|
// src/components/DropdownMenu/DropdownMenuRadioGroup/DropdownMenuRadioItem.tsx
|
|
2668
2734
|
init_icons();
|
|
2669
2735
|
init_utils();
|
|
2736
|
+
init_legacyIcon();
|
|
2670
2737
|
var DropdownMenuRadioItem = ({
|
|
2671
2738
|
className,
|
|
2672
2739
|
children,
|
|
@@ -2680,7 +2747,7 @@ var DropdownMenuRadioItem = ({
|
|
|
2680
2747
|
...props
|
|
2681
2748
|
}) => {
|
|
2682
2749
|
const isAtStart = indicatorAlign === "start";
|
|
2683
|
-
const indicatorEle = isLoading ? /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { className: iconClassName, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2750
|
+
const indicatorEle = isLoading ? /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { className: iconClassName, children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Loader2, { className: "tw-animate-spin" }) }) : /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItemIndicator, { variant: indicator });
|
|
2684
2751
|
const handleSelect = (event) => {
|
|
2685
2752
|
if (!closeOnSelect) event.preventDefault();
|
|
2686
2753
|
onSelect?.(event);
|
|
@@ -2757,7 +2824,7 @@ init_utils();
|
|
|
2757
2824
|
var DropdownMenuSubTrigger = ({ className, children, ...props }) => {
|
|
2758
2825
|
return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuPrimitive3__namespace.SubTrigger, { className: cn(itemVariants, className), ...props, children: [
|
|
2759
2826
|
children,
|
|
2760
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2827
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons_exports.ChevronRight, { className: "tw-ml-auto tw-size-5" })
|
|
2761
2828
|
] });
|
|
2762
2829
|
};
|
|
2763
2830
|
|
|
@@ -2802,10 +2869,10 @@ DropdownMenu.ItemDescription = DropdownMenuItemDescription;
|
|
|
2802
2869
|
// src/components/MarkdownEditor/plugins/toolbar/AlignmentDropdown.tsx
|
|
2803
2870
|
init_Tooltip2();
|
|
2804
2871
|
var ALIGNMENT_OPTIONS = [
|
|
2805
|
-
{ value: "left", label: "Left", icon:
|
|
2806
|
-
{ value: "center", label: "Center", icon:
|
|
2807
|
-
{ value: "right", label: "Right", icon:
|
|
2808
|
-
{ value: "justify", label: "Justify", icon:
|
|
2872
|
+
{ value: "left", label: "Left", icon: icons_exports.AlignLeft },
|
|
2873
|
+
{ value: "center", label: "Center", icon: icons_exports.AlignCenter },
|
|
2874
|
+
{ value: "right", label: "Right", icon: icons_exports.AlignRight },
|
|
2875
|
+
{ value: "justify", label: "Justify", icon: icons_exports.AlignJustify }
|
|
2809
2876
|
];
|
|
2810
2877
|
var ALIGNMENT_ICONS = Object.fromEntries(
|
|
2811
2878
|
ALIGNMENT_OPTIONS.map(({ value, icon }) => [value, icon])
|
|
@@ -2831,7 +2898,7 @@ var AlignmentDropdown = ({
|
|
|
2831
2898
|
editor.dispatchCommand(lexical.FORMAT_ELEMENT_COMMAND, align);
|
|
2832
2899
|
});
|
|
2833
2900
|
};
|
|
2834
|
-
const CurrentAlignmentIcon = ALIGNMENT_ICONS[alignment] ??
|
|
2901
|
+
const CurrentAlignmentIcon = ALIGNMENT_ICONS[alignment] ?? icons_exports.AlignLeft;
|
|
2835
2902
|
return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { onOpenChange: handleOpenChange, children: [
|
|
2836
2903
|
/* @__PURE__ */ jsxRuntime.jsx(Tooltip, { tooltip: "Text alignment", placement: "top", triggerAsChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2837
2904
|
"button",
|
|
@@ -2843,7 +2910,7 @@ var AlignmentDropdown = ({
|
|
|
2843
2910
|
),
|
|
2844
2911
|
children: [
|
|
2845
2912
|
/* @__PURE__ */ jsxRuntime.jsx(CurrentAlignmentIcon, { className: "tw-size-4" }),
|
|
2846
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2913
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons_exports.ChevronDown, { className: "tw-size-3" })
|
|
2847
2914
|
]
|
|
2848
2915
|
}
|
|
2849
2916
|
) }) }),
|
|
@@ -2870,14 +2937,14 @@ init_icons();
|
|
|
2870
2937
|
init_utils();
|
|
2871
2938
|
init_Tooltip2();
|
|
2872
2939
|
var BLOCK_TYPE_META = {
|
|
2873
|
-
paragraph: { label: "Normal", icon:
|
|
2874
|
-
h1: { label: "Heading 1", icon:
|
|
2875
|
-
h2: { label: "Heading 2", icon:
|
|
2876
|
-
h3: { label: "Heading 3", icon:
|
|
2877
|
-
bullet: { label: "Bullet List", icon:
|
|
2878
|
-
number: { label: "Numbered List", icon:
|
|
2879
|
-
quote: { label: "Quote", icon:
|
|
2880
|
-
code: { label: "Code Block", icon:
|
|
2940
|
+
paragraph: { label: "Normal", icon: icons_exports.Type, selectable: true },
|
|
2941
|
+
h1: { label: "Heading 1", icon: icons_exports.Heading1, selectable: true },
|
|
2942
|
+
h2: { label: "Heading 2", icon: icons_exports.Heading2, selectable: true },
|
|
2943
|
+
h3: { label: "Heading 3", icon: icons_exports.Heading3, selectable: true },
|
|
2944
|
+
bullet: { label: "Bullet List", icon: icons_exports.List, selectable: false },
|
|
2945
|
+
number: { label: "Numbered List", icon: icons_exports.ListOrdered, selectable: false },
|
|
2946
|
+
quote: { label: "Quote", icon: icons_exports.Quote, selectable: false },
|
|
2947
|
+
code: { label: "Code Block", icon: icons_exports.SquareCode, selectable: false }
|
|
2881
2948
|
};
|
|
2882
2949
|
var BLOCK_TYPE_OPTIONS = Object.entries(BLOCK_TYPE_META).filter(([, meta]) => meta.selectable).map(([value, { label, icon }]) => ({ value, label, icon }));
|
|
2883
2950
|
var isBlockType = (value) => Object.prototype.hasOwnProperty.call(BLOCK_TYPE_META, value);
|
|
@@ -2887,7 +2954,7 @@ var BlockTypeDropdown = ({
|
|
|
2887
2954
|
}) => {
|
|
2888
2955
|
const savedSelectionRef = react.useRef(null);
|
|
2889
2956
|
const currentMeta = isBlockType(blockType) ? BLOCK_TYPE_META[blockType] : null;
|
|
2890
|
-
const CurrentBlockIcon = currentMeta?.icon ??
|
|
2957
|
+
const CurrentBlockIcon = currentMeta?.icon ?? icons_exports.Type;
|
|
2891
2958
|
const handleOpenChange = (open) => {
|
|
2892
2959
|
if (open) {
|
|
2893
2960
|
editor.getEditorState().read(() => {
|
|
@@ -2930,7 +2997,7 @@ var BlockTypeDropdown = ({
|
|
|
2930
2997
|
children: [
|
|
2931
2998
|
/* @__PURE__ */ jsxRuntime.jsx(CurrentBlockIcon, { className: "tw-size-4" }),
|
|
2932
2999
|
currentMeta?.label ?? "Normal",
|
|
2933
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3000
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons_exports.ChevronDown, { className: "tw-size-3" })
|
|
2934
3001
|
]
|
|
2935
3002
|
}
|
|
2936
3003
|
) }) }),
|
|
@@ -3040,7 +3107,7 @@ var addonVariants = classVarianceAuthority.cva(
|
|
|
3040
3107
|
"tw-items-center",
|
|
3041
3108
|
"tw-gap-1",
|
|
3042
3109
|
// Default size for nested Lucide icons in prefix/suffix slots; callers can override on the icon.
|
|
3043
|
-
"[&_svg:not([class*='tw-size-'])]:tw-size-4",
|
|
3110
|
+
"[&_svg.lucide:not([class*='tw-size-'])]:tw-size-4",
|
|
3044
3111
|
"[&_svg]:tw-shrink-0"
|
|
3045
3112
|
],
|
|
3046
3113
|
{
|
|
@@ -3467,7 +3534,7 @@ var ColorPicker = ({ value, disabled, readOnly, ...props }) => {
|
|
|
3467
3534
|
disabled: disabled || readOnly,
|
|
3468
3535
|
onClick: handleOpenPicker,
|
|
3469
3536
|
"aria-label": "Pick color",
|
|
3470
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3537
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Pipette, { className: "tw-size-4" })
|
|
3471
3538
|
}
|
|
3472
3539
|
)
|
|
3473
3540
|
] });
|
|
@@ -3586,7 +3653,7 @@ var ColorInput = ({
|
|
|
3586
3653
|
onMouseDown: (event) => event.preventDefault(),
|
|
3587
3654
|
onClick: handleClear,
|
|
3588
3655
|
"aria-label": "Clear color",
|
|
3589
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3656
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.X, { className: "tw-size-4" })
|
|
3590
3657
|
}
|
|
3591
3658
|
),
|
|
3592
3659
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3821,7 +3888,7 @@ var Input = ({
|
|
|
3821
3888
|
onMouseDown: (e) => e.preventDefault(),
|
|
3822
3889
|
onClick: handleClear,
|
|
3823
3890
|
"data-testid": testId.clearButton,
|
|
3824
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3891
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.X, { className: "tw-size-4" })
|
|
3825
3892
|
}
|
|
3826
3893
|
),
|
|
3827
3894
|
rightSuffix && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4001,12 +4068,12 @@ var LinkPanel = ({ editor, isLink }) => {
|
|
|
4001
4068
|
active: true,
|
|
4002
4069
|
onClick: () => editor.dispatchCommand(link.TOGGLE_LINK_COMMAND, null),
|
|
4003
4070
|
tooltip: "Remove Link",
|
|
4004
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4071
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Link, { className: "tw-size-4" })
|
|
4005
4072
|
}
|
|
4006
4073
|
);
|
|
4007
4074
|
}
|
|
4008
4075
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-relative", children: [
|
|
4009
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { active: open, onClick: handleOpen, tooltip: "Insert Link", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4076
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { active: open, onClick: handleOpen, tooltip: "Insert Link", children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Link, { className: "tw-size-4" }) }),
|
|
4010
4077
|
open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4011
4078
|
"div",
|
|
4012
4079
|
{
|
|
@@ -4170,7 +4237,7 @@ var ToolbarPlugin = () => {
|
|
|
4170
4237
|
active: isBold,
|
|
4171
4238
|
onClick: () => editor.dispatchCommand(lexical.FORMAT_TEXT_COMMAND, "bold"),
|
|
4172
4239
|
tooltip: "Bold (Ctrl+B)",
|
|
4173
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4240
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Bold, { className: "tw-size-4" })
|
|
4174
4241
|
}
|
|
4175
4242
|
),
|
|
4176
4243
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4179,7 +4246,7 @@ var ToolbarPlugin = () => {
|
|
|
4179
4246
|
active: isItalic,
|
|
4180
4247
|
onClick: () => editor.dispatchCommand(lexical.FORMAT_TEXT_COMMAND, "italic"),
|
|
4181
4248
|
tooltip: "Italic (Ctrl+I)",
|
|
4182
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4249
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Italic, { className: "tw-size-4" })
|
|
4183
4250
|
}
|
|
4184
4251
|
),
|
|
4185
4252
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4188,7 +4255,7 @@ var ToolbarPlugin = () => {
|
|
|
4188
4255
|
active: isUnderline,
|
|
4189
4256
|
onClick: () => editor.dispatchCommand(lexical.FORMAT_TEXT_COMMAND, "underline"),
|
|
4190
4257
|
tooltip: "Underline (Ctrl+U)",
|
|
4191
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4258
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Underline, { className: "tw-size-4" })
|
|
4192
4259
|
}
|
|
4193
4260
|
),
|
|
4194
4261
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4197,7 +4264,7 @@ var ToolbarPlugin = () => {
|
|
|
4197
4264
|
active: isStrikethrough,
|
|
4198
4265
|
onClick: () => editor.dispatchCommand(lexical.FORMAT_TEXT_COMMAND, "strikethrough"),
|
|
4199
4266
|
tooltip: "Strikethrough",
|
|
4200
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4267
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Strikethrough, { className: "tw-size-4" })
|
|
4201
4268
|
}
|
|
4202
4269
|
),
|
|
4203
4270
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4206,7 +4273,7 @@ var ToolbarPlugin = () => {
|
|
|
4206
4273
|
active: isCode,
|
|
4207
4274
|
onClick: () => editor.dispatchCommand(lexical.FORMAT_TEXT_COMMAND, "code"),
|
|
4208
4275
|
tooltip: "Inline Code",
|
|
4209
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4276
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Code, { className: "tw-size-4" })
|
|
4210
4277
|
}
|
|
4211
4278
|
),
|
|
4212
4279
|
/* @__PURE__ */ jsxRuntime.jsx(ToolbarDivider, {}),
|
|
@@ -4224,7 +4291,7 @@ var ToolbarPlugin = () => {
|
|
|
4224
4291
|
}
|
|
4225
4292
|
},
|
|
4226
4293
|
tooltip: "Bullet List",
|
|
4227
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4294
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.List, { className: "tw-size-4" })
|
|
4228
4295
|
}
|
|
4229
4296
|
),
|
|
4230
4297
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4239,7 +4306,7 @@ var ToolbarPlugin = () => {
|
|
|
4239
4306
|
}
|
|
4240
4307
|
},
|
|
4241
4308
|
tooltip: "Numbered List",
|
|
4242
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4309
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.ListOrdered, { className: "tw-size-4" })
|
|
4243
4310
|
}
|
|
4244
4311
|
),
|
|
4245
4312
|
/* @__PURE__ */ jsxRuntime.jsx(ToolbarDivider, {}),
|
|
@@ -4261,7 +4328,7 @@ var ToolbarPlugin = () => {
|
|
|
4261
4328
|
});
|
|
4262
4329
|
},
|
|
4263
4330
|
tooltip: "Quote",
|
|
4264
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4331
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Quote, { className: "tw-size-4" })
|
|
4265
4332
|
}
|
|
4266
4333
|
),
|
|
4267
4334
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4280,7 +4347,7 @@ var ToolbarPlugin = () => {
|
|
|
4280
4347
|
});
|
|
4281
4348
|
},
|
|
4282
4349
|
tooltip: "Code Block",
|
|
4283
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4350
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.SquareCode, { className: "tw-size-4" })
|
|
4284
4351
|
}
|
|
4285
4352
|
)
|
|
4286
4353
|
]
|