@piedata/pieui 2.0.5 → 2.0.6
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/cli.js +223 -97
- package/dist/code/commands/init.d.ts.map +1 -1
- package/dist/code/templates/index.d.ts +2 -1
- package/dist/code/templates/index.d.ts.map +1 -1
- package/dist/code/templates/nextConfig.d.ts +3 -0
- package/dist/code/templates/nextConfig.d.ts.map +1 -0
- package/dist/components/Common/CloudStorageCard/index.d.ts +3 -0
- package/dist/components/Common/CloudStorageCard/index.d.ts.map +1 -0
- package/dist/components/Common/CloudStorageCard/types/index.d.ts +13 -0
- package/dist/components/Common/CloudStorageCard/types/index.d.ts.map +1 -0
- package/dist/components/Common/CloudStorageCard/ui/CloudStorageCard.d.ts +4 -0
- package/dist/components/Common/CloudStorageCard/ui/CloudStorageCard.d.ts.map +1 -0
- package/dist/components/Common/DeviceStorageCard/index.d.ts +3 -0
- package/dist/components/Common/DeviceStorageCard/index.d.ts.map +1 -0
- package/dist/components/Common/DeviceStorageCard/types/index.d.ts +13 -0
- package/dist/components/Common/DeviceStorageCard/types/index.d.ts.map +1 -0
- package/dist/components/Common/DeviceStorageCard/ui/DeviceStorageCard.d.ts +4 -0
- package/dist/components/Common/DeviceStorageCard/ui/DeviceStorageCard.d.ts.map +1 -0
- package/dist/components/Common/SecureStorageCard/index.d.ts +3 -0
- package/dist/components/Common/SecureStorageCard/index.d.ts.map +1 -0
- package/dist/components/Common/SecureStorageCard/types/index.d.ts +13 -0
- package/dist/components/Common/SecureStorageCard/types/index.d.ts.map +1 -0
- package/dist/components/Common/SecureStorageCard/ui/SecureStorageCard.d.ts +4 -0
- package/dist/components/Common/SecureStorageCard/ui/SecureStorageCard.d.ts.map +1 -0
- package/dist/components/Common/SessionStorageCard/index.d.ts +3 -0
- package/dist/components/Common/SessionStorageCard/index.d.ts.map +1 -0
- package/dist/components/Common/SessionStorageCard/types/index.d.ts +13 -0
- package/dist/components/Common/SessionStorageCard/types/index.d.ts.map +1 -0
- package/dist/components/Common/SessionStorageCard/ui/SessionStorageCard.d.ts +4 -0
- package/dist/components/Common/SessionStorageCard/ui/SessionStorageCard.d.ts.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.esm.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.js +2 -2
- package/dist/pieui.components.json +144 -0
- package/dist/tests/mittAgentTools.test.d.ts +2 -0
- package/dist/tests/mittAgentTools.test.d.ts.map +1 -0
- package/dist/util/ajaxCommonUtils.d.ts +21 -2
- package/dist/util/ajaxCommonUtils.d.ts.map +1 -1
- package/dist/util/mittAgentTools.d.ts +89 -0
- package/dist/util/mittAgentTools.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -398,13 +398,15 @@ var require_brace_expansion = __commonJS((exports2, module2) => {
|
|
|
398
398
|
parts.push.apply(parts, p);
|
|
399
399
|
return parts;
|
|
400
400
|
}
|
|
401
|
-
function expandTop(str) {
|
|
401
|
+
function expandTop(str, options) {
|
|
402
402
|
if (!str)
|
|
403
403
|
return [];
|
|
404
|
+
options = options || {};
|
|
405
|
+
var max = options.max == null ? Infinity : options.max;
|
|
404
406
|
if (str.substr(0, 2) === "{}") {
|
|
405
407
|
str = "\\{\\}" + str.substr(2);
|
|
406
408
|
}
|
|
407
|
-
return expand(escapeBraces(str), true).map(unescapeBraces);
|
|
409
|
+
return expand(escapeBraces(str), max, true).map(unescapeBraces);
|
|
408
410
|
}
|
|
409
411
|
function embrace(str) {
|
|
410
412
|
return "{" + str + "}";
|
|
@@ -418,7 +420,7 @@ var require_brace_expansion = __commonJS((exports2, module2) => {
|
|
|
418
420
|
function gte(i, y) {
|
|
419
421
|
return i >= y;
|
|
420
422
|
}
|
|
421
|
-
function expand(str, isTop) {
|
|
423
|
+
function expand(str, max, isTop) {
|
|
422
424
|
var expansions = [];
|
|
423
425
|
var m = balanced("{", "}", str);
|
|
424
426
|
if (!m || /\$$/.test(m.pre))
|
|
@@ -430,7 +432,7 @@ var require_brace_expansion = __commonJS((exports2, module2) => {
|
|
|
430
432
|
if (!isSequence && !isOptions) {
|
|
431
433
|
if (m.post.match(/,(?!,).*\}/)) {
|
|
432
434
|
str = m.pre + "{" + m.body + escClose + m.post;
|
|
433
|
-
return expand(str);
|
|
435
|
+
return expand(str, max, true);
|
|
434
436
|
}
|
|
435
437
|
return [str];
|
|
436
438
|
}
|
|
@@ -440,9 +442,9 @@ var require_brace_expansion = __commonJS((exports2, module2) => {
|
|
|
440
442
|
} else {
|
|
441
443
|
n7 = parseCommaParts(m.body);
|
|
442
444
|
if (n7.length === 1) {
|
|
443
|
-
n7 = expand(n7[0], false).map(embrace);
|
|
445
|
+
n7 = expand(n7[0], max, false).map(embrace);
|
|
444
446
|
if (n7.length === 1) {
|
|
445
|
-
var post = m.post.length ? expand(m.post, false) : [""];
|
|
447
|
+
var post = m.post.length ? expand(m.post, max, false) : [""];
|
|
446
448
|
return post.map(function(p) {
|
|
447
449
|
return m.pre + n7[0] + p;
|
|
448
450
|
});
|
|
@@ -450,7 +452,7 @@ var require_brace_expansion = __commonJS((exports2, module2) => {
|
|
|
450
452
|
}
|
|
451
453
|
}
|
|
452
454
|
var pre = m.pre;
|
|
453
|
-
var post = m.post.length ? expand(m.post, false) : [""];
|
|
455
|
+
var post = m.post.length ? expand(m.post, max, false) : [""];
|
|
454
456
|
var N2;
|
|
455
457
|
if (isSequence) {
|
|
456
458
|
var x2 = numeric(n7[0]);
|
|
@@ -488,11 +490,11 @@ var require_brace_expansion = __commonJS((exports2, module2) => {
|
|
|
488
490
|
}
|
|
489
491
|
} else {
|
|
490
492
|
N2 = concatMap(n7, function(el) {
|
|
491
|
-
return expand(el, false);
|
|
493
|
+
return expand(el, max, false);
|
|
492
494
|
});
|
|
493
495
|
}
|
|
494
496
|
for (var j2 = 0;j2 < N2.length; j2++) {
|
|
495
|
-
for (var k2 = 0;k2 < post.length; k2++) {
|
|
497
|
+
for (var k2 = 0;k2 < post.length && expansions.length < max; k2++) {
|
|
496
498
|
var expansion = pre + N2[j2] + post[k2];
|
|
497
499
|
if (!isTop || isSequence || expansion)
|
|
498
500
|
expansions.push(expansion);
|
|
@@ -184074,94 +184076,6 @@ var printUsage = () => {
|
|
|
184074
184076
|
// src/code/commands/init.ts
|
|
184075
184077
|
var import_fs = __toESM(require("fs"));
|
|
184076
184078
|
var import_path = __toESM(require("path"));
|
|
184077
|
-
var initCommand = (outDir) => {
|
|
184078
|
-
const resolvedOutDir = import_path.default.resolve(process.cwd(), outDir);
|
|
184079
|
-
console.log(`[pieui] Initializing piecomponents directory in ${resolvedOutDir}...`);
|
|
184080
|
-
const pieComponentsDir = import_path.default.join(resolvedOutDir, "piecomponents");
|
|
184081
|
-
if (!import_fs.default.existsSync(pieComponentsDir)) {
|
|
184082
|
-
import_fs.default.mkdirSync(pieComponentsDir, { recursive: true });
|
|
184083
|
-
console.log("[pieui] Created piecomponents directory");
|
|
184084
|
-
} else {
|
|
184085
|
-
console.log("[pieui] piecomponents directory already exists");
|
|
184086
|
-
}
|
|
184087
|
-
const registryPath = import_path.default.join(pieComponentsDir, "registry.ts");
|
|
184088
|
-
const registryContent = `"use client";
|
|
184089
|
-
|
|
184090
|
-
// Side-effect imports — each index.ts calls registerPieComponent at module level
|
|
184091
|
-
// Example:
|
|
184092
|
-
// import "@/piecomponents/MyCustomCard";
|
|
184093
|
-
`;
|
|
184094
|
-
if (!import_fs.default.existsSync(registryPath)) {
|
|
184095
|
-
import_fs.default.writeFileSync(registryPath, registryContent, "utf8");
|
|
184096
|
-
console.log("[pieui] Created registry.ts");
|
|
184097
|
-
} else {
|
|
184098
|
-
console.log("[pieui] registry.ts already exists");
|
|
184099
|
-
}
|
|
184100
|
-
const tailwindConfigPath = import_path.default.join(resolvedOutDir, "tailwind.config.js");
|
|
184101
|
-
const tailwindConfigTsPath = import_path.default.join(resolvedOutDir, "tailwind.config.ts");
|
|
184102
|
-
const pieuiContentPath = "./node_modules/@piedata/pieui/dist/**/*.{js,mjs,ts,jsx,tsx}";
|
|
184103
|
-
let configPath = null;
|
|
184104
|
-
if (import_fs.default.existsSync(tailwindConfigPath)) {
|
|
184105
|
-
configPath = tailwindConfigPath;
|
|
184106
|
-
} else if (import_fs.default.existsSync(tailwindConfigTsPath)) {
|
|
184107
|
-
configPath = tailwindConfigTsPath;
|
|
184108
|
-
}
|
|
184109
|
-
if (configPath) {
|
|
184110
|
-
console.log("[pieui] Updating Tailwind config...");
|
|
184111
|
-
try {
|
|
184112
|
-
let configContent = import_fs.default.readFileSync(configPath, "utf8");
|
|
184113
|
-
if (!configContent.includes(pieuiContentPath)) {
|
|
184114
|
-
const contentMatch = configContent.match(/content\s*:\s*\[([^\]]*)\]/s);
|
|
184115
|
-
if (contentMatch) {
|
|
184116
|
-
const contentArray = contentMatch[1];
|
|
184117
|
-
const newContentArray = contentArray.trim() ? `${contentArray.trim()},
|
|
184118
|
-
"${pieuiContentPath}"` : `
|
|
184119
|
-
"${pieuiContentPath}"
|
|
184120
|
-
`;
|
|
184121
|
-
configContent = configContent.replace(contentMatch[0], `content: [${newContentArray}]`);
|
|
184122
|
-
import_fs.default.writeFileSync(configPath, configContent, "utf8");
|
|
184123
|
-
console.log("[pieui] Added PieUI path to Tailwind content configuration");
|
|
184124
|
-
} else {
|
|
184125
|
-
console.log("[pieui] Warning: Could not find content array in Tailwind config");
|
|
184126
|
-
console.log("[pieui] Please manually add the following to your Tailwind content array:");
|
|
184127
|
-
console.log(`[pieui] "${pieuiContentPath}"`);
|
|
184128
|
-
}
|
|
184129
|
-
} else {
|
|
184130
|
-
console.log("[pieui] PieUI path already exists in Tailwind config");
|
|
184131
|
-
}
|
|
184132
|
-
} catch (error) {
|
|
184133
|
-
console.error("[pieui] Error updating Tailwind config:", error);
|
|
184134
|
-
console.log("[pieui] Please manually add the following to your Tailwind content array:");
|
|
184135
|
-
console.log(`[pieui] "${pieuiContentPath}"`);
|
|
184136
|
-
}
|
|
184137
|
-
} else {
|
|
184138
|
-
console.log("[pieui] No Tailwind config found. If you use Tailwind CSS, add this to your content array:");
|
|
184139
|
-
console.log(`[pieui] "${pieuiContentPath}"`);
|
|
184140
|
-
}
|
|
184141
|
-
console.log("[pieui] Initialization complete!");
|
|
184142
|
-
console.log("[pieui] Next steps:");
|
|
184143
|
-
console.log(' 1. Import "./piecomponents/registry" in your app entry point');
|
|
184144
|
-
console.log(' 2. Use "pieui add <ComponentName>" to create new components');
|
|
184145
|
-
};
|
|
184146
|
-
|
|
184147
|
-
// src/code/commands/add.ts
|
|
184148
|
-
var import_fs3 = __toESM(require("fs"));
|
|
184149
|
-
var import_path3 = __toESM(require("path"));
|
|
184150
|
-
|
|
184151
|
-
// src/code/registryPath.ts
|
|
184152
|
-
var import_fs2 = __toESM(require("fs"));
|
|
184153
|
-
var import_path2 = __toESM(require("path"));
|
|
184154
|
-
var resolveRegistryPath = (pieComponentsDir) => {
|
|
184155
|
-
const tsPath = import_path2.default.join(pieComponentsDir, "registry.ts");
|
|
184156
|
-
if (import_fs2.default.existsSync(tsPath)) {
|
|
184157
|
-
return tsPath;
|
|
184158
|
-
}
|
|
184159
|
-
const tsxPath = import_path2.default.join(pieComponentsDir, "registry.tsx");
|
|
184160
|
-
if (import_fs2.default.existsSync(tsxPath)) {
|
|
184161
|
-
return tsxPath;
|
|
184162
|
-
}
|
|
184163
|
-
return tsPath;
|
|
184164
|
-
};
|
|
184165
184079
|
|
|
184166
184080
|
// src/code/templates/componentIndex.ts
|
|
184167
184081
|
var componentIndexTemplate = (componentName) => `import { registerPieComponent } from "@piedata/pieui";
|
|
@@ -184291,6 +184205,31 @@ const ${componentName} = ({
|
|
|
184291
184205
|
export default ${componentName}
|
|
184292
184206
|
`;
|
|
184293
184207
|
|
|
184208
|
+
// src/code/templates/nextConfig.ts
|
|
184209
|
+
var REQUIRED_NEXT_CONFIG_ENV_KEYS = [
|
|
184210
|
+
"PIE_API_SERVER",
|
|
184211
|
+
"PIE_CENTRIFUGE_SERVER",
|
|
184212
|
+
"PIE_ENABLE_RENDERING_LOG",
|
|
184213
|
+
"PIE_PLATFORM"
|
|
184214
|
+
];
|
|
184215
|
+
var nextConfigTemplate = () => `import type { NextConfig } from "next";
|
|
184216
|
+
|
|
184217
|
+
const nextConfig: NextConfig = {
|
|
184218
|
+
output: "standalone",
|
|
184219
|
+
reactCompiler: false,
|
|
184220
|
+
env: {
|
|
184221
|
+
PIE_API_SERVER: process.env.PIE_API_SERVER,
|
|
184222
|
+
PIE_CENTRIFUGE_SERVER: process.env.PIE_CENTRIFUGE_SERVER,
|
|
184223
|
+
PIE_ENABLE_RENDERING_LOG: process.env.PIE_ENABLE_RENDERING_LOG,
|
|
184224
|
+
PIE_PLATFORM: process.env.PIE_PLATFORM || "telegram",
|
|
184225
|
+
},
|
|
184226
|
+
reactStrictMode: true,
|
|
184227
|
+
transpilePackages: ["@piedata/pieui"],
|
|
184228
|
+
};
|
|
184229
|
+
|
|
184230
|
+
export default nextConfig;
|
|
184231
|
+
`;
|
|
184232
|
+
|
|
184294
184233
|
// src/code/templates/index.ts
|
|
184295
184234
|
var BASE_INTERFACE_BY_TYPE = {
|
|
184296
184235
|
simple: "PieSimpleComponentProps",
|
|
@@ -184313,6 +184252,193 @@ var componentTemplateFor = (componentType, componentName) => {
|
|
|
184313
184252
|
}
|
|
184314
184253
|
};
|
|
184315
184254
|
|
|
184255
|
+
// src/code/commands/init.ts
|
|
184256
|
+
var initCommand = (outDir) => {
|
|
184257
|
+
const resolvedOutDir = import_path.default.resolve(process.cwd(), outDir);
|
|
184258
|
+
console.log(`[pieui] Initializing piecomponents directory in ${resolvedOutDir}...`);
|
|
184259
|
+
const pieComponentsDir = import_path.default.join(resolvedOutDir, "piecomponents");
|
|
184260
|
+
if (!import_fs.default.existsSync(pieComponentsDir)) {
|
|
184261
|
+
import_fs.default.mkdirSync(pieComponentsDir, { recursive: true });
|
|
184262
|
+
console.log("[pieui] Created piecomponents directory");
|
|
184263
|
+
} else {
|
|
184264
|
+
console.log("[pieui] piecomponents directory already exists");
|
|
184265
|
+
}
|
|
184266
|
+
const registryPath = import_path.default.join(pieComponentsDir, "registry.ts");
|
|
184267
|
+
const registryContent = `"use client";
|
|
184268
|
+
|
|
184269
|
+
// Side-effect imports — each index.ts calls registerPieComponent at module level
|
|
184270
|
+
// Example:
|
|
184271
|
+
// import "@/piecomponents/MyCustomCard";
|
|
184272
|
+
`;
|
|
184273
|
+
if (!import_fs.default.existsSync(registryPath)) {
|
|
184274
|
+
import_fs.default.writeFileSync(registryPath, registryContent, "utf8");
|
|
184275
|
+
console.log("[pieui] Created registry.ts");
|
|
184276
|
+
} else {
|
|
184277
|
+
console.log("[pieui] registry.ts already exists");
|
|
184278
|
+
}
|
|
184279
|
+
const tailwindConfigPath = import_path.default.join(resolvedOutDir, "tailwind.config.js");
|
|
184280
|
+
const tailwindConfigTsPath = import_path.default.join(resolvedOutDir, "tailwind.config.ts");
|
|
184281
|
+
const pieuiContentPath = "./node_modules/@piedata/pieui/dist/**/*.{js,mjs,ts,jsx,tsx}";
|
|
184282
|
+
let configPath = null;
|
|
184283
|
+
if (import_fs.default.existsSync(tailwindConfigPath)) {
|
|
184284
|
+
configPath = tailwindConfigPath;
|
|
184285
|
+
} else if (import_fs.default.existsSync(tailwindConfigTsPath)) {
|
|
184286
|
+
configPath = tailwindConfigTsPath;
|
|
184287
|
+
}
|
|
184288
|
+
if (configPath) {
|
|
184289
|
+
console.log("[pieui] Updating Tailwind config...");
|
|
184290
|
+
try {
|
|
184291
|
+
let configContent = import_fs.default.readFileSync(configPath, "utf8");
|
|
184292
|
+
if (!configContent.includes(pieuiContentPath)) {
|
|
184293
|
+
const contentMatch = configContent.match(/content\s*:\s*\[([^\]]*)\]/s);
|
|
184294
|
+
if (contentMatch) {
|
|
184295
|
+
const contentArray = contentMatch[1];
|
|
184296
|
+
const newContentArray = contentArray.trim() ? `${contentArray.trim()},
|
|
184297
|
+
"${pieuiContentPath}"` : `
|
|
184298
|
+
"${pieuiContentPath}"
|
|
184299
|
+
`;
|
|
184300
|
+
configContent = configContent.replace(contentMatch[0], `content: [${newContentArray}]`);
|
|
184301
|
+
import_fs.default.writeFileSync(configPath, configContent, "utf8");
|
|
184302
|
+
console.log("[pieui] Added PieUI path to Tailwind content configuration");
|
|
184303
|
+
} else {
|
|
184304
|
+
console.log("[pieui] Warning: Could not find content array in Tailwind config");
|
|
184305
|
+
console.log("[pieui] Please manually add the following to your Tailwind content array:");
|
|
184306
|
+
console.log(`[pieui] "${pieuiContentPath}"`);
|
|
184307
|
+
}
|
|
184308
|
+
} else {
|
|
184309
|
+
console.log("[pieui] PieUI path already exists in Tailwind config");
|
|
184310
|
+
}
|
|
184311
|
+
} catch (error) {
|
|
184312
|
+
console.error("[pieui] Error updating Tailwind config:", error);
|
|
184313
|
+
console.log("[pieui] Please manually add the following to your Tailwind content array:");
|
|
184314
|
+
console.log(`[pieui] "${pieuiContentPath}"`);
|
|
184315
|
+
}
|
|
184316
|
+
} else {
|
|
184317
|
+
console.log("[pieui] No Tailwind config found. If you use Tailwind CSS, add this to your content array:");
|
|
184318
|
+
console.log(`[pieui] "${pieuiContentPath}"`);
|
|
184319
|
+
}
|
|
184320
|
+
ensureNextConfig(resolvedOutDir);
|
|
184321
|
+
console.log("[pieui] Initialization complete!");
|
|
184322
|
+
console.log("[pieui] Next steps:");
|
|
184323
|
+
console.log(' 1. Import "./piecomponents/registry" in your app entry point');
|
|
184324
|
+
console.log(' 2. Use "pieui add <ComponentName>" to create new components');
|
|
184325
|
+
};
|
|
184326
|
+
var ensureNextConfig = (resolvedOutDir) => {
|
|
184327
|
+
const candidates = [
|
|
184328
|
+
"next.config.ts",
|
|
184329
|
+
"next.config.mjs",
|
|
184330
|
+
"next.config.js",
|
|
184331
|
+
"next.config.cjs"
|
|
184332
|
+
];
|
|
184333
|
+
const existing = candidates.map((name) => import_path.default.join(resolvedOutDir, name)).find((filePath) => import_fs.default.existsSync(filePath));
|
|
184334
|
+
if (!existing) {
|
|
184335
|
+
const targetPath = import_path.default.join(resolvedOutDir, "next.config.ts");
|
|
184336
|
+
try {
|
|
184337
|
+
import_fs.default.writeFileSync(targetPath, nextConfigTemplate(), "utf8");
|
|
184338
|
+
console.log("[pieui] Created next.config.ts with PieUI env vars");
|
|
184339
|
+
} catch (error) {
|
|
184340
|
+
console.error("[pieui] Failed to create next.config.ts:", error);
|
|
184341
|
+
}
|
|
184342
|
+
return;
|
|
184343
|
+
}
|
|
184344
|
+
console.log(`[pieui] Existing Next.js config detected: ${import_path.default.basename(existing)}`);
|
|
184345
|
+
try {
|
|
184346
|
+
const originalContent = import_fs.default.readFileSync(existing, "utf8");
|
|
184347
|
+
let updatedContent = originalContent;
|
|
184348
|
+
updatedContent = ensureEnvKeys(updatedContent);
|
|
184349
|
+
updatedContent = ensureTranspilePieui(updatedContent);
|
|
184350
|
+
if (updatedContent !== originalContent) {
|
|
184351
|
+
import_fs.default.writeFileSync(existing, updatedContent, "utf8");
|
|
184352
|
+
console.log(`[pieui] Updated ${import_path.default.basename(existing)} with missing PieUI settings`);
|
|
184353
|
+
} else {
|
|
184354
|
+
console.log("[pieui] Next.js config already has all PieUI settings");
|
|
184355
|
+
}
|
|
184356
|
+
} catch (error) {
|
|
184357
|
+
console.error("[pieui] Error updating Next.js config:", error);
|
|
184358
|
+
}
|
|
184359
|
+
};
|
|
184360
|
+
var CONFIG_OBJECT_OPEN = /(const\s+nextConfig\s*(?::\s*[A-Za-z_][\w.]*)?\s*=\s*|module\.exports\s*=\s*|export\s+default\s*)\{/;
|
|
184361
|
+
var envEntryFor = (key) => {
|
|
184362
|
+
if (key === "PIE_PLATFORM") {
|
|
184363
|
+
return ` ${key}: process.env.${key} || "telegram",`;
|
|
184364
|
+
}
|
|
184365
|
+
return ` ${key}: process.env.${key},`;
|
|
184366
|
+
};
|
|
184367
|
+
var ensureEnvKeys = (content) => {
|
|
184368
|
+
const missingKeys = REQUIRED_NEXT_CONFIG_ENV_KEYS.filter((key) => !content.includes(key));
|
|
184369
|
+
if (missingKeys.length === 0)
|
|
184370
|
+
return content;
|
|
184371
|
+
const envBlockMatch = content.match(/env\s*:\s*\{([\s\S]*?)}/);
|
|
184372
|
+
if (envBlockMatch) {
|
|
184373
|
+
const inner = envBlockMatch[1];
|
|
184374
|
+
const trimmed = inner.replace(/\s+$/, "");
|
|
184375
|
+
const needsComma = trimmed.trim().length > 0 && !trimmed.trimEnd().endsWith(",");
|
|
184376
|
+
const addition = missingKeys.map(envEntryFor).join(`
|
|
184377
|
+
`);
|
|
184378
|
+
const newInner = `${trimmed}${needsComma ? "," : ""}
|
|
184379
|
+
${addition}
|
|
184380
|
+
`;
|
|
184381
|
+
console.log(`[pieui] Adding missing env vars: ${missingKeys.join(", ")}`);
|
|
184382
|
+
return content.replace(envBlockMatch[0], `env: {${newInner}}`);
|
|
184383
|
+
}
|
|
184384
|
+
const envBlock = ` env: {
|
|
184385
|
+
${missingKeys.map(envEntryFor).join(`
|
|
184386
|
+
`)}
|
|
184387
|
+
},`;
|
|
184388
|
+
const inserted = insertIntoConfigObject(content, envBlock);
|
|
184389
|
+
if (inserted) {
|
|
184390
|
+
console.log(`[pieui] Adding env block with: ${missingKeys.join(", ")}`);
|
|
184391
|
+
return inserted;
|
|
184392
|
+
}
|
|
184393
|
+
console.log("[pieui] Warning: could not locate nextConfig object to add env block automatically");
|
|
184394
|
+
return content;
|
|
184395
|
+
};
|
|
184396
|
+
var ensureTranspilePieui = (content) => {
|
|
184397
|
+
const match = content.match(/transpilePackages\s*:\s*\[([\s\S]*?)]/);
|
|
184398
|
+
if (match) {
|
|
184399
|
+
if (match[1].includes("@piedata/pieui"))
|
|
184400
|
+
return content;
|
|
184401
|
+
const inner = match[1].trim();
|
|
184402
|
+
const separator = inner.length > 0 ? ", " : "";
|
|
184403
|
+
console.log('[pieui] Adding "@piedata/pieui" to transpilePackages');
|
|
184404
|
+
return content.replace(match[0], `transpilePackages: [${inner}${separator}"@piedata/pieui"]`);
|
|
184405
|
+
}
|
|
184406
|
+
const inserted = insertIntoConfigObject(content, ' transpilePackages: ["@piedata/pieui"],');
|
|
184407
|
+
if (inserted) {
|
|
184408
|
+
console.log('[pieui] Adding transpilePackages: ["@piedata/pieui"]');
|
|
184409
|
+
return inserted;
|
|
184410
|
+
}
|
|
184411
|
+
console.log("[pieui] Warning: could not locate nextConfig object to add transpilePackages automatically");
|
|
184412
|
+
return content;
|
|
184413
|
+
};
|
|
184414
|
+
var insertIntoConfigObject = (content, snippet) => {
|
|
184415
|
+
const match = content.match(CONFIG_OBJECT_OPEN);
|
|
184416
|
+
if (!match || match.index === undefined)
|
|
184417
|
+
return null;
|
|
184418
|
+
const insertAt = match.index + match[0].length;
|
|
184419
|
+
return `${content.slice(0, insertAt)}
|
|
184420
|
+
${snippet}${content.slice(insertAt)}`;
|
|
184421
|
+
};
|
|
184422
|
+
|
|
184423
|
+
// src/code/commands/add.ts
|
|
184424
|
+
var import_fs3 = __toESM(require("fs"));
|
|
184425
|
+
var import_path3 = __toESM(require("path"));
|
|
184426
|
+
|
|
184427
|
+
// src/code/registryPath.ts
|
|
184428
|
+
var import_fs2 = __toESM(require("fs"));
|
|
184429
|
+
var import_path2 = __toESM(require("path"));
|
|
184430
|
+
var resolveRegistryPath = (pieComponentsDir) => {
|
|
184431
|
+
const tsPath = import_path2.default.join(pieComponentsDir, "registry.ts");
|
|
184432
|
+
if (import_fs2.default.existsSync(tsPath)) {
|
|
184433
|
+
return tsPath;
|
|
184434
|
+
}
|
|
184435
|
+
const tsxPath = import_path2.default.join(pieComponentsDir, "registry.tsx");
|
|
184436
|
+
if (import_fs2.default.existsSync(tsxPath)) {
|
|
184437
|
+
return tsxPath;
|
|
184438
|
+
}
|
|
184439
|
+
return tsPath;
|
|
184440
|
+
};
|
|
184441
|
+
|
|
184316
184442
|
// src/code/commands/add.ts
|
|
184317
184443
|
var updateRegistryFile = (registryPath, componentName, componentDir) => {
|
|
184318
184444
|
let registryContent = import_fs3.default.readFileSync(registryPath, "utf8");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/code/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/code/commands/init.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,SA4GzC,CAAA"}
|
|
@@ -2,7 +2,8 @@ import { ComponentType } from '../types';
|
|
|
2
2
|
import { componentIndexTemplate } from './componentIndex';
|
|
3
3
|
import { componentTypesTemplate } from './componentTypes';
|
|
4
4
|
import { registerCallTemplate } from './registerCall';
|
|
5
|
-
|
|
5
|
+
import { nextConfigTemplate, REQUIRED_NEXT_CONFIG_ENV_KEYS } from './nextConfig';
|
|
6
|
+
export { componentIndexTemplate, componentTypesTemplate, registerCallTemplate, nextConfigTemplate, REQUIRED_NEXT_CONFIG_ENV_KEYS, };
|
|
6
7
|
export declare const baseInterfaceFor: (componentType: ComponentType) => string;
|
|
7
8
|
export declare const componentTemplateFor: (componentType: ComponentType, componentName: string) => string;
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/code/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/code/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAKrD,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAA;AAEhF,OAAO,EACH,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,6BAA6B,GAChC,CAAA;AASD,eAAO,MAAM,gBAAgB,GAAI,eAAe,aAAa,KAAG,MACvB,CAAA;AAEzC,eAAO,MAAM,oBAAoB,GAC7B,eAAe,aAAa,EAC5B,eAAe,MAAM,KACtB,MAYF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextConfig.d.ts","sourceRoot":"","sources":["../../../src/code/templates/nextConfig.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,kGAKhC,CAAA;AAEV,eAAO,MAAM,kBAAkB,QAAO,MAiBrC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Common/CloudStorageCard/index.ts"],"names":[],"mappings":";AAGA,wBAIE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PieSimpleComponentProps } from '../../../../types';
|
|
2
|
+
export interface CloudStorageCardData {
|
|
3
|
+
name: string;
|
|
4
|
+
key: string;
|
|
5
|
+
value: string;
|
|
6
|
+
useSocketioSupport?: boolean;
|
|
7
|
+
useCentrifugeSupport?: boolean;
|
|
8
|
+
useMittSupport?: boolean;
|
|
9
|
+
centrifugeChannel?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CloudStorageCardProps extends PieSimpleComponentProps<CloudStorageCardData> {
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/CloudStorageCard/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IAEb,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB,CAAC,oBAAoB,CAAC;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CloudStorageCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/CloudStorageCard/ui/CloudStorageCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAGhD,QAAA,MAAM,gBAAgB,GAAI,UAAU,qBAAqB,4CA6CxD,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Common/DeviceStorageCard/index.ts"],"names":[],"mappings":";AAGA,wBAIE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PieSimpleComponentProps } from '../../../../types';
|
|
2
|
+
export interface DeviceStorageCardData {
|
|
3
|
+
name: string;
|
|
4
|
+
key: string;
|
|
5
|
+
value: string;
|
|
6
|
+
useSocketioSupport?: boolean;
|
|
7
|
+
useCentrifugeSupport?: boolean;
|
|
8
|
+
useMittSupport?: boolean;
|
|
9
|
+
centrifugeChannel?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface DeviceStorageCardProps extends PieSimpleComponentProps<DeviceStorageCardData> {
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/DeviceStorageCard/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IAEb,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,sBAAuB,SAAQ,uBAAuB,CAAC,qBAAqB,CAAC;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceStorageCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/DeviceStorageCard/ui/DeviceStorageCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAGjD,QAAA,MAAM,iBAAiB,GAAI,UAAU,sBAAsB,4CA0C1D,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Common/SecureStorageCard/index.ts"],"names":[],"mappings":";AAGA,wBAIE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PieSimpleComponentProps } from '../../../../types';
|
|
2
|
+
export interface SecureStorageCardData {
|
|
3
|
+
name: string;
|
|
4
|
+
key: string;
|
|
5
|
+
value: string;
|
|
6
|
+
useSocketioSupport?: boolean;
|
|
7
|
+
useCentrifugeSupport?: boolean;
|
|
8
|
+
useMittSupport?: boolean;
|
|
9
|
+
centrifugeChannel?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SecureStorageCardProps extends PieSimpleComponentProps<SecureStorageCardData> {
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/SecureStorageCard/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IAEb,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,sBAAuB,SAAQ,uBAAuB,CAAC,qBAAqB,CAAC;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SecureStorageCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/SecureStorageCard/ui/SecureStorageCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAGjD,QAAA,MAAM,iBAAiB,GAAI,UAAU,sBAAsB,4CA6C1D,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Common/SessionStorageCard/index.ts"],"names":[],"mappings":";AAGA,wBAIE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PieSimpleComponentProps } from '../../../../types';
|
|
2
|
+
export interface SessionStorageCardData {
|
|
3
|
+
name: string;
|
|
4
|
+
key: string;
|
|
5
|
+
value: string;
|
|
6
|
+
useSocketioSupport?: boolean;
|
|
7
|
+
useCentrifugeSupport?: boolean;
|
|
8
|
+
useMittSupport?: boolean;
|
|
9
|
+
centrifugeChannel?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SessionStorageCardProps extends PieSimpleComponentProps<SessionStorageCardData> {
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/SessionStorageCard/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IAEb,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,uBAAwB,SAAQ,uBAAuB,CAAC,sBAAsB,CAAC;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionStorageCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/SessionStorageCard/ui/SessionStorageCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAGlD,QAAA,MAAM,kBAAkB,GAAI,UAAU,uBAAuB,4CA0C5D,CAAA;AAED,eAAe,kBAAkB,CAAA"}
|
|
@@ -7,6 +7,10 @@ export { default as HTMLEmbedCard } from './Common/HTMLEmbedCard';
|
|
|
7
7
|
export { default as HiddenCard } from './Common/HiddenCard';
|
|
8
8
|
export { default as AutoRedirectCard } from './Common/AutoRedirectCard';
|
|
9
9
|
export { default as IOEventsCard } from './Common/IOEventsCard';
|
|
10
|
+
export { default as SessionStorageCard } from './Common/SessionStorageCard';
|
|
11
|
+
export { default as DeviceStorageCard } from './Common/DeviceStorageCard';
|
|
12
|
+
export { default as CloudStorageCard } from './Common/CloudStorageCard';
|
|
13
|
+
export { default as SecureStorageCard } from './Common/SecureStorageCard';
|
|
10
14
|
export { default as AjaxGroupCard } from './Containers/AjaxGroupCard';
|
|
11
15
|
export { default as BoxCard } from './Containers/BoxCard';
|
|
12
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,MAAM,CAAA;AACpC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,MAAM,CAAA;AACpC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAA"}
|