@wix/cli-app 1.1.60 → 1.1.62
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/build/{CreateVersionCommand-Z6F5IKH5.js → CreateVersionCommand-IEF6U34E.js} +15 -15
- package/build/{DevCommand-YFEZ4QV5.js → DevCommand-SOODXUEP.js} +438 -299
- package/build/DevCommand-SOODXUEP.js.map +1 -0
- package/build/{GenerateCommand-KCV4YDNN.js → GenerateCommand-ARNW73TM.js} +108 -43
- package/build/{GenerateCommand-KCV4YDNN.js.map → GenerateCommand-ARNW73TM.js.map} +1 -1
- package/build/{LogsCommand-VBMGVYNU.js → LogsCommand-7TW36YZX.js} +5 -5
- package/build/PreviewCommand-ZZKRP2GF.js +23 -0
- package/build/{ReleaseCommand-5F3FPBXT.js → ReleaseCommand-SB2WWSVP.js} +15 -15
- package/build/{ServeCommand-G4FF4PT3.js → ServeCommand-GZKF6AN3.js} +14 -14
- package/build/{build-XZI3USNB.js → build-LHCSCFBM.js} +38 -9
- package/build/build-LHCSCFBM.js.map +1 -0
- package/build/{chunk-QVGYU6D4.js → chunk-2DRVDGHR.js} +5 -5
- package/build/chunk-2DRVDGHR.js.map +1 -0
- package/build/{chunk-USAOCISL.js → chunk-4WKSS3PU.js} +4 -4
- package/build/{chunk-CNZ3Q5PF.js → chunk-5R5H3Y2D.js} +105 -161
- package/build/chunk-5R5H3Y2D.js.map +1 -0
- package/build/chunk-6IX6CDWB.js +27644 -0
- package/build/chunk-6IX6CDWB.js.map +1 -0
- package/build/{chunk-VZJZSWRE.js → chunk-6US7335E.js} +3 -3
- package/build/{chunk-WRWNJYKZ.js → chunk-A3FHJ4EK.js} +3 -3
- package/build/{chunk-PKSGXFYA.js → chunk-HKX5ODUN.js} +3 -3
- package/build/{chunk-HUWYF2ET.js → chunk-KCNEUOW2.js} +8 -8
- package/build/{chunk-O42QDBJU.js → chunk-KJR4P55M.js} +3 -3
- package/build/{chunk-5QZS3HT7.js → chunk-KVM6MGID.js} +3 -3
- package/build/{chunk-VXE3IWKR.js → chunk-LMFNRK6X.js} +2 -2
- package/build/{chunk-DGTJGIY2.js → chunk-LULKQBSP.js} +5125 -2917
- package/build/chunk-LULKQBSP.js.map +1 -0
- package/build/{chunk-IG6IV6VM.js → chunk-MTEB33GR.js} +3 -3
- package/build/{chunk-36W5H7IG.js → chunk-PM4M3SGC.js} +195 -177
- package/build/chunk-PM4M3SGC.js.map +1 -0
- package/build/{chunk-4VTDNX5T.js → chunk-UE7LDQKD.js} +2 -2
- package/build/{chunk-2PTCXTKF.js → chunk-UZXKDHQZ.js} +5 -5
- package/build/{chunk-WRPV7SLY.js → chunk-V75TFIXI.js} +193 -20
- package/build/chunk-V75TFIXI.js.map +1 -0
- package/build/{chunk-7CGRTCDC.js → chunk-YW2RBPPY.js} +3 -3
- package/build/{chunk-QZOQAFHK.js → chunk-ZR3N5INU.js} +8 -8
- package/build/chunk-ZR3N5INU.js.map +1 -0
- package/build/cloudflare-runtime/entry.js +7157 -52
- package/build/cloudflare-runtime/getRegisteredExtensions.js +7095 -15
- package/build/index.js +20 -20
- package/build/platform-sdk/chunk-3U6QUCP3.js +2 -0
- package/build/platform-sdk/chunk-3U6QUCP3.js.map +1 -0
- package/build/platform-sdk/{chunk-QV4VBCJB.js → chunk-FLUCZ5U6.js} +2 -2
- package/build/platform-sdk/chunk-VXQAZIAE.js +2 -0
- package/build/platform-sdk/{chunk-EERHWVVD.js.map → chunk-VXQAZIAE.js.map} +1 -1
- package/build/platform-sdk/chunk-ZM5O3GFB.js +2 -0
- package/build/platform-sdk/chunk-ZM5O3GFB.js.map +1 -0
- package/build/platform-sdk/dashboard.js +1 -1
- package/build/platform-sdk/dashboard.js.map +1 -1
- package/build/platform-sdk/editor.js +2 -2
- package/build/platform-sdk/editor.js.map +1 -1
- package/build/platform-sdk/sdk-context.js +1 -1
- package/build/platform-sdk/sdk-context.js.map +1 -1
- package/build/platform-sdk/site.js +1 -1
- package/build/platform-sdk/site.js.map +1 -1
- package/build/platform-sdk/web-methods.js +1 -1
- package/build/platform-sdk/web-methods.js.map +1 -1
- package/build/{preview-VAHHFTRZ.js → preview-ZAKEXAJH.js} +13 -13
- package/build/{render-command-3AYSQXHN.js → render-command-XMQH723O.js} +6 -6
- package/package.json +8 -6
- package/schemas/custom-element.json +1 -1
- package/templates/custom-element/files/element.module.css.ejs +18 -5
- package/templates/custom-element/files/element.tsx.ejs +8 -5
- package/templates/custom-element/files/panel.tsx.ejs +25 -12
- package/templates/web-method/dependencies.json +5 -0
- package/templates/web-method/files/placeholder.ts.ejs +9 -2
- package/build/DevCommand-YFEZ4QV5.js.map +0 -1
- package/build/PreviewCommand-3OMHWDW6.js +0 -23
- package/build/build-XZI3USNB.js.map +0 -1
- package/build/chunk-36W5H7IG.js.map +0 -1
- package/build/chunk-CNZ3Q5PF.js.map +0 -1
- package/build/chunk-DGTJGIY2.js.map +0 -1
- package/build/chunk-FTC5AK3Y.js +0 -1367
- package/build/chunk-FTC5AK3Y.js.map +0 -1
- package/build/chunk-QVGYU6D4.js.map +0 -1
- package/build/chunk-QZOQAFHK.js.map +0 -1
- package/build/chunk-WRPV7SLY.js.map +0 -1
- package/build/platform-sdk/chunk-42XIZ4MH.js +0 -2
- package/build/platform-sdk/chunk-42XIZ4MH.js.map +0 -1
- package/build/platform-sdk/chunk-7EYXEF6M.js +0 -2
- package/build/platform-sdk/chunk-7EYXEF6M.js.map +0 -1
- package/build/platform-sdk/chunk-EERHWVVD.js +0 -2
- /package/build/{CreateVersionCommand-Z6F5IKH5.js.map → CreateVersionCommand-IEF6U34E.js.map} +0 -0
- /package/build/{LogsCommand-VBMGVYNU.js.map → LogsCommand-7TW36YZX.js.map} +0 -0
- /package/build/{PreviewCommand-3OMHWDW6.js.map → PreviewCommand-ZZKRP2GF.js.map} +0 -0
- /package/build/{ReleaseCommand-5F3FPBXT.js.map → ReleaseCommand-SB2WWSVP.js.map} +0 -0
- /package/build/{ServeCommand-G4FF4PT3.js.map → ServeCommand-GZKF6AN3.js.map} +0 -0
- /package/build/{chunk-USAOCISL.js.map → chunk-4WKSS3PU.js.map} +0 -0
- /package/build/{chunk-VZJZSWRE.js.map → chunk-6US7335E.js.map} +0 -0
- /package/build/{chunk-WRWNJYKZ.js.map → chunk-A3FHJ4EK.js.map} +0 -0
- /package/build/{chunk-PKSGXFYA.js.map → chunk-HKX5ODUN.js.map} +0 -0
- /package/build/{chunk-HUWYF2ET.js.map → chunk-KCNEUOW2.js.map} +0 -0
- /package/build/{chunk-O42QDBJU.js.map → chunk-KJR4P55M.js.map} +0 -0
- /package/build/{chunk-5QZS3HT7.js.map → chunk-KVM6MGID.js.map} +0 -0
- /package/build/{chunk-VXE3IWKR.js.map → chunk-LMFNRK6X.js.map} +0 -0
- /package/build/{chunk-IG6IV6VM.js.map → chunk-MTEB33GR.js.map} +0 -0
- /package/build/{chunk-4VTDNX5T.js.map → chunk-UE7LDQKD.js.map} +0 -0
- /package/build/{chunk-2PTCXTKF.js.map → chunk-UZXKDHQZ.js.map} +0 -0
- /package/build/{chunk-7CGRTCDC.js.map → chunk-YW2RBPPY.js.map} +0 -0
- /package/build/platform-sdk/{chunk-QV4VBCJB.js.map → chunk-FLUCZ5U6.js.map} +0 -0
- /package/build/{preview-VAHHFTRZ.js.map → preview-ZAKEXAJH.js.map} +0 -0
- /package/build/{render-command-3AYSQXHN.js.map → render-command-XMQH723O.js.map} +0 -0
|
@@ -11518,7 +11518,7 @@ var init_tslib_es6 = __esm({
|
|
|
11518
11518
|
});
|
|
11519
11519
|
|
|
11520
11520
|
// package.json
|
|
11521
|
-
var version = "1.1.
|
|
11521
|
+
var version = "1.1.62";
|
|
11522
11522
|
|
|
11523
11523
|
// ../cli-error/src/cli-error.ts
|
|
11524
11524
|
init_esm_shims();
|
|
@@ -11574,12 +11574,14 @@ var CliSystemErrorCode = (0, import_variant.variant)({
|
|
|
11574
11574
|
FailedToGetAppSecret: {},
|
|
11575
11575
|
FailedToCreateTunnel: {},
|
|
11576
11576
|
FailedToDeleteTunnel: {},
|
|
11577
|
+
FailedToGetBlocksExtensionsData: {},
|
|
11577
11578
|
GridAppFailedToUpdateFiles: {},
|
|
11578
11579
|
FailedToCreateGridApp: (0, import_variant.fields)(),
|
|
11579
11580
|
InvalidResponseData: {},
|
|
11580
11581
|
InvalidCreateAppResponse: {},
|
|
11581
11582
|
InvalidDeployAppResponse: {},
|
|
11582
11583
|
InvalidGetDeploymentResponse: {},
|
|
11584
|
+
InvalidGetDeploymentPipelineDescriptionResponse: {},
|
|
11583
11585
|
FailedToGetPagesDiff: {},
|
|
11584
11586
|
InvalidViteBuildOutput: {},
|
|
11585
11587
|
ViteModuleBundleNotFound: {},
|
|
@@ -11602,11 +11604,12 @@ var CliSystemErrorCode = (0, import_variant.variant)({
|
|
|
11602
11604
|
FailedToQuerySites: {},
|
|
11603
11605
|
FailedToGetSite: {},
|
|
11604
11606
|
FailedToDeploySite: {},
|
|
11607
|
+
FailedToDeploySitePreview: {},
|
|
11605
11608
|
FailedToPublishDeployment: {},
|
|
11606
11609
|
FailedToMarkDeploymentAsPermanent: {},
|
|
11607
|
-
|
|
11610
|
+
FailedToGetAppInstallationDetails: (0, import_variant.fields)(),
|
|
11608
11611
|
TypeErrorInvalidUrl: {},
|
|
11609
|
-
|
|
11612
|
+
FailedToGenerateSelfSignedCertificate: {},
|
|
11610
11613
|
FailedToResolveViteOrigin: {},
|
|
11611
11614
|
AppReleaseConfigViolations: (0, import_variant.fields)(),
|
|
11612
11615
|
FailedToCreateAppRelease: {},
|
|
@@ -11617,7 +11620,7 @@ var CliSystemErrorCode = (0, import_variant.variant)({
|
|
|
11617
11620
|
FailedToFetchPackageDetails: {},
|
|
11618
11621
|
FailedToCreateSiteOverride: {},
|
|
11619
11622
|
FailedToGetDeploymentStatus: {},
|
|
11620
|
-
|
|
11623
|
+
FailedToGetDeploymentPipelineDescription: {},
|
|
11621
11624
|
FailedToGenerateAppMarketQueryParam: {},
|
|
11622
11625
|
InvalidDependenciesJsonSchemaError: (0, import_variant.fields)(),
|
|
11623
11626
|
FailedToParseLog: {},
|
|
@@ -11637,7 +11640,12 @@ var CliSystemErrorCode = (0, import_variant.variant)({
|
|
|
11637
11640
|
FailedToCreateVeloApp: {},
|
|
11638
11641
|
FailedToUpdateVeloAppFiles: {},
|
|
11639
11642
|
FailedToGetFilesFromVelo: {},
|
|
11640
|
-
FailedToSyncPagesTypes: {}
|
|
11643
|
+
FailedToSyncPagesTypes: {},
|
|
11644
|
+
FailedToCreateDraftVersion: {},
|
|
11645
|
+
FailedToReleaseDraftVersion: {},
|
|
11646
|
+
FailedToDeployDocument: {},
|
|
11647
|
+
WaitForEditorInstallationStateFailure: {},
|
|
11648
|
+
EditorPendingInstallationCheckTimedout: {}
|
|
11641
11649
|
});
|
|
11642
11650
|
var CliUserErrorCode = (0, import_variant.variant)({
|
|
11643
11651
|
LatestVersionOfCreateAppRequired: (0, import_variant.fields)(),
|
|
@@ -11678,7 +11686,7 @@ var CliUserErrorCode = (0, import_variant.variant)({
|
|
|
11678
11686
|
SiteSelectorTimedout: {},
|
|
11679
11687
|
FailedToReadProjectFiles: {},
|
|
11680
11688
|
FailedToCreateVersionForSubmittedApp: {},
|
|
11681
|
-
|
|
11689
|
+
GridAppFilesMaxLengthExceeded: (0, import_variant.fields)(),
|
|
11682
11690
|
DeviceCodeTimedOut: {},
|
|
11683
11691
|
DuplicateComponentIdsError: (0, import_variant.fields)(),
|
|
11684
11692
|
FailedToSaveDevelopmentSite: (0, import_variant.fields)(),
|
|
@@ -11730,7 +11738,9 @@ var CliUserErrorCode = (0, import_variant.variant)({
|
|
|
11730
11738
|
FailedToCreateIntellisenseAdapter: {},
|
|
11731
11739
|
FailedToInitIntellisenseAdapterTypes: {},
|
|
11732
11740
|
FailedToUpdateIntellisenseAdapterTypes: {},
|
|
11733
|
-
WebMethodOutsideOfProjectDirectory: (0, import_variant.fields)()
|
|
11741
|
+
WebMethodOutsideOfProjectDirectory: (0, import_variant.fields)(),
|
|
11742
|
+
FailedToEvalBackendExtension: (0, import_variant.fields)(),
|
|
11743
|
+
DeploymentPipelineFailed: (0, import_variant.fields)()
|
|
11734
11744
|
});
|
|
11735
11745
|
var CliErrorCode = (0, import_variant.variant)({
|
|
11736
11746
|
...CliSystemErrorCode,
|
|
@@ -20642,13 +20652,13 @@ var testOverridesSchema = z.object({
|
|
|
20642
20652
|
devEditorBaseUrl: z.string().url().optional(),
|
|
20643
20653
|
inkDebug: z.boolean().optional(),
|
|
20644
20654
|
minRetryTimeout: z.number().optional(),
|
|
20655
|
+
pollInterval: z.number().optional(),
|
|
20645
20656
|
debounceQueueWait: z.number().optional(),
|
|
20646
20657
|
sentryDsn: z.string().optional(),
|
|
20647
20658
|
userBrowserTestEndpoint: z.string().url().optional(),
|
|
20648
20659
|
dataDir: z.string().optional(),
|
|
20649
20660
|
wixCliDependencyVersion: z.string().optional(),
|
|
20650
20661
|
wixCliAppDependencyVersion: z.string().optional(),
|
|
20651
|
-
appInstallationPollInterval: z.number().optional(),
|
|
20652
20662
|
disableTTY: z.boolean().optional(),
|
|
20653
20663
|
waitForLoginInterval: z.number().optional(),
|
|
20654
20664
|
registryUrl: z.string().optional(),
|
|
@@ -20790,7 +20800,7 @@ init_esm_shims();
|
|
|
20790
20800
|
|
|
20791
20801
|
// ../cli-ui-kit/src/components/ConfirmInput/ConfirmInput.tsx
|
|
20792
20802
|
init_esm_shims();
|
|
20793
|
-
var
|
|
20803
|
+
var import_react39 = __toESM(require_react(), 1);
|
|
20794
20804
|
var import_variant6 = __toESM(require_lib(), 1);
|
|
20795
20805
|
|
|
20796
20806
|
// ../cli-ui-kit/src/components/Text.tsx
|
|
@@ -20837,7 +20847,7 @@ var InputState = (0, import_variant4.variant)(
|
|
|
20837
20847
|
|
|
20838
20848
|
// ../cli-ui-kit/src/components/InputLabel.tsx
|
|
20839
20849
|
init_esm_shims();
|
|
20840
|
-
var
|
|
20850
|
+
var import_react35 = __toESM(require_react(), 1);
|
|
20841
20851
|
|
|
20842
20852
|
// ../cli-ui-kit/src/icons/index.ts
|
|
20843
20853
|
init_esm_shims();
|
|
@@ -20916,36 +20926,43 @@ var InsightIcon = () => {
|
|
|
20916
20926
|
return /* @__PURE__ */ import_react33.default.createElement(Text2, null, isUnicodeSupported() ? "\u{1F4A1}" : "!");
|
|
20917
20927
|
};
|
|
20918
20928
|
|
|
20929
|
+
// ../cli-ui-kit/src/icons/Learn.tsx
|
|
20930
|
+
init_esm_shims();
|
|
20931
|
+
var import_react34 = __toESM(require_react(), 1);
|
|
20932
|
+
var Learn = () => {
|
|
20933
|
+
return /* @__PURE__ */ import_react34.default.createElement(Text2, null, isUnicodeSupported() ? "\u{1F4DA}" : ">");
|
|
20934
|
+
};
|
|
20935
|
+
|
|
20919
20936
|
// ../cli-ui-kit/src/components/InputLabel.tsx
|
|
20920
20937
|
var InputLabel = ({ children, icon }) => {
|
|
20921
|
-
return /* @__PURE__ */
|
|
20938
|
+
return /* @__PURE__ */ import_react35.default.createElement(Text2, null, icon ?? /* @__PURE__ */ import_react35.default.createElement(Text2, { skin: "question", bold: true }, /* @__PURE__ */ import_react35.default.createElement(QuestionMarkIcon, null)), " ", /* @__PURE__ */ import_react35.default.createElement(Text2, { skin: "question", bold: true }, children));
|
|
20922
20939
|
};
|
|
20923
20940
|
|
|
20924
20941
|
// ../cli-ui-kit/src/components/ConfirmInput/Placeholder.tsx
|
|
20925
20942
|
init_esm_shims();
|
|
20926
|
-
var
|
|
20943
|
+
var import_react36 = __toESM(require_react(), 1);
|
|
20927
20944
|
var import_variant5 = __toESM(require_lib(), 1);
|
|
20928
20945
|
var Placeholder = ({ inputState }) => {
|
|
20929
20946
|
return (0, import_variant5.match)(inputState, {
|
|
20930
|
-
NotSubmitted: ({ value: value2 }) => /* @__PURE__ */
|
|
20931
|
-
Submitted: ({ value: value2 }) => /* @__PURE__ */
|
|
20947
|
+
NotSubmitted: ({ value: value2 }) => /* @__PURE__ */ import_react36.default.createElement(Text2, { skin: "secondary" }, "(", value2 ? "Y/n" : "y/N", ")"),
|
|
20948
|
+
Submitted: ({ value: value2 }) => /* @__PURE__ */ import_react36.default.createElement(Text2, null, value2 ? "Yes" : "No")
|
|
20932
20949
|
});
|
|
20933
20950
|
};
|
|
20934
20951
|
|
|
20935
20952
|
// ../cli-ui-kit/src/components/ConfirmInput/Input.tsx
|
|
20936
20953
|
init_esm_shims();
|
|
20937
|
-
var
|
|
20954
|
+
var import_react38 = __toESM(require_react(), 1);
|
|
20938
20955
|
|
|
20939
20956
|
// ../../node_modules/ink-text-input/build/index.js
|
|
20940
20957
|
init_esm_shims();
|
|
20941
|
-
var
|
|
20958
|
+
var import_react37 = __toESM(require_react(), 1);
|
|
20942
20959
|
function TextInput({ value: originalValue, placeholder = "", focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit }) {
|
|
20943
|
-
const [state, setState] = (0,
|
|
20960
|
+
const [state, setState] = (0, import_react37.useState)({
|
|
20944
20961
|
cursorOffset: (originalValue || "").length,
|
|
20945
20962
|
cursorWidth: 0
|
|
20946
20963
|
});
|
|
20947
20964
|
const { cursorOffset, cursorWidth } = state;
|
|
20948
|
-
(0,
|
|
20965
|
+
(0, import_react37.useEffect)(() => {
|
|
20949
20966
|
setState((previousState) => {
|
|
20950
20967
|
if (!focus || !showCursor) {
|
|
20951
20968
|
return previousState;
|
|
@@ -21023,13 +21040,13 @@ function TextInput({ value: originalValue, placeholder = "", focus = true, mask,
|
|
|
21023
21040
|
onChange(nextValue);
|
|
21024
21041
|
}
|
|
21025
21042
|
}, { isActive: focus });
|
|
21026
|
-
return
|
|
21043
|
+
return import_react37.default.createElement(Text, null, placeholder ? value2.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
|
|
21027
21044
|
}
|
|
21028
21045
|
var build_default = TextInput;
|
|
21029
21046
|
|
|
21030
21047
|
// ../cli-ui-kit/src/components/ConfirmInput/Input.tsx
|
|
21031
21048
|
var Input = ({ initialValue, onSubmit }) => {
|
|
21032
|
-
const handleChange = (0,
|
|
21049
|
+
const handleChange = (0, import_react38.useCallback)(
|
|
21033
21050
|
(rawKey) => {
|
|
21034
21051
|
const key = rawKey.toLowerCase();
|
|
21035
21052
|
if (["y", "n"].includes(key)) {
|
|
@@ -21038,7 +21055,7 @@ var Input = ({ initialValue, onSubmit }) => {
|
|
|
21038
21055
|
},
|
|
21039
21056
|
[onSubmit]
|
|
21040
21057
|
);
|
|
21041
|
-
return /* @__PURE__ */
|
|
21058
|
+
return /* @__PURE__ */ import_react38.default.createElement(
|
|
21042
21059
|
build_default,
|
|
21043
21060
|
{
|
|
21044
21061
|
value: "",
|
|
@@ -21056,17 +21073,17 @@ var ConfirmInput = ({
|
|
|
21056
21073
|
initialValue = true,
|
|
21057
21074
|
onSubmit
|
|
21058
21075
|
}) => {
|
|
21059
|
-
const [inputState, setInputState] = (0,
|
|
21076
|
+
const [inputState, setInputState] = (0, import_react39.useState)(
|
|
21060
21077
|
() => InputState.NotSubmitted(initialValue)
|
|
21061
21078
|
);
|
|
21062
|
-
const handleSubmit = (0,
|
|
21079
|
+
const handleSubmit = (0, import_react39.useCallback)(
|
|
21063
21080
|
(value2) => {
|
|
21064
21081
|
setInputState(InputState.Submitted(value2));
|
|
21065
21082
|
onSubmit(value2);
|
|
21066
21083
|
},
|
|
21067
21084
|
[onSubmit]
|
|
21068
21085
|
);
|
|
21069
|
-
return /* @__PURE__ */
|
|
21086
|
+
return /* @__PURE__ */ import_react39.default.createElement(Text2, null, /* @__PURE__ */ import_react39.default.createElement(InputLabel, null, label), " ", info && (0, import_variant6.isType)(inputState, InputState.NotSubmitted) && /* @__PURE__ */ import_react39.default.createElement(Text2, { skin: "secondary" }, info, " "), /* @__PURE__ */ import_react39.default.createElement(Placeholder, { inputState }), (0, import_variant6.isType)(inputState, InputState.NotSubmitted) && /* @__PURE__ */ import_react39.default.createElement(Input, { initialValue, onSubmit: handleSubmit }));
|
|
21070
21087
|
};
|
|
21071
21088
|
|
|
21072
21089
|
// ../cli-ui-kit/src/components/SelectInput/index.ts
|
|
@@ -21074,7 +21091,7 @@ init_esm_shims();
|
|
|
21074
21091
|
|
|
21075
21092
|
// ../cli-ui-kit/src/components/SelectInput/SelectInput.tsx
|
|
21076
21093
|
init_esm_shims();
|
|
21077
|
-
var
|
|
21094
|
+
var import_react46 = __toESM(require_react(), 1);
|
|
21078
21095
|
var import_variant10 = __toESM(require_lib(), 1);
|
|
21079
21096
|
|
|
21080
21097
|
// ../../node_modules/ink-select-input/build/index.js
|
|
@@ -21082,7 +21099,7 @@ init_esm_shims();
|
|
|
21082
21099
|
|
|
21083
21100
|
// ../../node_modules/ink-select-input/build/Indicator.js
|
|
21084
21101
|
init_esm_shims();
|
|
21085
|
-
var
|
|
21102
|
+
var import_react40 = __toESM(require_react(), 1);
|
|
21086
21103
|
|
|
21087
21104
|
// ../../node_modules/figures/index.js
|
|
21088
21105
|
init_esm_shims();
|
|
@@ -21377,39 +21394,39 @@ var figures_default = figures;
|
|
|
21377
21394
|
|
|
21378
21395
|
// ../../node_modules/ink-select-input/build/Indicator.js
|
|
21379
21396
|
function Indicator({ isSelected = false }) {
|
|
21380
|
-
return
|
|
21397
|
+
return import_react40.default.createElement(Box_default, { marginRight: 1 }, isSelected ? import_react40.default.createElement(Text, { color: "blue" }, figures_default.pointer) : import_react40.default.createElement(Text, null, " "));
|
|
21381
21398
|
}
|
|
21382
21399
|
var Indicator_default = Indicator;
|
|
21383
21400
|
|
|
21384
21401
|
// ../../node_modules/ink-select-input/build/Item.js
|
|
21385
21402
|
init_esm_shims();
|
|
21386
|
-
var
|
|
21403
|
+
var React28 = __toESM(require_react(), 1);
|
|
21387
21404
|
function Item({ isSelected = false, label }) {
|
|
21388
|
-
return
|
|
21405
|
+
return React28.createElement(Text, { color: isSelected ? "blue" : void 0 }, label);
|
|
21389
21406
|
}
|
|
21390
21407
|
var Item_default = Item;
|
|
21391
21408
|
|
|
21392
21409
|
// ../../node_modules/ink-select-input/build/SelectInput.js
|
|
21393
21410
|
init_esm_shims();
|
|
21394
|
-
var import_react40 = __toESM(require_react(), 1);
|
|
21395
21411
|
var import_react41 = __toESM(require_react(), 1);
|
|
21412
|
+
var import_react42 = __toESM(require_react(), 1);
|
|
21396
21413
|
var import_lodash = __toESM(require_lodash(), 1);
|
|
21397
21414
|
var import_arr_rotate = __toESM(require_arr_rotate(), 1);
|
|
21398
21415
|
function SelectInput({ items = [], isFocused = true, initialIndex = 0, indicatorComponent = Indicator_default, itemComponent = Item_default, limit: customLimit, onSelect, onHighlight }) {
|
|
21399
21416
|
const hasLimit = typeof customLimit === "number" && items.length > customLimit;
|
|
21400
21417
|
const limit = hasLimit ? Math.min(customLimit, items.length) : items.length;
|
|
21401
21418
|
const lastIndex = limit - 1;
|
|
21402
|
-
const [rotateIndex, setRotateIndex] = (0,
|
|
21403
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
21404
|
-
const previousItems = (0,
|
|
21405
|
-
(0,
|
|
21419
|
+
const [rotateIndex, setRotateIndex] = (0, import_react42.useState)(initialIndex > lastIndex ? lastIndex - initialIndex : 0);
|
|
21420
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react42.useState)(initialIndex ? initialIndex > lastIndex ? lastIndex : initialIndex : 0);
|
|
21421
|
+
const previousItems = (0, import_react42.useRef)(items);
|
|
21422
|
+
(0, import_react42.useEffect)(() => {
|
|
21406
21423
|
if (!(0, import_lodash.default)(previousItems.current.map((item) => item.value), items.map((item) => item.value))) {
|
|
21407
21424
|
setRotateIndex(0);
|
|
21408
21425
|
setSelectedIndex(0);
|
|
21409
21426
|
}
|
|
21410
21427
|
previousItems.current = items;
|
|
21411
21428
|
}, [items]);
|
|
21412
|
-
use_input_default((0,
|
|
21429
|
+
use_input_default((0, import_react42.useCallback)((input, key) => {
|
|
21413
21430
|
if (input === "k" || key.upArrow) {
|
|
21414
21431
|
const lastIndex2 = (hasLimit ? limit : items.length) - 1;
|
|
21415
21432
|
const atFirstIndex = selectedIndex === 0;
|
|
@@ -21451,15 +21468,15 @@ function SelectInput({ items = [], isFocused = true, initialIndex = 0, indicator
|
|
|
21451
21468
|
onHighlight
|
|
21452
21469
|
]), { isActive: isFocused });
|
|
21453
21470
|
const slicedItems = hasLimit ? (0, import_arr_rotate.default)(items, rotateIndex).slice(0, limit) : items;
|
|
21454
|
-
return
|
|
21471
|
+
return import_react41.default.createElement(Box_default, { flexDirection: "column" }, slicedItems.map((item, index) => {
|
|
21455
21472
|
const isSelected = index === selectedIndex;
|
|
21456
21473
|
return (
|
|
21457
21474
|
// @ts-expect-error - `key` can't be optional but `item.value` is generic T
|
|
21458
|
-
|
|
21475
|
+
import_react41.default.createElement(
|
|
21459
21476
|
Box_default,
|
|
21460
21477
|
{ key: item.key ?? item.value },
|
|
21461
|
-
|
|
21462
|
-
|
|
21478
|
+
import_react41.default.createElement(indicatorComponent, { isSelected }),
|
|
21479
|
+
import_react41.default.createElement(itemComponent, { ...item, isSelected })
|
|
21463
21480
|
)
|
|
21464
21481
|
);
|
|
21465
21482
|
}));
|
|
@@ -21468,14 +21485,14 @@ var SelectInput_default = SelectInput;
|
|
|
21468
21485
|
|
|
21469
21486
|
// ../cli-ui-kit/src/components/SelectInput/Indicator.tsx
|
|
21470
21487
|
init_esm_shims();
|
|
21471
|
-
var
|
|
21488
|
+
var import_react43 = __toESM(require_react(), 1);
|
|
21472
21489
|
var Indicator2 = ({ isSelected }) => {
|
|
21473
|
-
return /* @__PURE__ */
|
|
21490
|
+
return /* @__PURE__ */ import_react43.default.createElement(Box_default, { width: 2 }, /* @__PURE__ */ import_react43.default.createElement(Text2, { skin: "info" }, /* @__PURE__ */ import_react43.default.createElement(RadioIcon, { selected: isSelected })));
|
|
21474
21491
|
};
|
|
21475
21492
|
|
|
21476
21493
|
// ../cli-ui-kit/src/components/SelectInput/Item.tsx
|
|
21477
21494
|
init_esm_shims();
|
|
21478
|
-
var
|
|
21495
|
+
var import_react44 = __toESM(require_react(), 1);
|
|
21479
21496
|
var import_variant8 = __toESM(require_lib(), 1);
|
|
21480
21497
|
|
|
21481
21498
|
// ../cli-ui-kit/src/components/SelectInput/types.ts
|
|
@@ -21493,7 +21510,7 @@ function Item2({
|
|
|
21493
21510
|
value: { description, availability = SelectOptionAvailability.Enabled() }
|
|
21494
21511
|
}) {
|
|
21495
21512
|
const isDisabled = (0, import_variant8.isType)(availability, SelectOptionAvailability.Disabled);
|
|
21496
|
-
return /* @__PURE__ */
|
|
21513
|
+
return /* @__PURE__ */ import_react44.default.createElement(Box_default, null, /* @__PURE__ */ import_react44.default.createElement(
|
|
21497
21514
|
Text2,
|
|
21498
21515
|
{
|
|
21499
21516
|
skin: isDisabled ? "secondary" : isSelected ? "info" : "standard",
|
|
@@ -21501,19 +21518,19 @@ function Item2({
|
|
|
21501
21518
|
},
|
|
21502
21519
|
label
|
|
21503
21520
|
), isSelected && (0, import_variant8.match)(availability, {
|
|
21504
|
-
Disabled: ({ reason }) => /* @__PURE__ */
|
|
21505
|
-
Enabled: () => description && /* @__PURE__ */
|
|
21521
|
+
Disabled: ({ reason }) => /* @__PURE__ */ import_react44.default.createElement(Box_default, { marginLeft: 1 }, /* @__PURE__ */ import_react44.default.createElement(Text2, { skin: "warning" }, "- disabled", reason && ` (${reason})`)),
|
|
21522
|
+
Enabled: () => description && /* @__PURE__ */ import_react44.default.createElement(Box_default, { marginLeft: 1 }, /* @__PURE__ */ import_react44.default.createElement(Text2, { skin: "secondary" }, "- ", description))
|
|
21506
21523
|
}));
|
|
21507
21524
|
}
|
|
21508
21525
|
|
|
21509
21526
|
// ../cli-ui-kit/src/components/SelectInput/Placeholder.tsx
|
|
21510
21527
|
init_esm_shims();
|
|
21511
|
-
var
|
|
21528
|
+
var import_react45 = __toESM(require_react(), 1);
|
|
21512
21529
|
var import_variant9 = __toESM(require_lib(), 1);
|
|
21513
21530
|
function Placeholder2({ inputState }) {
|
|
21514
21531
|
return (0, import_variant9.match)(inputState, {
|
|
21515
21532
|
NotSubmitted: () => null,
|
|
21516
|
-
Submitted: ({ value: value2 }) => /* @__PURE__ */
|
|
21533
|
+
Submitted: ({ value: value2 }) => /* @__PURE__ */ import_react45.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react45.default.createElement(Text2, { skin: "secondary" }, /* @__PURE__ */ import_react45.default.createElement(SuccessIcon, null), " ", value2.title))
|
|
21517
21534
|
});
|
|
21518
21535
|
}
|
|
21519
21536
|
|
|
@@ -21529,16 +21546,16 @@ function SelectInput2({
|
|
|
21529
21546
|
if (!options.length) {
|
|
21530
21547
|
throw new Error("SelectInput: options cannot be empty");
|
|
21531
21548
|
}
|
|
21532
|
-
const [inputState, setInputState] = (0,
|
|
21549
|
+
const [inputState, setInputState] = (0, import_react46.useState)(
|
|
21533
21550
|
() => InputState.NotSubmitted()
|
|
21534
21551
|
);
|
|
21535
|
-
const handleHighlight = (0,
|
|
21552
|
+
const handleHighlight = (0, import_react46.useCallback)(
|
|
21536
21553
|
({ value: value2 }) => {
|
|
21537
21554
|
setInputState(InputState.NotSubmitted(value2));
|
|
21538
21555
|
},
|
|
21539
21556
|
[]
|
|
21540
21557
|
);
|
|
21541
|
-
const handleSelect = (0,
|
|
21558
|
+
const handleSelect = (0, import_react46.useCallback)(
|
|
21542
21559
|
({ value: value2 }) => {
|
|
21543
21560
|
if (!(0, import_variant10.isType)(value2.availability, SelectOptionAvailability.Disabled)) {
|
|
21544
21561
|
setInputState(InputState.Submitted(value2));
|
|
@@ -21547,7 +21564,7 @@ function SelectInput2({
|
|
|
21547
21564
|
},
|
|
21548
21565
|
[onSubmit]
|
|
21549
21566
|
);
|
|
21550
|
-
const items = (0,
|
|
21567
|
+
const items = (0, import_react46.useMemo)(
|
|
21551
21568
|
() => options.map((option) => ({
|
|
21552
21569
|
key: typeof option.value === "string" ? option.value : option.key,
|
|
21553
21570
|
label: option.title,
|
|
@@ -21555,7 +21572,7 @@ function SelectInput2({
|
|
|
21555
21572
|
})),
|
|
21556
21573
|
[options]
|
|
21557
21574
|
);
|
|
21558
|
-
return /* @__PURE__ */
|
|
21575
|
+
return /* @__PURE__ */ import_react46.default.createElement(import_react46.default.Fragment, null, /* @__PURE__ */ import_react46.default.createElement(Box_default, { marginLeft: -2, marginBottom: 1 }, /* @__PURE__ */ import_react46.default.createElement(Text2, null, /* @__PURE__ */ import_react46.default.createElement(InputLabel, null, label), " ", info && (0, import_variant10.isType)(inputState, InputState.NotSubmitted) && /* @__PURE__ */ import_react46.default.createElement(Text2, { skin: "secondary" }, info))), /* @__PURE__ */ import_react46.default.createElement(Placeholder2, { inputState }), (0, import_variant10.isType)(inputState, InputState.NotSubmitted) && /* @__PURE__ */ import_react46.default.createElement(Box_default, null, /* @__PURE__ */ import_react46.default.createElement(
|
|
21559
21576
|
SelectInput_default,
|
|
21560
21577
|
{
|
|
21561
21578
|
items,
|
|
@@ -21571,20 +21588,20 @@ function SelectInput2({
|
|
|
21571
21588
|
|
|
21572
21589
|
// ../cli-ui-kit/src/components/SelectInput/SelectGroupsInput.tsx
|
|
21573
21590
|
init_esm_shims();
|
|
21574
|
-
var
|
|
21591
|
+
var import_react51 = __toESM(require_react(), 1);
|
|
21575
21592
|
var import_variant11 = __toESM(require_lib(), 1);
|
|
21576
21593
|
|
|
21577
21594
|
// ../cli-ui-kit/src/components/TextInput/Input.tsx
|
|
21578
21595
|
init_esm_shims();
|
|
21579
|
-
var
|
|
21596
|
+
var import_react47 = __toESM(require_react(), 1);
|
|
21580
21597
|
var Input2 = ({
|
|
21581
21598
|
onSubmit,
|
|
21582
21599
|
onChange,
|
|
21583
21600
|
placeholder,
|
|
21584
21601
|
showCursor
|
|
21585
21602
|
}) => {
|
|
21586
|
-
const [currentValue, setCurrentValue] = (0,
|
|
21587
|
-
return /* @__PURE__ */
|
|
21603
|
+
const [currentValue, setCurrentValue] = (0, import_react47.useState)("");
|
|
21604
|
+
return /* @__PURE__ */ import_react47.default.createElement(
|
|
21588
21605
|
build_default,
|
|
21589
21606
|
{
|
|
21590
21607
|
showCursor,
|
|
@@ -21607,7 +21624,7 @@ var Input2 = ({
|
|
|
21607
21624
|
|
|
21608
21625
|
// ../cli-ui-kit/src/components/SelectInput/GroupsList.tsx
|
|
21609
21626
|
init_esm_shims();
|
|
21610
|
-
var
|
|
21627
|
+
var import_react50 = __toESM(require_react(), 1);
|
|
21611
21628
|
|
|
21612
21629
|
// ../cli-ui-kit/src/components/SelectInput/helpers.tsx
|
|
21613
21630
|
init_esm_shims();
|
|
@@ -21730,7 +21747,7 @@ function getVisibleListItems(staringIndex, listItems, limit, reverse) {
|
|
|
21730
21747
|
|
|
21731
21748
|
// ../cli-ui-kit/src/components/Scroll.tsx
|
|
21732
21749
|
init_esm_shims();
|
|
21733
|
-
var
|
|
21750
|
+
var import_react48 = __toESM(require_react(), 1);
|
|
21734
21751
|
var SCROLL_SYMBOL = "\u2588";
|
|
21735
21752
|
var Scroll = ({
|
|
21736
21753
|
height,
|
|
@@ -21748,7 +21765,7 @@ var Scroll = ({
|
|
|
21748
21765
|
const filledEndIndex = filledStartIndex + filledAmount - 1;
|
|
21749
21766
|
for (let i2 = 0; i2 < height; i2++) {
|
|
21750
21767
|
scroll.push(
|
|
21751
|
-
/* @__PURE__ */
|
|
21768
|
+
/* @__PURE__ */ import_react48.default.createElement(
|
|
21752
21769
|
Text,
|
|
21753
21770
|
{
|
|
21754
21771
|
color: i2 >= filledStartIndex && i2 <= filledEndIndex ? "white" : "gray",
|
|
@@ -21763,7 +21780,7 @@ var Scroll = ({
|
|
|
21763
21780
|
|
|
21764
21781
|
// ../cli-ui-kit/src/components/SelectInput/Highlighter.tsx
|
|
21765
21782
|
init_esm_shims();
|
|
21766
|
-
var
|
|
21783
|
+
var import_react49 = __toESM(require_react(), 1);
|
|
21767
21784
|
var Highlighter = ({ pattern, text }) => {
|
|
21768
21785
|
if (!pattern) {
|
|
21769
21786
|
return text;
|
|
@@ -21777,7 +21794,7 @@ var Highlighter = ({ pattern, text }) => {
|
|
|
21777
21794
|
hightlightMap[i2] = 1;
|
|
21778
21795
|
}
|
|
21779
21796
|
}
|
|
21780
|
-
return hightlightMap.map((flag, index) => /* @__PURE__ */
|
|
21797
|
+
return hightlightMap.map((flag, index) => /* @__PURE__ */ import_react49.default.createElement(Text2, { key: index, skin: flag ? "secondary" : "standard" }, text[index]));
|
|
21781
21798
|
};
|
|
21782
21799
|
|
|
21783
21800
|
// ../cli-ui-kit/src/components/SelectInput/GroupsList.tsx
|
|
@@ -21865,7 +21882,7 @@ function GroupsList({
|
|
|
21865
21882
|
width,
|
|
21866
21883
|
maxHeight: maxHeightProp
|
|
21867
21884
|
}) {
|
|
21868
|
-
const [state, dispatch] = (0,
|
|
21885
|
+
const [state, dispatch] = (0, import_react50.useReducer)(reducer, {
|
|
21869
21886
|
listItems: [],
|
|
21870
21887
|
visibleItems: [],
|
|
21871
21888
|
currentIndex: 0,
|
|
@@ -21873,20 +21890,20 @@ function GroupsList({
|
|
|
21873
21890
|
maxHeight: maxHeightProp
|
|
21874
21891
|
});
|
|
21875
21892
|
const { listItems, visibleItems, currentIndex, maxHeight, totalRowCounts } = state;
|
|
21876
|
-
(0,
|
|
21893
|
+
(0, import_react50.useEffect)(() => {
|
|
21877
21894
|
dispatch({
|
|
21878
21895
|
type: "REFRESH" /* REFRESH */,
|
|
21879
21896
|
payload: listItemsProp
|
|
21880
21897
|
});
|
|
21881
21898
|
}, [listItemsProp]);
|
|
21882
|
-
(0,
|
|
21899
|
+
(0, import_react50.useEffect)(() => {
|
|
21883
21900
|
dispatch({
|
|
21884
21901
|
type: "CHANGE_MAX_HEIGHT" /* CHANGE_MAX_HEIGHT */,
|
|
21885
21902
|
payload: maxHeightProp
|
|
21886
21903
|
});
|
|
21887
21904
|
}, [maxHeightProp]);
|
|
21888
21905
|
use_input_default(
|
|
21889
|
-
(0,
|
|
21906
|
+
(0, import_react50.useCallback)(
|
|
21890
21907
|
(input, key) => {
|
|
21891
21908
|
if (key.upArrow && currentIndex > 0) {
|
|
21892
21909
|
dispatch({
|
|
@@ -21913,7 +21930,7 @@ function GroupsList({
|
|
|
21913
21930
|
);
|
|
21914
21931
|
const shouldShowScroll = !hideScroll && totalRowCounts > maxHeight && visibleItems.length;
|
|
21915
21932
|
const viewHeight = Math.min(totalRowCounts, maxHeight);
|
|
21916
|
-
return /* @__PURE__ */
|
|
21933
|
+
return /* @__PURE__ */ import_react50.default.createElement(
|
|
21917
21934
|
Box_default,
|
|
21918
21935
|
{
|
|
21919
21936
|
height: viewHeight,
|
|
@@ -21921,33 +21938,33 @@ function GroupsList({
|
|
|
21921
21938
|
justifyContent: "space-between",
|
|
21922
21939
|
width: width ?? "100%"
|
|
21923
21940
|
},
|
|
21924
|
-
/* @__PURE__ */
|
|
21941
|
+
/* @__PURE__ */ import_react50.default.createElement(Box_default, { flexDirection: "column", height: viewHeight }, visibleItems.reduce(
|
|
21925
21942
|
(acc, { group, groupIndex, item, itemIndex }, index) => {
|
|
21926
21943
|
const shouldShowGroupLabel = index === 0 || groupIndex !== visibleItems.at(index - 1)?.groupIndex;
|
|
21927
21944
|
if (shouldShowGroupLabel) {
|
|
21928
21945
|
acc.push(
|
|
21929
|
-
/* @__PURE__ */
|
|
21946
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
21930
21947
|
Box_default,
|
|
21931
21948
|
{
|
|
21932
21949
|
key: `group-${groupIndex}`,
|
|
21933
21950
|
paddingTop: index === 0 ? 0 : GROUP_PADDING
|
|
21934
21951
|
},
|
|
21935
|
-
/* @__PURE__ */
|
|
21952
|
+
/* @__PURE__ */ import_react50.default.createElement(Text2, { bold: true, underline: true }, /* @__PURE__ */ import_react50.default.createElement(
|
|
21936
21953
|
Highlighter,
|
|
21937
21954
|
{
|
|
21938
21955
|
pattern: highlightPattern,
|
|
21939
21956
|
text: group.title
|
|
21940
21957
|
}
|
|
21941
21958
|
)),
|
|
21942
|
-
group.description && /* @__PURE__ */
|
|
21959
|
+
group.description && /* @__PURE__ */ import_react50.default.createElement(Box_default, { marginLeft: 1 }, group.description)
|
|
21943
21960
|
)
|
|
21944
21961
|
);
|
|
21945
21962
|
}
|
|
21946
21963
|
acc.push(
|
|
21947
|
-
/* @__PURE__ */
|
|
21964
|
+
/* @__PURE__ */ import_react50.default.createElement(Box_default, { key: `item-${itemIndex}`, marginLeft: 1 }, /* @__PURE__ */ import_react50.default.createElement(Indicator2, { isSelected: itemIndex === currentIndex }), /* @__PURE__ */ import_react50.default.createElement(
|
|
21948
21965
|
Item2,
|
|
21949
21966
|
{
|
|
21950
|
-
label: /* @__PURE__ */
|
|
21967
|
+
label: /* @__PURE__ */ import_react50.default.createElement(Highlighter, { pattern: highlightPattern, text: item.title }),
|
|
21951
21968
|
isSelected: itemIndex === currentIndex,
|
|
21952
21969
|
value: item
|
|
21953
21970
|
}
|
|
@@ -21957,7 +21974,7 @@ function GroupsList({
|
|
|
21957
21974
|
},
|
|
21958
21975
|
[]
|
|
21959
21976
|
)),
|
|
21960
|
-
shouldShowScroll ? /* @__PURE__ */
|
|
21977
|
+
shouldShowScroll ? /* @__PURE__ */ import_react50.default.createElement(Box_default, { flexDirection: "column", height: viewHeight }, /* @__PURE__ */ import_react50.default.createElement(
|
|
21961
21978
|
Scroll,
|
|
21962
21979
|
{
|
|
21963
21980
|
height: viewHeight,
|
|
@@ -21982,11 +21999,11 @@ function SelectGroupsInput({
|
|
|
21982
21999
|
if (!groups.length) {
|
|
21983
22000
|
throw new Error("SelectGroupsInput: groups cannot be empty");
|
|
21984
22001
|
}
|
|
21985
|
-
const [inputState, setInputState] = (0,
|
|
22002
|
+
const [inputState, setInputState] = (0, import_react51.useState)(
|
|
21986
22003
|
() => InputState.NotSubmitted()
|
|
21987
22004
|
);
|
|
21988
|
-
const [searchRegExp, setSearchRegExp] = (0,
|
|
21989
|
-
const filteredGroups = (0,
|
|
22005
|
+
const [searchRegExp, setSearchRegExp] = (0, import_react51.useState)();
|
|
22006
|
+
const filteredGroups = (0, import_react51.useMemo)(() => {
|
|
21990
22007
|
if (!searchRegExp) {
|
|
21991
22008
|
return groups;
|
|
21992
22009
|
}
|
|
@@ -22004,11 +22021,11 @@ function SelectGroupsInput({
|
|
|
22004
22021
|
return acc;
|
|
22005
22022
|
}, []);
|
|
22006
22023
|
}, [groups, searchRegExp]);
|
|
22007
|
-
const listItems = (0,
|
|
22024
|
+
const listItems = (0, import_react51.useMemo)(
|
|
22008
22025
|
() => getListItems(filteredGroups),
|
|
22009
22026
|
[filteredGroups]
|
|
22010
22027
|
);
|
|
22011
|
-
const handleItemSelection = (0,
|
|
22028
|
+
const handleItemSelection = (0, import_react51.useCallback)(
|
|
22012
22029
|
(selectedItem) => {
|
|
22013
22030
|
if (!(0, import_variant11.isType)(selectedItem.availability, SelectOptionAvailability.Disabled)) {
|
|
22014
22031
|
setInputState(InputState.Submitted(selectedItem));
|
|
@@ -22017,7 +22034,7 @@ function SelectGroupsInput({
|
|
|
22017
22034
|
},
|
|
22018
22035
|
[onSubmit]
|
|
22019
22036
|
);
|
|
22020
|
-
const handleSearchPhraseChange = (0,
|
|
22037
|
+
const handleSearchPhraseChange = (0, import_react51.useCallback)((searchPhrase) => {
|
|
22021
22038
|
const escapedSearchPhrase = searchPhrase.replaceAll(
|
|
22022
22039
|
/([.?*+^$[\]\\(){}|-])/g,
|
|
22023
22040
|
"\\$1"
|
|
@@ -22028,14 +22045,14 @@ function SelectGroupsInput({
|
|
|
22028
22045
|
}, []);
|
|
22029
22046
|
const lastItem = listItems.at(-1);
|
|
22030
22047
|
const shouldShowSearchInput = searchRegExp ? true : lastItem && lastItem.rowIndex > maxHeight;
|
|
22031
|
-
return /* @__PURE__ */
|
|
22048
|
+
return /* @__PURE__ */ import_react51.default.createElement(import_react51.default.Fragment, null, /* @__PURE__ */ import_react51.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react51.default.createElement(Text2, null, /* @__PURE__ */ import_react51.default.createElement(InputLabel, null, label), " ", info && (0, import_variant11.isType)(inputState, InputState.NotSubmitted) && /* @__PURE__ */ import_react51.default.createElement(Text2, { skin: "secondary" }, info)), (0, import_variant11.isType)(inputState, InputState.NotSubmitted) && shouldShowSearchInput && /* @__PURE__ */ import_react51.default.createElement(Text2, { skin: "secondary" }, /* @__PURE__ */ import_react51.default.createElement(
|
|
22032
22049
|
Input2,
|
|
22033
22050
|
{
|
|
22034
22051
|
onChange: handleSearchPhraseChange,
|
|
22035
22052
|
showCursor: true,
|
|
22036
22053
|
placeholder: "Type to search..."
|
|
22037
22054
|
}
|
|
22038
|
-
))), /* @__PURE__ */
|
|
22055
|
+
))), /* @__PURE__ */ import_react51.default.createElement(Placeholder2, { inputState }), (0, import_variant11.isType)(inputState, InputState.NotSubmitted) && (listItems.length ? /* @__PURE__ */ import_react51.default.createElement(
|
|
22039
22056
|
GroupsList,
|
|
22040
22057
|
{
|
|
22041
22058
|
listItems,
|
|
@@ -22045,7 +22062,7 @@ function SelectGroupsInput({
|
|
|
22045
22062
|
hideScroll,
|
|
22046
22063
|
onItemSelect: handleItemSelection
|
|
22047
22064
|
}
|
|
22048
|
-
) : /* @__PURE__ */
|
|
22065
|
+
) : /* @__PURE__ */ import_react51.default.createElement(Box_default, { paddingBottom: 1, paddingX: 2 }, /* @__PURE__ */ import_react51.default.createElement(Text2, { skin: "secondary" }, "No results found."))));
|
|
22049
22066
|
}
|
|
22050
22067
|
|
|
22051
22068
|
// ../cli-ui-kit/src/components/TextInput/index.ts
|
|
@@ -22053,7 +22070,7 @@ init_esm_shims();
|
|
|
22053
22070
|
|
|
22054
22071
|
// ../cli-ui-kit/src/components/TextInput/TextInput.tsx
|
|
22055
22072
|
init_esm_shims();
|
|
22056
|
-
var
|
|
22073
|
+
var import_react52 = __toESM(require_react(), 1);
|
|
22057
22074
|
var import_variant12 = __toESM(require_lib(), 1);
|
|
22058
22075
|
var TextInput2 = ({
|
|
22059
22076
|
label,
|
|
@@ -22062,12 +22079,12 @@ var TextInput2 = ({
|
|
|
22062
22079
|
validate = () => true,
|
|
22063
22080
|
inCreateFlow = false
|
|
22064
22081
|
}) => {
|
|
22065
|
-
const [inputState, setInputState] = (0,
|
|
22082
|
+
const [inputState, setInputState] = (0, import_react52.useState)(
|
|
22066
22083
|
() => InputState.NotSubmitted(placeholder)
|
|
22067
22084
|
);
|
|
22068
|
-
const [isDirty2, setIsDirty] = (0,
|
|
22069
|
-
const [validationError, setValidationError] = (0,
|
|
22070
|
-
const handleSubmit = (0,
|
|
22085
|
+
const [isDirty2, setIsDirty] = (0, import_react52.useState)(false);
|
|
22086
|
+
const [validationError, setValidationError] = (0, import_react52.useState)();
|
|
22087
|
+
const handleSubmit = (0, import_react52.useCallback)(
|
|
22071
22088
|
async (value2) => {
|
|
22072
22089
|
setIsDirty(false);
|
|
22073
22090
|
const validationResult = await validate(value2);
|
|
@@ -22082,13 +22099,13 @@ var TextInput2 = ({
|
|
|
22082
22099
|
[onSubmit, validate]
|
|
22083
22100
|
);
|
|
22084
22101
|
const afterValidationError = Boolean(validationError && !isDirty2);
|
|
22085
|
-
return /* @__PURE__ */
|
|
22102
|
+
return /* @__PURE__ */ import_react52.default.createElement(import_react52.default.Fragment, null, /* @__PURE__ */ import_react52.default.createElement(Box_default, { marginBottom: 1, marginLeft: inCreateFlow ? -2 : 0 }, /* @__PURE__ */ import_react52.default.createElement(Text2, null, /* @__PURE__ */ import_react52.default.createElement(
|
|
22086
22103
|
InputLabel,
|
|
22087
22104
|
{
|
|
22088
|
-
icon: /* @__PURE__ */
|
|
22105
|
+
icon: /* @__PURE__ */ import_react52.default.createElement(Text2, { skin: "question" }, /* @__PURE__ */ import_react52.default.createElement(PointerIcon, { appearance: "triangle" }))
|
|
22089
22106
|
},
|
|
22090
22107
|
label
|
|
22091
|
-
)
|
|
22108
|
+
), (0, import_variant12.isType)(inputState, InputState.NotSubmitted) && /* @__PURE__ */ import_react52.default.createElement(import_react52.default.Fragment, null, " ", /* @__PURE__ */ import_react52.default.createElement(Text2, { skin: afterValidationError ? "error" : "standard" }, /* @__PURE__ */ import_react52.default.createElement(
|
|
22092
22109
|
Input2,
|
|
22093
22110
|
{
|
|
22094
22111
|
placeholder: inputState.value,
|
|
@@ -22096,52 +22113,52 @@ var TextInput2 = ({
|
|
|
22096
22113
|
onChange: () => setIsDirty(true),
|
|
22097
22114
|
showCursor: afterValidationError
|
|
22098
22115
|
}
|
|
22099
|
-
))), (0, import_variant12.isType)(inputState, InputState.Submitted) && /* @__PURE__ */
|
|
22116
|
+
))))), (0, import_variant12.isType)(inputState, InputState.Submitted) && /* @__PURE__ */ import_react52.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react52.default.createElement(Text2, { skin: "secondary" }, /* @__PURE__ */ import_react52.default.createElement(SuccessIcon, null), " ", inputState.value)), validationError && /* @__PURE__ */ import_react52.default.createElement(Box_default, { columnGap: 1 }, /* @__PURE__ */ import_react52.default.createElement(Text2, { skin: "error" }, /* @__PURE__ */ import_react52.default.createElement(PointerIcon, { appearance: "exclamation" })), /* @__PURE__ */ import_react52.default.createElement(Text2, { skin: "error" }, validationError)));
|
|
22100
22117
|
};
|
|
22101
22118
|
|
|
22102
22119
|
// ../cli-ui-kit/src/components/Alert.tsx
|
|
22103
22120
|
init_esm_shims();
|
|
22104
|
-
var
|
|
22121
|
+
var import_react53 = __toESM(require_react(), 1);
|
|
22105
22122
|
var import_variant13 = __toESM(require_lib(), 1);
|
|
22106
22123
|
var Alert = ({ type, children }) => {
|
|
22107
22124
|
const icon = (0, import_variant13.match)(type, {
|
|
22108
22125
|
error: (0, import_variant13.constant)(
|
|
22109
|
-
/* @__PURE__ */
|
|
22126
|
+
/* @__PURE__ */ import_react53.default.createElement(Text2, { skin: "error" }, /* @__PURE__ */ import_react53.default.createElement(ErrorIcon, null))
|
|
22110
22127
|
),
|
|
22111
22128
|
warning: (0, import_variant13.constant)(
|
|
22112
|
-
/* @__PURE__ */
|
|
22129
|
+
/* @__PURE__ */ import_react53.default.createElement(Text2, { skin: "warning" }, /* @__PURE__ */ import_react53.default.createElement(WarningIcon, null))
|
|
22113
22130
|
),
|
|
22114
22131
|
success: (0, import_variant13.constant)(
|
|
22115
|
-
/* @__PURE__ */
|
|
22132
|
+
/* @__PURE__ */ import_react53.default.createElement(Text2, { skin: "success" }, /* @__PURE__ */ import_react53.default.createElement(SuccessIcon, null))
|
|
22116
22133
|
),
|
|
22117
|
-
insight: (0, import_variant13.constant)(/* @__PURE__ */
|
|
22134
|
+
insight: (0, import_variant13.constant)(/* @__PURE__ */ import_react53.default.createElement(InsightIcon, null))
|
|
22118
22135
|
});
|
|
22119
|
-
return /* @__PURE__ */
|
|
22136
|
+
return /* @__PURE__ */ import_react53.default.createElement(Text2, null, icon, " ", children);
|
|
22120
22137
|
};
|
|
22121
22138
|
|
|
22122
22139
|
// ../cli-ui-kit/src/components/Badge.tsx
|
|
22123
22140
|
init_esm_shims();
|
|
22124
|
-
var
|
|
22141
|
+
var import_react54 = __toESM(require_react(), 1);
|
|
22125
22142
|
var skins2 = {
|
|
22126
22143
|
success: { backgroundColor: "green" }
|
|
22127
22144
|
};
|
|
22128
22145
|
var Badge = ({ children, skin }) => {
|
|
22129
|
-
return /* @__PURE__ */
|
|
22146
|
+
return /* @__PURE__ */ import_react54.default.createElement(Text, { ...skins2[skin] }, " ", children, " ");
|
|
22130
22147
|
};
|
|
22131
22148
|
|
|
22132
22149
|
// ../cli-ui-kit/src/components/Key.tsx
|
|
22133
22150
|
init_esm_shims();
|
|
22134
|
-
var
|
|
22151
|
+
var import_react55 = __toESM(require_react(), 1);
|
|
22135
22152
|
var Key = ({ value: value2, skin }) => {
|
|
22136
22153
|
if (skin === "secondary") {
|
|
22137
|
-
return /* @__PURE__ */
|
|
22154
|
+
return /* @__PURE__ */ import_react55.default.createElement(Text, null, /* @__PURE__ */ import_react55.default.createElement(Text, { inverse: true }, " ", value2, " "), /* @__PURE__ */ import_react55.default.createElement(Text, null, "\u2591"));
|
|
22138
22155
|
}
|
|
22139
|
-
return /* @__PURE__ */
|
|
22156
|
+
return /* @__PURE__ */ import_react55.default.createElement(Text, null, /* @__PURE__ */ import_react55.default.createElement(Text, { backgroundColor: "blueBright" }, " ", value2, " "), /* @__PURE__ */ import_react55.default.createElement(Text, { color: "blueBright" }, "\u2591"));
|
|
22140
22157
|
};
|
|
22141
22158
|
|
|
22142
22159
|
// ../cli-ui-kit/src/components/Link.tsx
|
|
22143
22160
|
init_esm_shims();
|
|
22144
|
-
var
|
|
22161
|
+
var import_react56 = __toESM(require_react(), 1);
|
|
22145
22162
|
|
|
22146
22163
|
// ../../node_modules/terminal-link/index.js
|
|
22147
22164
|
init_esm_shims();
|
|
@@ -22288,31 +22305,31 @@ terminalLink.stderr.isSupported = import_supports_hyperlinks.default.stderr;
|
|
|
22288
22305
|
var Link = ({ skin, children, url }) => {
|
|
22289
22306
|
if (children) {
|
|
22290
22307
|
if (terminalLink.isSupported) {
|
|
22291
|
-
return /* @__PURE__ */
|
|
22308
|
+
return /* @__PURE__ */ import_react56.default.createElement(
|
|
22292
22309
|
Transform,
|
|
22293
22310
|
{
|
|
22294
22311
|
transform: (childrenAsString) => terminalLink(childrenAsString, url, { fallback: false })
|
|
22295
22312
|
},
|
|
22296
|
-
/* @__PURE__ */
|
|
22313
|
+
/* @__PURE__ */ import_react56.default.createElement(Text2, { skin }, children)
|
|
22297
22314
|
);
|
|
22298
22315
|
}
|
|
22299
|
-
return /* @__PURE__ */
|
|
22316
|
+
return /* @__PURE__ */ import_react56.default.createElement(Text2, null, /* @__PURE__ */ import_react56.default.createElement(Text2, { skin }, children), " (", url, ")");
|
|
22300
22317
|
}
|
|
22301
|
-
return /* @__PURE__ */
|
|
22318
|
+
return /* @__PURE__ */ import_react56.default.createElement(Text2, { skin: "info" }, url);
|
|
22302
22319
|
};
|
|
22303
22320
|
|
|
22304
22321
|
// ../cli-ui-kit/src/components/Spinner.tsx
|
|
22305
22322
|
init_esm_shims();
|
|
22306
|
-
var
|
|
22323
|
+
var import_react58 = __toESM(require_react(), 1);
|
|
22307
22324
|
|
|
22308
22325
|
// ../../node_modules/ink-spinner/build/index.js
|
|
22309
22326
|
init_esm_shims();
|
|
22310
|
-
var
|
|
22327
|
+
var import_react57 = __toESM(require_react(), 1);
|
|
22311
22328
|
var import_cli_spinners = __toESM(require_cli_spinners(), 1);
|
|
22312
22329
|
function Spinner({ type = "dots" }) {
|
|
22313
|
-
const [frame, setFrame] = (0,
|
|
22330
|
+
const [frame, setFrame] = (0, import_react57.useState)(0);
|
|
22314
22331
|
const spinner = import_cli_spinners.default[type];
|
|
22315
|
-
(0,
|
|
22332
|
+
(0, import_react57.useEffect)(() => {
|
|
22316
22333
|
const timer = setInterval(() => {
|
|
22317
22334
|
setFrame((previousFrame) => {
|
|
22318
22335
|
const isLastFrame = previousFrame === spinner.frames.length - 1;
|
|
@@ -22323,33 +22340,33 @@ function Spinner({ type = "dots" }) {
|
|
|
22323
22340
|
clearInterval(timer);
|
|
22324
22341
|
};
|
|
22325
22342
|
}, [spinner]);
|
|
22326
|
-
return
|
|
22343
|
+
return import_react57.default.createElement(Text, null, spinner.frames[frame]);
|
|
22327
22344
|
}
|
|
22328
22345
|
var build_default2 = Spinner;
|
|
22329
22346
|
|
|
22330
22347
|
// ../cli-ui-kit/src/components/Spinner.tsx
|
|
22331
22348
|
var Spinner2 = ({ text }) => {
|
|
22332
|
-
const spinnerNode = /* @__PURE__ */
|
|
22349
|
+
const spinnerNode = /* @__PURE__ */ import_react58.default.createElement(Text2, { skin: "info" }, /* @__PURE__ */ import_react58.default.createElement(build_default2, { type: "dots" }));
|
|
22333
22350
|
if (text) {
|
|
22334
|
-
return /* @__PURE__ */
|
|
22351
|
+
return /* @__PURE__ */ import_react58.default.createElement(Box_default, { gap: 1 }, spinnerNode, typeof text === "string" ? /* @__PURE__ */ import_react58.default.createElement(Text2, null, text) : text);
|
|
22335
22352
|
}
|
|
22336
22353
|
return spinnerNode;
|
|
22337
22354
|
};
|
|
22338
22355
|
|
|
22339
22356
|
// ../cli-ui-kit/src/components/ErrorDetails.tsx
|
|
22340
22357
|
init_esm_shims();
|
|
22341
|
-
var
|
|
22358
|
+
var import_react59 = __toESM(require_react(), 1);
|
|
22342
22359
|
var ErrorDetails = ({
|
|
22343
22360
|
message,
|
|
22344
22361
|
explanation,
|
|
22345
22362
|
hint
|
|
22346
|
-
}) => /* @__PURE__ */
|
|
22363
|
+
}) => /* @__PURE__ */ import_react59.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react59.default.createElement(Alert, { type: "error" }, message), explanation && /* @__PURE__ */ import_react59.default.createElement(Alert, { type: "warning" }, explanation), hint && /* @__PURE__ */ import_react59.default.createElement(Box_default, { paddingTop: 1 }, /* @__PURE__ */ import_react59.default.createElement(Alert, { type: "insight" }, hint)));
|
|
22347
22364
|
|
|
22348
22365
|
// ../cli-ui-kit/src/components/Notification.tsx
|
|
22349
22366
|
init_esm_shims();
|
|
22350
|
-
var
|
|
22367
|
+
var import_react60 = __toESM(require_react(), 1);
|
|
22351
22368
|
var Notification = ({ children }) => {
|
|
22352
|
-
return /* @__PURE__ */
|
|
22369
|
+
return /* @__PURE__ */ import_react60.default.createElement(Box_default, null, /* @__PURE__ */ import_react60.default.createElement(
|
|
22353
22370
|
Box_default,
|
|
22354
22371
|
{
|
|
22355
22372
|
padding: 1,
|
|
@@ -22368,7 +22385,7 @@ var import_variant14 = __toESM(require_lib(), 1);
|
|
|
22368
22385
|
|
|
22369
22386
|
// ../../node_modules/react-async-hook/dist/react-async-hook.esm.js
|
|
22370
22387
|
init_esm_shims();
|
|
22371
|
-
var
|
|
22388
|
+
var import_react61 = __toESM(require_react());
|
|
22372
22389
|
function _extends() {
|
|
22373
22390
|
_extends = Object.assign || function(target) {
|
|
22374
22391
|
for (var i2 = 1; i2 < arguments.length; i2++) {
|
|
@@ -22385,13 +22402,13 @@ function _extends() {
|
|
|
22385
22402
|
}
|
|
22386
22403
|
var _iteratorSymbol = typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
|
|
22387
22404
|
var _asyncIteratorSymbol = typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
|
|
22388
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined" ?
|
|
22405
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined" ? import_react61.useLayoutEffect : import_react61.useEffect;
|
|
22389
22406
|
var useGetter = function useGetter2(t3) {
|
|
22390
|
-
var ref = (0,
|
|
22407
|
+
var ref = (0, import_react61.useRef)(t3);
|
|
22391
22408
|
useIsomorphicLayoutEffect(function() {
|
|
22392
22409
|
ref.current = t3;
|
|
22393
22410
|
});
|
|
22394
|
-
return (0,
|
|
22411
|
+
return (0, import_react61.useCallback)(function() {
|
|
22395
22412
|
return ref.current;
|
|
22396
22413
|
}, [ref]);
|
|
22397
22414
|
};
|
|
@@ -22444,22 +22461,22 @@ var normalizeOptions = function normalizeOptions2(options) {
|
|
|
22444
22461
|
return _extends({}, DefaultOptions, {}, options);
|
|
22445
22462
|
};
|
|
22446
22463
|
var useAsyncState = function useAsyncState2(options) {
|
|
22447
|
-
var _useState = (0,
|
|
22464
|
+
var _useState = (0, import_react61.useState)(function() {
|
|
22448
22465
|
return options.initialState(options);
|
|
22449
22466
|
}), value2 = _useState[0], setValue = _useState[1];
|
|
22450
|
-
var reset = (0,
|
|
22467
|
+
var reset = (0, import_react61.useCallback)(function() {
|
|
22451
22468
|
return setValue(options.initialState(options));
|
|
22452
22469
|
}, [setValue, options]);
|
|
22453
|
-
var setLoading = (0,
|
|
22470
|
+
var setLoading = (0, import_react61.useCallback)(function() {
|
|
22454
22471
|
return setValue(options.setLoading(value2));
|
|
22455
22472
|
}, [value2, setValue]);
|
|
22456
|
-
var setResult = (0,
|
|
22473
|
+
var setResult = (0, import_react61.useCallback)(function(result) {
|
|
22457
22474
|
return setValue(options.setResult(result, value2));
|
|
22458
22475
|
}, [value2, setValue]);
|
|
22459
|
-
var setError = (0,
|
|
22476
|
+
var setError = (0, import_react61.useCallback)(function(error) {
|
|
22460
22477
|
return setValue(options.setError(error, value2));
|
|
22461
22478
|
}, [value2, setValue]);
|
|
22462
|
-
var merge = (0,
|
|
22479
|
+
var merge = (0, import_react61.useCallback)(function(state) {
|
|
22463
22480
|
return setValue(_extends({}, value2, {}, state));
|
|
22464
22481
|
}, [value2, setValue]);
|
|
22465
22482
|
return {
|
|
@@ -22473,8 +22490,8 @@ var useAsyncState = function useAsyncState2(options) {
|
|
|
22473
22490
|
};
|
|
22474
22491
|
};
|
|
22475
22492
|
var useIsMounted = function useIsMounted2() {
|
|
22476
|
-
var ref = (0,
|
|
22477
|
-
(0,
|
|
22493
|
+
var ref = (0, import_react61.useRef)(false);
|
|
22494
|
+
(0, import_react61.useEffect)(function() {
|
|
22478
22495
|
ref.current = true;
|
|
22479
22496
|
return function() {
|
|
22480
22497
|
ref.current = false;
|
|
@@ -22485,7 +22502,7 @@ var useIsMounted = function useIsMounted2() {
|
|
|
22485
22502
|
};
|
|
22486
22503
|
};
|
|
22487
22504
|
var useCurrentPromise = function useCurrentPromise2() {
|
|
22488
|
-
var ref = (0,
|
|
22505
|
+
var ref = (0, import_react61.useRef)(null);
|
|
22489
22506
|
return {
|
|
22490
22507
|
set: function set(promise) {
|
|
22491
22508
|
return ref.current = promise;
|
|
@@ -22501,7 +22518,7 @@ var useCurrentPromise = function useCurrentPromise2() {
|
|
|
22501
22518
|
var useAsyncInternal = function useAsyncInternal2(asyncFunction, params, options) {
|
|
22502
22519
|
!params && (params = []);
|
|
22503
22520
|
var normalizedOptions = normalizeOptions(options);
|
|
22504
|
-
var _useState2 = (0,
|
|
22521
|
+
var _useState2 = (0, import_react61.useState)(null), currentParams = _useState2[0], setCurrentParams = _useState2[1];
|
|
22505
22522
|
var AsyncState = useAsyncState(normalizedOptions);
|
|
22506
22523
|
var isMounted = useIsMounted();
|
|
22507
22524
|
var CurrentPromise = useCurrentPromise();
|
|
@@ -22544,11 +22561,11 @@ var useAsyncInternal = function useAsyncInternal2(asyncFunction, params, options
|
|
|
22544
22561
|
return promise;
|
|
22545
22562
|
};
|
|
22546
22563
|
var getLatestExecuteAsyncOperation = useGetter(executeAsyncOperation);
|
|
22547
|
-
var executeAsyncOperationMemo = (0,
|
|
22564
|
+
var executeAsyncOperationMemo = (0, import_react61.useCallback)(function() {
|
|
22548
22565
|
return getLatestExecuteAsyncOperation().apply(void 0, arguments);
|
|
22549
22566
|
}, [getLatestExecuteAsyncOperation]);
|
|
22550
22567
|
var isMounting = !isMounted();
|
|
22551
|
-
(0,
|
|
22568
|
+
(0, import_react61.useEffect)(function() {
|
|
22552
22569
|
var execute = function execute2() {
|
|
22553
22570
|
return getLatestExecuteAsyncOperation().apply(void 0, params);
|
|
22554
22571
|
};
|
|
@@ -22581,7 +22598,7 @@ var useAsyncCallback = function useAsyncCallback2(asyncFunction, options) {
|
|
|
22581
22598
|
};
|
|
22582
22599
|
|
|
22583
22600
|
// ../cli-ui-kit/src/hooks/use-async.ts
|
|
22584
|
-
var
|
|
22601
|
+
var import_react62 = __toESM(require_react(), 1);
|
|
22585
22602
|
var AsyncStatus = (0, import_variant14.variant)(
|
|
22586
22603
|
(0, import_variant14.onTerms)(({ T: _T }) => ({
|
|
22587
22604
|
Error: (error) => ({ error }),
|
|
@@ -22599,7 +22616,7 @@ var AsyncCallbackStatus = (0, import_variant14.variant)(
|
|
|
22599
22616
|
);
|
|
22600
22617
|
var useAsync2 = (fn, args, options) => {
|
|
22601
22618
|
const exit = useExit();
|
|
22602
|
-
const abortController = (0,
|
|
22619
|
+
const abortController = (0, import_react62.useMemo)(() => new AbortController(), []);
|
|
22603
22620
|
const { result, error, status, merge } = useAsync(
|
|
22604
22621
|
fn.bind(null, { signal: abortController.signal }),
|
|
22605
22622
|
args,
|
|
@@ -22608,7 +22625,7 @@ var useAsync2 = (fn, args, options) => {
|
|
|
22608
22625
|
...options ?? {}
|
|
22609
22626
|
}
|
|
22610
22627
|
);
|
|
22611
|
-
(0,
|
|
22628
|
+
(0, import_react62.useEffect)(() => {
|
|
22612
22629
|
return () => {
|
|
22613
22630
|
abortController.abort();
|
|
22614
22631
|
};
|
|
@@ -22628,7 +22645,7 @@ var useAsync2 = (fn, args, options) => {
|
|
|
22628
22645
|
};
|
|
22629
22646
|
var useAsyncCallback3 = (fn, options) => {
|
|
22630
22647
|
const exit = useExit();
|
|
22631
|
-
const abortController = (0,
|
|
22648
|
+
const abortController = (0, import_react62.useMemo)(() => new AbortController(), []);
|
|
22632
22649
|
const { result, error, status, merge, execute } = useAsyncCallback(
|
|
22633
22650
|
fn.bind(null, { signal: abortController.signal }),
|
|
22634
22651
|
{
|
|
@@ -22636,7 +22653,7 @@ var useAsyncCallback3 = (fn, options) => {
|
|
|
22636
22653
|
...options ?? {}
|
|
22637
22654
|
}
|
|
22638
22655
|
);
|
|
22639
|
-
(0,
|
|
22656
|
+
(0, import_react62.useEffect)(() => {
|
|
22640
22657
|
return () => {
|
|
22641
22658
|
abortController.abort();
|
|
22642
22659
|
};
|
|
@@ -22666,18 +22683,18 @@ var useAsyncCallback3 = (fn, options) => {
|
|
|
22666
22683
|
|
|
22667
22684
|
// ../cli-i18n/src/I18nProvider.tsx
|
|
22668
22685
|
init_esm_shims();
|
|
22669
|
-
var
|
|
22686
|
+
var import_react71 = __toESM(require_react(), 1);
|
|
22670
22687
|
|
|
22671
22688
|
// ../../node_modules/react-i18next/dist/es/index.js
|
|
22672
22689
|
init_esm_shims();
|
|
22673
22690
|
|
|
22674
22691
|
// ../../node_modules/react-i18next/dist/es/Trans.js
|
|
22675
22692
|
init_esm_shims();
|
|
22676
|
-
var
|
|
22693
|
+
var import_react65 = __toESM(require_react(), 1);
|
|
22677
22694
|
|
|
22678
22695
|
// ../../node_modules/react-i18next/dist/es/TransWithoutContext.js
|
|
22679
22696
|
init_esm_shims();
|
|
22680
|
-
var
|
|
22697
|
+
var import_react63 = __toESM(require_react(), 1);
|
|
22681
22698
|
|
|
22682
22699
|
// ../../node_modules/html-parse-stringify/dist/html-parse-stringify.module.js
|
|
22683
22700
|
init_esm_shims();
|
|
@@ -22876,7 +22893,7 @@ var getChildren = (node) => {
|
|
|
22876
22893
|
const children = node.props?.children ?? node.children;
|
|
22877
22894
|
return node.props?.i18nIsDynamicList ? getAsArray(children) : children;
|
|
22878
22895
|
};
|
|
22879
|
-
var hasValidReactChildren = (children) => Array.isArray(children) && children.every(
|
|
22896
|
+
var hasValidReactChildren = (children) => Array.isArray(children) && children.every(import_react63.isValidElement);
|
|
22880
22897
|
var getAsArray = (data) => Array.isArray(data) ? data : [data];
|
|
22881
22898
|
var mergeProps = (source, target) => {
|
|
22882
22899
|
const newTarget = {
|
|
@@ -22895,7 +22912,7 @@ var nodesToString = (children, i18nOptions, i18n, i18nKey) => {
|
|
|
22895
22912
|
stringNode += `${child}`;
|
|
22896
22913
|
return;
|
|
22897
22914
|
}
|
|
22898
|
-
if ((0,
|
|
22915
|
+
if ((0, import_react63.isValidElement)(child)) {
|
|
22899
22916
|
const {
|
|
22900
22917
|
props,
|
|
22901
22918
|
type
|
|
@@ -22960,7 +22977,7 @@ var renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, sho
|
|
|
22960
22977
|
childrenArray.forEach((child) => {
|
|
22961
22978
|
if (isString(child)) return;
|
|
22962
22979
|
if (hasChildren(child)) getData(getChildren(child));
|
|
22963
|
-
else if (isObject(child) && !(0,
|
|
22980
|
+
else if (isObject(child) && !(0, import_react63.isValidElement)(child)) Object.assign(data, child);
|
|
22964
22981
|
});
|
|
22965
22982
|
};
|
|
22966
22983
|
getData(children);
|
|
@@ -22977,16 +22994,16 @@ var renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, sho
|
|
|
22977
22994
|
const pushTranslatedJSX = (child, inner, mem, i2, isVoid) => {
|
|
22978
22995
|
if (child.dummy) {
|
|
22979
22996
|
child.children = inner;
|
|
22980
|
-
mem.push((0,
|
|
22997
|
+
mem.push((0, import_react63.cloneElement)(child, {
|
|
22981
22998
|
key: i2
|
|
22982
22999
|
}, isVoid ? void 0 : inner));
|
|
22983
23000
|
} else {
|
|
22984
|
-
mem.push(...
|
|
23001
|
+
mem.push(...import_react63.Children.map([child], (c2) => {
|
|
22985
23002
|
const props = {
|
|
22986
23003
|
...c2.props
|
|
22987
23004
|
};
|
|
22988
23005
|
delete props.i18nIsDynamicList;
|
|
22989
|
-
return (0,
|
|
23006
|
+
return (0, import_react63.createElement)(c2.type, {
|
|
22990
23007
|
...props,
|
|
22991
23008
|
key: i2,
|
|
22992
23009
|
ref: c2.ref
|
|
@@ -23006,7 +23023,7 @@ var renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, sho
|
|
|
23006
23023
|
const child = Object.keys(node.attrs).length !== 0 ? mergeProps({
|
|
23007
23024
|
props: node.attrs
|
|
23008
23025
|
}, tmp) : tmp;
|
|
23009
|
-
const isElement = (0,
|
|
23026
|
+
const isElement = (0, import_react63.isValidElement)(child);
|
|
23010
23027
|
const isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
|
|
23011
23028
|
const isEmptyTransWithHTML = emptyChildrenButNeedsHandling && isObject(child) && child.dummy && !isElement;
|
|
23012
23029
|
const isKnownComponent = isObject(children) && Object.hasOwnProperty.call(children, node.name);
|
|
@@ -23025,12 +23042,12 @@ var renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, sho
|
|
|
23025
23042
|
pushTranslatedJSX(child, inner, mem, i2, node.voidElement);
|
|
23026
23043
|
} else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
|
|
23027
23044
|
if (node.voidElement) {
|
|
23028
|
-
mem.push((0,
|
|
23045
|
+
mem.push((0, import_react63.createElement)(node.name, {
|
|
23029
23046
|
key: `${node.name}-${i2}`
|
|
23030
23047
|
}));
|
|
23031
23048
|
} else {
|
|
23032
23049
|
const inner = mapAST(reactNodes, node.children, rootReactNode);
|
|
23033
|
-
mem.push((0,
|
|
23050
|
+
mem.push((0, import_react63.createElement)(node.name, {
|
|
23034
23051
|
key: `${node.name}-${i2}`
|
|
23035
23052
|
}, inner));
|
|
23036
23053
|
}
|
|
@@ -23050,7 +23067,7 @@ var renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, sho
|
|
|
23050
23067
|
const wrapTextNodes = i18nOptions.transWrapTextNodes;
|
|
23051
23068
|
const content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
|
|
23052
23069
|
if (wrapTextNodes) {
|
|
23053
|
-
mem.push((0,
|
|
23070
|
+
mem.push((0, import_react63.createElement)(wrapTextNodes, {
|
|
23054
23071
|
key: `${node.name}-${i2}`
|
|
23055
23072
|
}, content));
|
|
23056
23073
|
} else {
|
|
@@ -23068,16 +23085,16 @@ var renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, sho
|
|
|
23068
23085
|
};
|
|
23069
23086
|
var fixComponentProps = (component, index, translation) => {
|
|
23070
23087
|
const componentKey = component.key || index;
|
|
23071
|
-
const comp = (0,
|
|
23088
|
+
const comp = (0, import_react63.cloneElement)(component, {
|
|
23072
23089
|
key: componentKey
|
|
23073
23090
|
});
|
|
23074
23091
|
if (!comp.props || !comp.props.children || translation.indexOf(`${index}/>`) < 0 && translation.indexOf(`${index} />`) < 0) {
|
|
23075
23092
|
return comp;
|
|
23076
23093
|
}
|
|
23077
23094
|
function Componentized() {
|
|
23078
|
-
return (0,
|
|
23095
|
+
return (0, import_react63.createElement)(import_react63.Fragment, null, comp);
|
|
23079
23096
|
}
|
|
23080
|
-
return (0,
|
|
23097
|
+
return (0, import_react63.createElement)(Componentized);
|
|
23081
23098
|
};
|
|
23082
23099
|
var generateArrayComponents = (components, translation) => components.map((c2, index) => fixComponentProps(c2, index, translation));
|
|
23083
23100
|
var generateObjectComponents = (components, translation) => {
|
|
@@ -23166,12 +23183,12 @@ function Trans({
|
|
|
23166
23183
|
const generatedComponents = generateComponents(components, translation, i18n, i18nKey);
|
|
23167
23184
|
const content = renderNodes(generatedComponents || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
|
|
23168
23185
|
const useAsParent = parent ?? reactI18nextOptions.defaultTransParent;
|
|
23169
|
-
return useAsParent ? (0,
|
|
23186
|
+
return useAsParent ? (0, import_react63.createElement)(useAsParent, additionalProps, content) : content;
|
|
23170
23187
|
}
|
|
23171
23188
|
|
|
23172
23189
|
// ../../node_modules/react-i18next/dist/es/context.js
|
|
23173
23190
|
init_esm_shims();
|
|
23174
|
-
var
|
|
23191
|
+
var import_react64 = __toESM(require_react(), 1);
|
|
23175
23192
|
|
|
23176
23193
|
// ../../node_modules/react-i18next/dist/es/initReactI18next.js
|
|
23177
23194
|
init_esm_shims();
|
|
@@ -23184,7 +23201,7 @@ var initReactI18next = {
|
|
|
23184
23201
|
};
|
|
23185
23202
|
|
|
23186
23203
|
// ../../node_modules/react-i18next/dist/es/context.js
|
|
23187
|
-
var I18nContext = (0,
|
|
23204
|
+
var I18nContext = (0, import_react64.createContext)();
|
|
23188
23205
|
var ReportNamespaces = class {
|
|
23189
23206
|
constructor() {
|
|
23190
23207
|
this.usedNamespaces = {};
|
|
@@ -23219,7 +23236,7 @@ function Trans2({
|
|
|
23219
23236
|
const {
|
|
23220
23237
|
i18n: i18nFromContext,
|
|
23221
23238
|
defaultNS: defaultNSFromContext
|
|
23222
|
-
} = (0,
|
|
23239
|
+
} = (0, import_react65.useContext)(I18nContext) || {};
|
|
23223
23240
|
const i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
23224
23241
|
const t3 = tFromProps || i18n?.t.bind(i18n);
|
|
23225
23242
|
return Trans({
|
|
@@ -23242,16 +23259,16 @@ function Trans2({
|
|
|
23242
23259
|
|
|
23243
23260
|
// ../../node_modules/react-i18next/dist/es/useTranslation.js
|
|
23244
23261
|
init_esm_shims();
|
|
23245
|
-
var
|
|
23262
|
+
var import_react66 = __toESM(require_react(), 1);
|
|
23246
23263
|
var usePrevious = (value2, ignore) => {
|
|
23247
|
-
const ref = (0,
|
|
23248
|
-
(0,
|
|
23264
|
+
const ref = (0, import_react66.useRef)();
|
|
23265
|
+
(0, import_react66.useEffect)(() => {
|
|
23249
23266
|
ref.current = ignore ? ref.current : value2;
|
|
23250
23267
|
}, [value2, ignore]);
|
|
23251
23268
|
return ref.current;
|
|
23252
23269
|
};
|
|
23253
23270
|
var alwaysNewT = (i18n, language, namespace, keyPrefix) => i18n.getFixedT(language, namespace, keyPrefix);
|
|
23254
|
-
var useMemoizedT = (i18n, language, namespace, keyPrefix) => (0,
|
|
23271
|
+
var useMemoizedT = (i18n, language, namespace, keyPrefix) => (0, import_react66.useCallback)(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
|
|
23255
23272
|
var useTranslation = (ns, props = {}) => {
|
|
23256
23273
|
const {
|
|
23257
23274
|
i18n: i18nFromProps
|
|
@@ -23259,7 +23276,7 @@ var useTranslation = (ns, props = {}) => {
|
|
|
23259
23276
|
const {
|
|
23260
23277
|
i18n: i18nFromContext,
|
|
23261
23278
|
defaultNS: defaultNSFromContext
|
|
23262
|
-
} = (0,
|
|
23279
|
+
} = (0, import_react66.useContext)(I18nContext) || {};
|
|
23263
23280
|
const i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
23264
23281
|
if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
|
|
23265
23282
|
if (!i18n) {
|
|
@@ -23292,12 +23309,12 @@ var useTranslation = (ns, props = {}) => {
|
|
|
23292
23309
|
const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
23293
23310
|
const getT = () => memoGetT;
|
|
23294
23311
|
const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
23295
|
-
const [t3, setT] = (0,
|
|
23312
|
+
const [t3, setT] = (0, import_react66.useState)(getT);
|
|
23296
23313
|
let joinedNS = namespaces.join();
|
|
23297
23314
|
if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
|
|
23298
23315
|
const previousJoinedNS = usePrevious(joinedNS);
|
|
23299
|
-
const isMounted = (0,
|
|
23300
|
-
(0,
|
|
23316
|
+
const isMounted = (0, import_react66.useRef)(true);
|
|
23317
|
+
(0, import_react66.useEffect)(() => {
|
|
23301
23318
|
const {
|
|
23302
23319
|
bindI18n,
|
|
23303
23320
|
bindI18nStore
|
|
@@ -23328,7 +23345,7 @@ var useTranslation = (ns, props = {}) => {
|
|
|
23328
23345
|
if (bindI18nStore && i18n) bindI18nStore.split(" ").forEach((e2) => i18n.store.off(e2, boundReset));
|
|
23329
23346
|
};
|
|
23330
23347
|
}, [i18n, joinedNS]);
|
|
23331
|
-
(0,
|
|
23348
|
+
(0, import_react66.useEffect)(() => {
|
|
23332
23349
|
if (isMounted.current && ready) {
|
|
23333
23350
|
setT(getT);
|
|
23334
23351
|
}
|
|
@@ -23350,35 +23367,35 @@ var useTranslation = (ns, props = {}) => {
|
|
|
23350
23367
|
|
|
23351
23368
|
// ../../node_modules/react-i18next/dist/es/withTranslation.js
|
|
23352
23369
|
init_esm_shims();
|
|
23353
|
-
var
|
|
23370
|
+
var import_react67 = __toESM(require_react(), 1);
|
|
23354
23371
|
|
|
23355
23372
|
// ../../node_modules/react-i18next/dist/es/Translation.js
|
|
23356
23373
|
init_esm_shims();
|
|
23357
23374
|
|
|
23358
23375
|
// ../../node_modules/react-i18next/dist/es/I18nextProvider.js
|
|
23359
23376
|
init_esm_shims();
|
|
23360
|
-
var
|
|
23377
|
+
var import_react68 = __toESM(require_react(), 1);
|
|
23361
23378
|
function I18nextProvider({
|
|
23362
23379
|
i18n,
|
|
23363
23380
|
defaultNS,
|
|
23364
23381
|
children
|
|
23365
23382
|
}) {
|
|
23366
|
-
const value2 = (0,
|
|
23383
|
+
const value2 = (0, import_react68.useMemo)(() => ({
|
|
23367
23384
|
i18n,
|
|
23368
23385
|
defaultNS
|
|
23369
23386
|
}), [i18n, defaultNS]);
|
|
23370
|
-
return (0,
|
|
23387
|
+
return (0, import_react68.createElement)(I18nContext.Provider, {
|
|
23371
23388
|
value: value2
|
|
23372
23389
|
}, children);
|
|
23373
23390
|
}
|
|
23374
23391
|
|
|
23375
23392
|
// ../../node_modules/react-i18next/dist/es/withSSR.js
|
|
23376
23393
|
init_esm_shims();
|
|
23377
|
-
var
|
|
23394
|
+
var import_react70 = __toESM(require_react(), 1);
|
|
23378
23395
|
|
|
23379
23396
|
// ../../node_modules/react-i18next/dist/es/useSSR.js
|
|
23380
23397
|
init_esm_shims();
|
|
23381
|
-
var
|
|
23398
|
+
var import_react69 = __toESM(require_react(), 1);
|
|
23382
23399
|
|
|
23383
23400
|
// ../cli-i18n/src/create-i18n.ts
|
|
23384
23401
|
init_esm_shims();
|
|
@@ -29135,8 +29152,8 @@ var I18nProvider = ({
|
|
|
29135
29152
|
messages,
|
|
29136
29153
|
i18n: initialI18n
|
|
29137
29154
|
}) => {
|
|
29138
|
-
const [i18n] = (0,
|
|
29139
|
-
return /* @__PURE__ */
|
|
29155
|
+
const [i18n] = (0, import_react71.useState)(() => initialI18n ?? createI18n(messages));
|
|
29156
|
+
return /* @__PURE__ */ import_react71.default.createElement(I18nextProvider, { i18n }, children);
|
|
29140
29157
|
};
|
|
29141
29158
|
|
|
29142
29159
|
// ../cli-i18n/src/index.ts
|
|
@@ -29174,6 +29191,7 @@ export {
|
|
|
29174
29191
|
PointerIcon,
|
|
29175
29192
|
PointerSmallIcon,
|
|
29176
29193
|
SuccessIcon,
|
|
29194
|
+
Learn,
|
|
29177
29195
|
InputLabel,
|
|
29178
29196
|
ConfirmInput,
|
|
29179
29197
|
SelectOptionAvailability,
|
|
@@ -29244,4 +29262,4 @@ react-reconciler/cjs/react-reconciler-constants.production.min.js:
|
|
|
29244
29262
|
* LICENSE file in the root directory of this source tree.
|
|
29245
29263
|
*)
|
|
29246
29264
|
*/
|
|
29247
|
-
//# sourceMappingURL=chunk-
|
|
29265
|
+
//# sourceMappingURL=chunk-PM4M3SGC.js.map
|