copit 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +148 -491
- 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
|
-
|
|
41060
|
-
// node_modules/to-rotated/index.js
|
|
41061
|
-
function toRotated(array, steps) {
|
|
41062
|
-
if (!Array.isArray(array)) {
|
|
41063
|
-
throw new TypeError(`Expected an array, got \`${typeof array}\`.`);
|
|
41064
|
-
}
|
|
41065
|
-
if (!Number.isSafeInteger(steps)) {
|
|
41066
|
-
throw new TypeError(`The \`steps\` parameter must be an integer, got ${steps}.`);
|
|
41067
|
-
}
|
|
41068
|
-
const { length } = array;
|
|
41069
|
-
if (length === 0) {
|
|
41070
|
-
return [...array];
|
|
41071
|
-
}
|
|
41072
|
-
const normalizedSteps = (steps % length + length) % length;
|
|
41073
|
-
if (normalizedSteps === 0) {
|
|
41074
|
-
return [...array];
|
|
41075
|
-
}
|
|
41076
|
-
return [
|
|
41077
|
-
...array.slice(-normalizedSteps),
|
|
41078
|
-
...array.slice(0, -normalizedSteps)
|
|
41079
|
-
];
|
|
41080
|
-
}
|
|
41081
40754
|
|
|
41082
|
-
//
|
|
41083
|
-
|
|
41084
|
-
|
|
41085
|
-
|
|
41086
|
-
|
|
41087
|
-
|
|
41088
|
-
|
|
41089
|
-
|
|
41090
|
-
|
|
41091
|
-
|
|
41092
|
-
|
|
41093
|
-
|
|
41094
|
-
|
|
41095
|
-
|
|
41096
|
-
}, [items]);
|
|
41097
|
-
|
|
41098
|
-
if (
|
|
41099
|
-
|
|
41100
|
-
|
|
41101
|
-
|
|
41102
|
-
|
|
41103
|
-
|
|
41104
|
-
|
|
41105
|
-
|
|
41106
|
-
|
|
41107
|
-
|
|
41108
|
-
|
|
41109
|
-
|
|
41110
|
-
|
|
41111
|
-
if (
|
|
41112
|
-
|
|
41113
|
-
|
|
41114
|
-
|
|
41115
|
-
|
|
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();
|
|
@@ -41281,8 +40940,11 @@ var TemplateList = () => {
|
|
|
41281
40940
|
const handleConfirmedCopy = async (template) => {
|
|
41282
40941
|
setConfirmState({ type: "copying" });
|
|
41283
40942
|
try {
|
|
41284
|
-
|
|
41285
|
-
setConfirmState({
|
|
40943
|
+
await copyTemplateToDir(template, process.cwd());
|
|
40944
|
+
setConfirmState({
|
|
40945
|
+
type: "done",
|
|
40946
|
+
message: `✅ Copied: ${template.relativePath}`
|
|
40947
|
+
});
|
|
41286
40948
|
setTimeout(() => setConfirmState({ type: "idle" }), 2000);
|
|
41287
40949
|
} catch (error) {
|
|
41288
40950
|
const message = error instanceof Error ? error.message : "Unknown error";
|
|
@@ -41312,7 +40974,7 @@ var TemplateList = () => {
|
|
|
41312
40974
|
const destPath = getDestPath(process.cwd(), template.relativePath);
|
|
41313
40975
|
const exists = await checkFileExists(destPath);
|
|
41314
40976
|
if (exists) {
|
|
41315
|
-
setConfirmState({ type: "confirmingOverwrite", template
|
|
40977
|
+
setConfirmState({ type: "confirmingOverwrite", template });
|
|
41316
40978
|
} else {
|
|
41317
40979
|
await handleConfirmedCopy(template);
|
|
41318
40980
|
}
|
|
@@ -41321,33 +40983,33 @@ var TemplateList = () => {
|
|
|
41321
40983
|
setHighlightedId(item.value);
|
|
41322
40984
|
};
|
|
41323
40985
|
if (isLoading) {
|
|
41324
|
-
return /* @__PURE__ */
|
|
40986
|
+
return /* @__PURE__ */ import_react24.default.createElement(Text, null, "Loading templates...");
|
|
41325
40987
|
}
|
|
41326
40988
|
if (confirmState.type === "confirmingOverwrite") {
|
|
41327
|
-
return /* @__PURE__ */
|
|
40989
|
+
return /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41328
40990
|
flexDirection: "column"
|
|
41329
|
-
}, /* @__PURE__ */
|
|
40991
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41330
40992
|
bold: true,
|
|
41331
40993
|
color: "yellow"
|
|
41332
|
-
}, "⚠️ File already exists"), /* @__PURE__ */
|
|
40994
|
+
}, "⚠️ File already exists"), /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41333
40995
|
marginTop: 1
|
|
41334
|
-
}, /* @__PURE__ */
|
|
40996
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, null, "Overwrite ", confirmState.template.relativePath, "?")), /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41335
40997
|
marginTop: 1
|
|
41336
|
-
}, /* @__PURE__ */
|
|
40998
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41337
40999
|
dimColor: true
|
|
41338
41000
|
}, "[y] Yes [n] No")));
|
|
41339
41001
|
}
|
|
41340
41002
|
if (confirmState.type === "confirmingDelete") {
|
|
41341
|
-
return /* @__PURE__ */
|
|
41003
|
+
return /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41342
41004
|
flexDirection: "column"
|
|
41343
|
-
}, /* @__PURE__ */
|
|
41005
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41344
41006
|
bold: true,
|
|
41345
41007
|
color: "red"
|
|
41346
|
-
}, "\uD83D\uDDD1️ Delete template"), /* @__PURE__ */
|
|
41008
|
+
}, "\uD83D\uDDD1️ Delete template"), /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41347
41009
|
marginTop: 1
|
|
41348
|
-
}, /* @__PURE__ */
|
|
41010
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, null, 'Delete "', confirmState.template.name, '" (', confirmState.template.relativePath, ")?")), /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41349
41011
|
marginTop: 1
|
|
41350
|
-
}, /* @__PURE__ */
|
|
41012
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41351
41013
|
dimColor: true
|
|
41352
41014
|
}, "[y] Yes [n] No")));
|
|
41353
41015
|
}
|
|
@@ -41355,37 +41017,37 @@ var TemplateList = () => {
|
|
|
41355
41017
|
label: `\uD83D\uDCC4 ${t.name} (${t.relativePath})`,
|
|
41356
41018
|
value: t.id
|
|
41357
41019
|
}));
|
|
41358
|
-
return /* @__PURE__ */
|
|
41020
|
+
return /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41359
41021
|
flexDirection: "column"
|
|
41360
|
-
}, /* @__PURE__ */
|
|
41022
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41361
41023
|
marginBottom: 1
|
|
41362
|
-
}, /* @__PURE__ */
|
|
41024
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41363
41025
|
bold: true,
|
|
41364
41026
|
color: "cyan"
|
|
41365
|
-
}, "\uD83D\uDCCB Templates")), items.length > 0 ? /* @__PURE__ */
|
|
41027
|
+
}, "\uD83D\uDCCB Templates")), items.length > 0 ? /* @__PURE__ */ import_react24.default.createElement(SelectList, {
|
|
41366
41028
|
items,
|
|
41367
41029
|
onSelect: handleSelect,
|
|
41368
41030
|
onHighlight: handleHighlight
|
|
41369
|
-
}) : /* @__PURE__ */
|
|
41031
|
+
}) : /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41370
41032
|
flexDirection: "column"
|
|
41371
|
-
}, /* @__PURE__ */
|
|
41033
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41372
41034
|
dimColor: true
|
|
41373
|
-
}, "No templates registered"), /* @__PURE__ */
|
|
41035
|
+
}, "No templates registered"), /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41374
41036
|
dimColor: true
|
|
41375
|
-
}, "Press [Tab] to register a template!")), confirmState.type === "done" && /* @__PURE__ */
|
|
41037
|
+
}, "Press [Tab] to register a template!")), confirmState.type === "done" && /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41376
41038
|
marginTop: 1
|
|
41377
|
-
}, /* @__PURE__ */
|
|
41039
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, null, confirmState.message)), confirmState.type === "copying" && /* @__PURE__ */ import_react24.default.createElement(Box_default, {
|
|
41378
41040
|
marginTop: 1
|
|
41379
|
-
}, /* @__PURE__ */
|
|
41041
|
+
}, /* @__PURE__ */ import_react24.default.createElement(Text, {
|
|
41380
41042
|
color: "yellow"
|
|
41381
41043
|
}, "Copying...")));
|
|
41382
41044
|
};
|
|
41383
41045
|
|
|
41384
41046
|
// src/features/template/RegisterScreen.tsx
|
|
41385
|
-
var
|
|
41047
|
+
var import_react26 = __toESM(require_react(), 1);
|
|
41386
41048
|
|
|
41387
41049
|
// node_modules/ink-text-input/build/index.js
|
|
41388
|
-
var
|
|
41050
|
+
var import_react25 = __toESM(require_react(), 1);
|
|
41389
41051
|
|
|
41390
41052
|
// node_modules/ink-text-input/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
41391
41053
|
var ANSI_BACKGROUND_OFFSET3 = 10;
|
|
@@ -41565,16 +41227,16 @@ var ansiStyles3 = assembleStyles3();
|
|
|
41565
41227
|
var ansi_styles_default3 = ansiStyles3;
|
|
41566
41228
|
|
|
41567
41229
|
// node_modules/ink-text-input/node_modules/chalk/source/vendor/supports-color/index.js
|
|
41568
|
-
import
|
|
41230
|
+
import process13 from "node:process";
|
|
41569
41231
|
import os3 from "node:os";
|
|
41570
41232
|
import tty2 from "node:tty";
|
|
41571
|
-
function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args :
|
|
41233
|
+
function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process13.argv) {
|
|
41572
41234
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
41573
41235
|
const position = argv.indexOf(prefix + flag);
|
|
41574
41236
|
const terminatorPosition = argv.indexOf("--");
|
|
41575
41237
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
41576
41238
|
}
|
|
41577
|
-
var { env: env3 } =
|
|
41239
|
+
var { env: env3 } = process13;
|
|
41578
41240
|
var flagForceColor2;
|
|
41579
41241
|
if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
|
|
41580
41242
|
flagForceColor2 = 0;
|
|
@@ -41630,7 +41292,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
41630
41292
|
if (env3.TERM === "dumb") {
|
|
41631
41293
|
return min;
|
|
41632
41294
|
}
|
|
41633
|
-
if (
|
|
41295
|
+
if (process13.platform === "win32") {
|
|
41634
41296
|
const osRelease = os3.release().split(".");
|
|
41635
41297
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
41636
41298
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
@@ -41872,12 +41534,12 @@ var source_default2 = chalk2;
|
|
|
41872
41534
|
|
|
41873
41535
|
// node_modules/ink-text-input/build/index.js
|
|
41874
41536
|
function TextInput({ value: originalValue, placeholder = "", focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit }) {
|
|
41875
|
-
const [state, setState] =
|
|
41537
|
+
const [state, setState] = import_react25.useState({
|
|
41876
41538
|
cursorOffset: (originalValue || "").length,
|
|
41877
41539
|
cursorWidth: 0
|
|
41878
41540
|
});
|
|
41879
41541
|
const { cursorOffset, cursorWidth } = state;
|
|
41880
|
-
|
|
41542
|
+
import_react25.useEffect(() => {
|
|
41881
41543
|
setState((previousState) => {
|
|
41882
41544
|
if (!focus || !showCursor) {
|
|
41883
41545
|
return previousState;
|
|
@@ -41955,7 +41617,7 @@ function TextInput({ value: originalValue, placeholder = "", focus = true, mask,
|
|
|
41955
41617
|
onChange(nextValue);
|
|
41956
41618
|
}
|
|
41957
41619
|
}, { isActive: focus });
|
|
41958
|
-
return
|
|
41620
|
+
return import_react25.default.createElement(Text, null, placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
|
|
41959
41621
|
}
|
|
41960
41622
|
var build_default = TextInput;
|
|
41961
41623
|
|
|
@@ -41988,14 +41650,14 @@ var loadLocalFiles = async (dir) => {
|
|
|
41988
41650
|
// src/features/template/RegisterScreen.tsx
|
|
41989
41651
|
var RegisterScreen = () => {
|
|
41990
41652
|
const setView = useSetAtom(viewAtom);
|
|
41991
|
-
const [files, setFiles] =
|
|
41992
|
-
const [currentDir, setCurrentDir] =
|
|
41993
|
-
const [projectRoot] =
|
|
41994
|
-
const [isLoading, setIsLoading] =
|
|
41995
|
-
const [registerState, setRegisterState] =
|
|
41653
|
+
const [files, setFiles] = import_react26.useState([]);
|
|
41654
|
+
const [currentDir, setCurrentDir] = import_react26.useState(process.cwd());
|
|
41655
|
+
const [projectRoot] = import_react26.useState(process.cwd());
|
|
41656
|
+
const [isLoading, setIsLoading] = import_react26.useState(true);
|
|
41657
|
+
const [registerState, setRegisterState] = import_react26.useState({
|
|
41996
41658
|
type: "browsing"
|
|
41997
41659
|
});
|
|
41998
|
-
const [templateName, setTemplateName] =
|
|
41660
|
+
const [templateName, setTemplateName] = import_react26.useState("");
|
|
41999
41661
|
use_input_default((_input, key) => {
|
|
42000
41662
|
if (key.escape && registerState.type === "naming") {
|
|
42001
41663
|
setRegisterState({ type: "browsing" });
|
|
@@ -42006,7 +41668,7 @@ var RegisterScreen = () => {
|
|
|
42006
41668
|
setView("templates");
|
|
42007
41669
|
}
|
|
42008
41670
|
});
|
|
42009
|
-
|
|
41671
|
+
import_react26.useEffect(() => {
|
|
42010
41672
|
const load = async () => {
|
|
42011
41673
|
setIsLoading(true);
|
|
42012
41674
|
try {
|
|
@@ -42043,7 +41705,7 @@ var RegisterScreen = () => {
|
|
|
42043
41705
|
message: `✅ Registered: ${templateName}`
|
|
42044
41706
|
});
|
|
42045
41707
|
setTimeout(() => {
|
|
42046
|
-
|
|
41708
|
+
setRegisterState({ type: "browsing" });
|
|
42047
41709
|
}, 1000);
|
|
42048
41710
|
} catch (error) {
|
|
42049
41711
|
const message = error instanceof Error ? error.message : "Unknown error";
|
|
@@ -42054,24 +41716,24 @@ var RegisterScreen = () => {
|
|
|
42054
41716
|
}
|
|
42055
41717
|
};
|
|
42056
41718
|
if (isLoading) {
|
|
42057
|
-
return /* @__PURE__ */
|
|
41719
|
+
return /* @__PURE__ */ import_react26.default.createElement(Text, null, "Loading files...");
|
|
42058
41720
|
}
|
|
42059
41721
|
switch (registerState.type) {
|
|
42060
41722
|
case "naming":
|
|
42061
|
-
return /* @__PURE__ */
|
|
41723
|
+
return /* @__PURE__ */ import_react26.default.createElement(NamingForm, {
|
|
42062
41724
|
relativePath: registerState.relativePath,
|
|
42063
41725
|
templateName,
|
|
42064
41726
|
onChangeName: setTemplateName,
|
|
42065
41727
|
onSubmit: handleRegister
|
|
42066
41728
|
});
|
|
42067
41729
|
case "registering":
|
|
42068
|
-
return /* @__PURE__ */
|
|
41730
|
+
return /* @__PURE__ */ import_react26.default.createElement(RegisteringStatus, null);
|
|
42069
41731
|
case "done":
|
|
42070
|
-
return /* @__PURE__ */
|
|
41732
|
+
return /* @__PURE__ */ import_react26.default.createElement(DoneStatus, {
|
|
42071
41733
|
message: registerState.message
|
|
42072
41734
|
});
|
|
42073
41735
|
case "browsing":
|
|
42074
|
-
return /* @__PURE__ */
|
|
41736
|
+
return /* @__PURE__ */ import_react26.default.createElement(FileBrowser, {
|
|
42075
41737
|
files,
|
|
42076
41738
|
currentDir,
|
|
42077
41739
|
projectRoot,
|
|
@@ -42089,31 +41751,26 @@ var FileBrowser = ({
|
|
|
42089
41751
|
label: f.isDirectory ? `\uD83D\uDCC1 ${f.name}` : `\uD83D\uDCC4 ${f.name}`,
|
|
42090
41752
|
value: f.path
|
|
42091
41753
|
}));
|
|
42092
|
-
|
|
42093
|
-
const hasMore = items.length > 15;
|
|
42094
|
-
return /* @__PURE__ */ import_react27.default.createElement(Box_default, {
|
|
41754
|
+
return /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42095
41755
|
flexDirection: "column"
|
|
42096
|
-
}, /* @__PURE__ */
|
|
41756
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42097
41757
|
marginBottom: 1,
|
|
42098
41758
|
flexDirection: "row",
|
|
42099
41759
|
justifyContent: "space-between"
|
|
42100
|
-
}, /* @__PURE__ */
|
|
41760
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42101
41761
|
bold: true,
|
|
42102
41762
|
color: "cyan"
|
|
42103
|
-
}, "\uD83D\uDCCC Register Template"), /* @__PURE__ */
|
|
41763
|
+
}, "\uD83D\uDCCC Register Template"), /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42104
41764
|
dimColor: true
|
|
42105
|
-
}, "Root: ", projectRoot)), /* @__PURE__ */
|
|
41765
|
+
}, "Root: ", projectRoot)), /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42106
41766
|
marginBottom: 1
|
|
42107
|
-
}, /* @__PURE__ */
|
|
42108
|
-
dimColor: true
|
|
42109
|
-
}, "Current: ", currentDir)), /* @__PURE__ */ import_react27.default.createElement(SelectInput_default, {
|
|
42110
|
-
items: displayItems,
|
|
42111
|
-
onSelect
|
|
42112
|
-
}), hasMore && /* @__PURE__ */ import_react27.default.createElement(Box_default, {
|
|
42113
|
-
marginTop: 1
|
|
42114
|
-
}, /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
41767
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42115
41768
|
dimColor: true
|
|
42116
|
-
}, "
|
|
41769
|
+
}, "Current: ", currentDir)), /* @__PURE__ */ import_react26.default.createElement(SelectList, {
|
|
41770
|
+
items,
|
|
41771
|
+
onSelect,
|
|
41772
|
+
limit: 15
|
|
41773
|
+
}));
|
|
42117
41774
|
};
|
|
42118
41775
|
var NamingForm = ({
|
|
42119
41776
|
relativePath,
|
|
@@ -42121,38 +41778,38 @@ var NamingForm = ({
|
|
|
42121
41778
|
onChangeName,
|
|
42122
41779
|
onSubmit
|
|
42123
41780
|
}) => {
|
|
42124
|
-
return /* @__PURE__ */
|
|
41781
|
+
return /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42125
41782
|
flexDirection: "column"
|
|
42126
|
-
}, /* @__PURE__ */
|
|
41783
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42127
41784
|
marginBottom: 1
|
|
42128
|
-
}, /* @__PURE__ */
|
|
41785
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42129
41786
|
bold: true,
|
|
42130
41787
|
color: "cyan"
|
|
42131
|
-
}, "\uD83D\uDCCC Register Template")), /* @__PURE__ */
|
|
41788
|
+
}, "\uD83D\uDCCC Register Template")), /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42132
41789
|
marginBottom: 1
|
|
42133
|
-
}, /* @__PURE__ */
|
|
41790
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, null, "File: "), /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42134
41791
|
color: "green"
|
|
42135
|
-
}, relativePath)), /* @__PURE__ */
|
|
41792
|
+
}, relativePath)), /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42136
41793
|
marginBottom: 1
|
|
42137
|
-
}, /* @__PURE__ */
|
|
41794
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, null, "Template name: "), /* @__PURE__ */ import_react26.default.createElement(build_default, {
|
|
42138
41795
|
value: templateName,
|
|
42139
41796
|
onChange: onChangeName,
|
|
42140
41797
|
onSubmit
|
|
42141
|
-
})), /* @__PURE__ */
|
|
41798
|
+
})), /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42142
41799
|
dimColor: true
|
|
42143
41800
|
}, "[Enter] Register [Esc] Cancel"));
|
|
42144
41801
|
};
|
|
42145
41802
|
var RegisteringStatus = () => {
|
|
42146
|
-
return /* @__PURE__ */
|
|
41803
|
+
return /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42147
41804
|
flexDirection: "column"
|
|
42148
|
-
}, /* @__PURE__ */
|
|
41805
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, {
|
|
42149
41806
|
color: "yellow"
|
|
42150
41807
|
}, "Registering..."));
|
|
42151
41808
|
};
|
|
42152
41809
|
var DoneStatus = ({ message }) => {
|
|
42153
|
-
return /* @__PURE__ */
|
|
41810
|
+
return /* @__PURE__ */ import_react26.default.createElement(Box_default, {
|
|
42154
41811
|
flexDirection: "column"
|
|
42155
|
-
}, /* @__PURE__ */
|
|
41812
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Text, null, message));
|
|
42156
41813
|
};
|
|
42157
41814
|
|
|
42158
41815
|
// src/App.tsx
|
|
@@ -42163,30 +41820,30 @@ var App2 = () => {
|
|
|
42163
41820
|
process.exit(0);
|
|
42164
41821
|
}
|
|
42165
41822
|
});
|
|
42166
|
-
return /* @__PURE__ */
|
|
41823
|
+
return /* @__PURE__ */ import_react27.default.createElement(Box_default, {
|
|
42167
41824
|
flexDirection: "column",
|
|
42168
41825
|
padding: 1
|
|
42169
|
-
}, /* @__PURE__ */
|
|
41826
|
+
}, /* @__PURE__ */ import_react27.default.createElement(Box_default, {
|
|
42170
41827
|
marginBottom: 1,
|
|
42171
41828
|
flexDirection: "row",
|
|
42172
41829
|
justifyContent: "space-between",
|
|
42173
41830
|
alignItems: "center"
|
|
42174
|
-
}, /* @__PURE__ */
|
|
41831
|
+
}, /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42175
41832
|
bold: true,
|
|
42176
41833
|
color: "cyan"
|
|
42177
|
-
}, "copit - Template Manager"), /* @__PURE__ */
|
|
41834
|
+
}, "copit - Template Manager"), /* @__PURE__ */ import_react27.default.createElement(Box_default, {
|
|
42178
41835
|
flexDirection: "row"
|
|
42179
|
-
}, /* @__PURE__ */
|
|
41836
|
+
}, /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42180
41837
|
color: view === "templates" ? "cyan" : "gray"
|
|
42181
|
-
}, "\uD83D\uDCCB Templates"), /* @__PURE__ */
|
|
41838
|
+
}, "\uD83D\uDCCB Templates"), /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42182
41839
|
dimColor: true
|
|
42183
|
-
}, " | "), /* @__PURE__ */
|
|
41840
|
+
}, " | "), /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42184
41841
|
color: view === "register" ? "cyan" : "gray"
|
|
42185
|
-
}, "\uD83D\uDCCC Register"))), /* @__PURE__ */
|
|
41842
|
+
}, "\uD83D\uDCCC Register"))), /* @__PURE__ */ import_react27.default.createElement(Box_default, {
|
|
42186
41843
|
borderStyle: "single",
|
|
42187
41844
|
flexDirection: "column",
|
|
42188
41845
|
padding: 1
|
|
42189
|
-
}, view === "templates" && /* @__PURE__ */
|
|
41846
|
+
}, 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
41847
|
items: [
|
|
42191
41848
|
{ key: "↑/↓", label: "navigate" },
|
|
42192
41849
|
{ key: "Enter", label: view === "register" ? "select" : "copy" },
|
|
@@ -42198,21 +41855,21 @@ var App2 = () => {
|
|
|
42198
41855
|
};
|
|
42199
41856
|
var HelpBar = ({ items }) => {
|
|
42200
41857
|
const visibleItems = items.filter((item) => item.show !== false);
|
|
42201
|
-
return /* @__PURE__ */
|
|
41858
|
+
return /* @__PURE__ */ import_react27.default.createElement(Box_default, {
|
|
42202
41859
|
marginTop: 1
|
|
42203
|
-
}, visibleItems.map((item, index) => /* @__PURE__ */
|
|
41860
|
+
}, visibleItems.map((item, index) => /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, {
|
|
42204
41861
|
key: item.key
|
|
42205
|
-
}, index > 0 && /* @__PURE__ */
|
|
41862
|
+
}, index > 0 && /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42206
41863
|
dimColor: true
|
|
42207
|
-
}, " • "), /* @__PURE__ */
|
|
41864
|
+
}, " • "), /* @__PURE__ */ import_react27.default.createElement(Text, null, /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42208
41865
|
color: "cyan"
|
|
42209
|
-
}, item.key), /* @__PURE__ */
|
|
41866
|
+
}, item.key), /* @__PURE__ */ import_react27.default.createElement(Text, {
|
|
42210
41867
|
dimColor: true
|
|
42211
41868
|
}, " ", item.label)))));
|
|
42212
41869
|
};
|
|
42213
41870
|
|
|
42214
41871
|
// src/index.tsx
|
|
42215
|
-
var app = render_default(/* @__PURE__ */
|
|
41872
|
+
var app = render_default(/* @__PURE__ */ import_react28.default.createElement(Provider, null, /* @__PURE__ */ import_react28.default.createElement(App2, null)));
|
|
42216
41873
|
process.on("SIGINT", () => {
|
|
42217
41874
|
app.unmount();
|
|
42218
41875
|
process.exit(0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "copit",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
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"
|