copit 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +142 -488
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -34567,7 +34567,7 @@ var require_stack_utils = __commonJS((exports, module) => {
|
|
|
34567
34567
|
});
|
|
34568
34568
|
|
|
34569
34569
|
// src/index.tsx
|
|
34570
|
-
var
|
|
34570
|
+
var import_react28 = __toESM(require_react(), 1);
|
|
34571
34571
|
|
|
34572
34572
|
// node_modules/ink/build/render.js
|
|
34573
34573
|
import { Stream } from "node:stream";
|
|
@@ -40744,414 +40744,73 @@ function useSetAtom(atom2, options) {
|
|
|
40744
40744
|
}
|
|
40745
40745
|
|
|
40746
40746
|
// src/App.tsx
|
|
40747
|
-
var
|
|
40747
|
+
var import_react27 = __toESM(require_react(), 1);
|
|
40748
40748
|
|
|
40749
40749
|
// src/features/store/atoms.ts
|
|
40750
40750
|
var viewAtom = atom("templates");
|
|
40751
40751
|
|
|
40752
40752
|
// src/features/template/TemplateList.tsx
|
|
40753
|
-
var import_react25 = __toESM(require_react(), 1);
|
|
40754
|
-
|
|
40755
|
-
// node_modules/ink-select-input/build/Indicator.js
|
|
40756
|
-
var import_react23 = __toESM(require_react(), 1);
|
|
40757
|
-
|
|
40758
|
-
// node_modules/is-unicode-supported/index.js
|
|
40759
|
-
import process13 from "node:process";
|
|
40760
|
-
function isUnicodeSupported() {
|
|
40761
|
-
const { env: env3 } = process13;
|
|
40762
|
-
const { TERM, TERM_PROGRAM } = env3;
|
|
40763
|
-
if (process13.platform !== "win32") {
|
|
40764
|
-
return TERM !== "linux";
|
|
40765
|
-
}
|
|
40766
|
-
return Boolean(env3.WT_SESSION) || Boolean(env3.TERMINUS_SUBLIME) || env3.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env3.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
40767
|
-
}
|
|
40768
|
-
|
|
40769
|
-
// node_modules/figures/index.js
|
|
40770
|
-
var common = {
|
|
40771
|
-
circleQuestionMark: "(?)",
|
|
40772
|
-
questionMarkPrefix: "(?)",
|
|
40773
|
-
square: "█",
|
|
40774
|
-
squareDarkShade: "▓",
|
|
40775
|
-
squareMediumShade: "▒",
|
|
40776
|
-
squareLightShade: "░",
|
|
40777
|
-
squareTop: "▀",
|
|
40778
|
-
squareBottom: "▄",
|
|
40779
|
-
squareLeft: "▌",
|
|
40780
|
-
squareRight: "▐",
|
|
40781
|
-
squareCenter: "■",
|
|
40782
|
-
bullet: "●",
|
|
40783
|
-
dot: "․",
|
|
40784
|
-
ellipsis: "…",
|
|
40785
|
-
pointerSmall: "›",
|
|
40786
|
-
triangleUp: "▲",
|
|
40787
|
-
triangleUpSmall: "▴",
|
|
40788
|
-
triangleDown: "▼",
|
|
40789
|
-
triangleDownSmall: "▾",
|
|
40790
|
-
triangleLeftSmall: "◂",
|
|
40791
|
-
triangleRightSmall: "▸",
|
|
40792
|
-
home: "⌂",
|
|
40793
|
-
heart: "♥",
|
|
40794
|
-
musicNote: "♪",
|
|
40795
|
-
musicNoteBeamed: "♫",
|
|
40796
|
-
arrowUp: "↑",
|
|
40797
|
-
arrowDown: "↓",
|
|
40798
|
-
arrowLeft: "←",
|
|
40799
|
-
arrowRight: "→",
|
|
40800
|
-
arrowLeftRight: "↔",
|
|
40801
|
-
arrowUpDown: "↕",
|
|
40802
|
-
almostEqual: "≈",
|
|
40803
|
-
notEqual: "≠",
|
|
40804
|
-
lessOrEqual: "≤",
|
|
40805
|
-
greaterOrEqual: "≥",
|
|
40806
|
-
identical: "≡",
|
|
40807
|
-
infinity: "∞",
|
|
40808
|
-
subscriptZero: "₀",
|
|
40809
|
-
subscriptOne: "₁",
|
|
40810
|
-
subscriptTwo: "₂",
|
|
40811
|
-
subscriptThree: "₃",
|
|
40812
|
-
subscriptFour: "₄",
|
|
40813
|
-
subscriptFive: "₅",
|
|
40814
|
-
subscriptSix: "₆",
|
|
40815
|
-
subscriptSeven: "₇",
|
|
40816
|
-
subscriptEight: "₈",
|
|
40817
|
-
subscriptNine: "₉",
|
|
40818
|
-
oneHalf: "½",
|
|
40819
|
-
oneThird: "⅓",
|
|
40820
|
-
oneQuarter: "¼",
|
|
40821
|
-
oneFifth: "⅕",
|
|
40822
|
-
oneSixth: "⅙",
|
|
40823
|
-
oneEighth: "⅛",
|
|
40824
|
-
twoThirds: "⅔",
|
|
40825
|
-
twoFifths: "⅖",
|
|
40826
|
-
threeQuarters: "¾",
|
|
40827
|
-
threeFifths: "⅗",
|
|
40828
|
-
threeEighths: "⅜",
|
|
40829
|
-
fourFifths: "⅘",
|
|
40830
|
-
fiveSixths: "⅚",
|
|
40831
|
-
fiveEighths: "⅝",
|
|
40832
|
-
sevenEighths: "⅞",
|
|
40833
|
-
line: "─",
|
|
40834
|
-
lineBold: "━",
|
|
40835
|
-
lineDouble: "═",
|
|
40836
|
-
lineDashed0: "┄",
|
|
40837
|
-
lineDashed1: "┅",
|
|
40838
|
-
lineDashed2: "┈",
|
|
40839
|
-
lineDashed3: "┉",
|
|
40840
|
-
lineDashed4: "╌",
|
|
40841
|
-
lineDashed5: "╍",
|
|
40842
|
-
lineDashed6: "╴",
|
|
40843
|
-
lineDashed7: "╶",
|
|
40844
|
-
lineDashed8: "╸",
|
|
40845
|
-
lineDashed9: "╺",
|
|
40846
|
-
lineDashed10: "╼",
|
|
40847
|
-
lineDashed11: "╾",
|
|
40848
|
-
lineDashed12: "−",
|
|
40849
|
-
lineDashed13: "–",
|
|
40850
|
-
lineDashed14: "‐",
|
|
40851
|
-
lineDashed15: "⁃",
|
|
40852
|
-
lineVertical: "│",
|
|
40853
|
-
lineVerticalBold: "┃",
|
|
40854
|
-
lineVerticalDouble: "║",
|
|
40855
|
-
lineVerticalDashed0: "┆",
|
|
40856
|
-
lineVerticalDashed1: "┇",
|
|
40857
|
-
lineVerticalDashed2: "┊",
|
|
40858
|
-
lineVerticalDashed3: "┋",
|
|
40859
|
-
lineVerticalDashed4: "╎",
|
|
40860
|
-
lineVerticalDashed5: "╏",
|
|
40861
|
-
lineVerticalDashed6: "╵",
|
|
40862
|
-
lineVerticalDashed7: "╷",
|
|
40863
|
-
lineVerticalDashed8: "╹",
|
|
40864
|
-
lineVerticalDashed9: "╻",
|
|
40865
|
-
lineVerticalDashed10: "╽",
|
|
40866
|
-
lineVerticalDashed11: "╿",
|
|
40867
|
-
lineDownLeft: "┐",
|
|
40868
|
-
lineDownLeftArc: "╮",
|
|
40869
|
-
lineDownBoldLeftBold: "┓",
|
|
40870
|
-
lineDownBoldLeft: "┒",
|
|
40871
|
-
lineDownLeftBold: "┑",
|
|
40872
|
-
lineDownDoubleLeftDouble: "╗",
|
|
40873
|
-
lineDownDoubleLeft: "╖",
|
|
40874
|
-
lineDownLeftDouble: "╕",
|
|
40875
|
-
lineDownRight: "┌",
|
|
40876
|
-
lineDownRightArc: "╭",
|
|
40877
|
-
lineDownBoldRightBold: "┏",
|
|
40878
|
-
lineDownBoldRight: "┎",
|
|
40879
|
-
lineDownRightBold: "┍",
|
|
40880
|
-
lineDownDoubleRightDouble: "╔",
|
|
40881
|
-
lineDownDoubleRight: "╓",
|
|
40882
|
-
lineDownRightDouble: "╒",
|
|
40883
|
-
lineUpLeft: "┘",
|
|
40884
|
-
lineUpLeftArc: "╯",
|
|
40885
|
-
lineUpBoldLeftBold: "┛",
|
|
40886
|
-
lineUpBoldLeft: "┚",
|
|
40887
|
-
lineUpLeftBold: "┙",
|
|
40888
|
-
lineUpDoubleLeftDouble: "╝",
|
|
40889
|
-
lineUpDoubleLeft: "╜",
|
|
40890
|
-
lineUpLeftDouble: "╛",
|
|
40891
|
-
lineUpRight: "└",
|
|
40892
|
-
lineUpRightArc: "╰",
|
|
40893
|
-
lineUpBoldRightBold: "┗",
|
|
40894
|
-
lineUpBoldRight: "┖",
|
|
40895
|
-
lineUpRightBold: "┕",
|
|
40896
|
-
lineUpDoubleRightDouble: "╚",
|
|
40897
|
-
lineUpDoubleRight: "╙",
|
|
40898
|
-
lineUpRightDouble: "╘",
|
|
40899
|
-
lineUpDownLeft: "┤",
|
|
40900
|
-
lineUpBoldDownBoldLeftBold: "┫",
|
|
40901
|
-
lineUpBoldDownBoldLeft: "┨",
|
|
40902
|
-
lineUpDownLeftBold: "┥",
|
|
40903
|
-
lineUpBoldDownLeftBold: "┩",
|
|
40904
|
-
lineUpDownBoldLeftBold: "┪",
|
|
40905
|
-
lineUpDownBoldLeft: "┧",
|
|
40906
|
-
lineUpBoldDownLeft: "┦",
|
|
40907
|
-
lineUpDoubleDownDoubleLeftDouble: "╣",
|
|
40908
|
-
lineUpDoubleDownDoubleLeft: "╢",
|
|
40909
|
-
lineUpDownLeftDouble: "╡",
|
|
40910
|
-
lineUpDownRight: "├",
|
|
40911
|
-
lineUpBoldDownBoldRightBold: "┣",
|
|
40912
|
-
lineUpBoldDownBoldRight: "┠",
|
|
40913
|
-
lineUpDownRightBold: "┝",
|
|
40914
|
-
lineUpBoldDownRightBold: "┡",
|
|
40915
|
-
lineUpDownBoldRightBold: "┢",
|
|
40916
|
-
lineUpDownBoldRight: "┟",
|
|
40917
|
-
lineUpBoldDownRight: "┞",
|
|
40918
|
-
lineUpDoubleDownDoubleRightDouble: "╠",
|
|
40919
|
-
lineUpDoubleDownDoubleRight: "╟",
|
|
40920
|
-
lineUpDownRightDouble: "╞",
|
|
40921
|
-
lineDownLeftRight: "┬",
|
|
40922
|
-
lineDownBoldLeftBoldRightBold: "┳",
|
|
40923
|
-
lineDownLeftBoldRightBold: "┯",
|
|
40924
|
-
lineDownBoldLeftRight: "┰",
|
|
40925
|
-
lineDownBoldLeftBoldRight: "┱",
|
|
40926
|
-
lineDownBoldLeftRightBold: "┲",
|
|
40927
|
-
lineDownLeftRightBold: "┮",
|
|
40928
|
-
lineDownLeftBoldRight: "┭",
|
|
40929
|
-
lineDownDoubleLeftDoubleRightDouble: "╦",
|
|
40930
|
-
lineDownDoubleLeftRight: "╥",
|
|
40931
|
-
lineDownLeftDoubleRightDouble: "╤",
|
|
40932
|
-
lineUpLeftRight: "┴",
|
|
40933
|
-
lineUpBoldLeftBoldRightBold: "┻",
|
|
40934
|
-
lineUpLeftBoldRightBold: "┷",
|
|
40935
|
-
lineUpBoldLeftRight: "┸",
|
|
40936
|
-
lineUpBoldLeftBoldRight: "┹",
|
|
40937
|
-
lineUpBoldLeftRightBold: "┺",
|
|
40938
|
-
lineUpLeftRightBold: "┶",
|
|
40939
|
-
lineUpLeftBoldRight: "┵",
|
|
40940
|
-
lineUpDoubleLeftDoubleRightDouble: "╩",
|
|
40941
|
-
lineUpDoubleLeftRight: "╨",
|
|
40942
|
-
lineUpLeftDoubleRightDouble: "╧",
|
|
40943
|
-
lineUpDownLeftRight: "┼",
|
|
40944
|
-
lineUpBoldDownBoldLeftBoldRightBold: "╋",
|
|
40945
|
-
lineUpDownBoldLeftBoldRightBold: "╈",
|
|
40946
|
-
lineUpBoldDownLeftBoldRightBold: "╇",
|
|
40947
|
-
lineUpBoldDownBoldLeftRightBold: "╊",
|
|
40948
|
-
lineUpBoldDownBoldLeftBoldRight: "╉",
|
|
40949
|
-
lineUpBoldDownLeftRight: "╀",
|
|
40950
|
-
lineUpDownBoldLeftRight: "╁",
|
|
40951
|
-
lineUpDownLeftBoldRight: "┽",
|
|
40952
|
-
lineUpDownLeftRightBold: "┾",
|
|
40953
|
-
lineUpBoldDownBoldLeftRight: "╂",
|
|
40954
|
-
lineUpDownLeftBoldRightBold: "┿",
|
|
40955
|
-
lineUpBoldDownLeftBoldRight: "╃",
|
|
40956
|
-
lineUpBoldDownLeftRightBold: "╄",
|
|
40957
|
-
lineUpDownBoldLeftBoldRight: "╅",
|
|
40958
|
-
lineUpDownBoldLeftRightBold: "╆",
|
|
40959
|
-
lineUpDoubleDownDoubleLeftDoubleRightDouble: "╬",
|
|
40960
|
-
lineUpDoubleDownDoubleLeftRight: "╫",
|
|
40961
|
-
lineUpDownLeftDoubleRightDouble: "╪",
|
|
40962
|
-
lineCross: "╳",
|
|
40963
|
-
lineBackslash: "╲",
|
|
40964
|
-
lineSlash: "╱"
|
|
40965
|
-
};
|
|
40966
|
-
var specialMainSymbols = {
|
|
40967
|
-
tick: "✔",
|
|
40968
|
-
info: "ℹ",
|
|
40969
|
-
warning: "⚠",
|
|
40970
|
-
cross: "✘",
|
|
40971
|
-
squareSmall: "◻",
|
|
40972
|
-
squareSmallFilled: "◼",
|
|
40973
|
-
circle: "◯",
|
|
40974
|
-
circleFilled: "◉",
|
|
40975
|
-
circleDotted: "◌",
|
|
40976
|
-
circleDouble: "◎",
|
|
40977
|
-
circleCircle: "ⓞ",
|
|
40978
|
-
circleCross: "ⓧ",
|
|
40979
|
-
circlePipe: "Ⓘ",
|
|
40980
|
-
radioOn: "◉",
|
|
40981
|
-
radioOff: "◯",
|
|
40982
|
-
checkboxOn: "☒",
|
|
40983
|
-
checkboxOff: "☐",
|
|
40984
|
-
checkboxCircleOn: "ⓧ",
|
|
40985
|
-
checkboxCircleOff: "Ⓘ",
|
|
40986
|
-
pointer: "❯",
|
|
40987
|
-
triangleUpOutline: "△",
|
|
40988
|
-
triangleLeft: "◀",
|
|
40989
|
-
triangleRight: "▶",
|
|
40990
|
-
lozenge: "◆",
|
|
40991
|
-
lozengeOutline: "◇",
|
|
40992
|
-
hamburger: "☰",
|
|
40993
|
-
smiley: "㋡",
|
|
40994
|
-
mustache: "෴",
|
|
40995
|
-
star: "★",
|
|
40996
|
-
play: "▶",
|
|
40997
|
-
nodejs: "⬢",
|
|
40998
|
-
oneSeventh: "⅐",
|
|
40999
|
-
oneNinth: "⅑",
|
|
41000
|
-
oneTenth: "⅒"
|
|
41001
|
-
};
|
|
41002
|
-
var specialFallbackSymbols = {
|
|
41003
|
-
tick: "√",
|
|
41004
|
-
info: "i",
|
|
41005
|
-
warning: "‼",
|
|
41006
|
-
cross: "×",
|
|
41007
|
-
squareSmall: "□",
|
|
41008
|
-
squareSmallFilled: "■",
|
|
41009
|
-
circle: "( )",
|
|
41010
|
-
circleFilled: "(*)",
|
|
41011
|
-
circleDotted: "( )",
|
|
41012
|
-
circleDouble: "( )",
|
|
41013
|
-
circleCircle: "(○)",
|
|
41014
|
-
circleCross: "(×)",
|
|
41015
|
-
circlePipe: "(│)",
|
|
41016
|
-
radioOn: "(*)",
|
|
41017
|
-
radioOff: "( )",
|
|
41018
|
-
checkboxOn: "[×]",
|
|
41019
|
-
checkboxOff: "[ ]",
|
|
41020
|
-
checkboxCircleOn: "(×)",
|
|
41021
|
-
checkboxCircleOff: "( )",
|
|
41022
|
-
pointer: ">",
|
|
41023
|
-
triangleUpOutline: "∆",
|
|
41024
|
-
triangleLeft: "◄",
|
|
41025
|
-
triangleRight: "►",
|
|
41026
|
-
lozenge: "♦",
|
|
41027
|
-
lozengeOutline: "◊",
|
|
41028
|
-
hamburger: "≡",
|
|
41029
|
-
smiley: "☺",
|
|
41030
|
-
mustache: "┌─┐",
|
|
41031
|
-
star: "✶",
|
|
41032
|
-
play: "►",
|
|
41033
|
-
nodejs: "♦",
|
|
41034
|
-
oneSeventh: "1/7",
|
|
41035
|
-
oneNinth: "1/9",
|
|
41036
|
-
oneTenth: "1/10"
|
|
41037
|
-
};
|
|
41038
|
-
var mainSymbols = { ...common, ...specialMainSymbols };
|
|
41039
|
-
var fallbackSymbols = { ...common, ...specialFallbackSymbols };
|
|
41040
|
-
var shouldUseMain = isUnicodeSupported();
|
|
41041
|
-
var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
41042
|
-
var figures_default = figures;
|
|
41043
|
-
var replacements = Object.entries(specialMainSymbols);
|
|
41044
|
-
|
|
41045
|
-
// node_modules/ink-select-input/build/Indicator.js
|
|
41046
|
-
function Indicator({ isSelected = false }) {
|
|
41047
|
-
return import_react23.default.createElement(Box_default, { marginRight: 1 }, isSelected ? import_react23.default.createElement(Text, { color: "blue" }, figures_default.pointer) : import_react23.default.createElement(Text, null, " "));
|
|
41048
|
-
}
|
|
41049
|
-
var Indicator_default = Indicator;
|
|
41050
|
-
// node_modules/ink-select-input/build/Item.js
|
|
41051
|
-
var React12 = __toESM(require_react(), 1);
|
|
41052
|
-
function Item({ isSelected = false, label }) {
|
|
41053
|
-
return React12.createElement(Text, { color: isSelected ? "blue" : undefined }, label);
|
|
41054
|
-
}
|
|
41055
|
-
var Item_default = Item;
|
|
41056
|
-
// node_modules/ink-select-input/build/SelectInput.js
|
|
41057
40753
|
var import_react24 = __toESM(require_react(), 1);
|
|
41058
|
-
import { isDeepStrictEqual } from "node:util";
|
|
41059
40754
|
|
|
41060
|
-
//
|
|
41061
|
-
|
|
41062
|
-
|
|
41063
|
-
|
|
41064
|
-
|
|
41065
|
-
|
|
41066
|
-
|
|
41067
|
-
|
|
41068
|
-
const
|
|
41069
|
-
|
|
41070
|
-
|
|
41071
|
-
|
|
41072
|
-
|
|
41073
|
-
|
|
41074
|
-
|
|
41075
|
-
|
|
41076
|
-
|
|
41077
|
-
|
|
41078
|
-
|
|
41079
|
-
|
|
41080
|
-
|
|
41081
|
-
|
|
41082
|
-
|
|
41083
|
-
|
|
41084
|
-
|
|
41085
|
-
|
|
41086
|
-
|
|
41087
|
-
|
|
41088
|
-
|
|
41089
|
-
|
|
41090
|
-
|
|
41091
|
-
|
|
41092
|
-
|
|
41093
|
-
setSelectedIndex(
|
|
41094
|
-
}
|
|
41095
|
-
previousItems.current = items;
|
|
41096
|
-
}, [items]);
|
|
41097
|
-
use_input_default(import_react24.useCallback((input, key) => {
|
|
41098
|
-
if (input === "k" || key.upArrow) {
|
|
41099
|
-
const lastIndex2 = (hasLimit ? limit : items.length) - 1;
|
|
41100
|
-
const atFirstIndex = selectedIndex === 0;
|
|
41101
|
-
const nextIndex = hasLimit ? selectedIndex : lastIndex2;
|
|
41102
|
-
const nextRotateIndex = atFirstIndex ? rotateIndex + 1 : rotateIndex;
|
|
41103
|
-
const nextSelectedIndex = atFirstIndex ? nextIndex : selectedIndex - 1;
|
|
41104
|
-
setRotateIndex(nextRotateIndex);
|
|
41105
|
-
setSelectedIndex(nextSelectedIndex);
|
|
41106
|
-
const slicedItems2 = hasLimit ? toRotated(items, nextRotateIndex).slice(0, limit) : items;
|
|
41107
|
-
if (typeof onHighlight === "function") {
|
|
41108
|
-
onHighlight(slicedItems2[nextSelectedIndex]);
|
|
41109
|
-
}
|
|
41110
|
-
}
|
|
41111
|
-
if (input === "j" || key.downArrow) {
|
|
41112
|
-
const atLastIndex = selectedIndex === (hasLimit ? limit : items.length) - 1;
|
|
41113
|
-
const nextIndex = hasLimit ? selectedIndex : 0;
|
|
41114
|
-
const nextRotateIndex = atLastIndex ? rotateIndex - 1 : rotateIndex;
|
|
41115
|
-
const nextSelectedIndex = atLastIndex ? nextIndex : selectedIndex + 1;
|
|
41116
|
-
setRotateIndex(nextRotateIndex);
|
|
41117
|
-
setSelectedIndex(nextSelectedIndex);
|
|
41118
|
-
const slicedItems2 = hasLimit ? toRotated(items, nextRotateIndex).slice(0, limit) : items;
|
|
41119
|
-
if (typeof onHighlight === "function") {
|
|
41120
|
-
onHighlight(slicedItems2[nextSelectedIndex]);
|
|
41121
|
-
}
|
|
41122
|
-
}
|
|
41123
|
-
if (/^[1-9]$/.test(input)) {
|
|
41124
|
-
const targetIndex = Number.parseInt(input, 10) - 1;
|
|
41125
|
-
const visibleItems = hasLimit ? toRotated(items, rotateIndex).slice(0, limit) : items;
|
|
41126
|
-
if (targetIndex >= 0 && targetIndex < visibleItems.length) {
|
|
41127
|
-
const selectedItem = visibleItems[targetIndex];
|
|
41128
|
-
if (selectedItem) {
|
|
41129
|
-
onSelect?.(selectedItem);
|
|
41130
|
-
}
|
|
41131
|
-
}
|
|
40755
|
+
// src/features/template/SelectList.tsx
|
|
40756
|
+
var import_react23 = __toESM(require_react(), 1);
|
|
40757
|
+
var SelectList = ({
|
|
40758
|
+
items,
|
|
40759
|
+
onSelect,
|
|
40760
|
+
onHighlight,
|
|
40761
|
+
limit = 10
|
|
40762
|
+
}) => {
|
|
40763
|
+
const [selectedIndex, setSelectedIndex] = import_react23.useState(0);
|
|
40764
|
+
const [windowStart, setWindowStart] = import_react23.useState(0);
|
|
40765
|
+
const windowSize = Math.min(limit, items.length);
|
|
40766
|
+
import_react23.useEffect(() => {
|
|
40767
|
+
setSelectedIndex(0);
|
|
40768
|
+
setWindowStart(0);
|
|
40769
|
+
}, [items.length]);
|
|
40770
|
+
import_react23.useEffect(() => {
|
|
40771
|
+
if (selectedIndex < windowStart) {
|
|
40772
|
+
setWindowStart(selectedIndex);
|
|
40773
|
+
}
|
|
40774
|
+
if (selectedIndex >= windowStart + windowSize) {
|
|
40775
|
+
setWindowStart(selectedIndex - windowSize + 1);
|
|
40776
|
+
}
|
|
40777
|
+
}, [selectedIndex, windowStart, windowSize]);
|
|
40778
|
+
import_react23.useEffect(() => {
|
|
40779
|
+
if (onHighlight && items[selectedIndex]) {
|
|
40780
|
+
onHighlight(items[selectedIndex]);
|
|
40781
|
+
}
|
|
40782
|
+
}, [selectedIndex, items, onHighlight]);
|
|
40783
|
+
use_input_default((_input, key) => {
|
|
40784
|
+
if (key.upArrow) {
|
|
40785
|
+
setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
40786
|
+
}
|
|
40787
|
+
if (key.downArrow) {
|
|
40788
|
+
setSelectedIndex((prev) => Math.min(items.length - 1, prev + 1));
|
|
41132
40789
|
}
|
|
41133
40790
|
if (key.return) {
|
|
41134
|
-
|
|
41135
|
-
|
|
41136
|
-
onSelect(slicedItems2[selectedIndex]);
|
|
40791
|
+
if (items[selectedIndex]) {
|
|
40792
|
+
onSelect(items[selectedIndex]);
|
|
41137
40793
|
}
|
|
41138
40794
|
}
|
|
41139
|
-
}
|
|
41140
|
-
|
|
41141
|
-
|
|
41142
|
-
|
|
41143
|
-
|
|
41144
|
-
|
|
41145
|
-
|
|
41146
|
-
|
|
41147
|
-
|
|
41148
|
-
|
|
41149
|
-
|
|
41150
|
-
|
|
41151
|
-
|
|
40795
|
+
});
|
|
40796
|
+
if (items.length === 0) {
|
|
40797
|
+
return null;
|
|
40798
|
+
}
|
|
40799
|
+
const windowEnd = windowStart + windowSize;
|
|
40800
|
+
const visibleItems = items.slice(windowStart, windowEnd);
|
|
40801
|
+
return /* @__PURE__ */ import_react23.default.createElement(Box_default, {
|
|
40802
|
+
flexDirection: "column"
|
|
40803
|
+
}, visibleItems.map((item, index) => {
|
|
40804
|
+
const actualIndex = windowStart + index;
|
|
40805
|
+
const isSelected = actualIndex === selectedIndex;
|
|
40806
|
+
return /* @__PURE__ */ import_react23.default.createElement(Box_default, {
|
|
40807
|
+
key: item.value
|
|
40808
|
+
}, isSelected ? /* @__PURE__ */ import_react23.default.createElement(Text, {
|
|
40809
|
+
color: "cyan"
|
|
40810
|
+
}, "❯ ", item.label) : /* @__PURE__ */ import_react23.default.createElement(Text, null, " ", item.label));
|
|
41152
40811
|
}));
|
|
41153
|
-
}
|
|
41154
|
-
|
|
40812
|
+
};
|
|
40813
|
+
|
|
41155
40814
|
// src/features/template/storage.ts
|
|
41156
40815
|
import { promises as fs2 } from "fs";
|
|
41157
40816
|
import path from "path";
|
|
@@ -41236,12 +40895,12 @@ var getDestPath = (destDir, relativePath) => {
|
|
|
41236
40895
|
// src/features/template/TemplateList.tsx
|
|
41237
40896
|
var TemplateList = () => {
|
|
41238
40897
|
const setView = useSetAtom(viewAtom);
|
|
41239
|
-
const [templates, setTemplates] =
|
|
41240
|
-
const [isLoading, setIsLoading] =
|
|
41241
|
-
const [confirmState, setConfirmState] =
|
|
40898
|
+
const [templates, setTemplates] = import_react24.useState([]);
|
|
40899
|
+
const [isLoading, setIsLoading] = import_react24.useState(true);
|
|
40900
|
+
const [confirmState, setConfirmState] = import_react24.useState({
|
|
41242
40901
|
type: "idle"
|
|
41243
40902
|
});
|
|
41244
|
-
const [highlightedId, setHighlightedId] =
|
|
40903
|
+
const [highlightedId, setHighlightedId] = import_react24.useState(null);
|
|
41245
40904
|
use_input_default((input, key) => {
|
|
41246
40905
|
if (confirmState.type === "confirmingOverwrite") {
|
|
41247
40906
|
if (input === "y" || input === "Y") {
|
|
@@ -41269,7 +40928,7 @@ var TemplateList = () => {
|
|
|
41269
40928
|
}
|
|
41270
40929
|
}
|
|
41271
40930
|
});
|
|
41272
|
-
|
|
40931
|
+
import_react24.useEffect(() => {
|
|
41273
40932
|
const load = async () => {
|
|
41274
40933
|
setIsLoading(true);
|
|
41275
40934
|
const data = await loadTemplates();
|
|
@@ -41321,33 +40980,33 @@ var TemplateList = () => {
|
|
|
41321
40980
|
setHighlightedId(item.value);
|
|
41322
40981
|
};
|
|
41323
40982
|
if (isLoading) {
|
|
41324
|
-
return /* @__PURE__ */
|
|
40983
|
+
return /* @__PURE__ */ import_react24.default.createElement(Text, null, "Loading templates...");
|
|
41325
40984
|
}
|
|
41326
40985
|
if (confirmState.type === "confirmingOverwrite") {
|
|
41327
|
-
return /* @__PURE__ */
|
|
40986
|
+
return /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41328
40987
|
flexDirection: "column"
|
|
41329
|
-
}, /* @__PURE__ */
|
|
40988
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41330
40989
|
bold: true,
|
|
41331
40990
|
color: "yellow"
|
|
41332
|
-
}, "⚠️ File already exists"), /* @__PURE__ */
|
|
40991
|
+
}, "⚠️ File already exists"), /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41333
40992
|
marginTop: 1
|
|
41334
|
-
}, /* @__PURE__ */
|
|
40993
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, null, "Overwrite ", confirmState.destPath, "?")), /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41335
40994
|
marginTop: 1
|
|
41336
|
-
}, /* @__PURE__ */
|
|
40995
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41337
40996
|
dimColor: true
|
|
41338
40997
|
}, "[y] Yes [n] No")));
|
|
41339
40998
|
}
|
|
41340
40999
|
if (confirmState.type === "confirmingDelete") {
|
|
41341
|
-
return /* @__PURE__ */
|
|
41000
|
+
return /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41342
41001
|
flexDirection: "column"
|
|
41343
|
-
}, /* @__PURE__ */
|
|
41002
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41344
41003
|
bold: true,
|
|
41345
41004
|
color: "red"
|
|
41346
|
-
}, "\uD83D\uDDD1️ Delete template"), /* @__PURE__ */
|
|
41005
|
+
}, "\uD83D\uDDD1️ Delete template"), /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41347
41006
|
marginTop: 1
|
|
41348
|
-
}, /* @__PURE__ */
|
|
41007
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, null, 'Delete "', confirmState.template.name, '" (', confirmState.template.relativePath, ")?")), /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41349
41008
|
marginTop: 1
|
|
41350
|
-
}, /* @__PURE__ */
|
|
41009
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41351
41010
|
dimColor: true
|
|
41352
41011
|
}, "[y] Yes [n] No")));
|
|
41353
41012
|
}
|
|
@@ -41355,37 +41014,37 @@ var TemplateList = () => {
|
|
|
41355
41014
|
label: `\uD83D\uDCC4 ${t.name} (${t.relativePath})`,
|
|
41356
41015
|
value: t.id
|
|
41357
41016
|
}));
|
|
41358
|
-
return /* @__PURE__ */
|
|
41017
|
+
return /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41359
41018
|
flexDirection: "column"
|
|
41360
|
-
}, /* @__PURE__ */
|
|
41019
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41361
41020
|
marginBottom: 1
|
|
41362
|
-
}, /* @__PURE__ */
|
|
41021
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41363
41022
|
bold: true,
|
|
41364
41023
|
color: "cyan"
|
|
41365
|
-
}, "\uD83D\uDCCB Templates")), items.length > 0 ? /* @__PURE__ */
|
|
41024
|
+
}, "\uD83D\uDCCB Templates")), items.length > 0 ? /* @__PURE__ */ import_react24.default.createElement(SelectList, {
|
|
41366
41025
|
items,
|
|
41367
41026
|
onSelect: handleSelect,
|
|
41368
41027
|
onHighlight: handleHighlight
|
|
41369
|
-
}) : /* @__PURE__ */
|
|
41028
|
+
}) : /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41370
41029
|
flexDirection: "column"
|
|
41371
|
-
}, /* @__PURE__ */
|
|
41030
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41372
41031
|
dimColor: true
|
|
41373
|
-
}, "No templates registered"), /* @__PURE__ */
|
|
41032
|
+
}, "No templates registered"), /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41374
41033
|
dimColor: true
|
|
41375
|
-
}, "Press [Tab] to register a template!")), confirmState.type === "done" && /* @__PURE__ */
|
|
41034
|
+
}, "Press [Tab] to register a template!")), confirmState.type === "done" && /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41376
41035
|
marginTop: 1
|
|
41377
|
-
}, /* @__PURE__ */
|
|
41036
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, null, confirmState.message)), confirmState.type === "copying" && /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41378
41037
|
marginTop: 1
|
|
41379
|
-
}, /* @__PURE__ */
|
|
41038
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41380
41039
|
color: "yellow"
|
|
41381
41040
|
}, "Copying...")));
|
|
41382
41041
|
};
|
|
41383
41042
|
|
|
41384
41043
|
// src/features/template/RegisterScreen.tsx
|
|
41385
|
-
var
|
|
41044
|
+
var import_react26 = __toESM(require_react(), 1);
|
|
41386
41045
|
|
|
41387
41046
|
// node_modules/ink-text-input/build/index.js
|
|
41388
|
-
var
|
|
41047
|
+
var import_react25 = __toESM(require_react(), 1);
|
|
41389
41048
|
|
|
41390
41049
|
// node_modules/ink-text-input/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
41391
41050
|
var ANSI_BACKGROUND_OFFSET3 = 10;
|
|
@@ -41565,16 +41224,16 @@ var ansiStyles3 = assembleStyles3();
|
|
|
41565
41224
|
var ansi_styles_default3 = ansiStyles3;
|
|
41566
41225
|
|
|
41567
41226
|
// node_modules/ink-text-input/node_modules/chalk/source/vendor/supports-color/index.js
|
|
41568
|
-
import
|
|
41227
|
+
import process13 from "node:process";
|
|
41569
41228
|
import os3 from "node:os";
|
|
41570
41229
|
import tty2 from "node:tty";
|
|
41571
|
-
function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args :
|
|
41230
|
+
function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process13.argv) {
|
|
41572
41231
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
41573
41232
|
const position = argv.indexOf(prefix + flag);
|
|
41574
41233
|
const terminatorPosition = argv.indexOf("--");
|
|
41575
41234
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
41576
41235
|
}
|
|
41577
|
-
var { env: env3 } =
|
|
41236
|
+
var { env: env3 } = process13;
|
|
41578
41237
|
var flagForceColor2;
|
|
41579
41238
|
if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
|
|
41580
41239
|
flagForceColor2 = 0;
|
|
@@ -41630,7 +41289,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
41630
41289
|
if (env3.TERM === "dumb") {
|
|
41631
41290
|
return min;
|
|
41632
41291
|
}
|
|
41633
|
-
if (
|
|
41292
|
+
if (process13.platform === "win32") {
|
|
41634
41293
|
const osRelease = os3.release().split(".");
|
|
41635
41294
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
41636
41295
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
@@ -41872,12 +41531,12 @@ var source_default2 = chalk2;
|
|
|
41872
41531
|
|
|
41873
41532
|
// node_modules/ink-text-input/build/index.js
|
|
41874
41533
|
function TextInput({ value: originalValue, placeholder = "", focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit }) {
|
|
41875
|
-
const [state, setState] =
|
|
41534
|
+
const [state, setState] = import_react25.useState({
|
|
41876
41535
|
cursorOffset: (originalValue || "").length,
|
|
41877
41536
|
cursorWidth: 0
|
|
41878
41537
|
});
|
|
41879
41538
|
const { cursorOffset, cursorWidth } = state;
|
|
41880
|
-
|
|
41539
|
+
import_react25.useEffect(() => {
|
|
41881
41540
|
setState((previousState) => {
|
|
41882
41541
|
if (!focus || !showCursor) {
|
|
41883
41542
|
return previousState;
|
|
@@ -41955,7 +41614,7 @@ function TextInput({ value: originalValue, placeholder = "", focus = true, mask,
|
|
|
41955
41614
|
onChange(nextValue);
|
|
41956
41615
|
}
|
|
41957
41616
|
}, { isActive: focus });
|
|
41958
|
-
return
|
|
41617
|
+
return import_react25.default.createElement(Text, null, placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
|
|
41959
41618
|
}
|
|
41960
41619
|
var build_default = TextInput;
|
|
41961
41620
|
|
|
@@ -41988,14 +41647,14 @@ var loadLocalFiles = async (dir) => {
|
|
|
41988
41647
|
// src/features/template/RegisterScreen.tsx
|
|
41989
41648
|
var RegisterScreen = () => {
|
|
41990
41649
|
const setView = useSetAtom(viewAtom);
|
|
41991
|
-
const [files, setFiles] =
|
|
41992
|
-
const [currentDir, setCurrentDir] =
|
|
41993
|
-
const [projectRoot] =
|
|
41994
|
-
const [isLoading, setIsLoading] =
|
|
41995
|
-
const [registerState, setRegisterState] =
|
|
41650
|
+
const [files, setFiles] = import_react26.useState([]);
|
|
41651
|
+
const [currentDir, setCurrentDir] = import_react26.useState(process.cwd());
|
|
41652
|
+
const [projectRoot] = import_react26.useState(process.cwd());
|
|
41653
|
+
const [isLoading, setIsLoading] = import_react26.useState(true);
|
|
41654
|
+
const [registerState, setRegisterState] = import_react26.useState({
|
|
41996
41655
|
type: "browsing"
|
|
41997
41656
|
});
|
|
41998
|
-
const [templateName, setTemplateName] =
|
|
41657
|
+
const [templateName, setTemplateName] = import_react26.useState("");
|
|
41999
41658
|
use_input_default((_input, key) => {
|
|
42000
41659
|
if (key.escape && registerState.type === "naming") {
|
|
42001
41660
|
setRegisterState({ type: "browsing" });
|
|
@@ -42006,7 +41665,7 @@ var RegisterScreen = () => {
|
|
|
42006
41665
|
setView("templates");
|
|
42007
41666
|
}
|
|
42008
41667
|
});
|
|
42009
|
-
|
|
41668
|
+
import_react26.useEffect(() => {
|
|
42010
41669
|
const load = async () => {
|
|
42011
41670
|
setIsLoading(true);
|
|
42012
41671
|
try {
|
|
@@ -42043,7 +41702,7 @@ var RegisterScreen = () => {
|
|
|
42043
41702
|
message: `✅ Registered: ${templateName}`
|
|
42044
41703
|
});
|
|
42045
41704
|
setTimeout(() => {
|
|
42046
|
-
|
|
41705
|
+
setRegisterState({ type: "browsing" });
|
|
42047
41706
|
}, 1000);
|
|
42048
41707
|
} catch (error) {
|
|
42049
41708
|
const message = error instanceof Error ? error.message : "Unknown error";
|
|
@@ -42054,24 +41713,24 @@ var RegisterScreen = () => {
|
|
|
42054
41713
|
}
|
|
42055
41714
|
};
|
|
42056
41715
|
if (isLoading) {
|
|
42057
|
-
return /* @__PURE__ */
|
|
41716
|
+
return /* @__PURE__ */ import_react26.default.createElement(Text, null, "Loading files...");
|
|
42058
41717
|
}
|
|
42059
41718
|
switch (registerState.type) {
|
|
42060
41719
|
case "naming":
|
|
42061
|
-
return /* @__PURE__ */
|
|
41720
|
+
return /* @__PURE__ */ import_react26.default.createElement(NamingForm, {
|
|
42062
41721
|
relativePath: registerState.relativePath,
|
|
42063
41722
|
templateName,
|
|
42064
41723
|
onChangeName: setTemplateName,
|
|
42065
41724
|
onSubmit: handleRegister
|
|
42066
41725
|
});
|
|
42067
41726
|
case "registering":
|
|
42068
|
-
return /* @__PURE__ */
|
|
41727
|
+
return /* @__PURE__ */ import_react26.default.createElement(RegisteringStatus, null);
|
|
42069
41728
|
case "done":
|
|
42070
|
-
return /* @__PURE__ */
|
|
41729
|
+
return /* @__PURE__ */ import_react26.default.createElement(DoneStatus, {
|
|
42071
41730
|
message: registerState.message
|
|
42072
41731
|
});
|
|
42073
41732
|
case "browsing":
|
|
42074
|
-
return /* @__PURE__ */
|
|
41733
|
+
return /* @__PURE__ */ import_react26.default.createElement(FileBrowser, {
|
|
42075
41734
|
files,
|
|
42076
41735
|
currentDir,
|
|
42077
41736
|
projectRoot,
|
|
@@ -42089,31 +41748,26 @@ var FileBrowser = ({
|
|
|
42089
41748
|
label: f.isDirectory ? `\uD83D\uDCC1 ${f.name}` : `\uD83D\uDCC4 ${f.name}`,
|
|
42090
41749
|
value: f.path
|
|
42091
41750
|
}));
|
|
42092
|
-
|
|
42093
|
-
const hasMore = items.length > 15;
|
|
42094
|
-
return /* @__PURE__ */ import_react27.default.createElement(Box_default, {
|
|
41751
|
+
return /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42095
41752
|
flexDirection: "column"
|
|
42096
|
-
}, /* @__PURE__ */
|
|
41753
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42097
41754
|
marginBottom: 1,
|
|
42098
41755
|
flexDirection: "row",
|
|
42099
41756
|
justifyContent: "space-between"
|
|
42100
|
-
}, /* @__PURE__ */
|
|
41757
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42101
41758
|
bold: true,
|
|
42102
41759
|
color: "cyan"
|
|
42103
|
-
}, "\uD83D\uDCCC Register Template"), /* @__PURE__ */
|
|
41760
|
+
}, "\uD83D\uDCCC Register Template"), /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42104
41761
|
dimColor: true
|
|
42105
|
-
}, "Root: ", projectRoot)), /* @__PURE__ */
|
|
41762
|
+
}, "Root: ", projectRoot)), /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42106
41763
|
marginBottom: 1
|
|
42107
|
-
}, /* @__PURE__ */
|
|
41764
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42108
41765
|
dimColor: true
|
|
42109
|
-
}, "Current: ", currentDir)), /* @__PURE__ */
|
|
42110
|
-
items
|
|
42111
|
-
onSelect
|
|
42112
|
-
|
|
42113
|
-
|
|
42114
|
-
}, /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42115
|
-
dimColor: true
|
|
42116
|
-
}, "... and ", items.length - 15, " more files")));
|
|
41766
|
+
}, "Current: ", currentDir)), /* @__PURE__ */ import_react26.default.createElement(SelectList, {
|
|
41767
|
+
items,
|
|
41768
|
+
onSelect,
|
|
41769
|
+
limit: 15
|
|
41770
|
+
}));
|
|
42117
41771
|
};
|
|
42118
41772
|
var NamingForm = ({
|
|
42119
41773
|
relativePath,
|
|
@@ -42121,38 +41775,38 @@ var NamingForm = ({
|
|
|
42121
41775
|
onChangeName,
|
|
42122
41776
|
onSubmit
|
|
42123
41777
|
}) => {
|
|
42124
|
-
return /* @__PURE__ */
|
|
41778
|
+
return /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42125
41779
|
flexDirection: "column"
|
|
42126
|
-
}, /* @__PURE__ */
|
|
41780
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42127
41781
|
marginBottom: 1
|
|
42128
|
-
}, /* @__PURE__ */
|
|
41782
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42129
41783
|
bold: true,
|
|
42130
41784
|
color: "cyan"
|
|
42131
|
-
}, "\uD83D\uDCCC Register Template")), /* @__PURE__ */
|
|
41785
|
+
}, "\uD83D\uDCCC Register Template")), /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42132
41786
|
marginBottom: 1
|
|
42133
|
-
}, /* @__PURE__ */
|
|
41787
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, null, "File: "), /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42134
41788
|
color: "green"
|
|
42135
|
-
}, relativePath)), /* @__PURE__ */
|
|
41789
|
+
}, relativePath)), /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42136
41790
|
marginBottom: 1
|
|
42137
|
-
}, /* @__PURE__ */
|
|
41791
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, null, "Template name: "), /* @__PURE__ */ import_react26.default.createElement(build_default, {
|
|
42138
41792
|
value: templateName,
|
|
42139
41793
|
onChange: onChangeName,
|
|
42140
41794
|
onSubmit
|
|
42141
|
-
})), /* @__PURE__ */
|
|
41795
|
+
})), /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42142
41796
|
dimColor: true
|
|
42143
41797
|
}, "[Enter] Register [Esc] Cancel"));
|
|
42144
41798
|
};
|
|
42145
41799
|
var RegisteringStatus = () => {
|
|
42146
|
-
return /* @__PURE__ */
|
|
41800
|
+
return /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42147
41801
|
flexDirection: "column"
|
|
42148
|
-
}, /* @__PURE__ */
|
|
41802
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42149
41803
|
color: "yellow"
|
|
42150
41804
|
}, "Registering..."));
|
|
42151
41805
|
};
|
|
42152
41806
|
var DoneStatus = ({ message }) => {
|
|
42153
|
-
return /* @__PURE__ */
|
|
41807
|
+
return /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42154
41808
|
flexDirection: "column"
|
|
42155
|
-
}, /* @__PURE__ */
|
|
41809
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, null, message));
|
|
42156
41810
|
};
|
|
42157
41811
|
|
|
42158
41812
|
// src/App.tsx
|
|
@@ -42163,30 +41817,30 @@ var App2 = () => {
|
|
|
42163
41817
|
process.exit(0);
|
|
42164
41818
|
}
|
|
42165
41819
|
});
|
|
42166
|
-
return /* @__PURE__ */
|
|
41820
|
+
return /* @__PURE__ */ import_react27.default.createElement(Box_default, {
|
|
42167
41821
|
flexDirection: "column",
|
|
42168
41822
|
padding: 1
|
|
42169
|
-
}, /* @__PURE__ */
|
|
41823
|
+
}, /* @__PURE__ */ import_react27.default.createElement(Box_default, {
|
|
42170
41824
|
marginBottom: 1,
|
|
42171
41825
|
flexDirection: "row",
|
|
42172
41826
|
justifyContent: "space-between",
|
|
42173
41827
|
alignItems: "center"
|
|
42174
|
-
}, /* @__PURE__ */
|
|
41828
|
+
}, /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42175
41829
|
bold: true,
|
|
42176
41830
|
color: "cyan"
|
|
42177
|
-
}, "copit - Template Manager"), /* @__PURE__ */
|
|
41831
|
+
}, "copit - Template Manager"), /* @__PURE__ */ import_react27.default.createElement(Box_default, {
|
|
42178
41832
|
flexDirection: "row"
|
|
42179
|
-
}, /* @__PURE__ */
|
|
41833
|
+
}, /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42180
41834
|
color: view === "templates" ? "cyan" : "gray"
|
|
42181
|
-
}, "\uD83D\uDCCB Templates"), /* @__PURE__ */
|
|
41835
|
+
}, "\uD83D\uDCCB Templates"), /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42182
41836
|
dimColor: true
|
|
42183
|
-
}, " | "), /* @__PURE__ */
|
|
41837
|
+
}, " | "), /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42184
41838
|
color: view === "register" ? "cyan" : "gray"
|
|
42185
|
-
}, "\uD83D\uDCCC Register"))), /* @__PURE__ */
|
|
41839
|
+
}, "\uD83D\uDCCC Register"))), /* @__PURE__ */ import_react27.default.createElement(Box_default, {
|
|
42186
41840
|
borderStyle: "single",
|
|
42187
41841
|
flexDirection: "column",
|
|
42188
41842
|
padding: 1
|
|
42189
|
-
}, view === "templates" && /* @__PURE__ */
|
|
41843
|
+
}, view === "templates" && /* @__PURE__ */ import_react27.default.createElement(TemplateList, null), view === "register" && /* @__PURE__ */ import_react27.default.createElement(RegisterScreen, null)), /* @__PURE__ */ import_react27.default.createElement(HelpBar, {
|
|
42190
41844
|
items: [
|
|
42191
41845
|
{ key: "↑/↓", label: "navigate" },
|
|
42192
41846
|
{ key: "Enter", label: view === "register" ? "select" : "copy" },
|
|
@@ -42198,21 +41852,21 @@ var App2 = () => {
|
|
|
42198
41852
|
};
|
|
42199
41853
|
var HelpBar = ({ items }) => {
|
|
42200
41854
|
const visibleItems = items.filter((item) => item.show !== false);
|
|
42201
|
-
return /* @__PURE__ */
|
|
41855
|
+
return /* @__PURE__ */ import_react27.default.createElement(Box_default, {
|
|
42202
41856
|
marginTop: 1
|
|
42203
|
-
}, visibleItems.map((item, index) => /* @__PURE__ */
|
|
41857
|
+
}, visibleItems.map((item, index) => /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, {
|
|
42204
41858
|
key: item.key
|
|
42205
|
-
}, index > 0 && /* @__PURE__ */
|
|
41859
|
+
}, index > 0 && /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42206
41860
|
dimColor: true
|
|
42207
|
-
}, " • "), /* @__PURE__ */
|
|
41861
|
+
}, " • "), /* @__PURE__ */ import_react27.default.createElement(Text, null, /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42208
41862
|
color: "cyan"
|
|
42209
|
-
}, item.key), /* @__PURE__ */
|
|
41863
|
+
}, item.key), /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42210
41864
|
dimColor: true
|
|
42211
41865
|
}, " ", item.label)))));
|
|
42212
41866
|
};
|
|
42213
41867
|
|
|
42214
41868
|
// src/index.tsx
|
|
42215
|
-
var app = render_default(/* @__PURE__ */
|
|
41869
|
+
var app = render_default(/* @__PURE__ */ import_react28.default.createElement(Provider, null, /* @__PURE__ */ import_react28.default.createElement(App2, null)));
|
|
42216
41870
|
process.on("SIGINT", () => {
|
|
42217
41871
|
app.unmount();
|
|
42218
41872
|
process.exit(0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "copit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "TUI tool for managing local file templates - register and copy config files to new projects",
|
|
5
5
|
"module": "src/index.tsx",
|
|
6
6
|
"type": "module",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"ink": "^5.0.1",
|
|
40
|
-
"ink-select-input": "^6.2.0",
|
|
41
40
|
"ink-text-input": "^6.0.0",
|
|
42
41
|
"jotai": "^2.12.5",
|
|
43
42
|
"react": "^18.3.1"
|