@swarm.ing/pieui 2.0.33 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.ts +12 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.esm.js +2 -0
- package/dist/agent/index.js +2 -0
- package/dist/cli.js +358 -95
- package/dist/code/args.d.ts +1 -1
- package/dist/code/args.d.ts.map +1 -1
- package/dist/code/commands/createPieApp.d.ts.map +1 -1
- package/dist/code/commands/registry.d.ts +8 -0
- package/dist/code/commands/registry.d.ts.map +1 -0
- package/dist/code/types.d.ts +5 -0
- package/dist/code/types.d.ts.map +1 -1
- package/dist/components/Common/AutoRedirectCard/ui/AutoRedirectCard.d.ts +1 -1
- package/dist/components/Common/AutoRedirectCard/ui/AutoRedirectCard.d.ts.map +1 -1
- package/dist/components/Common/CloudStorageCard/ui/CloudStorageCard.d.ts +1 -1
- package/dist/components/Common/CloudStorageCard/ui/CloudStorageCard.d.ts.map +1 -1
- package/dist/components/Common/DeviceStorageCard/ui/DeviceStorageCard.d.ts +1 -1
- package/dist/components/Common/DeviceStorageCard/ui/DeviceStorageCard.d.ts.map +1 -1
- package/dist/components/Common/HTMLEmbedCard/ui/HTMLEmbedCard.d.ts +1 -1
- package/dist/components/Common/HTMLEmbedCard/ui/HTMLEmbedCard.d.ts.map +1 -1
- package/dist/components/Common/HiddenCard/ui/HiddenCard.d.ts +1 -1
- package/dist/components/Common/HiddenCard/ui/HiddenCard.d.ts.map +1 -1
- package/dist/components/Common/IOEventsCard/ui/IOEventsCard.d.ts +1 -1
- package/dist/components/Common/IOEventsCard/ui/IOEventsCard.d.ts.map +1 -1
- package/dist/components/Common/SecureStorageCard/ui/SecureStorageCard.d.ts +1 -1
- package/dist/components/Common/SecureStorageCard/ui/SecureStorageCard.d.ts.map +1 -1
- package/dist/components/Common/SessionStorageCard/ui/SessionStorageCard.d.ts +1 -1
- package/dist/components/Common/SessionStorageCard/ui/SessionStorageCard.d.ts.map +1 -1
- package/dist/components/Containers/AjaxGroupCard/ui/AjaxGroupCard.d.ts +1 -1
- package/dist/components/Containers/AjaxGroupCard/ui/AjaxGroupCard.d.ts.map +1 -1
- package/dist/components/Containers/BoxCard/ui/BoxCard.d.ts +1 -1
- package/dist/components/Containers/BoxCard/ui/BoxCard.d.ts.map +1 -1
- package/dist/components/Containers/OneOfCard/ui/OneOfCard.d.ts +1 -1
- package/dist/components/Containers/OneOfCard/ui/OneOfCard.d.ts.map +1 -1
- package/dist/components/Containers/SequenceCard/ui/SequenceCard.d.ts +1 -1
- package/dist/components/Containers/SequenceCard/ui/SequenceCard.d.ts.map +1 -1
- package/dist/components/Containers/UnionCard/ui/UnionCard.d.ts +1 -1
- package/dist/components/Containers/UnionCard/ui/UnionCard.d.ts.map +1 -1
- package/dist/components/LazyBoundary/index.d.ts +43 -0
- package/dist/components/LazyBoundary/index.d.ts.map +1 -0
- package/dist/components/PieBaseRoot/index.d.ts +1 -1
- package/dist/components/PieBaseRoot/index.d.ts.map +1 -1
- package/dist/components/PieCard/index.d.ts +1 -1
- package/dist/components/PieCard/index.d.ts.map +1 -1
- package/dist/components/PieMaxRoot/index.d.ts.map +1 -1
- package/dist/components/PiePreviewRoot/index.d.ts +37 -0
- package/dist/components/PiePreviewRoot/index.d.ts.map +1 -0
- package/dist/components/PieRoot/index.d.ts +1 -1
- package/dist/components/PieRoot/index.d.ts.map +1 -1
- package/dist/components/PieRoot/types/index.d.ts +19 -3
- package/dist/components/PieRoot/types/index.d.ts.map +1 -1
- package/dist/components/PieTelegramRoot/index.d.ts.map +1 -1
- package/dist/components/UI/index.d.ts +1 -1
- package/dist/components/UI/index.d.ts.map +1 -1
- package/dist/components/UILoading/index.d.ts +1 -1
- package/dist/components/UILoading/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 +4 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.js +2 -2
- package/dist/max/index.d.ts +12 -0
- package/dist/max/index.d.ts.map +1 -0
- package/dist/max/index.esm.js +2 -0
- package/dist/max/index.js +2 -0
- package/dist/storybook/index.d.ts +3 -3
- package/dist/storybook/index.d.ts.map +1 -1
- package/dist/telegram/index.d.ts +12 -0
- package/dist/telegram/index.d.ts.map +1 -0
- package/dist/telegram/index.esm.js +2 -0
- package/dist/telegram/index.js +2 -0
- package/dist/util/lazy.d.ts.map +1 -1
- package/dist/util/lazyError.d.ts +9 -0
- package/dist/util/lazyError.d.ts.map +1 -0
- package/dist/util/registry.d.ts +28 -0
- package/dist/util/registry.d.ts.map +1 -1
- package/package.json +33 -11
package/dist/code/args.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ParsedArgs } from './types';
|
|
2
2
|
export declare const parseArgs: (argv: string[]) => ParsedArgs;
|
|
3
|
-
export type HelpScope = 'all' | 'login' | 'create' | 'init' | 'postbuild' | 'card' | 'card-remote' | 'page' | 'self-upgrade';
|
|
3
|
+
export type HelpScope = 'all' | 'login' | 'create' | 'init' | 'postbuild' | 'card' | 'card-remote' | 'page' | 'registry' | 'self-upgrade';
|
|
4
4
|
export declare const detectHelpScope: (argv: string[]) => HelpScope | null;
|
|
5
5
|
export declare const printUsage: (scope?: HelpScope) => void;
|
|
6
6
|
//# sourceMappingURL=args.d.ts.map
|
package/dist/code/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/code/args.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAOR,UAAU,
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/code/args.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAOR,UAAU,EAEb,MAAM,SAAS,CAAA;AA0KhB,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,KAAG,UAyK1C,CAAA;AAED,MAAM,MAAM,SAAS,GACf,KAAK,GACL,OAAO,GACP,QAAQ,GACR,MAAM,GACN,WAAW,GACX,MAAM,GACN,aAAa,GACb,MAAM,GACN,UAAU,GACV,cAAc,CAAA;AAEpB,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,KAAG,SAAS,GAAG,IAgB5D,CAAA;AA8MD,eAAO,MAAM,UAAU,GAAI,QAAO,SAAiB,SAwBlD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPieApp.d.ts","sourceRoot":"","sources":["../../../src/code/commands/createPieApp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createPieApp.d.ts","sourceRoot":"","sources":["../../../src/code/commands/createPieApp.ts"],"names":[],"mappings":"AAqOA,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,SAyElD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/code/commands/registry.ts"],"names":[],"mappings":"AAyBA,KAAK,eAAe,GAAG;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AA2LD,eAAO,MAAM,eAAe,GACxB,QAAQ,KAAK,GAAG,OAAO,EACvB,OAAM,eAAoB,KAC3B,IAiDF,CAAA"}
|
package/dist/code/types.d.ts
CHANGED
|
@@ -39,7 +39,12 @@ export type ParsedArgs = {
|
|
|
39
39
|
selfUpgradePm?: string;
|
|
40
40
|
dumpMetadataOut?: string;
|
|
41
41
|
cardGeneratePreviewOut?: string;
|
|
42
|
+
registryAction?: RegistryAction;
|
|
43
|
+
registryPort?: number;
|
|
44
|
+
registryApiServer?: string;
|
|
45
|
+
registryOut?: string;
|
|
42
46
|
};
|
|
47
|
+
export type RegistryAction = 'dev' | 'build';
|
|
43
48
|
export type CardScaffoldOptions = {
|
|
44
49
|
ajax?: boolean;
|
|
45
50
|
io?: boolean;
|
package/dist/code/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/code/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,wBAAwB,CAAA;AAElD,eAAO,MAAM,iBAAiB,0BAA0B,CAAA;AACxD,eAAO,MAAM,iBAAiB,yBAAyB,CAAA;AAEvD,MAAM,MAAM,aAAa,GACnB,QAAQ,GACR,SAAS,GACT,kBAAkB,GAClB,mBAAmB,CAAA;AAEzB,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,aAAa,CAAA;AAC9C,MAAM,MAAM,UAAU,GAChB,KAAK,GACL,MAAM,GACN,MAAM,GACN,MAAM,GACN,QAAQ,GACR,aAAa,GACb,WAAW,GACX,QAAQ,GACR,eAAe,GACf,YAAY,GACZ,WAAW,GACX,kBAAkB,CAAA;AACxB,MAAM,MAAM,gBAAgB,GACtB,MAAM,GACN,MAAM,GACN,MAAM,GACN,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,CAAA;AACf,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAA;AAChD,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,CAAA;AAE7C,MAAM,MAAM,UAAU,GAAG;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,OAAO,CAAA;IACf,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,sBAAsB,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/code/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,wBAAwB,CAAA;AAElD,eAAO,MAAM,iBAAiB,0BAA0B,CAAA;AACxD,eAAO,MAAM,iBAAiB,yBAAyB,CAAA;AAEvD,MAAM,MAAM,aAAa,GACnB,QAAQ,GACR,SAAS,GACT,kBAAkB,GAClB,mBAAmB,CAAA;AAEzB,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,aAAa,CAAA;AAC9C,MAAM,MAAM,UAAU,GAChB,KAAK,GACL,MAAM,GACN,MAAM,GACN,MAAM,GACN,QAAQ,GACR,aAAa,GACb,WAAW,GACX,QAAQ,GACR,eAAe,GACf,YAAY,GACZ,WAAW,GACX,kBAAkB,CAAA;AACxB,MAAM,MAAM,gBAAgB,GACtB,MAAM,GACN,MAAM,GACN,MAAM,GACN,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,CAAA;AACf,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAA;AAChD,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,CAAA;AAE7C,MAAM,MAAM,UAAU,GAAG;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,OAAO,CAAA;IACf,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,OAAO,CAAA;AAE5C,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,KAAK,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,GAAG,CAAC,UAAU,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEhD,MAAM,MAAM,YAAY,GAAG;IACvB;;yBAEqB;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,YAAY,EAAE,CAAA;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,WAAW,EAAE,UAAU,GAAG,IAAI,CAAA;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAC7C,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,gBAAgB,EAAE,UAAU,GAAG,IAAI,CAAA;IACnC,QAAQ,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AutoRedirectCardProps } from '../types';
|
|
2
|
-
declare const AutoRedirectCard: ({ data }: AutoRedirectCardProps) => import("react
|
|
2
|
+
declare const AutoRedirectCard: ({ data }: AutoRedirectCardProps) => import("react").JSX.Element;
|
|
3
3
|
export default AutoRedirectCard;
|
|
4
4
|
//# sourceMappingURL=AutoRedirectCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoRedirectCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/AutoRedirectCard/ui/AutoRedirectCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAKhD,QAAA,MAAM,gBAAgB,GAAI,UAAU,qBAAqB,
|
|
1
|
+
{"version":3,"file":"AutoRedirectCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/AutoRedirectCard/ui/AutoRedirectCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAKhD,QAAA,MAAM,gBAAgB,GAAI,UAAU,qBAAqB,gCAexD,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CloudStorageCardProps } from '../types';
|
|
2
|
-
declare const CloudStorageCard: ({ data }: CloudStorageCardProps) => import("react
|
|
2
|
+
declare const CloudStorageCard: ({ data }: CloudStorageCardProps) => import("react").JSX.Element;
|
|
3
3
|
export default CloudStorageCard;
|
|
4
4
|
//# sourceMappingURL=CloudStorageCard.d.ts.map
|
|
@@ -1 +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,
|
|
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,gCA6CxD,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { DeviceStorageCardProps } from '../types';
|
|
2
|
-
declare const DeviceStorageCard: ({ data }: DeviceStorageCardProps) => import("react
|
|
2
|
+
declare const DeviceStorageCard: ({ data }: DeviceStorageCardProps) => import("react").JSX.Element;
|
|
3
3
|
export default DeviceStorageCard;
|
|
4
4
|
//# sourceMappingURL=DeviceStorageCard.d.ts.map
|
|
@@ -1 +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,
|
|
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,gCA0C1D,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLEmbedCardProps } from '../types';
|
|
2
|
-
declare const HTMLEmbedCard: ({ data }: HTMLEmbedCardProps) => import("react
|
|
2
|
+
declare const HTMLEmbedCard: ({ data }: HTMLEmbedCardProps) => import("react").JSX.Element;
|
|
3
3
|
export default HTMLEmbedCard;
|
|
4
4
|
//# sourceMappingURL=HTMLEmbedCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTMLEmbedCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/HTMLEmbedCard/ui/HTMLEmbedCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAG7C,QAAA,MAAM,aAAa,GAAI,UAAU,kBAAkB,
|
|
1
|
+
{"version":3,"file":"HTMLEmbedCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/HTMLEmbedCard/ui/HTMLEmbedCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAG7C,QAAA,MAAM,aAAa,GAAI,UAAU,kBAAkB,gCAoElD,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HiddenCardProps } from '../types';
|
|
2
|
-
declare const HiddenCard: ({ data }: HiddenCardProps) => import("react
|
|
2
|
+
declare const HiddenCard: ({ data }: HiddenCardProps) => import("react").JSX.Element;
|
|
3
3
|
export default HiddenCard;
|
|
4
4
|
//# sourceMappingURL=HiddenCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiddenCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/HiddenCard/ui/HiddenCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG1C,QAAA,MAAM,UAAU,GAAI,UAAU,eAAe,
|
|
1
|
+
{"version":3,"file":"HiddenCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/HiddenCard/ui/HiddenCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG1C,QAAA,MAAM,UAAU,GAAI,UAAU,eAAe,gCAgC5C,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IOEventsCardProps } from '../types';
|
|
2
|
-
declare const IOEventsCard: ({ data }: IOEventsCardProps) => import("react
|
|
2
|
+
declare const IOEventsCard: ({ data }: IOEventsCardProps) => import("react").JSX.Element;
|
|
3
3
|
export default IOEventsCard;
|
|
4
4
|
//# sourceMappingURL=IOEventsCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IOEventsCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/IOEventsCard/ui/IOEventsCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,iBAAiB,EAAE,MAAM,UAAU,CAAA;AA8EzD,QAAA,MAAM,YAAY,GAAI,UAAU,iBAAiB,
|
|
1
|
+
{"version":3,"file":"IOEventsCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/IOEventsCard/ui/IOEventsCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,iBAAiB,EAAE,MAAM,UAAU,CAAA;AA8EzD,QAAA,MAAM,YAAY,GAAI,UAAU,iBAAiB,gCA6DhD,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SecureStorageCardProps } from '../types';
|
|
2
|
-
declare const SecureStorageCard: ({ data }: SecureStorageCardProps) => import("react
|
|
2
|
+
declare const SecureStorageCard: ({ data }: SecureStorageCardProps) => import("react").JSX.Element;
|
|
3
3
|
export default SecureStorageCard;
|
|
4
4
|
//# sourceMappingURL=SecureStorageCard.d.ts.map
|
|
@@ -1 +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,
|
|
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,gCA6C1D,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SessionStorageCardProps } from '../types';
|
|
2
|
-
declare const SessionStorageCard: ({ data }: SessionStorageCardProps) => import("react
|
|
2
|
+
declare const SessionStorageCard: ({ data }: SessionStorageCardProps) => import("react").JSX.Element;
|
|
3
3
|
export default SessionStorageCard;
|
|
4
4
|
//# sourceMappingURL=SessionStorageCard.d.ts.map
|
|
@@ -1 +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,
|
|
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,gCA0C5D,CAAA;AAED,eAAe,kBAAkB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { AjaxGroupCardProps } from '../types';
|
|
3
|
-
declare const AjaxGroupCard: ({ data, content }: AjaxGroupCardProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react
|
|
3
|
+
declare const AjaxGroupCard: ({ data, content }: AjaxGroupCardProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
4
4
|
export default AjaxGroupCard;
|
|
5
5
|
//# sourceMappingURL=AjaxGroupCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AjaxGroupCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Containers/AjaxGroupCard/ui/AjaxGroupCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAMZ,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAO7C,QAAA,MAAM,aAAa,GAAI,mBAAmB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"AjaxGroupCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Containers/AjaxGroupCard/ui/AjaxGroupCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAMZ,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAO7C,QAAA,MAAM,aAAa,GAAI,mBAAmB,kBAAkB,gUAuF3D,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -4,6 +4,6 @@ declare const BoxCard: ({ data, content, setUiAjaxConfiguration, }: {
|
|
|
4
4
|
data: BoxCardData;
|
|
5
5
|
content: UIConfigType;
|
|
6
6
|
setUiAjaxConfiguration?: SetUiAjaxConfigurationType;
|
|
7
|
-
}) => import("react
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
8
8
|
export default BoxCard;
|
|
9
9
|
//# sourceMappingURL=BoxCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BoxCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Containers/BoxCard/ui/BoxCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEtC,OAAO,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAM5E,QAAA,MAAM,OAAO,GAAI,4CAId;IACC,IAAI,EAAE,WAAW,CAAA;IACjB,OAAO,EAAE,YAAY,CAAA;IACrB,sBAAsB,CAAC,EAAE,0BAA0B,CAAA;CACtD,
|
|
1
|
+
{"version":3,"file":"BoxCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Containers/BoxCard/ui/BoxCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEtC,OAAO,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAM5E,QAAA,MAAM,OAAO,GAAI,4CAId;IACC,IAAI,EAAE,WAAW,CAAA;IACjB,OAAO,EAAE,YAAY,CAAA;IACrB,sBAAsB,CAAC,EAAE,0BAA0B,CAAA;CACtD,gCA4BA,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { OneOfCardProps } from '../types';
|
|
2
|
-
declare const OneOfCard: ({ data, content, setUiAjaxConfiguration, }: OneOfCardProps) => import("react
|
|
2
|
+
declare const OneOfCard: ({ data, content, setUiAjaxConfiguration, }: OneOfCardProps) => import("react").JSX.Element;
|
|
3
3
|
export default OneOfCard;
|
|
4
4
|
//# sourceMappingURL=OneOfCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OneOfCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Containers/OneOfCard/ui/OneOfCard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAKzC,QAAA,MAAM,SAAS,GAAI,4CAIhB,cAAc,
|
|
1
|
+
{"version":3,"file":"OneOfCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Containers/OneOfCard/ui/OneOfCard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAKzC,QAAA,MAAM,SAAS,GAAI,4CAIhB,cAAc,gCAkBhB,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SequenceCardProps } from '../types';
|
|
2
|
-
declare const SequenceCard: ({ data, content, setUiAjaxConfiguration, }: SequenceCardProps) => import("react
|
|
2
|
+
declare const SequenceCard: ({ data, content, setUiAjaxConfiguration, }: SequenceCardProps) => import("react").JSX.Element;
|
|
3
3
|
export default SequenceCard;
|
|
4
4
|
//# sourceMappingURL=SequenceCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SequenceCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Containers/SequenceCard/ui/SequenceCard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAK5C,QAAA,MAAM,YAAY,GAAI,4CAInB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"SequenceCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Containers/SequenceCard/ui/SequenceCard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAK5C,QAAA,MAAM,YAAY,GAAI,4CAInB,iBAAiB,gCAkBnB,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UnionCardProps } from '../types';
|
|
2
|
-
declare const UnionCard: ({ data, content, setUiAjaxConfiguration, }: UnionCardProps) => import("react
|
|
2
|
+
declare const UnionCard: ({ data, content, setUiAjaxConfiguration, }: UnionCardProps) => import("react").JSX.Element;
|
|
3
3
|
export default UnionCard;
|
|
4
4
|
//# sourceMappingURL=UnionCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnionCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Containers/UnionCard/ui/UnionCard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAKzC,QAAA,MAAM,SAAS,GAAI,4CAIhB,cAAc,
|
|
1
|
+
{"version":3,"file":"UnionCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Containers/UnionCard/ui/UnionCard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAKzC,QAAA,MAAM,SAAS,GAAI,4CAIhB,cAAc,gCAgBhB,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Component, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Error boundary + Suspense wrapper for a single lazy (code-split) card.
|
|
4
|
+
*
|
|
5
|
+
* A `React.lazy` chunk can fail to load — a flaky network, or (commonly) a
|
|
6
|
+
* fresh deploy that changed chunk hashes so the running tab requests a chunk
|
|
7
|
+
* that now 404s. A bare `<Suspense>` does NOT catch that: the error propagates
|
|
8
|
+
* and white-screens the tree. This boundary instead:
|
|
9
|
+
*
|
|
10
|
+
* 1. renders the card's `fallback` (its skeleton) instead of crashing,
|
|
11
|
+
* 2. retries the import a couple of times with backoff — remounting the
|
|
12
|
+
* Suspense subtree, which re-runs the loader (the module cache evicts a
|
|
13
|
+
* rejected promise, so the retry is a fresh attempt), and
|
|
14
|
+
* 3. calls `onError` so the host can recover from a stale deploy (e.g. a
|
|
15
|
+
* one-shot page reload).
|
|
16
|
+
*
|
|
17
|
+
* If the retries are exhausted it stays on the fallback rather than throwing,
|
|
18
|
+
* so one broken card never takes down the whole screen.
|
|
19
|
+
*/
|
|
20
|
+
type Props = {
|
|
21
|
+
/** Stable key (the card name) — resets the boundary if the card changes. */
|
|
22
|
+
name: string;
|
|
23
|
+
/** Shown while loading and as the give-up state (the card's skeleton). */
|
|
24
|
+
fallback: ReactNode;
|
|
25
|
+
/** Called on each caught chunk error, after retries are scheduled. */
|
|
26
|
+
onError?: (error: unknown) => void;
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
};
|
|
29
|
+
type State = {
|
|
30
|
+
failed: boolean;
|
|
31
|
+
attempt: number;
|
|
32
|
+
};
|
|
33
|
+
export default class LazyBoundary extends Component<Props, State> {
|
|
34
|
+
state: State;
|
|
35
|
+
private timer;
|
|
36
|
+
static getDerivedStateFromError(): Partial<State>;
|
|
37
|
+
componentDidCatch(error: unknown): void;
|
|
38
|
+
componentDidUpdate(prevProps: Props): void;
|
|
39
|
+
componentWillUnmount(): void;
|
|
40
|
+
render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LazyBoundary/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAEtD;;;;;;;;;;;;;;;;;GAiBG;AAEH,KAAK,KAAK,GAAG;IACT,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAA;IACZ,0EAA0E;IAC1E,QAAQ,EAAE,SAAS,CAAA;IACnB,sEAAsE;IACtE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAClC,QAAQ,EAAE,SAAS,CAAA;CACtB,CAAA;AAED,KAAK,KAAK,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAKjD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IAC7D,KAAK,EAAE,KAAK,CAAgC;IAC5C,OAAO,CAAC,KAAK,CAA2C;IAExD,MAAM,CAAC,wBAAwB,IAAI,OAAO,CAAC,KAAK,CAAC;IAIjD,iBAAiB,CAAC,KAAK,EAAE,OAAO;IAWhC,kBAAkB,CAAC,SAAS,EAAE,KAAK;IAOnC,oBAAoB;IAIpB,MAAM;CAWT"}
|
|
@@ -10,6 +10,6 @@ import { PieBaseRootProps } from './types';
|
|
|
10
10
|
* that tree. Use this when you want full control over what is rendered or
|
|
11
11
|
* when combining a PieUI widget with a non-PieUI application shell.
|
|
12
12
|
*/
|
|
13
|
-
declare const PieBaseRoot: (props: PieBaseRootProps) => import("react
|
|
13
|
+
declare const PieBaseRoot: (props: PieBaseRootProps) => import("react").JSX.Element;
|
|
14
14
|
export default PieBaseRoot;
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PieBaseRoot/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PieBaseRoot/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AA6D1C;;;;;;;;;;GAUG;AACH,QAAA,MAAM,WAAW,GAAI,OAAO,gBAAgB,gCAe3C,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -17,6 +17,6 @@ import { PieCardProps } from './types';
|
|
|
17
17
|
* Cleanup runs automatically on unmount or when `data.name`/the support
|
|
18
18
|
* flags change.
|
|
19
19
|
*/
|
|
20
|
-
declare const PieCard: <TStored = unknown>({ card, data, children, useSocketioSupport, useCentrifugeSupport, useMittSupport, centrifugeChannel, methods, stored, }: PieCardProps<TStored>) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react
|
|
20
|
+
declare const PieCard: <TStored = unknown>({ card, data, children, useSocketioSupport, useCentrifugeSupport, useMittSupport, centrifugeChannel, methods, stored, }: PieCardProps<TStored>) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
21
21
|
export default PieCard;
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PieCard/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,OAAO,GAAI,OAAO,GAAG,OAAO,EAAG,yHAUlC,YAAY,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PieCard/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,OAAO,GAAI,OAAO,GAAG,OAAO,EAAG,yHAUlC,YAAY,CAAC,OAAO,CAAC,gWAiMvB,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PieMaxRoot/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAOtC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PieMaxRoot/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAOtC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAoL/C;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAetC,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for {@link PiePreviewRoot}.
|
|
4
|
+
*/
|
|
5
|
+
export interface PiePreviewRootProps {
|
|
6
|
+
/**
|
|
7
|
+
* Base URL of the PieUI backend (must end with `/`). Defaults to
|
|
8
|
+
* `process.env.PIE_API_SERVER`. When used with `pie card show` /
|
|
9
|
+
* `pieui card show`, the dev server is launched with this pointed at the
|
|
10
|
+
* ephemeral preview backend.
|
|
11
|
+
*/
|
|
12
|
+
apiServer?: string;
|
|
13
|
+
/** Route fetched from the backend. The preview backend serves at `/`. */
|
|
14
|
+
pathname?: string;
|
|
15
|
+
/** Query string for the fetch / react-query key. */
|
|
16
|
+
search?: string;
|
|
17
|
+
/** Optional Centrifuge URL (preview works without real-time). */
|
|
18
|
+
centrifugeServer?: string;
|
|
19
|
+
/** Node shown while the card config loads or on fetch error. */
|
|
20
|
+
fallback?: ReactNode;
|
|
21
|
+
/** Enable PieUI's verbose `[PieRoot]` console logging. */
|
|
22
|
+
enableRenderingLog?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Ungated, host-chrome-free root for previewing a single card.
|
|
26
|
+
*
|
|
27
|
+
* Wraps {@link PieRoot} (the plain web root — `pageProcessor: "web"`, no
|
|
28
|
+
* Telegram/MAX host integration) with preview-friendly defaults: it fetches
|
|
29
|
+
* the card config from `{apiServer}api/content{pathname}` and renders it with
|
|
30
|
+
* none of an application's auth/lock/boot providers. Drop it into a dedicated
|
|
31
|
+
* route (e.g. `app/__pieshow__/page.tsx`) — after importing the app's card
|
|
32
|
+
* registry — so `pie card show` / `pieui card show` can render an arbitrary
|
|
33
|
+
* card without the app's gating screens taking over.
|
|
34
|
+
*/
|
|
35
|
+
declare const PiePreviewRoot: ({ apiServer, pathname, search, centrifugeServer, fallback, enableRenderingLog, }: PiePreviewRootProps) => import("react").JSX.Element;
|
|
36
|
+
export default PiePreviewRoot;
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PiePreviewRoot/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAK/C;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAcD;;;;;;;;;;GAUG;AACH,QAAA,MAAM,cAAc,GAAI,kFAOrB,mBAAmB,gCAgCrB,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -16,6 +16,6 @@ import { PieRootProps } from './types';
|
|
|
16
16
|
* (`staleTime: Infinity`); supply `queryOptions` to override the
|
|
17
17
|
* react-query behaviour.
|
|
18
18
|
*/
|
|
19
|
-
declare const PieRoot: (props: PieRootProps) => import("react
|
|
19
|
+
declare const PieRoot: (props: PieRootProps) => import("react").JSX.Element;
|
|
20
20
|
export default PieRoot;
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PieRoot/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PieRoot/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAoLtC;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,OAAO,GAAI,OAAO,YAAY,gCAmBnC,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { PieConfig, UIConfigType } from '../../../types';
|
|
3
|
-
import { UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
import { QueryClient, UseQueryOptions } from '@tanstack/react-query';
|
|
4
4
|
import { AxiosError } from 'axios';
|
|
5
5
|
/**
|
|
6
6
|
* Extra options merged into the internal `useQuery` call that fetches the
|
|
@@ -33,8 +33,16 @@ export interface PieRootProps {
|
|
|
33
33
|
* via `UILoading` instead of the plain `fallback`.
|
|
34
34
|
*/
|
|
35
35
|
piecache?: Record<string, UIConfigType>;
|
|
36
|
-
/**
|
|
37
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Invoked on a render-blocking error: either the UI-configuration request
|
|
38
|
+
* throws, or a lazy (code-split) card's chunk fails to load after the
|
|
39
|
+
* internal boundary's retries. The triggering error is passed when
|
|
40
|
+
* available. Use it to recover from a stale deploy — e.g. reload the page
|
|
41
|
+
* once so the fresh asset manifest is fetched. Without it, a fetch failure
|
|
42
|
+
* shows the `fallback` and a permanently-failing chunk shows the card's
|
|
43
|
+
* skeleton.
|
|
44
|
+
*/
|
|
45
|
+
onError?: (error?: unknown) => void;
|
|
38
46
|
/**
|
|
39
47
|
* Navigation handler forwarded through `NavigateContext` so PieUI
|
|
40
48
|
* components can route via the host application (Next.js router,
|
|
@@ -45,6 +53,14 @@ export interface PieRootProps {
|
|
|
45
53
|
config: PieConfig;
|
|
46
54
|
/** Optional react-query overrides; see {@link PieQueryOptions}. */
|
|
47
55
|
queryOptions?: PieQueryOptions;
|
|
56
|
+
/**
|
|
57
|
+
* Optional host-supplied react-query `QueryClient`. Pass a stable
|
|
58
|
+
* (module-singleton) client so the fetched UI-config cache survives a
|
|
59
|
+
* remount of the root — otherwise a fresh client is created per mount and
|
|
60
|
+
* every cached page config is discarded (causing a refetch/flash). When
|
|
61
|
+
* omitted, a per-mount client is used (previous behaviour).
|
|
62
|
+
*/
|
|
63
|
+
queryClient?: QueryClient;
|
|
48
64
|
/**
|
|
49
65
|
* When `true`, the implicit `<form id="piedata_global_form">` wrapper is
|
|
50
66
|
* not rendered. Use this when the host application owns its own form
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/PieRoot/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/PieRoot/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAC9B,eAAe,CAAC,YAAY,EAAE,UAAU,CAAC,EACzC,UAAU,GAAG,SAAS,GAAG,SAAS,CACrC,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;;;OAKG;IACH,QAAQ,EAAE;QACN,QAAQ,EAAE,MAAM,CAAA;QAChB,MAAM,EAAE,MAAM,CAAA;KACjB,CAAA;IACD;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACvC;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IACnC;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,oEAAoE;IACpE,MAAM,EAAE,SAAS,CAAA;IACjB,mEAAmE;IACnE,YAAY,CAAC,EAAE,eAAe,CAAA;IAC9B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PieTelegramRoot/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAOtC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PieTelegramRoot/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAOtC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAsL/C;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAiB3C,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -3,7 +3,7 @@ import { ReactNode } from 'react';
|
|
|
3
3
|
declare function UI({ uiConfig, setUiAjaxConfiguration, }: {
|
|
4
4
|
uiConfig: UIConfigType;
|
|
5
5
|
setUiAjaxConfiguration?: SetUiAjaxConfigurationType;
|
|
6
|
-
}): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react
|
|
6
|
+
}): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
7
7
|
declare const _default: import("react").MemoExoticComponent<typeof UI>;
|
|
8
8
|
export default _default;
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/UI/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAEtE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/UI/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAEtE,OAAO,EAAc,SAAS,EAAQ,MAAM,OAAO,CAAA;AAMnD,iBAAS,EAAE,CAAC,EACR,QAAQ,EACR,sBAAsB,GACzB,EAAE;IACC,QAAQ,EAAE,YAAY,CAAA;IACtB,sBAAsB,CAAC,EAAE,0BAA0B,CAAA;CACtD,+TAmEA;;AAED,wBAAuB"}
|
|
@@ -3,6 +3,6 @@ import { ReactNode } from 'react';
|
|
|
3
3
|
declare function UILoading({ uiConfig, setUiAjaxConfiguration, }: {
|
|
4
4
|
uiConfig: UIConfigType;
|
|
5
5
|
setUiAjaxConfiguration?: SetUiAjaxConfigurationType;
|
|
6
|
-
}): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react
|
|
6
|
+
}): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
7
7
|
export default UILoading;
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/UILoading/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAEtE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/UILoading/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAEtE,OAAO,EAAc,SAAS,EAAE,MAAM,OAAO,CAAA;AAO7C,iBAAS,SAAS,CAAC,EACf,QAAQ,EACR,sBAAsB,GACzB,EAAE;IACC,QAAQ,EAAE,YAAY,CAAA;IACtB,sBAAsB,CAAC,EAAE,0BAA0B,CAAA;CACtD,+TA2EA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{useContext as J,useEffect as X,useRef as Wo}from"react";import{createContext as Bo,useContext as Vo}from"react";var $o=Bo(null),ao=()=>{let o=Vo($o);if(!o)throw Error("usePieConfig must be used within PieConfigProvider");return o};var $=()=>{let{enableRenderingLog:o}=ao();return o},E=$;import{createContext as qo}from"react";import{Centrifuge as Af}from"centrifuge";var Go=qo(null),b=Go;import{io as Tf}from"socket.io-client";import{createContext as Fo}from"react";var Jo=Fo(null),N=Jo;import Lf from"mitt";import{createContext as Xo,useCallback as Vf,useContext as $f}from"react";var Qo=Xo(null);var a=Qo;import{jsx as Mo,jsxs as Ro,Fragment as yo}from"react/jsx-runtime";var Yo=({card:o,data:r,children:C,useSocketioSupport:f=!1,useCentrifugeSupport:p=!1,useMittSupport:i=!1,centrifugeChannel:d=void 0,methods:S=void 0,stored:U=void 0})=>{let m=E(),u=Wo(S);if(u.current=S,m)console.log("[PieCard] Rendering card:",o),console.log("[PieCard] Card data:",r),console.log("[PieCard] Component name:",r?.name),console.log("[PieCard] Real-time support:",{socketio:f,centrifuge:p,mitt:i,centrifugeChannel:d}),console.log("[PieCard] Methods:",S?Object.keys(S):"none"),console.log("[PieCard] Has children:",!!C);let P=J(N),n=J(b),l=J(a);if(X(()=>{if(!P||!f||!u.current||!r.name){if(m&&f)console.log("[PieCard] Socket.IO setup skipped:",{hasSocket:!!P,useSocketioSupport:f,hasMethods:!!u.current,hasDataName:!!r?.name});return}let O=Object.keys(u.current??{}).map((g)=>{let T=`pie${g}_${r.name}`;if(m)console.log(`[PieCard] Socket.IO registering event: ${T}`);let D=(z)=>{u.current?.[g]?.(z)};return P.on(T,D),[T,D]});return()=>{O.forEach(([g,T])=>{if(m)console.log(`[PieCard] Socket.IO unregistering event: ${g}`);P.off(g,T)})}},[P,r.name,f]),X(()=>{if(!n||!p||!d||!r.name){if(m&&p)console.log("[PieCard] Centrifuge setup skipped:",{hasCentrifuge:!!n,useCentrifugeSupport:p,hasCentrifugeChannel:!!d,hasMethods:!!u.current,hasDataName:!!r?.name});return}let O=Object.keys(u.current??{}).map((g)=>{let T=`pie${g}_${r.name}_${d}`;if(m)console.log(`[PieCard] Centrifuge subscribing to channel: ${T}`);let D=n.newSubscription(T);return D.on("publication",(z)=>{if(m)console.log(`[PieCard] Centrifuge received data on ${T}:`,z.data);u.current?.[g]?.(z.data)}),D.subscribe(),D});return()=>{O.forEach((g)=>{if(m)console.log("[PieCard] Centrifuge unsubscribing from channel");g.unsubscribe(),n.removeSubscription(g)})}},[n,d,r.name,p]),X(()=>{if(!l||!i||!r.name){if(m&&i)console.log("[PieCard] Mitt setup skipped:",{hasMitt:!!l,useMittSupport:i,hasMethods:!!u.current,hasDataName:!!r?.name});return}let I=Object.keys(u.current??{}),O={};return I.forEach((g)=>{let T=`pie${g}_${r.name}`,D=(z)=>{if(m)console.log(`[PieCard] Mitt registering event: ${T}`);u.current?.[g]?.(z)};O[T]=D,l.on(T,D)}),()=>{Object.entries(O).forEach(([g,T])=>{if(m)console.log(`[PieCard] Mitt unregistering event: ${g}`);l.off(g,T)})}},[l,r.name,i]),m)console.log("[PieCard] Rendering complete, returning children");if(U!==void 0)return Ro(yo,{children:[Mo("input",{type:"hidden",name:r.name,value:JSON.stringify(U)}),C]});return C},A=Yo;import{lazy as Ko}from"react";var Q=new Map;function c(o,r){return Ko(()=>{if(Q.has(r))return Q.get(r);let C=o().then((f)=>f);return Q.set(r,C),C})}var j=new Map,_o=(o)=>{if(!o.name)throw Error("Component registration requires a name");if(!o.component&&!o.loader)throw Error(`Component "${o.name}" requires component or loader`);let r={name:o.name,component:o.component,loader:o.loader,metadata:o.metadata,fallback:o.fallback,isLazy:!1};if(!r.component&&r.loader)r.component=c(r.loader,o.name),r.loader=void 0,r.isLazy=!0;return r};function w(o){let r=_o(o);return j.set(r.name,r),r.component}var q=(o)=>{return j.get(o)};import{Suspense as bo,useContext as No,memo as co}from"react";import{createContext as ko}from"react";import{jsx as Eo,Fragment as xo}from"react/jsx-runtime";var to=ko(Eo(xo,{})),B=to;import{jsx as W}from"react/jsx-runtime";function jo({uiConfig:o,setUiAjaxConfiguration:r}){let C=No(B),f=$();if(f)console.log("[UI] Rendering component:",o.card),console.log("[UI] Component data:",o.data),console.log("[UI] Component content:",o.content),console.log("[UI] Has setUiAjaxConfiguration:",!!r);let p=q(o.card);if(!p?.component){if(f)console.warn(`[UI] Component not found in registry: ${o.card}`),console.log("[UI] Returning fallback component");return C}if(f)console.log("[UI] Found component in registry:",{name:p.name,isLazy:p.isLazy,hasMetadata:!!p.metadata});let i=p.component,d=W(i,{data:o.data,content:o.content,setUiAjaxConfiguration:r});if(p.isLazy){if(f)console.log("[UI] Rendering lazy component with Suspense:",p.name);return W(bo,{fallback:p.fallback?W(p.fallback,{}):C,children:d},`${p.name}`)}if(f)console.log("[UI] Rendering component directly:",p.name);return d}var L=co(jo);import{Suspense as ho,useContext as eo}from"react";import{createContext as vo}from"react";var so=vo(null),Z=so;import{jsx as G}from"react/jsx-runtime";function v({uiConfig:o,setUiAjaxConfiguration:r}){let C=eo(B),f=$();if(f)console.log("[UILoading] Rendering fallback for:",o.card),console.log("[UILoading] Component data:",o.data),console.log("[UILoading] Component content:",o.content),console.log("[UILoading] Has setUiAjaxConfiguration:",!!r);let p=q(o.card);if(!p?.component){if(f)console.warn(`[UILoading] Component not found in registry: ${o.card}`),console.log("[UILoading] Returning fallback component");return C}if(f)console.log("[UILoading] Found component in registry:",{name:p.name,isLazy:p.isLazy,hasMetadata:!!p.metadata,hasFallback:!!p.fallback});if(p.fallback){if(f)console.log("[UILoading] Rendering fallback for:",p.name);let S=p.fallback;return G(S,{})}if(f)console.log("[UILoading] No fallback, rendering full component:",p.name);let i=p.component,d=G(Z.Provider,{value:v,children:G(i,{data:o.data,content:o.content,setUiAjaxConfiguration:r})});if(p.isLazy)return G(ho,{fallback:C,children:d},`${p.name}`);return d}var or=v;import{useContext as rr}from"react";import{jsx as Y}from"react/jsx-runtime";var fr=({data:o,content:r,setUiAjaxConfiguration:C})=>{let{name:f,sx:p}=o,i=rr(Z)??L;return Y(A,{card:f,data:o,children:Y("div",{style:p,id:f,children:r.map((d,S)=>{return Y(i,{uiConfig:d,setUiAjaxConfiguration:C},`children-${S}`)})})})},s=fr;var pr=w({name:"SequenceCard",component:s,metadata:{author:"Swarm.ing",description:"Simple div with styles joining few components"}});import{useContext as Cr}from"react";import{jsx as h}from"react/jsx-runtime";var mr=({data:o,content:r,setUiAjaxConfiguration:C})=>{let{name:f}=o,p=Cr(Z)??L;return h(A,{card:f,data:o,children:r.map((i,d)=>{return h(p,{uiConfig:i,setUiAjaxConfiguration:C},`children-${d}`)})})},e=mr;var dr=w({name:"UnionCard",component:e,metadata:{author:"Swarm.ing",description:"Renders one of many components"}});import{useEffect as Sr,useState as Ir}from"react";import lr from"html-react-parser";import{useCallback as F,useEffect as ir,useRef as y,useState as ur}from"react";function Ur(){let o=new AudioContext,r=o.createOscillator(),C=r.connect(o.createMediaStreamDestination());r.start();let f=C.stream.getAudioTracks()[0];return f.enabled=!1,f}function M(o=null,r){let[C,f]=ur(!1),p=y(null),i=y(null),d=y(null),S=F(async(P,n=!0)=>{if(p.current)U();let l=new RTCPeerConnection;if(l.onconnectionstatechange=()=>{if(l.connectionState==="connected")f(!0);else if(["disconnected","failed","closed"].includes(l.connectionState))f(!1)},l.ontrack=(H)=>{if(o)o.srcObject=H.streams[0]},n){let H=await navigator.mediaDevices.getUserMedia({audio:!0});l.addTrack(H.getTracks()[0],H)}else{let H=Ur();l.addTrack(H)}let I=l.createDataChannel("oai-events");i.current=I,d.current=new Promise((H)=>{I.addEventListener("open",()=>{H()})});let O=await l.createOffer();await l.setLocalDescription(O);let z=await(await fetch(`${"https://api.openai.com/v1/realtime/calls"}?model=${"gpt-realtime"}`,{method:"POST",body:O.sdp,headers:{Authorization:`Bearer ${P}`,"Content-Type":"application/sdp"}})).text();await l.setRemoteDescription({type:"answer",sdp:z}),p.current=l,await d.current},[o]),U=F(()=>{let P=i.current;if(P)P.close();p.current?.getSenders()?.forEach((n)=>n.track?.stop()),p.current?.close(),f(!1),p.current=null,i.current=null,d.current=null},[o]),m=F((P)=>{let n=i.current;if(!n){console.error("Data channel is not ready",P);return}let l=new Date().toLocaleTimeString();if(P.event_id=P.event_id||crypto.randomUUID(),n.send(JSON.stringify(P)),!P.timestamp)P.timestamp=l;r?.(P)},[r,o]),u=F((P)=>{if(!i.current){console.error("Data channel is not ready");return}let l=()=>{m({type:"conversation.item.create",item:{type:"message",role:"user",content:[{type:"input_text",text:P}]}}),m({type:"response.create"})};if(d.current)d.current.then(l);else l()},[r,o]);return ir(()=>{let P=i.current;if(!P)return;let n=(l)=>{let I=JSON.parse(l.data);if(!I.timestamp)I.timestamp=new Date().toLocaleTimeString();r?.(I)};return P.addEventListener("message",n),()=>{P.removeEventListener("message",n)}},[r,o]),{isSessionActive:C,startSession:S,stopSession:U,sendTextMessage:u}}import{jsx as wr}from"react/jsx-runtime";var Pr=({data:o})=>{let{html:r,useSocketioSupport:C,useCentrifugeSupport:f,useMittSupport:p,centrifugeChannel:i}=o,[d,S]=Ir(r),{isSessionActive:U,startSession:m,sendTextMessage:u}=M(null,(I)=>{if(console.log(I.type,I.type==="response.output_text.delta"&&I.delta),I.type==="response.output_text.delta"&&I.delta)S((O)=>O+I.delta)});return Sr(()=>{S(r)},[r]),wr(A,{card:"HTMLEmbedCard",data:o,methods:{update:(I)=>{S(I.value)},generateUsingAI:async(I)=>{try{if(!U&&I.token)await m(I.token,!1);u(I.prompt)}catch(O){console.error("Failed to generate using AI",O)}},initializeAI:async(I)=>{if(!U&&I.token)await m(I.token,!1)}},useCentrifugeSupport:f,useSocketioSupport:C,useMittSupport:p,centrifugeChannel:i,children:lr(d)})},oo=Pr;var Ar=w({name:"HTMLEmbedCard",component:oo,metadata:{author:"Swarm.ing"}});import{useEffect as nr,useState as gr}from"react";import{jsx as ro}from"react/jsx-runtime";var Tr=({data:o})=>{let{name:r,value:C,useSocketioSupport:f,useCentrifugeSupport:p,useMittSupport:i,centrifugeChannel:d}=o,[S,U]=gr(C);return nr(()=>{U(C)},[C]),ro(A,{card:"HiddenCard",data:o,useSocketioSupport:f,useCentrifugeSupport:p,useMittSupport:i,centrifugeChannel:d,methods:{update:({value:m})=>{U(m)}},children:ro("input",{type:"hidden",id:r,name:r,value:S})})},fo=Tr;var Hr=w({name:"HiddenCard",component:fo,metadata:{author:"Swarm.ing"}});import{useContext as po,useEffect as Zr}from"react";import{createContext as Or}from"react";var Dr=Or(void 0),V=Dr;import{jsx as Br,Fragment as zr}from"react/jsx-runtime";var Lr=({data:o})=>{let{url:r}=o,C=po(V),f=po(B);return Zr(()=>{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(r))window.location.href=r;else C?.(r)},[r,C]),Br(zr,{children:f})},Co=Lr;var Vr=w({name:"AutoRedirectCard",component:Co,metadata:{author:"Swarm.ing"}});import{Bounce as $r,Slide as ar,Zoom as qr,Flip as Gr}from"react-toastify";import{toast as Fr,ToastContainer as Jr}from"react-toastify";import{useContext as Xr,useMemo as Qr,useRef as Wr}from"react";import{jsx as R,Fragment as _r}from"react/jsx-runtime";var Yr={bounce:$r,slide:ar,zoom:qr,flip:Gr},yr=(o)=>{let r={...o,type:o.alertType,transition:o.transition?Yr[o.transition]:void 0,position:o.position??"bottom-right",autoClose:o.autoClose??3000,style:{backgroundColor:"black",...o.sx}};Fr(o.message,r)},Mr=(o)=>{console.log("Log event",o)},Rr=(o)=>{if(typeof window>"u"||!window.Notification){console.warn("[IOEventsCard] Notifications API is not available");return}let r=()=>{try{new window.Notification(o.title,{body:o.message??o.subtitle,icon:o.icon,silent:o.silent})}catch(f){console.error("[IOEventsCard] Failed to show notification",f)}},C=window.Notification.permission;if(C==="granted"){r();return}if(C==="denied"){console.warn("[IOEventsCard] Notification permission denied");return}window.Notification.requestPermission().then((f)=>{if(f==="granted")r()})},Kr=({data:o})=>{let{useCentrifugeSupport:r,useSocketioSupport:C,useMittSupport:f,centrifugeChannel:p}=o,i=Xr(V),d=Wr(i);d.current=i;let S=Qr(()=>({alert:yr,log:Mr,push:Rr,redirect:(U)=>{if(U.to){let m=U.to;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(m))window.location.href=m;else d.current?.(m)}else window.location.reload()},reload:(U)=>{if(U.to){let m=U.to;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(m))window.location.href=m;else d.current?.(m)}else window.location.reload()}}),[]);return R(_r,{children:R(A,{card:"IOEventsCard",data:o,useCentrifugeSupport:r,useSocketioSupport:C,useMittSupport:f,centrifugeChannel:p,methods:S,children:R(Jr,{})})})},mo=Kr;var kr=w({name:"IOEventsCard",component:mo,metadata:{author:"Swarm.ing"}});import{useEffect as io,useState as tr}from"react";import{jsx as uo}from"react/jsx-runtime";var xr=({data:o})=>{let{name:r,key:C,value:f,useSocketioSupport:p,useCentrifugeSupport:i,useMittSupport:d,centrifugeChannel:S}=o,[U,m]=tr(f);return io(()=>{m(f)},[f]),io(()=>{if(typeof window>"u")return;sessionStorage.setItem(C,U)},[C,U]),uo(A,{card:"SessionStorageCard",data:o,useSocketioSupport:p,useCentrifugeSupport:i,useMittSupport:d,centrifugeChannel:S,methods:{update:({value:u})=>{m(u)},remove:()=>{sessionStorage.removeItem(C),m("")}},children:uo("input",{type:"hidden",id:r,name:r,value:U})})},Uo=xr;var Er=w({name:"SessionStorageCard",component:Uo,metadata:{author:"PieData"}});import{useEffect as So,useState as br}from"react";import{jsx as Io}from"react/jsx-runtime";var Nr=({data:o})=>{let{name:r,key:C,value:f,useSocketioSupport:p,useCentrifugeSupport:i,useMittSupport:d,centrifugeChannel:S}=o,[U,m]=br(f);return So(()=>{m(f)},[f]),So(()=>{if(typeof window>"u")return;localStorage.setItem(C,U)},[C,U]),Io(A,{card:"DeviceStorageCard",data:o,useSocketioSupport:p,useCentrifugeSupport:i,useMittSupport:d,centrifugeChannel:S,methods:{update:({value:u})=>{m(u)},remove:()=>{localStorage.removeItem(C),m("")}},children:Io("input",{type:"hidden",id:r,name:r,value:U})})},lo=Nr;var cr=w({name:"DeviceStorageCard",component:lo,metadata:{author:"PieData"}});import{useEffect as Po,useState as jr}from"react";import{jsx as wo}from"react/jsx-runtime";var vr=({data:o})=>{let{name:r,key:C,value:f,useSocketioSupport:p,useCentrifugeSupport:i,useMittSupport:d,centrifugeChannel:S}=o,[U,m]=jr(f);return Po(()=>{m(f)},[f]),Po(()=>{if(typeof window>"u")return;let u=window.Telegram?.WebApp?.CloudStorage;if(!u)return;u.setItem(C,U)},[C,U]),wo(A,{card:"CloudStorageCard",data:o,useSocketioSupport:p,useCentrifugeSupport:i,useMittSupport:d,centrifugeChannel:S,methods:{update:({value:u})=>{m(u)},remove:()=>{let u=window.Telegram?.WebApp?.CloudStorage;if(u)u.removeItem(C);m("")}},children:wo("input",{type:"hidden",id:r,name:r,value:U})})},Ao=vr;var sr=w({name:"CloudStorageCard",component:Ao,metadata:{author:"PieData"}});import{useEffect as no,useState as hr}from"react";import{jsx as go}from"react/jsx-runtime";var er=({data:o})=>{let{name:r,key:C,value:f,useSocketioSupport:p,useCentrifugeSupport:i,useMittSupport:d,centrifugeChannel:S}=o,[U,m]=hr(f);return no(()=>{m(f)},[f]),no(()=>{if(typeof window>"u")return;let u=window.Telegram?.WebApp?.SecureStorage;if(!u)return;u.setItem(C,U)},[C,U]),go(A,{card:"SecureStorageCard",data:o,useSocketioSupport:p,useCentrifugeSupport:i,useMittSupport:d,centrifugeChannel:S,methods:{update:({value:u})=>{m(u)},remove:()=>{let u=window.Telegram?.WebApp?.SecureStorage;if(u)u.removeItem(C);m("")}},children:go("input",{type:"hidden",id:r,name:r,value:U})})},To=er;var of=w({name:"SecureStorageCard",component:To,metadata:{author:"PieData"}});import{useCallback as K,useContext as _,useEffect as rf,useRef as ff,useState as Ho}from"react";import{jsx as Oo}from"react/jsx-runtime";var pf=({data:o,content:r})=>{let{useLoader:C,noReturn:f,returnType:p,useSocketioSupport:i,useCentrifugeSupport:d,useMittSupport:S,centrifugeChannel:U}=o,m=_(B),u=_(Z)??L,[P,n]=Ho(!1),[l,I]=Ho(null),O=ff(r),g=_(a),T=K((H)=>{if(H===null)n(!0);else if(n(!1),!f)O.current=H;if(!f)I(H)},[f]),D=K((H)=>{O.current=H.content,I(H.content)},[]),z=K((H)=>{if(H===null)n(!0);else if(n(!1),!f)for(let x of H)g?.emit(x.name,x.data)},[f,g]);if(rf(()=>{I(r),n(!1)},[r]),!l&&C)return m;return Oo(A,{card:"AjaxGroupCard",data:o,methods:{changeContent:D},useSocketioSupport:i,useCentrifugeSupport:d,useMittSupport:S,centrifugeChannel:U,children:Oo(u,{uiConfig:l??O.current,setUiAjaxConfiguration:p==="events"?z:T})})},Do=pf;var Cf=w({name:"AjaxGroupCard",component:Do,metadata:{author:"Swarm.ing",description:"Group card with AJAX support"}});import{useContext as Zo}from"react";import{jsx as k}from"react/jsx-runtime";var mf=({data:o,content:r,setUiAjaxConfiguration:C})=>{let{name:f,url:p,sx:i}=o,d=Zo(V),S=Zo(Z)??L;return k(A,{card:f,data:o,children:k("div",{style:i,id:f,onClick:(m)=>{if(p)if(m.stopPropagation(),/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(p))window.location.href=p;else d?.(p)},children:k(S,{setUiAjaxConfiguration:C,uiConfig:r})})})},Lo=mf;var df=w({name:"BoxCard",component:Lo,metadata:{author:"Swarm.ing",description:"Simple div with styles joining few components"}});import{useContext as uf}from"react";import{jsx as t}from"react/jsx-runtime";var Uf=({data:o,content:r,setUiAjaxConfiguration:C})=>{let{name:f,sx:p}=o,i=uf(Z)??L;return t(A,{card:f,data:o,children:t("div",{style:p,id:f,children:r.map((d,S)=>{return t(i,{uiConfig:d,setUiAjaxConfiguration:C},`children-${S}`)})})})},zo=Uf;var Sf=w({name:"OneOfCard",component:zo,metadata:{author:"Swarm.ing",description:"Different variants"}});export{dr as UnionCard,or as UILoading,L as UI,Er as SessionStorageCard,pr as SequenceCard,of as SecureStorageCard,A as PieCard,Sf as OneOfCard,kr as IOEventsCard,Hr as HiddenCard,Ar as HTMLEmbedCard,cr as DeviceStorageCard,sr as CloudStorageCard,df as BoxCard,Vr as AutoRedirectCard,Cf as AjaxGroupCard};
|
|
2
|
+
import{useContext as K,useEffect as M,useRef as Eo}from"react";import{createContext as Fo,useContext as Jo}from"react";var Qo=Fo(null),Wo=()=>{let o=Jo(Qo);if(!o)throw Error("usePieConfig must be used within PieConfigProvider");return o};var G=()=>{let{enableRenderingLog:o}=Wo();return o},a=G;import{createContext as Xo}from"react";import{Centrifuge as Bf}from"centrifuge";var Yo=Xo(null),c=Yo;import{io as qf}from"socket.io-client";import{createContext as Ko}from"react";var Mo=Ko(null),v=Mo;import Qf from"mitt";import{createContext as Ro,useCallback as Yf,useContext as Kf}from"react";var _o=Ro(null);var J=_o;import{jsx as bo,jsxs as ko,Fragment as yo}from"react/jsx-runtime";var xo=({card:o,data:r,children:C,useSocketioSupport:p=!1,useCentrifugeSupport:U=!1,useMittSupport:f=!1,centrifugeChannel:m=void 0,methods:d=void 0,stored:S=void 0})=>{let u=a(),I=Eo(d);if(I.current=d,u)console.log("[PieCard] Rendering card:",o),console.log("[PieCard] Card data:",r),console.log("[PieCard] Component name:",r?.name),console.log("[PieCard] Real-time support:",{socketio:p,centrifuge:U,mitt:f,centrifugeChannel:m}),console.log("[PieCard] Methods:",d?Object.keys(d):"none"),console.log("[PieCard] Has children:",!!C);let w=K(v),H=K(c),A=K(J);if(M(()=>{if(!w||!p||!I.current||!r.name){if(u&&p)console.log("[PieCard] Socket.IO setup skipped:",{hasSocket:!!w,useSocketioSupport:p,hasMethods:!!I.current,hasDataName:!!r?.name});return}let z=Object.keys(I.current??{}).map((O)=>{let L=`pie${O}_${r.name}`;if(u)console.log(`[PieCard] Socket.IO registering event: ${L}`);let Z=(l)=>{I.current?.[O]?.(l)};return w.on(L,Z),[L,Z]});return()=>{z.forEach(([O,L])=>{if(u)console.log(`[PieCard] Socket.IO unregistering event: ${O}`);w.off(O,L)})}},[w,r.name,p]),M(()=>{if(!H||!U||!m||!r.name){if(u&&U)console.log("[PieCard] Centrifuge setup skipped:",{hasCentrifuge:!!H,useCentrifugeSupport:U,hasCentrifugeChannel:!!m,hasMethods:!!I.current,hasDataName:!!r?.name});return}let z=Object.keys(I.current??{}).map((O)=>{let L=`pie${O}_${r.name}_${m}`;if(u)console.log(`[PieCard] Centrifuge subscribing to channel: ${L}`);let Z=H.newSubscription(L);return Z.on("publication",(l)=>{if(u)console.log(`[PieCard] Centrifuge received data on ${L}:`,l.data);I.current?.[O]?.(l.data)}),Z.subscribe(),Z});return()=>{z.forEach((O)=>{if(u)console.log("[PieCard] Centrifuge unsubscribing from channel");O.unsubscribe(),H.removeSubscription(O)})}},[H,m,r.name,U]),M(()=>{if(!A||!f||!r.name){if(u&&f)console.log("[PieCard] Mitt setup skipped:",{hasMitt:!!A,useMittSupport:f,hasMethods:!!I.current,hasDataName:!!r?.name});return}let P=Object.keys(I.current??{}),z={};return P.forEach((O)=>{let L=`pie${O}_${r.name}`,Z=(l)=>{if(u)console.log(`[PieCard] Mitt registering event: ${L}`);I.current?.[O]?.(l)};z[L]=Z,A.on(L,Z)}),()=>{Object.entries(z).forEach(([O,L])=>{if(u)console.log(`[PieCard] Mitt unregistering event: ${O}`);A.off(O,L)})}},[A,r.name,f]),u)console.log("[PieCard] Rendering complete, returning children");if(S!==void 0)return ko(yo,{children:[bo("input",{type:"hidden",name:r.name,value:JSON.stringify(S)}),C]});return C},i=xo;import{lazy as No}from"react";var F=new Map;function jo(o,r){return r.catch(()=>{if(F.get(o)===r)F.delete(o)}),F.set(o,r),r}function t(o,r){return No(()=>{if(F.has(r))return F.get(r);return jo(r,o().then((C)=>C))})}var h=new Map,no=(o)=>{if(!o.name)throw Error("Component registration requires a name");if(!o.component&&!o.loader)throw Error(`Component "${o.name}" requires component or loader`);let r={name:o.name,component:o.component,loader:o.loader,metadata:o.metadata,fallback:o.fallback,isLazy:!1};if(!r.component&&r.loader)r.component=t(r.loader,o.name),r.isLazy=!0;return r};function T(o){let r=no(o);return h.set(r.name,r),r.component}var Q=(o)=>{return h.get(o)};import{useContext as s,memo as Cr}from"react";import{createContext as ao}from"react";import{jsx as to,Fragment as vo}from"react/jsx-runtime";var co=ao(to(vo,{})),V=co;import{createContext as ho}from"react";var so=ho(void 0),W=so;import{Component as eo,Suspense as or}from"react";import{jsx as pr}from"react/jsx-runtime";var rr=2,fr=400;class q extends eo{state={failed:!1,attempt:0};timer;static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(o){if(this.props.onError?.(o),this.state.attempt<rr){let r=fr*(this.state.attempt+1);this.timer=setTimeout(()=>{this.setState((C)=>({failed:!1,attempt:C.attempt+1}))},r)}}componentDidUpdate(o){if(o.name!==this.props.name&&this.state.attempt!==0)this.setState({failed:!1,attempt:0})}componentWillUnmount(){if(this.timer)clearTimeout(this.timer)}render(){if(this.state.failed)return this.props.fallback;return pr(or,{fallback:this.props.fallback,children:this.props.children},`${this.props.name}:${this.state.attempt}`)}}import{jsx as R}from"react/jsx-runtime";function Ur({uiConfig:o,setUiAjaxConfiguration:r}){let C=s(V),p=s(W),U=G();if(U)console.log("[UI] Rendering component:",o.card),console.log("[UI] Component data:",o.data),console.log("[UI] Component content:",o.content),console.log("[UI] Has setUiAjaxConfiguration:",!!r);let f=Q(o.card);if(!f?.component){if(U)console.warn(`[UI] Component not found in registry: ${o.card}`),console.log("[UI] Returning fallback component");return C}if(U)console.log("[UI] Found component in registry:",{name:f.name,isLazy:f.isLazy,hasMetadata:!!f.metadata});let m=f.component,d=R(m,{data:o.data,content:o.content,setUiAjaxConfiguration:r});if(f.isLazy){if(U)console.log("[UI] Rendering lazy component with Suspense:",f.name);return R(q,{name:f.name,fallback:f.fallback?R(f.fallback,{}):C,onError:p,children:d})}if(U)console.log("[UI] Rendering component directly:",f.name);return d}var B=Cr(Ur);import{useContext as e}from"react";import{createContext as ur}from"react";var mr=ur(null),g=mr;import{jsx as X}from"react/jsx-runtime";function oo({uiConfig:o,setUiAjaxConfiguration:r}){let C=e(V),p=e(W),U=G();if(U)console.log("[UILoading] Rendering fallback for:",o.card),console.log("[UILoading] Component data:",o.data),console.log("[UILoading] Component content:",o.content),console.log("[UILoading] Has setUiAjaxConfiguration:",!!r);let f=Q(o.card);if(!f?.component){if(U)console.warn(`[UILoading] Component not found in registry: ${o.card}`),console.log("[UILoading] Returning fallback component");return C}if(U)console.log("[UILoading] Found component in registry:",{name:f.name,isLazy:f.isLazy,hasMetadata:!!f.metadata,hasFallback:!!f.fallback});if(f.fallback){if(U)console.log("[UILoading] Rendering fallback for:",f.name);let S=f.fallback;return X(S,{})}if(U)console.log("[UILoading] No fallback, rendering full component:",f.name);let m=f.component,d=X(g.Provider,{value:oo,children:X(m,{data:o.data,content:o.content,setUiAjaxConfiguration:r})});if(f.isLazy)return X(q,{name:f.name,fallback:C,onError:p,children:d});return d}var Ir=oo;import{useContext as Sr}from"react";import{jsx as _}from"react/jsx-runtime";var dr=({data:o,content:r,setUiAjaxConfiguration:C})=>{let{name:p,sx:U}=o,f=Sr(g)??B;return _(i,{card:p,data:o,children:_("div",{style:U,id:p,children:r.map((m,d)=>{return _(f,{uiConfig:m,setUiAjaxConfiguration:C},`children-${d}`)})})})},ro=dr;var Pr=T({name:"SequenceCard",component:ro,metadata:{author:"Swarm.ing",description:"Simple div with styles joining few components"}});import{useContext as Ar}from"react";import{jsx as fo}from"react/jsx-runtime";var wr=({data:o,content:r,setUiAjaxConfiguration:C})=>{let{name:p}=o,U=Ar(g)??B;return fo(i,{card:p,data:o,children:r.map((f,m)=>{return fo(U,{uiConfig:f,setUiAjaxConfiguration:C},`children-${m}`)})})},po=wr;var Tr=T({name:"UnionCard",component:po,metadata:{author:"Swarm.ing",description:"Renders one of many components"}});import{useEffect as Lr,useState as Dr}from"react";import zr from"html-react-parser";import{useCallback as Y,useEffect as ir,useRef as E,useState as Hr}from"react";function Or(){let o=new AudioContext,r=o.createOscillator(),C=r.connect(o.createMediaStreamDestination());r.start();let p=C.stream.getAudioTracks()[0];return p.enabled=!1,p}function x(o=null,r){let[C,p]=Hr(!1),U=E(null),f=E(null),m=E(null),d=Y(async(w,H=!0)=>{if(U.current)S();let A=new RTCPeerConnection;if(A.onconnectionstatechange=()=>{if(A.connectionState==="connected")p(!0);else if(["disconnected","failed","closed"].includes(A.connectionState))p(!1)},A.ontrack=(D)=>{if(o)o.srcObject=D.streams[0]},H){let D=await navigator.mediaDevices.getUserMedia({audio:!0});A.addTrack(D.getTracks()[0],D)}else{let D=Or();A.addTrack(D)}let P=A.createDataChannel("oai-events");f.current=P,m.current=new Promise((D)=>{P.addEventListener("open",()=>{D()})});let z=await A.createOffer();await A.setLocalDescription(z);let l=await(await fetch(`${"https://api.openai.com/v1/realtime/calls"}?model=${"gpt-realtime"}`,{method:"POST",body:z.sdp,headers:{Authorization:`Bearer ${w}`,"Content-Type":"application/sdp"}})).text();await A.setRemoteDescription({type:"answer",sdp:l}),U.current=A,await m.current},[o]),S=Y(()=>{let w=f.current;if(w)w.close();U.current?.getSenders()?.forEach((H)=>H.track?.stop()),U.current?.close(),p(!1),U.current=null,f.current=null,m.current=null},[o]),u=Y((w)=>{let H=f.current;if(!H){console.error("Data channel is not ready",w);return}let A=new Date().toLocaleTimeString();if(w.event_id=w.event_id||crypto.randomUUID(),H.send(JSON.stringify(w)),!w.timestamp)w.timestamp=A;r?.(w)},[r,o]),I=Y((w)=>{if(!f.current){console.error("Data channel is not ready");return}let A=()=>{u({type:"conversation.item.create",item:{type:"message",role:"user",content:[{type:"input_text",text:w}]}}),u({type:"response.create"})};if(m.current)m.current.then(A);else A()},[r,o]);return ir(()=>{let w=f.current;if(!w)return;let H=(A)=>{let P=JSON.parse(A.data);if(!P.timestamp)P.timestamp=new Date().toLocaleTimeString();r?.(P)};return w.addEventListener("message",H),()=>{w.removeEventListener("message",H)}},[r,o]),{isSessionActive:C,startSession:d,stopSession:S,sendTextMessage:I}}import{jsx as gr}from"react/jsx-runtime";var Zr=({data:o})=>{let{html:r,useSocketioSupport:C,useCentrifugeSupport:p,useMittSupport:U,centrifugeChannel:f}=o,[m,d]=Dr(r),{isSessionActive:S,startSession:u,sendTextMessage:I}=x(null,(P)=>{if(console.log(P.type,P.type==="response.output_text.delta"&&P.delta),P.type==="response.output_text.delta"&&P.delta)d((z)=>z+P.delta)});return Lr(()=>{d(r)},[r]),gr(i,{card:"HTMLEmbedCard",data:o,methods:{update:(P)=>{d(P.value)},generateUsingAI:async(P)=>{try{if(!S&&P.token)await u(P.token,!1);I(P.prompt)}catch(z){console.error("Failed to generate using AI",z)}},initializeAI:async(P)=>{if(!S&&P.token)await u(P.token,!1)}},useCentrifugeSupport:p,useSocketioSupport:C,useMittSupport:U,centrifugeChannel:f,children:zr(m)})},Co=Zr;var Br=T({name:"HTMLEmbedCard",component:Co,metadata:{author:"Swarm.ing"}});import{useEffect as lr,useState as Vr}from"react";import{jsx as Uo}from"react/jsx-runtime";var qr=({data:o})=>{let{name:r,value:C,useSocketioSupport:p,useCentrifugeSupport:U,useMittSupport:f,centrifugeChannel:m}=o,[d,S]=Vr(C);return lr(()=>{S(C)},[C]),Uo(i,{card:"HiddenCard",data:o,useSocketioSupport:p,useCentrifugeSupport:U,useMittSupport:f,centrifugeChannel:m,methods:{update:({value:u})=>{S(u)}},children:Uo("input",{type:"hidden",id:r,name:r,value:d})})},uo=qr;var $r=T({name:"HiddenCard",component:uo,metadata:{author:"Swarm.ing"}});import{useContext as mo,useEffect as Jr}from"react";import{createContext as Gr}from"react";var Fr=Gr(void 0),$=Fr;import{jsx as Xr,Fragment as Wr}from"react/jsx-runtime";var Qr=({data:o})=>{let{url:r}=o,C=mo($),p=mo(V);return Jr(()=>{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(r))window.location.href=r;else C?.(r)},[r,C]),Xr(Wr,{children:p})},Io=Qr;var Yr=T({name:"AutoRedirectCard",component:Io,metadata:{author:"Swarm.ing"}});import{Bounce as Kr,Slide as Mr,Zoom as Rr,Flip as _r}from"react-toastify";import{toast as Er,ToastContainer as xr}from"react-toastify";import{useContext as yr,useMemo as br,useRef as kr}from"react";import{jsx as y,Fragment as vr}from"react/jsx-runtime";var Nr={bounce:Kr,slide:Mr,zoom:Rr,flip:_r},jr=(o)=>{let r={...o,type:o.alertType,transition:o.transition?Nr[o.transition]:void 0,position:o.position??"bottom-right",autoClose:o.autoClose??3000,style:{backgroundColor:"black",...o.sx}};Er(o.message,r)},nr=(o)=>{console.log("Log event",o)},ar=(o)=>{if(typeof window>"u"||!window.Notification){console.warn("[IOEventsCard] Notifications API is not available");return}let r=()=>{try{new window.Notification(o.title,{body:o.message??o.subtitle,icon:o.icon,silent:o.silent})}catch(p){console.error("[IOEventsCard] Failed to show notification",p)}},C=window.Notification.permission;if(C==="granted"){r();return}if(C==="denied"){console.warn("[IOEventsCard] Notification permission denied");return}window.Notification.requestPermission().then((p)=>{if(p==="granted")r()})},cr=({data:o})=>{let{useCentrifugeSupport:r,useSocketioSupport:C,useMittSupport:p,centrifugeChannel:U}=o,f=yr($),m=kr(f);m.current=f;let d=br(()=>({alert:jr,log:nr,push:ar,redirect:(S)=>{if(S.to){let u=S.to;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(u))window.location.href=u;else m.current?.(u)}else window.location.reload()},reload:(S)=>{if(S.to){let u=S.to;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(u))window.location.href=u;else m.current?.(u)}else window.location.reload()}}),[]);return y(vr,{children:y(i,{card:"IOEventsCard",data:o,useCentrifugeSupport:r,useSocketioSupport:C,useMittSupport:p,centrifugeChannel:U,methods:d,children:y(xr,{})})})},So=cr;var tr=T({name:"IOEventsCard",component:So,metadata:{author:"Swarm.ing"}});import{useEffect as Po,useState as hr}from"react";import{jsx as Ao}from"react/jsx-runtime";var sr=({data:o})=>{let{name:r,key:C,value:p,useSocketioSupport:U,useCentrifugeSupport:f,useMittSupport:m,centrifugeChannel:d}=o,[S,u]=hr(p);return Po(()=>{u(p)},[p]),Po(()=>{if(typeof window>"u")return;sessionStorage.setItem(C,S)},[C,S]),Ao(i,{card:"SessionStorageCard",data:o,useSocketioSupport:U,useCentrifugeSupport:f,useMittSupport:m,centrifugeChannel:d,methods:{update:({value:I})=>{u(I)},remove:()=>{sessionStorage.removeItem(C),u("")}},children:Ao("input",{type:"hidden",id:r,name:r,value:S})})},wo=sr;var er=T({name:"SessionStorageCard",component:wo,metadata:{author:"PieData"}});import{useEffect as To,useState as of}from"react";import{jsx as io}from"react/jsx-runtime";var rf=({data:o})=>{let{name:r,key:C,value:p,useSocketioSupport:U,useCentrifugeSupport:f,useMittSupport:m,centrifugeChannel:d}=o,[S,u]=of(p);return To(()=>{u(p)},[p]),To(()=>{if(typeof window>"u")return;localStorage.setItem(C,S)},[C,S]),io(i,{card:"DeviceStorageCard",data:o,useSocketioSupport:U,useCentrifugeSupport:f,useMittSupport:m,centrifugeChannel:d,methods:{update:({value:I})=>{u(I)},remove:()=>{localStorage.removeItem(C),u("")}},children:io("input",{type:"hidden",id:r,name:r,value:S})})},Ho=rf;var ff=T({name:"DeviceStorageCard",component:Ho,metadata:{author:"PieData"}});import{useEffect as Oo,useState as pf}from"react";import{jsx as Lo}from"react/jsx-runtime";var Cf=({data:o})=>{let{name:r,key:C,value:p,useSocketioSupport:U,useCentrifugeSupport:f,useMittSupport:m,centrifugeChannel:d}=o,[S,u]=pf(p);return Oo(()=>{u(p)},[p]),Oo(()=>{if(typeof window>"u")return;let I=window.Telegram?.WebApp?.CloudStorage;if(!I)return;I.setItem(C,S)},[C,S]),Lo(i,{card:"CloudStorageCard",data:o,useSocketioSupport:U,useCentrifugeSupport:f,useMittSupport:m,centrifugeChannel:d,methods:{update:({value:I})=>{u(I)},remove:()=>{let I=window.Telegram?.WebApp?.CloudStorage;if(I)I.removeItem(C);u("")}},children:Lo("input",{type:"hidden",id:r,name:r,value:S})})},Do=Cf;var Uf=T({name:"CloudStorageCard",component:Do,metadata:{author:"PieData"}});import{useEffect as zo,useState as uf}from"react";import{jsx as Zo}from"react/jsx-runtime";var mf=({data:o})=>{let{name:r,key:C,value:p,useSocketioSupport:U,useCentrifugeSupport:f,useMittSupport:m,centrifugeChannel:d}=o,[S,u]=uf(p);return zo(()=>{u(p)},[p]),zo(()=>{if(typeof window>"u")return;let I=window.Telegram?.WebApp?.SecureStorage;if(!I)return;I.setItem(C,S)},[C,S]),Zo(i,{card:"SecureStorageCard",data:o,useSocketioSupport:U,useCentrifugeSupport:f,useMittSupport:m,centrifugeChannel:d,methods:{update:({value:I})=>{u(I)},remove:()=>{let I=window.Telegram?.WebApp?.SecureStorage;if(I)I.removeItem(C);u("")}},children:Zo("input",{type:"hidden",id:r,name:r,value:S})})},go=mf;var If=T({name:"SecureStorageCard",component:go,metadata:{author:"PieData"}});import{useCallback as b,useContext as k,useEffect as Sf,useRef as df,useState as Bo}from"react";import{jsx as lo}from"react/jsx-runtime";var Pf=({data:o,content:r})=>{let{useLoader:C,noReturn:p,returnType:U,useSocketioSupport:f,useCentrifugeSupport:m,useMittSupport:d,centrifugeChannel:S}=o,u=k(V),I=k(g)??B,[w,H]=Bo(!1),[A,P]=Bo(null),z=df(r),O=k(J),L=b((D)=>{if(D===null)H(!0);else if(H(!1),!p)z.current=D;if(!p)P(D)},[p]),Z=b((D)=>{z.current=D.content,P(D.content)},[]),l=b((D)=>{if(D===null)H(!0);else if(H(!1),!p)for(let n of D)O?.emit(n.name,n.data)},[p,O]);if(Sf(()=>{P(r),H(!1)},[r]),!A&&C)return u;return lo(i,{card:"AjaxGroupCard",data:o,methods:{changeContent:Z},useSocketioSupport:f,useCentrifugeSupport:m,useMittSupport:d,centrifugeChannel:S,children:lo(I,{uiConfig:A??z.current,setUiAjaxConfiguration:U==="events"?l:L})})},Vo=Pf;var Af=T({name:"AjaxGroupCard",component:Vo,metadata:{author:"Swarm.ing",description:"Group card with AJAX support"}});import{useContext as qo}from"react";import{jsx as N}from"react/jsx-runtime";var wf=({data:o,content:r,setUiAjaxConfiguration:C})=>{let{name:p,url:U,sx:f}=o,m=qo($),d=qo(g)??B;return N(i,{card:p,data:o,children:N("div",{style:f,id:p,onClick:(u)=>{if(U)if(u.stopPropagation(),/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(U))window.location.href=U;else m?.(U)},children:N(d,{setUiAjaxConfiguration:C,uiConfig:r})})})},$o=wf;var Tf=T({name:"BoxCard",component:$o,metadata:{author:"Swarm.ing",description:"Simple div with styles joining few components"}});import{useContext as Hf}from"react";import{jsx as j}from"react/jsx-runtime";var Of=({data:o,content:r,setUiAjaxConfiguration:C})=>{let{name:p,sx:U}=o,f=Hf(g)??B;return j(i,{card:p,data:o,children:j("div",{style:U,id:p,children:r.map((m,d)=>{return j(f,{uiConfig:m,setUiAjaxConfiguration:C},`children-${d}`)})})})},Go=Of;var Lf=T({name:"OneOfCard",component:Go,metadata:{author:"Swarm.ing",description:"Different variants"}});export{Tr as UnionCard,Ir as UILoading,B as UI,er as SessionStorageCard,Pr as SequenceCard,If as SecureStorageCard,i as PieCard,Lf as OneOfCard,tr as IOEventsCard,$r as HiddenCard,Br as HTMLEmbedCard,ff as DeviceStorageCard,Uf as CloudStorageCard,Tf as BoxCard,Yr as AutoRedirectCard,Af as AjaxGroupCard};
|