@swarm.ing/pieui 2.0.10
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/README.md +117 -0
- package/dist/__tests__/step1-local.test.d.cts +2 -0
- package/dist/__tests__/step1-local.test.d.cts.map +1 -0
- package/dist/__tests__/step2-remote.test.d.cts +2 -0
- package/dist/__tests__/step2-remote.test.d.cts.map +1 -0
- package/dist/__tests__/step3-contract.test.d.cts +2 -0
- package/dist/__tests__/step3-contract.test.d.cts.map +1 -0
- package/dist/__tests__/step4-ci.test.d.cts +2 -0
- package/dist/__tests__/step4-ci.test.d.cts.map +1 -0
- package/dist/__tests__/step5-regres.test.d.cts +2 -0
- package/dist/__tests__/step5-regres.test.d.cts.map +1 -0
- package/dist/cli.js +198415 -0
- package/dist/code/args.d.ts +4 -0
- package/dist/code/args.d.ts.map +1 -0
- package/dist/code/commands/add.d.ts +3 -0
- package/dist/code/commands/add.d.ts.map +1 -0
- package/dist/code/commands/addEvent.d.ts +2 -0
- package/dist/code/commands/addEvent.d.ts.map +1 -0
- package/dist/code/commands/createPieApp.d.ts +2 -0
- package/dist/code/commands/createPieApp.d.ts.map +1 -0
- package/dist/code/commands/init.d.ts +2 -0
- package/dist/code/commands/init.d.ts.map +1 -0
- package/dist/code/commands/list.d.ts +3 -0
- package/dist/code/commands/list.d.ts.map +1 -0
- package/dist/code/commands/listEvents.d.ts +2 -0
- package/dist/code/commands/listEvents.d.ts.map +1 -0
- package/dist/code/commands/postbuild.d.ts +2 -0
- package/dist/code/commands/postbuild.d.ts.map +1 -0
- package/dist/code/commands/pull.d.ts +2 -0
- package/dist/code/commands/pull.d.ts.map +1 -0
- package/dist/code/commands/push.d.ts +2 -0
- package/dist/code/commands/push.d.ts.map +1 -0
- package/dist/code/commands/remoteRemove.d.ts +2 -0
- package/dist/code/commands/remoteRemove.d.ts.map +1 -0
- package/dist/code/commands/remove.d.ts +2 -0
- package/dist/code/commands/remove.d.ts.map +1 -0
- package/dist/code/registryPath.d.ts +8 -0
- package/dist/code/registryPath.d.ts.map +1 -0
- package/dist/code/scan.d.ts +4 -0
- package/dist/code/scan.d.ts.map +1 -0
- package/dist/code/schema.d.ts +4 -0
- package/dist/code/schema.d.ts.map +1 -0
- package/dist/code/templates/complexComponent.d.ts +2 -0
- package/dist/code/templates/complexComponent.d.ts.map +1 -0
- package/dist/code/templates/complexContainerComponent.d.ts +2 -0
- package/dist/code/templates/complexContainerComponent.d.ts.map +1 -0
- package/dist/code/templates/componentIndex.d.ts +2 -0
- package/dist/code/templates/componentIndex.d.ts.map +1 -0
- package/dist/code/templates/componentTypes.d.ts +2 -0
- package/dist/code/templates/componentTypes.d.ts.map +1 -0
- package/dist/code/templates/index.d.ts +9 -0
- package/dist/code/templates/index.d.ts.map +1 -0
- package/dist/code/templates/nextConfig.d.ts +3 -0
- package/dist/code/templates/nextConfig.d.ts.map +1 -0
- package/dist/code/templates/registerCall.d.ts +2 -0
- package/dist/code/templates/registerCall.d.ts.map +1 -0
- package/dist/code/templates/simpleComponent.d.ts +2 -0
- package/dist/code/templates/simpleComponent.d.ts.map +1 -0
- package/dist/code/templates/simpleContainerComponent.d.ts +2 -0
- package/dist/code/templates/simpleContainerComponent.d.ts.map +1 -0
- package/dist/code/ts.d.ts +4 -0
- package/dist/code/ts.d.ts.map +1 -0
- package/dist/code/types.d.ts +27 -0
- package/dist/code/types.d.ts.map +1 -0
- package/dist/components/Common/AutoRedirectCard/index.d.ts +3 -0
- package/dist/components/Common/AutoRedirectCard/index.d.ts.map +1 -0
- package/dist/components/Common/AutoRedirectCard/types/index.d.ts +7 -0
- package/dist/components/Common/AutoRedirectCard/types/index.d.ts.map +1 -0
- package/dist/components/Common/AutoRedirectCard/ui/AutoRedirectCard.d.ts +4 -0
- package/dist/components/Common/AutoRedirectCard/ui/AutoRedirectCard.d.ts.map +1 -0
- package/dist/components/Common/CloudStorageCard/index.d.ts +3 -0
- package/dist/components/Common/CloudStorageCard/index.d.ts.map +1 -0
- package/dist/components/Common/CloudStorageCard/types/index.d.ts +13 -0
- package/dist/components/Common/CloudStorageCard/types/index.d.ts.map +1 -0
- package/dist/components/Common/CloudStorageCard/ui/CloudStorageCard.d.ts +4 -0
- package/dist/components/Common/CloudStorageCard/ui/CloudStorageCard.d.ts.map +1 -0
- package/dist/components/Common/DeviceStorageCard/index.d.ts +3 -0
- package/dist/components/Common/DeviceStorageCard/index.d.ts.map +1 -0
- package/dist/components/Common/DeviceStorageCard/types/index.d.ts +13 -0
- package/dist/components/Common/DeviceStorageCard/types/index.d.ts.map +1 -0
- package/dist/components/Common/DeviceStorageCard/ui/DeviceStorageCard.d.ts +4 -0
- package/dist/components/Common/DeviceStorageCard/ui/DeviceStorageCard.d.ts.map +1 -0
- package/dist/components/Common/HTMLEmbedCard/index.d.ts +3 -0
- package/dist/components/Common/HTMLEmbedCard/index.d.ts.map +1 -0
- package/dist/components/Common/HTMLEmbedCard/types/index.d.ts +14 -0
- package/dist/components/Common/HTMLEmbedCard/types/index.d.ts.map +1 -0
- package/dist/components/Common/HTMLEmbedCard/ui/HTMLEmbedCard.d.ts +4 -0
- package/dist/components/Common/HTMLEmbedCard/ui/HTMLEmbedCard.d.ts.map +1 -0
- package/dist/components/Common/HiddenCard/index.d.ts +3 -0
- package/dist/components/Common/HiddenCard/index.d.ts.map +1 -0
- package/dist/components/Common/HiddenCard/types/index.d.ts +12 -0
- package/dist/components/Common/HiddenCard/types/index.d.ts.map +1 -0
- package/dist/components/Common/HiddenCard/ui/HiddenCard.d.ts +4 -0
- package/dist/components/Common/HiddenCard/ui/HiddenCard.d.ts.map +1 -0
- package/dist/components/Common/IOEventsCard/index.d.ts +3 -0
- package/dist/components/Common/IOEventsCard/index.d.ts.map +1 -0
- package/dist/components/Common/IOEventsCard/types/index.d.ts +22 -0
- package/dist/components/Common/IOEventsCard/types/index.d.ts.map +1 -0
- package/dist/components/Common/IOEventsCard/ui/IOEventsCard.d.ts +4 -0
- package/dist/components/Common/IOEventsCard/ui/IOEventsCard.d.ts.map +1 -0
- package/dist/components/Common/SecureStorageCard/index.d.ts +3 -0
- package/dist/components/Common/SecureStorageCard/index.d.ts.map +1 -0
- package/dist/components/Common/SecureStorageCard/types/index.d.ts +13 -0
- package/dist/components/Common/SecureStorageCard/types/index.d.ts.map +1 -0
- package/dist/components/Common/SecureStorageCard/ui/SecureStorageCard.d.ts +4 -0
- package/dist/components/Common/SecureStorageCard/ui/SecureStorageCard.d.ts.map +1 -0
- package/dist/components/Common/SessionStorageCard/index.d.ts +3 -0
- package/dist/components/Common/SessionStorageCard/index.d.ts.map +1 -0
- package/dist/components/Common/SessionStorageCard/types/index.d.ts +13 -0
- package/dist/components/Common/SessionStorageCard/types/index.d.ts.map +1 -0
- package/dist/components/Common/SessionStorageCard/ui/SessionStorageCard.d.ts +4 -0
- package/dist/components/Common/SessionStorageCard/ui/SessionStorageCard.d.ts.map +1 -0
- package/dist/components/Containers/AjaxGroupCard/index.d.ts +3 -0
- package/dist/components/Containers/AjaxGroupCard/index.d.ts.map +1 -0
- package/dist/components/Containers/AjaxGroupCard/types/index.d.ts +14 -0
- package/dist/components/Containers/AjaxGroupCard/types/index.d.ts.map +1 -0
- package/dist/components/Containers/AjaxGroupCard/ui/AjaxGroupCard.d.ts +5 -0
- package/dist/components/Containers/AjaxGroupCard/ui/AjaxGroupCard.d.ts.map +1 -0
- package/dist/components/Containers/BoxCard/index.d.ts +7 -0
- package/dist/components/Containers/BoxCard/index.d.ts.map +1 -0
- package/dist/components/Containers/BoxCard/types/index.d.ts +7 -0
- package/dist/components/Containers/BoxCard/types/index.d.ts.map +1 -0
- package/dist/components/Containers/BoxCard/ui/BoxCard.d.ts +9 -0
- package/dist/components/Containers/BoxCard/ui/BoxCard.d.ts.map +1 -0
- package/dist/components/Containers/SequenceCard/index.d.ts +3 -0
- package/dist/components/Containers/SequenceCard/index.d.ts.map +1 -0
- package/dist/components/Containers/SequenceCard/types/index.d.ts +9 -0
- package/dist/components/Containers/SequenceCard/types/index.d.ts.map +1 -0
- package/dist/components/Containers/SequenceCard/ui/SequenceCard.d.ts +4 -0
- package/dist/components/Containers/SequenceCard/ui/SequenceCard.d.ts.map +1 -0
- package/dist/components/Containers/UnionCard/index.d.ts +3 -0
- package/dist/components/Containers/UnionCard/index.d.ts.map +1 -0
- package/dist/components/Containers/UnionCard/types/index.d.ts +7 -0
- package/dist/components/Containers/UnionCard/types/index.d.ts.map +1 -0
- package/dist/components/Containers/UnionCard/ui/UnionCard.d.ts +4 -0
- package/dist/components/Containers/UnionCard/ui/UnionCard.d.ts.map +1 -0
- package/dist/components/PieBaseRoot/index.d.ts +15 -0
- package/dist/components/PieBaseRoot/index.d.ts.map +1 -0
- package/dist/components/PieBaseRoot/types/index.d.ts +12 -0
- package/dist/components/PieBaseRoot/types/index.d.ts.map +1 -0
- package/dist/components/PieCard/index.d.ts +22 -0
- package/dist/components/PieCard/index.d.ts.map +1 -0
- package/dist/components/PieCard/types/index.d.ts +52 -0
- package/dist/components/PieCard/types/index.d.ts.map +1 -0
- package/dist/components/PieMaxRoot/index.d.ts +17 -0
- package/dist/components/PieMaxRoot/index.d.ts.map +1 -0
- package/dist/components/PieRoot/index.d.ts +21 -0
- package/dist/components/PieRoot/index.d.ts.map +1 -0
- package/dist/components/PieRoot/types/index.d.ts +49 -0
- package/dist/components/PieRoot/types/index.d.ts.map +1 -0
- package/dist/components/PieTelegramRoot/index.d.ts +18 -0
- package/dist/components/PieTelegramRoot/index.d.ts.map +1 -0
- package/dist/components/UI/index.d.ts +9 -0
- package/dist/components/UI/index.d.ts.map +1 -0
- package/dist/components/UILoading/index.d.ts +8 -0
- package/dist/components/UILoading/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.esm.js +2 -0
- package/dist/components/index.js +2 -0
- package/dist/create.d.ts +3 -0
- package/dist/create.d.ts.map +1 -0
- package/dist/create.js +162 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +3 -0
- package/dist/index.js +3 -0
- package/dist/pieui.components.json +365 -0
- package/dist/providers/CentrifugeIOInitProvider.d.ts +6 -0
- package/dist/providers/CentrifugeIOInitProvider.d.ts.map +1 -0
- package/dist/providers/SocketIOInitProvider.d.ts +6 -0
- package/dist/providers/SocketIOInitProvider.d.ts.map +1 -0
- package/dist/tests/globalForm.test.d.ts +2 -0
- package/dist/tests/globalForm.test.d.ts.map +1 -0
- package/dist/tests/mitt.test.d.ts +2 -0
- package/dist/tests/mitt.test.d.ts.map +1 -0
- package/dist/tests/mittAgentTools.test.d.ts +2 -0
- package/dist/tests/mittAgentTools.test.d.ts.map +1 -0
- package/dist/tests/registry-builtin.test.d.ts +2 -0
- package/dist/tests/registry-builtin.test.d.ts.map +1 -0
- package/dist/tests/registry.test.d.ts +2 -0
- package/dist/tests/registry.test.d.ts.map +1 -0
- package/dist/tests/setup.d.ts +2 -0
- package/dist/tests/setup.d.ts.map +1 -0
- package/dist/tests/socket-cache.test.d.ts +2 -0
- package/dist/tests/socket-cache.test.d.ts.map +1 -0
- package/dist/tests/use-client-directive.test.d.ts +2 -0
- package/dist/tests/use-client-directive.test.d.ts.map +1 -0
- package/dist/tests/useMaxWebApp.test.d.ts +2 -0
- package/dist/tests/useMaxWebApp.test.d.ts.map +1 -0
- package/dist/tests/utils.test.d.ts +2 -0
- package/dist/tests/utils.test.d.ts.map +1 -0
- package/dist/types/index.d.ts +509 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/util/ajaxCommonUtils.d.ts +76 -0
- package/dist/util/ajaxCommonUtils.d.ts.map +1 -0
- package/dist/util/centrifuge.d.ts +27 -0
- package/dist/util/centrifuge.d.ts.map +1 -0
- package/dist/util/fallback.d.ts +10 -0
- package/dist/util/fallback.d.ts.map +1 -0
- package/dist/util/globalForm.d.ts +10 -0
- package/dist/util/globalForm.d.ts.map +1 -0
- package/dist/util/lazy.d.ts +31 -0
- package/dist/util/lazy.d.ts.map +1 -0
- package/dist/util/mitt.d.ts +45 -0
- package/dist/util/mitt.d.ts.map +1 -0
- package/dist/util/mittAgentTools.d.ts +89 -0
- package/dist/util/mittAgentTools.d.ts.map +1 -0
- package/dist/util/navigate.d.ts +15 -0
- package/dist/util/navigate.d.ts.map +1 -0
- package/dist/util/pieConfig.d.ts +52 -0
- package/dist/util/pieConfig.d.ts.map +1 -0
- package/dist/util/pieName.d.ts +14 -0
- package/dist/util/pieName.d.ts.map +1 -0
- package/dist/util/piecache.d.ts +19 -0
- package/dist/util/piecache.d.ts.map +1 -0
- package/dist/util/registry.d.ts +61 -0
- package/dist/util/registry.d.ts.map +1 -0
- package/dist/util/socket.d.ts +27 -0
- package/dist/util/socket.d.ts.map +1 -0
- package/dist/util/sx2radium.d.ts +8 -0
- package/dist/util/sx2radium.d.ts.map +1 -0
- package/dist/util/tailwindCommonUtils.d.ts +17 -0
- package/dist/util/tailwindCommonUtils.d.ts.map +1 -0
- package/dist/util/uiRenderer.d.ts +23 -0
- package/dist/util/uiRenderer.d.ts.map +1 -0
- package/dist/util/useIsSupported.d.ts +20 -0
- package/dist/util/useIsSupported.d.ts.map +1 -0
- package/dist/util/useMaxWebApp.d.ts +33 -0
- package/dist/util/useMaxWebApp.d.ts.map +1 -0
- package/dist/util/useOpenAIWebRTC.d.ts +58 -0
- package/dist/util/useOpenAIWebRTC.d.ts.map +1 -0
- package/dist/util/useWebApp.d.ts +27 -0
- package/dist/util/useWebApp.d.ts.map +1 -0
- package/dist/util/waitForSidAvailable.d.ts +11 -0
- package/dist/util/waitForSidAvailable.d.ts.map +1 -0
- package/dist/util/webrtcClient.d.ts +93 -0
- package/dist/util/webrtcClient.d.ts.map +1 -0
- package/package.json +125 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { InitData, InitDataUnsafe, WebApp } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* React hook that resolves the Telegram `WebApp` object from
|
|
4
|
+
* `window.Telegram.WebApp`, calls `ready()`, and optionally expands the
|
|
5
|
+
* viewport on iOS/Android when the current `pageProcessor` is
|
|
6
|
+
* `'telegram_expanded'`.
|
|
7
|
+
*
|
|
8
|
+
* When Telegram is not present (SSR, regular browsers, embedded previews)
|
|
9
|
+
* the hook silently returns `null`. Any error thrown by `ready()` is
|
|
10
|
+
* swallowed and forwarded to the caller-provided `onError` callback so
|
|
11
|
+
* that a failed init does not crash the tree.
|
|
12
|
+
*
|
|
13
|
+
* Accepts a single options object with an optional `onError` handler that
|
|
14
|
+
* fires when `wApp.ready()` throws.
|
|
15
|
+
*
|
|
16
|
+
* @returns The Telegram WebApp instance, or `null` when unavailable.
|
|
17
|
+
*/
|
|
18
|
+
export declare const useWebApp: ({ onError, }?: {
|
|
19
|
+
onError?: () => void;
|
|
20
|
+
}) => WebApp | null;
|
|
21
|
+
/**
|
|
22
|
+
* Convenience hook returning the Telegram WebApp init payload as a tuple of
|
|
23
|
+
* `[initDataUnsafe, initData]`. Both values are `undefined` on the server
|
|
24
|
+
* and while Telegram is still initializing.
|
|
25
|
+
*/
|
|
26
|
+
export declare const useInitData: () => readonly [InitDataUnsafe | undefined, InitData | undefined];
|
|
27
|
+
//# sourceMappingURL=useWebApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWebApp.d.ts","sourceRoot":"","sources":["../../src/util/useWebApp.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAE3D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,SAAS,GAAI,eAEvB;IAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAO,KAAG,MAAM,GAAG,IA2B3C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAAO,SAAS,CACpC,cAAc,GAAG,SAAS,EAC1B,QAAQ,GAAG,SAAS,CAKvB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Должно вызываться из SocketIOInitProvider сразу после того, как
|
|
3
|
+
* window.sid был проставлен. Резолвит любые ожидающие waitForSidAvailable().
|
|
4
|
+
*/
|
|
5
|
+
export declare function markSidAvailable(): void;
|
|
6
|
+
/**
|
|
7
|
+
* Возвращает промис, который резолвится, когда window.sid появится.
|
|
8
|
+
* Один промис-синглтон на все вызовы — никакого polling'а.
|
|
9
|
+
*/
|
|
10
|
+
export default function waitForSidAvailable(): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=waitForSidAvailable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waitForSidAvailable.d.ts","sourceRoot":"","sources":["../../src/util/waitForSidAvailable.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,gBAAgB,SAE/B;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAe3D"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options accepted by {@link WebRTCClient}.
|
|
3
|
+
*
|
|
4
|
+
* @property endpoint HTTP endpoint that exchanges SDP with the
|
|
5
|
+
* backend; must accept a POST of
|
|
6
|
+
* `{ sdp, type, webrtc_id }` and return the
|
|
7
|
+
* answer description.
|
|
8
|
+
* @property onConnected Fires after `setRemoteDescription` succeeds.
|
|
9
|
+
* @property onDisconnected Fires when `disconnect()` is invoked,
|
|
10
|
+
* regardless of whether a connection existed.
|
|
11
|
+
* @property onMessage Invoked for every JSON-parsed message
|
|
12
|
+
* received on the `text` data channel.
|
|
13
|
+
* @property onAudioStream Receives the remote `MediaStream` once
|
|
14
|
+
* negotiated so the caller can attach it to
|
|
15
|
+
* an audio element.
|
|
16
|
+
* @property onAudioLevel Throttled average microphone level in
|
|
17
|
+
* `[0, 1]`. Updates roughly every 100ms.
|
|
18
|
+
* @property audioInputDeviceId Optional `deviceId` constraint for
|
|
19
|
+
* `getUserMedia`.
|
|
20
|
+
* @property audioOutputDeviceId Output device id forwarded to the audio
|
|
21
|
+
* stream consumer via
|
|
22
|
+
* `options.audioOutputDeviceId`.
|
|
23
|
+
*/
|
|
24
|
+
interface WebRTCClientOptions {
|
|
25
|
+
endpoint: string;
|
|
26
|
+
onConnected?: () => void;
|
|
27
|
+
onDisconnected?: () => void;
|
|
28
|
+
onMessage?: (message: any) => void;
|
|
29
|
+
onAudioStream?: (stream: MediaStream) => void;
|
|
30
|
+
onAudioLevel?: (level: number) => void;
|
|
31
|
+
audioInputDeviceId?: string;
|
|
32
|
+
audioOutputDeviceId?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Browser-side WebRTC helper that opens an audio peer connection to a PieUI
|
|
36
|
+
* backend endpoint, exchanges SDP, and exposes lightweight hooks for
|
|
37
|
+
* messaging and microphone level analysis.
|
|
38
|
+
*
|
|
39
|
+
* The class is safe to instantiate in SSR environments — `connect()` and
|
|
40
|
+
* device setters guard on `typeof window !== 'undefined'` and no-op on the
|
|
41
|
+
* server. Calling any method twice cleanly re-establishes the connection.
|
|
42
|
+
*/
|
|
43
|
+
export declare class WebRTCClient {
|
|
44
|
+
private peerConnection;
|
|
45
|
+
private mediaStream;
|
|
46
|
+
private dataChannel;
|
|
47
|
+
private options;
|
|
48
|
+
private audioContext;
|
|
49
|
+
private analyser;
|
|
50
|
+
private dataArray;
|
|
51
|
+
private animationFrameId;
|
|
52
|
+
private currentInputDeviceId;
|
|
53
|
+
private currentOutputDeviceId;
|
|
54
|
+
constructor(options: WebRTCClientOptions);
|
|
55
|
+
/**
|
|
56
|
+
* Changes the active microphone device.
|
|
57
|
+
*
|
|
58
|
+
* If a peer connection is already open the client tears it down and
|
|
59
|
+
* re-connects with the new device, because WebRTC tracks cannot be
|
|
60
|
+
* swapped mid-session without renegotiation.
|
|
61
|
+
*/
|
|
62
|
+
setAudioInputDevice(deviceId: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* Changes the preferred audio output device. Because the actual sink is
|
|
65
|
+
* attached to the `<audio>` element in the consumer code, the new
|
|
66
|
+
* `deviceId` is forwarded through `options.audioOutputDeviceId` so the
|
|
67
|
+
* `onAudioStream` callback can apply `HTMLAudioElement.setSinkId()`.
|
|
68
|
+
*/
|
|
69
|
+
setAudioOutputDevice(deviceId: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Opens a new peer connection: acquires the microphone, wires up audio
|
|
72
|
+
* analysis, creates a `text` data channel, exchanges SDP with the
|
|
73
|
+
* configured endpoint, and invokes `onConnected` on success.
|
|
74
|
+
*
|
|
75
|
+
* Throws user-friendly `Error`s for the two most common microphone
|
|
76
|
+
* failures (`NotAllowedError` → permission denied, `NotFoundError` →
|
|
77
|
+
* no device detected). Any other failure triggers `disconnect()` and
|
|
78
|
+
* the underlying error is re-thrown so the caller can react.
|
|
79
|
+
*/
|
|
80
|
+
connect(): Promise<void>;
|
|
81
|
+
private setupAudioAnalysis;
|
|
82
|
+
private startAnalysis;
|
|
83
|
+
private stopAnalysis;
|
|
84
|
+
/**
|
|
85
|
+
* Tears the session down: stops the microphone tracks, closes the peer
|
|
86
|
+
* connection and data channel, releases the `AudioContext` used for
|
|
87
|
+
* level analysis, and invokes `onDisconnected`. Safe to call multiple
|
|
88
|
+
* times and on the server (no-op).
|
|
89
|
+
*/
|
|
90
|
+
disconnect(): void;
|
|
91
|
+
}
|
|
92
|
+
export {};
|
|
93
|
+
//# sourceMappingURL=webrtcClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webrtcClient.d.ts","sourceRoot":"","sources":["../../src/util/webrtcClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,UAAU,mBAAmB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAA;IAClC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAA;IAC7C,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC/B;AAKD;;;;;;;;GAQG;AACH,qBAAa,YAAY;IACrB,OAAO,CAAC,cAAc,CAAiC;IACvD,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,WAAW,CAA8B;IACjD,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,SAAS,CAAuC;IACxD,OAAO,CAAC,gBAAgB,CAAsB;IAC9C,OAAO,CAAC,oBAAoB,CAAgC;IAC5D,OAAO,CAAC,qBAAqB,CAAgC;gBAEjD,OAAO,EAAE,mBAAmB;IAMxC;;;;;;OAMG;IACH,mBAAmB,CAAC,QAAQ,EAAE,MAAM;IAUpC;;;;;OAKG;IACH,oBAAoB,CAAC,QAAQ,EAAE,MAAM;IAYrC;;;;;;;;;OASG;IACG,OAAO;IA4Gb,OAAO,CAAC,kBAAkB;IAuB1B,OAAO,CAAC,aAAa;IA+BrB,OAAO,CAAC,YAAY;IAiBpB;;;;;OAKG;IACH,UAAU;CAqBb"}
|
package/package.json
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@swarm.ing/pieui",
|
|
3
|
+
"version": "2.0.10",
|
|
4
|
+
"description": "A React component library featuring PieCard component",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Swarm-AI-Labs/pieui"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"module": "dist/index.esm.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"bin": {
|
|
13
|
+
"pieui": "dist/cli.js",
|
|
14
|
+
"create-pieui": "dist/create.js"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"sideEffects": [
|
|
20
|
+
"*.css"
|
|
21
|
+
],
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"import": "./dist/index.esm.js",
|
|
25
|
+
"require": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./components": {
|
|
29
|
+
"import": "./dist/components/index.esm.js",
|
|
30
|
+
"require": "./dist/components/index.js",
|
|
31
|
+
"types": "./dist/components/index.d.ts"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "rm -rf ./dist && rm -rf pieui-*.tgz && bun run build:clean && NODE_ENV=production bun run build:esm && NODE_ENV=production bun run build:cjs && NODE_ENV=production bun run build:components:esm && NODE_ENV=production bun run build:components:cjs && bun run build:banner && NODE_ENV=production bun run build:types && NODE_ENV=production bun run build:cli && NODE_ENV=production bun run build:create && bun src/cli.ts postbuild --src-dir src --out-dir dist && bun pm pack",
|
|
36
|
+
"build:banner": "node -e \"const fs=require('fs');['dist/index.esm.js','dist/index.js','dist/components/index.esm.js','dist/components/index.js'].forEach(f=>{if(fs.existsSync(f)){fs.writeFileSync(f,'\\\"use client\\\";\\n'+fs.readFileSync(f,'utf8'))}})\"",
|
|
37
|
+
"build:clean": "rm -rf dist",
|
|
38
|
+
"build:esm": "bun build src/index.ts --outfile dist/index.esm.js --format esm --target browser --jsx=automatic --jsx-import-source=react --minify --packages=external",
|
|
39
|
+
"build:cjs": "bun build src/index.ts --outfile dist/index.js --format cjs --target node --jsx=automatic --jsx-import-source=react --minify --packages=external",
|
|
40
|
+
"build:components:esm": "bun build src/components/index.ts --outfile dist/components/index.esm.js --format esm --target browser --jsx=automatic --jsx-import-source=react --minify --packages=external",
|
|
41
|
+
"build:components:cjs": "bun build src/components/index.ts --outfile dist/components/index.js --format cjs --target node --jsx=automatic --jsx-import-source=react --minify --packages=external",
|
|
42
|
+
"build:esm:debug": "bun build src/index.ts --outfile dist/index.esm.js --format esm --target browser --jsx=automatic --jsx-import-source=react --packages=external",
|
|
43
|
+
"build:cjs:debug": "bun build src/index.ts --outfile dist/index.js --format cjs --target node --jsx=automatic --jsx-import-source=react --packages=external",
|
|
44
|
+
"build:components:esm:debug": "bun build src/components/index.ts --outfile dist/components/index.esm.js --format esm --target browser --jsx=automatic --jsx-import-source=react --packages=external",
|
|
45
|
+
"build:components:cjs:debug": "bun build src/components/index.ts --outfile dist/components/index.js --format cjs --target node --jsx=automatic --jsx-import-source=react --packages=external",
|
|
46
|
+
"build:debug": "rm -rf ./dist && rm -rf pieui-*.tgz && bun run build:clean && NODE_ENV=production bun run build:esm:debug && NODE_ENV=production bun run build:cjs:debug && NODE_ENV=production bun run build:components:esm:debug && NODE_ENV=production bun run build:components:cjs:debug && NODE_ENV=production bun run build:types && NODE_ENV=production bun run build:cli && NODE_ENV=production bun run build:create && bun src/cli.ts postbuild --src-dir src --out-dir dist && bun pm pack",
|
|
47
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
48
|
+
"build:cli": "bun build src/cli.ts --outfile dist/cli.js --format cjs --target node --external vm2",
|
|
49
|
+
"build:create": "bun build src/create.ts --outfile dist/create.js --format cjs --target node --external vm2",
|
|
50
|
+
"dev": "bun run src/index.ts",
|
|
51
|
+
"test": "bun test",
|
|
52
|
+
"test:step1": "bun test src/__tests__/step1-local.test.cjs",
|
|
53
|
+
"test:step2": "bun test src/__tests__/step2-remote.test.cjs",
|
|
54
|
+
"test:step3": "bun test src/__tests__/step3-contract.test.cjs",
|
|
55
|
+
"test:step4": "bun test src/__tests__/step4-ci.test.cjs",
|
|
56
|
+
"test:step5": "bun test src/__tests__/step5-regres.test.cjs",
|
|
57
|
+
"test:steps": "bun test src/__tests__/step1-local.test.cjs src/__tests__/step2-remote.test.cjs src/__tests__/step3-contract.test.cjs src/__tests__/step4-ci.test.cjs src/__tests__/step5-regres.test.cjs",
|
|
58
|
+
"test:cleanup": "node scripts/cleanup-test-artifacts.mjs",
|
|
59
|
+
"typecheck": "tsc --noEmit",
|
|
60
|
+
"lint": "prettier --write ./",
|
|
61
|
+
"prepublishOnly": "bun run build",
|
|
62
|
+
"release": "npm version patch && git push && git push --tags",
|
|
63
|
+
"release:retry": "git tag v$(node -p \"require('./package.json').version\") && git push --tags",
|
|
64
|
+
"release:patch": "npm version patch && git push --tags",
|
|
65
|
+
"release:minor": "npm version minor && git push --tags",
|
|
66
|
+
"release:major": "npm version major && git push --tags",
|
|
67
|
+
"release:prerelease": "npm version prerelease --preid=beta && git push && git push --tags",
|
|
68
|
+
"release:dry-run": "npm publish --dry-run",
|
|
69
|
+
"publish:npm": "npm publish",
|
|
70
|
+
"publish:beta": "npm publish --tag beta",
|
|
71
|
+
"unrelease": "git tag -d v$(node -p \"require('./package.json').version\") && git push origin :refs/tags/v$(node -p \"require('./package.json').version\")",
|
|
72
|
+
"version:current": "node -p \"require('./package.json').version\""
|
|
73
|
+
},
|
|
74
|
+
"keywords": [
|
|
75
|
+
"react",
|
|
76
|
+
"component",
|
|
77
|
+
"ui",
|
|
78
|
+
"pie",
|
|
79
|
+
"card"
|
|
80
|
+
],
|
|
81
|
+
"author": "",
|
|
82
|
+
"license": "MIT",
|
|
83
|
+
"peerDependencies": {
|
|
84
|
+
"react": ">=19",
|
|
85
|
+
"react-dom": ">=19"
|
|
86
|
+
},
|
|
87
|
+
"devDependencies": {
|
|
88
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
89
|
+
"@testing-library/react": "^16.3.2",
|
|
90
|
+
"@types/bun": "latest",
|
|
91
|
+
"@types/glob": "^9.0.0",
|
|
92
|
+
"@types/node": "^25.5.0",
|
|
93
|
+
"@types/react": "^19.2.14",
|
|
94
|
+
"ajv": "^8.18.0",
|
|
95
|
+
"autoprefixer": "10",
|
|
96
|
+
"commander": "^14.0.3",
|
|
97
|
+
"eslint-plugin-no-browser-globals": "^1.0.1",
|
|
98
|
+
"glob": "^13.0.0",
|
|
99
|
+
"happy-dom": "^20.8.9",
|
|
100
|
+
"lint-staged": "^16.2.7",
|
|
101
|
+
"postcss": "8",
|
|
102
|
+
"tailwindcss": "3",
|
|
103
|
+
"typescript": ">=5",
|
|
104
|
+
"typescript-json-schema": "^0.67.1"
|
|
105
|
+
},
|
|
106
|
+
"dependencies": {
|
|
107
|
+
"@openai/agents": "^0.4.5",
|
|
108
|
+
"@tanstack/react-query": "^5.90.20",
|
|
109
|
+
"@telegram-apps/sdk": "^3.11.8",
|
|
110
|
+
"annyang": "^2.6.1",
|
|
111
|
+
"axios": "^1.15.0",
|
|
112
|
+
"axios-date-transformer": "^1.2.1",
|
|
113
|
+
"centrifuge": "^5.5.3",
|
|
114
|
+
"clsx": "^2.1.1",
|
|
115
|
+
"html-react-parser": "^5.2.16",
|
|
116
|
+
"jszip": "^3.10.1",
|
|
117
|
+
"mitt": "^3.0.1",
|
|
118
|
+
"react-toastify": "^11.0.5",
|
|
119
|
+
"socket.io-client": "^4.8.3",
|
|
120
|
+
"tailwind-merge": "^3.4.0",
|
|
121
|
+
"vm2": "^3.10.3",
|
|
122
|
+
"zod": "^4.3.6",
|
|
123
|
+
"zod-from-json-schema": "^0.5.2"
|
|
124
|
+
}
|
|
125
|
+
}
|