zero-query 1.1.1 → 1.2.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/LICENSE +21 -21
- package/README.md +2 -0
- package/cli/args.js +33 -33
- package/cli/commands/build-api.js +443 -442
- package/cli/commands/build.js +254 -247
- package/cli/commands/bundle.js +1228 -1224
- package/cli/commands/create.js +137 -121
- package/cli/commands/dev/devtools/index.js +56 -56
- package/cli/commands/dev/devtools/js/components.js +49 -49
- package/cli/commands/dev/devtools/js/core.js +423 -423
- package/cli/commands/dev/devtools/js/elements.js +421 -421
- package/cli/commands/dev/devtools/js/network.js +166 -166
- package/cli/commands/dev/devtools/js/performance.js +73 -73
- package/cli/commands/dev/devtools/js/router.js +105 -105
- package/cli/commands/dev/devtools/js/source.js +132 -132
- package/cli/commands/dev/devtools/js/stats.js +35 -35
- package/cli/commands/dev/devtools/js/tabs.js +79 -79
- package/cli/commands/dev/devtools/panel.html +95 -95
- package/cli/commands/dev/devtools/styles.css +244 -244
- package/cli/commands/dev/index.js +107 -107
- package/cli/commands/dev/logger.js +75 -75
- package/cli/commands/dev/overlay.js +858 -858
- package/cli/commands/dev/server.js +220 -220
- package/cli/commands/dev/validator.js +94 -94
- package/cli/commands/dev/watcher.js +172 -172
- package/cli/help.js +114 -112
- package/cli/index.js +52 -52
- package/cli/scaffold/default/LICENSE +21 -21
- package/cli/scaffold/default/app/app.js +207 -207
- package/cli/scaffold/default/app/components/about.js +201 -201
- package/cli/scaffold/default/app/components/api-demo.js +143 -143
- package/cli/scaffold/default/app/components/contact-card.js +231 -231
- package/cli/scaffold/default/app/components/contacts/contacts.css +706 -706
- package/cli/scaffold/default/app/components/contacts/contacts.html +200 -200
- package/cli/scaffold/default/app/components/contacts/contacts.js +196 -196
- package/cli/scaffold/default/app/components/counter.js +127 -127
- package/cli/scaffold/default/app/components/home.js +249 -249
- package/cli/scaffold/default/app/components/not-found.js +16 -16
- package/cli/scaffold/default/app/components/playground/playground.css +115 -115
- package/cli/scaffold/default/app/components/playground/playground.html +161 -161
- package/cli/scaffold/default/app/components/playground/playground.js +116 -116
- package/cli/scaffold/default/app/components/todos.js +225 -225
- package/cli/scaffold/default/app/components/toolkit/toolkit.css +97 -97
- package/cli/scaffold/default/app/components/toolkit/toolkit.html +146 -146
- package/cli/scaffold/default/app/components/toolkit/toolkit.js +280 -280
- package/cli/scaffold/default/app/routes.js +15 -15
- package/cli/scaffold/default/app/store.js +101 -101
- package/cli/scaffold/default/global.css +552 -552
- package/cli/scaffold/default/index.html +99 -99
- package/cli/scaffold/minimal/app/app.js +85 -85
- package/cli/scaffold/minimal/app/components/about.js +68 -68
- package/cli/scaffold/minimal/app/components/counter.js +122 -122
- package/cli/scaffold/minimal/app/components/home.js +68 -68
- package/cli/scaffold/minimal/app/components/not-found.js +16 -16
- package/cli/scaffold/minimal/app/routes.js +9 -9
- package/cli/scaffold/minimal/app/store.js +36 -36
- package/cli/scaffold/minimal/global.css +300 -300
- package/cli/scaffold/minimal/index.html +44 -44
- package/cli/scaffold/ssr/app/app.js +41 -41
- package/cli/scaffold/ssr/app/components/about.js +55 -55
- package/cli/scaffold/ssr/app/components/blog/index.js +65 -65
- package/cli/scaffold/ssr/app/components/blog/post.js +86 -86
- package/cli/scaffold/ssr/app/components/home.js +37 -37
- package/cli/scaffold/ssr/app/components/not-found.js +15 -15
- package/cli/scaffold/ssr/app/routes.js +8 -8
- package/cli/scaffold/ssr/global.css +228 -228
- package/cli/scaffold/ssr/index.html +37 -37
- package/cli/scaffold/ssr/package.json +8 -8
- package/cli/scaffold/ssr/server/data/posts.js +144 -144
- package/cli/scaffold/ssr/server/index.js +213 -213
- package/cli/scaffold/webrtc/app/app.js +11 -0
- package/cli/scaffold/webrtc/app/components/video-room.js +295 -0
- package/cli/scaffold/webrtc/app/lib/room.js +252 -0
- package/cli/scaffold/webrtc/assets/.gitkeep +0 -0
- package/cli/scaffold/webrtc/global.css +250 -0
- package/cli/scaffold/webrtc/index.html +21 -0
- package/cli/utils.js +305 -287
- package/dist/API.md +661 -0
- package/dist/zquery.dist.zip +0 -0
- package/dist/zquery.js +10313 -6614
- package/dist/zquery.min.js +8 -631
- package/index.d.ts +570 -371
- package/index.js +311 -240
- package/package.json +76 -70
- package/src/component.js +1709 -1691
- package/src/core.js +921 -921
- package/src/diff.js +497 -497
- package/src/errors.js +209 -209
- package/src/expression.js +922 -922
- package/src/http.js +242 -242
- package/src/package.json +1 -1
- package/src/reactive.js +255 -255
- package/src/router.js +843 -843
- package/src/ssr.js +418 -418
- package/src/store.js +318 -318
- package/src/utils.js +515 -515
- package/src/webrtc/e2ee.js +351 -0
- package/src/webrtc/errors.js +116 -0
- package/src/webrtc/ice.js +301 -0
- package/src/webrtc/index.js +131 -0
- package/src/webrtc/joinToken.js +119 -0
- package/src/webrtc/observe.js +172 -0
- package/src/webrtc/peer.js +351 -0
- package/src/webrtc/reactive.js +268 -0
- package/src/webrtc/room.js +625 -0
- package/src/webrtc/sdp.js +302 -0
- package/src/webrtc/sfu/index.js +43 -0
- package/src/webrtc/sfu/livekit.js +131 -0
- package/src/webrtc/sfu/mediasoup.js +150 -0
- package/src/webrtc/signaling.js +373 -0
- package/src/webrtc/turn.js +237 -0
- package/tests/_helpers/webrtcFakes.js +289 -0
- package/tests/audit.test.js +4158 -4158
- package/tests/cli.test.js +1136 -1103
- package/tests/compare.test.js +497 -486
- package/tests/component.test.js +3969 -3938
- package/tests/core.test.js +1910 -1910
- package/tests/dev-server.test.js +489 -489
- package/tests/diff.test.js +1416 -1416
- package/tests/docs.test.js +1664 -1650
- package/tests/electron-features.test.js +864 -864
- package/tests/errors.test.js +619 -619
- package/tests/expression.test.js +1056 -1056
- package/tests/http.test.js +648 -648
- package/tests/reactive.test.js +819 -819
- package/tests/router.test.js +2327 -2327
- package/tests/ssr.test.js +870 -870
- package/tests/store.test.js +830 -830
- package/tests/test-minifier.js +153 -153
- package/tests/test-ssr.js +27 -27
- package/tests/utils.test.js +1377 -1377
- package/tests/webrtc/e2ee.test.js +283 -0
- package/tests/webrtc/ice.test.js +202 -0
- package/tests/webrtc/joinToken.test.js +89 -0
- package/tests/webrtc/observe.test.js +111 -0
- package/tests/webrtc/peer.test.js +373 -0
- package/tests/webrtc/reactive.test.js +235 -0
- package/tests/webrtc/room.test.js +406 -0
- package/tests/webrtc/sdp.test.js +151 -0
- package/tests/webrtc/sfu-livekit.test.js +119 -0
- package/tests/webrtc/sfu.test.js +160 -0
- package/tests/webrtc/signaling.test.js +251 -0
- package/tests/webrtc/turn.test.js +256 -0
- package/types/collection.d.ts +383 -383
- package/types/component.d.ts +186 -186
- package/types/errors.d.ts +135 -135
- package/types/http.d.ts +92 -92
- package/types/misc.d.ts +201 -201
- package/types/reactive.d.ts +98 -98
- package/types/router.d.ts +190 -190
- package/types/ssr.d.ts +102 -102
- package/types/store.d.ts +146 -146
- package/types/utils.d.ts +245 -245
- package/types/webrtc.d.ts +653 -0
package/index.js
CHANGED
|
@@ -1,240 +1,311 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ┌---------------------------------------------------------┐
|
|
3
|
-
* │ zQuery (zeroQuery) - Lightweight Frontend Library │
|
|
4
|
-
* │ │
|
|
5
|
-
* │ jQuery-like selectors · Reactive components │
|
|
6
|
-
* │ SPA router · State management · Zero dependencies │
|
|
7
|
-
* │ │
|
|
8
|
-
* │ https://github.com/tonywied17/zero-query │
|
|
9
|
-
* └---------------------------------------------------------┘
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { query, queryAll, ZQueryCollection } from './src/core.js';
|
|
13
|
-
import { reactive, Signal, signal, computed, effect, batch, untracked } from './src/reactive.js';
|
|
14
|
-
import { component, mount, mountAll, getInstance, destroy, getRegistry, prefetch, style } from './src/component.js';
|
|
15
|
-
import { createRouter, getRouter, matchRoute } from './src/router.js';
|
|
16
|
-
import { createStore, getStore, connectStore } from './src/store.js';
|
|
17
|
-
import { http } from './src/http.js';
|
|
18
|
-
import { morph, morphElement } from './src/diff.js';
|
|
19
|
-
import { safeEval } from './src/expression.js';
|
|
20
|
-
import {
|
|
21
|
-
debounce, throttle, pipe, once, sleep,
|
|
22
|
-
escapeHtml, stripHtml, html, trust, TrustedHTML, uuid, camelCase, kebabCase,
|
|
23
|
-
deepClone, deepMerge, isEqual, param, parseQuery,
|
|
24
|
-
storage, session, EventBus, bus,
|
|
25
|
-
range, unique, chunk, groupBy,
|
|
26
|
-
pick, omit, getPath, setPath, isEmpty,
|
|
27
|
-
capitalize, truncate, clamp,
|
|
28
|
-
memoize, retry, timeout,
|
|
29
|
-
} from './src/utils.js';
|
|
30
|
-
import { ZQueryError, ErrorCode, onError, reportError, guardCallback, guardAsync, validate, formatError } from './src/errors.js';
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
$.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
// ---
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
$.
|
|
93
|
-
$.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
$.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
$.
|
|
107
|
-
$.
|
|
108
|
-
$.
|
|
109
|
-
$.
|
|
110
|
-
$.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
$.
|
|
114
|
-
$.
|
|
115
|
-
$.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
$.
|
|
119
|
-
$.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
$.
|
|
124
|
-
$.
|
|
125
|
-
$.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
$.
|
|
129
|
-
$.
|
|
130
|
-
$.
|
|
131
|
-
$.
|
|
132
|
-
$.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
$.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
$.
|
|
141
|
-
$.
|
|
142
|
-
$.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
$.
|
|
146
|
-
$.
|
|
147
|
-
$.
|
|
148
|
-
$.
|
|
149
|
-
$.
|
|
150
|
-
$.
|
|
151
|
-
$.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
$.
|
|
155
|
-
$.
|
|
156
|
-
$.
|
|
157
|
-
$.
|
|
158
|
-
$.
|
|
159
|
-
$.
|
|
160
|
-
$.
|
|
161
|
-
$.
|
|
162
|
-
$.
|
|
163
|
-
$.
|
|
164
|
-
$.
|
|
165
|
-
$.
|
|
166
|
-
$.
|
|
167
|
-
$.
|
|
168
|
-
$.
|
|
169
|
-
$.
|
|
170
|
-
$.
|
|
171
|
-
$.
|
|
172
|
-
$.
|
|
173
|
-
$.
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
$.
|
|
177
|
-
$.
|
|
178
|
-
$.
|
|
179
|
-
$.
|
|
180
|
-
$.
|
|
181
|
-
$.
|
|
182
|
-
$.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
$.
|
|
186
|
-
$.
|
|
187
|
-
$.
|
|
188
|
-
$.
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
$.
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
$.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ┌---------------------------------------------------------┐
|
|
3
|
+
* │ zQuery (zeroQuery) - Lightweight Frontend Library │
|
|
4
|
+
* │ │
|
|
5
|
+
* │ jQuery-like selectors · Reactive components │
|
|
6
|
+
* │ SPA router · State management · Zero dependencies │
|
|
7
|
+
* │ │
|
|
8
|
+
* │ https://github.com/tonywied17/zero-query │
|
|
9
|
+
* └---------------------------------------------------------┘
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { query, queryAll, ZQueryCollection } from './src/core.js';
|
|
13
|
+
import { reactive, Signal, signal, computed, effect, batch, untracked } from './src/reactive.js';
|
|
14
|
+
import { component, mount, mountAll, getInstance, destroy, getRegistry, prefetch, style } from './src/component.js';
|
|
15
|
+
import { createRouter, getRouter, matchRoute } from './src/router.js';
|
|
16
|
+
import { createStore, getStore, connectStore } from './src/store.js';
|
|
17
|
+
import { http } from './src/http.js';
|
|
18
|
+
import { morph, morphElement } from './src/diff.js';
|
|
19
|
+
import { safeEval } from './src/expression.js';
|
|
20
|
+
import {
|
|
21
|
+
debounce, throttle, pipe, once, sleep,
|
|
22
|
+
escapeHtml, stripHtml, html, trust, TrustedHTML, uuid, camelCase, kebabCase,
|
|
23
|
+
deepClone, deepMerge, isEqual, param, parseQuery,
|
|
24
|
+
storage, session, EventBus, bus,
|
|
25
|
+
range, unique, chunk, groupBy,
|
|
26
|
+
pick, omit, getPath, setPath, isEmpty,
|
|
27
|
+
capitalize, truncate, clamp,
|
|
28
|
+
memoize, retry, timeout,
|
|
29
|
+
} from './src/utils.js';
|
|
30
|
+
import { ZQueryError, ErrorCode, onError, reportError, guardCallback, guardAsync, validate, formatError } from './src/errors.js';
|
|
31
|
+
import {
|
|
32
|
+
webrtc,
|
|
33
|
+
SignalingClient,
|
|
34
|
+
Peer,
|
|
35
|
+
Room, join as webrtcJoin,
|
|
36
|
+
useRoom, usePeer, useTracks, useDataChannel, useConnectionQuality,
|
|
37
|
+
fetchTurnCredentials, mergeIceServers, createTurnRefresher,
|
|
38
|
+
deriveSFrameKey, generateSFrameKey, SFrameContext,
|
|
39
|
+
encryptFrame, decryptFrame, attachE2ee,
|
|
40
|
+
loadSfuAdapter,
|
|
41
|
+
decodeJoinToken, isJoinTokenExpired,
|
|
42
|
+
samplePeerStats, createStatsSampler, classifyStats,
|
|
43
|
+
parseSdp, validateSdp,
|
|
44
|
+
parseCandidate, stringifyCandidate, filterCandidates,
|
|
45
|
+
isPrivateIp, isLoopbackIp, isLinkLocalIp, isMdnsHostname,
|
|
46
|
+
WebRtcError, SignalingError, IceError, SdpError, TurnError, E2eeError, SfuError,
|
|
47
|
+
} from './src/webrtc/index.js';
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
// $ - The main function & namespace
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Main selector function - always returns a ZQueryCollection (like jQuery).
|
|
56
|
+
*
|
|
57
|
+
* $('selector') → ZQueryCollection (querySelectorAll)
|
|
58
|
+
* $('<div>hello</div>') → ZQueryCollection from created elements
|
|
59
|
+
* $(element) → ZQueryCollection wrapping the element
|
|
60
|
+
* $(fn) → DOMContentLoaded shorthand
|
|
61
|
+
*
|
|
62
|
+
* @param {string|Element|NodeList|Function} selector
|
|
63
|
+
* @param {string|Element} [context]
|
|
64
|
+
* @returns {ZQueryCollection}
|
|
65
|
+
*/
|
|
66
|
+
function $(selector, context) {
|
|
67
|
+
// $(fn) → DOM ready shorthand
|
|
68
|
+
if (typeof selector === 'function') {
|
|
69
|
+
query.ready(selector);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
return query(selector, context);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
// --- Quick refs (DOM selectors) --------------------------------------------
|
|
77
|
+
$.id = query.id;
|
|
78
|
+
$.class = query.class;
|
|
79
|
+
$.classes = query.classes;
|
|
80
|
+
$.tag = query.tag;
|
|
81
|
+
Object.defineProperty($, 'name', {
|
|
82
|
+
value: query.name, writable: true, configurable: true
|
|
83
|
+
});
|
|
84
|
+
$.children = query.children;
|
|
85
|
+
$.qs = query.qs;
|
|
86
|
+
$.qsa = query.qsa;
|
|
87
|
+
|
|
88
|
+
// --- Collection selector ---------------------------------------------------
|
|
89
|
+
/**
|
|
90
|
+
* Collection selector (like jQuery's $)
|
|
91
|
+
*
|
|
92
|
+
* $.all('selector') → ZQueryCollection (querySelectorAll)
|
|
93
|
+
* $.all('<div>hello</div>') → create elements as collection
|
|
94
|
+
* $.all(element) → wrap element in collection
|
|
95
|
+
* $.all(nodeList) → wrap NodeList in collection
|
|
96
|
+
*
|
|
97
|
+
* @param {string|Element|NodeList|Array} selector
|
|
98
|
+
* @param {string|Element} [context]
|
|
99
|
+
* @returns {ZQueryCollection}
|
|
100
|
+
*/
|
|
101
|
+
$.all = function(selector, context) {
|
|
102
|
+
return queryAll(selector, context);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// --- DOM helpers -----------------------------------------------------------
|
|
106
|
+
$.create = query.create;
|
|
107
|
+
$.ready = query.ready;
|
|
108
|
+
$.on = query.on;
|
|
109
|
+
$.off = query.off;
|
|
110
|
+
$.fn = query.fn;
|
|
111
|
+
|
|
112
|
+
// --- Reactive primitives ---------------------------------------------------
|
|
113
|
+
$.reactive = reactive;
|
|
114
|
+
$.Signal = Signal;
|
|
115
|
+
$.signal = signal;
|
|
116
|
+
$.computed = computed;
|
|
117
|
+
$.effect = effect;
|
|
118
|
+
$.batch = batch;
|
|
119
|
+
$.untracked = untracked;
|
|
120
|
+
|
|
121
|
+
// --- Components ------------------------------------------------------------
|
|
122
|
+
$.component = component;
|
|
123
|
+
$.mount = mount;
|
|
124
|
+
$.mountAll = mountAll;
|
|
125
|
+
$.getInstance = getInstance;
|
|
126
|
+
$.destroy = destroy;
|
|
127
|
+
$.components = getRegistry;
|
|
128
|
+
$.prefetch = prefetch;
|
|
129
|
+
$.style = style;
|
|
130
|
+
$.morph = morph;
|
|
131
|
+
$.morphElement = morphElement;
|
|
132
|
+
$.safeEval = safeEval;
|
|
133
|
+
|
|
134
|
+
// --- Router ----------------------------------------------------------------
|
|
135
|
+
$.router = createRouter;
|
|
136
|
+
$.getRouter = getRouter;
|
|
137
|
+
$.matchRoute = matchRoute;
|
|
138
|
+
|
|
139
|
+
// --- Store -----------------------------------------------------------------
|
|
140
|
+
$.store = createStore;
|
|
141
|
+
$.getStore = getStore;
|
|
142
|
+
$.connectStore = connectStore;
|
|
143
|
+
|
|
144
|
+
// --- HTTP ------------------------------------------------------------------
|
|
145
|
+
$.http = http;
|
|
146
|
+
$.get = http.get;
|
|
147
|
+
$.post = http.post;
|
|
148
|
+
$.put = http.put;
|
|
149
|
+
$.patch = http.patch;
|
|
150
|
+
$.delete = http.delete;
|
|
151
|
+
$.head = http.head;
|
|
152
|
+
|
|
153
|
+
// --- Utilities -------------------------------------------------------------
|
|
154
|
+
$.debounce = debounce;
|
|
155
|
+
$.throttle = throttle;
|
|
156
|
+
$.pipe = pipe;
|
|
157
|
+
$.once = once;
|
|
158
|
+
$.sleep = sleep;
|
|
159
|
+
$.escapeHtml = escapeHtml;
|
|
160
|
+
$.stripHtml = stripHtml;
|
|
161
|
+
$.html = html;
|
|
162
|
+
$.trust = trust;
|
|
163
|
+
$.TrustedHTML = TrustedHTML;
|
|
164
|
+
$.uuid = uuid;
|
|
165
|
+
$.camelCase = camelCase;
|
|
166
|
+
$.kebabCase = kebabCase;
|
|
167
|
+
$.deepClone = deepClone;
|
|
168
|
+
$.deepMerge = deepMerge;
|
|
169
|
+
$.isEqual = isEqual;
|
|
170
|
+
$.param = param;
|
|
171
|
+
$.parseQuery = parseQuery;
|
|
172
|
+
$.storage = storage;
|
|
173
|
+
$.session = session;
|
|
174
|
+
$.EventBus = EventBus;
|
|
175
|
+
$.bus = bus;
|
|
176
|
+
$.range = range;
|
|
177
|
+
$.unique = unique;
|
|
178
|
+
$.chunk = chunk;
|
|
179
|
+
$.groupBy = groupBy;
|
|
180
|
+
$.pick = pick;
|
|
181
|
+
$.omit = omit;
|
|
182
|
+
$.getPath = getPath;
|
|
183
|
+
$.setPath = setPath;
|
|
184
|
+
$.isEmpty = isEmpty;
|
|
185
|
+
$.capitalize = capitalize;
|
|
186
|
+
$.truncate = truncate;
|
|
187
|
+
$.clamp = clamp;
|
|
188
|
+
$.memoize = memoize;
|
|
189
|
+
$.retry = retry;
|
|
190
|
+
$.timeout = timeout;
|
|
191
|
+
|
|
192
|
+
// --- Error handling --------------------------------------------------------
|
|
193
|
+
$.onError = onError;
|
|
194
|
+
$.ZQueryError = ZQueryError;
|
|
195
|
+
$.ErrorCode = ErrorCode;
|
|
196
|
+
$.guardCallback = guardCallback;
|
|
197
|
+
$.guardAsync = guardAsync;
|
|
198
|
+
$.validate = validate;
|
|
199
|
+
$.formatError = formatError;
|
|
200
|
+
|
|
201
|
+
// --- WebRTC ----------------------------------------------------------------
|
|
202
|
+
$.webrtc = webrtc;
|
|
203
|
+
$.SignalingClient = SignalingClient;
|
|
204
|
+
$.Peer = Peer;
|
|
205
|
+
$.Room = Room;
|
|
206
|
+
$.useRoom = useRoom;
|
|
207
|
+
$.usePeer = usePeer;
|
|
208
|
+
$.useTracks = useTracks;
|
|
209
|
+
$.useDataChannel = useDataChannel;
|
|
210
|
+
$.useConnectionQuality = useConnectionQuality;
|
|
211
|
+
$.fetchTurnCredentials = fetchTurnCredentials;
|
|
212
|
+
$.mergeIceServers = mergeIceServers;
|
|
213
|
+
$.createTurnRefresher = createTurnRefresher;
|
|
214
|
+
$.deriveSFrameKey = deriveSFrameKey;
|
|
215
|
+
$.generateSFrameKey = generateSFrameKey;
|
|
216
|
+
$.SFrameContext = SFrameContext;
|
|
217
|
+
$.encryptFrame = encryptFrame;
|
|
218
|
+
$.decryptFrame = decryptFrame;
|
|
219
|
+
$.attachE2ee = attachE2ee;
|
|
220
|
+
$.loadSfuAdapter = loadSfuAdapter;
|
|
221
|
+
$.SfuError = SfuError;
|
|
222
|
+
$.decodeJoinToken = decodeJoinToken;
|
|
223
|
+
$.isJoinTokenExpired = isJoinTokenExpired;
|
|
224
|
+
$.samplePeerStats = samplePeerStats;
|
|
225
|
+
$.createStatsSampler = createStatsSampler;
|
|
226
|
+
$.classifyStats = classifyStats;
|
|
227
|
+
$.parseSdp = parseSdp;
|
|
228
|
+
$.validateSdp = validateSdp;
|
|
229
|
+
$.parseCandidate = parseCandidate;
|
|
230
|
+
$.stringifyCandidate = stringifyCandidate;
|
|
231
|
+
$.filterCandidates = filterCandidates;
|
|
232
|
+
$.isPrivateIp = isPrivateIp;
|
|
233
|
+
$.isLoopbackIp = isLoopbackIp;
|
|
234
|
+
$.isLinkLocalIp = isLinkLocalIp;
|
|
235
|
+
$.isMdnsHostname = isMdnsHostname;
|
|
236
|
+
$.WebRtcError = WebRtcError;
|
|
237
|
+
$.SignalingError = SignalingError;
|
|
238
|
+
$.IceError = IceError;
|
|
239
|
+
$.SdpError = SdpError;
|
|
240
|
+
$.TurnError = TurnError;
|
|
241
|
+
$.E2eeError = E2eeError;
|
|
242
|
+
|
|
243
|
+
// --- Meta ------------------------------------------------------------------
|
|
244
|
+
$.version = '__VERSION__';
|
|
245
|
+
$.libSize = '__LIB_SIZE__';
|
|
246
|
+
$.unitTests = '__UNIT_TESTS__';
|
|
247
|
+
$.meta = {}; // populated at build time by CLI bundler
|
|
248
|
+
|
|
249
|
+
// --- Environment detection -------------------------------------------------
|
|
250
|
+
$.isElectron = typeof navigator !== 'undefined' && /Electron/i.test(navigator.userAgent)
|
|
251
|
+
|| typeof process !== 'undefined' && process.versions != null && !!process.versions.electron;
|
|
252
|
+
$.platform = $.isElectron ? 'electron'
|
|
253
|
+
: typeof window !== 'undefined' ? 'browser'
|
|
254
|
+
: 'node';
|
|
255
|
+
|
|
256
|
+
$.noConflict = () => {
|
|
257
|
+
if (typeof window !== 'undefined' && window.$ === $) {
|
|
258
|
+
delete window.$;
|
|
259
|
+
}
|
|
260
|
+
return $;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
// ---------------------------------------------------------------------------
|
|
265
|
+
// Global exposure (browser)
|
|
266
|
+
// ---------------------------------------------------------------------------
|
|
267
|
+
if (typeof window !== 'undefined') {
|
|
268
|
+
window.$ = $;
|
|
269
|
+
window.zQuery = $;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
// ---------------------------------------------------------------------------
|
|
274
|
+
// Named exports (ES modules)
|
|
275
|
+
// ---------------------------------------------------------------------------
|
|
276
|
+
export {
|
|
277
|
+
$,
|
|
278
|
+
$ as zQuery,
|
|
279
|
+
ZQueryCollection,
|
|
280
|
+
queryAll,
|
|
281
|
+
reactive, Signal, signal, computed, effect, batch, untracked,
|
|
282
|
+
component, mount, mountAll, getInstance, destroy, getRegistry, prefetch, style,
|
|
283
|
+
morph, morphElement,
|
|
284
|
+
safeEval,
|
|
285
|
+
createRouter, getRouter, matchRoute,
|
|
286
|
+
createStore, getStore, connectStore,
|
|
287
|
+
http,
|
|
288
|
+
ZQueryError, ErrorCode, onError, reportError, guardCallback, guardAsync, validate, formatError,
|
|
289
|
+
webrtc, SignalingClient, Peer, Room, webrtcJoin,
|
|
290
|
+
useRoom, usePeer, useTracks, useDataChannel, useConnectionQuality,
|
|
291
|
+
fetchTurnCredentials, mergeIceServers, createTurnRefresher,
|
|
292
|
+
deriveSFrameKey, generateSFrameKey, SFrameContext,
|
|
293
|
+
encryptFrame, decryptFrame, attachE2ee,
|
|
294
|
+
loadSfuAdapter, SfuError,
|
|
295
|
+
decodeJoinToken, isJoinTokenExpired,
|
|
296
|
+
samplePeerStats, createStatsSampler, classifyStats,
|
|
297
|
+
parseSdp, validateSdp,
|
|
298
|
+
parseCandidate, stringifyCandidate, filterCandidates,
|
|
299
|
+
isPrivateIp, isLoopbackIp, isLinkLocalIp, isMdnsHostname,
|
|
300
|
+
WebRtcError, SignalingError, IceError, SdpError, TurnError, E2eeError,
|
|
301
|
+
debounce, throttle, pipe, once, sleep,
|
|
302
|
+
escapeHtml, stripHtml, html, trust, TrustedHTML, uuid, camelCase, kebabCase,
|
|
303
|
+
deepClone, deepMerge, isEqual, param, parseQuery,
|
|
304
|
+
storage, session, EventBus, bus,
|
|
305
|
+
range, unique, chunk, groupBy,
|
|
306
|
+
pick, omit, getPath, setPath, isEmpty,
|
|
307
|
+
capitalize, truncate, clamp,
|
|
308
|
+
memoize, retry, timeout,
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
export default $;
|