@farmzone/fz-react-ui 1.2.0 → 1.2.2
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 +27 -0
- package/dist/index.cjs +286 -201
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.js +285 -199
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -29,7 +29,6 @@ var reactDaumPostcode = require('react-daum-postcode');
|
|
|
29
29
|
var zustand = require('zustand');
|
|
30
30
|
var middleware = require('zustand/middleware');
|
|
31
31
|
var uuid = require('uuid');
|
|
32
|
-
var heic2any = require('heic2any');
|
|
33
32
|
var react = require('@tiptap/react');
|
|
34
33
|
var core = require('@tiptap/core');
|
|
35
34
|
var StarterKit = require('@tiptap/starter-kit');
|
|
@@ -72,7 +71,6 @@ var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitiv
|
|
|
72
71
|
var useEmblaCarousel__default = /*#__PURE__*/_interopDefault(useEmblaCarousel);
|
|
73
72
|
var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
|
|
74
73
|
var customParseFormat__default = /*#__PURE__*/_interopDefault(customParseFormat);
|
|
75
|
-
var heic2any__default = /*#__PURE__*/_interopDefault(heic2any);
|
|
76
74
|
var StarterKit__default = /*#__PURE__*/_interopDefault(StarterKit);
|
|
77
75
|
var TextAlign__default = /*#__PURE__*/_interopDefault(TextAlign);
|
|
78
76
|
var Mention__default = /*#__PURE__*/_interopDefault(Mention);
|
|
@@ -96,7 +94,12 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
96
94
|
accent: "btn-grad text-white rounded-full",
|
|
97
95
|
metal: "btn-metal text-white min-w-22",
|
|
98
96
|
ghost: "p-1 h-auto rounded-sm bg-transparent text-sub-darkgray transition-colors hover:bg-gray-100",
|
|
99
|
-
link: "bg-transparent border-none text-main-blue underline-offset-4 hover:underline h-auto p-0"
|
|
97
|
+
link: "bg-transparent border-none text-main-blue underline-offset-4 hover:underline h-auto p-0",
|
|
98
|
+
// inkstone: 흑백 미니멀. 색은 --fz-ink-* 변수(styles/inkstone.css)에서 읽는다.
|
|
99
|
+
inkstone: "rounded-[2px] bg-[var(--fz-ink)] border border-[var(--fz-ink)] text-[var(--fz-ink-contrast)] hover:bg-[var(--fz-ink-hover)] hover:border-[var(--fz-ink-hover)] active:bg-[var(--fz-ink)]",
|
|
100
|
+
"inkstone-outline": "rounded-[2px] bg-[var(--fz-ink-surface)] border border-[var(--fz-ink-line-strong)] text-[var(--fz-ink-text)] hover:bg-[var(--fz-ink-soft)] active:bg-[var(--fz-ink-selected)]",
|
|
101
|
+
"inkstone-ghost": "rounded-[2px] bg-transparent border border-transparent text-[var(--fz-ink-text-secondary)] hover:bg-[var(--fz-ink-soft)] hover:text-[var(--fz-ink-text)] active:bg-[var(--fz-ink-selected)]",
|
|
102
|
+
"inkstone-danger": "rounded-[2px] bg-[var(--fz-ink-surface)] border border-[var(--fz-ink-danger)] text-[var(--fz-ink-danger)] hover:bg-[color-mix(in_srgb,var(--fz-ink-danger)_8%,var(--fz-ink-surface))]"
|
|
100
103
|
},
|
|
101
104
|
size: {
|
|
102
105
|
default: "h-8 px-4 font-semibold",
|
|
@@ -3818,6 +3821,15 @@ var VARIANT_CONFIG = {
|
|
|
3818
3821
|
titleColor: "text-slate-100",
|
|
3819
3822
|
descColor: "text-slate-400",
|
|
3820
3823
|
closeBtn: "text-slate-500 group-hover:text-slate-300"
|
|
3824
|
+
},
|
|
3825
|
+
// inkstone: 흰 바탕에 아래 테두리만. 아이콘은 회색 네모 칸 안의 먹색.
|
|
3826
|
+
inkstone: {
|
|
3827
|
+
container: "bg-[var(--fz-ink-surface)] border-[var(--fz-ink-line)]",
|
|
3828
|
+
iconBg: "bg-[var(--fz-ink-soft)] rounded-[2px]",
|
|
3829
|
+
iconColor: "text-[var(--fz-ink-text)]",
|
|
3830
|
+
titleColor: "text-[var(--fz-ink-text)]",
|
|
3831
|
+
descColor: "text-[var(--fz-ink-text-tertiary)]",
|
|
3832
|
+
closeBtn: "text-[var(--fz-ink-text-tertiary)] group-hover:text-[var(--fz-ink-text)]"
|
|
3821
3833
|
}
|
|
3822
3834
|
};
|
|
3823
3835
|
var SIZE_CONFIG = {
|
|
@@ -5057,7 +5069,8 @@ function Table(props) {
|
|
|
5057
5069
|
tooltipConfig = "overflow",
|
|
5058
5070
|
isDynamicHeight = true,
|
|
5059
5071
|
showHorizontalDivider = true,
|
|
5060
|
-
showVerticalDivider = true
|
|
5072
|
+
showVerticalDivider = true,
|
|
5073
|
+
variant = "default"
|
|
5061
5074
|
} = props;
|
|
5062
5075
|
const {
|
|
5063
5076
|
fixed = false,
|
|
@@ -5537,82 +5550,89 @@ function Table(props) {
|
|
|
5537
5550
|
const rest = baseRows.filter((row) => !effectiveRowOrder.includes(String(getRowKey(row.original, row.index))));
|
|
5538
5551
|
return [...ordered, ...rest];
|
|
5539
5552
|
}, [baseRows, effectiveRowOrder, getRowKey]);
|
|
5540
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5549
|
-
"table",
|
|
5553
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5554
|
+
"div",
|
|
5555
|
+
{
|
|
5556
|
+
className: "bg-white rounded shadow-table border border-gray-200 overflow-hidden",
|
|
5557
|
+
"data-fz-table-variant": variant,
|
|
5558
|
+
children: [
|
|
5559
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5560
|
+
"div",
|
|
5550
5561
|
{
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5562
|
+
id: "table-layout",
|
|
5563
|
+
ref: scrollRef,
|
|
5564
|
+
className: "relative w-full overflow-y-auto overflow-x-auto custom-view-scrollbar bg-white",
|
|
5565
|
+
style: { height: `${tableHeight}px` },
|
|
5566
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5567
|
+
"table",
|
|
5568
|
+
{
|
|
5569
|
+
className: `table-fixed border-spacing-0${tableMinWidth === void 0 ? " w-full" : ""}`,
|
|
5570
|
+
style: tableMinWidth !== void 0 ? { width: tableMinWidth, minWidth: tableMinWidth } : {
|
|
5571
|
+
minWidth: orderedColumns.reduce(
|
|
5572
|
+
(sum, col) => sum + (col.key === "__checkbox__" || col.width !== void 0 ? parseColPx(col) : 80),
|
|
5573
|
+
0
|
|
5574
|
+
)
|
|
5575
|
+
},
|
|
5576
|
+
children: [
|
|
5577
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5578
|
+
TableHeader,
|
|
5579
|
+
{
|
|
5580
|
+
columns: orderedColumns,
|
|
5581
|
+
getAlignStyle,
|
|
5582
|
+
sortOption,
|
|
5583
|
+
onSortChange,
|
|
5584
|
+
onColumnDragStartCapture: handleColumnDragStartCapture,
|
|
5585
|
+
onColumnDragStart: handleColumnDragStart,
|
|
5586
|
+
onColumnDrop: handleColumnDrop,
|
|
5587
|
+
onColumnDragEnd: handleColumnDragEnd,
|
|
5588
|
+
onColumnDragOver: handleColumnDragOver,
|
|
5589
|
+
isColumnDraggable
|
|
5590
|
+
}
|
|
5591
|
+
),
|
|
5592
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "w-full h-full", children: showSkeleton ? Array.from({ length: 3 }).map((_, rowIdx) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "hover:bg-gray-50", children: [
|
|
5593
|
+
leadingPinnedCols.map((col, idx) => /* @__PURE__ */ jsxRuntime.jsx(SkeletonTd, { col, showSquare: idx === 0 && !!checkboxInfo }, `leading-${idx}`)),
|
|
5594
|
+
leftColspan > 0 && /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: leftColspan, style: { padding: 0, border: "none" } }),
|
|
5595
|
+
virtualItems.map((vc) => /* @__PURE__ */ jsxRuntime.jsx(SkeletonTd, { col: groupCols[vc.index] }, `group-${vc.index}`)),
|
|
5596
|
+
rightColspan > 0 && /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: rightColspan, style: { padding: 0, border: "none" } }),
|
|
5597
|
+
trailingPinnedCols.map((col, idx) => /* @__PURE__ */ jsxRuntime.jsx(SkeletonTd, { col }, `trailing-${idx}`))
|
|
5598
|
+
] }, rowIdx)) : showEmpty ? /* @__PURE__ */ jsxRuntime.jsx(TableEmpty, { columnCount: allColumns.length }) : rows.map((row) => {
|
|
5599
|
+
const rowId = String(getRowKey(row.original, row.index));
|
|
5600
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5601
|
+
TableDataRow,
|
|
5602
|
+
{
|
|
5603
|
+
record: row.original,
|
|
5604
|
+
rowIdx: row.index,
|
|
5605
|
+
rowId,
|
|
5606
|
+
draggable: rowDraggable && !showSkeleton,
|
|
5607
|
+
onDragStart: handleRowDragStart,
|
|
5608
|
+
onDragOver: handleRowDragOver,
|
|
5609
|
+
onDrop: handleRowDrop,
|
|
5610
|
+
onDragEnd: handleRowDragEnd,
|
|
5611
|
+
leftColspan,
|
|
5612
|
+
rightColspan,
|
|
5613
|
+
renderLeadingPinnedCols,
|
|
5614
|
+
renderVisibleGroupCols,
|
|
5615
|
+
renderTrailingPinnedCols
|
|
5616
|
+
},
|
|
5617
|
+
row.id
|
|
5618
|
+
);
|
|
5619
|
+
}) })
|
|
5620
|
+
]
|
|
5621
|
+
}
|
|
5622
|
+
)
|
|
5603
5623
|
}
|
|
5604
|
-
)
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5624
|
+
),
|
|
5625
|
+
!showSkeleton && (paginationInfo || renderFooter?.renderLeft || renderFooter?.renderRight) && /* @__PURE__ */ jsxRuntime.jsx("div", { ref: footerRef, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5626
|
+
TableFooter,
|
|
5627
|
+
{
|
|
5628
|
+
paginationInfo,
|
|
5629
|
+
renderLeft: renderFooter?.renderLeft,
|
|
5630
|
+
renderRight: renderFooter?.renderRight
|
|
5631
|
+
}
|
|
5632
|
+
) })
|
|
5633
|
+
]
|
|
5634
|
+
}
|
|
5635
|
+
);
|
|
5616
5636
|
}
|
|
5617
5637
|
var CarouselContext = React6__namespace.createContext(null);
|
|
5618
5638
|
function useCarousel() {
|
|
@@ -8352,6 +8372,26 @@ var VARIANT_STYLES = {
|
|
|
8352
8372
|
tabTextSize: "text-sm",
|
|
8353
8373
|
scrollPadding: "px-4 pt-2",
|
|
8354
8374
|
rounded: "rounded-t-none"
|
|
8375
|
+
},
|
|
8376
|
+
// inkstone: 흑백 미니멀. 선택된 탭만 먹(검정) 바탕에 흰 글자, 나머지는 흰 바탕 + 회색 테두리.
|
|
8377
|
+
inkstone: {
|
|
8378
|
+
container: "bg-[var(--fz-ink-canvas)]",
|
|
8379
|
+
activeTab: "bg-[var(--fz-ink)] border-[var(--fz-ink)] text-[var(--fz-ink-contrast)]",
|
|
8380
|
+
inactiveTab: "bg-[var(--fz-ink-surface)] border-[var(--fz-ink-line)] text-[var(--fz-ink-text-secondary)] hover:text-[var(--fz-ink-text)] hover:bg-[var(--fz-ink-soft)] hover:border-[var(--fz-ink-line-control)]",
|
|
8381
|
+
activeText: "font-bold text-[var(--fz-ink-contrast)]",
|
|
8382
|
+
inactiveText: "font-medium",
|
|
8383
|
+
indicator: "bg-transparent",
|
|
8384
|
+
closeBtn: "ml-auto rounded-[2px] opacity-60 hover:opacity-100 hover:bg-[color-mix(in_srgb,currentColor_18%,transparent)]",
|
|
8385
|
+
closeBtnWH: "w-4 h-4",
|
|
8386
|
+
closeBtnSize: 12,
|
|
8387
|
+
plusBtnArea: "bg-[var(--fz-ink-canvas)]",
|
|
8388
|
+
plusBtn: "text-[var(--fz-ink-text-tertiary)] hover:text-[var(--fz-ink-text)] hover:bg-[var(--fz-ink-soft)]",
|
|
8389
|
+
fadeOpacity: 0.12,
|
|
8390
|
+
tabHeight: "h-[30px]",
|
|
8391
|
+
tabPx: "px-3",
|
|
8392
|
+
tabTextSize: "text-xs",
|
|
8393
|
+
scrollPadding: "px-2 pt-2",
|
|
8394
|
+
rounded: "rounded-t-[2px]"
|
|
8355
8395
|
}
|
|
8356
8396
|
};
|
|
8357
8397
|
var PLUS_BTN_WIDTH = 36;
|
|
@@ -9544,7 +9584,8 @@ function revokeFile(file) {
|
|
|
9544
9584
|
}
|
|
9545
9585
|
}
|
|
9546
9586
|
var convertHeicToJpeg = async (file) => {
|
|
9547
|
-
const
|
|
9587
|
+
const { default: heic2any } = await import('heic2any');
|
|
9588
|
+
const blob = await heic2any({ blob: file, toType: "image/jpeg", quality: 0.92 });
|
|
9548
9589
|
const result = Array.isArray(blob) ? blob[0] : blob;
|
|
9549
9590
|
const baseName = file.name.replace(/\.[^.]+$/, "");
|
|
9550
9591
|
if (!result) throw new Error("HEIC conversion failed");
|
|
@@ -9944,6 +9985,34 @@ var VARIANT_STYLES2 = {
|
|
|
9944
9985
|
paddingLeft: "10px"
|
|
9945
9986
|
},
|
|
9946
9987
|
footerBorder: "border-t border-gray-200"
|
|
9988
|
+
},
|
|
9989
|
+
// inkstone: 흑백 미니멀. 현재 메뉴는 회색 바탕 + 굵은 글자로만 표시하고 색 띠를 두지 않는다.
|
|
9990
|
+
inkstone: {
|
|
9991
|
+
aside: "bg-[var(--fz-ink-canvas)]",
|
|
9992
|
+
sectionTitle: "text-[11px] font-medium text-[var(--fz-ink-text-tertiary)] mb-1 px-2",
|
|
9993
|
+
itemActive: "font-bold",
|
|
9994
|
+
itemInactive: "text-[var(--fz-ink-text)] hover:bg-[var(--fz-ink-soft)]",
|
|
9995
|
+
subItemActive: "text-[var(--fz-ink-text)] font-bold",
|
|
9996
|
+
subItemInactive: "text-[var(--fz-ink-text-secondary)] hover:bg-[var(--fz-ink-soft)] hover:text-[var(--fz-ink-text)]",
|
|
9997
|
+
childGroupBorder: "border-[var(--fz-ink-line)]",
|
|
9998
|
+
childActive: "font-bold",
|
|
9999
|
+
childInactive: "text-[var(--fz-ink-text-secondary)] hover:bg-[var(--fz-ink-soft)] hover:text-[var(--fz-ink-text)]",
|
|
10000
|
+
grandchildActive: "text-[var(--fz-ink-text)] font-bold",
|
|
10001
|
+
grandchildInactive: "text-[var(--fz-ink-text-tertiary)] hover:bg-[var(--fz-ink-soft)] hover:text-[var(--fz-ink-text)]",
|
|
10002
|
+
collapseBtn: "bg-transparent hover:bg-[var(--fz-ink-soft)]",
|
|
10003
|
+
collapseIcon: "#525252",
|
|
10004
|
+
rounded: "rounded-[2px]",
|
|
10005
|
+
itemPy: "py-2",
|
|
10006
|
+
childPy: "py-1.5",
|
|
10007
|
+
grandchildPy: "py-1",
|
|
10008
|
+
itemFont: "font-medium",
|
|
10009
|
+
itemTextSize: "text-[13px]",
|
|
10010
|
+
grandchildTextSize: "text-xs",
|
|
10011
|
+
iconClass: "w-4 h-4 flex-shrink-0",
|
|
10012
|
+
activeItemStyle: { color: "var(--fz-ink-text)", backgroundColor: "var(--fz-ink-soft)" },
|
|
10013
|
+
activeChildStyle: { color: "var(--fz-ink-text)", backgroundColor: "var(--fz-ink-soft)" },
|
|
10014
|
+
activeGrandchildStyle: { color: "var(--fz-ink-text)", backgroundColor: "var(--fz-ink-soft)" },
|
|
10015
|
+
footerBorder: "border-t border-[var(--fz-ink-line)]"
|
|
9947
10016
|
}
|
|
9948
10017
|
};
|
|
9949
10018
|
function tintedStyle(color) {
|
|
@@ -10012,6 +10081,13 @@ var ACCENT_APPLIERS = {
|
|
|
10012
10081
|
borderLeft: `2px solid ${c}`,
|
|
10013
10082
|
paddingLeft: "10px"
|
|
10014
10083
|
})
|
|
10084
|
+
},
|
|
10085
|
+
// inkstone keeps its flat grey highlight; a primaryColor only tints it, with no side bar.
|
|
10086
|
+
inkstone: {
|
|
10087
|
+
itemActive: tintedStyle,
|
|
10088
|
+
subItemActive: textStyle,
|
|
10089
|
+
childActive: tintedStyle,
|
|
10090
|
+
grandchildActive: textStyle
|
|
10015
10091
|
}
|
|
10016
10092
|
};
|
|
10017
10093
|
function Sidebar(props) {
|
|
@@ -10025,6 +10101,7 @@ function Sidebar(props) {
|
|
|
10025
10101
|
showCollapseButton = false,
|
|
10026
10102
|
collapseButtonPlacement = "right",
|
|
10027
10103
|
variant = "light",
|
|
10104
|
+
width,
|
|
10028
10105
|
primaryColor
|
|
10029
10106
|
} = props;
|
|
10030
10107
|
const { pathname } = reactRouter.useLocation();
|
|
@@ -10102,12 +10179,13 @@ function Sidebar(props) {
|
|
|
10102
10179
|
"aside",
|
|
10103
10180
|
{
|
|
10104
10181
|
className: `
|
|
10105
|
-
${isCollapsed ? "w-11 min-w-11" : "min-w-60 w-62"}
|
|
10182
|
+
${isCollapsed ? "w-11 min-w-11" : width === void 0 ? "min-w-60 w-62" : ""}
|
|
10106
10183
|
transition-[width,min-width] duration-300 ease-in-out
|
|
10107
10184
|
relative h-screen shrink-0 overflow-x-hidden flex flex-col
|
|
10108
10185
|
${s.aside}
|
|
10109
10186
|
${className ?? ""}
|
|
10110
10187
|
`,
|
|
10188
|
+
style: !isCollapsed && width !== void 0 ? { width, minWidth: width } : void 0,
|
|
10111
10189
|
children: [
|
|
10112
10190
|
showCollapseButton && !isHeaderRenderProp && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10113
10191
|
"button",
|
|
@@ -10121,147 +10199,154 @@ function Sidebar(props) {
|
|
|
10121
10199
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex-1 min-h-0 hide-scrollbar ${overflowVisible ? "overflow-y-auto" : "overflow-hidden"}`, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10122
10200
|
"div",
|
|
10123
10201
|
{
|
|
10124
|
-
className: `transition-opacity duration-200 ease-in-out ${isCollapsed ? "opacity-0 pointer-events-none select-none" : "opacity-100"} ${variant === "system-dark" || variant === "system-light" ? "pb-6" : "px-4 pb-6"}`,
|
|
10202
|
+
className: `transition-opacity duration-200 ease-in-out ${isCollapsed ? "opacity-0 pointer-events-none select-none" : "opacity-100"} ${variant === "system-dark" || variant === "system-light" || variant === "inkstone" ? "pb-6" : "px-4 pb-6"}`,
|
|
10125
10203
|
style: { transitionDelay: isCollapsed ? "0ms" : "150ms" },
|
|
10126
10204
|
children: [
|
|
10127
10205
|
!isHeaderRenderProp && headerContent,
|
|
10128
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
|
|
10141
|
-
|
|
10142
|
-
|
|
10143
|
-
|
|
10206
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10207
|
+
"nav",
|
|
10208
|
+
{
|
|
10209
|
+
className: `${variant === "inkstone" ? "space-y-4 px-2" : "space-y-6"} ${variant === "system-dark" || variant === "system-light" ? "px-1" : ""}`,
|
|
10210
|
+
children: menuSections.map((section, sectionIndex) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
10211
|
+
section.title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.sectionTitle, children: section.title }),
|
|
10212
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", children: section.items.map((item) => {
|
|
10213
|
+
const isActive = !item.children && pathname === item.path;
|
|
10214
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
10215
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10216
|
+
"button",
|
|
10217
|
+
{
|
|
10218
|
+
onClick: () => {
|
|
10219
|
+
if (item.children) {
|
|
10220
|
+
toggleExpand(item.label);
|
|
10221
|
+
} else if (item.path) {
|
|
10222
|
+
handleItemClick(item.path);
|
|
10223
|
+
}
|
|
10224
|
+
},
|
|
10225
|
+
className: `
|
|
10144
10226
|
w-full text-left flex items-center gap-2 px-3 ${s.itemPy} ${s.rounded} ${s.itemTextSize} ${s.itemFont} transition-colors cursor-pointer
|
|
10145
10227
|
${isActive ? s.itemActive : s.itemInactive}
|
|
10146
10228
|
`,
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
className: "w-4 h-4 flex-shrink-0 opacity-50",
|
|
10168
|
-
fill: "none",
|
|
10169
|
-
stroke: "currentColor",
|
|
10170
|
-
viewBox: "0 0 24 24",
|
|
10171
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10172
|
-
"path",
|
|
10229
|
+
style: {
|
|
10230
|
+
...isActive ? s.activeItemStyle : {},
|
|
10231
|
+
...isActive && primaryColor ? applier.itemActive(primaryColor) : {}
|
|
10232
|
+
},
|
|
10233
|
+
children: [
|
|
10234
|
+
/* @__PURE__ */ jsxRuntime.jsx(item.icon, { className: s.iconClass }),
|
|
10235
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `flex-1 ${variant === "inkstone" ? "min-w-0 truncate text-left" : ""}`, children: item.label }),
|
|
10236
|
+
item.badge !== void 0 && item.badge !== null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs font-medium opacity-60", children: item.badge }),
|
|
10237
|
+
item.children && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10238
|
+
"svg",
|
|
10239
|
+
{
|
|
10240
|
+
className: `w-4 h-4 transition-transform ${expandedItems.has(item.label) ? "rotate-90" : ""}`,
|
|
10241
|
+
fill: "none",
|
|
10242
|
+
stroke: "currentColor",
|
|
10243
|
+
viewBox: "0 0 24 24",
|
|
10244
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
|
|
10245
|
+
}
|
|
10246
|
+
),
|
|
10247
|
+
item.path?.includes("https") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10248
|
+
"svg",
|
|
10173
10249
|
{
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10250
|
+
className: "w-4 h-4 flex-shrink-0 opacity-50",
|
|
10251
|
+
fill: "none",
|
|
10252
|
+
stroke: "currentColor",
|
|
10253
|
+
viewBox: "0 0 24 24",
|
|
10254
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10255
|
+
"path",
|
|
10256
|
+
{
|
|
10257
|
+
strokeLinecap: "round",
|
|
10258
|
+
strokeLinejoin: "round",
|
|
10259
|
+
strokeWidth: 2,
|
|
10260
|
+
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
|
10261
|
+
}
|
|
10262
|
+
)
|
|
10178
10263
|
}
|
|
10179
10264
|
)
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
onClick: () => toggleSubExpand(subKey),
|
|
10195
|
-
className: `
|
|
10265
|
+
]
|
|
10266
|
+
}
|
|
10267
|
+
),
|
|
10268
|
+
item.children && expandedItems.has(item.label) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `ml-5 mt-0.5 space-y-0.5 border-l ${s.childGroupBorder}`, children: item.children.map((child, childIndex) => {
|
|
10269
|
+
if (child.children && child.children.length > 0) {
|
|
10270
|
+
const subKey = `${item.label}::${child.label}`;
|
|
10271
|
+
const isSubExpanded = expandedSubItems.has(subKey);
|
|
10272
|
+
const isSubActive = child.children.some((gc) => gc.path === pathname);
|
|
10273
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
10274
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10275
|
+
"button",
|
|
10276
|
+
{
|
|
10277
|
+
onClick: () => toggleSubExpand(subKey),
|
|
10278
|
+
className: `
|
|
10196
10279
|
w-full text-left flex items-center justify-between pl-4 pr-3 ${s.childPy} ${s.rounded} ${s.itemTextSize} transition-colors cursor-pointer
|
|
10197
10280
|
${isSubActive ? s.subItemActive : s.subItemInactive}
|
|
10198
10281
|
`,
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
{
|
|
10205
|
-
className: `w-3 h-3 transition-transform ${isSubExpanded ? "rotate-90" : ""}`,
|
|
10206
|
-
fill: "none",
|
|
10207
|
-
stroke: "currentColor",
|
|
10208
|
-
viewBox: "0 0 24 24",
|
|
10209
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10210
|
-
"path",
|
|
10282
|
+
style: isSubActive && primaryColor ? applier.subItemActive(primaryColor) : void 0,
|
|
10283
|
+
children: [
|
|
10284
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: child.label }),
|
|
10285
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10286
|
+
"svg",
|
|
10211
10287
|
{
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10288
|
+
className: `w-3 h-3 transition-transform ${isSubExpanded ? "rotate-90" : ""}`,
|
|
10289
|
+
fill: "none",
|
|
10290
|
+
stroke: "currentColor",
|
|
10291
|
+
viewBox: "0 0 24 24",
|
|
10292
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10293
|
+
"path",
|
|
10294
|
+
{
|
|
10295
|
+
strokeLinecap: "round",
|
|
10296
|
+
strokeLinejoin: "round",
|
|
10297
|
+
strokeWidth: 2,
|
|
10298
|
+
d: "M9 5l7 7-7 7"
|
|
10299
|
+
}
|
|
10300
|
+
)
|
|
10216
10301
|
}
|
|
10217
10302
|
)
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
onClick: () => handleItemClick(grandchild.path),
|
|
10229
|
-
className: `
|
|
10303
|
+
]
|
|
10304
|
+
}
|
|
10305
|
+
),
|
|
10306
|
+
isSubExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-3 mt-0.5 space-y-0.5 pl-2", children: child.children.map((grandchild) => {
|
|
10307
|
+
const isGrandchildActive = pathname === grandchild.path;
|
|
10308
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10309
|
+
"button",
|
|
10310
|
+
{
|
|
10311
|
+
onClick: () => handleItemClick(grandchild.path),
|
|
10312
|
+
className: `
|
|
10230
10313
|
w-full text-left px-3 ${s.grandchildPy} ${s.rounded} ${s.grandchildTextSize} transition-colors cursor-pointer
|
|
10231
10314
|
${isGrandchildActive ? s.grandchildActive : s.grandchildInactive}
|
|
10232
10315
|
`,
|
|
10233
|
-
|
|
10234
|
-
|
|
10235
|
-
|
|
10236
|
-
|
|
10237
|
-
|
|
10238
|
-
|
|
10239
|
-
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10316
|
+
style: {
|
|
10317
|
+
...isGrandchildActive ? s.activeGrandchildStyle : {},
|
|
10318
|
+
...isGrandchildActive && primaryColor ? applier.grandchildActive(primaryColor) : {}
|
|
10319
|
+
},
|
|
10320
|
+
children: grandchild.label
|
|
10321
|
+
},
|
|
10322
|
+
grandchild.path
|
|
10323
|
+
);
|
|
10324
|
+
}) })
|
|
10325
|
+
] }, child.label);
|
|
10326
|
+
}
|
|
10327
|
+
const isChildActive = pathname === child.path;
|
|
10328
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10329
|
+
"button",
|
|
10330
|
+
{
|
|
10331
|
+
onClick: () => handleItemClick(child.path ?? ""),
|
|
10332
|
+
className: `
|
|
10250
10333
|
w-full text-left pl-4 pr-3 ${s.childPy} ${s.rounded} ${s.itemTextSize} transition-colors cursor-pointer
|
|
10251
10334
|
${isChildActive ? s.childActive : s.childInactive}
|
|
10252
10335
|
`,
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
|
|
10336
|
+
style: {
|
|
10337
|
+
...isChildActive ? s.activeChildStyle : {},
|
|
10338
|
+
...isChildActive && primaryColor ? applier.childActive(primaryColor) : {}
|
|
10339
|
+
},
|
|
10340
|
+
children: child.label
|
|
10341
|
+
},
|
|
10342
|
+
childIndex
|
|
10343
|
+
);
|
|
10344
|
+
}) })
|
|
10345
|
+
] }, item.label);
|
|
10261
10346
|
}) })
|
|
10262
|
-
] },
|
|
10263
|
-
}
|
|
10264
|
-
|
|
10347
|
+
] }, section.title ?? sectionIndex))
|
|
10348
|
+
}
|
|
10349
|
+
)
|
|
10265
10350
|
]
|
|
10266
10351
|
}
|
|
10267
10352
|
) }),
|
|
@@ -11254,7 +11339,7 @@ function RichEditorToolbar(props) {
|
|
|
11254
11339
|
"div",
|
|
11255
11340
|
{
|
|
11256
11341
|
className: cn(
|
|
11257
|
-
"flex flex-wrap items-center gap-0.5 p-2",
|
|
11342
|
+
"sticky top-0 z-10 flex flex-wrap items-center gap-0.5 p-2",
|
|
11258
11343
|
theme.toolbar.wrapper,
|
|
11259
11344
|
className
|
|
11260
11345
|
),
|
|
@@ -11886,7 +11971,7 @@ var RichEditor = React6.forwardRef(function RichEditor2({
|
|
|
11886
11971
|
const editorBox = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11887
11972
|
"div",
|
|
11888
11973
|
{
|
|
11889
|
-
className: cn("overflow-
|
|
11974
|
+
className: cn("overflow-clip rounded-lg border border-gray-200 shadow-sm flex flex-col relative", className),
|
|
11890
11975
|
"data-rich-editor-theme": theme,
|
|
11891
11976
|
style: accentStyle,
|
|
11892
11977
|
children: [
|