ziko 0.49.4 → 0.49.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ziko.cjs +101 -61
- package/dist/ziko.js +101 -61
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +101 -61
- package/package.json +2 -1
- package/src/__ziko__/__state__.js +1 -1
- package/src/hooks/index.js +3 -1
- package/src/hooks/use-channel.js +102 -0
- package/src/hooks/use-derived.js +1 -1
- package/src/hooks/use-reactive.js +1 -2
- package/src/{use → hooks}/use-storage.js +3 -3
- package/src/math/complex/index.js +1 -3
- package/src/math/matrix/Matrix.js +1 -3
- package/src/reactivity/hooks/UI/useMediaQuery.js +2 -2
- package/src/reactivity/hooks/UI/useStyle.js +3 -3
- package/src/reactivity/hooks/UI/useTheme.js +2 -2
- package/src/use/index.js +2 -2
- package/src/use/use-channel.js.txt +61 -0
- package/src/use/use-event-emmiter.js +2 -2
- package/src/use/use-root.js +3 -3
- package/src/use/use-storage.js.txt +73 -0
- package/src/use/use-thread.js +2 -2
- package/types/hooks/index.d.ts +4 -0
- package/types/hooks/use-channel.d.ts +12 -0
- package/types/hooks/use-derived.d.ts +14 -0
- package/types/hooks/use-reactive.d.ts +14 -0
- package/types/hooks/use-state.d.ts +25 -0
- package/types/index.d.ts +2 -1
- package/src/math/absract.js +0 -1
- package/src/use/use-channel.js +0 -50
package/dist/ziko.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/*
|
|
3
3
|
Project: ziko.js
|
|
4
4
|
Author: Zakaria Elalaoui
|
|
5
|
-
Date :
|
|
5
|
+
Date : Wed Nov 26 2025 12:01:55 GMT+0100 (UTC+01:00)
|
|
6
6
|
Git-Repo : https://github.com/zakarialaoui10/ziko.js
|
|
7
7
|
Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
|
|
8
8
|
Released under MIT License
|
|
@@ -44,8 +44,6 @@ Fixed = new Proxy(Fixed, {
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
class ZikoMath {}
|
|
48
|
-
|
|
49
47
|
// To generalise
|
|
50
48
|
|
|
51
49
|
const mapfun$1=(fun,...X)=>{
|
|
@@ -1181,57 +1179,108 @@ const __CACHE__ = {
|
|
|
1181
1179
|
}
|
|
1182
1180
|
};
|
|
1183
1181
|
|
|
1184
|
-
class
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1182
|
+
class UseChannel {
|
|
1183
|
+
// private fields
|
|
1184
|
+
#channel;
|
|
1185
|
+
#eventData;
|
|
1186
|
+
#handlers;
|
|
1187
|
+
#uuid;
|
|
1188
|
+
#subscribers;
|
|
1189
|
+
#currentRooms; // now a Set for multiple rooms
|
|
1190
|
+
|
|
1191
|
+
constructor(name = "") {
|
|
1192
|
+
this.#channel = new BroadcastChannel(name);
|
|
1193
|
+
this.#eventData = new Map();
|
|
1194
|
+
this.#handlers = new Map(); // Map<event, Array<{fn, rooms}>>
|
|
1195
|
+
this.#uuid = "ziko-channel:" + Random.string(10);
|
|
1196
|
+
this.#subscribers = new Set([this.#uuid]);
|
|
1197
|
+
this.#currentRooms = new Set(); // multiple rooms
|
|
1198
|
+
|
|
1199
|
+
this.#channel.addEventListener("message", (e) => {
|
|
1200
|
+
const { last_sent_event, userId, eventData, rooms } = e.data;
|
|
1201
|
+
|
|
1202
|
+
if (userId === this.#uuid) return; // ignore own messages
|
|
1203
|
+
|
|
1204
|
+
// broadcast if no rooms, else check intersection
|
|
1205
|
+
if (rooms && rooms.length && !rooms.some(r => this.#currentRooms.has(r))) return;
|
|
1206
|
+
|
|
1207
|
+
this.#subscribers.add(userId);
|
|
1208
|
+
this.#eventData = new Map(eventData);
|
|
1209
|
+
|
|
1210
|
+
const handlersList = this.#handlers.get(last_sent_event);
|
|
1211
|
+
if (!handlersList) return;
|
|
1212
|
+
|
|
1213
|
+
handlersList.forEach(({ fn, rooms: handlerRooms }) => {
|
|
1214
|
+
// trigger if listener has no room filter, or intersects subscriber rooms
|
|
1215
|
+
if (!handlerRooms || handlerRooms.length === 0 ||
|
|
1216
|
+
!rooms || rooms.some(r => handlerRooms.includes(r))) {
|
|
1217
|
+
fn(this.#eventData.get(last_sent_event));
|
|
1218
|
+
}
|
|
1219
|
+
});
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
emit(event, data, rooms) {
|
|
1224
|
+
this.#eventData.set(event, data);
|
|
1225
|
+
if(typeof rooms === 'string') rooms = [rooms];
|
|
1226
|
+
|
|
1227
|
+
this.#channel.postMessage({
|
|
1228
|
+
eventData: Array.from(this.#eventData.entries()),
|
|
1229
|
+
last_sent_event: event,
|
|
1230
|
+
userId: this.#uuid,
|
|
1231
|
+
rooms: rooms && rooms.length ? rooms : undefined
|
|
1232
|
+
});
|
|
1233
|
+
|
|
1195
1234
|
return this;
|
|
1196
1235
|
}
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
this.#
|
|
1236
|
+
|
|
1237
|
+
on(event, handler = console.log, rooms) {
|
|
1238
|
+
if (!this.#handlers.has(event)) this.#handlers.set(event, []);
|
|
1239
|
+
if(typeof rooms === 'string') rooms = [rooms];
|
|
1240
|
+
this.#handlers.get(event).push({ fn: handler, rooms });
|
|
1200
1241
|
return this;
|
|
1201
1242
|
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
this.#
|
|
1243
|
+
|
|
1244
|
+
off(event, handler) {
|
|
1245
|
+
if (!this.#handlers.has(event)) return this;
|
|
1246
|
+
this.#handlers.set(
|
|
1247
|
+
event,
|
|
1248
|
+
this.#handlers.get(event).filter(h => h.fn !== handler)
|
|
1249
|
+
);
|
|
1205
1250
|
return this;
|
|
1206
1251
|
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
this.
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
this
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1252
|
+
|
|
1253
|
+
once(event, handler, rooms) {
|
|
1254
|
+
const wrapper = (data) => {
|
|
1255
|
+
handler(data);
|
|
1256
|
+
this.off(event, wrapper);
|
|
1257
|
+
};
|
|
1258
|
+
this.on(event, wrapper, rooms);
|
|
1259
|
+
return this;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
join(...rooms) {
|
|
1263
|
+
rooms.forEach(r => this.#currentRooms.add(r));
|
|
1264
|
+
return this;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
leave(...rooms) {
|
|
1268
|
+
if (!rooms.length) this.#currentRooms.clear();
|
|
1269
|
+
else rooms.forEach(r => this.#currentRooms.delete(r));
|
|
1224
1270
|
return this;
|
|
1225
1271
|
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1272
|
+
|
|
1273
|
+
close() {
|
|
1274
|
+
this.#channel.close();
|
|
1228
1275
|
return this;
|
|
1229
1276
|
}
|
|
1277
|
+
|
|
1230
1278
|
}
|
|
1231
|
-
|
|
1279
|
+
|
|
1280
|
+
const useChannel = (name) => new UseChannel(name);
|
|
1232
1281
|
|
|
1233
1282
|
// To do : remove old items
|
|
1234
|
-
class
|
|
1283
|
+
class UseStorage{
|
|
1235
1284
|
constructor(storage, globalKey, initialValue){
|
|
1236
1285
|
this.cache={
|
|
1237
1286
|
storage,
|
|
@@ -1296,8 +1345,8 @@ class ZikoUseStorage{
|
|
|
1296
1345
|
}
|
|
1297
1346
|
|
|
1298
1347
|
}
|
|
1299
|
-
const useLocaleStorage=(key,initialValue)=>new
|
|
1300
|
-
const useSessionStorage=(key,initialValue)=>new
|
|
1348
|
+
const useLocaleStorage=(key,initialValue)=>new UseStorage(localStorage,key,initialValue);
|
|
1349
|
+
const useSessionStorage=(key,initialValue)=>new UseStorage(sessionStorage,key,initialValue);
|
|
1301
1350
|
|
|
1302
1351
|
const __State__ = {
|
|
1303
1352
|
store : new Map(),
|
|
@@ -3227,9 +3276,8 @@ function trimKeys(obj) {
|
|
|
3227
3276
|
}, Array.isArray(obj) ? [] : {});
|
|
3228
3277
|
}
|
|
3229
3278
|
|
|
3230
|
-
class Matrix
|
|
3279
|
+
class Matrix{
|
|
3231
3280
|
constructor(rows, cols, element = [] ) {
|
|
3232
|
-
super();
|
|
3233
3281
|
if(rows instanceof Matrix){
|
|
3234
3282
|
this.arr=rows.arr;
|
|
3235
3283
|
this.rows=rows.rows;
|
|
@@ -3894,9 +3942,8 @@ const matrix2=(...element)=>new Matrix(2, 2, element);
|
|
|
3894
3942
|
const matrix3=(...element)=>new Matrix(3, 3, element);
|
|
3895
3943
|
const matrix4=(...element)=>new Matrix(4, 4, element);
|
|
3896
3944
|
|
|
3897
|
-
class Complex
|
|
3945
|
+
class Complex{
|
|
3898
3946
|
constructor(a = 0, b = 0) {
|
|
3899
|
-
super();
|
|
3900
3947
|
if(a instanceof Complex){
|
|
3901
3948
|
this.a=a.a;
|
|
3902
3949
|
this.b=a.b;
|
|
@@ -4072,12 +4119,6 @@ const complex=(a,b)=>{
|
|
|
4072
4119
|
return new Complex(a,b)
|
|
4073
4120
|
};
|
|
4074
4121
|
|
|
4075
|
-
// import {
|
|
4076
|
-
// gamma,
|
|
4077
|
-
// bessel,
|
|
4078
|
-
// beta
|
|
4079
|
-
// } from "../calculus/index.js";
|
|
4080
|
-
|
|
4081
4122
|
const abs=(...x)=>mapfun$1(Math.abs,...x);
|
|
4082
4123
|
const sqrt$2=(...x)=>mapfun$1(Math.sqrt,...x);
|
|
4083
4124
|
const pow$1=(x,n)=>{
|
|
@@ -4756,7 +4797,7 @@ const timeTaken = callback => {
|
|
|
4756
4797
|
return r;
|
|
4757
4798
|
};
|
|
4758
4799
|
|
|
4759
|
-
class
|
|
4800
|
+
class UseEventEmitter {
|
|
4760
4801
|
constructor() {
|
|
4761
4802
|
this.events = {};
|
|
4762
4803
|
this.maxListeners = 10;
|
|
@@ -4818,7 +4859,7 @@ class ZikoUseEventEmitter {
|
|
|
4818
4859
|
}
|
|
4819
4860
|
}
|
|
4820
4861
|
|
|
4821
|
-
const useEventEmitter=()=>new
|
|
4862
|
+
const useEventEmitter=()=>new UseEventEmitter();
|
|
4822
4863
|
|
|
4823
4864
|
class ZikoUseFavIcon{
|
|
4824
4865
|
constructor(FavIcon,useEventEmitter=true){
|
|
@@ -5201,7 +5242,6 @@ function useDerived(deriveFn, sources) {
|
|
|
5201
5242
|
const useReactive = (nested_value) => mapfun$1(
|
|
5202
5243
|
n => {
|
|
5203
5244
|
const state = useState(n);
|
|
5204
|
-
// console.log(state)
|
|
5205
5245
|
return {
|
|
5206
5246
|
get : state[0],
|
|
5207
5247
|
set : state[1],
|
|
@@ -5210,7 +5250,7 @@ const useReactive = (nested_value) => mapfun$1(
|
|
|
5210
5250
|
nested_value
|
|
5211
5251
|
);
|
|
5212
5252
|
|
|
5213
|
-
class
|
|
5253
|
+
class UseThreed {
|
|
5214
5254
|
#workerContent;
|
|
5215
5255
|
constructor() {
|
|
5216
5256
|
this.#workerContent = (
|
|
@@ -5246,14 +5286,14 @@ class ZikoUseThreed {
|
|
|
5246
5286
|
}
|
|
5247
5287
|
|
|
5248
5288
|
const useThread = (func, callback , close) => {
|
|
5249
|
-
const T = new
|
|
5289
|
+
const T = new UseThreed();
|
|
5250
5290
|
if (func) {
|
|
5251
5291
|
T.call(func, callback , close);
|
|
5252
5292
|
}
|
|
5253
5293
|
return T;
|
|
5254
5294
|
};
|
|
5255
5295
|
|
|
5256
|
-
class
|
|
5296
|
+
class UseRoot {
|
|
5257
5297
|
constructor(PropsMap, {namespace = 'Ziko', register, ValidateCssProps = false} = {}){
|
|
5258
5298
|
this.currentPropsMap = PropsMap;
|
|
5259
5299
|
this.namespace = namespace;
|
|
@@ -5298,7 +5338,7 @@ function ValidateCssProps(PropsMap){
|
|
|
5298
5338
|
}
|
|
5299
5339
|
}
|
|
5300
5340
|
|
|
5301
|
-
const useRoot = (PropsMap, {namespace, register, ValidateCssProps} = {}) => new
|
|
5341
|
+
const useRoot = (PropsMap, {namespace, register, ValidateCssProps} = {}) => new UseRoot(PropsMap, {namespace, register, ValidateCssProps});
|
|
5302
5342
|
|
|
5303
5343
|
// Usage
|
|
5304
5344
|
|
|
@@ -5419,6 +5459,7 @@ exports.UINode = UINode;
|
|
|
5419
5459
|
exports.UISVGWrapper = UISVGWrapper;
|
|
5420
5460
|
exports.UISwitch = UISwitch;
|
|
5421
5461
|
exports.UIView = UIView;
|
|
5462
|
+
exports.UseRoot = UseRoot;
|
|
5422
5463
|
exports.Utils = Utils;
|
|
5423
5464
|
exports.View = View;
|
|
5424
5465
|
exports.ZikoApp = ZikoApp;
|
|
@@ -5437,7 +5478,6 @@ exports.ZikoSPA = ZikoSPA;
|
|
|
5437
5478
|
exports.ZikoUIFlex = ZikoUIFlex;
|
|
5438
5479
|
exports.ZikoUISuspense = ZikoUISuspense;
|
|
5439
5480
|
exports.ZikoUIText = ZikoUIText;
|
|
5440
|
-
exports.ZikoUseRoot = ZikoUseRoot;
|
|
5441
5481
|
exports.__ZikoEvent__ = __ZikoEvent__;
|
|
5442
5482
|
exports.abs = abs;
|
|
5443
5483
|
exports.accum = accum;
|
package/dist/ziko.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/*
|
|
3
3
|
Project: ziko.js
|
|
4
4
|
Author: Zakaria Elalaoui
|
|
5
|
-
Date :
|
|
5
|
+
Date : Wed Nov 26 2025 12:01:55 GMT+0100 (UTC+01:00)
|
|
6
6
|
Git-Repo : https://github.com/zakarialaoui10/ziko.js
|
|
7
7
|
Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
|
|
8
8
|
Released under MIT License
|
|
@@ -48,8 +48,6 @@
|
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
class ZikoMath {}
|
|
52
|
-
|
|
53
51
|
// To generalise
|
|
54
52
|
|
|
55
53
|
const mapfun$1=(fun,...X)=>{
|
|
@@ -1185,57 +1183,108 @@
|
|
|
1185
1183
|
}
|
|
1186
1184
|
};
|
|
1187
1185
|
|
|
1188
|
-
class
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1186
|
+
class UseChannel {
|
|
1187
|
+
// private fields
|
|
1188
|
+
#channel;
|
|
1189
|
+
#eventData;
|
|
1190
|
+
#handlers;
|
|
1191
|
+
#uuid;
|
|
1192
|
+
#subscribers;
|
|
1193
|
+
#currentRooms; // now a Set for multiple rooms
|
|
1194
|
+
|
|
1195
|
+
constructor(name = "") {
|
|
1196
|
+
this.#channel = new BroadcastChannel(name);
|
|
1197
|
+
this.#eventData = new Map();
|
|
1198
|
+
this.#handlers = new Map(); // Map<event, Array<{fn, rooms}>>
|
|
1199
|
+
this.#uuid = "ziko-channel:" + Random.string(10);
|
|
1200
|
+
this.#subscribers = new Set([this.#uuid]);
|
|
1201
|
+
this.#currentRooms = new Set(); // multiple rooms
|
|
1202
|
+
|
|
1203
|
+
this.#channel.addEventListener("message", (e) => {
|
|
1204
|
+
const { last_sent_event, userId, eventData, rooms } = e.data;
|
|
1205
|
+
|
|
1206
|
+
if (userId === this.#uuid) return; // ignore own messages
|
|
1207
|
+
|
|
1208
|
+
// broadcast if no rooms, else check intersection
|
|
1209
|
+
if (rooms && rooms.length && !rooms.some(r => this.#currentRooms.has(r))) return;
|
|
1210
|
+
|
|
1211
|
+
this.#subscribers.add(userId);
|
|
1212
|
+
this.#eventData = new Map(eventData);
|
|
1213
|
+
|
|
1214
|
+
const handlersList = this.#handlers.get(last_sent_event);
|
|
1215
|
+
if (!handlersList) return;
|
|
1216
|
+
|
|
1217
|
+
handlersList.forEach(({ fn, rooms: handlerRooms }) => {
|
|
1218
|
+
// trigger if listener has no room filter, or intersects subscriber rooms
|
|
1219
|
+
if (!handlerRooms || handlerRooms.length === 0 ||
|
|
1220
|
+
!rooms || rooms.some(r => handlerRooms.includes(r))) {
|
|
1221
|
+
fn(this.#eventData.get(last_sent_event));
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1224
|
+
});
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
emit(event, data, rooms) {
|
|
1228
|
+
this.#eventData.set(event, data);
|
|
1229
|
+
if(typeof rooms === 'string') rooms = [rooms];
|
|
1230
|
+
|
|
1231
|
+
this.#channel.postMessage({
|
|
1232
|
+
eventData: Array.from(this.#eventData.entries()),
|
|
1233
|
+
last_sent_event: event,
|
|
1234
|
+
userId: this.#uuid,
|
|
1235
|
+
rooms: rooms && rooms.length ? rooms : undefined
|
|
1236
|
+
});
|
|
1237
|
+
|
|
1199
1238
|
return this;
|
|
1200
1239
|
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
this.#
|
|
1240
|
+
|
|
1241
|
+
on(event, handler = console.log, rooms) {
|
|
1242
|
+
if (!this.#handlers.has(event)) this.#handlers.set(event, []);
|
|
1243
|
+
if(typeof rooms === 'string') rooms = [rooms];
|
|
1244
|
+
this.#handlers.get(event).push({ fn: handler, rooms });
|
|
1204
1245
|
return this;
|
|
1205
1246
|
}
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
this.#
|
|
1247
|
+
|
|
1248
|
+
off(event, handler) {
|
|
1249
|
+
if (!this.#handlers.has(event)) return this;
|
|
1250
|
+
this.#handlers.set(
|
|
1251
|
+
event,
|
|
1252
|
+
this.#handlers.get(event).filter(h => h.fn !== handler)
|
|
1253
|
+
);
|
|
1209
1254
|
return this;
|
|
1210
1255
|
}
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
this.
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
this
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1256
|
+
|
|
1257
|
+
once(event, handler, rooms) {
|
|
1258
|
+
const wrapper = (data) => {
|
|
1259
|
+
handler(data);
|
|
1260
|
+
this.off(event, wrapper);
|
|
1261
|
+
};
|
|
1262
|
+
this.on(event, wrapper, rooms);
|
|
1263
|
+
return this;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
join(...rooms) {
|
|
1267
|
+
rooms.forEach(r => this.#currentRooms.add(r));
|
|
1268
|
+
return this;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
leave(...rooms) {
|
|
1272
|
+
if (!rooms.length) this.#currentRooms.clear();
|
|
1273
|
+
else rooms.forEach(r => this.#currentRooms.delete(r));
|
|
1228
1274
|
return this;
|
|
1229
1275
|
}
|
|
1230
|
-
|
|
1231
|
-
|
|
1276
|
+
|
|
1277
|
+
close() {
|
|
1278
|
+
this.#channel.close();
|
|
1232
1279
|
return this;
|
|
1233
1280
|
}
|
|
1281
|
+
|
|
1234
1282
|
}
|
|
1235
|
-
|
|
1283
|
+
|
|
1284
|
+
const useChannel = (name) => new UseChannel(name);
|
|
1236
1285
|
|
|
1237
1286
|
// To do : remove old items
|
|
1238
|
-
class
|
|
1287
|
+
class UseStorage{
|
|
1239
1288
|
constructor(storage, globalKey, initialValue){
|
|
1240
1289
|
this.cache={
|
|
1241
1290
|
storage,
|
|
@@ -1300,8 +1349,8 @@
|
|
|
1300
1349
|
}
|
|
1301
1350
|
|
|
1302
1351
|
}
|
|
1303
|
-
const useLocaleStorage=(key,initialValue)=>new
|
|
1304
|
-
const useSessionStorage=(key,initialValue)=>new
|
|
1352
|
+
const useLocaleStorage=(key,initialValue)=>new UseStorage(localStorage,key,initialValue);
|
|
1353
|
+
const useSessionStorage=(key,initialValue)=>new UseStorage(sessionStorage,key,initialValue);
|
|
1305
1354
|
|
|
1306
1355
|
const __State__ = {
|
|
1307
1356
|
store : new Map(),
|
|
@@ -3231,9 +3280,8 @@
|
|
|
3231
3280
|
}, Array.isArray(obj) ? [] : {});
|
|
3232
3281
|
}
|
|
3233
3282
|
|
|
3234
|
-
class Matrix
|
|
3283
|
+
class Matrix{
|
|
3235
3284
|
constructor(rows, cols, element = [] ) {
|
|
3236
|
-
super();
|
|
3237
3285
|
if(rows instanceof Matrix){
|
|
3238
3286
|
this.arr=rows.arr;
|
|
3239
3287
|
this.rows=rows.rows;
|
|
@@ -3898,9 +3946,8 @@
|
|
|
3898
3946
|
const matrix3=(...element)=>new Matrix(3, 3, element);
|
|
3899
3947
|
const matrix4=(...element)=>new Matrix(4, 4, element);
|
|
3900
3948
|
|
|
3901
|
-
class Complex
|
|
3949
|
+
class Complex{
|
|
3902
3950
|
constructor(a = 0, b = 0) {
|
|
3903
|
-
super();
|
|
3904
3951
|
if(a instanceof Complex){
|
|
3905
3952
|
this.a=a.a;
|
|
3906
3953
|
this.b=a.b;
|
|
@@ -4076,12 +4123,6 @@
|
|
|
4076
4123
|
return new Complex(a,b)
|
|
4077
4124
|
};
|
|
4078
4125
|
|
|
4079
|
-
// import {
|
|
4080
|
-
// gamma,
|
|
4081
|
-
// bessel,
|
|
4082
|
-
// beta
|
|
4083
|
-
// } from "../calculus/index.js";
|
|
4084
|
-
|
|
4085
4126
|
const abs=(...x)=>mapfun$1(Math.abs,...x);
|
|
4086
4127
|
const sqrt$2=(...x)=>mapfun$1(Math.sqrt,...x);
|
|
4087
4128
|
const pow$1=(x,n)=>{
|
|
@@ -4760,7 +4801,7 @@
|
|
|
4760
4801
|
return r;
|
|
4761
4802
|
};
|
|
4762
4803
|
|
|
4763
|
-
class
|
|
4804
|
+
class UseEventEmitter {
|
|
4764
4805
|
constructor() {
|
|
4765
4806
|
this.events = {};
|
|
4766
4807
|
this.maxListeners = 10;
|
|
@@ -4822,7 +4863,7 @@
|
|
|
4822
4863
|
}
|
|
4823
4864
|
}
|
|
4824
4865
|
|
|
4825
|
-
const useEventEmitter=()=>new
|
|
4866
|
+
const useEventEmitter=()=>new UseEventEmitter();
|
|
4826
4867
|
|
|
4827
4868
|
class ZikoUseFavIcon{
|
|
4828
4869
|
constructor(FavIcon,useEventEmitter=true){
|
|
@@ -5205,7 +5246,6 @@
|
|
|
5205
5246
|
const useReactive = (nested_value) => mapfun$1(
|
|
5206
5247
|
n => {
|
|
5207
5248
|
const state = useState(n);
|
|
5208
|
-
// console.log(state)
|
|
5209
5249
|
return {
|
|
5210
5250
|
get : state[0],
|
|
5211
5251
|
set : state[1],
|
|
@@ -5214,7 +5254,7 @@
|
|
|
5214
5254
|
nested_value
|
|
5215
5255
|
);
|
|
5216
5256
|
|
|
5217
|
-
class
|
|
5257
|
+
class UseThreed {
|
|
5218
5258
|
#workerContent;
|
|
5219
5259
|
constructor() {
|
|
5220
5260
|
this.#workerContent = (
|
|
@@ -5250,14 +5290,14 @@
|
|
|
5250
5290
|
}
|
|
5251
5291
|
|
|
5252
5292
|
const useThread = (func, callback , close) => {
|
|
5253
|
-
const T = new
|
|
5293
|
+
const T = new UseThreed();
|
|
5254
5294
|
if (func) {
|
|
5255
5295
|
T.call(func, callback , close);
|
|
5256
5296
|
}
|
|
5257
5297
|
return T;
|
|
5258
5298
|
};
|
|
5259
5299
|
|
|
5260
|
-
class
|
|
5300
|
+
class UseRoot {
|
|
5261
5301
|
constructor(PropsMap, {namespace = 'Ziko', register, ValidateCssProps = false} = {}){
|
|
5262
5302
|
this.currentPropsMap = PropsMap;
|
|
5263
5303
|
this.namespace = namespace;
|
|
@@ -5302,7 +5342,7 @@
|
|
|
5302
5342
|
}
|
|
5303
5343
|
}
|
|
5304
5344
|
|
|
5305
|
-
const useRoot = (PropsMap, {namespace, register, ValidateCssProps} = {}) => new
|
|
5345
|
+
const useRoot = (PropsMap, {namespace, register, ValidateCssProps} = {}) => new UseRoot(PropsMap, {namespace, register, ValidateCssProps});
|
|
5306
5346
|
|
|
5307
5347
|
// Usage
|
|
5308
5348
|
|
|
@@ -5423,6 +5463,7 @@
|
|
|
5423
5463
|
exports.UISVGWrapper = UISVGWrapper;
|
|
5424
5464
|
exports.UISwitch = UISwitch;
|
|
5425
5465
|
exports.UIView = UIView;
|
|
5466
|
+
exports.UseRoot = UseRoot;
|
|
5426
5467
|
exports.Utils = Utils;
|
|
5427
5468
|
exports.View = View;
|
|
5428
5469
|
exports.ZikoApp = ZikoApp;
|
|
@@ -5441,7 +5482,6 @@
|
|
|
5441
5482
|
exports.ZikoUIFlex = ZikoUIFlex;
|
|
5442
5483
|
exports.ZikoUISuspense = ZikoUISuspense;
|
|
5443
5484
|
exports.ZikoUIText = ZikoUIText;
|
|
5444
|
-
exports.ZikoUseRoot = ZikoUseRoot;
|
|
5445
5485
|
exports.__ZikoEvent__ = __ZikoEvent__;
|
|
5446
5486
|
exports.abs = abs;
|
|
5447
5487
|
exports.accum = accum;
|