@piedata/pieui 1.1.2 → 1.1.4
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 +124 -59
- package/dist/components/Buttons/AjaxButtonCard/ui/AjaxButtonCard.d.ts.map +1 -1
- package/dist/components/Chats/ChatCard/ui/ChatCard.d.ts.map +1 -1
- package/dist/components/PieRoot/index.d.ts.map +1 -1
- package/dist/components/index.esm.js +13 -13
- package/dist/components/index.js +20 -20
- package/dist/index.esm.js +15 -15
- package/dist/index.js +23 -23
- package/dist/util/ajaxCommonUtils.d.ts +7 -1
- package/dist/util/ajaxCommonUtils.d.ts.map +1 -1
- package/package.json +2 -5
- package/src/components/Buttons/AjaxButtonCard/index.ts +0 -1
- package/src/components/Buttons/AjaxButtonCard/types/index.ts +0 -17
- package/src/components/Buttons/AjaxButtonCard/ui/AjaxButtonCard.tsx +0 -38
- package/src/components/Chats/ChatCard/index.ts +0 -1
- package/src/components/Chats/ChatCard/types/annyang.d.ts +0 -11
- package/src/components/Chats/ChatCard/types/index.ts +0 -59
- package/src/components/Chats/ChatCard/ui/ChatCard.tsx +0 -130
- package/src/components/Chats/ChatCard/ui/components/AttachFileButton.tsx +0 -49
- package/src/components/Chats/ChatCard/ui/components/AttachedFileView.tsx +0 -29
- package/src/components/Chats/ChatCard/ui/components/ChatCardInput.tsx +0 -177
- package/src/components/Chats/ChatCard/ui/components/ChatOption.tsx +0 -25
- package/src/components/Chats/ChatCard/ui/components/Markdown.tsx +0 -21
- package/src/components/Chats/ChatCard/ui/components/MessageAvatar.tsx +0 -17
- package/src/components/Chats/ChatCard/ui/components/MessageCard.tsx +0 -80
- package/src/components/Chats/ChatCard/ui/components/MessageContent.tsx +0 -27
- package/src/components/Chats/ChatCard/ui/components/MessagesBoard.tsx +0 -61
- package/src/components/Chats/ChatCard/ui/components/Options.tsx +0 -20
- package/src/components/Chats/ChatCard/ui/components/ResizableTextarea.tsx +0 -59
- package/src/components/Chats/ChatCard/ui/components/SendButton.tsx +0 -37
- package/src/components/Chats/ChatCard/ui/components/VoiceListeningButton.tsx +0 -35
- package/src/components/Chats/ChatCard/ui/components/icons/AttachFileIcon.tsx +0 -18
- package/src/components/Chats/ChatCard/ui/components/icons/AttachedFileIcon.tsx +0 -18
- package/src/components/Chats/ChatCard/ui/components/icons/CancelFileIcon.tsx +0 -14
- package/src/components/Chats/ChatCard/ui/components/icons/DefaultAvatar.tsx +0 -10
- package/src/components/Chats/ChatCard/ui/components/icons/SendIcon.tsx +0 -18
- package/src/components/Chats/ChatCard/ui/components/icons/VoiceRecordIcon.tsx +0 -15
- package/src/components/Containers/AjaxGroupCard/index.ts +0 -1
- package/src/components/Containers/AjaxGroupCard/types/index.ts +0 -17
- package/src/components/Containers/AjaxGroupCard/ui/AjaxGroupCard.tsx +0 -96
- package/src/components/Containers/SequenceCard/index.ts +0 -1
- package/src/components/Containers/SequenceCard/types/index.ts +0 -10
- package/src/components/Containers/SequenceCard/ui/SequenceCard.tsx +0 -32
- package/src/components/Containers/UnionCard/index.ts +0 -1
- package/src/components/Containers/UnionCard/types/index.ts +0 -8
- package/src/components/Containers/UnionCard/ui/UnionCard.tsx +0 -27
- package/src/components/PieCard/index.tsx +0 -149
- package/src/components/PieCard/types/index.ts +0 -18
- package/src/components/PieRoot/index.tsx +0 -154
- package/src/components/PieRoot/types/index.ts +0 -14
- package/src/components/PieTelegramRoot/index.tsx +0 -161
- package/src/components/UI/index.tsx +0 -70
- package/src/components/index.ts +0 -6
- package/src/index.ts +0 -15
- package/src/providers/CentrifugeIOInitProvider.tsx +0 -42
- package/src/providers/SocketIOInitProvider.tsx +0 -52
- package/src/types/index.ts +0 -139
- package/src/util/ajaxCommonUtils.ts +0 -137
- package/src/util/centrifuge.ts +0 -33
- package/src/util/fallback.tsx +0 -6
- package/src/util/initializeComponents.ts +0 -84
- package/src/util/lazy.ts +0 -25
- package/src/util/mitt.ts +0 -11
- package/src/util/pieConfig.ts +0 -43
- package/src/util/registry.ts +0 -81
- package/src/util/socket.ts +0 -24
- package/src/util/sx2radium.ts +0 -15
- package/src/util/tailwindCommonUtils.ts +0 -6
- package/src/util/useIsSupported.ts +0 -17
- package/src/util/useOpenAIWebRTC.ts +0 -176
- package/src/util/useWebApp.ts +0 -32
- package/src/util/waitForSidAvailable.ts +0 -21
- package/src/util/webrtcClient.ts +0 -247
package/dist/cli.js
CHANGED
|
@@ -336949,10 +336949,9 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
336949
336949
|
var thisObjectHasOwnProperty = thisObjectPrototype.hasOwnProperty;
|
|
336950
336950
|
var ThisProxy = Proxy;
|
|
336951
336951
|
var ThisWeakMap = WeakMap;
|
|
336952
|
-
var
|
|
336953
|
-
|
|
336954
|
-
|
|
336955
|
-
} = ThisWeakMap.prototype;
|
|
336952
|
+
var thisWeakMapProto = ThisWeakMap.prototype;
|
|
336953
|
+
var thisWeakMapGet = thisWeakMapProto.get;
|
|
336954
|
+
var thisWeakMapSet = thisWeakMapProto.set;
|
|
336956
336955
|
var ThisMap = Map;
|
|
336957
336956
|
var thisMapGet = ThisMap.prototype.get;
|
|
336958
336957
|
var thisMapSet = ThisMap.prototype.set;
|
|
@@ -337058,6 +337057,13 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337058
337057
|
const mappingOtherToThis = new ThisWeakMap;
|
|
337059
337058
|
const protoMappings = new ThisMap;
|
|
337060
337059
|
const protoName = new ThisMap;
|
|
337060
|
+
const handlerToObject = new ThisWeakMap;
|
|
337061
|
+
function getHandlerObject(handler) {
|
|
337062
|
+
return thisReflectApply(thisWeakMapGet, handlerToObject, [handler]);
|
|
337063
|
+
}
|
|
337064
|
+
function handlerFromOtherWithContext(handler, other) {
|
|
337065
|
+
return thisFromOtherWithFactory(handler.getFactory(), other);
|
|
337066
|
+
}
|
|
337061
337067
|
function thisAddProtoMapping(proto, other, name) {
|
|
337062
337068
|
thisReflectApply(thisMapSet, protoMappings, [proto, thisIdMapping]);
|
|
337063
337069
|
thisReflectApply(thisMapSet, protoMappings, [
|
|
@@ -337160,7 +337166,7 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337160
337166
|
} else {
|
|
337161
337167
|
ret = desc.value;
|
|
337162
337168
|
}
|
|
337163
|
-
return handler
|
|
337169
|
+
return handlerFromOtherWithContext(handler, ret);
|
|
337164
337170
|
}
|
|
337165
337171
|
function otherFromThisIfAvailable(to, from, key) {
|
|
337166
337172
|
if (!thisReflectApply(thisObjectHasOwnProperty, from, [key]))
|
|
@@ -337176,17 +337182,11 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337176
337182
|
class BaseHandler extends SafeBase {
|
|
337177
337183
|
constructor(object) {
|
|
337178
337184
|
super();
|
|
337179
|
-
|
|
337180
|
-
}
|
|
337181
|
-
getObject() {
|
|
337182
|
-
return this.objectWrapper();
|
|
337185
|
+
thisReflectApply(thisWeakMapSet, handlerToObject, [this, object]);
|
|
337183
337186
|
}
|
|
337184
337187
|
getFactory() {
|
|
337185
337188
|
return defaultFactory;
|
|
337186
337189
|
}
|
|
337187
|
-
fromOtherWithContext(other) {
|
|
337188
|
-
return thisFromOtherWithFactory(this.getFactory(), other);
|
|
337189
|
-
}
|
|
337190
337190
|
doPreventExtensions(target, object, factory) {
|
|
337191
337191
|
let keys;
|
|
337192
337192
|
try {
|
|
@@ -337211,12 +337211,12 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337211
337211
|
if (current && !current.configurable)
|
|
337212
337212
|
continue;
|
|
337213
337213
|
if (desc.get || desc.set) {
|
|
337214
|
-
desc.get = this
|
|
337215
|
-
desc.set = this
|
|
337214
|
+
desc.get = handlerFromOtherWithContext(this, desc.get);
|
|
337215
|
+
desc.set = handlerFromOtherWithContext(this, desc.set);
|
|
337216
337216
|
} else if (typeof object === "function" && (key === "caller" || key === "callee" || key === "arguments")) {
|
|
337217
337217
|
desc.value = null;
|
|
337218
337218
|
} else {
|
|
337219
|
-
desc.value = this
|
|
337219
|
+
desc.value = handlerFromOtherWithContext(this, desc.value);
|
|
337220
337220
|
}
|
|
337221
337221
|
} else {
|
|
337222
337222
|
if (desc.get || desc.set) {
|
|
@@ -337240,7 +337240,7 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337240
337240
|
get(target, key, receiver) {
|
|
337241
337241
|
if (key === "isProxy")
|
|
337242
337242
|
return true;
|
|
337243
|
-
const object = this
|
|
337243
|
+
const object = getHandlerObject(this);
|
|
337244
337244
|
switch (key) {
|
|
337245
337245
|
case "constructor": {
|
|
337246
337246
|
const desc = otherSafeGetOwnPropertyDescriptor(object, key);
|
|
@@ -337280,10 +337280,10 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337280
337280
|
} catch (e) {
|
|
337281
337281
|
throw thisFromOtherForThrow(e);
|
|
337282
337282
|
}
|
|
337283
|
-
return this
|
|
337283
|
+
return handlerFromOtherWithContext(this, ret);
|
|
337284
337284
|
}
|
|
337285
337285
|
set(target, key, value2, receiver) {
|
|
337286
|
-
const object = this
|
|
337286
|
+
const object = getHandlerObject(this);
|
|
337287
337287
|
if (key === "__proto__" && !thisOtherHasOwnProperty(object, key)) {
|
|
337288
337288
|
return this.setPrototypeOf(target, value2);
|
|
337289
337289
|
}
|
|
@@ -337301,7 +337301,7 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337301
337301
|
throw new VMError(OPNA);
|
|
337302
337302
|
}
|
|
337303
337303
|
apply(target, context, args) {
|
|
337304
|
-
const object = this
|
|
337304
|
+
const object = getHandlerObject(this);
|
|
337305
337305
|
let ret;
|
|
337306
337306
|
try {
|
|
337307
337307
|
context = otherFromThis(context);
|
|
@@ -337313,7 +337313,7 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337313
337313
|
return thisFromOther(ret);
|
|
337314
337314
|
}
|
|
337315
337315
|
construct(target, args, newTarget) {
|
|
337316
|
-
const object = this
|
|
337316
|
+
const object = getHandlerObject(this);
|
|
337317
337317
|
let ret;
|
|
337318
337318
|
try {
|
|
337319
337319
|
args = otherFromThisArguments(args);
|
|
@@ -337324,7 +337324,7 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337324
337324
|
return thisFromOtherWithFactory(this.getFactory(), ret, thisFromOther(object));
|
|
337325
337325
|
}
|
|
337326
337326
|
getOwnPropertyDescriptorDesc(target, prop, desc) {
|
|
337327
|
-
const object = this
|
|
337327
|
+
const object = getHandlerObject(this);
|
|
337328
337328
|
if (desc && typeof object === "function" && (prop === "arguments" || prop === "caller" || prop === "callee"))
|
|
337329
337329
|
desc.value = null;
|
|
337330
337330
|
return desc;
|
|
@@ -337332,7 +337332,7 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337332
337332
|
getOwnPropertyDescriptor(target, prop) {
|
|
337333
337333
|
if (isDangerousCrossRealmSymbol(prop))
|
|
337334
337334
|
return;
|
|
337335
|
-
const object = this
|
|
337335
|
+
const object = getHandlerObject(this);
|
|
337336
337336
|
let desc;
|
|
337337
337337
|
try {
|
|
337338
337338
|
desc = otherSafeGetOwnPropertyDescriptor(object, prop);
|
|
@@ -337346,15 +337346,15 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337346
337346
|
if (desc.get || desc.set) {
|
|
337347
337347
|
thisDesc = {
|
|
337348
337348
|
__proto__: null,
|
|
337349
|
-
get: this
|
|
337350
|
-
set: this
|
|
337349
|
+
get: handlerFromOtherWithContext(this, desc.get),
|
|
337350
|
+
set: handlerFromOtherWithContext(this, desc.set),
|
|
337351
337351
|
enumerable: desc.enumerable === true,
|
|
337352
337352
|
configurable: desc.configurable === true
|
|
337353
337353
|
};
|
|
337354
337354
|
} else {
|
|
337355
337355
|
thisDesc = {
|
|
337356
337356
|
__proto__: null,
|
|
337357
|
-
value: this
|
|
337357
|
+
value: handlerFromOtherWithContext(this, desc.value),
|
|
337358
337358
|
writable: desc.writable === true,
|
|
337359
337359
|
enumerable: desc.enumerable === true,
|
|
337360
337360
|
configurable: desc.configurable === true
|
|
@@ -337373,7 +337373,7 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337373
337373
|
return desc;
|
|
337374
337374
|
}
|
|
337375
337375
|
defineProperty(target, prop, desc) {
|
|
337376
|
-
const object = this
|
|
337376
|
+
const object = getHandlerObject(this);
|
|
337377
337377
|
if (!thisReflectSetPrototypeOf(desc, null))
|
|
337378
337378
|
throw thisUnexpected();
|
|
337379
337379
|
desc = this.definePropertyDesc(target, prop, desc);
|
|
@@ -337403,15 +337403,15 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337403
337403
|
if (otherDesc.get || otherDesc.set) {
|
|
337404
337404
|
thisDesc = {
|
|
337405
337405
|
__proto__: null,
|
|
337406
|
-
get: this
|
|
337407
|
-
set: this
|
|
337406
|
+
get: handlerFromOtherWithContext(this, otherDesc.get),
|
|
337407
|
+
set: handlerFromOtherWithContext(this, otherDesc.set),
|
|
337408
337408
|
enumerable: otherDesc.enumerable,
|
|
337409
337409
|
configurable: otherDesc.configurable
|
|
337410
337410
|
};
|
|
337411
337411
|
} else {
|
|
337412
337412
|
thisDesc = {
|
|
337413
337413
|
__proto__: null,
|
|
337414
|
-
value: this
|
|
337414
|
+
value: handlerFromOtherWithContext(this, otherDesc.value),
|
|
337415
337415
|
writable: otherDesc.writable,
|
|
337416
337416
|
enumerable: otherDesc.enumerable,
|
|
337417
337417
|
configurable: otherDesc.configurable
|
|
@@ -337423,7 +337423,7 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337423
337423
|
return true;
|
|
337424
337424
|
}
|
|
337425
337425
|
deleteProperty(target, prop) {
|
|
337426
|
-
const object = this
|
|
337426
|
+
const object = getHandlerObject(this);
|
|
337427
337427
|
try {
|
|
337428
337428
|
return otherReflectDeleteProperty(object, prop) === true;
|
|
337429
337429
|
} catch (e) {
|
|
@@ -337433,7 +337433,7 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337433
337433
|
has(target, key) {
|
|
337434
337434
|
if (isDangerousCrossRealmSymbol(key))
|
|
337435
337435
|
return false;
|
|
337436
|
-
const object = this
|
|
337436
|
+
const object = getHandlerObject(this);
|
|
337437
337437
|
try {
|
|
337438
337438
|
return otherReflectHas(object, key) === true;
|
|
337439
337439
|
} catch (e) {
|
|
@@ -337441,7 +337441,7 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337441
337441
|
}
|
|
337442
337442
|
}
|
|
337443
337443
|
isExtensible(target) {
|
|
337444
|
-
const object = this
|
|
337444
|
+
const object = getHandlerObject(this);
|
|
337445
337445
|
try {
|
|
337446
337446
|
if (otherReflectIsExtensible(object))
|
|
337447
337447
|
return true;
|
|
@@ -337454,7 +337454,7 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337454
337454
|
return false;
|
|
337455
337455
|
}
|
|
337456
337456
|
ownKeys(target) {
|
|
337457
|
-
const object = this
|
|
337457
|
+
const object = getHandlerObject(this);
|
|
337458
337458
|
let res;
|
|
337459
337459
|
try {
|
|
337460
337460
|
res = otherReflectOwnKeys(object);
|
|
@@ -337478,7 +337478,7 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337478
337478
|
return filtered;
|
|
337479
337479
|
}
|
|
337480
337480
|
preventExtensions(target) {
|
|
337481
|
-
const object = this
|
|
337481
|
+
const object = getHandlerObject(this);
|
|
337482
337482
|
try {
|
|
337483
337483
|
if (!otherReflectPreventExtensions(object))
|
|
337484
337484
|
return false;
|
|
@@ -337491,14 +337491,14 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337491
337491
|
return true;
|
|
337492
337492
|
}
|
|
337493
337493
|
enumerate(target) {
|
|
337494
|
-
const object = this
|
|
337494
|
+
const object = getHandlerObject(this);
|
|
337495
337495
|
let res;
|
|
337496
337496
|
try {
|
|
337497
337497
|
res = otherReflectEnumerate(object);
|
|
337498
337498
|
} catch (e) {
|
|
337499
337499
|
throw thisFromOtherForThrow(e);
|
|
337500
337500
|
}
|
|
337501
|
-
return this
|
|
337501
|
+
return handlerFromOtherWithContext(this, res);
|
|
337502
337502
|
}
|
|
337503
337503
|
}
|
|
337504
337504
|
BaseHandler.prototype[thisSymbolNodeJSUtilInspectCustom] = undefined;
|
|
@@ -337575,7 +337575,7 @@ var require_bridge = __commonJS((exports2) => {
|
|
|
337575
337575
|
get(target, key, receiver) {
|
|
337576
337576
|
if (key === "isProxy")
|
|
337577
337577
|
return true;
|
|
337578
|
-
const object = this
|
|
337578
|
+
const object = getHandlerObject(this);
|
|
337579
337579
|
const mock = this.mock;
|
|
337580
337580
|
if (thisReflectApply(thisObjectHasOwnProperty, mock, key) && !thisOtherHasOwnProperty(object, key)) {
|
|
337581
337581
|
return mock[key];
|
|
@@ -361308,19 +361308,15 @@ var initCommand = () => {
|
|
|
361308
361308
|
console.log("[pieui] piecomponents directory already exists");
|
|
361309
361309
|
}
|
|
361310
361310
|
const registryPath = import_path.default.join(pieComponentsDir, "registry.ts");
|
|
361311
|
-
const registryContent = `
|
|
361312
|
-
|
|
361313
|
-
import { registerPieComponent
|
|
361311
|
+
const registryContent = `"use client"
|
|
361312
|
+
|
|
361313
|
+
import { registerPieComponent } from "@piedata/pieui";
|
|
361314
361314
|
|
|
361315
361315
|
// Import your custom components here
|
|
361316
361316
|
// Example:
|
|
361317
361317
|
// import MyCustomCard from "./MyCustomCard/ui/MyCustomCard";
|
|
361318
361318
|
|
|
361319
|
-
|
|
361320
|
-
if (!isPieComponentsInitialized()) {
|
|
361321
|
-
// Initialize PieUI built-in components
|
|
361322
|
-
initializePieComponents();
|
|
361323
|
-
|
|
361319
|
+
export const initializePieUI = () => {
|
|
361324
361320
|
// Register your custom components here
|
|
361325
361321
|
// Example:
|
|
361326
361322
|
// registerPieComponent({
|
|
@@ -361335,10 +361331,51 @@ if (!isPieComponentsInitialized()) {
|
|
|
361335
361331
|
} else {
|
|
361336
361332
|
console.log("[pieui] registry.ts already exists");
|
|
361337
361333
|
}
|
|
361334
|
+
const tailwindConfigPath = import_path.default.join(process.cwd(), "tailwind.config.js");
|
|
361335
|
+
const tailwindConfigTsPath = import_path.default.join(process.cwd(), "tailwind.config.ts");
|
|
361336
|
+
const pieuiContentPath = "./node_modules/@piedata/pieui/dist/**/*.{js,mjs,ts,jsx,tsx}";
|
|
361337
|
+
let configPath = null;
|
|
361338
|
+
if (import_fs2.default.existsSync(tailwindConfigPath)) {
|
|
361339
|
+
configPath = tailwindConfigPath;
|
|
361340
|
+
} else if (import_fs2.default.existsSync(tailwindConfigTsPath)) {
|
|
361341
|
+
configPath = tailwindConfigTsPath;
|
|
361342
|
+
}
|
|
361343
|
+
if (configPath) {
|
|
361344
|
+
console.log("[pieui] Updating Tailwind config...");
|
|
361345
|
+
try {
|
|
361346
|
+
let configContent = import_fs2.default.readFileSync(configPath, "utf8");
|
|
361347
|
+
if (!configContent.includes(pieuiContentPath)) {
|
|
361348
|
+
const contentMatch = configContent.match(/content\s*:\s*\[([^\]]*)\]/s);
|
|
361349
|
+
if (contentMatch) {
|
|
361350
|
+
const contentArray = contentMatch[1];
|
|
361351
|
+
const newContentArray = contentArray.trim() ? `${contentArray.trim()},
|
|
361352
|
+
"${pieuiContentPath}"` : `
|
|
361353
|
+
"${pieuiContentPath}"
|
|
361354
|
+
`;
|
|
361355
|
+
configContent = configContent.replace(contentMatch[0], `content: [${newContentArray}]`);
|
|
361356
|
+
import_fs2.default.writeFileSync(configPath, configContent, "utf8");
|
|
361357
|
+
console.log("[pieui] Added PieUI path to Tailwind content configuration");
|
|
361358
|
+
} else {
|
|
361359
|
+
console.log("[pieui] Warning: Could not find content array in Tailwind config");
|
|
361360
|
+
console.log("[pieui] Please manually add the following to your Tailwind content array:");
|
|
361361
|
+
console.log(`[pieui] "${pieuiContentPath}"`);
|
|
361362
|
+
}
|
|
361363
|
+
} else {
|
|
361364
|
+
console.log("[pieui] PieUI path already exists in Tailwind config");
|
|
361365
|
+
}
|
|
361366
|
+
} catch (error) {
|
|
361367
|
+
console.error("[pieui] Error updating Tailwind config:", error);
|
|
361368
|
+
console.log("[pieui] Please manually add the following to your Tailwind content array:");
|
|
361369
|
+
console.log(`[pieui] "${pieuiContentPath}"`);
|
|
361370
|
+
}
|
|
361371
|
+
} else {
|
|
361372
|
+
console.log("[pieui] No Tailwind config found. If you use Tailwind CSS, add this to your content array:");
|
|
361373
|
+
console.log(`[pieui] "${pieuiContentPath}"`);
|
|
361374
|
+
}
|
|
361338
361375
|
console.log("[pieui] Initialization complete!");
|
|
361339
361376
|
console.log("[pieui] Next steps:");
|
|
361340
|
-
console.log(' 1. Import {
|
|
361341
|
-
console.log(" 2. Call
|
|
361377
|
+
console.log(' 1. Import { initializePieUI } from "./piecomponents/registry" in your app');
|
|
361378
|
+
console.log(" 2. Call initializePieUI() before using PieRoot");
|
|
361342
361379
|
console.log(' 3. Use "pieui add <ComponentName>" to create new components');
|
|
361343
361380
|
};
|
|
361344
361381
|
var addCommand = (componentName, componentType = "complex-container") => {
|
|
@@ -361523,26 +361560,54 @@ export default ${componentName}
|
|
|
361523
361560
|
registryContent = registryContent.slice(0, insertPos) + `
|
|
361524
361561
|
` + importLine + registryContent.slice(insertPos);
|
|
361525
361562
|
} else {
|
|
361526
|
-
const
|
|
361527
|
-
|
|
361563
|
+
const pieuiImportMatch = registryContent.match(/import .* from ["']@piedata\/pieui["'];/);
|
|
361564
|
+
if (pieuiImportMatch) {
|
|
361565
|
+
const pieuiImportEnd = registryContent.indexOf(pieuiImportMatch[0]) + pieuiImportMatch[0].length;
|
|
361566
|
+
registryContent = registryContent.slice(0, pieuiImportEnd) + `
|
|
361528
361567
|
|
|
361568
|
+
// Import your custom components here
|
|
361569
|
+
// Example:
|
|
361570
|
+
// import MyCustomCard from "./MyCustomCard/ui/MyCustomCard";
|
|
361529
361571
|
` + importLine + registryContent.slice(pieuiImportEnd);
|
|
361572
|
+
}
|
|
361530
361573
|
}
|
|
361531
361574
|
const registerLine = ` registerPieComponent({
|
|
361532
361575
|
name: '${componentName}',
|
|
361533
361576
|
component: ${componentName},
|
|
361534
361577
|
});`;
|
|
361535
|
-
const
|
|
361536
|
-
|
|
361537
|
-
|
|
361538
|
-
|
|
361578
|
+
const functionMatch = registryContent.match(/export const initializePieUI = \(\) => \{([\s\S]*?)\n\}/m);
|
|
361579
|
+
if (functionMatch) {
|
|
361580
|
+
const functionContent = functionMatch[1];
|
|
361581
|
+
if (functionContent.includes("registerPieComponent({")) {
|
|
361582
|
+
const lastRegisterMatch = functionContent.match(/registerPieComponent\([^)]+\);/g);
|
|
361583
|
+
if (lastRegisterMatch) {
|
|
361584
|
+
const lastRegister = lastRegisterMatch[lastRegisterMatch.length - 1];
|
|
361585
|
+
const lastRegisterPos = registryContent.lastIndexOf(lastRegister) + lastRegister.length;
|
|
361586
|
+
registryContent = registryContent.slice(0, lastRegisterPos) + `
|
|
361539
361587
|
|
|
361540
|
-
` + registerLine + registryContent.slice(
|
|
361541
|
-
|
|
361542
|
-
|
|
361543
|
-
|
|
361544
|
-
|
|
361545
|
-
|
|
361588
|
+
` + registerLine + registryContent.slice(lastRegisterPos);
|
|
361589
|
+
}
|
|
361590
|
+
} else {
|
|
361591
|
+
const functionStart = registryContent.indexOf("export const initializePieUI = () => {");
|
|
361592
|
+
const openBracePos = registryContent.indexOf("{", functionStart) + 1;
|
|
361593
|
+
const commentStart = registryContent.indexOf("// Register your custom components here", openBracePos);
|
|
361594
|
+
if (commentStart !== -1 && commentStart < registryContent.indexOf("}", openBracePos)) {
|
|
361595
|
+
const lines = registryContent.substring(commentStart).split(`
|
|
361596
|
+
`);
|
|
361597
|
+
let commentEnd = commentStart;
|
|
361598
|
+
for (const line of lines) {
|
|
361599
|
+
if (line.trim() && !line.trim().startsWith("//")) {
|
|
361600
|
+
break;
|
|
361601
|
+
}
|
|
361602
|
+
commentEnd += line.length + 1;
|
|
361603
|
+
}
|
|
361604
|
+
registryContent = registryContent.slice(0, commentStart) + registerLine + `
|
|
361605
|
+
` + registryContent.slice(commentEnd);
|
|
361606
|
+
} else {
|
|
361607
|
+
registryContent = registryContent.slice(0, openBracePos) + `
|
|
361608
|
+
` + registerLine + registryContent.slice(openBracePos);
|
|
361609
|
+
}
|
|
361610
|
+
}
|
|
361546
361611
|
}
|
|
361547
361612
|
import_fs2.default.writeFileSync(registryPath, registryContent, "utf8");
|
|
361548
361613
|
console.log(`[pieui] Component ${componentName} (${componentType}) created successfully!`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AjaxButtonCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Buttons/AjaxButtonCard/ui/AjaxButtonCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"AjaxButtonCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Buttons/AjaxButtonCard/ui/AjaxButtonCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;4DAWzC,mBAAmB;AAsBtB,wBAAqC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Chats/ChatCard/ui/ChatCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAMxC,QAAA,MAAM,QAAQ,GAAI,mCAGf,aAAa,
|
|
1
|
+
{"version":3,"file":"ChatCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Chats/ChatCard/ui/ChatCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAMxC,QAAA,MAAM,QAAQ,GAAI,mCAGf,aAAa,4CAiHf,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PieRoot/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PieRoot/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAA;AAwIpC,QAAA,MAAM,OAAO,GAAI,OAAO,YAAY,4CASnC,CAAA;AAGD,eAAe,OAAO,CAAA"}
|