@industry-theme/backlogmd-kanban-panel 1.0.32 → 1.0.34
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/dist/mocks/panelContext.d.ts +12 -2
- package/dist/mocks/panelContext.d.ts.map +1 -1
- package/dist/panels/KanbanPanel.d.ts.map +1 -1
- package/dist/panels/KanbanPanel.stories.d.ts.map +1 -1
- package/dist/panels/TaskDetailPanel.d.ts.map +1 -1
- package/dist/panels/TaskDetailPanel.stories.d.ts +2 -0
- package/dist/panels/TaskDetailPanel.stories.d.ts.map +1 -1
- package/dist/panels/kanban/components/TaskCard.d.ts.map +1 -1
- package/dist/panels/kanban/components/TaskCard.stories.d.ts +31 -0
- package/dist/panels/kanban/components/TaskCard.stories.d.ts.map +1 -0
- package/dist/panels/kanban/hooks/useKanbanData.d.ts +2 -0
- package/dist/panels/kanban/hooks/useKanbanData.d.ts.map +1 -1
- package/dist/panels.bundle.css +1 -0
- package/dist/panels.bundle.js +2835 -500
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +3 -2
package/dist/panels.bundle.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
3
3
|
var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
4
|
-
import { jsxs,
|
|
4
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
5
5
|
import * as React2 from "react";
|
|
6
6
|
import React2__default, { useLayoutEffect, useEffect, useRef, useMemo, useCallback, useState, createContext, memo, useReducer, useContext, forwardRef, cloneElement, createElement, useImperativeHandle } from "react";
|
|
7
7
|
import { unstable_batchedUpdates, createPortal } from "react-dom";
|
|
@@ -33,7 +33,7 @@ function isDocument(node2) {
|
|
|
33
33
|
} = getWindow(node2);
|
|
34
34
|
return node2 instanceof Document;
|
|
35
35
|
}
|
|
36
|
-
function isHTMLElement(node2) {
|
|
36
|
+
function isHTMLElement$1(node2) {
|
|
37
37
|
if (isWindow(node2)) {
|
|
38
38
|
return false;
|
|
39
39
|
}
|
|
@@ -55,15 +55,15 @@ function getOwnerDocument(target) {
|
|
|
55
55
|
if (isDocument(target)) {
|
|
56
56
|
return target;
|
|
57
57
|
}
|
|
58
|
-
if (isHTMLElement(target) || isSVGElement(target)) {
|
|
58
|
+
if (isHTMLElement$1(target) || isSVGElement(target)) {
|
|
59
59
|
return target.ownerDocument;
|
|
60
60
|
}
|
|
61
61
|
return document;
|
|
62
62
|
}
|
|
63
|
-
const useIsomorphicLayoutEffect$
|
|
63
|
+
const useIsomorphicLayoutEffect$2 = canUseDOM ? useLayoutEffect : useEffect;
|
|
64
64
|
function useEvent(handler) {
|
|
65
65
|
const handlerRef = useRef(handler);
|
|
66
|
-
useIsomorphicLayoutEffect$
|
|
66
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
67
67
|
handlerRef.current = handler;
|
|
68
68
|
});
|
|
69
69
|
return useCallback(function() {
|
|
@@ -91,7 +91,7 @@ function useLatestValue(value, dependencies) {
|
|
|
91
91
|
dependencies = [value];
|
|
92
92
|
}
|
|
93
93
|
const valueRef = useRef(value);
|
|
94
|
-
useIsomorphicLayoutEffect$
|
|
94
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
95
95
|
if (valueRef.current !== value) {
|
|
96
96
|
valueRef.current = value;
|
|
97
97
|
}
|
|
@@ -133,7 +133,7 @@ function usePrevious(value) {
|
|
|
133
133
|
return ref.current;
|
|
134
134
|
}
|
|
135
135
|
let ids = {};
|
|
136
|
-
function useUniqueId$
|
|
136
|
+
function useUniqueId$2(prefix, value) {
|
|
137
137
|
return useMemo(() => {
|
|
138
138
|
if (value) {
|
|
139
139
|
return value;
|
|
@@ -396,7 +396,7 @@ function Accessibility(_ref) {
|
|
|
396
396
|
announce,
|
|
397
397
|
announcement
|
|
398
398
|
} = useAnnouncement();
|
|
399
|
-
const liveRegionId = useUniqueId$
|
|
399
|
+
const liveRegionId = useUniqueId$2("DndLiveRegion");
|
|
400
400
|
const [mounted, setMounted] = useState(false);
|
|
401
401
|
useEffect(() => {
|
|
402
402
|
setMounted(true);
|
|
@@ -731,7 +731,7 @@ function getScrollableAncestors(element2, limit) {
|
|
|
731
731
|
scrollParents.push(node2.scrollingElement);
|
|
732
732
|
return scrollParents;
|
|
733
733
|
}
|
|
734
|
-
if (!isHTMLElement(node2) || isSVGElement(node2)) {
|
|
734
|
+
if (!isHTMLElement$1(node2) || isSVGElement(node2)) {
|
|
735
735
|
return scrollParents;
|
|
736
736
|
}
|
|
737
737
|
if (scrollParents.includes(node2)) {
|
|
@@ -770,7 +770,7 @@ function getScrollableElement(element2) {
|
|
|
770
770
|
if (isDocument(element2) || element2 === getOwnerDocument(element2).scrollingElement) {
|
|
771
771
|
return window;
|
|
772
772
|
}
|
|
773
|
-
if (isHTMLElement(element2)) {
|
|
773
|
+
if (isHTMLElement$1(element2)) {
|
|
774
774
|
return element2;
|
|
775
775
|
}
|
|
776
776
|
return null;
|
|
@@ -2015,7 +2015,7 @@ function useRect(element2, measure, fallbackRect) {
|
|
|
2015
2015
|
const resizeObserver = useResizeObserver({
|
|
2016
2016
|
callback: measureRect
|
|
2017
2017
|
});
|
|
2018
|
-
useIsomorphicLayoutEffect$
|
|
2018
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
2019
2019
|
measureRect();
|
|
2020
2020
|
if (element2) {
|
|
2021
2021
|
resizeObserver == null ? void 0 : resizeObserver.observe(element2);
|
|
@@ -2189,7 +2189,7 @@ function useRects(elements, measure) {
|
|
|
2189
2189
|
const resizeObserver = useResizeObserver({
|
|
2190
2190
|
callback: measureRects
|
|
2191
2191
|
});
|
|
2192
|
-
useIsomorphicLayoutEffect$
|
|
2192
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
2193
2193
|
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
|
2194
2194
|
measureRects();
|
|
2195
2195
|
elements.forEach((element2) => resizeObserver == null ? void 0 : resizeObserver.observe(element2));
|
|
@@ -2204,7 +2204,7 @@ function getMeasurableNode(node2) {
|
|
|
2204
2204
|
return node2;
|
|
2205
2205
|
}
|
|
2206
2206
|
const firstChild = node2.children[0];
|
|
2207
|
-
return isHTMLElement(firstChild) ? firstChild : node2;
|
|
2207
|
+
return isHTMLElement$1(firstChild) ? firstChild : node2;
|
|
2208
2208
|
}
|
|
2209
2209
|
function useDragOverlayMeasuring(_ref) {
|
|
2210
2210
|
let {
|
|
@@ -2215,7 +2215,7 @@ function useDragOverlayMeasuring(_ref) {
|
|
|
2215
2215
|
for (const {
|
|
2216
2216
|
target
|
|
2217
2217
|
} of entries) {
|
|
2218
|
-
if (isHTMLElement(target)) {
|
|
2218
|
+
if (isHTMLElement$1(target)) {
|
|
2219
2219
|
setRect((rect2) => {
|
|
2220
2220
|
const newRect = measure(target);
|
|
2221
2221
|
return rect2 ? {
|
|
@@ -2551,7 +2551,7 @@ function useLayoutShiftScrollCompensation(_ref) {
|
|
|
2551
2551
|
x: config,
|
|
2552
2552
|
y: config
|
|
2553
2553
|
} : config;
|
|
2554
|
-
useIsomorphicLayoutEffect$
|
|
2554
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
2555
2555
|
const disabled = !x && !y;
|
|
2556
2556
|
if (disabled || !activeNode) {
|
|
2557
2557
|
initialized.current = false;
|
|
@@ -2641,7 +2641,7 @@ const DndContext = /* @__PURE__ */ memo(function DndContext2(_ref) {
|
|
|
2641
2641
|
const [activeSensor, setActiveSensor] = useState(null);
|
|
2642
2642
|
const [activatorEvent, setActivatorEvent] = useState(null);
|
|
2643
2643
|
const latestProps = useLatestValue(props, Object.values(props));
|
|
2644
|
-
const draggableDescribedById = useUniqueId$
|
|
2644
|
+
const draggableDescribedById = useUniqueId$2("DndDescribedBy", id);
|
|
2645
2645
|
const enabledDroppableContainers = useMemo(() => droppableContainers.getEnabled(), [droppableContainers]);
|
|
2646
2646
|
const measuringConfiguration = useMeasuringConfiguration(measuring);
|
|
2647
2647
|
const {
|
|
@@ -2912,7 +2912,7 @@ const DndContext = /* @__PURE__ */ memo(function DndContext2(_ref) {
|
|
|
2912
2912
|
}, [draggableNodes, instantiateSensor]);
|
|
2913
2913
|
const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator);
|
|
2914
2914
|
useSensorSetup(sensors);
|
|
2915
|
-
useIsomorphicLayoutEffect$
|
|
2915
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
2916
2916
|
if (activeNodeRect && status === Status.Initializing) {
|
|
2917
2917
|
setStatus(Status.Initialized);
|
|
2918
2918
|
}
|
|
@@ -2996,7 +2996,7 @@ const DndContext = /* @__PURE__ */ memo(function DndContext2(_ref) {
|
|
|
2996
2996
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2997
2997
|
[overId]
|
|
2998
2998
|
);
|
|
2999
|
-
useIsomorphicLayoutEffect$
|
|
2999
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
3000
3000
|
sensorContext.current = {
|
|
3001
3001
|
activatorEvent,
|
|
3002
3002
|
active,
|
|
@@ -3102,7 +3102,7 @@ function useDraggable(_ref) {
|
|
|
3102
3102
|
disabled = false,
|
|
3103
3103
|
attributes
|
|
3104
3104
|
} = _ref;
|
|
3105
|
-
const key2 = useUniqueId$
|
|
3105
|
+
const key2 = useUniqueId$2(ID_PREFIX);
|
|
3106
3106
|
const {
|
|
3107
3107
|
activators,
|
|
3108
3108
|
activatorEvent,
|
|
@@ -3123,7 +3123,7 @@ function useDraggable(_ref) {
|
|
|
3123
3123
|
const [activatorNode, setActivatorNodeRef] = useNodeRef();
|
|
3124
3124
|
const listeners = useSyntheticListeners(activators, id);
|
|
3125
3125
|
const dataRef = useLatestValue(data);
|
|
3126
|
-
useIsomorphicLayoutEffect$
|
|
3126
|
+
useIsomorphicLayoutEffect$2(
|
|
3127
3127
|
() => {
|
|
3128
3128
|
draggableNodes.set(id, {
|
|
3129
3129
|
id,
|
|
@@ -3178,7 +3178,7 @@ function useDroppable(_ref) {
|
|
|
3178
3178
|
id,
|
|
3179
3179
|
resizeObserverConfig
|
|
3180
3180
|
} = _ref;
|
|
3181
|
-
const key2 = useUniqueId$
|
|
3181
|
+
const key2 = useUniqueId$2(ID_PREFIX$1);
|
|
3182
3182
|
const {
|
|
3183
3183
|
active,
|
|
3184
3184
|
dispatch,
|
|
@@ -3296,7 +3296,7 @@ function AnimationManager(_ref) {
|
|
|
3296
3296
|
if (!children2 && !clonedChildren && previousChildren) {
|
|
3297
3297
|
setClonedChildren(previousChildren);
|
|
3298
3298
|
}
|
|
3299
|
-
useIsomorphicLayoutEffect$
|
|
3299
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
3300
3300
|
if (!element2) {
|
|
3301
3301
|
return;
|
|
3302
3302
|
}
|
|
@@ -3740,7 +3740,7 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
3740
3740
|
* This source code is licensed under the ISC license.
|
|
3741
3741
|
* See the LICENSE file in the root directory of this source tree.
|
|
3742
3742
|
*/
|
|
3743
|
-
const __iconNode$
|
|
3743
|
+
const __iconNode$k = [
|
|
3744
3744
|
["path", { d: "M12 8V4H8", key: "hb8ula" }],
|
|
3745
3745
|
["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
|
|
3746
3746
|
["path", { d: "M2 14h2", key: "vft8re" }],
|
|
@@ -3748,88 +3748,75 @@ const __iconNode$o = [
|
|
|
3748
3748
|
["path", { d: "M15 13v2", key: "1xurst" }],
|
|
3749
3749
|
["path", { d: "M9 13v2", key: "rq6x2g" }]
|
|
3750
3750
|
];
|
|
3751
|
-
const Bot = createLucideIcon("bot", __iconNode$
|
|
3752
|
-
/**
|
|
3753
|
-
* @license lucide-react v0.552.0 - ISC
|
|
3754
|
-
*
|
|
3755
|
-
* This source code is licensed under the ISC license.
|
|
3756
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
3757
|
-
*/
|
|
3758
|
-
const __iconNode$n = [
|
|
3759
|
-
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
3760
|
-
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
3761
|
-
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
3762
|
-
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
3763
|
-
];
|
|
3764
|
-
const Calendar = createLucideIcon("calendar", __iconNode$n);
|
|
3751
|
+
const Bot = createLucideIcon("bot", __iconNode$k);
|
|
3765
3752
|
/**
|
|
3766
3753
|
* @license lucide-react v0.552.0 - ISC
|
|
3767
3754
|
*
|
|
3768
3755
|
* This source code is licensed under the ISC license.
|
|
3769
3756
|
* See the LICENSE file in the root directory of this source tree.
|
|
3770
3757
|
*/
|
|
3771
|
-
const __iconNode$
|
|
3772
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
3758
|
+
const __iconNode$j = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
3759
|
+
const Check = createLucideIcon("check", __iconNode$j);
|
|
3773
3760
|
/**
|
|
3774
3761
|
* @license lucide-react v0.552.0 - ISC
|
|
3775
3762
|
*
|
|
3776
3763
|
* This source code is licensed under the ISC license.
|
|
3777
3764
|
* See the LICENSE file in the root directory of this source tree.
|
|
3778
3765
|
*/
|
|
3779
|
-
const __iconNode$
|
|
3780
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
3766
|
+
const __iconNode$i = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
3767
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$i);
|
|
3781
3768
|
/**
|
|
3782
3769
|
* @license lucide-react v0.552.0 - ISC
|
|
3783
3770
|
*
|
|
3784
3771
|
* This source code is licensed under the ISC license.
|
|
3785
3772
|
* See the LICENSE file in the root directory of this source tree.
|
|
3786
3773
|
*/
|
|
3787
|
-
const __iconNode$
|
|
3774
|
+
const __iconNode$h = [
|
|
3788
3775
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
3789
3776
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
3790
3777
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
3791
3778
|
];
|
|
3792
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$
|
|
3779
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$h);
|
|
3793
3780
|
/**
|
|
3794
3781
|
* @license lucide-react v0.552.0 - ISC
|
|
3795
3782
|
*
|
|
3796
3783
|
* This source code is licensed under the ISC license.
|
|
3797
3784
|
* See the LICENSE file in the root directory of this source tree.
|
|
3798
3785
|
*/
|
|
3799
|
-
const __iconNode$
|
|
3786
|
+
const __iconNode$g = [
|
|
3800
3787
|
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
|
|
3801
3788
|
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
3802
3789
|
];
|
|
3803
|
-
const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$
|
|
3790
|
+
const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$g);
|
|
3804
3791
|
/**
|
|
3805
3792
|
* @license lucide-react v0.552.0 - ISC
|
|
3806
3793
|
*
|
|
3807
3794
|
* This source code is licensed under the ISC license.
|
|
3808
3795
|
* See the LICENSE file in the root directory of this source tree.
|
|
3809
3796
|
*/
|
|
3810
|
-
const __iconNode$
|
|
3797
|
+
const __iconNode$f = [
|
|
3811
3798
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
3812
3799
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
3813
3800
|
];
|
|
3814
|
-
const CircleCheck = createLucideIcon("circle-check", __iconNode$
|
|
3801
|
+
const CircleCheck = createLucideIcon("circle-check", __iconNode$f);
|
|
3815
3802
|
/**
|
|
3816
3803
|
* @license lucide-react v0.552.0 - ISC
|
|
3817
3804
|
*
|
|
3818
3805
|
* This source code is licensed under the ISC license.
|
|
3819
3806
|
* See the LICENSE file in the root directory of this source tree.
|
|
3820
3807
|
*/
|
|
3821
|
-
const __iconNode$
|
|
3808
|
+
const __iconNode$e = [
|
|
3822
3809
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
3823
3810
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
3824
3811
|
];
|
|
3825
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
3812
|
+
const Copy = createLucideIcon("copy", __iconNode$e);
|
|
3826
3813
|
/**
|
|
3827
3814
|
* @license lucide-react v0.552.0 - ISC
|
|
3828
3815
|
*
|
|
3829
3816
|
* This source code is licensed under the ISC license.
|
|
3830
3817
|
* See the LICENSE file in the root directory of this source tree.
|
|
3831
3818
|
*/
|
|
3832
|
-
const __iconNode$
|
|
3819
|
+
const __iconNode$d = [
|
|
3833
3820
|
["path", { d: "m15 15 6 6", key: "1s409w" }],
|
|
3834
3821
|
["path", { d: "m15 9 6-6", key: "ko1vev" }],
|
|
3835
3822
|
["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
|
|
@@ -3839,26 +3826,26 @@ const __iconNode$g = [
|
|
|
3839
3826
|
["path", { d: "M3 8V3h5", key: "1ln10m" }],
|
|
3840
3827
|
["path", { d: "M9 9 3 3", key: "v551iv" }]
|
|
3841
3828
|
];
|
|
3842
|
-
const Expand = createLucideIcon("expand", __iconNode$
|
|
3829
|
+
const Expand = createLucideIcon("expand", __iconNode$d);
|
|
3843
3830
|
/**
|
|
3844
3831
|
* @license lucide-react v0.552.0 - ISC
|
|
3845
3832
|
*
|
|
3846
3833
|
* This source code is licensed under the ISC license.
|
|
3847
3834
|
* See the LICENSE file in the root directory of this source tree.
|
|
3848
3835
|
*/
|
|
3849
|
-
const __iconNode$
|
|
3836
|
+
const __iconNode$c = [
|
|
3850
3837
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
3851
3838
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
3852
3839
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
3853
3840
|
];
|
|
3854
|
-
const ExternalLink = createLucideIcon("external-link", __iconNode$
|
|
3841
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$c);
|
|
3855
3842
|
/**
|
|
3856
3843
|
* @license lucide-react v0.552.0 - ISC
|
|
3857
3844
|
*
|
|
3858
3845
|
* This source code is licensed under the ISC license.
|
|
3859
3846
|
* See the LICENSE file in the root directory of this source tree.
|
|
3860
3847
|
*/
|
|
3861
|
-
const __iconNode$
|
|
3848
|
+
const __iconNode$b = [
|
|
3862
3849
|
[
|
|
3863
3850
|
"path",
|
|
3864
3851
|
{
|
|
@@ -3871,30 +3858,14 @@ const __iconNode$e = [
|
|
|
3871
3858
|
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
3872
3859
|
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
3873
3860
|
];
|
|
3874
|
-
const FileText = createLucideIcon("file-text", __iconNode$
|
|
3875
|
-
/**
|
|
3876
|
-
* @license lucide-react v0.552.0 - ISC
|
|
3877
|
-
*
|
|
3878
|
-
* This source code is licensed under the ISC license.
|
|
3879
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
3880
|
-
*/
|
|
3881
|
-
const __iconNode$d = [
|
|
3882
|
-
[
|
|
3883
|
-
"path",
|
|
3884
|
-
{
|
|
3885
|
-
d: "M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",
|
|
3886
|
-
key: "1jaruq"
|
|
3887
|
-
}
|
|
3888
|
-
]
|
|
3889
|
-
];
|
|
3890
|
-
const Flag = createLucideIcon("flag", __iconNode$d);
|
|
3861
|
+
const FileText = createLucideIcon("file-text", __iconNode$b);
|
|
3891
3862
|
/**
|
|
3892
3863
|
* @license lucide-react v0.552.0 - ISC
|
|
3893
3864
|
*
|
|
3894
3865
|
* This source code is licensed under the ISC license.
|
|
3895
3866
|
* See the LICENSE file in the root directory of this source tree.
|
|
3896
3867
|
*/
|
|
3897
|
-
const __iconNode$
|
|
3868
|
+
const __iconNode$a = [
|
|
3898
3869
|
["path", { d: "M12 10v6", key: "1bos4e" }],
|
|
3899
3870
|
["path", { d: "M9 13h6", key: "1uhe8q" }],
|
|
3900
3871
|
[
|
|
@@ -3905,35 +3876,22 @@ const __iconNode$c = [
|
|
|
3905
3876
|
}
|
|
3906
3877
|
]
|
|
3907
3878
|
];
|
|
3908
|
-
const FolderPlus = createLucideIcon("folder-plus", __iconNode$
|
|
3909
|
-
/**
|
|
3910
|
-
* @license lucide-react v0.552.0 - ISC
|
|
3911
|
-
*
|
|
3912
|
-
* This source code is licensed under the ISC license.
|
|
3913
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
3914
|
-
*/
|
|
3915
|
-
const __iconNode$b = [
|
|
3916
|
-
["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
|
|
3917
|
-
["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
|
|
3918
|
-
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
|
|
3919
|
-
["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
|
|
3920
|
-
];
|
|
3921
|
-
const GitBranch = createLucideIcon("git-branch", __iconNode$b);
|
|
3879
|
+
const FolderPlus = createLucideIcon("folder-plus", __iconNode$a);
|
|
3922
3880
|
/**
|
|
3923
3881
|
* @license lucide-react v0.552.0 - ISC
|
|
3924
3882
|
*
|
|
3925
3883
|
* This source code is licensed under the ISC license.
|
|
3926
3884
|
* See the LICENSE file in the root directory of this source tree.
|
|
3927
3885
|
*/
|
|
3928
|
-
const __iconNode$
|
|
3929
|
-
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$
|
|
3886
|
+
const __iconNode$9 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
3887
|
+
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$9);
|
|
3930
3888
|
/**
|
|
3931
3889
|
* @license lucide-react v0.552.0 - ISC
|
|
3932
3890
|
*
|
|
3933
3891
|
* This source code is licensed under the ISC license.
|
|
3934
3892
|
* See the LICENSE file in the root directory of this source tree.
|
|
3935
3893
|
*/
|
|
3936
|
-
const __iconNode$
|
|
3894
|
+
const __iconNode$8 = [
|
|
3937
3895
|
["path", { d: "M12 13v8", key: "1l5pq0" }],
|
|
3938
3896
|
["path", { d: "M12 3v3", key: "1n5kay" }],
|
|
3939
3897
|
[
|
|
@@ -3944,37 +3902,37 @@ const __iconNode$9 = [
|
|
|
3944
3902
|
}
|
|
3945
3903
|
]
|
|
3946
3904
|
];
|
|
3947
|
-
const Milestone = createLucideIcon("milestone", __iconNode$
|
|
3905
|
+
const Milestone = createLucideIcon("milestone", __iconNode$8);
|
|
3948
3906
|
/**
|
|
3949
3907
|
* @license lucide-react v0.552.0 - ISC
|
|
3950
3908
|
*
|
|
3951
3909
|
* This source code is licensed under the ISC license.
|
|
3952
3910
|
* See the LICENSE file in the root directory of this source tree.
|
|
3953
3911
|
*/
|
|
3954
|
-
const __iconNode$
|
|
3912
|
+
const __iconNode$7 = [
|
|
3955
3913
|
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
3956
3914
|
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
3957
3915
|
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
3958
3916
|
];
|
|
3959
|
-
const Monitor = createLucideIcon("monitor", __iconNode$
|
|
3917
|
+
const Monitor = createLucideIcon("monitor", __iconNode$7);
|
|
3960
3918
|
/**
|
|
3961
3919
|
* @license lucide-react v0.552.0 - ISC
|
|
3962
3920
|
*
|
|
3963
3921
|
* This source code is licensed under the ISC license.
|
|
3964
3922
|
* See the LICENSE file in the root directory of this source tree.
|
|
3965
3923
|
*/
|
|
3966
|
-
const __iconNode$
|
|
3924
|
+
const __iconNode$6 = [
|
|
3967
3925
|
["path", { d: "M18 8L22 12L18 16", key: "1r0oui" }],
|
|
3968
3926
|
["path", { d: "M2 12H22", key: "1m8cig" }]
|
|
3969
3927
|
];
|
|
3970
|
-
const MoveRight = createLucideIcon("move-right", __iconNode$
|
|
3928
|
+
const MoveRight = createLucideIcon("move-right", __iconNode$6);
|
|
3971
3929
|
/**
|
|
3972
3930
|
* @license lucide-react v0.552.0 - ISC
|
|
3973
3931
|
*
|
|
3974
3932
|
* This source code is licensed under the ISC license.
|
|
3975
3933
|
* See the LICENSE file in the root directory of this source tree.
|
|
3976
3934
|
*/
|
|
3977
|
-
const __iconNode$
|
|
3935
|
+
const __iconNode$5 = [
|
|
3978
3936
|
[
|
|
3979
3937
|
"path",
|
|
3980
3938
|
{
|
|
@@ -3983,59 +3941,42 @@ const __iconNode$6 = [
|
|
|
3983
3941
|
}
|
|
3984
3942
|
]
|
|
3985
3943
|
];
|
|
3986
|
-
const Play = createLucideIcon("play", __iconNode$
|
|
3944
|
+
const Play = createLucideIcon("play", __iconNode$5);
|
|
3987
3945
|
/**
|
|
3988
3946
|
* @license lucide-react v0.552.0 - ISC
|
|
3989
3947
|
*
|
|
3990
3948
|
* This source code is licensed under the ISC license.
|
|
3991
3949
|
* See the LICENSE file in the root directory of this source tree.
|
|
3992
3950
|
*/
|
|
3993
|
-
const __iconNode$
|
|
3951
|
+
const __iconNode$4 = [
|
|
3994
3952
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
3995
3953
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
3996
3954
|
];
|
|
3997
|
-
const Plus = createLucideIcon("plus", __iconNode$
|
|
3955
|
+
const Plus = createLucideIcon("plus", __iconNode$4);
|
|
3998
3956
|
/**
|
|
3999
3957
|
* @license lucide-react v0.552.0 - ISC
|
|
4000
3958
|
*
|
|
4001
3959
|
* This source code is licensed under the ISC license.
|
|
4002
3960
|
* See the LICENSE file in the root directory of this source tree.
|
|
4003
3961
|
*/
|
|
4004
|
-
const __iconNode$
|
|
3962
|
+
const __iconNode$3 = [
|
|
4005
3963
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
4006
3964
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
4007
3965
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
4008
3966
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
4009
3967
|
];
|
|
4010
|
-
const RefreshCw = createLucideIcon("refresh-cw", __iconNode$
|
|
3968
|
+
const RefreshCw = createLucideIcon("refresh-cw", __iconNode$3);
|
|
4011
3969
|
/**
|
|
4012
3970
|
* @license lucide-react v0.552.0 - ISC
|
|
4013
3971
|
*
|
|
4014
3972
|
* This source code is licensed under the ISC license.
|
|
4015
3973
|
* See the LICENSE file in the root directory of this source tree.
|
|
4016
3974
|
*/
|
|
4017
|
-
const __iconNode$
|
|
3975
|
+
const __iconNode$2 = [
|
|
4018
3976
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
4019
3977
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
4020
3978
|
];
|
|
4021
|
-
const Search = createLucideIcon("search", __iconNode$
|
|
4022
|
-
/**
|
|
4023
|
-
* @license lucide-react v0.552.0 - ISC
|
|
4024
|
-
*
|
|
4025
|
-
* This source code is licensed under the ISC license.
|
|
4026
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
4027
|
-
*/
|
|
4028
|
-
const __iconNode$2 = [
|
|
4029
|
-
[
|
|
4030
|
-
"path",
|
|
4031
|
-
{
|
|
4032
|
-
d: "M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",
|
|
4033
|
-
key: "vktsd0"
|
|
4034
|
-
}
|
|
4035
|
-
],
|
|
4036
|
-
["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }]
|
|
4037
|
-
];
|
|
4038
|
-
const Tag = createLucideIcon("tag", __iconNode$2);
|
|
3979
|
+
const Search = createLucideIcon("search", __iconNode$2);
|
|
4039
3980
|
/**
|
|
4040
3981
|
* @license lucide-react v0.552.0 - ISC
|
|
4041
3982
|
*
|
|
@@ -4043,10 +3984,13 @@ const Tag = createLucideIcon("tag", __iconNode$2);
|
|
|
4043
3984
|
* See the LICENSE file in the root directory of this source tree.
|
|
4044
3985
|
*/
|
|
4045
3986
|
const __iconNode$1 = [
|
|
4046
|
-
["path", { d: "
|
|
4047
|
-
["
|
|
3987
|
+
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
3988
|
+
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
3989
|
+
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
3990
|
+
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
3991
|
+
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
4048
3992
|
];
|
|
4049
|
-
const
|
|
3993
|
+
const Trash2 = createLucideIcon("trash-2", __iconNode$1);
|
|
4050
3994
|
/**
|
|
4051
3995
|
* @license lucide-react v0.552.0 - ISC
|
|
4052
3996
|
*
|
|
@@ -4081,280 +4025,2342 @@ var useTheme = () => {
|
|
|
4081
4025
|
}
|
|
4082
4026
|
return context;
|
|
4083
4027
|
};
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
acceptanceCriteriaItems: acceptanceCriteria,
|
|
4107
|
-
filePath
|
|
4108
|
-
};
|
|
4109
|
-
}
|
|
4110
|
-
function serializeTaskMarkdown(task) {
|
|
4111
|
-
const lines = [];
|
|
4112
|
-
lines.push("---");
|
|
4113
|
-
lines.push(`status: ${task.status}`);
|
|
4114
|
-
if (task.priority) {
|
|
4115
|
-
lines.push(`priority: ${task.priority}`);
|
|
4116
|
-
}
|
|
4117
|
-
if (task.assignee && task.assignee.length > 0) {
|
|
4118
|
-
lines.push(`assignee: [${task.assignee.join(", ")}]`);
|
|
4119
|
-
}
|
|
4120
|
-
if (task.reporter) {
|
|
4121
|
-
lines.push(`reporter: ${task.reporter}`);
|
|
4122
|
-
}
|
|
4123
|
-
if (task.labels && task.labels.length > 0) {
|
|
4124
|
-
lines.push(`labels: [${task.labels.join(", ")}]`);
|
|
4125
|
-
}
|
|
4126
|
-
if (task.milestone) {
|
|
4127
|
-
lines.push(`milestone: ${task.milestone}`);
|
|
4128
|
-
}
|
|
4129
|
-
if (task.dependencies && task.dependencies.length > 0) {
|
|
4130
|
-
lines.push(`dependencies: [${task.dependencies.join(", ")}]`);
|
|
4131
|
-
}
|
|
4132
|
-
if (task.references && task.references.length > 0) {
|
|
4133
|
-
lines.push(`references: [${task.references.join(", ")}]`);
|
|
4134
|
-
}
|
|
4135
|
-
if (task.parentTaskId) {
|
|
4136
|
-
lines.push(`parentTaskId: ${task.parentTaskId}`);
|
|
4137
|
-
}
|
|
4138
|
-
if (task.subtasks && task.subtasks.length > 0) {
|
|
4139
|
-
lines.push(`subtasks: [${task.subtasks.join(", ")}]`);
|
|
4140
|
-
}
|
|
4141
|
-
if (task.branch) {
|
|
4142
|
-
lines.push(`branch: ${task.branch}`);
|
|
4143
|
-
}
|
|
4144
|
-
if (task.ordinal !== void 0) {
|
|
4145
|
-
lines.push(`ordinal: ${task.ordinal}`);
|
|
4146
|
-
}
|
|
4147
|
-
if (task.createdDate) {
|
|
4148
|
-
lines.push(`createdDate: ${task.createdDate}`);
|
|
4149
|
-
}
|
|
4150
|
-
if (task.updatedDate) {
|
|
4151
|
-
lines.push(`updatedDate: ${task.updatedDate}`);
|
|
4028
|
+
const PanelGroupContext$1 = createContext(null);
|
|
4029
|
+
PanelGroupContext$1.displayName = "PanelGroupContext";
|
|
4030
|
+
const DATA_ATTRIBUTES$1 = {
|
|
4031
|
+
group: "data-panel-group",
|
|
4032
|
+
groupDirection: "data-panel-group-direction",
|
|
4033
|
+
groupId: "data-panel-group-id",
|
|
4034
|
+
panel: "data-panel",
|
|
4035
|
+
panelCollapsible: "data-panel-collapsible",
|
|
4036
|
+
panelId: "data-panel-id",
|
|
4037
|
+
panelSize: "data-panel-size",
|
|
4038
|
+
resizeHandleId: "data-panel-resize-handle-id"
|
|
4039
|
+
};
|
|
4040
|
+
const PRECISION$1 = 10;
|
|
4041
|
+
const useIsomorphicLayoutEffect$1 = useLayoutEffect;
|
|
4042
|
+
const useId$1 = React2["useId".toString()];
|
|
4043
|
+
const wrappedUseId$1 = typeof useId$1 === "function" ? useId$1 : () => null;
|
|
4044
|
+
let counter$1 = 0;
|
|
4045
|
+
function useUniqueId$1(idFromParams = null) {
|
|
4046
|
+
const idFromUseId = wrappedUseId$1();
|
|
4047
|
+
const idRef = useRef(idFromParams || idFromUseId || null);
|
|
4048
|
+
if (idRef.current === null) {
|
|
4049
|
+
idRef.current = "" + counter$1++;
|
|
4152
4050
|
}
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4051
|
+
return idFromParams !== null && idFromParams !== void 0 ? idFromParams : idRef.current;
|
|
4052
|
+
}
|
|
4053
|
+
function PanelWithForwardedRef$1({
|
|
4054
|
+
children: children2,
|
|
4055
|
+
className: classNameFromProps = "",
|
|
4056
|
+
collapsedSize,
|
|
4057
|
+
collapsible,
|
|
4058
|
+
defaultSize,
|
|
4059
|
+
forwardedRef,
|
|
4060
|
+
id: idFromProps,
|
|
4061
|
+
maxSize,
|
|
4062
|
+
minSize,
|
|
4063
|
+
onCollapse,
|
|
4064
|
+
onExpand,
|
|
4065
|
+
onResize,
|
|
4066
|
+
order: order2,
|
|
4067
|
+
style: styleFromProps,
|
|
4068
|
+
tagName: Type = "div",
|
|
4069
|
+
...rest
|
|
4070
|
+
}) {
|
|
4071
|
+
const context = useContext(PanelGroupContext$1);
|
|
4072
|
+
if (context === null) {
|
|
4073
|
+
throw Error(`Panel components must be rendered within a PanelGroup container`);
|
|
4160
4074
|
}
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4075
|
+
const {
|
|
4076
|
+
collapsePanel,
|
|
4077
|
+
expandPanel,
|
|
4078
|
+
getPanelSize,
|
|
4079
|
+
getPanelStyle,
|
|
4080
|
+
groupId,
|
|
4081
|
+
isPanelCollapsed,
|
|
4082
|
+
reevaluatePanelConstraints,
|
|
4083
|
+
registerPanel,
|
|
4084
|
+
resizePanel: resizePanel2,
|
|
4085
|
+
unregisterPanel
|
|
4086
|
+
} = context;
|
|
4087
|
+
const panelId = useUniqueId$1(idFromProps);
|
|
4088
|
+
const panelDataRef = useRef({
|
|
4089
|
+
callbacks: {
|
|
4090
|
+
onCollapse,
|
|
4091
|
+
onExpand,
|
|
4092
|
+
onResize
|
|
4093
|
+
},
|
|
4094
|
+
constraints: {
|
|
4095
|
+
collapsedSize,
|
|
4096
|
+
collapsible,
|
|
4097
|
+
defaultSize,
|
|
4098
|
+
maxSize,
|
|
4099
|
+
minSize
|
|
4100
|
+
},
|
|
4101
|
+
id: panelId,
|
|
4102
|
+
idIsFromProps: idFromProps !== void 0,
|
|
4103
|
+
order: order2
|
|
4104
|
+
});
|
|
4105
|
+
useRef({
|
|
4106
|
+
didLogMissingDefaultSizeWarning: false
|
|
4107
|
+
});
|
|
4108
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
4109
|
+
const {
|
|
4110
|
+
callbacks,
|
|
4111
|
+
constraints
|
|
4112
|
+
} = panelDataRef.current;
|
|
4113
|
+
const prevConstraints = {
|
|
4114
|
+
...constraints
|
|
4115
|
+
};
|
|
4116
|
+
panelDataRef.current.id = panelId;
|
|
4117
|
+
panelDataRef.current.idIsFromProps = idFromProps !== void 0;
|
|
4118
|
+
panelDataRef.current.order = order2;
|
|
4119
|
+
callbacks.onCollapse = onCollapse;
|
|
4120
|
+
callbacks.onExpand = onExpand;
|
|
4121
|
+
callbacks.onResize = onResize;
|
|
4122
|
+
constraints.collapsedSize = collapsedSize;
|
|
4123
|
+
constraints.collapsible = collapsible;
|
|
4124
|
+
constraints.defaultSize = defaultSize;
|
|
4125
|
+
constraints.maxSize = maxSize;
|
|
4126
|
+
constraints.minSize = minSize;
|
|
4127
|
+
if (prevConstraints.collapsedSize !== constraints.collapsedSize || prevConstraints.collapsible !== constraints.collapsible || prevConstraints.maxSize !== constraints.maxSize || prevConstraints.minSize !== constraints.minSize) {
|
|
4128
|
+
reevaluatePanelConstraints(panelDataRef.current, prevConstraints);
|
|
4167
4129
|
}
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
}
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4130
|
+
});
|
|
4131
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
4132
|
+
const panelData = panelDataRef.current;
|
|
4133
|
+
registerPanel(panelData);
|
|
4134
|
+
return () => {
|
|
4135
|
+
unregisterPanel(panelData);
|
|
4136
|
+
};
|
|
4137
|
+
}, [order2, panelId, registerPanel, unregisterPanel]);
|
|
4138
|
+
useImperativeHandle(forwardedRef, () => ({
|
|
4139
|
+
collapse: () => {
|
|
4140
|
+
collapsePanel(panelDataRef.current);
|
|
4141
|
+
},
|
|
4142
|
+
expand: (minSize2) => {
|
|
4143
|
+
expandPanel(panelDataRef.current, minSize2);
|
|
4144
|
+
},
|
|
4145
|
+
getId() {
|
|
4146
|
+
return panelId;
|
|
4147
|
+
},
|
|
4148
|
+
getSize() {
|
|
4149
|
+
return getPanelSize(panelDataRef.current);
|
|
4150
|
+
},
|
|
4151
|
+
isCollapsed() {
|
|
4152
|
+
return isPanelCollapsed(panelDataRef.current);
|
|
4153
|
+
},
|
|
4154
|
+
isExpanded() {
|
|
4155
|
+
return !isPanelCollapsed(panelDataRef.current);
|
|
4156
|
+
},
|
|
4157
|
+
resize: (size) => {
|
|
4158
|
+
resizePanel2(panelDataRef.current, size);
|
|
4159
|
+
}
|
|
4160
|
+
}), [collapsePanel, expandPanel, getPanelSize, isPanelCollapsed, panelId, resizePanel2]);
|
|
4161
|
+
const style2 = getPanelStyle(panelDataRef.current, defaultSize);
|
|
4162
|
+
return createElement(Type, {
|
|
4163
|
+
...rest,
|
|
4164
|
+
children: children2,
|
|
4165
|
+
className: classNameFromProps,
|
|
4166
|
+
id: panelId,
|
|
4167
|
+
style: {
|
|
4168
|
+
...style2,
|
|
4169
|
+
...styleFromProps
|
|
4170
|
+
},
|
|
4171
|
+
// CSS selectors
|
|
4172
|
+
[DATA_ATTRIBUTES$1.groupId]: groupId,
|
|
4173
|
+
[DATA_ATTRIBUTES$1.panel]: "",
|
|
4174
|
+
[DATA_ATTRIBUTES$1.panelCollapsible]: collapsible || void 0,
|
|
4175
|
+
[DATA_ATTRIBUTES$1.panelId]: panelId,
|
|
4176
|
+
[DATA_ATTRIBUTES$1.panelSize]: parseFloat("" + style2.flexGrow).toFixed(1)
|
|
4177
|
+
});
|
|
4183
4178
|
}
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
let title = "";
|
|
4193
|
-
const titleMatch = remaining.match(/^#\s+(.+)$/m);
|
|
4194
|
-
if (titleMatch) {
|
|
4195
|
-
title = titleMatch[1].trim();
|
|
4196
|
-
}
|
|
4197
|
-
const acceptanceCriteria = parseAcceptanceCriteria(remaining);
|
|
4198
|
-
const rawContent = remaining.trim();
|
|
4199
|
-
const description = extractDescription(remaining, title);
|
|
4200
|
-
return { frontmatter, title, rawContent, description, acceptanceCriteria };
|
|
4179
|
+
const Panel$1 = forwardRef((props, ref) => createElement(PanelWithForwardedRef$1, {
|
|
4180
|
+
...props,
|
|
4181
|
+
forwardedRef: ref
|
|
4182
|
+
}));
|
|
4183
|
+
PanelWithForwardedRef$1.displayName = "Panel";
|
|
4184
|
+
Panel$1.displayName = "forwardRef(Panel)";
|
|
4185
|
+
function isKeyDown$1(event) {
|
|
4186
|
+
return event.type === "keydown";
|
|
4201
4187
|
}
|
|
4202
|
-
function
|
|
4203
|
-
|
|
4204
|
-
for (const line of raw2.split("\n")) {
|
|
4205
|
-
const match = line.match(/^(\w+):\s*(.+)$/);
|
|
4206
|
-
if (!match)
|
|
4207
|
-
continue;
|
|
4208
|
-
const [, key2, value] = match;
|
|
4209
|
-
switch (key2) {
|
|
4210
|
-
case "status":
|
|
4211
|
-
result.status = value.trim();
|
|
4212
|
-
break;
|
|
4213
|
-
case "priority":
|
|
4214
|
-
result.priority = value.trim();
|
|
4215
|
-
break;
|
|
4216
|
-
case "ordinal":
|
|
4217
|
-
result.ordinal = parseInt(value.trim(), 10);
|
|
4218
|
-
break;
|
|
4219
|
-
case "reporter":
|
|
4220
|
-
case "milestone":
|
|
4221
|
-
case "parentTaskId":
|
|
4222
|
-
case "branch":
|
|
4223
|
-
case "createdDate":
|
|
4224
|
-
case "updatedDate":
|
|
4225
|
-
result[key2] = value.trim();
|
|
4226
|
-
break;
|
|
4227
|
-
case "assignee":
|
|
4228
|
-
case "labels":
|
|
4229
|
-
case "dependencies":
|
|
4230
|
-
case "references":
|
|
4231
|
-
case "subtasks":
|
|
4232
|
-
result[key2] = parseArrayValue(value);
|
|
4233
|
-
break;
|
|
4234
|
-
}
|
|
4235
|
-
}
|
|
4236
|
-
return result;
|
|
4188
|
+
function isPointerEvent$1(event) {
|
|
4189
|
+
return event.type.startsWith("pointer");
|
|
4237
4190
|
}
|
|
4238
|
-
function
|
|
4239
|
-
|
|
4240
|
-
if (!cleaned)
|
|
4241
|
-
return [];
|
|
4242
|
-
return cleaned.split(",").map((s2) => s2.trim()).filter(Boolean);
|
|
4191
|
+
function isMouseEvent$1(event) {
|
|
4192
|
+
return event.type.startsWith("mouse");
|
|
4243
4193
|
}
|
|
4244
|
-
function
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4194
|
+
function getResizeEventCoordinates$1(event) {
|
|
4195
|
+
if (isPointerEvent$1(event)) {
|
|
4196
|
+
if (event.isPrimary) {
|
|
4197
|
+
return {
|
|
4198
|
+
x: event.clientX,
|
|
4199
|
+
y: event.clientY
|
|
4200
|
+
};
|
|
4201
|
+
}
|
|
4202
|
+
} else if (isMouseEvent$1(event)) {
|
|
4203
|
+
return {
|
|
4204
|
+
x: event.clientX,
|
|
4205
|
+
y: event.clientY
|
|
4206
|
+
};
|
|
4255
4207
|
}
|
|
4256
|
-
return
|
|
4208
|
+
return {
|
|
4209
|
+
x: Infinity,
|
|
4210
|
+
y: Infinity
|
|
4211
|
+
};
|
|
4257
4212
|
}
|
|
4258
|
-
function
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
return stripHtmlComments(descriptionSection).trim();
|
|
4262
|
-
}
|
|
4263
|
-
let body = content2;
|
|
4264
|
-
if (title) {
|
|
4265
|
-
body = body.replace(new RegExp(`^#\\s+${escapeRegex(title)}\\s*\\n?`, "m"), "");
|
|
4266
|
-
}
|
|
4267
|
-
const firstSectionMatch = body.match(/^##\s+/m);
|
|
4268
|
-
if (firstSectionMatch && firstSectionMatch.index !== void 0) {
|
|
4269
|
-
body = body.slice(0, firstSectionMatch.index);
|
|
4213
|
+
function getInputType$1() {
|
|
4214
|
+
if (typeof matchMedia === "function") {
|
|
4215
|
+
return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
|
|
4270
4216
|
}
|
|
4271
|
-
body = stripHtmlComments(body);
|
|
4272
|
-
return body.trim();
|
|
4273
4217
|
}
|
|
4274
|
-
|
|
4275
|
-
|
|
4218
|
+
const EXCEEDED_HORIZONTAL_MIN$1 = 1;
|
|
4219
|
+
const EXCEEDED_HORIZONTAL_MAX$1 = 2;
|
|
4220
|
+
const EXCEEDED_VERTICAL_MIN$1 = 4;
|
|
4221
|
+
const EXCEEDED_VERTICAL_MAX$1 = 8;
|
|
4222
|
+
getInputType$1() === "coarse";
|
|
4223
|
+
let panelConstraintFlags$1 = /* @__PURE__ */ new Map();
|
|
4224
|
+
function reportConstraintsViolation$1(resizeHandleId, flag) {
|
|
4225
|
+
panelConstraintFlags$1.set(resizeHandleId, flag);
|
|
4276
4226
|
}
|
|
4277
|
-
function
|
|
4278
|
-
const
|
|
4279
|
-
|
|
4280
|
-
if (match) {
|
|
4281
|
-
return match[1];
|
|
4282
|
-
}
|
|
4283
|
-
return filename.replace(/\.md$/, "");
|
|
4227
|
+
function useForceUpdate$1() {
|
|
4228
|
+
const [_, setCount] = useState(0);
|
|
4229
|
+
return useCallback(() => setCount((prevCount) => prevCount + 1), []);
|
|
4284
4230
|
}
|
|
4285
|
-
function
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
return match[1].trim();
|
|
4231
|
+
function assert$1(expectedCondition, message) {
|
|
4232
|
+
if (!expectedCondition) {
|
|
4233
|
+
console.error(message);
|
|
4234
|
+
throw Error(message);
|
|
4290
4235
|
}
|
|
4291
|
-
return filename.replace(/\.md$/, "");
|
|
4292
4236
|
}
|
|
4293
|
-
function
|
|
4294
|
-
if (
|
|
4295
|
-
return
|
|
4237
|
+
function fuzzyCompareNumbers$1(actual, expected, fractionDigits = PRECISION$1) {
|
|
4238
|
+
if (actual.toFixed(fractionDigits) === expected.toFixed(fractionDigits)) {
|
|
4239
|
+
return 0;
|
|
4240
|
+
} else {
|
|
4241
|
+
return actual > expected ? 1 : -1;
|
|
4296
4242
|
}
|
|
4297
|
-
return "tasks";
|
|
4298
|
-
}
|
|
4299
|
-
function extractTaskIndexFromPath(filePath) {
|
|
4300
|
-
return {
|
|
4301
|
-
id: extractIdFromPath(filePath),
|
|
4302
|
-
filePath,
|
|
4303
|
-
title: extractTitleFromPath(filePath),
|
|
4304
|
-
source: extractSourceFromPath(filePath)
|
|
4305
|
-
};
|
|
4306
4243
|
}
|
|
4307
|
-
function
|
|
4308
|
-
return
|
|
4244
|
+
function fuzzyNumbersEqual$1$1(actual, expected, fractionDigits = PRECISION$1) {
|
|
4245
|
+
return fuzzyCompareNumbers$1(actual, expected, fractionDigits) === 0;
|
|
4309
4246
|
}
|
|
4310
|
-
function
|
|
4311
|
-
|
|
4312
|
-
const src = content2.replace(/\r\n/g, "\n");
|
|
4313
|
-
const regex2 = new RegExp(`## ${sectionTitle}\\s*\\n([\\s\\S]*?)(?=\\n## |$)`, "i");
|
|
4314
|
-
const match = src.match(regex2);
|
|
4315
|
-
return (_a = match == null ? void 0 : match[1]) == null ? void 0 : _a.trim();
|
|
4247
|
+
function fuzzyNumbersEqual$2(actual, expected, fractionDigits) {
|
|
4248
|
+
return fuzzyCompareNumbers$1(actual, expected, fractionDigits) === 0;
|
|
4316
4249
|
}
|
|
4317
|
-
function
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
const
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
cleanValue = cleanValue.slice(1, -1);
|
|
4327
|
-
}
|
|
4328
|
-
switch (key2) {
|
|
4329
|
-
case "id":
|
|
4330
|
-
case "title":
|
|
4331
|
-
result[key2] = cleanValue;
|
|
4332
|
-
break;
|
|
4333
|
-
case "tasks":
|
|
4334
|
-
if (cleanValue.startsWith("[") && cleanValue.endsWith("]")) {
|
|
4335
|
-
result.tasks = cleanValue.slice(1, -1).split(",").map((s2) => s2.trim()).filter(Boolean);
|
|
4336
|
-
}
|
|
4337
|
-
break;
|
|
4250
|
+
function fuzzyLayoutsEqual$1(actual, expected, fractionDigits) {
|
|
4251
|
+
if (actual.length !== expected.length) {
|
|
4252
|
+
return false;
|
|
4253
|
+
}
|
|
4254
|
+
for (let index2 = 0; index2 < actual.length; index2++) {
|
|
4255
|
+
const actualSize = actual[index2];
|
|
4256
|
+
const expectedSize = expected[index2];
|
|
4257
|
+
if (!fuzzyNumbersEqual$2(actualSize, expectedSize, fractionDigits)) {
|
|
4258
|
+
return false;
|
|
4338
4259
|
}
|
|
4339
4260
|
}
|
|
4340
|
-
return
|
|
4261
|
+
return true;
|
|
4341
4262
|
}
|
|
4342
|
-
function
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4263
|
+
function resizePanel$1({
|
|
4264
|
+
panelConstraints: panelConstraintsArray,
|
|
4265
|
+
panelIndex,
|
|
4266
|
+
size
|
|
4267
|
+
}) {
|
|
4268
|
+
const panelConstraints = panelConstraintsArray[panelIndex];
|
|
4269
|
+
assert$1(panelConstraints != null, `Panel constraints not found for index ${panelIndex}`);
|
|
4270
|
+
let {
|
|
4271
|
+
collapsedSize = 0,
|
|
4272
|
+
collapsible,
|
|
4273
|
+
maxSize = 100,
|
|
4274
|
+
minSize = 0
|
|
4275
|
+
} = panelConstraints;
|
|
4276
|
+
if (fuzzyCompareNumbers$1(size, minSize) < 0) {
|
|
4277
|
+
if (collapsible) {
|
|
4278
|
+
const halfwayPoint = (collapsedSize + minSize) / 2;
|
|
4279
|
+
if (fuzzyCompareNumbers$1(size, halfwayPoint) < 0) {
|
|
4280
|
+
size = collapsedSize;
|
|
4281
|
+
} else {
|
|
4282
|
+
size = minSize;
|
|
4283
|
+
}
|
|
4284
|
+
} else {
|
|
4285
|
+
size = minSize;
|
|
4286
|
+
}
|
|
4349
4287
|
}
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
return
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4288
|
+
size = Math.min(maxSize, size);
|
|
4289
|
+
size = parseFloat(size.toFixed(PRECISION$1));
|
|
4290
|
+
return size;
|
|
4291
|
+
}
|
|
4292
|
+
function adjustLayoutByDelta$1({
|
|
4293
|
+
delta,
|
|
4294
|
+
initialLayout,
|
|
4295
|
+
panelConstraints: panelConstraintsArray,
|
|
4296
|
+
pivotIndices,
|
|
4297
|
+
prevLayout,
|
|
4298
|
+
trigger
|
|
4299
|
+
}) {
|
|
4300
|
+
if (fuzzyNumbersEqual$2(delta, 0)) {
|
|
4301
|
+
return initialLayout;
|
|
4302
|
+
}
|
|
4303
|
+
const nextLayout = [...initialLayout];
|
|
4304
|
+
const [firstPivotIndex, secondPivotIndex] = pivotIndices;
|
|
4305
|
+
assert$1(firstPivotIndex != null, "Invalid first pivot index");
|
|
4306
|
+
assert$1(secondPivotIndex != null, "Invalid second pivot index");
|
|
4307
|
+
let deltaApplied = 0;
|
|
4308
|
+
{
|
|
4309
|
+
if (trigger === "keyboard") {
|
|
4310
|
+
{
|
|
4311
|
+
const index2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
|
|
4312
|
+
const panelConstraints = panelConstraintsArray[index2];
|
|
4313
|
+
assert$1(panelConstraints, `Panel constraints not found for index ${index2}`);
|
|
4314
|
+
const {
|
|
4315
|
+
collapsedSize = 0,
|
|
4316
|
+
collapsible,
|
|
4317
|
+
minSize = 0
|
|
4318
|
+
} = panelConstraints;
|
|
4319
|
+
if (collapsible) {
|
|
4320
|
+
const prevSize = initialLayout[index2];
|
|
4321
|
+
assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
|
|
4322
|
+
if (fuzzyNumbersEqual$2(prevSize, collapsedSize)) {
|
|
4323
|
+
const localDelta = minSize - prevSize;
|
|
4324
|
+
if (fuzzyCompareNumbers$1(localDelta, Math.abs(delta)) > 0) {
|
|
4325
|
+
delta = delta < 0 ? 0 - localDelta : localDelta;
|
|
4326
|
+
}
|
|
4327
|
+
}
|
|
4328
|
+
}
|
|
4329
|
+
}
|
|
4330
|
+
{
|
|
4331
|
+
const index2 = delta < 0 ? firstPivotIndex : secondPivotIndex;
|
|
4332
|
+
const panelConstraints = panelConstraintsArray[index2];
|
|
4333
|
+
assert$1(panelConstraints, `No panel constraints found for index ${index2}`);
|
|
4334
|
+
const {
|
|
4335
|
+
collapsedSize = 0,
|
|
4336
|
+
collapsible,
|
|
4337
|
+
minSize = 0
|
|
4338
|
+
} = panelConstraints;
|
|
4339
|
+
if (collapsible) {
|
|
4340
|
+
const prevSize = initialLayout[index2];
|
|
4341
|
+
assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
|
|
4342
|
+
if (fuzzyNumbersEqual$2(prevSize, minSize)) {
|
|
4343
|
+
const localDelta = prevSize - collapsedSize;
|
|
4344
|
+
if (fuzzyCompareNumbers$1(localDelta, Math.abs(delta)) > 0) {
|
|
4345
|
+
delta = delta < 0 ? 0 - localDelta : localDelta;
|
|
4346
|
+
}
|
|
4347
|
+
}
|
|
4348
|
+
}
|
|
4349
|
+
}
|
|
4350
|
+
}
|
|
4351
|
+
}
|
|
4352
|
+
{
|
|
4353
|
+
const increment2 = delta < 0 ? 1 : -1;
|
|
4354
|
+
let index2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
|
|
4355
|
+
let maxAvailableDelta = 0;
|
|
4356
|
+
while (true) {
|
|
4357
|
+
const prevSize = initialLayout[index2];
|
|
4358
|
+
assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
|
|
4359
|
+
const maxSafeSize = resizePanel$1({
|
|
4360
|
+
panelConstraints: panelConstraintsArray,
|
|
4361
|
+
panelIndex: index2,
|
|
4362
|
+
size: 100
|
|
4363
|
+
});
|
|
4364
|
+
const delta2 = maxSafeSize - prevSize;
|
|
4365
|
+
maxAvailableDelta += delta2;
|
|
4366
|
+
index2 += increment2;
|
|
4367
|
+
if (index2 < 0 || index2 >= panelConstraintsArray.length) {
|
|
4368
|
+
break;
|
|
4369
|
+
}
|
|
4370
|
+
}
|
|
4371
|
+
const minAbsDelta = Math.min(Math.abs(delta), Math.abs(maxAvailableDelta));
|
|
4372
|
+
delta = delta < 0 ? 0 - minAbsDelta : minAbsDelta;
|
|
4373
|
+
}
|
|
4374
|
+
{
|
|
4375
|
+
const pivotIndex = delta < 0 ? firstPivotIndex : secondPivotIndex;
|
|
4376
|
+
let index2 = pivotIndex;
|
|
4377
|
+
while (index2 >= 0 && index2 < panelConstraintsArray.length) {
|
|
4378
|
+
const deltaRemaining = Math.abs(delta) - Math.abs(deltaApplied);
|
|
4379
|
+
const prevSize = initialLayout[index2];
|
|
4380
|
+
assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
|
|
4381
|
+
const unsafeSize = prevSize - deltaRemaining;
|
|
4382
|
+
const safeSize = resizePanel$1({
|
|
4383
|
+
panelConstraints: panelConstraintsArray,
|
|
4384
|
+
panelIndex: index2,
|
|
4385
|
+
size: unsafeSize
|
|
4386
|
+
});
|
|
4387
|
+
if (!fuzzyNumbersEqual$2(prevSize, safeSize)) {
|
|
4388
|
+
deltaApplied += prevSize - safeSize;
|
|
4389
|
+
nextLayout[index2] = safeSize;
|
|
4390
|
+
if (deltaApplied.toFixed(3).localeCompare(Math.abs(delta).toFixed(3), void 0, {
|
|
4391
|
+
numeric: true
|
|
4392
|
+
}) >= 0) {
|
|
4393
|
+
break;
|
|
4394
|
+
}
|
|
4395
|
+
}
|
|
4396
|
+
if (delta < 0) {
|
|
4397
|
+
index2--;
|
|
4398
|
+
} else {
|
|
4399
|
+
index2++;
|
|
4400
|
+
}
|
|
4401
|
+
}
|
|
4402
|
+
}
|
|
4403
|
+
if (fuzzyLayoutsEqual$1(prevLayout, nextLayout)) {
|
|
4404
|
+
return prevLayout;
|
|
4405
|
+
}
|
|
4406
|
+
{
|
|
4407
|
+
const pivotIndex = delta < 0 ? secondPivotIndex : firstPivotIndex;
|
|
4408
|
+
const prevSize = initialLayout[pivotIndex];
|
|
4409
|
+
assert$1(prevSize != null, `Previous layout not found for panel index ${pivotIndex}`);
|
|
4410
|
+
const unsafeSize = prevSize + deltaApplied;
|
|
4411
|
+
const safeSize = resizePanel$1({
|
|
4412
|
+
panelConstraints: panelConstraintsArray,
|
|
4413
|
+
panelIndex: pivotIndex,
|
|
4414
|
+
size: unsafeSize
|
|
4415
|
+
});
|
|
4416
|
+
nextLayout[pivotIndex] = safeSize;
|
|
4417
|
+
if (!fuzzyNumbersEqual$2(safeSize, unsafeSize)) {
|
|
4418
|
+
let deltaRemaining = unsafeSize - safeSize;
|
|
4419
|
+
const pivotIndex2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
|
|
4420
|
+
let index2 = pivotIndex2;
|
|
4421
|
+
while (index2 >= 0 && index2 < panelConstraintsArray.length) {
|
|
4422
|
+
const prevSize2 = nextLayout[index2];
|
|
4423
|
+
assert$1(prevSize2 != null, `Previous layout not found for panel index ${index2}`);
|
|
4424
|
+
const unsafeSize2 = prevSize2 + deltaRemaining;
|
|
4425
|
+
const safeSize2 = resizePanel$1({
|
|
4426
|
+
panelConstraints: panelConstraintsArray,
|
|
4427
|
+
panelIndex: index2,
|
|
4428
|
+
size: unsafeSize2
|
|
4429
|
+
});
|
|
4430
|
+
if (!fuzzyNumbersEqual$2(prevSize2, safeSize2)) {
|
|
4431
|
+
deltaRemaining -= safeSize2 - prevSize2;
|
|
4432
|
+
nextLayout[index2] = safeSize2;
|
|
4433
|
+
}
|
|
4434
|
+
if (fuzzyNumbersEqual$2(deltaRemaining, 0)) {
|
|
4435
|
+
break;
|
|
4436
|
+
}
|
|
4437
|
+
if (delta > 0) {
|
|
4438
|
+
index2--;
|
|
4439
|
+
} else {
|
|
4440
|
+
index2++;
|
|
4441
|
+
}
|
|
4442
|
+
}
|
|
4443
|
+
}
|
|
4444
|
+
}
|
|
4445
|
+
const totalSize = nextLayout.reduce((total, size) => size + total, 0);
|
|
4446
|
+
if (!fuzzyNumbersEqual$2(totalSize, 100)) {
|
|
4447
|
+
return prevLayout;
|
|
4448
|
+
}
|
|
4449
|
+
return nextLayout;
|
|
4450
|
+
}
|
|
4451
|
+
function calculateAriaValues$1({
|
|
4452
|
+
layout,
|
|
4453
|
+
panelsArray,
|
|
4454
|
+
pivotIndices
|
|
4455
|
+
}) {
|
|
4456
|
+
let currentMinSize = 0;
|
|
4457
|
+
let currentMaxSize = 100;
|
|
4458
|
+
let totalMinSize = 0;
|
|
4459
|
+
let totalMaxSize = 0;
|
|
4460
|
+
const firstIndex = pivotIndices[0];
|
|
4461
|
+
assert$1(firstIndex != null, "No pivot index found");
|
|
4462
|
+
panelsArray.forEach((panelData, index2) => {
|
|
4463
|
+
const {
|
|
4464
|
+
constraints
|
|
4465
|
+
} = panelData;
|
|
4466
|
+
const {
|
|
4467
|
+
maxSize = 100,
|
|
4468
|
+
minSize = 0
|
|
4469
|
+
} = constraints;
|
|
4470
|
+
if (index2 === firstIndex) {
|
|
4471
|
+
currentMinSize = minSize;
|
|
4472
|
+
currentMaxSize = maxSize;
|
|
4473
|
+
} else {
|
|
4474
|
+
totalMinSize += minSize;
|
|
4475
|
+
totalMaxSize += maxSize;
|
|
4476
|
+
}
|
|
4477
|
+
});
|
|
4478
|
+
const valueMax = Math.min(currentMaxSize, 100 - totalMinSize);
|
|
4479
|
+
const valueMin = Math.max(currentMinSize, 100 - totalMaxSize);
|
|
4480
|
+
const valueNow = layout[firstIndex];
|
|
4481
|
+
return {
|
|
4482
|
+
valueMax,
|
|
4483
|
+
valueMin,
|
|
4484
|
+
valueNow
|
|
4485
|
+
};
|
|
4486
|
+
}
|
|
4487
|
+
function getResizeHandleElementsForGroup$1(groupId, scope = document) {
|
|
4488
|
+
return Array.from(scope.querySelectorAll(`[${DATA_ATTRIBUTES$1.resizeHandleId}][data-panel-group-id="${groupId}"]`));
|
|
4489
|
+
}
|
|
4490
|
+
function getResizeHandleElementIndex$1(groupId, id, scope = document) {
|
|
4491
|
+
const handles = getResizeHandleElementsForGroup$1(groupId, scope);
|
|
4492
|
+
const index2 = handles.findIndex((handle2) => handle2.getAttribute(DATA_ATTRIBUTES$1.resizeHandleId) === id);
|
|
4493
|
+
return index2 !== null && index2 !== void 0 ? index2 : null;
|
|
4494
|
+
}
|
|
4495
|
+
function determinePivotIndices$1(groupId, dragHandleId, panelGroupElement) {
|
|
4496
|
+
const index2 = getResizeHandleElementIndex$1(groupId, dragHandleId, panelGroupElement);
|
|
4497
|
+
return index2 != null ? [index2, index2 + 1] : [-1, -1];
|
|
4498
|
+
}
|
|
4499
|
+
function isHTMLElement(target) {
|
|
4500
|
+
if (target instanceof HTMLElement) {
|
|
4501
|
+
return true;
|
|
4502
|
+
}
|
|
4503
|
+
return typeof target === "object" && target !== null && "tagName" in target && "getAttribute" in target;
|
|
4504
|
+
}
|
|
4505
|
+
function getPanelGroupElement$1(id, rootElement = document) {
|
|
4506
|
+
if (isHTMLElement(rootElement) && rootElement.dataset.panelGroupId == id) {
|
|
4507
|
+
return rootElement;
|
|
4508
|
+
}
|
|
4509
|
+
const element2 = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
|
|
4510
|
+
if (element2) {
|
|
4511
|
+
return element2;
|
|
4512
|
+
}
|
|
4513
|
+
return null;
|
|
4514
|
+
}
|
|
4515
|
+
function getResizeHandleElement$1(id, scope = document) {
|
|
4516
|
+
const element2 = scope.querySelector(`[${DATA_ATTRIBUTES$1.resizeHandleId}="${id}"]`);
|
|
4517
|
+
if (element2) {
|
|
4518
|
+
return element2;
|
|
4519
|
+
}
|
|
4520
|
+
return null;
|
|
4521
|
+
}
|
|
4522
|
+
function getResizeHandlePanelIds$1(groupId, handleId, panelsArray, scope = document) {
|
|
4523
|
+
var _panelsArray$index$id, _panelsArray$index, _panelsArray$id, _panelsArray;
|
|
4524
|
+
const handle2 = getResizeHandleElement$1(handleId, scope);
|
|
4525
|
+
const handles = getResizeHandleElementsForGroup$1(groupId, scope);
|
|
4526
|
+
const index2 = handle2 ? handles.indexOf(handle2) : -1;
|
|
4527
|
+
const idBefore = (_panelsArray$index$id = (_panelsArray$index = panelsArray[index2]) === null || _panelsArray$index === void 0 ? void 0 : _panelsArray$index.id) !== null && _panelsArray$index$id !== void 0 ? _panelsArray$index$id : null;
|
|
4528
|
+
const idAfter = (_panelsArray$id = (_panelsArray = panelsArray[index2 + 1]) === null || _panelsArray === void 0 ? void 0 : _panelsArray.id) !== null && _panelsArray$id !== void 0 ? _panelsArray$id : null;
|
|
4529
|
+
return [idBefore, idAfter];
|
|
4530
|
+
}
|
|
4531
|
+
function useWindowSplitterPanelGroupBehavior$1({
|
|
4532
|
+
committedValuesRef,
|
|
4533
|
+
eagerValuesRef,
|
|
4534
|
+
groupId,
|
|
4535
|
+
layout,
|
|
4536
|
+
panelDataArray,
|
|
4537
|
+
panelGroupElement,
|
|
4538
|
+
setLayout
|
|
4539
|
+
}) {
|
|
4540
|
+
useRef({
|
|
4541
|
+
didWarnAboutMissingResizeHandle: false
|
|
4542
|
+
});
|
|
4543
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
4544
|
+
if (!panelGroupElement) {
|
|
4545
|
+
return;
|
|
4546
|
+
}
|
|
4547
|
+
const resizeHandleElements = getResizeHandleElementsForGroup$1(groupId, panelGroupElement);
|
|
4548
|
+
for (let index2 = 0; index2 < panelDataArray.length - 1; index2++) {
|
|
4549
|
+
const {
|
|
4550
|
+
valueMax,
|
|
4551
|
+
valueMin,
|
|
4552
|
+
valueNow
|
|
4553
|
+
} = calculateAriaValues$1({
|
|
4554
|
+
layout,
|
|
4555
|
+
panelsArray: panelDataArray,
|
|
4556
|
+
pivotIndices: [index2, index2 + 1]
|
|
4557
|
+
});
|
|
4558
|
+
const resizeHandleElement = resizeHandleElements[index2];
|
|
4559
|
+
if (resizeHandleElement == null) ;
|
|
4560
|
+
else {
|
|
4561
|
+
const panelData = panelDataArray[index2];
|
|
4562
|
+
assert$1(panelData, `No panel data found for index "${index2}"`);
|
|
4563
|
+
resizeHandleElement.setAttribute("aria-controls", panelData.id);
|
|
4564
|
+
resizeHandleElement.setAttribute("aria-valuemax", "" + Math.round(valueMax));
|
|
4565
|
+
resizeHandleElement.setAttribute("aria-valuemin", "" + Math.round(valueMin));
|
|
4566
|
+
resizeHandleElement.setAttribute("aria-valuenow", valueNow != null ? "" + Math.round(valueNow) : "");
|
|
4567
|
+
}
|
|
4568
|
+
}
|
|
4569
|
+
return () => {
|
|
4570
|
+
resizeHandleElements.forEach((resizeHandleElement, index2) => {
|
|
4571
|
+
resizeHandleElement.removeAttribute("aria-controls");
|
|
4572
|
+
resizeHandleElement.removeAttribute("aria-valuemax");
|
|
4573
|
+
resizeHandleElement.removeAttribute("aria-valuemin");
|
|
4574
|
+
resizeHandleElement.removeAttribute("aria-valuenow");
|
|
4575
|
+
});
|
|
4576
|
+
};
|
|
4577
|
+
}, [groupId, layout, panelDataArray, panelGroupElement]);
|
|
4578
|
+
useEffect(() => {
|
|
4579
|
+
if (!panelGroupElement) {
|
|
4580
|
+
return;
|
|
4581
|
+
}
|
|
4582
|
+
const eagerValues = eagerValuesRef.current;
|
|
4583
|
+
assert$1(eagerValues, `Eager values not found`);
|
|
4584
|
+
const {
|
|
4585
|
+
panelDataArray: panelDataArray2
|
|
4586
|
+
} = eagerValues;
|
|
4587
|
+
const groupElement = getPanelGroupElement$1(groupId, panelGroupElement);
|
|
4588
|
+
assert$1(groupElement != null, `No group found for id "${groupId}"`);
|
|
4589
|
+
const handles = getResizeHandleElementsForGroup$1(groupId, panelGroupElement);
|
|
4590
|
+
assert$1(handles, `No resize handles found for group id "${groupId}"`);
|
|
4591
|
+
const cleanupFunctions = handles.map((handle2) => {
|
|
4592
|
+
const handleId = handle2.getAttribute(DATA_ATTRIBUTES$1.resizeHandleId);
|
|
4593
|
+
assert$1(handleId, `Resize handle element has no handle id attribute`);
|
|
4594
|
+
const [idBefore, idAfter] = getResizeHandlePanelIds$1(groupId, handleId, panelDataArray2, panelGroupElement);
|
|
4595
|
+
if (idBefore == null || idAfter == null) {
|
|
4596
|
+
return () => {
|
|
4597
|
+
};
|
|
4598
|
+
}
|
|
4599
|
+
const onKeyDown = (event) => {
|
|
4600
|
+
if (event.defaultPrevented) {
|
|
4601
|
+
return;
|
|
4602
|
+
}
|
|
4603
|
+
switch (event.key) {
|
|
4604
|
+
case "Enter": {
|
|
4605
|
+
event.preventDefault();
|
|
4606
|
+
const index2 = panelDataArray2.findIndex((panelData) => panelData.id === idBefore);
|
|
4607
|
+
if (index2 >= 0) {
|
|
4608
|
+
const panelData = panelDataArray2[index2];
|
|
4609
|
+
assert$1(panelData, `No panel data found for index ${index2}`);
|
|
4610
|
+
const size = layout[index2];
|
|
4611
|
+
const {
|
|
4612
|
+
collapsedSize = 0,
|
|
4613
|
+
collapsible,
|
|
4614
|
+
minSize = 0
|
|
4615
|
+
} = panelData.constraints;
|
|
4616
|
+
if (size != null && collapsible) {
|
|
4617
|
+
const nextLayout = adjustLayoutByDelta$1({
|
|
4618
|
+
delta: fuzzyNumbersEqual$2(size, collapsedSize) ? minSize - collapsedSize : collapsedSize - size,
|
|
4619
|
+
initialLayout: layout,
|
|
4620
|
+
panelConstraints: panelDataArray2.map((panelData2) => panelData2.constraints),
|
|
4621
|
+
pivotIndices: determinePivotIndices$1(groupId, handleId, panelGroupElement),
|
|
4622
|
+
prevLayout: layout,
|
|
4623
|
+
trigger: "keyboard"
|
|
4624
|
+
});
|
|
4625
|
+
if (layout !== nextLayout) {
|
|
4626
|
+
setLayout(nextLayout);
|
|
4627
|
+
}
|
|
4628
|
+
}
|
|
4629
|
+
}
|
|
4630
|
+
break;
|
|
4631
|
+
}
|
|
4632
|
+
}
|
|
4633
|
+
};
|
|
4634
|
+
handle2.addEventListener("keydown", onKeyDown);
|
|
4635
|
+
return () => {
|
|
4636
|
+
handle2.removeEventListener("keydown", onKeyDown);
|
|
4637
|
+
};
|
|
4638
|
+
});
|
|
4639
|
+
return () => {
|
|
4640
|
+
cleanupFunctions.forEach((cleanupFunction) => cleanupFunction());
|
|
4641
|
+
};
|
|
4642
|
+
}, [panelGroupElement, committedValuesRef, eagerValuesRef, groupId, layout, panelDataArray, setLayout]);
|
|
4643
|
+
}
|
|
4644
|
+
function areEqual$1(arrayA, arrayB) {
|
|
4645
|
+
if (arrayA.length !== arrayB.length) {
|
|
4646
|
+
return false;
|
|
4647
|
+
}
|
|
4648
|
+
for (let index2 = 0; index2 < arrayA.length; index2++) {
|
|
4649
|
+
if (arrayA[index2] !== arrayB[index2]) {
|
|
4650
|
+
return false;
|
|
4651
|
+
}
|
|
4652
|
+
}
|
|
4653
|
+
return true;
|
|
4654
|
+
}
|
|
4655
|
+
function getResizeEventCursorPosition$1(direction, event) {
|
|
4656
|
+
const isHorizontal = direction === "horizontal";
|
|
4657
|
+
const {
|
|
4658
|
+
x,
|
|
4659
|
+
y
|
|
4660
|
+
} = getResizeEventCoordinates$1(event);
|
|
4661
|
+
return isHorizontal ? x : y;
|
|
4662
|
+
}
|
|
4663
|
+
function calculateDragOffsetPercentage$1(event, dragHandleId, direction, initialDragState, panelGroupElement) {
|
|
4664
|
+
const isHorizontal = direction === "horizontal";
|
|
4665
|
+
const handleElement = getResizeHandleElement$1(dragHandleId, panelGroupElement);
|
|
4666
|
+
assert$1(handleElement, `No resize handle element found for id "${dragHandleId}"`);
|
|
4667
|
+
const groupId = handleElement.getAttribute(DATA_ATTRIBUTES$1.groupId);
|
|
4668
|
+
assert$1(groupId, `Resize handle element has no group id attribute`);
|
|
4669
|
+
let {
|
|
4670
|
+
initialCursorPosition
|
|
4671
|
+
} = initialDragState;
|
|
4672
|
+
const cursorPosition = getResizeEventCursorPosition$1(direction, event);
|
|
4673
|
+
const groupElement = getPanelGroupElement$1(groupId, panelGroupElement);
|
|
4674
|
+
assert$1(groupElement, `No group element found for id "${groupId}"`);
|
|
4675
|
+
const groupRect = groupElement.getBoundingClientRect();
|
|
4676
|
+
const groupSizeInPixels = isHorizontal ? groupRect.width : groupRect.height;
|
|
4677
|
+
const offsetPixels = cursorPosition - initialCursorPosition;
|
|
4678
|
+
const offsetPercentage = offsetPixels / groupSizeInPixels * 100;
|
|
4679
|
+
return offsetPercentage;
|
|
4680
|
+
}
|
|
4681
|
+
function calculateDeltaPercentage$1(event, dragHandleId, direction, initialDragState, keyboardResizeBy, panelGroupElement) {
|
|
4682
|
+
if (isKeyDown$1(event)) {
|
|
4683
|
+
const isHorizontal = direction === "horizontal";
|
|
4684
|
+
let delta = 0;
|
|
4685
|
+
if (event.shiftKey) {
|
|
4686
|
+
delta = 100;
|
|
4687
|
+
} else if (keyboardResizeBy != null) {
|
|
4688
|
+
delta = keyboardResizeBy;
|
|
4689
|
+
} else {
|
|
4690
|
+
delta = 10;
|
|
4691
|
+
}
|
|
4692
|
+
let movement = 0;
|
|
4693
|
+
switch (event.key) {
|
|
4694
|
+
case "ArrowDown":
|
|
4695
|
+
movement = isHorizontal ? 0 : delta;
|
|
4696
|
+
break;
|
|
4697
|
+
case "ArrowLeft":
|
|
4698
|
+
movement = isHorizontal ? -delta : 0;
|
|
4699
|
+
break;
|
|
4700
|
+
case "ArrowRight":
|
|
4701
|
+
movement = isHorizontal ? delta : 0;
|
|
4702
|
+
break;
|
|
4703
|
+
case "ArrowUp":
|
|
4704
|
+
movement = isHorizontal ? 0 : -delta;
|
|
4705
|
+
break;
|
|
4706
|
+
case "End":
|
|
4707
|
+
movement = 100;
|
|
4708
|
+
break;
|
|
4709
|
+
case "Home":
|
|
4710
|
+
movement = -100;
|
|
4711
|
+
break;
|
|
4712
|
+
}
|
|
4713
|
+
return movement;
|
|
4714
|
+
} else {
|
|
4715
|
+
if (initialDragState == null) {
|
|
4716
|
+
return 0;
|
|
4717
|
+
}
|
|
4718
|
+
return calculateDragOffsetPercentage$1(event, dragHandleId, direction, initialDragState, panelGroupElement);
|
|
4719
|
+
}
|
|
4720
|
+
}
|
|
4721
|
+
function calculateUnsafeDefaultLayout$1({
|
|
4722
|
+
panelDataArray
|
|
4723
|
+
}) {
|
|
4724
|
+
const layout = Array(panelDataArray.length);
|
|
4725
|
+
const panelConstraintsArray = panelDataArray.map((panelData) => panelData.constraints);
|
|
4726
|
+
let numPanelsWithSizes = 0;
|
|
4727
|
+
let remainingSize = 100;
|
|
4728
|
+
for (let index2 = 0; index2 < panelDataArray.length; index2++) {
|
|
4729
|
+
const panelConstraints = panelConstraintsArray[index2];
|
|
4730
|
+
assert$1(panelConstraints, `Panel constraints not found for index ${index2}`);
|
|
4731
|
+
const {
|
|
4732
|
+
defaultSize
|
|
4733
|
+
} = panelConstraints;
|
|
4734
|
+
if (defaultSize != null) {
|
|
4735
|
+
numPanelsWithSizes++;
|
|
4736
|
+
layout[index2] = defaultSize;
|
|
4737
|
+
remainingSize -= defaultSize;
|
|
4738
|
+
}
|
|
4739
|
+
}
|
|
4740
|
+
for (let index2 = 0; index2 < panelDataArray.length; index2++) {
|
|
4741
|
+
const panelConstraints = panelConstraintsArray[index2];
|
|
4742
|
+
assert$1(panelConstraints, `Panel constraints not found for index ${index2}`);
|
|
4743
|
+
const {
|
|
4744
|
+
defaultSize
|
|
4745
|
+
} = panelConstraints;
|
|
4746
|
+
if (defaultSize != null) {
|
|
4747
|
+
continue;
|
|
4748
|
+
}
|
|
4749
|
+
const numRemainingPanels = panelDataArray.length - numPanelsWithSizes;
|
|
4750
|
+
const size = remainingSize / numRemainingPanels;
|
|
4751
|
+
numPanelsWithSizes++;
|
|
4752
|
+
layout[index2] = size;
|
|
4753
|
+
remainingSize -= size;
|
|
4754
|
+
}
|
|
4755
|
+
return layout;
|
|
4756
|
+
}
|
|
4757
|
+
function callPanelCallbacks$1(panelsArray, layout, panelIdToLastNotifiedSizeMap) {
|
|
4758
|
+
layout.forEach((size, index2) => {
|
|
4759
|
+
const panelData = panelsArray[index2];
|
|
4760
|
+
assert$1(panelData, `Panel data not found for index ${index2}`);
|
|
4761
|
+
const {
|
|
4762
|
+
callbacks,
|
|
4763
|
+
constraints,
|
|
4764
|
+
id: panelId
|
|
4765
|
+
} = panelData;
|
|
4766
|
+
const {
|
|
4767
|
+
collapsedSize = 0,
|
|
4768
|
+
collapsible
|
|
4769
|
+
} = constraints;
|
|
4770
|
+
const lastNotifiedSize = panelIdToLastNotifiedSizeMap[panelId];
|
|
4771
|
+
if (lastNotifiedSize == null || size !== lastNotifiedSize) {
|
|
4772
|
+
panelIdToLastNotifiedSizeMap[panelId] = size;
|
|
4773
|
+
const {
|
|
4774
|
+
onCollapse,
|
|
4775
|
+
onExpand,
|
|
4776
|
+
onResize
|
|
4777
|
+
} = callbacks;
|
|
4778
|
+
if (onResize) {
|
|
4779
|
+
onResize(size, lastNotifiedSize);
|
|
4780
|
+
}
|
|
4781
|
+
if (collapsible && (onCollapse || onExpand)) {
|
|
4782
|
+
if (onExpand && (lastNotifiedSize == null || fuzzyNumbersEqual$1$1(lastNotifiedSize, collapsedSize)) && !fuzzyNumbersEqual$1$1(size, collapsedSize)) {
|
|
4783
|
+
onExpand();
|
|
4784
|
+
}
|
|
4785
|
+
if (onCollapse && (lastNotifiedSize == null || !fuzzyNumbersEqual$1$1(lastNotifiedSize, collapsedSize)) && fuzzyNumbersEqual$1$1(size, collapsedSize)) {
|
|
4786
|
+
onCollapse();
|
|
4787
|
+
}
|
|
4788
|
+
}
|
|
4789
|
+
}
|
|
4790
|
+
});
|
|
4791
|
+
}
|
|
4792
|
+
function compareLayouts$1(a, b) {
|
|
4793
|
+
if (a.length !== b.length) {
|
|
4794
|
+
return false;
|
|
4795
|
+
} else {
|
|
4796
|
+
for (let index2 = 0; index2 < a.length; index2++) {
|
|
4797
|
+
if (a[index2] != b[index2]) {
|
|
4798
|
+
return false;
|
|
4799
|
+
}
|
|
4800
|
+
}
|
|
4801
|
+
}
|
|
4802
|
+
return true;
|
|
4803
|
+
}
|
|
4804
|
+
function computePanelFlexBoxStyle$1({
|
|
4805
|
+
defaultSize,
|
|
4806
|
+
dragState,
|
|
4807
|
+
layout,
|
|
4808
|
+
panelData,
|
|
4809
|
+
panelIndex,
|
|
4810
|
+
precision = 3
|
|
4811
|
+
}) {
|
|
4812
|
+
const size = layout[panelIndex];
|
|
4813
|
+
let flexGrow;
|
|
4814
|
+
if (size == null) {
|
|
4815
|
+
flexGrow = defaultSize != void 0 ? defaultSize.toFixed(precision) : "1";
|
|
4816
|
+
} else if (panelData.length === 1) {
|
|
4817
|
+
flexGrow = "1";
|
|
4818
|
+
} else {
|
|
4819
|
+
flexGrow = size.toFixed(precision);
|
|
4820
|
+
}
|
|
4821
|
+
return {
|
|
4822
|
+
flexBasis: 0,
|
|
4823
|
+
flexGrow,
|
|
4824
|
+
flexShrink: 1,
|
|
4825
|
+
// Without this, Panel sizes may be unintentionally overridden by their content
|
|
4826
|
+
overflow: "hidden",
|
|
4827
|
+
// Disable pointer events inside of a panel during resize
|
|
4828
|
+
// This avoid edge cases like nested iframes
|
|
4829
|
+
pointerEvents: dragState !== null ? "none" : void 0
|
|
4830
|
+
};
|
|
4831
|
+
}
|
|
4832
|
+
function debounce$1(callback, durationMs = 10) {
|
|
4833
|
+
let timeoutId = null;
|
|
4834
|
+
let callable = (...args) => {
|
|
4835
|
+
if (timeoutId !== null) {
|
|
4836
|
+
clearTimeout(timeoutId);
|
|
4837
|
+
}
|
|
4838
|
+
timeoutId = setTimeout(() => {
|
|
4839
|
+
callback(...args);
|
|
4840
|
+
}, durationMs);
|
|
4841
|
+
};
|
|
4842
|
+
return callable;
|
|
4843
|
+
}
|
|
4844
|
+
function initializeDefaultStorage$1(storageObject) {
|
|
4845
|
+
try {
|
|
4846
|
+
if (typeof localStorage !== "undefined") {
|
|
4847
|
+
storageObject.getItem = (name2) => {
|
|
4848
|
+
return localStorage.getItem(name2);
|
|
4849
|
+
};
|
|
4850
|
+
storageObject.setItem = (name2, value) => {
|
|
4851
|
+
localStorage.setItem(name2, value);
|
|
4852
|
+
};
|
|
4853
|
+
} else {
|
|
4854
|
+
throw new Error("localStorage not supported in this environment");
|
|
4855
|
+
}
|
|
4856
|
+
} catch (error) {
|
|
4857
|
+
console.error(error);
|
|
4858
|
+
storageObject.getItem = () => null;
|
|
4859
|
+
storageObject.setItem = () => {
|
|
4860
|
+
};
|
|
4861
|
+
}
|
|
4862
|
+
}
|
|
4863
|
+
function getPanelGroupKey$1(autoSaveId) {
|
|
4864
|
+
return `react-resizable-panels:${autoSaveId}`;
|
|
4865
|
+
}
|
|
4866
|
+
function getPanelKey$1(panels2) {
|
|
4867
|
+
return panels2.map((panel) => {
|
|
4868
|
+
const {
|
|
4869
|
+
constraints,
|
|
4870
|
+
id,
|
|
4871
|
+
idIsFromProps,
|
|
4872
|
+
order: order2
|
|
4873
|
+
} = panel;
|
|
4874
|
+
if (idIsFromProps) {
|
|
4875
|
+
return id;
|
|
4876
|
+
} else {
|
|
4877
|
+
return order2 ? `${order2}:${JSON.stringify(constraints)}` : JSON.stringify(constraints);
|
|
4878
|
+
}
|
|
4879
|
+
}).sort((a, b) => a.localeCompare(b)).join(",");
|
|
4880
|
+
}
|
|
4881
|
+
function loadSerializedPanelGroupState$1(autoSaveId, storage) {
|
|
4882
|
+
try {
|
|
4883
|
+
const panelGroupKey = getPanelGroupKey$1(autoSaveId);
|
|
4884
|
+
const serialized = storage.getItem(panelGroupKey);
|
|
4885
|
+
if (serialized) {
|
|
4886
|
+
const parsed = JSON.parse(serialized);
|
|
4887
|
+
if (typeof parsed === "object" && parsed != null) {
|
|
4888
|
+
return parsed;
|
|
4889
|
+
}
|
|
4890
|
+
}
|
|
4891
|
+
} catch (error) {
|
|
4892
|
+
}
|
|
4893
|
+
return null;
|
|
4894
|
+
}
|
|
4895
|
+
function loadPanelGroupState$1(autoSaveId, panels2, storage) {
|
|
4896
|
+
var _loadSerializedPanelG, _state$panelKey;
|
|
4897
|
+
const state = (_loadSerializedPanelG = loadSerializedPanelGroupState$1(autoSaveId, storage)) !== null && _loadSerializedPanelG !== void 0 ? _loadSerializedPanelG : {};
|
|
4898
|
+
const panelKey = getPanelKey$1(panels2);
|
|
4899
|
+
return (_state$panelKey = state[panelKey]) !== null && _state$panelKey !== void 0 ? _state$panelKey : null;
|
|
4900
|
+
}
|
|
4901
|
+
function savePanelGroupState$1(autoSaveId, panels2, panelSizesBeforeCollapse, sizes, storage) {
|
|
4902
|
+
var _loadSerializedPanelG2;
|
|
4903
|
+
const panelGroupKey = getPanelGroupKey$1(autoSaveId);
|
|
4904
|
+
const panelKey = getPanelKey$1(panels2);
|
|
4905
|
+
const state = (_loadSerializedPanelG2 = loadSerializedPanelGroupState$1(autoSaveId, storage)) !== null && _loadSerializedPanelG2 !== void 0 ? _loadSerializedPanelG2 : {};
|
|
4906
|
+
state[panelKey] = {
|
|
4907
|
+
expandToSizes: Object.fromEntries(panelSizesBeforeCollapse.entries()),
|
|
4908
|
+
layout: sizes
|
|
4909
|
+
};
|
|
4910
|
+
try {
|
|
4911
|
+
storage.setItem(panelGroupKey, JSON.stringify(state));
|
|
4912
|
+
} catch (error) {
|
|
4913
|
+
console.error(error);
|
|
4914
|
+
}
|
|
4915
|
+
}
|
|
4916
|
+
function validatePanelGroupLayout$1({
|
|
4917
|
+
layout: prevLayout,
|
|
4918
|
+
panelConstraints
|
|
4919
|
+
}) {
|
|
4920
|
+
const nextLayout = [...prevLayout];
|
|
4921
|
+
const nextLayoutTotalSize = nextLayout.reduce((accumulated, current) => accumulated + current, 0);
|
|
4922
|
+
if (nextLayout.length !== panelConstraints.length) {
|
|
4923
|
+
throw Error(`Invalid ${panelConstraints.length} panel layout: ${nextLayout.map((size) => `${size}%`).join(", ")}`);
|
|
4924
|
+
} else if (!fuzzyNumbersEqual$2(nextLayoutTotalSize, 100) && nextLayout.length > 0) {
|
|
4925
|
+
for (let index2 = 0; index2 < panelConstraints.length; index2++) {
|
|
4926
|
+
const unsafeSize = nextLayout[index2];
|
|
4927
|
+
assert$1(unsafeSize != null, `No layout data found for index ${index2}`);
|
|
4928
|
+
const safeSize = 100 / nextLayoutTotalSize * unsafeSize;
|
|
4929
|
+
nextLayout[index2] = safeSize;
|
|
4930
|
+
}
|
|
4931
|
+
}
|
|
4932
|
+
let remainingSize = 0;
|
|
4933
|
+
for (let index2 = 0; index2 < panelConstraints.length; index2++) {
|
|
4934
|
+
const unsafeSize = nextLayout[index2];
|
|
4935
|
+
assert$1(unsafeSize != null, `No layout data found for index ${index2}`);
|
|
4936
|
+
const safeSize = resizePanel$1({
|
|
4937
|
+
panelConstraints,
|
|
4938
|
+
panelIndex: index2,
|
|
4939
|
+
size: unsafeSize
|
|
4940
|
+
});
|
|
4941
|
+
if (unsafeSize != safeSize) {
|
|
4942
|
+
remainingSize += unsafeSize - safeSize;
|
|
4943
|
+
nextLayout[index2] = safeSize;
|
|
4944
|
+
}
|
|
4945
|
+
}
|
|
4946
|
+
if (!fuzzyNumbersEqual$2(remainingSize, 0)) {
|
|
4947
|
+
for (let index2 = 0; index2 < panelConstraints.length; index2++) {
|
|
4948
|
+
const prevSize = nextLayout[index2];
|
|
4949
|
+
assert$1(prevSize != null, `No layout data found for index ${index2}`);
|
|
4950
|
+
const unsafeSize = prevSize + remainingSize;
|
|
4951
|
+
const safeSize = resizePanel$1({
|
|
4952
|
+
panelConstraints,
|
|
4953
|
+
panelIndex: index2,
|
|
4954
|
+
size: unsafeSize
|
|
4955
|
+
});
|
|
4956
|
+
if (prevSize !== safeSize) {
|
|
4957
|
+
remainingSize -= safeSize - prevSize;
|
|
4958
|
+
nextLayout[index2] = safeSize;
|
|
4959
|
+
if (fuzzyNumbersEqual$2(remainingSize, 0)) {
|
|
4960
|
+
break;
|
|
4961
|
+
}
|
|
4962
|
+
}
|
|
4963
|
+
}
|
|
4964
|
+
}
|
|
4965
|
+
return nextLayout;
|
|
4966
|
+
}
|
|
4967
|
+
const LOCAL_STORAGE_DEBOUNCE_INTERVAL$1 = 100;
|
|
4968
|
+
const defaultStorage$1 = {
|
|
4969
|
+
getItem: (name2) => {
|
|
4970
|
+
initializeDefaultStorage$1(defaultStorage$1);
|
|
4971
|
+
return defaultStorage$1.getItem(name2);
|
|
4972
|
+
},
|
|
4973
|
+
setItem: (name2, value) => {
|
|
4974
|
+
initializeDefaultStorage$1(defaultStorage$1);
|
|
4975
|
+
defaultStorage$1.setItem(name2, value);
|
|
4976
|
+
}
|
|
4977
|
+
};
|
|
4978
|
+
const debounceMap$1 = {};
|
|
4979
|
+
function PanelGroupWithForwardedRef$1({
|
|
4980
|
+
autoSaveId = null,
|
|
4981
|
+
children: children2,
|
|
4982
|
+
className: classNameFromProps = "",
|
|
4983
|
+
direction,
|
|
4984
|
+
forwardedRef,
|
|
4985
|
+
id: idFromProps = null,
|
|
4986
|
+
onLayout = null,
|
|
4987
|
+
keyboardResizeBy = null,
|
|
4988
|
+
storage = defaultStorage$1,
|
|
4989
|
+
style: styleFromProps,
|
|
4990
|
+
tagName: Type = "div",
|
|
4991
|
+
...rest
|
|
4992
|
+
}) {
|
|
4993
|
+
const groupId = useUniqueId$1(idFromProps);
|
|
4994
|
+
const panelGroupElementRef = useRef(null);
|
|
4995
|
+
const [dragState, setDragState] = useState(null);
|
|
4996
|
+
const [layout, setLayout] = useState([]);
|
|
4997
|
+
const forceUpdate = useForceUpdate$1();
|
|
4998
|
+
const panelIdToLastNotifiedSizeMapRef = useRef({});
|
|
4999
|
+
const panelSizeBeforeCollapseRef = useRef(/* @__PURE__ */ new Map());
|
|
5000
|
+
const prevDeltaRef = useRef(0);
|
|
5001
|
+
const committedValuesRef = useRef({
|
|
5002
|
+
autoSaveId,
|
|
5003
|
+
direction,
|
|
5004
|
+
dragState,
|
|
5005
|
+
id: groupId,
|
|
5006
|
+
keyboardResizeBy,
|
|
5007
|
+
onLayout,
|
|
5008
|
+
storage
|
|
5009
|
+
});
|
|
5010
|
+
const eagerValuesRef = useRef({
|
|
5011
|
+
layout,
|
|
5012
|
+
panelDataArray: [],
|
|
5013
|
+
panelDataArrayChanged: false
|
|
5014
|
+
});
|
|
5015
|
+
useRef({
|
|
5016
|
+
didLogIdAndOrderWarning: false,
|
|
5017
|
+
didLogPanelConstraintsWarning: false,
|
|
5018
|
+
prevPanelIds: []
|
|
5019
|
+
});
|
|
5020
|
+
useImperativeHandle(forwardedRef, () => ({
|
|
5021
|
+
getId: () => committedValuesRef.current.id,
|
|
5022
|
+
getLayout: () => {
|
|
5023
|
+
const {
|
|
5024
|
+
layout: layout2
|
|
5025
|
+
} = eagerValuesRef.current;
|
|
5026
|
+
return layout2;
|
|
5027
|
+
},
|
|
5028
|
+
setLayout: (unsafeLayout) => {
|
|
5029
|
+
const {
|
|
5030
|
+
onLayout: onLayout2
|
|
5031
|
+
} = committedValuesRef.current;
|
|
5032
|
+
const {
|
|
5033
|
+
layout: prevLayout,
|
|
5034
|
+
panelDataArray
|
|
5035
|
+
} = eagerValuesRef.current;
|
|
5036
|
+
const safeLayout = validatePanelGroupLayout$1({
|
|
5037
|
+
layout: unsafeLayout,
|
|
5038
|
+
panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
|
|
5039
|
+
});
|
|
5040
|
+
if (!areEqual$1(prevLayout, safeLayout)) {
|
|
5041
|
+
setLayout(safeLayout);
|
|
5042
|
+
eagerValuesRef.current.layout = safeLayout;
|
|
5043
|
+
if (onLayout2) {
|
|
5044
|
+
onLayout2(safeLayout);
|
|
5045
|
+
}
|
|
5046
|
+
callPanelCallbacks$1(panelDataArray, safeLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
5047
|
+
}
|
|
5048
|
+
}
|
|
5049
|
+
}), []);
|
|
5050
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
5051
|
+
committedValuesRef.current.autoSaveId = autoSaveId;
|
|
5052
|
+
committedValuesRef.current.direction = direction;
|
|
5053
|
+
committedValuesRef.current.dragState = dragState;
|
|
5054
|
+
committedValuesRef.current.id = groupId;
|
|
5055
|
+
committedValuesRef.current.onLayout = onLayout;
|
|
5056
|
+
committedValuesRef.current.storage = storage;
|
|
5057
|
+
});
|
|
5058
|
+
useWindowSplitterPanelGroupBehavior$1({
|
|
5059
|
+
committedValuesRef,
|
|
5060
|
+
eagerValuesRef,
|
|
5061
|
+
groupId,
|
|
5062
|
+
layout,
|
|
5063
|
+
panelDataArray: eagerValuesRef.current.panelDataArray,
|
|
5064
|
+
setLayout,
|
|
5065
|
+
panelGroupElement: panelGroupElementRef.current
|
|
5066
|
+
});
|
|
5067
|
+
useEffect(() => {
|
|
5068
|
+
const {
|
|
5069
|
+
panelDataArray
|
|
5070
|
+
} = eagerValuesRef.current;
|
|
5071
|
+
if (autoSaveId) {
|
|
5072
|
+
if (layout.length === 0 || layout.length !== panelDataArray.length) {
|
|
5073
|
+
return;
|
|
5074
|
+
}
|
|
5075
|
+
let debouncedSave = debounceMap$1[autoSaveId];
|
|
5076
|
+
if (debouncedSave == null) {
|
|
5077
|
+
debouncedSave = debounce$1(savePanelGroupState$1, LOCAL_STORAGE_DEBOUNCE_INTERVAL$1);
|
|
5078
|
+
debounceMap$1[autoSaveId] = debouncedSave;
|
|
5079
|
+
}
|
|
5080
|
+
const clonedPanelDataArray = [...panelDataArray];
|
|
5081
|
+
const clonedPanelSizesBeforeCollapse = new Map(panelSizeBeforeCollapseRef.current);
|
|
5082
|
+
debouncedSave(autoSaveId, clonedPanelDataArray, clonedPanelSizesBeforeCollapse, layout, storage);
|
|
5083
|
+
}
|
|
5084
|
+
}, [autoSaveId, layout, storage]);
|
|
5085
|
+
useEffect(() => {
|
|
5086
|
+
});
|
|
5087
|
+
const collapsePanel = useCallback((panelData) => {
|
|
5088
|
+
const {
|
|
5089
|
+
onLayout: onLayout2
|
|
5090
|
+
} = committedValuesRef.current;
|
|
5091
|
+
const {
|
|
5092
|
+
layout: prevLayout,
|
|
5093
|
+
panelDataArray
|
|
5094
|
+
} = eagerValuesRef.current;
|
|
5095
|
+
if (panelData.constraints.collapsible) {
|
|
5096
|
+
const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
|
|
5097
|
+
const {
|
|
5098
|
+
collapsedSize = 0,
|
|
5099
|
+
panelSize,
|
|
5100
|
+
pivotIndices
|
|
5101
|
+
} = panelDataHelper$1(panelDataArray, panelData, prevLayout);
|
|
5102
|
+
assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
|
|
5103
|
+
if (!fuzzyNumbersEqual$1$1(panelSize, collapsedSize)) {
|
|
5104
|
+
panelSizeBeforeCollapseRef.current.set(panelData.id, panelSize);
|
|
5105
|
+
const isLastPanel = findPanelDataIndex$1(panelDataArray, panelData) === panelDataArray.length - 1;
|
|
5106
|
+
const delta = isLastPanel ? panelSize - collapsedSize : collapsedSize - panelSize;
|
|
5107
|
+
const nextLayout = adjustLayoutByDelta$1({
|
|
5108
|
+
delta,
|
|
5109
|
+
initialLayout: prevLayout,
|
|
5110
|
+
panelConstraints: panelConstraintsArray,
|
|
5111
|
+
pivotIndices,
|
|
5112
|
+
prevLayout,
|
|
5113
|
+
trigger: "imperative-api"
|
|
5114
|
+
});
|
|
5115
|
+
if (!compareLayouts$1(prevLayout, nextLayout)) {
|
|
5116
|
+
setLayout(nextLayout);
|
|
5117
|
+
eagerValuesRef.current.layout = nextLayout;
|
|
5118
|
+
if (onLayout2) {
|
|
5119
|
+
onLayout2(nextLayout);
|
|
5120
|
+
}
|
|
5121
|
+
callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
5122
|
+
}
|
|
5123
|
+
}
|
|
5124
|
+
}
|
|
5125
|
+
}, []);
|
|
5126
|
+
const expandPanel = useCallback((panelData, minSizeOverride) => {
|
|
5127
|
+
const {
|
|
5128
|
+
onLayout: onLayout2
|
|
5129
|
+
} = committedValuesRef.current;
|
|
5130
|
+
const {
|
|
5131
|
+
layout: prevLayout,
|
|
5132
|
+
panelDataArray
|
|
5133
|
+
} = eagerValuesRef.current;
|
|
5134
|
+
if (panelData.constraints.collapsible) {
|
|
5135
|
+
const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
|
|
5136
|
+
const {
|
|
5137
|
+
collapsedSize = 0,
|
|
5138
|
+
panelSize = 0,
|
|
5139
|
+
minSize: minSizeFromProps = 0,
|
|
5140
|
+
pivotIndices
|
|
5141
|
+
} = panelDataHelper$1(panelDataArray, panelData, prevLayout);
|
|
5142
|
+
const minSize = minSizeOverride !== null && minSizeOverride !== void 0 ? minSizeOverride : minSizeFromProps;
|
|
5143
|
+
if (fuzzyNumbersEqual$1$1(panelSize, collapsedSize)) {
|
|
5144
|
+
const prevPanelSize = panelSizeBeforeCollapseRef.current.get(panelData.id);
|
|
5145
|
+
const baseSize = prevPanelSize != null && prevPanelSize >= minSize ? prevPanelSize : minSize;
|
|
5146
|
+
const isLastPanel = findPanelDataIndex$1(panelDataArray, panelData) === panelDataArray.length - 1;
|
|
5147
|
+
const delta = isLastPanel ? panelSize - baseSize : baseSize - panelSize;
|
|
5148
|
+
const nextLayout = adjustLayoutByDelta$1({
|
|
5149
|
+
delta,
|
|
5150
|
+
initialLayout: prevLayout,
|
|
5151
|
+
panelConstraints: panelConstraintsArray,
|
|
5152
|
+
pivotIndices,
|
|
5153
|
+
prevLayout,
|
|
5154
|
+
trigger: "imperative-api"
|
|
5155
|
+
});
|
|
5156
|
+
if (!compareLayouts$1(prevLayout, nextLayout)) {
|
|
5157
|
+
setLayout(nextLayout);
|
|
5158
|
+
eagerValuesRef.current.layout = nextLayout;
|
|
5159
|
+
if (onLayout2) {
|
|
5160
|
+
onLayout2(nextLayout);
|
|
5161
|
+
}
|
|
5162
|
+
callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
5163
|
+
}
|
|
5164
|
+
}
|
|
5165
|
+
}
|
|
5166
|
+
}, []);
|
|
5167
|
+
const getPanelSize = useCallback((panelData) => {
|
|
5168
|
+
const {
|
|
5169
|
+
layout: layout2,
|
|
5170
|
+
panelDataArray
|
|
5171
|
+
} = eagerValuesRef.current;
|
|
5172
|
+
const {
|
|
5173
|
+
panelSize
|
|
5174
|
+
} = panelDataHelper$1(panelDataArray, panelData, layout2);
|
|
5175
|
+
assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
|
|
5176
|
+
return panelSize;
|
|
5177
|
+
}, []);
|
|
5178
|
+
const getPanelStyle = useCallback((panelData, defaultSize) => {
|
|
5179
|
+
const {
|
|
5180
|
+
panelDataArray
|
|
5181
|
+
} = eagerValuesRef.current;
|
|
5182
|
+
const panelIndex = findPanelDataIndex$1(panelDataArray, panelData);
|
|
5183
|
+
return computePanelFlexBoxStyle$1({
|
|
5184
|
+
defaultSize,
|
|
5185
|
+
dragState,
|
|
5186
|
+
layout,
|
|
5187
|
+
panelData: panelDataArray,
|
|
5188
|
+
panelIndex
|
|
5189
|
+
});
|
|
5190
|
+
}, [dragState, layout]);
|
|
5191
|
+
const isPanelCollapsed = useCallback((panelData) => {
|
|
5192
|
+
const {
|
|
5193
|
+
layout: layout2,
|
|
5194
|
+
panelDataArray
|
|
5195
|
+
} = eagerValuesRef.current;
|
|
5196
|
+
const {
|
|
5197
|
+
collapsedSize = 0,
|
|
5198
|
+
collapsible,
|
|
5199
|
+
panelSize
|
|
5200
|
+
} = panelDataHelper$1(panelDataArray, panelData, layout2);
|
|
5201
|
+
assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
|
|
5202
|
+
return collapsible === true && fuzzyNumbersEqual$1$1(panelSize, collapsedSize);
|
|
5203
|
+
}, []);
|
|
5204
|
+
const isPanelExpanded = useCallback((panelData) => {
|
|
5205
|
+
const {
|
|
5206
|
+
layout: layout2,
|
|
5207
|
+
panelDataArray
|
|
5208
|
+
} = eagerValuesRef.current;
|
|
5209
|
+
const {
|
|
5210
|
+
collapsedSize = 0,
|
|
5211
|
+
collapsible,
|
|
5212
|
+
panelSize
|
|
5213
|
+
} = panelDataHelper$1(panelDataArray, panelData, layout2);
|
|
5214
|
+
assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
|
|
5215
|
+
return !collapsible || fuzzyCompareNumbers$1(panelSize, collapsedSize) > 0;
|
|
5216
|
+
}, []);
|
|
5217
|
+
const registerPanel = useCallback((panelData) => {
|
|
5218
|
+
const {
|
|
5219
|
+
panelDataArray
|
|
5220
|
+
} = eagerValuesRef.current;
|
|
5221
|
+
panelDataArray.push(panelData);
|
|
5222
|
+
panelDataArray.sort((panelA, panelB) => {
|
|
5223
|
+
const orderA = panelA.order;
|
|
5224
|
+
const orderB = panelB.order;
|
|
5225
|
+
if (orderA == null && orderB == null) {
|
|
5226
|
+
return 0;
|
|
5227
|
+
} else if (orderA == null) {
|
|
5228
|
+
return -1;
|
|
5229
|
+
} else if (orderB == null) {
|
|
5230
|
+
return 1;
|
|
5231
|
+
} else {
|
|
5232
|
+
return orderA - orderB;
|
|
5233
|
+
}
|
|
5234
|
+
});
|
|
5235
|
+
eagerValuesRef.current.panelDataArrayChanged = true;
|
|
5236
|
+
forceUpdate();
|
|
5237
|
+
}, [forceUpdate]);
|
|
5238
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
5239
|
+
if (eagerValuesRef.current.panelDataArrayChanged) {
|
|
5240
|
+
eagerValuesRef.current.panelDataArrayChanged = false;
|
|
5241
|
+
const {
|
|
5242
|
+
autoSaveId: autoSaveId2,
|
|
5243
|
+
onLayout: onLayout2,
|
|
5244
|
+
storage: storage2
|
|
5245
|
+
} = committedValuesRef.current;
|
|
5246
|
+
const {
|
|
5247
|
+
layout: prevLayout,
|
|
5248
|
+
panelDataArray
|
|
5249
|
+
} = eagerValuesRef.current;
|
|
5250
|
+
let unsafeLayout = null;
|
|
5251
|
+
if (autoSaveId2) {
|
|
5252
|
+
const state = loadPanelGroupState$1(autoSaveId2, panelDataArray, storage2);
|
|
5253
|
+
if (state) {
|
|
5254
|
+
panelSizeBeforeCollapseRef.current = new Map(Object.entries(state.expandToSizes));
|
|
5255
|
+
unsafeLayout = state.layout;
|
|
5256
|
+
}
|
|
5257
|
+
}
|
|
5258
|
+
if (unsafeLayout == null) {
|
|
5259
|
+
unsafeLayout = calculateUnsafeDefaultLayout$1({
|
|
5260
|
+
panelDataArray
|
|
5261
|
+
});
|
|
5262
|
+
}
|
|
5263
|
+
const nextLayout = validatePanelGroupLayout$1({
|
|
5264
|
+
layout: unsafeLayout,
|
|
5265
|
+
panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
|
|
5266
|
+
});
|
|
5267
|
+
if (!areEqual$1(prevLayout, nextLayout)) {
|
|
5268
|
+
setLayout(nextLayout);
|
|
5269
|
+
eagerValuesRef.current.layout = nextLayout;
|
|
5270
|
+
if (onLayout2) {
|
|
5271
|
+
onLayout2(nextLayout);
|
|
5272
|
+
}
|
|
5273
|
+
callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
5274
|
+
}
|
|
5275
|
+
}
|
|
5276
|
+
});
|
|
5277
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
5278
|
+
const eagerValues = eagerValuesRef.current;
|
|
5279
|
+
return () => {
|
|
5280
|
+
eagerValues.layout = [];
|
|
5281
|
+
};
|
|
5282
|
+
}, []);
|
|
5283
|
+
const registerResizeHandle = useCallback((dragHandleId) => {
|
|
5284
|
+
let isRTL = false;
|
|
5285
|
+
const panelGroupElement = panelGroupElementRef.current;
|
|
5286
|
+
if (panelGroupElement) {
|
|
5287
|
+
const style3 = window.getComputedStyle(panelGroupElement, null);
|
|
5288
|
+
if (style3.getPropertyValue("direction") === "rtl") {
|
|
5289
|
+
isRTL = true;
|
|
5290
|
+
}
|
|
5291
|
+
}
|
|
5292
|
+
return function resizeHandler(event) {
|
|
5293
|
+
event.preventDefault();
|
|
5294
|
+
const panelGroupElement2 = panelGroupElementRef.current;
|
|
5295
|
+
if (!panelGroupElement2) {
|
|
5296
|
+
return () => null;
|
|
5297
|
+
}
|
|
5298
|
+
const {
|
|
5299
|
+
direction: direction2,
|
|
5300
|
+
dragState: dragState2,
|
|
5301
|
+
id: groupId2,
|
|
5302
|
+
keyboardResizeBy: keyboardResizeBy2,
|
|
5303
|
+
onLayout: onLayout2
|
|
5304
|
+
} = committedValuesRef.current;
|
|
5305
|
+
const {
|
|
5306
|
+
layout: prevLayout,
|
|
5307
|
+
panelDataArray
|
|
5308
|
+
} = eagerValuesRef.current;
|
|
5309
|
+
const {
|
|
5310
|
+
initialLayout
|
|
5311
|
+
} = dragState2 !== null && dragState2 !== void 0 ? dragState2 : {};
|
|
5312
|
+
const pivotIndices = determinePivotIndices$1(groupId2, dragHandleId, panelGroupElement2);
|
|
5313
|
+
let delta = calculateDeltaPercentage$1(event, dragHandleId, direction2, dragState2, keyboardResizeBy2, panelGroupElement2);
|
|
5314
|
+
const isHorizontal = direction2 === "horizontal";
|
|
5315
|
+
if (isHorizontal && isRTL) {
|
|
5316
|
+
delta = -delta;
|
|
5317
|
+
}
|
|
5318
|
+
const panelConstraints = panelDataArray.map((panelData) => panelData.constraints);
|
|
5319
|
+
const nextLayout = adjustLayoutByDelta$1({
|
|
5320
|
+
delta,
|
|
5321
|
+
initialLayout: initialLayout !== null && initialLayout !== void 0 ? initialLayout : prevLayout,
|
|
5322
|
+
panelConstraints,
|
|
5323
|
+
pivotIndices,
|
|
5324
|
+
prevLayout,
|
|
5325
|
+
trigger: isKeyDown$1(event) ? "keyboard" : "mouse-or-touch"
|
|
5326
|
+
});
|
|
5327
|
+
const layoutChanged = !compareLayouts$1(prevLayout, nextLayout);
|
|
5328
|
+
if (isPointerEvent$1(event) || isMouseEvent$1(event)) {
|
|
5329
|
+
if (prevDeltaRef.current != delta) {
|
|
5330
|
+
prevDeltaRef.current = delta;
|
|
5331
|
+
if (!layoutChanged && delta !== 0) {
|
|
5332
|
+
if (isHorizontal) {
|
|
5333
|
+
reportConstraintsViolation$1(dragHandleId, delta < 0 ? EXCEEDED_HORIZONTAL_MIN$1 : EXCEEDED_HORIZONTAL_MAX$1);
|
|
5334
|
+
} else {
|
|
5335
|
+
reportConstraintsViolation$1(dragHandleId, delta < 0 ? EXCEEDED_VERTICAL_MIN$1 : EXCEEDED_VERTICAL_MAX$1);
|
|
5336
|
+
}
|
|
5337
|
+
} else {
|
|
5338
|
+
reportConstraintsViolation$1(dragHandleId, 0);
|
|
5339
|
+
}
|
|
5340
|
+
}
|
|
5341
|
+
}
|
|
5342
|
+
if (layoutChanged) {
|
|
5343
|
+
setLayout(nextLayout);
|
|
5344
|
+
eagerValuesRef.current.layout = nextLayout;
|
|
5345
|
+
if (onLayout2) {
|
|
5346
|
+
onLayout2(nextLayout);
|
|
5347
|
+
}
|
|
5348
|
+
callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
5349
|
+
}
|
|
5350
|
+
};
|
|
5351
|
+
}, []);
|
|
5352
|
+
const resizePanel2 = useCallback((panelData, unsafePanelSize) => {
|
|
5353
|
+
const {
|
|
5354
|
+
onLayout: onLayout2
|
|
5355
|
+
} = committedValuesRef.current;
|
|
5356
|
+
const {
|
|
5357
|
+
layout: prevLayout,
|
|
5358
|
+
panelDataArray
|
|
5359
|
+
} = eagerValuesRef.current;
|
|
5360
|
+
const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
|
|
5361
|
+
const {
|
|
5362
|
+
panelSize,
|
|
5363
|
+
pivotIndices
|
|
5364
|
+
} = panelDataHelper$1(panelDataArray, panelData, prevLayout);
|
|
5365
|
+
assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
|
|
5366
|
+
const isLastPanel = findPanelDataIndex$1(panelDataArray, panelData) === panelDataArray.length - 1;
|
|
5367
|
+
const delta = isLastPanel ? panelSize - unsafePanelSize : unsafePanelSize - panelSize;
|
|
5368
|
+
const nextLayout = adjustLayoutByDelta$1({
|
|
5369
|
+
delta,
|
|
5370
|
+
initialLayout: prevLayout,
|
|
5371
|
+
panelConstraints: panelConstraintsArray,
|
|
5372
|
+
pivotIndices,
|
|
5373
|
+
prevLayout,
|
|
5374
|
+
trigger: "imperative-api"
|
|
5375
|
+
});
|
|
5376
|
+
if (!compareLayouts$1(prevLayout, nextLayout)) {
|
|
5377
|
+
setLayout(nextLayout);
|
|
5378
|
+
eagerValuesRef.current.layout = nextLayout;
|
|
5379
|
+
if (onLayout2) {
|
|
5380
|
+
onLayout2(nextLayout);
|
|
5381
|
+
}
|
|
5382
|
+
callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
5383
|
+
}
|
|
5384
|
+
}, []);
|
|
5385
|
+
const reevaluatePanelConstraints = useCallback((panelData, prevConstraints) => {
|
|
5386
|
+
const {
|
|
5387
|
+
layout: layout2,
|
|
5388
|
+
panelDataArray
|
|
5389
|
+
} = eagerValuesRef.current;
|
|
5390
|
+
const {
|
|
5391
|
+
collapsedSize: prevCollapsedSize = 0,
|
|
5392
|
+
collapsible: prevCollapsible
|
|
5393
|
+
} = prevConstraints;
|
|
5394
|
+
const {
|
|
5395
|
+
collapsedSize: nextCollapsedSize = 0,
|
|
5396
|
+
collapsible: nextCollapsible,
|
|
5397
|
+
maxSize: nextMaxSize = 100,
|
|
5398
|
+
minSize: nextMinSize = 0
|
|
5399
|
+
} = panelData.constraints;
|
|
5400
|
+
const {
|
|
5401
|
+
panelSize: prevPanelSize
|
|
5402
|
+
} = panelDataHelper$1(panelDataArray, panelData, layout2);
|
|
5403
|
+
if (prevPanelSize == null) {
|
|
5404
|
+
return;
|
|
5405
|
+
}
|
|
5406
|
+
if (prevCollapsible && nextCollapsible && fuzzyNumbersEqual$1$1(prevPanelSize, prevCollapsedSize)) {
|
|
5407
|
+
if (!fuzzyNumbersEqual$1$1(prevCollapsedSize, nextCollapsedSize)) {
|
|
5408
|
+
resizePanel2(panelData, nextCollapsedSize);
|
|
5409
|
+
}
|
|
5410
|
+
} else if (prevPanelSize < nextMinSize) {
|
|
5411
|
+
resizePanel2(panelData, nextMinSize);
|
|
5412
|
+
} else if (prevPanelSize > nextMaxSize) {
|
|
5413
|
+
resizePanel2(panelData, nextMaxSize);
|
|
5414
|
+
}
|
|
5415
|
+
}, [resizePanel2]);
|
|
5416
|
+
const startDragging = useCallback((dragHandleId, event) => {
|
|
5417
|
+
const {
|
|
5418
|
+
direction: direction2
|
|
5419
|
+
} = committedValuesRef.current;
|
|
5420
|
+
const {
|
|
5421
|
+
layout: layout2
|
|
5422
|
+
} = eagerValuesRef.current;
|
|
5423
|
+
if (!panelGroupElementRef.current) {
|
|
5424
|
+
return;
|
|
5425
|
+
}
|
|
5426
|
+
const handleElement = getResizeHandleElement$1(dragHandleId, panelGroupElementRef.current);
|
|
5427
|
+
assert$1(handleElement, `Drag handle element not found for id "${dragHandleId}"`);
|
|
5428
|
+
const initialCursorPosition = getResizeEventCursorPosition$1(direction2, event);
|
|
5429
|
+
setDragState({
|
|
5430
|
+
dragHandleId,
|
|
5431
|
+
dragHandleRect: handleElement.getBoundingClientRect(),
|
|
5432
|
+
initialCursorPosition,
|
|
5433
|
+
initialLayout: layout2
|
|
5434
|
+
});
|
|
5435
|
+
}, []);
|
|
5436
|
+
const stopDragging = useCallback(() => {
|
|
5437
|
+
setDragState(null);
|
|
5438
|
+
}, []);
|
|
5439
|
+
const unregisterPanel = useCallback((panelData) => {
|
|
5440
|
+
const {
|
|
5441
|
+
panelDataArray
|
|
5442
|
+
} = eagerValuesRef.current;
|
|
5443
|
+
const index2 = findPanelDataIndex$1(panelDataArray, panelData);
|
|
5444
|
+
if (index2 >= 0) {
|
|
5445
|
+
panelDataArray.splice(index2, 1);
|
|
5446
|
+
delete panelIdToLastNotifiedSizeMapRef.current[panelData.id];
|
|
5447
|
+
eagerValuesRef.current.panelDataArrayChanged = true;
|
|
5448
|
+
forceUpdate();
|
|
5449
|
+
}
|
|
5450
|
+
}, [forceUpdate]);
|
|
5451
|
+
const context = useMemo(() => ({
|
|
5452
|
+
collapsePanel,
|
|
5453
|
+
direction,
|
|
5454
|
+
dragState,
|
|
5455
|
+
expandPanel,
|
|
5456
|
+
getPanelSize,
|
|
5457
|
+
getPanelStyle,
|
|
5458
|
+
groupId,
|
|
5459
|
+
isPanelCollapsed,
|
|
5460
|
+
isPanelExpanded,
|
|
5461
|
+
reevaluatePanelConstraints,
|
|
5462
|
+
registerPanel,
|
|
5463
|
+
registerResizeHandle,
|
|
5464
|
+
resizePanel: resizePanel2,
|
|
5465
|
+
startDragging,
|
|
5466
|
+
stopDragging,
|
|
5467
|
+
unregisterPanel,
|
|
5468
|
+
panelGroupElement: panelGroupElementRef.current
|
|
5469
|
+
}), [collapsePanel, dragState, direction, expandPanel, getPanelSize, getPanelStyle, groupId, isPanelCollapsed, isPanelExpanded, reevaluatePanelConstraints, registerPanel, registerResizeHandle, resizePanel2, startDragging, stopDragging, unregisterPanel]);
|
|
5470
|
+
const style2 = {
|
|
5471
|
+
display: "flex",
|
|
5472
|
+
flexDirection: direction === "horizontal" ? "row" : "column",
|
|
5473
|
+
height: "100%",
|
|
5474
|
+
overflow: "hidden",
|
|
5475
|
+
width: "100%"
|
|
5476
|
+
};
|
|
5477
|
+
return createElement(PanelGroupContext$1.Provider, {
|
|
5478
|
+
value: context
|
|
5479
|
+
}, createElement(Type, {
|
|
5480
|
+
...rest,
|
|
5481
|
+
children: children2,
|
|
5482
|
+
className: classNameFromProps,
|
|
5483
|
+
id: idFromProps,
|
|
5484
|
+
ref: panelGroupElementRef,
|
|
5485
|
+
style: {
|
|
5486
|
+
...style2,
|
|
5487
|
+
...styleFromProps
|
|
5488
|
+
},
|
|
5489
|
+
// CSS selectors
|
|
5490
|
+
[DATA_ATTRIBUTES$1.group]: "",
|
|
5491
|
+
[DATA_ATTRIBUTES$1.groupDirection]: direction,
|
|
5492
|
+
[DATA_ATTRIBUTES$1.groupId]: groupId
|
|
5493
|
+
}));
|
|
5494
|
+
}
|
|
5495
|
+
const PanelGroup$1 = forwardRef((props, ref) => createElement(PanelGroupWithForwardedRef$1, {
|
|
5496
|
+
...props,
|
|
5497
|
+
forwardedRef: ref
|
|
5498
|
+
}));
|
|
5499
|
+
PanelGroupWithForwardedRef$1.displayName = "PanelGroup";
|
|
5500
|
+
PanelGroup$1.displayName = "forwardRef(PanelGroup)";
|
|
5501
|
+
function findPanelDataIndex$1(panelDataArray, panelData) {
|
|
5502
|
+
return panelDataArray.findIndex((prevPanelData) => prevPanelData === panelData || prevPanelData.id === panelData.id);
|
|
5503
|
+
}
|
|
5504
|
+
function panelDataHelper$1(panelDataArray, panelData, layout) {
|
|
5505
|
+
const panelIndex = findPanelDataIndex$1(panelDataArray, panelData);
|
|
5506
|
+
const isLastPanel = panelIndex === panelDataArray.length - 1;
|
|
5507
|
+
const pivotIndices = isLastPanel ? [panelIndex - 1, panelIndex] : [panelIndex, panelIndex + 1];
|
|
5508
|
+
const panelSize = layout[panelIndex];
|
|
5509
|
+
return {
|
|
5510
|
+
...panelData.constraints,
|
|
5511
|
+
panelSize,
|
|
5512
|
+
pivotIndices
|
|
5513
|
+
};
|
|
5514
|
+
}
|
|
5515
|
+
function C(e) {
|
|
5516
|
+
return { "--panel-background": e.colors.background, "--panel-border": e.colors.border, "--panel-handle": e.colors.backgroundSecondary, "--panel-handle-hover": e.colors.backgroundHover, "--panel-handle-active": e.colors.primary, "--panel-button-bg": e.colors.surface, "--panel-button-hover": e.colors.backgroundHover, "--panel-button-border": e.colors.border, "--panel-button-icon": e.colors.textSecondary, "--panel-accent-bg": e.colors.primary + "15" };
|
|
5517
|
+
}
|
|
5518
|
+
const z = forwardRef(({ panels: o, className: a = "", style: s2, theme: d, minPanelWidth: u = 350, idealPanelWidth: p2 = 0.333, showSeparator: h2 = false, onPanelChange: m, preventKeyboardScroll: f = true, disableSwipe: g = false }, v) => {
|
|
5519
|
+
const b = useRef(null), y = C(d);
|
|
5520
|
+
useImperativeHandle(v, () => ({ scrollToPanel: (e) => {
|
|
5521
|
+
if (!b.current) return;
|
|
5522
|
+
const t = b.current, n = t.children[e];
|
|
5523
|
+
if (n) {
|
|
5524
|
+
const e2 = n.offsetLeft;
|
|
5525
|
+
t.scrollTo({ left: e2, behavior: "smooth" });
|
|
5526
|
+
}
|
|
5527
|
+
}, getCurrentPanel: () => {
|
|
5528
|
+
if (!b.current || 0 === b.current.children.length) return 0;
|
|
5529
|
+
const e = b.current, t = e.getBoundingClientRect().left;
|
|
5530
|
+
let n = 0, r2 = 1 / 0;
|
|
5531
|
+
for (let o2 = 0; o2 < e.children.length; o2++) {
|
|
5532
|
+
const i = e.children[o2].getBoundingClientRect(), a2 = Math.abs(i.left - t);
|
|
5533
|
+
a2 < r2 && (r2 = a2, n = o2);
|
|
5534
|
+
}
|
|
5535
|
+
return n;
|
|
5536
|
+
} }));
|
|
5537
|
+
useEffect(() => {
|
|
5538
|
+
if (!f || !b.current) return;
|
|
5539
|
+
const e = b.current, t = (e2) => {
|
|
5540
|
+
const t2 = e2.target;
|
|
5541
|
+
if ("INPUT" === t2.tagName || "TEXTAREA" === t2.tagName || "SELECT" === t2.tagName || t2.isContentEditable || null !== t2.closest(".xterm") || null !== t2.closest('[contenteditable="true"]')) return;
|
|
5542
|
+
[" ", "Space", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown"].includes(e2.key) && e2.preventDefault();
|
|
5543
|
+
};
|
|
5544
|
+
return e.addEventListener("keydown", t), () => {
|
|
5545
|
+
e.removeEventListener("keydown", t);
|
|
5546
|
+
};
|
|
5547
|
+
}, [f]);
|
|
5548
|
+
const w = o.length, x = 2 * u;
|
|
5549
|
+
let S2;
|
|
5550
|
+
S2 = 1 === w || 2 === w ? "100%" : `max(${u}px, ${100 * p2}%)`;
|
|
5551
|
+
const R = React2__default.useId().replace(/:/g, "_");
|
|
5552
|
+
return jsxs(Fragment, { children: [
|
|
5553
|
+
2 === w && /* @__PURE__ */ jsx("style", { children: `
|
|
5554
|
+
.snap-carousel-container[data-carousel-id="${R}"][data-panel-count="2"] .snap-carousel-panel {
|
|
5555
|
+
width: 100%;
|
|
5556
|
+
}
|
|
5557
|
+
@container (min-width: ${x}px) {
|
|
5558
|
+
.snap-carousel-container[data-carousel-id="${R}"][data-panel-count="2"] .snap-carousel-panel {
|
|
5559
|
+
width: 50%;
|
|
5560
|
+
}
|
|
5561
|
+
}
|
|
5562
|
+
` }),
|
|
5563
|
+
/* @__PURE__ */ jsx("div", { ref: b, className: `snap-carousel-container ${g ? "swipe-disabled" : ""} ${a}`, style: { ...y, ...s2, "--snap-carousel-min-width": `${u}px`, "--snap-carousel-ideal-width": 100 * p2 + "%", "--snap-carousel-gap": h2 ? "1px" : "0px", "--snap-carousel-panel-width": S2, "--snap-carousel-panel-count": w, "--snap-carousel-two-panel-threshold": `${x}px` }, onScroll: (e) => {
|
|
5564
|
+
if (!m || !b.current || 0 === b.current.children.length) return;
|
|
5565
|
+
const t = b.current, n = t.getBoundingClientRect().left;
|
|
5566
|
+
let r2 = 0, o2 = 1 / 0;
|
|
5567
|
+
for (let i = 0; i < t.children.length; i++) {
|
|
5568
|
+
const e2 = t.children[i].getBoundingClientRect(), a2 = Math.abs(e2.left - n);
|
|
5569
|
+
a2 < o2 && (o2 = a2, r2 = i);
|
|
5570
|
+
}
|
|
5571
|
+
m(r2);
|
|
5572
|
+
}, "data-panel-count": w, "data-carousel-id": R, children: o.map((t, n) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t }, n)) })
|
|
5573
|
+
] });
|
|
5574
|
+
});
|
|
5575
|
+
z.displayName = "SnapCarousel";
|
|
5576
|
+
var le$1, se$1;
|
|
5577
|
+
(se$1 = le$1 || (le$1 = {})).DragStart = "dragStart", se$1.DragMove = "dragMove", se$1.DragEnd = "dragEnd", se$1.DragCancel = "dragCancel", se$1.DragOver = "dragOver", se$1.RegisterDroppable = "registerDroppable", se$1.SetDroppableDisabled = "setDroppableDisabled", se$1.UnregisterDroppable = "unregisterDroppable";
|
|
5578
|
+
const de = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
|
|
5579
|
+
var Te$1, Ae;
|
|
5580
|
+
(Ae = Te$1 || (Te$1 = {}))[Ae.Forward = 1] = "Forward", Ae[Ae.Backward = -1] = "Backward";
|
|
5581
|
+
var _e$1, je$1, He$1, Ke$1;
|
|
5582
|
+
(je$1 = _e$1 || (_e$1 = {})).Click = "click", je$1.DragStart = "dragstart", je$1.Keydown = "keydown", je$1.ContextMenu = "contextmenu", je$1.Resize = "resize", je$1.SelectionChange = "selectionchange", je$1.VisibilityChange = "visibilitychange", (Ke$1 = He$1 || (He$1 = {})).Space = "Space", Ke$1.Down = "ArrowDown", Ke$1.Right = "ArrowRight", Ke$1.Left = "ArrowLeft", Ke$1.Up = "ArrowUp", Ke$1.Esc = "Escape", Ke$1.Enter = "Enter", Ke$1.Tab = "Tab";
|
|
5583
|
+
({ start: [He$1.Space, He$1.Enter], cancel: [He$1.Esc], end: [He$1.Space, He$1.Enter, He$1.Tab] });
|
|
5584
|
+
var rt, ot$1;
|
|
5585
|
+
(ot$1 = rt || (rt = {}))[ot$1.RightClick = 2] = "RightClick";
|
|
5586
|
+
var at, lt$1, st$1, ct$1;
|
|
5587
|
+
(lt$1 = at || (at = {}))[lt$1.Pointer = 0] = "Pointer", lt$1[lt$1.DraggableRect = 1] = "DraggableRect", (ct$1 = st$1 || (st$1 = {}))[ct$1.TreeOrder = 0] = "TreeOrder", ct$1[ct$1.ReversedTreeOrder = 1] = "ReversedTreeOrder";
|
|
5588
|
+
({ x: { [Te$1.Backward]: false, [Te$1.Forward]: false }, y: { [Te$1.Backward]: false, [Te$1.Forward]: false } });
|
|
5589
|
+
var pt, ht$1, mt$1;
|
|
5590
|
+
(ht$1 = pt || (pt = {}))[ht$1.Always = 0] = "Always", ht$1[ht$1.BeforeDragging = 1] = "BeforeDragging", ht$1[ht$1.WhileDragging = 2] = "WhileDragging", (mt$1 || (mt$1 = {})).Optimized = "optimized";
|
|
5591
|
+
({ droppable: { strategy: pt.WhileDragging, frequency: mt$1.Optimized } });
|
|
5592
|
+
/* @__PURE__ */ createContext({ ...de, scaleX: 1, scaleY: 1 });
|
|
5593
|
+
var $t, Bt$1;
|
|
5594
|
+
(Bt$1 = $t || ($t = {}))[Bt$1.Uninitialized = 0] = "Uninitialized", Bt$1[Bt$1.Initializing = 1] = "Initializing", Bt$1[Bt$1.Initialized = 2] = "Initialized";
|
|
5595
|
+
var Ut;
|
|
5596
|
+
(() => {
|
|
5597
|
+
if ("undefined" != typeof window) {
|
|
5598
|
+
const e = window;
|
|
5599
|
+
return e.__principlemd_theme_context__ || (e.__principlemd_theme_context__ = createContext(void 0)), e.__principlemd_theme_context__;
|
|
5600
|
+
}
|
|
5601
|
+
return Ut || (Ut = createContext(void 0)), Ut;
|
|
5602
|
+
})();
|
|
5603
|
+
var _e = Object.defineProperty;
|
|
5604
|
+
var Ee = (o, e, t) => e in o ? _e(o, e, { enumerable: true, configurable: true, writable: true, value: t }) : o[e] = t;
|
|
5605
|
+
var le = (o, e, t) => Ee(o, typeof e != "symbol" ? e + "" : e, t);
|
|
5606
|
+
class De {
|
|
5607
|
+
constructor() {
|
|
5608
|
+
le(this, "PRESETS_KEY", "panel-layouts:workspace-presets");
|
|
5609
|
+
le(this, "REPO_STATE_PREFIX", "panel-layouts:repo-state:");
|
|
5610
|
+
}
|
|
5611
|
+
/**
|
|
5612
|
+
* Load all user-created workspace presets
|
|
5613
|
+
*/
|
|
5614
|
+
async loadWorkspacePresets() {
|
|
5615
|
+
try {
|
|
5616
|
+
const e = localStorage.getItem(this.PRESETS_KEY);
|
|
5617
|
+
return e ? JSON.parse(e) : {};
|
|
5618
|
+
} catch (e) {
|
|
5619
|
+
return console.error("Failed to load workspace presets:", e), {};
|
|
5620
|
+
}
|
|
5621
|
+
}
|
|
5622
|
+
/**
|
|
5623
|
+
* Save workspace presets
|
|
5624
|
+
*/
|
|
5625
|
+
async saveWorkspacePresets(e) {
|
|
5626
|
+
try {
|
|
5627
|
+
localStorage.setItem(this.PRESETS_KEY, JSON.stringify(e));
|
|
5628
|
+
} catch (t) {
|
|
5629
|
+
throw console.error("Failed to save workspace presets:", t), t;
|
|
5630
|
+
}
|
|
5631
|
+
}
|
|
5632
|
+
/**
|
|
5633
|
+
* Load repository-specific workspace state
|
|
5634
|
+
*/
|
|
5635
|
+
async loadRepositoryState(e) {
|
|
5636
|
+
try {
|
|
5637
|
+
const t = `${this.REPO_STATE_PREFIX}${e}`, r2 = localStorage.getItem(t);
|
|
5638
|
+
return r2 ? JSON.parse(r2) : null;
|
|
5639
|
+
} catch (t) {
|
|
5640
|
+
return console.error(
|
|
5641
|
+
`Failed to load repository state for ${e}:`,
|
|
5642
|
+
t
|
|
5643
|
+
), null;
|
|
5644
|
+
}
|
|
5645
|
+
}
|
|
5646
|
+
/**
|
|
5647
|
+
* Save repository-specific workspace state
|
|
5648
|
+
*/
|
|
5649
|
+
async saveRepositoryState(e, t) {
|
|
5650
|
+
try {
|
|
5651
|
+
const r2 = `${this.REPO_STATE_PREFIX}${e}`;
|
|
5652
|
+
localStorage.setItem(r2, JSON.stringify(t));
|
|
5653
|
+
} catch (r2) {
|
|
5654
|
+
throw console.error(
|
|
5655
|
+
`Failed to save repository state for ${e}:`,
|
|
5656
|
+
r2
|
|
5657
|
+
), r2;
|
|
5658
|
+
}
|
|
5659
|
+
}
|
|
5660
|
+
/**
|
|
5661
|
+
* Load all repository states
|
|
5662
|
+
*/
|
|
5663
|
+
async loadAllRepositoryStates() {
|
|
5664
|
+
try {
|
|
5665
|
+
const e = {};
|
|
5666
|
+
for (let t = 0; t < localStorage.length; t++) {
|
|
5667
|
+
const r2 = localStorage.key(t);
|
|
5668
|
+
if (r2 && r2.startsWith(this.REPO_STATE_PREFIX)) {
|
|
5669
|
+
const s2 = r2.substring(this.REPO_STATE_PREFIX.length), i = localStorage.getItem(r2);
|
|
5670
|
+
if (i)
|
|
5671
|
+
try {
|
|
5672
|
+
e[s2] = JSON.parse(i);
|
|
5673
|
+
} catch (l) {
|
|
5674
|
+
console.error(
|
|
5675
|
+
`Failed to parse repository state for ${s2}:`,
|
|
5676
|
+
l
|
|
5677
|
+
);
|
|
5678
|
+
}
|
|
5679
|
+
}
|
|
5680
|
+
}
|
|
5681
|
+
return e;
|
|
5682
|
+
} catch (e) {
|
|
5683
|
+
return console.error("Failed to load all repository states:", e), {};
|
|
5684
|
+
}
|
|
5685
|
+
}
|
|
5686
|
+
}
|
|
5687
|
+
class O {
|
|
5688
|
+
/**
|
|
5689
|
+
* Configure a custom storage adapter (for Electron IPC or remote storage)
|
|
5690
|
+
*/
|
|
5691
|
+
static setAdapter(e) {
|
|
5692
|
+
this.adapter = e;
|
|
5693
|
+
}
|
|
5694
|
+
/**
|
|
5695
|
+
* Get all workspace layouts (including built-in)
|
|
5696
|
+
*/
|
|
5697
|
+
static async getWorkspaceLayouts() {
|
|
5698
|
+
const e = this.getBuiltInWorkspaceLayouts();
|
|
5699
|
+
return {
|
|
5700
|
+
...await this.adapter.loadWorkspacePresets(),
|
|
5701
|
+
...e
|
|
5702
|
+
};
|
|
5703
|
+
}
|
|
5704
|
+
/**
|
|
5705
|
+
* Get a specific workspace layout by ID
|
|
5706
|
+
*/
|
|
5707
|
+
static async getWorkspaceLayout(e) {
|
|
5708
|
+
return (await this.getWorkspaceLayouts())[e] || null;
|
|
5709
|
+
}
|
|
5710
|
+
/**
|
|
5711
|
+
* Create a new workspace layout
|
|
5712
|
+
*/
|
|
5713
|
+
static async createWorkspaceLayout(e) {
|
|
5714
|
+
const t = await this.adapter.loadWorkspacePresets(), r2 = this.generateWorkspaceId(e.name), s2 = {
|
|
5715
|
+
id: r2,
|
|
5716
|
+
name: e.name,
|
|
5717
|
+
description: e.description,
|
|
5718
|
+
layout: e.layout,
|
|
5719
|
+
defaultSizes: e.defaultSizes,
|
|
5720
|
+
defaultCollapsed: e.defaultCollapsed,
|
|
5721
|
+
createdAt: Date.now(),
|
|
5722
|
+
updatedAt: Date.now(),
|
|
5723
|
+
isBuiltIn: false
|
|
5724
|
+
}, i = {
|
|
5725
|
+
...t,
|
|
5726
|
+
[r2]: s2
|
|
5727
|
+
};
|
|
5728
|
+
return await this.adapter.saveWorkspacePresets(i), s2;
|
|
5729
|
+
}
|
|
5730
|
+
/**
|
|
5731
|
+
* Update an existing workspace layout
|
|
5732
|
+
*/
|
|
5733
|
+
static async updateWorkspaceLayout(e, t) {
|
|
5734
|
+
const r2 = await this.adapter.loadWorkspacePresets(), s2 = r2[e];
|
|
5735
|
+
if (!s2)
|
|
5736
|
+
return console.error(`Workspace layout ${e} not found`), null;
|
|
5737
|
+
if (s2.isBuiltIn)
|
|
5738
|
+
return console.error(`Cannot update built-in workspace layout ${e}`), null;
|
|
5739
|
+
const i = {
|
|
5740
|
+
...s2,
|
|
5741
|
+
...t,
|
|
5742
|
+
id: e,
|
|
5743
|
+
// Preserve ID
|
|
5744
|
+
createdAt: s2.createdAt,
|
|
5745
|
+
// Preserve creation time
|
|
5746
|
+
updatedAt: Date.now()
|
|
5747
|
+
}, l = {
|
|
5748
|
+
...r2,
|
|
5749
|
+
[e]: i
|
|
5750
|
+
};
|
|
5751
|
+
return await this.adapter.saveWorkspacePresets(l), i;
|
|
5752
|
+
}
|
|
5753
|
+
/**
|
|
5754
|
+
* Delete a workspace layout
|
|
5755
|
+
*/
|
|
5756
|
+
static async deleteWorkspaceLayout(e) {
|
|
5757
|
+
const t = await this.adapter.loadWorkspacePresets(), r2 = t[e];
|
|
5758
|
+
if (!r2)
|
|
5759
|
+
return console.error(`Workspace layout ${e} not found`), false;
|
|
5760
|
+
if (r2.isBuiltIn)
|
|
5761
|
+
return console.error(`Cannot delete built-in workspace layout ${e}`), false;
|
|
5762
|
+
const s2 = { ...t };
|
|
5763
|
+
return delete s2[e], await this.adapter.saveWorkspacePresets(s2), true;
|
|
5764
|
+
}
|
|
5765
|
+
/**
|
|
5766
|
+
* Get repository state (which workspace + current sizes/collapsed)
|
|
5767
|
+
*/
|
|
5768
|
+
static async getRepositoryState(e) {
|
|
5769
|
+
return await this.adapter.loadRepositoryState(e);
|
|
5770
|
+
}
|
|
5771
|
+
/**
|
|
5772
|
+
* Set repository state (which workspace + current sizes/collapsed/layout)
|
|
5773
|
+
*/
|
|
5774
|
+
static async setRepositoryState(e, t) {
|
|
5775
|
+
await this.adapter.saveRepositoryState(e, t);
|
|
5776
|
+
}
|
|
5777
|
+
/**
|
|
5778
|
+
* Update only sizes in repository state
|
|
5779
|
+
*/
|
|
5780
|
+
static async updateRepositorySizes(e, t) {
|
|
5781
|
+
const r2 = await this.getRepositoryState(e);
|
|
5782
|
+
r2 && await this.setRepositoryState(e, {
|
|
5783
|
+
...r2,
|
|
5784
|
+
sizes: t
|
|
5785
|
+
});
|
|
5786
|
+
}
|
|
5787
|
+
/**
|
|
5788
|
+
* Update only collapsed state in repository state
|
|
5789
|
+
*/
|
|
5790
|
+
static async updateRepositoryCollapsed(e, t) {
|
|
5791
|
+
const r2 = await this.getRepositoryState(e);
|
|
5792
|
+
r2 && await this.setRepositoryState(e, {
|
|
5793
|
+
...r2,
|
|
5794
|
+
collapsed: t
|
|
5795
|
+
});
|
|
5796
|
+
}
|
|
5797
|
+
/**
|
|
5798
|
+
* Check if repository state differs from workspace defaults
|
|
5799
|
+
*/
|
|
5800
|
+
static hasStateDeviation(e, t) {
|
|
5801
|
+
const r2 = t.defaultSizes ? JSON.stringify(e.sizes) !== JSON.stringify(t.defaultSizes) : false, s2 = t.defaultCollapsed ? JSON.stringify(e.collapsed) !== JSON.stringify(t.defaultCollapsed) : false;
|
|
5802
|
+
return { hasSizeDeviation: r2, hasCollapsedDeviation: s2 };
|
|
5803
|
+
}
|
|
5804
|
+
/**
|
|
5805
|
+
* Update workspace defaults from repository state
|
|
5806
|
+
*/
|
|
5807
|
+
static async updateWorkspaceFromRepositoryState(e, t) {
|
|
5808
|
+
const r2 = await this.getWorkspaceLayout(e), s2 = await this.getRepositoryState(t);
|
|
5809
|
+
if (!r2 || !s2 || r2.isBuiltIn) {
|
|
5810
|
+
console.error(
|
|
5811
|
+
"Cannot update built-in workspace or workspace/state not found"
|
|
5812
|
+
);
|
|
5813
|
+
return;
|
|
5814
|
+
}
|
|
5815
|
+
await this.updateWorkspaceLayout(e, {
|
|
5816
|
+
defaultSizes: s2.sizes,
|
|
5817
|
+
defaultCollapsed: s2.collapsed
|
|
5818
|
+
});
|
|
5819
|
+
}
|
|
5820
|
+
/**
|
|
5821
|
+
* Reset repository state to workspace defaults
|
|
5822
|
+
*/
|
|
5823
|
+
static async resetRepositoryToWorkspaceDefaults(e, t) {
|
|
5824
|
+
const r2 = await this.getWorkspaceLayout(t);
|
|
5825
|
+
if (!r2) {
|
|
5826
|
+
console.error(`Workspace ${t} not found`);
|
|
5827
|
+
return;
|
|
5828
|
+
}
|
|
5829
|
+
const s2 = await this.getRepositoryState(e);
|
|
5830
|
+
s2 && await this.setRepositoryState(e, {
|
|
5831
|
+
...s2,
|
|
5832
|
+
sizes: r2.defaultSizes || { left: 20, middle: 45, right: 35 },
|
|
5833
|
+
collapsed: r2.defaultCollapsed || { left: false, right: false }
|
|
5834
|
+
});
|
|
5835
|
+
}
|
|
5836
|
+
/**
|
|
5837
|
+
* Check if a layout matches a workspace layout
|
|
5838
|
+
*/
|
|
5839
|
+
static isLayoutMatchingWorkspace(e, t) {
|
|
5840
|
+
return this.areLayoutsEqual(e, t.layout);
|
|
5841
|
+
}
|
|
5842
|
+
/**
|
|
5843
|
+
* Find workspace ID that matches the given layout
|
|
5844
|
+
*/
|
|
5845
|
+
static async findMatchingWorkspace(e) {
|
|
5846
|
+
const t = await this.getWorkspaceLayouts();
|
|
5847
|
+
for (const [r2, s2] of Object.entries(t))
|
|
5848
|
+
if (this.isLayoutMatchingWorkspace(e, s2))
|
|
5849
|
+
return r2;
|
|
5850
|
+
return null;
|
|
5851
|
+
}
|
|
5852
|
+
/**
|
|
5853
|
+
* Deep comparison of two panel layouts
|
|
5854
|
+
*/
|
|
5855
|
+
static areLayoutsEqual(e, t) {
|
|
5856
|
+
return JSON.stringify(e) === JSON.stringify(t);
|
|
5857
|
+
}
|
|
5858
|
+
/**
|
|
5859
|
+
* Generate a unique ID from a workspace name
|
|
5860
|
+
*/
|
|
5861
|
+
static generateWorkspaceId(e) {
|
|
5862
|
+
return `${e.toLowerCase().replace(/[^a-z0-9]+/g, "-")}-${Date.now()}`;
|
|
5863
|
+
}
|
|
5864
|
+
/**
|
|
5865
|
+
* Get built-in workspace layouts
|
|
5866
|
+
*/
|
|
5867
|
+
static getBuiltInWorkspaceLayouts() {
|
|
5868
|
+
const e = Date.now();
|
|
5869
|
+
return {
|
|
5870
|
+
"project-management": {
|
|
5871
|
+
id: "project-management",
|
|
5872
|
+
name: "Project Management",
|
|
5873
|
+
description: "Tasks, dependencies, issues, file tree, docs, drawings, multi terminal, city visualization, code viewer, markdown slides, and excalidraw",
|
|
5874
|
+
layout: {
|
|
5875
|
+
left: {
|
|
5876
|
+
type: "tabs",
|
|
5877
|
+
panels: [
|
|
5878
|
+
"tasks",
|
|
5879
|
+
"dependencies",
|
|
5880
|
+
"gitIssues",
|
|
5881
|
+
"fileTree",
|
|
5882
|
+
"docs",
|
|
5883
|
+
"drawings"
|
|
5884
|
+
],
|
|
5885
|
+
config: { defaultActiveTab: 0, tabPosition: "top" }
|
|
5886
|
+
},
|
|
5887
|
+
middle: "multiTerminal",
|
|
5888
|
+
right: {
|
|
5889
|
+
type: "tabs",
|
|
5890
|
+
panels: [
|
|
5891
|
+
"cityVisualization",
|
|
5892
|
+
"codeViewer",
|
|
5893
|
+
"markdownViewer",
|
|
5894
|
+
"excalidrawDiagram"
|
|
5895
|
+
],
|
|
5896
|
+
config: { defaultActiveTab: 0, tabPosition: "top" }
|
|
5897
|
+
}
|
|
5898
|
+
},
|
|
5899
|
+
defaultSizes: { left: 20, middle: 45, right: 35 },
|
|
5900
|
+
defaultCollapsed: { left: false, right: false },
|
|
5901
|
+
createdAt: e,
|
|
5902
|
+
updatedAt: e,
|
|
5903
|
+
isBuiltIn: true
|
|
5904
|
+
},
|
|
5905
|
+
"code-review": {
|
|
5906
|
+
id: "code-review",
|
|
5907
|
+
name: "Code Review",
|
|
5908
|
+
description: "Git changes, pull requests, and file tree on left, git diff and code viewer in middle, city map on right",
|
|
5909
|
+
layout: {
|
|
5910
|
+
left: {
|
|
5911
|
+
type: "tabs",
|
|
5912
|
+
panels: ["gitChanges", "gitPullRequests", "fileTree"],
|
|
5913
|
+
config: { defaultActiveTab: 0, tabPosition: "top" }
|
|
5914
|
+
},
|
|
5915
|
+
middle: {
|
|
5916
|
+
type: "tabs",
|
|
5917
|
+
panels: ["gitDiff", "codeViewer"],
|
|
5918
|
+
config: { defaultActiveTab: 0, tabPosition: "top" }
|
|
5919
|
+
},
|
|
5920
|
+
right: "cityVisualization"
|
|
5921
|
+
},
|
|
5922
|
+
defaultSizes: { left: 20, middle: 50, right: 30 },
|
|
5923
|
+
defaultCollapsed: { left: false, right: false },
|
|
5924
|
+
createdAt: e,
|
|
5925
|
+
updatedAt: e,
|
|
5926
|
+
isBuiltIn: true
|
|
5927
|
+
},
|
|
5928
|
+
documentation: {
|
|
5929
|
+
id: "documentation",
|
|
5930
|
+
name: "Documentation",
|
|
5931
|
+
description: "Docs, markdown viewer, and code viewer",
|
|
5932
|
+
layout: {
|
|
5933
|
+
left: "docs",
|
|
5934
|
+
middle: "markdownViewer",
|
|
5935
|
+
right: "codeViewer"
|
|
5936
|
+
},
|
|
5937
|
+
defaultSizes: { left: 20, middle: 50, right: 30 },
|
|
5938
|
+
defaultCollapsed: { left: false, right: true },
|
|
5939
|
+
createdAt: e,
|
|
5940
|
+
updatedAt: e,
|
|
5941
|
+
isBuiltIn: true
|
|
5942
|
+
},
|
|
5943
|
+
"agent-work": {
|
|
5944
|
+
id: "agent-work",
|
|
5945
|
+
name: "Agent Work",
|
|
5946
|
+
description: "Tasks, agent sessions, file tree, agent context, git changes, docs, multi terminal, city map, agent events, code viewer, and markdown slides",
|
|
5947
|
+
layout: {
|
|
5948
|
+
left: {
|
|
5949
|
+
type: "tabs",
|
|
5950
|
+
panels: [
|
|
5951
|
+
"tasks",
|
|
5952
|
+
"agentSessions",
|
|
5953
|
+
"fileTree",
|
|
5954
|
+
"agentContext",
|
|
5955
|
+
"gitChanges",
|
|
5956
|
+
"docs"
|
|
5957
|
+
],
|
|
5958
|
+
config: { defaultActiveTab: 0, tabPosition: "top" }
|
|
5959
|
+
},
|
|
5960
|
+
middle: "multiTerminal",
|
|
5961
|
+
right: {
|
|
5962
|
+
type: "tabs",
|
|
5963
|
+
panels: [
|
|
5964
|
+
"cityVisualization",
|
|
5965
|
+
"agentEvents",
|
|
5966
|
+
"codeViewer",
|
|
5967
|
+
"markdownViewer"
|
|
5968
|
+
],
|
|
5969
|
+
config: { defaultActiveTab: 0, tabPosition: "top" }
|
|
5970
|
+
}
|
|
5971
|
+
},
|
|
5972
|
+
defaultSizes: { left: 20, middle: 45, right: 35 },
|
|
5973
|
+
defaultCollapsed: { left: false, right: false },
|
|
5974
|
+
createdAt: e,
|
|
5975
|
+
updatedAt: e,
|
|
5976
|
+
isBuiltIn: true
|
|
5977
|
+
},
|
|
5978
|
+
"quality-check": {
|
|
5979
|
+
id: "quality-check",
|
|
5980
|
+
name: "Quality Check",
|
|
5981
|
+
description: "Package information, tools, and dependencies on left; city visualization map in middle; multi terminal and code viewer on right (collapsed)",
|
|
5982
|
+
layout: {
|
|
5983
|
+
left: {
|
|
5984
|
+
type: "tabs",
|
|
5985
|
+
panels: ["packageInfo", "tools", "dependencies"],
|
|
5986
|
+
config: { defaultActiveTab: 0, tabPosition: "top" }
|
|
5987
|
+
},
|
|
5988
|
+
middle: "cityVisualization",
|
|
5989
|
+
right: {
|
|
5990
|
+
type: "tabs",
|
|
5991
|
+
panels: ["multiTerminal", "codeViewer"],
|
|
5992
|
+
config: { defaultActiveTab: 0, tabPosition: "top" }
|
|
5993
|
+
}
|
|
5994
|
+
},
|
|
5995
|
+
defaultSizes: { left: 20, middle: 45, right: 35 },
|
|
5996
|
+
defaultCollapsed: { left: false, right: true },
|
|
5997
|
+
createdAt: e,
|
|
5998
|
+
updatedAt: e,
|
|
5999
|
+
isBuiltIn: true
|
|
6000
|
+
},
|
|
6001
|
+
drawing: {
|
|
6002
|
+
id: "drawing",
|
|
6003
|
+
name: "Drawing",
|
|
6004
|
+
description: "Drawings and docs, excalidraw diagram, multi terminal and markdown viewer",
|
|
6005
|
+
layout: {
|
|
6006
|
+
left: {
|
|
6007
|
+
type: "tabs",
|
|
6008
|
+
panels: ["drawings", "docs"],
|
|
6009
|
+
config: { defaultActiveTab: 0, tabPosition: "top" }
|
|
6010
|
+
},
|
|
6011
|
+
middle: "excalidrawDiagram",
|
|
6012
|
+
right: {
|
|
6013
|
+
type: "tabs",
|
|
6014
|
+
panels: ["multiTerminal", "markdownViewer"],
|
|
6015
|
+
config: { defaultActiveTab: 0, tabPosition: "top" }
|
|
6016
|
+
}
|
|
6017
|
+
},
|
|
6018
|
+
defaultSizes: { left: 20, middle: 50, right: 30 },
|
|
6019
|
+
defaultCollapsed: { left: false, right: true },
|
|
6020
|
+
createdAt: e,
|
|
6021
|
+
updatedAt: e,
|
|
6022
|
+
isBuiltIn: true
|
|
6023
|
+
},
|
|
6024
|
+
"old-school": {
|
|
6025
|
+
id: "old-school",
|
|
6026
|
+
name: "Old School",
|
|
6027
|
+
description: "File tree, search, git changes, and docs on left; code viewer and markdown viewer in middle; multi terminal and city map on right (collapsed)",
|
|
6028
|
+
layout: {
|
|
6029
|
+
left: {
|
|
6030
|
+
type: "tabs",
|
|
6031
|
+
panels: ["fileTree", "search", "gitChanges", "docs"],
|
|
6032
|
+
config: { defaultActiveTab: 0, tabPosition: "top" }
|
|
6033
|
+
},
|
|
6034
|
+
middle: {
|
|
6035
|
+
type: "tabs",
|
|
6036
|
+
panels: ["codeViewer", "markdownViewer"],
|
|
6037
|
+
config: { defaultActiveTab: 0, tabPosition: "top" }
|
|
6038
|
+
},
|
|
6039
|
+
right: {
|
|
6040
|
+
type: "tabs",
|
|
6041
|
+
panels: ["multiTerminal", "cityVisualization"],
|
|
6042
|
+
config: { defaultActiveTab: 0, tabPosition: "top" }
|
|
6043
|
+
}
|
|
6044
|
+
},
|
|
6045
|
+
defaultSizes: { left: 20, middle: 50, right: 30 },
|
|
6046
|
+
defaultCollapsed: { left: false, right: true },
|
|
6047
|
+
createdAt: e,
|
|
6048
|
+
updatedAt: e,
|
|
6049
|
+
isBuiltIn: true
|
|
6050
|
+
},
|
|
6051
|
+
"principal-office": {
|
|
6052
|
+
id: "principal-office",
|
|
6053
|
+
name: "Principal Office",
|
|
6054
|
+
description: "Alexandria docs on left, MDX editor in middle, multi terminal on right",
|
|
6055
|
+
layout: {
|
|
6056
|
+
left: "docs",
|
|
6057
|
+
middle: "mdxEditor",
|
|
6058
|
+
right: "multiTerminal"
|
|
6059
|
+
},
|
|
6060
|
+
defaultSizes: { left: 20, middle: 50, right: 30 },
|
|
6061
|
+
defaultCollapsed: { left: false, right: false },
|
|
6062
|
+
createdAt: e,
|
|
6063
|
+
updatedAt: e,
|
|
6064
|
+
isBuiltIn: true
|
|
6065
|
+
}
|
|
6066
|
+
};
|
|
6067
|
+
}
|
|
6068
|
+
/**
|
|
6069
|
+
* Initialize workspace layouts with built-in defaults if none exist
|
|
6070
|
+
*/
|
|
6071
|
+
static async initializeWorkspaceLayouts() {
|
|
6072
|
+
const e = await this.adapter.loadWorkspacePresets();
|
|
6073
|
+
Object.keys(e).length;
|
|
6074
|
+
}
|
|
6075
|
+
}
|
|
6076
|
+
le(O, "adapter", new De());
|
|
6077
|
+
function gt(o, e, t, r2) {
|
|
6078
|
+
useEffect(() => {
|
|
6079
|
+
const s2 = e.on(
|
|
6080
|
+
"panel:focus",
|
|
6081
|
+
(l) => {
|
|
6082
|
+
l.payload.panelId === o && t();
|
|
6083
|
+
}
|
|
6084
|
+
);
|
|
6085
|
+
return () => {
|
|
6086
|
+
s2();
|
|
6087
|
+
};
|
|
6088
|
+
}, [o, e, t, r2]);
|
|
6089
|
+
}
|
|
6090
|
+
function parseTaskMarkdown(content2, filePath) {
|
|
6091
|
+
const { frontmatter, title, rawContent, acceptanceCriteria, description } = parseMarkdownContent(content2);
|
|
6092
|
+
const id = extractIdFromPath(filePath);
|
|
6093
|
+
return {
|
|
6094
|
+
id,
|
|
6095
|
+
title: title || `Task ${id}`,
|
|
6096
|
+
status: frontmatter.status || "backlog",
|
|
6097
|
+
priority: frontmatter.priority,
|
|
6098
|
+
assignee: frontmatter.assignee || [],
|
|
6099
|
+
reporter: frontmatter.reporter,
|
|
6100
|
+
createdDate: frontmatter.createdDate || (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
6101
|
+
updatedDate: frontmatter.updatedDate,
|
|
6102
|
+
labels: frontmatter.labels || [],
|
|
6103
|
+
milestone: frontmatter.milestone,
|
|
6104
|
+
dependencies: frontmatter.dependencies || [],
|
|
6105
|
+
references: frontmatter.references || [],
|
|
6106
|
+
parentTaskId: frontmatter.parentTaskId,
|
|
6107
|
+
subtasks: frontmatter.subtasks,
|
|
6108
|
+
branch: frontmatter.branch,
|
|
6109
|
+
ordinal: frontmatter.ordinal,
|
|
6110
|
+
rawContent,
|
|
6111
|
+
description,
|
|
6112
|
+
acceptanceCriteriaItems: acceptanceCriteria,
|
|
6113
|
+
filePath
|
|
6114
|
+
};
|
|
6115
|
+
}
|
|
6116
|
+
function serializeTaskMarkdown(task) {
|
|
6117
|
+
const lines = [];
|
|
6118
|
+
lines.push("---");
|
|
6119
|
+
lines.push(`status: ${task.status}`);
|
|
6120
|
+
if (task.priority) {
|
|
6121
|
+
lines.push(`priority: ${task.priority}`);
|
|
6122
|
+
}
|
|
6123
|
+
if (task.assignee && task.assignee.length > 0) {
|
|
6124
|
+
lines.push(`assignee: [${task.assignee.join(", ")}]`);
|
|
6125
|
+
}
|
|
6126
|
+
if (task.reporter) {
|
|
6127
|
+
lines.push(`reporter: ${task.reporter}`);
|
|
6128
|
+
}
|
|
6129
|
+
if (task.labels && task.labels.length > 0) {
|
|
6130
|
+
lines.push(`labels: [${task.labels.join(", ")}]`);
|
|
6131
|
+
}
|
|
6132
|
+
if (task.milestone) {
|
|
6133
|
+
lines.push(`milestone: ${task.milestone}`);
|
|
6134
|
+
}
|
|
6135
|
+
if (task.dependencies && task.dependencies.length > 0) {
|
|
6136
|
+
lines.push(`dependencies: [${task.dependencies.join(", ")}]`);
|
|
6137
|
+
}
|
|
6138
|
+
if (task.references && task.references.length > 0) {
|
|
6139
|
+
lines.push(`references: [${task.references.join(", ")}]`);
|
|
6140
|
+
}
|
|
6141
|
+
if (task.parentTaskId) {
|
|
6142
|
+
lines.push(`parentTaskId: ${task.parentTaskId}`);
|
|
6143
|
+
}
|
|
6144
|
+
if (task.subtasks && task.subtasks.length > 0) {
|
|
6145
|
+
lines.push(`subtasks: [${task.subtasks.join(", ")}]`);
|
|
6146
|
+
}
|
|
6147
|
+
if (task.branch) {
|
|
6148
|
+
lines.push(`branch: ${task.branch}`);
|
|
6149
|
+
}
|
|
6150
|
+
if (task.ordinal !== void 0) {
|
|
6151
|
+
lines.push(`ordinal: ${task.ordinal}`);
|
|
6152
|
+
}
|
|
6153
|
+
if (task.createdDate) {
|
|
6154
|
+
lines.push(`createdDate: ${task.createdDate}`);
|
|
6155
|
+
}
|
|
6156
|
+
if (task.updatedDate) {
|
|
6157
|
+
lines.push(`updatedDate: ${task.updatedDate}`);
|
|
6158
|
+
}
|
|
6159
|
+
lines.push("---");
|
|
6160
|
+
lines.push("");
|
|
6161
|
+
lines.push(`# ${task.title}`);
|
|
6162
|
+
lines.push("");
|
|
6163
|
+
if (task.description) {
|
|
6164
|
+
lines.push(task.description);
|
|
6165
|
+
lines.push("");
|
|
6166
|
+
}
|
|
6167
|
+
if (task.acceptanceCriteriaItems && task.acceptanceCriteriaItems.length > 0) {
|
|
6168
|
+
lines.push("## Acceptance Criteria");
|
|
6169
|
+
lines.push("");
|
|
6170
|
+
for (const criterion of task.acceptanceCriteriaItems) {
|
|
6171
|
+
const checkbox = criterion.checked ? "[x]" : "[ ]";
|
|
6172
|
+
lines.push(`- ${checkbox} ${criterion.text}`);
|
|
6173
|
+
}
|
|
6174
|
+
lines.push("");
|
|
6175
|
+
}
|
|
6176
|
+
if (task.implementationPlan) {
|
|
6177
|
+
lines.push("## Implementation Plan");
|
|
6178
|
+
lines.push("");
|
|
6179
|
+
lines.push(task.implementationPlan);
|
|
6180
|
+
lines.push("");
|
|
6181
|
+
}
|
|
6182
|
+
if (task.implementationNotes) {
|
|
6183
|
+
lines.push("## Implementation Notes");
|
|
6184
|
+
lines.push("");
|
|
6185
|
+
lines.push(task.implementationNotes);
|
|
6186
|
+
lines.push("");
|
|
6187
|
+
}
|
|
6188
|
+
return lines.join("\n");
|
|
6189
|
+
}
|
|
6190
|
+
function parseMarkdownContent(content2) {
|
|
6191
|
+
let frontmatter = {};
|
|
6192
|
+
let remaining = content2;
|
|
6193
|
+
const frontmatterMatch = content2.match(/^---\n([\s\S]*?)\n---\n/);
|
|
6194
|
+
if (frontmatterMatch) {
|
|
6195
|
+
frontmatter = parseFrontmatter(frontmatterMatch[1]);
|
|
6196
|
+
remaining = content2.slice(frontmatterMatch[0].length);
|
|
6197
|
+
}
|
|
6198
|
+
let title = "";
|
|
6199
|
+
const titleMatch = remaining.match(/^#\s+(.+)$/m);
|
|
6200
|
+
if (titleMatch) {
|
|
6201
|
+
title = titleMatch[1].trim();
|
|
6202
|
+
}
|
|
6203
|
+
const acceptanceCriteria = parseAcceptanceCriteria(remaining);
|
|
6204
|
+
const rawContent = remaining.trim();
|
|
6205
|
+
const description = extractDescription(remaining, title);
|
|
6206
|
+
return { frontmatter, title, rawContent, description, acceptanceCriteria };
|
|
6207
|
+
}
|
|
6208
|
+
function parseFrontmatter(raw2) {
|
|
6209
|
+
const result = {};
|
|
6210
|
+
for (const line of raw2.split("\n")) {
|
|
6211
|
+
const match = line.match(/^(\w+):\s*(.+)$/);
|
|
6212
|
+
if (!match)
|
|
6213
|
+
continue;
|
|
6214
|
+
const [, key2, value] = match;
|
|
6215
|
+
switch (key2) {
|
|
6216
|
+
case "status":
|
|
6217
|
+
result.status = value.trim();
|
|
6218
|
+
break;
|
|
6219
|
+
case "priority":
|
|
6220
|
+
result.priority = value.trim();
|
|
6221
|
+
break;
|
|
6222
|
+
case "ordinal":
|
|
6223
|
+
result.ordinal = parseInt(value.trim(), 10);
|
|
6224
|
+
break;
|
|
6225
|
+
case "reporter":
|
|
6226
|
+
case "milestone":
|
|
6227
|
+
case "parentTaskId":
|
|
6228
|
+
case "branch":
|
|
6229
|
+
case "createdDate":
|
|
6230
|
+
case "updatedDate":
|
|
6231
|
+
result[key2] = value.trim();
|
|
6232
|
+
break;
|
|
6233
|
+
case "assignee":
|
|
6234
|
+
case "labels":
|
|
6235
|
+
case "dependencies":
|
|
6236
|
+
case "references":
|
|
6237
|
+
case "subtasks":
|
|
6238
|
+
result[key2] = parseArrayValue(value);
|
|
6239
|
+
break;
|
|
6240
|
+
}
|
|
6241
|
+
}
|
|
6242
|
+
return result;
|
|
6243
|
+
}
|
|
6244
|
+
function parseArrayValue(value) {
|
|
6245
|
+
const cleaned = value.replace(/^\[|\]$/g, "").trim();
|
|
6246
|
+
if (!cleaned)
|
|
6247
|
+
return [];
|
|
6248
|
+
return cleaned.split(",").map((s2) => s2.trim()).filter(Boolean);
|
|
6249
|
+
}
|
|
6250
|
+
function parseAcceptanceCriteria(content2) {
|
|
6251
|
+
const criteria = [];
|
|
6252
|
+
const checkboxPattern = /^-\s*\[([ xX])\]\s*(.+)$/gm;
|
|
6253
|
+
const matches = content2.matchAll(checkboxPattern);
|
|
6254
|
+
let index2 = 1;
|
|
6255
|
+
for (const match of matches) {
|
|
6256
|
+
criteria.push({
|
|
6257
|
+
index: index2++,
|
|
6258
|
+
checked: match[1].toLowerCase() === "x",
|
|
6259
|
+
text: match[2].trim()
|
|
6260
|
+
});
|
|
6261
|
+
}
|
|
6262
|
+
return criteria;
|
|
6263
|
+
}
|
|
6264
|
+
function extractDescription(content2, title) {
|
|
6265
|
+
const descriptionSection = extractSection(content2, "Description");
|
|
6266
|
+
if (descriptionSection) {
|
|
6267
|
+
return stripHtmlComments(descriptionSection).trim();
|
|
6268
|
+
}
|
|
6269
|
+
let body = content2;
|
|
6270
|
+
if (title) {
|
|
6271
|
+
body = body.replace(new RegExp(`^#\\s+${escapeRegex(title)}\\s*\\n?`, "m"), "");
|
|
6272
|
+
}
|
|
6273
|
+
const firstSectionMatch = body.match(/^##\s+/m);
|
|
6274
|
+
if (firstSectionMatch && firstSectionMatch.index !== void 0) {
|
|
6275
|
+
body = body.slice(0, firstSectionMatch.index);
|
|
6276
|
+
}
|
|
6277
|
+
body = stripHtmlComments(body);
|
|
6278
|
+
return body.trim();
|
|
6279
|
+
}
|
|
6280
|
+
function stripHtmlComments(content2) {
|
|
6281
|
+
return content2.replace(/<!--[\s\S]*?-->/g, "").trim();
|
|
6282
|
+
}
|
|
6283
|
+
function extractIdFromPath(filePath) {
|
|
6284
|
+
const filename = filePath.split("/").pop() || "";
|
|
6285
|
+
const match = filename.match(/^(?:task-)?(\d+(?:\.\d+)?)\s*-/);
|
|
6286
|
+
if (match) {
|
|
6287
|
+
return match[1];
|
|
6288
|
+
}
|
|
6289
|
+
return filename.replace(/\.md$/, "");
|
|
6290
|
+
}
|
|
6291
|
+
function extractTitleFromPath(filePath) {
|
|
6292
|
+
const filename = filePath.split("/").pop() || "";
|
|
6293
|
+
const match = filename.match(/^(?:task-)?\d+(?:\.\d+)?\s*-\s*(.+)\.md$/);
|
|
6294
|
+
if (match) {
|
|
6295
|
+
return match[1].trim();
|
|
6296
|
+
}
|
|
6297
|
+
return filename.replace(/\.md$/, "");
|
|
6298
|
+
}
|
|
6299
|
+
function extractSourceFromPath(filePath) {
|
|
6300
|
+
if (filePath.includes("/completed/") || filePath.includes("\\completed\\")) {
|
|
6301
|
+
return "completed";
|
|
6302
|
+
}
|
|
6303
|
+
return "tasks";
|
|
6304
|
+
}
|
|
6305
|
+
function extractTaskIndexFromPath(filePath) {
|
|
6306
|
+
return {
|
|
6307
|
+
id: extractIdFromPath(filePath),
|
|
6308
|
+
filePath,
|
|
6309
|
+
title: extractTitleFromPath(filePath),
|
|
6310
|
+
source: extractSourceFromPath(filePath)
|
|
6311
|
+
};
|
|
6312
|
+
}
|
|
6313
|
+
function escapeRegex(str) {
|
|
6314
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
6315
|
+
}
|
|
6316
|
+
function extractSection(content2, sectionTitle) {
|
|
6317
|
+
var _a;
|
|
6318
|
+
const src = content2.replace(/\r\n/g, "\n");
|
|
6319
|
+
const regex2 = new RegExp(`## ${sectionTitle}\\s*\\n([\\s\\S]*?)(?=\\n## |$)`, "i");
|
|
6320
|
+
const match = src.match(regex2);
|
|
6321
|
+
return (_a = match == null ? void 0 : match[1]) == null ? void 0 : _a.trim();
|
|
6322
|
+
}
|
|
6323
|
+
function parseMilestoneFrontmatter(raw2) {
|
|
6324
|
+
const result = {};
|
|
6325
|
+
for (const line of raw2.split("\n")) {
|
|
6326
|
+
const match = line.match(/^(\w+):\s*(.+)$/);
|
|
6327
|
+
if (!match)
|
|
6328
|
+
continue;
|
|
6329
|
+
const [, key2, value] = match;
|
|
6330
|
+
let cleanValue = value.trim();
|
|
6331
|
+
if (cleanValue.startsWith('"') && cleanValue.endsWith('"') || cleanValue.startsWith("'") && cleanValue.endsWith("'")) {
|
|
6332
|
+
cleanValue = cleanValue.slice(1, -1);
|
|
6333
|
+
}
|
|
6334
|
+
switch (key2) {
|
|
6335
|
+
case "id":
|
|
6336
|
+
case "title":
|
|
6337
|
+
result[key2] = cleanValue;
|
|
6338
|
+
break;
|
|
6339
|
+
case "tasks":
|
|
6340
|
+
if (cleanValue.startsWith("[") && cleanValue.endsWith("]")) {
|
|
6341
|
+
result.tasks = cleanValue.slice(1, -1).split(",").map((s2) => s2.trim()).filter(Boolean);
|
|
6342
|
+
}
|
|
6343
|
+
break;
|
|
6344
|
+
}
|
|
6345
|
+
}
|
|
6346
|
+
return result;
|
|
6347
|
+
}
|
|
6348
|
+
function parseMilestoneMarkdown(content2) {
|
|
6349
|
+
let frontmatter = {};
|
|
6350
|
+
let remaining = content2;
|
|
6351
|
+
const frontmatterMatch = content2.match(/^---\n([\s\S]*?)\n---\n/);
|
|
6352
|
+
if (frontmatterMatch) {
|
|
6353
|
+
frontmatter = parseMilestoneFrontmatter(frontmatterMatch[1]);
|
|
6354
|
+
remaining = content2.slice(frontmatterMatch[0].length);
|
|
6355
|
+
}
|
|
6356
|
+
const rawContent = remaining.trim();
|
|
6357
|
+
const description = extractSection(rawContent, "Description") || "";
|
|
6358
|
+
return {
|
|
6359
|
+
id: frontmatter.id || "",
|
|
6360
|
+
title: frontmatter.title || "",
|
|
6361
|
+
description,
|
|
6362
|
+
rawContent,
|
|
6363
|
+
tasks: frontmatter.tasks || []
|
|
4358
6364
|
};
|
|
4359
6365
|
}
|
|
4360
6366
|
function serializeMilestoneMarkdown(milestone) {
|
|
@@ -5909,7 +7915,8 @@ function useKanbanData(options) {
|
|
|
5909
7915
|
const {
|
|
5910
7916
|
context,
|
|
5911
7917
|
actions,
|
|
5912
|
-
tasksLimit = DEFAULT_TASKS_LIMIT
|
|
7918
|
+
tasksLimit = DEFAULT_TASKS_LIMIT,
|
|
7919
|
+
events: events2
|
|
5913
7920
|
} = options || {};
|
|
5914
7921
|
const [tasks, setTasks] = useState([]);
|
|
5915
7922
|
const [isLoading, setIsLoading] = useState(true);
|
|
@@ -6054,6 +8061,19 @@ function useKanbanData(options) {
|
|
|
6054
8061
|
useEffect(() => {
|
|
6055
8062
|
loadBacklogData();
|
|
6056
8063
|
}, [loadBacklogData]);
|
|
8064
|
+
useEffect(() => {
|
|
8065
|
+
if (!events2) return;
|
|
8066
|
+
const unsubscribe = events2.on("file:write-complete", (event) => {
|
|
8067
|
+
const payload = event.payload || {};
|
|
8068
|
+
const filePath = payload.path || "";
|
|
8069
|
+
if (filePath.includes("backlog/tasks/")) {
|
|
8070
|
+
console.log("[useKanbanData] Task file written, refreshing data:", filePath);
|
|
8071
|
+
fileTreeVersionRef.current = null;
|
|
8072
|
+
loadBacklogData();
|
|
8073
|
+
}
|
|
8074
|
+
});
|
|
8075
|
+
return unsubscribe;
|
|
8076
|
+
}, [events2, loadBacklogData]);
|
|
6057
8077
|
const loadMoreTasks = useCallback(async () => {
|
|
6058
8078
|
const core2 = coreRef.current;
|
|
6059
8079
|
if (!core2) {
|
|
@@ -6177,6 +8197,16 @@ function useKanbanData(options) {
|
|
|
6177
8197
|
core: coreRef.current
|
|
6178
8198
|
};
|
|
6179
8199
|
}
|
|
8200
|
+
function getGitHubIssueFromRefs$1(references) {
|
|
8201
|
+
if (!references) return null;
|
|
8202
|
+
for (const ref of references) {
|
|
8203
|
+
const match = ref.match(/github\.com\/[^/]+\/[^/]+\/issues\/(\d+)/);
|
|
8204
|
+
if (match) {
|
|
8205
|
+
return { number: parseInt(match[1], 10), url: ref };
|
|
8206
|
+
}
|
|
8207
|
+
}
|
|
8208
|
+
return null;
|
|
8209
|
+
}
|
|
6180
8210
|
const TaskCard = ({
|
|
6181
8211
|
task,
|
|
6182
8212
|
onClick,
|
|
@@ -6327,15 +8357,44 @@ const TaskCard = ({
|
|
|
6327
8357
|
color: theme2.colors.textMuted
|
|
6328
8358
|
},
|
|
6329
8359
|
children: [
|
|
6330
|
-
/* @__PURE__ */
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
8360
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
8361
|
+
/* @__PURE__ */ jsx(
|
|
8362
|
+
"span",
|
|
8363
|
+
{
|
|
8364
|
+
style: {
|
|
8365
|
+
fontFamily: theme2.fonts.monospace
|
|
8366
|
+
},
|
|
8367
|
+
children: task.id
|
|
8368
|
+
}
|
|
8369
|
+
),
|
|
8370
|
+
(() => {
|
|
8371
|
+
const issue = getGitHubIssueFromRefs$1(task.references);
|
|
8372
|
+
if (!issue) return null;
|
|
8373
|
+
return /* @__PURE__ */ jsxs(
|
|
8374
|
+
"a",
|
|
8375
|
+
{
|
|
8376
|
+
href: issue.url,
|
|
8377
|
+
target: "_blank",
|
|
8378
|
+
rel: "noopener noreferrer",
|
|
8379
|
+
onClick: (e) => e.stopPropagation(),
|
|
8380
|
+
style: {
|
|
8381
|
+
display: "inline-flex",
|
|
8382
|
+
alignItems: "center",
|
|
8383
|
+
gap: "3px",
|
|
8384
|
+
color: theme2.colors.primary,
|
|
8385
|
+
textDecoration: "none",
|
|
8386
|
+
fontSize: theme2.fontSizes[0]
|
|
8387
|
+
},
|
|
8388
|
+
title: `View issue #${issue.number} on GitHub`,
|
|
8389
|
+
children: [
|
|
8390
|
+
/* @__PURE__ */ jsx(ExternalLink, { size: 10 }),
|
|
8391
|
+
"#",
|
|
8392
|
+
issue.number
|
|
8393
|
+
]
|
|
8394
|
+
}
|
|
8395
|
+
);
|
|
8396
|
+
})()
|
|
8397
|
+
] }),
|
|
6339
8398
|
task.assignee && task.assignee.length > 0 && /* @__PURE__ */ jsxs(
|
|
6340
8399
|
"span",
|
|
6341
8400
|
{
|
|
@@ -7829,7 +9888,7 @@ const KanbanPanel = ({
|
|
|
7829
9888
|
const [selectedTaskId, setSelectedTaskId] = useState(null);
|
|
7830
9889
|
const [selectedTab, setSelectedTab] = useState("todo");
|
|
7831
9890
|
const [isNarrowView, setIsNarrowView] = useState(false);
|
|
7832
|
-
const
|
|
9891
|
+
const kanbanPanelRef = useRef(null);
|
|
7833
9892
|
const [viewMode, setViewMode] = useState("board");
|
|
7834
9893
|
const [activeTask, setActiveTask] = useState(null);
|
|
7835
9894
|
const [isTaskModalOpen, setIsTaskModalOpen] = useState(false);
|
|
@@ -7854,7 +9913,7 @@ const KanbanPanel = ({
|
|
|
7854
9913
|
}
|
|
7855
9914
|
};
|
|
7856
9915
|
useLayoutEffect(() => {
|
|
7857
|
-
const container =
|
|
9916
|
+
const container = kanbanPanelRef.current;
|
|
7858
9917
|
if (!container) return;
|
|
7859
9918
|
const observer = new ResizeObserver((entries) => {
|
|
7860
9919
|
for (const entry of entries) {
|
|
@@ -7864,6 +9923,14 @@ const KanbanPanel = ({
|
|
|
7864
9923
|
observer.observe(container);
|
|
7865
9924
|
return () => observer.disconnect();
|
|
7866
9925
|
}, []);
|
|
9926
|
+
gt(
|
|
9927
|
+
"backlog-kanban",
|
|
9928
|
+
events2,
|
|
9929
|
+
() => {
|
|
9930
|
+
var _a2;
|
|
9931
|
+
return (_a2 = kanbanPanelRef.current) == null ? void 0 : _a2.focus();
|
|
9932
|
+
}
|
|
9933
|
+
);
|
|
7867
9934
|
useEffect(() => {
|
|
7868
9935
|
if (!events2) return;
|
|
7869
9936
|
const unsubscribe = events2.on("task:selected", (event) => {
|
|
@@ -7889,6 +9956,7 @@ const KanbanPanel = ({
|
|
|
7889
9956
|
} = useKanbanData({
|
|
7890
9957
|
context,
|
|
7891
9958
|
actions,
|
|
9959
|
+
events: events2,
|
|
7892
9960
|
tasksLimit: 20
|
|
7893
9961
|
});
|
|
7894
9962
|
const {
|
|
@@ -8084,7 +10152,8 @@ const KanbanPanel = ({
|
|
|
8084
10152
|
return /* @__PURE__ */ jsxs(
|
|
8085
10153
|
"div",
|
|
8086
10154
|
{
|
|
8087
|
-
ref:
|
|
10155
|
+
ref: kanbanPanelRef,
|
|
10156
|
+
tabIndex: -1,
|
|
8088
10157
|
style: {
|
|
8089
10158
|
padding: "clamp(12px, 3vw, 20px)",
|
|
8090
10159
|
// Responsive padding for mobile
|
|
@@ -8098,7 +10167,9 @@ const KanbanPanel = ({
|
|
|
8098
10167
|
overflow: "hidden",
|
|
8099
10168
|
// Prevent outer scrolling
|
|
8100
10169
|
backgroundColor: theme2.colors.background,
|
|
8101
|
-
color: theme2.colors.text
|
|
10170
|
+
color: theme2.colors.text,
|
|
10171
|
+
outline: "none"
|
|
10172
|
+
// Remove default focus outline
|
|
8102
10173
|
},
|
|
8103
10174
|
children: [
|
|
8104
10175
|
/* @__PURE__ */ jsxs(
|
|
@@ -45793,20 +47864,20 @@ class EditMap {
|
|
|
45793
47864
|
this.map.length = 0;
|
|
45794
47865
|
}
|
|
45795
47866
|
}
|
|
45796
|
-
function addImplementation(editMap,
|
|
47867
|
+
function addImplementation(editMap, at2, remove, add2) {
|
|
45797
47868
|
let index2 = 0;
|
|
45798
47869
|
if (remove === 0 && add2.length === 0) {
|
|
45799
47870
|
return;
|
|
45800
47871
|
}
|
|
45801
47872
|
while (index2 < editMap.map.length) {
|
|
45802
|
-
if (editMap.map[index2][0] ===
|
|
47873
|
+
if (editMap.map[index2][0] === at2) {
|
|
45803
47874
|
editMap.map[index2][1] += remove;
|
|
45804
47875
|
editMap.map[index2][2].push(...add2);
|
|
45805
47876
|
return;
|
|
45806
47877
|
}
|
|
45807
47878
|
index2 += 1;
|
|
45808
47879
|
}
|
|
45809
|
-
editMap.map.push([
|
|
47880
|
+
editMap.map.push([at2, remove, add2]);
|
|
45810
47881
|
}
|
|
45811
47882
|
function gfmTableAlign(events2, index2) {
|
|
45812
47883
|
let inDelimiterRow = false;
|
|
@@ -47963,7 +50034,7 @@ var css_248z = ".transform-component-module_wrapper__SPB86 {\n position: relati
|
|
|
47963
50034
|
var styles = { "wrapper": "transform-component-module_wrapper__SPB86", "content": "transform-component-module_content__FBWxo" };
|
|
47964
50035
|
styleInject(css_248z);
|
|
47965
50036
|
var TransformComponent = function(_a) {
|
|
47966
|
-
var children2 = _a.children, _b = _a.wrapperClass, wrapperClass = _b === void 0 ? "" : _b, _c = _a.contentClass, contentClass = _c === void 0 ? "" : _c, wrapperStyle = _a.wrapperStyle, contentStyle = _a.contentStyle, _d = _a.wrapperProps, wrapperProps = _d === void 0 ? {} : _d,
|
|
50037
|
+
var children2 = _a.children, _b = _a.wrapperClass, wrapperClass = _b === void 0 ? "" : _b, _c = _a.contentClass, contentClass = _c === void 0 ? "" : _c, wrapperStyle = _a.wrapperStyle, contentStyle = _a.contentStyle, _d = _a.wrapperProps, wrapperProps = _d === void 0 ? {} : _d, _e2 = _a.contentProps, contentProps = _e2 === void 0 ? {} : _e2;
|
|
47967
50038
|
var _f = useContext(Context), init = _f.init, cleanupWindowEvents = _f.cleanupWindowEvents;
|
|
47968
50039
|
var wrapperRef = useRef(null);
|
|
47969
50040
|
var contentRef = useRef(null);
|
|
@@ -49459,7 +51530,7 @@ var createIndustryMarkdownComponents = ({
|
|
|
49459
51530
|
...props
|
|
49460
51531
|
}, children2),
|
|
49461
51532
|
li: ({ children: children2, ...props }) => {
|
|
49462
|
-
var _a, _b, _c, _d,
|
|
51533
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h;
|
|
49463
51534
|
const isTaskListItem = Array.isArray(children2) && children2.length > 0 && React2__default.isValidElement(children2[0]) && ((_b = (_a = children2[0]) == null ? void 0 : _a.props) == null ? void 0 : _b.type) === "checkbox";
|
|
49464
51535
|
if (isTaskListItem) {
|
|
49465
51536
|
const checkbox = children2[0];
|
|
@@ -49474,7 +51545,7 @@ var createIndustryMarkdownComponents = ({
|
|
|
49474
51545
|
}
|
|
49475
51546
|
});
|
|
49476
51547
|
const checked = ((_c = checkbox == null ? void 0 : checkbox.props) == null ? void 0 : _c.checked) || false;
|
|
49477
|
-
const lineNumber = ((
|
|
51548
|
+
const lineNumber = ((_e2 = (_d = props.sourcePosition) == null ? void 0 : _d.start) == null ? void 0 : _e2.line) || ((_h = (_g = (_f = props.node) == null ? void 0 : _f.position) == null ? void 0 : _g.start) == null ? void 0 : _h.line) || 1;
|
|
49478
51549
|
const id = `${slideIdPrefix}-checkbox-${lineNumber}`;
|
|
49479
51550
|
const isChecked = checkedItems[id] ?? checked;
|
|
49480
51551
|
const handleChange = (e) => {
|
|
@@ -49619,7 +51690,7 @@ var createIndustryMarkdownComponents = ({
|
|
|
49619
51690
|
});
|
|
49620
51691
|
},
|
|
49621
51692
|
code: ({ node: node2, className, children: children2, ...props }) => {
|
|
49622
|
-
var _a, _b, _c, _d,
|
|
51693
|
+
var _a, _b, _c, _d, _e2, _f;
|
|
49623
51694
|
const hasLanguageClass = className && (className.includes("language-") || className.includes("hljs"));
|
|
49624
51695
|
const codeString = extractTextFromChildren(children2);
|
|
49625
51696
|
const matchLang = /language-(\w+)/.exec(className || "");
|
|
@@ -49831,7 +51902,7 @@ var createIndustryMarkdownComponents = ({
|
|
|
49831
51902
|
...props
|
|
49832
51903
|
}, children2)));
|
|
49833
51904
|
}
|
|
49834
|
-
const cleanClassName = (_f = (
|
|
51905
|
+
const cleanClassName = (_f = (_e2 = (_d = className == null ? void 0 : className.replace(/hljs(-\w+)?/g, "")) == null ? void 0 : _d.replace(/language-\w+/g, "")) == null ? void 0 : _e2.replace(/\s+/g, " ")) == null ? void 0 : _f.trim();
|
|
49835
51906
|
return /* @__PURE__ */ React2__default.createElement("code", {
|
|
49836
51907
|
style: {
|
|
49837
51908
|
color: theme2.colors.accent,
|
|
@@ -50870,7 +52941,7 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
|
|
|
50870
52941
|
}
|
|
50871
52942
|
}, [slideIndex]);
|
|
50872
52943
|
const sanitizeSchema = useMemo(() => {
|
|
50873
|
-
var _a, _b, _c, _d,
|
|
52944
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
|
|
50874
52945
|
return {
|
|
50875
52946
|
...defaultSchema,
|
|
50876
52947
|
tagNames: [...defaultSchema.tagNames || [], "picture", "source", "mark"],
|
|
@@ -50881,7 +52952,7 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
|
|
|
50881
52952
|
span: [...((_b = defaultSchema.attributes) == null ? void 0 : _b.span) || [], "className", "style"],
|
|
50882
52953
|
pre: [...((_c = defaultSchema.attributes) == null ? void 0 : _c.pre) || [], "className", "style"],
|
|
50883
52954
|
div: [...((_d = defaultSchema.attributes) == null ? void 0 : _d.div) || [], "style", "className", "id"],
|
|
50884
|
-
p: [...((
|
|
52955
|
+
p: [...((_e2 = defaultSchema.attributes) == null ? void 0 : _e2.p) || [], "style", "className", "id"],
|
|
50885
52956
|
h1: [...((_f = defaultSchema.attributes) == null ? void 0 : _f.h1) || [], "style", "className", "id"],
|
|
50886
52957
|
h2: [...((_g = defaultSchema.attributes) == null ? void 0 : _g.h2) || [], "style", "className", "id"],
|
|
50887
52958
|
h3: [...((_h = defaultSchema.attributes) == null ? void 0 : _h.h3) || [], "style", "className", "id"],
|
|
@@ -52696,14 +54767,14 @@ var M = forwardRef(({ panels: o2, className: a2 = "", style: s2, theme: d2, minP
|
|
|
52696
54767
|
const y2 = o2.length, w2 = 2 * u2;
|
|
52697
54768
|
let x2;
|
|
52698
54769
|
x2 = y2 === 1 || y2 === 2 ? "100%" : `max(${u2}px, ${100 * p2}%)`;
|
|
52699
|
-
const
|
|
54770
|
+
const C2 = React2__default.useId().replace(/:/g, "_");
|
|
52700
54771
|
return jsxs(Fragment, { children: [
|
|
52701
54772
|
y2 === 2 && /* @__PURE__ */ jsx("style", { children: `
|
|
52702
|
-
.snap-carousel-container[data-carousel-id="${
|
|
54773
|
+
.snap-carousel-container[data-carousel-id="${C2}"][data-panel-count="2"] .snap-carousel-panel {
|
|
52703
54774
|
width: 100%;
|
|
52704
54775
|
}
|
|
52705
54776
|
@container (min-width: ${w2}px) {
|
|
52706
|
-
.snap-carousel-container[data-carousel-id="${
|
|
54777
|
+
.snap-carousel-container[data-carousel-id="${C2}"][data-panel-count="2"] .snap-carousel-panel {
|
|
52707
54778
|
width: 50%;
|
|
52708
54779
|
}
|
|
52709
54780
|
}
|
|
@@ -52718,7 +54789,7 @@ var M = forwardRef(({ panels: o2, className: a2 = "", style: s2, theme: d2, minP
|
|
|
52718
54789
|
a3 < o3 && (o3 = a3, r2 = i2);
|
|
52719
54790
|
}
|
|
52720
54791
|
m2(r2);
|
|
52721
|
-
}, "data-panel-count": y2, "data-carousel-id":
|
|
54792
|
+
}, "data-panel-count": y2, "data-carousel-id": C2, children: o2.map((t2, n2) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
|
|
52722
54793
|
] });
|
|
52723
54794
|
});
|
|
52724
54795
|
M.displayName = "SnapCarousel";
|
|
@@ -52812,6 +54883,16 @@ var DocumentView = ({
|
|
|
52812
54883
|
editable
|
|
52813
54884
|
})));
|
|
52814
54885
|
};
|
|
54886
|
+
function getGitHubIssueFromRefs(references) {
|
|
54887
|
+
if (!references) return null;
|
|
54888
|
+
for (const ref of references) {
|
|
54889
|
+
const match = ref.match(/github\.com\/[^/]+\/[^/]+\/issues\/(\d+)/);
|
|
54890
|
+
if (match) {
|
|
54891
|
+
return { number: parseInt(match[1], 10), url: ref };
|
|
54892
|
+
}
|
|
54893
|
+
}
|
|
54894
|
+
return null;
|
|
54895
|
+
}
|
|
52815
54896
|
function getTaskBodyMarkdown(task, options = {}) {
|
|
52816
54897
|
const { includeTitle = false } = options;
|
|
52817
54898
|
if (task.rawContent) {
|
|
@@ -52890,34 +54971,23 @@ const StatusBadge = ({ status }) => {
|
|
|
52890
54971
|
}
|
|
52891
54972
|
);
|
|
52892
54973
|
};
|
|
52893
|
-
const MetadataRow = ({ icon, label, value }) => {
|
|
52894
|
-
const { theme: theme2 } = useTheme();
|
|
52895
|
-
return /* @__PURE__ */ jsxs(
|
|
52896
|
-
"div",
|
|
52897
|
-
{
|
|
52898
|
-
style: {
|
|
52899
|
-
display: "flex",
|
|
52900
|
-
alignItems: "center",
|
|
52901
|
-
gap: "8px",
|
|
52902
|
-
fontSize: theme2.fontSizes[1]
|
|
52903
|
-
},
|
|
52904
|
-
children: [
|
|
52905
|
-
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textMuted, display: "flex", alignItems: "center" }, children: icon }),
|
|
52906
|
-
/* @__PURE__ */ jsxs("span", { style: { color: theme2.colors.textSecondary }, children: [
|
|
52907
|
-
label,
|
|
52908
|
-
":"
|
|
52909
|
-
] }),
|
|
52910
|
-
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.text }, children: value })
|
|
52911
|
-
]
|
|
52912
|
-
}
|
|
52913
|
-
);
|
|
52914
|
-
};
|
|
52915
54974
|
const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
|
|
52916
54975
|
var _a;
|
|
52917
54976
|
const { theme: theme2 } = useTheme();
|
|
52918
54977
|
const [selectedTask, setSelectedTask] = useState(null);
|
|
52919
54978
|
const [claudeAssignment, setClaudeAssignment] = useState({ status: "idle" });
|
|
54979
|
+
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
|
|
54980
|
+
const [deleteState, setDeleteState] = useState({ status: "idle" });
|
|
54981
|
+
const panelRef = useRef(null);
|
|
52920
54982
|
const { editable = false } = config ?? {};
|
|
54983
|
+
gt(
|
|
54984
|
+
"task-detail",
|
|
54985
|
+
events2,
|
|
54986
|
+
() => {
|
|
54987
|
+
var _a2;
|
|
54988
|
+
return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
|
|
54989
|
+
}
|
|
54990
|
+
);
|
|
52921
54991
|
const repoCapabilities = context.getRepositorySlice("repoCapabilities");
|
|
52922
54992
|
const hasClaudeWorkflow = ((_a = repoCapabilities == null ? void 0 : repoCapabilities.data) == null ? void 0 : _a.hasClaudeWorkflow) ?? false;
|
|
52923
54993
|
const handleAssignToClaude = useCallback(() => {
|
|
@@ -52938,11 +55008,27 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
|
|
|
52938
55008
|
assignee: selectedTask.assignee,
|
|
52939
55009
|
acceptanceCriteria: selectedTask.acceptanceCriteriaItems,
|
|
52940
55010
|
implementationPlan: selectedTask.implementationPlan,
|
|
52941
|
-
rawContent: selectedTask.rawContent
|
|
55011
|
+
rawContent: selectedTask.rawContent,
|
|
55012
|
+
filePath: selectedTask.filePath,
|
|
55013
|
+
status: selectedTask.status,
|
|
55014
|
+
references: selectedTask.references
|
|
52942
55015
|
}
|
|
52943
55016
|
}
|
|
52944
55017
|
});
|
|
52945
55018
|
}, [events2, selectedTask]);
|
|
55019
|
+
const handleDeleteConfirm = useCallback(() => {
|
|
55020
|
+
if (!events2 || !selectedTask) return;
|
|
55021
|
+
setDeleteState({ status: "loading" });
|
|
55022
|
+
events2.emit({
|
|
55023
|
+
type: "task:delete-requested",
|
|
55024
|
+
source: "task-detail-panel",
|
|
55025
|
+
timestamp: Date.now(),
|
|
55026
|
+
payload: {
|
|
55027
|
+
taskId: selectedTask.id,
|
|
55028
|
+
task: selectedTask
|
|
55029
|
+
}
|
|
55030
|
+
});
|
|
55031
|
+
}, [events2, selectedTask]);
|
|
52946
55032
|
useEffect(() => {
|
|
52947
55033
|
if (!events2) return;
|
|
52948
55034
|
const handleTaskSelected = (event) => {
|
|
@@ -52985,8 +55071,46 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
|
|
|
52985
55071
|
});
|
|
52986
55072
|
};
|
|
52987
55073
|
}, [events2, selectedTask == null ? void 0 : selectedTask.id]);
|
|
55074
|
+
useEffect(() => {
|
|
55075
|
+
if (!events2) return;
|
|
55076
|
+
const unsubscribers = [
|
|
55077
|
+
events2.on("task:deleted:success", (event) => {
|
|
55078
|
+
const payload = event.payload;
|
|
55079
|
+
if (payload.taskId === (selectedTask == null ? void 0 : selectedTask.id)) {
|
|
55080
|
+
setDeleteState({ status: "success" });
|
|
55081
|
+
setIsDeleteModalOpen(false);
|
|
55082
|
+
setTimeout(() => {
|
|
55083
|
+
events2.emit({
|
|
55084
|
+
type: "task:deleted",
|
|
55085
|
+
source: "task-detail-panel",
|
|
55086
|
+
timestamp: Date.now(),
|
|
55087
|
+
payload: { taskId: payload.taskId }
|
|
55088
|
+
});
|
|
55089
|
+
setSelectedTask(null);
|
|
55090
|
+
setDeleteState({ status: "idle" });
|
|
55091
|
+
}, 2e3);
|
|
55092
|
+
}
|
|
55093
|
+
}),
|
|
55094
|
+
events2.on("task:deleted:error", (event) => {
|
|
55095
|
+
const payload = event.payload;
|
|
55096
|
+
if (payload.taskId === (selectedTask == null ? void 0 : selectedTask.id)) {
|
|
55097
|
+
setDeleteState({
|
|
55098
|
+
status: "error",
|
|
55099
|
+
error: payload.error
|
|
55100
|
+
});
|
|
55101
|
+
}
|
|
55102
|
+
})
|
|
55103
|
+
];
|
|
55104
|
+
return () => {
|
|
55105
|
+
unsubscribers.forEach((unsub) => {
|
|
55106
|
+
if (typeof unsub === "function") unsub();
|
|
55107
|
+
});
|
|
55108
|
+
};
|
|
55109
|
+
}, [events2, selectedTask == null ? void 0 : selectedTask.id]);
|
|
52988
55110
|
const handleBack = () => {
|
|
52989
55111
|
setSelectedTask(null);
|
|
55112
|
+
setDeleteState({ status: "idle" });
|
|
55113
|
+
setIsDeleteModalOpen(false);
|
|
52990
55114
|
if (events2) {
|
|
52991
55115
|
events2.emit({
|
|
52992
55116
|
type: "task:deselected",
|
|
@@ -53046,13 +55170,16 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
|
|
|
53046
55170
|
return /* @__PURE__ */ jsxs(
|
|
53047
55171
|
"div",
|
|
53048
55172
|
{
|
|
55173
|
+
ref: panelRef,
|
|
55174
|
+
tabIndex: -1,
|
|
53049
55175
|
style: {
|
|
53050
55176
|
height: "100%",
|
|
53051
55177
|
display: "flex",
|
|
53052
55178
|
flexDirection: "column",
|
|
53053
55179
|
backgroundColor: theme2.colors.background,
|
|
53054
55180
|
color: theme2.colors.text,
|
|
53055
|
-
overflow: "hidden"
|
|
55181
|
+
overflow: "hidden",
|
|
55182
|
+
outline: "none"
|
|
53056
55183
|
},
|
|
53057
55184
|
children: [
|
|
53058
55185
|
/* @__PURE__ */ jsxs(
|
|
@@ -53087,10 +55214,11 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
|
|
|
53087
55214
|
children: selectedTask.id
|
|
53088
55215
|
}
|
|
53089
55216
|
),
|
|
55217
|
+
selectedTask.priority && /* @__PURE__ */ jsx("span", { style: getPriorityStyles(theme2, selectedTask.priority), children: selectedTask.priority }),
|
|
53090
55218
|
/* @__PURE__ */ jsx(StatusBadge, { status: selectedTask.status })
|
|
53091
55219
|
] }),
|
|
53092
55220
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
53093
|
-
hasClaudeWorkflow && claudeAssignment.status === "idle" && /* @__PURE__ */ jsxs(
|
|
55221
|
+
hasClaudeWorkflow && claudeAssignment.status === "idle" && !getGitHubIssueFromRefs(selectedTask.references) && /* @__PURE__ */ jsxs(
|
|
53094
55222
|
"button",
|
|
53095
55223
|
{
|
|
53096
55224
|
onClick: handleAssignToClaude,
|
|
@@ -53123,6 +55251,46 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
|
|
|
53123
55251
|
]
|
|
53124
55252
|
}
|
|
53125
55253
|
),
|
|
55254
|
+
(() => {
|
|
55255
|
+
const existingIssue = getGitHubIssueFromRefs(selectedTask.references);
|
|
55256
|
+
if (!existingIssue || claudeAssignment.status !== "idle") return null;
|
|
55257
|
+
return /* @__PURE__ */ jsxs(
|
|
55258
|
+
"a",
|
|
55259
|
+
{
|
|
55260
|
+
href: existingIssue.url,
|
|
55261
|
+
target: "_blank",
|
|
55262
|
+
rel: "noopener noreferrer",
|
|
55263
|
+
style: {
|
|
55264
|
+
display: "flex",
|
|
55265
|
+
alignItems: "center",
|
|
55266
|
+
gap: "6px",
|
|
55267
|
+
padding: "6px 12px",
|
|
55268
|
+
border: `1px solid ${theme2.colors.primary}`,
|
|
55269
|
+
borderRadius: theme2.radii[1],
|
|
55270
|
+
background: "transparent",
|
|
55271
|
+
color: theme2.colors.primary,
|
|
55272
|
+
fontSize: theme2.fontSizes[1],
|
|
55273
|
+
fontWeight: theme2.fontWeights.medium,
|
|
55274
|
+
textDecoration: "none",
|
|
55275
|
+
transition: "all 0.2s ease"
|
|
55276
|
+
},
|
|
55277
|
+
onMouseEnter: (e) => {
|
|
55278
|
+
e.currentTarget.style.background = theme2.colors.primary;
|
|
55279
|
+
e.currentTarget.style.color = theme2.colors.background;
|
|
55280
|
+
},
|
|
55281
|
+
onMouseLeave: (e) => {
|
|
55282
|
+
e.currentTarget.style.background = "transparent";
|
|
55283
|
+
e.currentTarget.style.color = theme2.colors.primary;
|
|
55284
|
+
},
|
|
55285
|
+
title: `View issue #${existingIssue.number} on GitHub`,
|
|
55286
|
+
children: [
|
|
55287
|
+
/* @__PURE__ */ jsx(Bot, { size: 14 }),
|
|
55288
|
+
"View Progress",
|
|
55289
|
+
/* @__PURE__ */ jsx(ExternalLink, { size: 12 })
|
|
55290
|
+
]
|
|
55291
|
+
}
|
|
55292
|
+
);
|
|
55293
|
+
})(),
|
|
53126
55294
|
claudeAssignment.status === "loading" && /* @__PURE__ */ jsxs(
|
|
53127
55295
|
"div",
|
|
53128
55296
|
{
|
|
@@ -53204,6 +55372,60 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
|
|
|
53204
55372
|
]
|
|
53205
55373
|
}
|
|
53206
55374
|
),
|
|
55375
|
+
deleteState.status === "idle" && /* @__PURE__ */ jsxs(
|
|
55376
|
+
"button",
|
|
55377
|
+
{
|
|
55378
|
+
onClick: () => setIsDeleteModalOpen(true),
|
|
55379
|
+
style: {
|
|
55380
|
+
display: "flex",
|
|
55381
|
+
alignItems: "center",
|
|
55382
|
+
gap: "6px",
|
|
55383
|
+
padding: "6px 12px",
|
|
55384
|
+
border: `1px solid ${theme2.colors.error}`,
|
|
55385
|
+
borderRadius: theme2.radii[1],
|
|
55386
|
+
background: "transparent",
|
|
55387
|
+
cursor: "pointer",
|
|
55388
|
+
color: theme2.colors.error,
|
|
55389
|
+
fontSize: theme2.fontSizes[1],
|
|
55390
|
+
fontWeight: theme2.fontWeights.medium,
|
|
55391
|
+
transition: "all 0.2s ease"
|
|
55392
|
+
},
|
|
55393
|
+
onMouseEnter: (e) => {
|
|
55394
|
+
e.currentTarget.style.background = theme2.colors.error;
|
|
55395
|
+
e.currentTarget.style.color = theme2.colors.background;
|
|
55396
|
+
},
|
|
55397
|
+
onMouseLeave: (e) => {
|
|
55398
|
+
e.currentTarget.style.background = "transparent";
|
|
55399
|
+
e.currentTarget.style.color = theme2.colors.error;
|
|
55400
|
+
},
|
|
55401
|
+
title: "Delete task",
|
|
55402
|
+
children: [
|
|
55403
|
+
/* @__PURE__ */ jsx(Trash2, { size: 14 }),
|
|
55404
|
+
"Delete"
|
|
55405
|
+
]
|
|
55406
|
+
}
|
|
55407
|
+
),
|
|
55408
|
+
deleteState.status === "success" && /* @__PURE__ */ jsxs(
|
|
55409
|
+
"div",
|
|
55410
|
+
{
|
|
55411
|
+
style: {
|
|
55412
|
+
display: "flex",
|
|
55413
|
+
alignItems: "center",
|
|
55414
|
+
gap: "6px",
|
|
55415
|
+
padding: "6px 12px",
|
|
55416
|
+
border: `1px solid ${theme2.colors.success}`,
|
|
55417
|
+
borderRadius: theme2.radii[1],
|
|
55418
|
+
background: `${theme2.colors.success}15`,
|
|
55419
|
+
color: theme2.colors.success,
|
|
55420
|
+
fontSize: theme2.fontSizes[1],
|
|
55421
|
+
fontWeight: theme2.fontWeights.medium
|
|
55422
|
+
},
|
|
55423
|
+
children: [
|
|
55424
|
+
/* @__PURE__ */ jsx(CircleCheckBig, { size: 14 }),
|
|
55425
|
+
"Task deleted"
|
|
55426
|
+
]
|
|
55427
|
+
}
|
|
55428
|
+
),
|
|
53207
55429
|
/* @__PURE__ */ jsx(
|
|
53208
55430
|
"button",
|
|
53209
55431
|
{
|
|
@@ -53254,80 +55476,6 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
|
|
|
53254
55476
|
},
|
|
53255
55477
|
children: selectedTask.title
|
|
53256
55478
|
}
|
|
53257
|
-
),
|
|
53258
|
-
/* @__PURE__ */ jsxs(
|
|
53259
|
-
"div",
|
|
53260
|
-
{
|
|
53261
|
-
style: {
|
|
53262
|
-
display: "grid",
|
|
53263
|
-
gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))",
|
|
53264
|
-
gap: "12px"
|
|
53265
|
-
},
|
|
53266
|
-
children: [
|
|
53267
|
-
selectedTask.priority && /* @__PURE__ */ jsx(
|
|
53268
|
-
MetadataRow,
|
|
53269
|
-
{
|
|
53270
|
-
icon: /* @__PURE__ */ jsx(Flag, { size: 14 }),
|
|
53271
|
-
label: "Priority",
|
|
53272
|
-
value: /* @__PURE__ */ jsx("span", { style: getPriorityStyles(theme2, selectedTask.priority), children: selectedTask.priority })
|
|
53273
|
-
}
|
|
53274
|
-
),
|
|
53275
|
-
selectedTask.assignee && selectedTask.assignee.length > 0 && /* @__PURE__ */ jsx(
|
|
53276
|
-
MetadataRow,
|
|
53277
|
-
{
|
|
53278
|
-
icon: /* @__PURE__ */ jsx(User, { size: 14 }),
|
|
53279
|
-
label: "Assignee",
|
|
53280
|
-
value: selectedTask.assignee.join(", ")
|
|
53281
|
-
}
|
|
53282
|
-
),
|
|
53283
|
-
selectedTask.createdDate && /* @__PURE__ */ jsx(
|
|
53284
|
-
MetadataRow,
|
|
53285
|
-
{
|
|
53286
|
-
icon: /* @__PURE__ */ jsx(Calendar, { size: 14 }),
|
|
53287
|
-
label: "Created",
|
|
53288
|
-
value: selectedTask.createdDate
|
|
53289
|
-
}
|
|
53290
|
-
),
|
|
53291
|
-
selectedTask.branch && /* @__PURE__ */ jsx(
|
|
53292
|
-
MetadataRow,
|
|
53293
|
-
{
|
|
53294
|
-
icon: /* @__PURE__ */ jsx(GitBranch, { size: 14 }),
|
|
53295
|
-
label: "Branch",
|
|
53296
|
-
value: selectedTask.branch
|
|
53297
|
-
}
|
|
53298
|
-
)
|
|
53299
|
-
]
|
|
53300
|
-
}
|
|
53301
|
-
),
|
|
53302
|
-
selectedTask.labels && selectedTask.labels.length > 0 && /* @__PURE__ */ jsxs(
|
|
53303
|
-
"div",
|
|
53304
|
-
{
|
|
53305
|
-
style: {
|
|
53306
|
-
display: "flex",
|
|
53307
|
-
alignItems: "center",
|
|
53308
|
-
gap: "8px",
|
|
53309
|
-
marginTop: "12px",
|
|
53310
|
-
flexWrap: "wrap"
|
|
53311
|
-
},
|
|
53312
|
-
children: [
|
|
53313
|
-
/* @__PURE__ */ jsx(Tag, { size: 14, color: theme2.colors.textMuted }),
|
|
53314
|
-
selectedTask.labels.map((label) => /* @__PURE__ */ jsx(
|
|
53315
|
-
"span",
|
|
53316
|
-
{
|
|
53317
|
-
style: {
|
|
53318
|
-
padding: "2px 8px",
|
|
53319
|
-
borderRadius: theme2.radii[1],
|
|
53320
|
-
fontSize: theme2.fontSizes[0],
|
|
53321
|
-
fontWeight: theme2.fontWeights.medium,
|
|
53322
|
-
background: `${theme2.colors.primary}15`,
|
|
53323
|
-
color: theme2.colors.primary
|
|
53324
|
-
},
|
|
53325
|
-
children: label
|
|
53326
|
-
},
|
|
53327
|
-
label
|
|
53328
|
-
))
|
|
53329
|
-
]
|
|
53330
|
-
}
|
|
53331
55479
|
)
|
|
53332
55480
|
]
|
|
53333
55481
|
}
|
|
@@ -53366,6 +55514,193 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
|
|
|
53366
55514
|
}
|
|
53367
55515
|
)
|
|
53368
55516
|
}
|
|
55517
|
+
),
|
|
55518
|
+
isDeleteModalOpen && createPortal(
|
|
55519
|
+
/* @__PURE__ */ jsxs(
|
|
55520
|
+
"div",
|
|
55521
|
+
{
|
|
55522
|
+
style: {
|
|
55523
|
+
position: "fixed",
|
|
55524
|
+
inset: 0,
|
|
55525
|
+
zIndex: 9999,
|
|
55526
|
+
display: "flex",
|
|
55527
|
+
alignItems: "center",
|
|
55528
|
+
justifyContent: "center",
|
|
55529
|
+
padding: "16px"
|
|
55530
|
+
},
|
|
55531
|
+
children: [
|
|
55532
|
+
/* @__PURE__ */ jsx(
|
|
55533
|
+
"div",
|
|
55534
|
+
{
|
|
55535
|
+
onClick: () => setIsDeleteModalOpen(false),
|
|
55536
|
+
style: {
|
|
55537
|
+
position: "absolute",
|
|
55538
|
+
inset: 0,
|
|
55539
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
55540
|
+
}
|
|
55541
|
+
}
|
|
55542
|
+
),
|
|
55543
|
+
/* @__PURE__ */ jsxs(
|
|
55544
|
+
"div",
|
|
55545
|
+
{
|
|
55546
|
+
style: {
|
|
55547
|
+
position: "relative",
|
|
55548
|
+
width: "100%",
|
|
55549
|
+
maxWidth: "400px",
|
|
55550
|
+
backgroundColor: theme2.colors.background,
|
|
55551
|
+
borderRadius: theme2.radii[3],
|
|
55552
|
+
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
|
|
55553
|
+
border: `1px solid ${theme2.colors.border}`
|
|
55554
|
+
},
|
|
55555
|
+
children: [
|
|
55556
|
+
/* @__PURE__ */ jsxs(
|
|
55557
|
+
"div",
|
|
55558
|
+
{
|
|
55559
|
+
style: {
|
|
55560
|
+
display: "flex",
|
|
55561
|
+
alignItems: "center",
|
|
55562
|
+
justifyContent: "space-between",
|
|
55563
|
+
padding: "16px 20px",
|
|
55564
|
+
borderBottom: `1px solid ${theme2.colors.border}`
|
|
55565
|
+
},
|
|
55566
|
+
children: [
|
|
55567
|
+
/* @__PURE__ */ jsx(
|
|
55568
|
+
"h2",
|
|
55569
|
+
{
|
|
55570
|
+
style: {
|
|
55571
|
+
margin: 0,
|
|
55572
|
+
fontSize: theme2.fontSizes[4],
|
|
55573
|
+
fontWeight: 600,
|
|
55574
|
+
color: theme2.colors.text
|
|
55575
|
+
},
|
|
55576
|
+
children: "Delete Task?"
|
|
55577
|
+
}
|
|
55578
|
+
),
|
|
55579
|
+
/* @__PURE__ */ jsx(
|
|
55580
|
+
"button",
|
|
55581
|
+
{
|
|
55582
|
+
onClick: () => setIsDeleteModalOpen(false),
|
|
55583
|
+
style: {
|
|
55584
|
+
background: "none",
|
|
55585
|
+
border: "none",
|
|
55586
|
+
cursor: "pointer",
|
|
55587
|
+
padding: "4px",
|
|
55588
|
+
display: "flex",
|
|
55589
|
+
alignItems: "center",
|
|
55590
|
+
justifyContent: "center",
|
|
55591
|
+
borderRadius: theme2.radii[1],
|
|
55592
|
+
color: theme2.colors.textMuted
|
|
55593
|
+
},
|
|
55594
|
+
children: /* @__PURE__ */ jsx(X, { size: 20 })
|
|
55595
|
+
}
|
|
55596
|
+
)
|
|
55597
|
+
]
|
|
55598
|
+
}
|
|
55599
|
+
),
|
|
55600
|
+
/* @__PURE__ */ jsxs("div", { style: { padding: "20px" }, children: [
|
|
55601
|
+
/* @__PURE__ */ jsxs(
|
|
55602
|
+
"p",
|
|
55603
|
+
{
|
|
55604
|
+
style: {
|
|
55605
|
+
margin: 0,
|
|
55606
|
+
fontSize: theme2.fontSizes[2],
|
|
55607
|
+
color: theme2.colors.text,
|
|
55608
|
+
lineHeight: 1.5
|
|
55609
|
+
},
|
|
55610
|
+
children: [
|
|
55611
|
+
"Are you sure you want to delete ",
|
|
55612
|
+
/* @__PURE__ */ jsxs("strong", { children: [
|
|
55613
|
+
'"',
|
|
55614
|
+
selectedTask.title,
|
|
55615
|
+
'"'
|
|
55616
|
+
] }),
|
|
55617
|
+
"? This action cannot be undone."
|
|
55618
|
+
]
|
|
55619
|
+
}
|
|
55620
|
+
),
|
|
55621
|
+
deleteState.status === "error" && /* @__PURE__ */ jsx(
|
|
55622
|
+
"div",
|
|
55623
|
+
{
|
|
55624
|
+
style: {
|
|
55625
|
+
marginTop: "16px",
|
|
55626
|
+
padding: "10px 12px",
|
|
55627
|
+
backgroundColor: `${theme2.colors.error}15`,
|
|
55628
|
+
border: `1px solid ${theme2.colors.error}`,
|
|
55629
|
+
borderRadius: theme2.radii[2],
|
|
55630
|
+
color: theme2.colors.error,
|
|
55631
|
+
fontSize: theme2.fontSizes[1]
|
|
55632
|
+
},
|
|
55633
|
+
children: deleteState.error || "Failed to delete task"
|
|
55634
|
+
}
|
|
55635
|
+
)
|
|
55636
|
+
] }),
|
|
55637
|
+
/* @__PURE__ */ jsxs(
|
|
55638
|
+
"div",
|
|
55639
|
+
{
|
|
55640
|
+
style: {
|
|
55641
|
+
display: "flex",
|
|
55642
|
+
justifyContent: "flex-end",
|
|
55643
|
+
gap: "12px",
|
|
55644
|
+
padding: "16px 20px",
|
|
55645
|
+
borderTop: `1px solid ${theme2.colors.border}`
|
|
55646
|
+
},
|
|
55647
|
+
children: [
|
|
55648
|
+
/* @__PURE__ */ jsx(
|
|
55649
|
+
"button",
|
|
55650
|
+
{
|
|
55651
|
+
type: "button",
|
|
55652
|
+
onClick: () => setIsDeleteModalOpen(false),
|
|
55653
|
+
disabled: deleteState.status === "loading",
|
|
55654
|
+
style: {
|
|
55655
|
+
padding: "10px 20px",
|
|
55656
|
+
fontSize: theme2.fontSizes[2],
|
|
55657
|
+
fontWeight: 500,
|
|
55658
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
55659
|
+
borderRadius: theme2.radii[2],
|
|
55660
|
+
backgroundColor: "transparent",
|
|
55661
|
+
color: theme2.colors.text,
|
|
55662
|
+
cursor: deleteState.status === "loading" ? "not-allowed" : "pointer",
|
|
55663
|
+
opacity: deleteState.status === "loading" ? 0.5 : 1
|
|
55664
|
+
},
|
|
55665
|
+
children: "Cancel"
|
|
55666
|
+
}
|
|
55667
|
+
),
|
|
55668
|
+
/* @__PURE__ */ jsxs(
|
|
55669
|
+
"button",
|
|
55670
|
+
{
|
|
55671
|
+
type: "button",
|
|
55672
|
+
onClick: handleDeleteConfirm,
|
|
55673
|
+
disabled: deleteState.status === "loading",
|
|
55674
|
+
style: {
|
|
55675
|
+
display: "flex",
|
|
55676
|
+
alignItems: "center",
|
|
55677
|
+
gap: "8px",
|
|
55678
|
+
padding: "10px 20px",
|
|
55679
|
+
fontSize: theme2.fontSizes[2],
|
|
55680
|
+
fontWeight: 500,
|
|
55681
|
+
border: "none",
|
|
55682
|
+
borderRadius: theme2.radii[2],
|
|
55683
|
+
backgroundColor: theme2.colors.error,
|
|
55684
|
+
color: theme2.colors.background,
|
|
55685
|
+
cursor: deleteState.status === "loading" ? "wait" : "pointer",
|
|
55686
|
+
opacity: deleteState.status === "loading" ? 0.7 : 1
|
|
55687
|
+
},
|
|
55688
|
+
children: [
|
|
55689
|
+
deleteState.status === "loading" && /* @__PURE__ */ jsx(LoaderCircle, { size: 16, style: { animation: "spin 1s linear infinite" } }),
|
|
55690
|
+
"Delete"
|
|
55691
|
+
]
|
|
55692
|
+
}
|
|
55693
|
+
)
|
|
55694
|
+
]
|
|
55695
|
+
}
|
|
55696
|
+
)
|
|
55697
|
+
]
|
|
55698
|
+
}
|
|
55699
|
+
)
|
|
55700
|
+
]
|
|
55701
|
+
}
|
|
55702
|
+
),
|
|
55703
|
+
document.body
|
|
53369
55704
|
)
|
|
53370
55705
|
]
|
|
53371
55706
|
}
|