sibujs 4.2.0 → 4.4.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/README.md +23 -4
- package/dist/browser.cjs +1 -1
- package/dist/browser.js +4 -4
- package/dist/build.cjs +30 -8
- package/dist/build.js +10 -10
- package/dist/cdn.dev.global.js +10 -10
- package/dist/cdn.full.dev.global.js +400 -0
- package/dist/cdn.full.global.js +398 -0
- package/dist/cdn.global.js +10 -10
- package/dist/{chunk-P3DHXBR6.js → chunk-36S2YPP4.js} +1 -1
- package/dist/{chunk-7ALC7KGE.js → chunk-3BTTCZ5J.js} +1 -1
- package/dist/{chunk-QL4UREZO.js → chunk-4Z3SPQ67.js} +3 -3
- package/dist/{chunk-XZ2N525U.js → chunk-6GSIXTWX.js} +4 -4
- package/dist/{chunk-7VEC3UD2.js → chunk-7GIHSAWB.js} +1 -1
- package/dist/{chunk-FOWBJZDL.js → chunk-7NBDXVHS.js} +1 -1
- package/dist/{chunk-HZEBO22J.js → chunk-ADM46X22.js} +38 -16
- package/dist/{chunk-QCFLDD7C.js → chunk-HFCOH2GN.js} +4 -4
- package/dist/{chunk-NEYWS4EX.js → chunk-HQSEH5F6.js} +3 -3
- package/dist/{chunk-OUWAIXIK.js → chunk-LQFGQNMV.js} +3 -3
- package/dist/{chunk-KE4KWRDY.js → chunk-LYVUX7NT.js} +2 -2
- package/dist/{chunk-BNKV4REK.js → chunk-M2F7TZHH.js} +2 -2
- package/dist/{chunk-HECVW343.js → chunk-NVNJH22U.js} +1 -1
- package/dist/{chunk-6ZGI3RBE.js → chunk-PNIRUQ4C.js} +2 -2
- package/dist/{chunk-VJE6DDYM.js → chunk-R25EFXXC.js} +40 -26
- package/dist/{chunk-BMYYZWHX.js → chunk-RR7M3FHM.js} +1 -1
- package/dist/{chunk-3VTSPNC5.js → chunk-SKPTERHP.js} +1 -1
- package/dist/{chunk-GDUNQCCW.js → chunk-UCALUKB5.js} +4 -4
- package/dist/{chunk-HJEPKZ2O.js → chunk-VCTAEPSB.js} +1 -1
- package/dist/{chunk-2LOYNGBY.js → chunk-W2EQ7X2L.js} +1 -1
- package/dist/{chunk-SF3TB4K6.js → chunk-XLO7SLIX.js} +5 -5
- package/dist/{contracts-Hg6ITAEF.d.cts → contracts-DBdg9J_a.d.cts} +25 -4
- package/dist/{contracts-Hg6ITAEF.d.ts → contracts-DBdg9J_a.d.ts} +25 -4
- package/dist/data.cjs +1 -1
- package/dist/data.js +6 -6
- package/dist/devtools.cjs +1 -1
- package/dist/devtools.js +4 -4
- package/dist/ecosystem.cjs +1 -1
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +36 -27
- package/dist/extras.d.cts +1 -1
- package/dist/extras.d.ts +1 -1
- package/dist/extras.js +20 -20
- package/dist/index.cjs +30 -8
- package/dist/index.d.cts +36 -4
- package/dist/index.d.ts +36 -4
- package/dist/index.js +10 -10
- package/dist/motion.cjs +1 -1
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +36 -27
- package/dist/patterns.d.cts +1 -1
- package/dist/patterns.d.ts +1 -1
- package/dist/patterns.js +6 -6
- package/dist/performance.cjs +1 -1
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +4 -3
- package/dist/plugins.d.cts +10 -2
- package/dist/plugins.d.ts +10 -2
- package/dist/plugins.js +9 -8
- package/dist/ssr.cjs +1 -1
- package/dist/ssr.js +7 -7
- package/dist/testing.cjs +1 -1
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +36 -27
- package/dist/ui.d.cts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +7 -7
- package/dist/widgets.cjs +1 -1
- package/dist/widgets.js +6 -6
- package/package.json +7 -1
|
@@ -135,42 +135,42 @@ import {
|
|
|
135
135
|
use,
|
|
136
136
|
var_,
|
|
137
137
|
video
|
|
138
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-36S2YPP4.js";
|
|
139
139
|
import {
|
|
140
140
|
trustHTML
|
|
141
141
|
} from "./chunk-NIOYEGBQ.js";
|
|
142
142
|
import {
|
|
143
143
|
watch
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-RR7M3FHM.js";
|
|
145
145
|
import {
|
|
146
146
|
__resetIdCounter,
|
|
147
147
|
createId
|
|
148
148
|
} from "./chunk-CCSJMTRN.js";
|
|
149
149
|
import {
|
|
150
150
|
context
|
|
151
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-7NBDXVHS.js";
|
|
152
152
|
import {
|
|
153
153
|
SVG_NS,
|
|
154
154
|
bindChildNode,
|
|
155
155
|
captureFocusWithin,
|
|
156
156
|
restoreFocusWithin,
|
|
157
157
|
tagFactory
|
|
158
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-PNIRUQ4C.js";
|
|
159
159
|
import {
|
|
160
160
|
bindAttribute,
|
|
161
161
|
bindDynamic,
|
|
162
162
|
setSafeAttribute
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-VCTAEPSB.js";
|
|
164
164
|
import {
|
|
165
165
|
derived
|
|
166
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-W2EQ7X2L.js";
|
|
167
167
|
import {
|
|
168
168
|
globalSingleton
|
|
169
169
|
} from "./chunk-7ZHH77QA.js";
|
|
170
170
|
import {
|
|
171
171
|
effect,
|
|
172
172
|
on
|
|
173
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-7GIHSAWB.js";
|
|
174
174
|
import {
|
|
175
175
|
disableSSR,
|
|
176
176
|
enableSSR,
|
|
@@ -195,7 +195,7 @@ import {
|
|
|
195
195
|
external,
|
|
196
196
|
isBatching,
|
|
197
197
|
signal
|
|
198
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-NVNJH22U.js";
|
|
199
199
|
import {
|
|
200
200
|
notifySubscribers,
|
|
201
201
|
reactiveBinding,
|
|
@@ -206,7 +206,7 @@ import {
|
|
|
206
206
|
suspendTracking,
|
|
207
207
|
track,
|
|
208
208
|
untracked
|
|
209
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-3BTTCZ5J.js";
|
|
210
210
|
import {
|
|
211
211
|
DEV,
|
|
212
212
|
__export,
|
|
@@ -3298,7 +3298,16 @@ function enhance(target, setup) {
|
|
|
3298
3298
|
const teardowns = [];
|
|
3299
3299
|
const owner = /* @__PURE__ */ Symbol("sibujs.enhance");
|
|
3300
3300
|
let disposed = false;
|
|
3301
|
-
|
|
3301
|
+
let closed = false;
|
|
3302
|
+
const isClosed = (method) => {
|
|
3303
|
+
if (!closed) return false;
|
|
3304
|
+
devWarnLazy(
|
|
3305
|
+
() => `enhance: ctx.${method}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`
|
|
3306
|
+
);
|
|
3307
|
+
return true;
|
|
3308
|
+
};
|
|
3309
|
+
const bind = (method, target_, fn) => {
|
|
3310
|
+
if (isClosed(method)) return;
|
|
3302
3311
|
const el = resolveTarget(root, target_);
|
|
3303
3312
|
if (!el) {
|
|
3304
3313
|
if (typeof console !== "undefined") {
|
|
@@ -3320,14 +3329,14 @@ function enhance(target, setup) {
|
|
|
3320
3329
|
}
|
|
3321
3330
|
},
|
|
3322
3331
|
on: (t, event, handler, options) => {
|
|
3323
|
-
bind(t, (el) => {
|
|
3332
|
+
bind("on", t, (el) => {
|
|
3324
3333
|
const wrapped = (e) => handler(e, el);
|
|
3325
3334
|
el.addEventListener(event, wrapped, options);
|
|
3326
3335
|
teardowns.push(() => el.removeEventListener(event, wrapped, options));
|
|
3327
3336
|
});
|
|
3328
3337
|
},
|
|
3329
3338
|
text: (t, value) => {
|
|
3330
|
-
bind(t, (el) => {
|
|
3339
|
+
bind("text", t, (el) => {
|
|
3331
3340
|
teardowns.push(
|
|
3332
3341
|
bindNode(el, () => {
|
|
3333
3342
|
const v = value();
|
|
@@ -3338,7 +3347,7 @@ function enhance(target, setup) {
|
|
|
3338
3347
|
});
|
|
3339
3348
|
},
|
|
3340
3349
|
attr: (t, name, value) => {
|
|
3341
|
-
bind(t, (el) => {
|
|
3350
|
+
bind("attr", t, (el) => {
|
|
3342
3351
|
teardowns.push(
|
|
3343
3352
|
bindNode(el, () => {
|
|
3344
3353
|
const v = value();
|
|
@@ -3349,7 +3358,7 @@ function enhance(target, setup) {
|
|
|
3349
3358
|
});
|
|
3350
3359
|
},
|
|
3351
3360
|
classed: (t, name, on2) => {
|
|
3352
|
-
bind(t, (el) => {
|
|
3361
|
+
bind("classed", t, (el) => {
|
|
3353
3362
|
teardowns.push(
|
|
3354
3363
|
bindNode(el, () => {
|
|
3355
3364
|
el.classList.toggle(name, Boolean(on2()));
|
|
@@ -3358,7 +3367,7 @@ function enhance(target, setup) {
|
|
|
3358
3367
|
});
|
|
3359
3368
|
},
|
|
3360
3369
|
show: (t, when2) => {
|
|
3361
|
-
bind(t, (el) => {
|
|
3370
|
+
bind("show", t, (el) => {
|
|
3362
3371
|
const prevHidden = el.hidden;
|
|
3363
3372
|
teardowns.push(
|
|
3364
3373
|
bindNode(el, () => {
|
|
@@ -3371,7 +3380,7 @@ function enhance(target, setup) {
|
|
|
3371
3380
|
});
|
|
3372
3381
|
},
|
|
3373
3382
|
model: (t, state, options) => {
|
|
3374
|
-
bind(t, (el) => {
|
|
3383
|
+
bind("model", t, (el) => {
|
|
3375
3384
|
const control = el;
|
|
3376
3385
|
const [get, set] = state;
|
|
3377
3386
|
const evt = options?.event ?? (control instanceof HTMLSelectElement || control instanceof HTMLInputElement && (control.type === "checkbox" || control.type === "radio") ? "change" : "input");
|
|
@@ -3386,6 +3395,7 @@ function enhance(target, setup) {
|
|
|
3386
3395
|
});
|
|
3387
3396
|
},
|
|
3388
3397
|
each: (target_, describe) => {
|
|
3398
|
+
if (isClosed("each")) return;
|
|
3389
3399
|
devAssert(typeof describe === "function", "ctx.each: second argument must be a function.");
|
|
3390
3400
|
const elements = typeof target_ === "string" ? ctx.refs(target_) : Array.from(target_);
|
|
3391
3401
|
for (let i2 = 0; i2 < elements.length; i2++) {
|
|
@@ -3396,14 +3406,25 @@ function enhance(target, setup) {
|
|
|
3396
3406
|
}
|
|
3397
3407
|
},
|
|
3398
3408
|
cleanup: (fn) => {
|
|
3409
|
+
if (isClosed("cleanup")) return;
|
|
3399
3410
|
teardowns.push(fn);
|
|
3400
3411
|
}
|
|
3401
3412
|
};
|
|
3402
3413
|
let extra;
|
|
3403
3414
|
try {
|
|
3404
3415
|
extra = setup(ctx);
|
|
3416
|
+
const returned = extra;
|
|
3417
|
+
if (returned && typeof returned.then === "function") {
|
|
3418
|
+
returned.then(void 0, (reason) => {
|
|
3419
|
+
devWarnLazy(() => `enhance: the promise returned by the setup also rejected: ${String(reason)}`);
|
|
3420
|
+
});
|
|
3421
|
+
throw new Error(
|
|
3422
|
+
(typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : DEV) ? "[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored." : "[SibuJS enhance] setup returned a promise"
|
|
3423
|
+
);
|
|
3424
|
+
}
|
|
3405
3425
|
} catch (err) {
|
|
3406
3426
|
drainTeardowns(teardowns, "enhance");
|
|
3427
|
+
closed = true;
|
|
3407
3428
|
throw err;
|
|
3408
3429
|
}
|
|
3409
3430
|
if (typeof extra === "function") teardowns.push(extra);
|
|
@@ -3416,6 +3437,7 @@ function enhance(target, setup) {
|
|
|
3416
3437
|
}
|
|
3417
3438
|
unregisterDisposer(root, dispose2);
|
|
3418
3439
|
drainTeardowns(teardowns, "enhance");
|
|
3440
|
+
closed = true;
|
|
3419
3441
|
};
|
|
3420
3442
|
registerDisposer(root, dispose2);
|
|
3421
3443
|
enhancementOwner.set(root, owner);
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
watch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RR7M3FHM.js";
|
|
4
4
|
import {
|
|
5
5
|
createId
|
|
6
6
|
} from "./chunk-CCSJMTRN.js";
|
|
7
7
|
import {
|
|
8
8
|
derived
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-W2EQ7X2L.js";
|
|
10
10
|
import {
|
|
11
11
|
stripHtml
|
|
12
12
|
} from "./chunk-IXKSNWV5.js";
|
|
13
13
|
import {
|
|
14
14
|
effect
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7GIHSAWB.js";
|
|
16
16
|
import {
|
|
17
17
|
batch,
|
|
18
18
|
signal
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NVNJH22U.js";
|
|
20
20
|
|
|
21
21
|
// src/widgets/Combobox.ts
|
|
22
22
|
var boundComboboxes = /* @__PURE__ */ new WeakMap();
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
div,
|
|
8
8
|
span
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-36S2YPP4.js";
|
|
10
10
|
import {
|
|
11
11
|
STATIC_VALUE_RESOLVER,
|
|
12
12
|
planHeadElementEntry,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-7ZHH77QA.js";
|
|
21
21
|
import {
|
|
22
22
|
effect
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-7GIHSAWB.js";
|
|
24
24
|
import {
|
|
25
25
|
registerDisposer,
|
|
26
26
|
replaceChildrenSafely
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import {
|
|
29
29
|
batch,
|
|
30
30
|
signal
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-NVNJH22U.js";
|
|
32
32
|
|
|
33
33
|
// src/platform/head.ts
|
|
34
34
|
function escapeScriptJsonLocal(json) {
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-H3SRKIYX.js";
|
|
5
5
|
import {
|
|
6
6
|
derived
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-W2EQ7X2L.js";
|
|
8
8
|
import {
|
|
9
9
|
effect
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7GIHSAWB.js";
|
|
11
11
|
import {
|
|
12
12
|
batch,
|
|
13
13
|
signal
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NVNJH22U.js";
|
|
15
15
|
|
|
16
16
|
// src/patterns/machine.ts
|
|
17
17
|
function machine(config) {
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
} from "./chunk-52XFPGSN.js";
|
|
7
7
|
import {
|
|
8
8
|
effect
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7GIHSAWB.js";
|
|
10
10
|
import {
|
|
11
11
|
batch,
|
|
12
12
|
signal
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NVNJH22U.js";
|
|
14
14
|
import {
|
|
15
15
|
reportError
|
|
16
16
|
} from "./chunk-2WLZ6757.js";
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
} from "./chunk-7ZHH77QA.js";
|
|
7
7
|
import {
|
|
8
8
|
effect
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7GIHSAWB.js";
|
|
10
10
|
import {
|
|
11
11
|
dispose,
|
|
12
12
|
replaceChildrenSafely
|
|
13
13
|
} from "./chunk-QKRPLZ2V.js";
|
|
14
14
|
import {
|
|
15
15
|
signal
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NVNJH22U.js";
|
|
17
17
|
import {
|
|
18
18
|
DEV,
|
|
19
19
|
devWarn,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bindAttribute,
|
|
3
3
|
setSafeAttribute
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VCTAEPSB.js";
|
|
5
5
|
import {
|
|
6
6
|
isEventHandlerAttr,
|
|
7
7
|
sanitizeCSSValue,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-QKRPLZ2V.js";
|
|
14
14
|
import {
|
|
15
15
|
reactiveBinding
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-3BTTCZ5J.js";
|
|
17
17
|
import {
|
|
18
18
|
DEV,
|
|
19
19
|
devWarn,
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEV,
|
|
3
|
+
devWarn
|
|
4
|
+
} from "./chunk-2WLZ6757.js";
|
|
5
|
+
|
|
1
6
|
// src/patterns/hoc.ts
|
|
2
7
|
function withWrapper(WrappedComponent, wrapper) {
|
|
3
8
|
return (props) => wrapper(WrappedComponent, props);
|
|
@@ -113,31 +118,39 @@ var validators = {
|
|
|
113
118
|
};
|
|
114
119
|
function validateProps(props, schema) {
|
|
115
120
|
const result = { ...props };
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
121
|
+
if (typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : DEV) {
|
|
122
|
+
const errors = [];
|
|
123
|
+
for (const [key, def] of Object.entries(schema)) {
|
|
124
|
+
const propDef = typeof def === "function" ? { type: def } : def;
|
|
125
|
+
if (result[key] == null && propDef.default !== void 0) {
|
|
126
|
+
result[key] = typeof propDef.default === "function" ? propDef.default() : propDef.default;
|
|
127
|
+
}
|
|
128
|
+
if (propDef.required && result[key] == null) {
|
|
129
|
+
errors.push(`Prop '${key}' is required`);
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (result[key] == null) continue;
|
|
133
|
+
if (propDef.type) {
|
|
134
|
+
const typeResult = propDef.type(result[key], key);
|
|
135
|
+
if (typeResult !== true) errors.push(typeResult);
|
|
136
|
+
}
|
|
137
|
+
if (propDef.validator) {
|
|
138
|
+
const validResult = propDef.validator(result[key], key);
|
|
139
|
+
if (validResult !== true) errors.push(validResult);
|
|
140
|
+
}
|
|
132
141
|
}
|
|
133
|
-
if (
|
|
134
|
-
|
|
135
|
-
|
|
142
|
+
if (errors.length > 0) {
|
|
143
|
+
devWarn(`Prop validation errors:
|
|
144
|
+
${errors.map((e) => ` - ${e}`).join("\n")}`);
|
|
136
145
|
}
|
|
146
|
+
return result;
|
|
137
147
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
148
|
+
for (const [key, def] of Object.entries(schema)) {
|
|
149
|
+
if (typeof def === "function") continue;
|
|
150
|
+
const fallback = def.default;
|
|
151
|
+
if (result[key] == null && fallback !== void 0) {
|
|
152
|
+
result[key] = typeof fallback === "function" ? fallback() : fallback;
|
|
153
|
+
}
|
|
141
154
|
}
|
|
142
155
|
return result;
|
|
143
156
|
}
|
|
@@ -148,10 +161,11 @@ function defineStrictComponent(config) {
|
|
|
148
161
|
};
|
|
149
162
|
}
|
|
150
163
|
function assertType(value, validator, label) {
|
|
151
|
-
if (typeof
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
164
|
+
if (typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : DEV) {
|
|
165
|
+
const result = validator(value, label || "value");
|
|
166
|
+
if (result !== true) {
|
|
167
|
+
throw new TypeError(`[SibuJS Contract] ${result}`);
|
|
168
|
+
}
|
|
155
169
|
}
|
|
156
170
|
}
|
|
157
171
|
function createGuard(validator) {
|
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
} from "./chunk-WWV3SJ3L.js";
|
|
4
4
|
import {
|
|
5
5
|
tagFactory
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PNIRUQ4C.js";
|
|
7
7
|
import {
|
|
8
8
|
derived
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-W2EQ7X2L.js";
|
|
10
10
|
import {
|
|
11
11
|
effect
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7GIHSAWB.js";
|
|
13
13
|
import {
|
|
14
14
|
batch,
|
|
15
15
|
signal
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NVNJH22U.js";
|
|
17
17
|
|
|
18
18
|
// src/ecosystem/adapters/mobx.ts
|
|
19
19
|
function mobXAdapter(options) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bindAttribute,
|
|
3
3
|
setSafeAttribute
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VCTAEPSB.js";
|
|
5
5
|
import {
|
|
6
6
|
derived
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-W2EQ7X2L.js";
|
|
8
8
|
import {
|
|
9
9
|
isEventHandlerAttr
|
|
10
10
|
} from "./chunk-IXKSNWV5.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-7ZHH77QA.js";
|
|
14
14
|
import {
|
|
15
15
|
effect
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7GIHSAWB.js";
|
|
17
17
|
import {
|
|
18
18
|
dispose,
|
|
19
19
|
registerDisposer,
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
} from "./chunk-QKRPLZ2V.js";
|
|
22
22
|
import {
|
|
23
23
|
signal
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-NVNJH22U.js";
|
|
25
25
|
import {
|
|
26
26
|
track
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-3BTTCZ5J.js";
|
|
28
28
|
import {
|
|
29
29
|
reportError
|
|
30
30
|
} from "./chunk-2WLZ6757.js";
|
|
@@ -182,6 +182,15 @@ declare function withProps<OuterProps extends object, InnerProps extends object>
|
|
|
182
182
|
/**
|
|
183
183
|
* Runtime prop validation and strict typing contracts for SibuJS.
|
|
184
184
|
* Provides runtime type checking for component props in development mode.
|
|
185
|
+
*
|
|
186
|
+
* Both diagnostics here gate on `DEV`, the same foldable flag the rest of the
|
|
187
|
+
* framework uses, so a `__SIBU_DEV__: false` define removes them and their
|
|
188
|
+
* message text entirely. They used to test `process.env.NODE_ENV` directly,
|
|
189
|
+
* which is not a `define` target and does not exist in a browser at all — so
|
|
190
|
+
* every browser build treated itself as development: `validateProps` ran and
|
|
191
|
+
* warned, `assertType` threw, and the strings shipped. That went unnoticed
|
|
192
|
+
* while these functions were reachable only through a bundler; putting
|
|
193
|
+
* `patterns` on the CDN made them a production artifact.
|
|
185
194
|
*/
|
|
186
195
|
/** Validator function: returns true if valid, or an error message string. */
|
|
187
196
|
type Validator<T = unknown> = (value: T, propName: string) => true | string;
|
|
@@ -212,9 +221,19 @@ type PropSchema<Props> = {
|
|
|
212
221
|
[K in keyof Props]: PropDef<Props[K]> | Validator<Props[K]>;
|
|
213
222
|
};
|
|
214
223
|
/**
|
|
215
|
-
* Validate props against a schema
|
|
216
|
-
*
|
|
217
|
-
*
|
|
224
|
+
* Validate props against a schema, returning the props with defaults applied.
|
|
225
|
+
*
|
|
226
|
+
* Defaults are production behaviour; the checking is development-only and is
|
|
227
|
+
* compiled out of production builds. The two are not interchangeable when the
|
|
228
|
+
* schema's callbacks touch outside state: a validator that runs in development
|
|
229
|
+
* and not in production can leave a later property's default factory reading
|
|
230
|
+
* different state. Keep defaults and validators free of side effects if the
|
|
231
|
+
* two modes must agree exactly.
|
|
232
|
+
*
|
|
233
|
+
* @param props - The props to validate. Not mutated.
|
|
234
|
+
* @param schema - Per-property definitions, in either the shorthand
|
|
235
|
+
* (a bare {@link Validator}) or object form.
|
|
236
|
+
* @returns A new object: the props, plus any defaults that applied.
|
|
218
237
|
*/
|
|
219
238
|
declare function validateProps<Props extends object>(props: Partial<Props>, schema: PropSchema<Props>): Props;
|
|
220
239
|
/**
|
|
@@ -228,7 +247,9 @@ declare function defineStrictComponent<Props extends object>(config: {
|
|
|
228
247
|
}): (props: Partial<Props>) => HTMLElement;
|
|
229
248
|
/**
|
|
230
249
|
* Assert that a value satisfies a contract at runtime.
|
|
231
|
-
*
|
|
250
|
+
*
|
|
251
|
+
* No-op in production builds — genuinely, now. The previous guard returned early
|
|
252
|
+
* only when `process` existed, so in a browser it fell through and threw.
|
|
232
253
|
*/
|
|
233
254
|
declare function assertType<T>(value: unknown, validator: Validator<T>, label?: string): asserts value is T;
|
|
234
255
|
/**
|
|
@@ -182,6 +182,15 @@ declare function withProps<OuterProps extends object, InnerProps extends object>
|
|
|
182
182
|
/**
|
|
183
183
|
* Runtime prop validation and strict typing contracts for SibuJS.
|
|
184
184
|
* Provides runtime type checking for component props in development mode.
|
|
185
|
+
*
|
|
186
|
+
* Both diagnostics here gate on `DEV`, the same foldable flag the rest of the
|
|
187
|
+
* framework uses, so a `__SIBU_DEV__: false` define removes them and their
|
|
188
|
+
* message text entirely. They used to test `process.env.NODE_ENV` directly,
|
|
189
|
+
* which is not a `define` target and does not exist in a browser at all — so
|
|
190
|
+
* every browser build treated itself as development: `validateProps` ran and
|
|
191
|
+
* warned, `assertType` threw, and the strings shipped. That went unnoticed
|
|
192
|
+
* while these functions were reachable only through a bundler; putting
|
|
193
|
+
* `patterns` on the CDN made them a production artifact.
|
|
185
194
|
*/
|
|
186
195
|
/** Validator function: returns true if valid, or an error message string. */
|
|
187
196
|
type Validator<T = unknown> = (value: T, propName: string) => true | string;
|
|
@@ -212,9 +221,19 @@ type PropSchema<Props> = {
|
|
|
212
221
|
[K in keyof Props]: PropDef<Props[K]> | Validator<Props[K]>;
|
|
213
222
|
};
|
|
214
223
|
/**
|
|
215
|
-
* Validate props against a schema
|
|
216
|
-
*
|
|
217
|
-
*
|
|
224
|
+
* Validate props against a schema, returning the props with defaults applied.
|
|
225
|
+
*
|
|
226
|
+
* Defaults are production behaviour; the checking is development-only and is
|
|
227
|
+
* compiled out of production builds. The two are not interchangeable when the
|
|
228
|
+
* schema's callbacks touch outside state: a validator that runs in development
|
|
229
|
+
* and not in production can leave a later property's default factory reading
|
|
230
|
+
* different state. Keep defaults and validators free of side effects if the
|
|
231
|
+
* two modes must agree exactly.
|
|
232
|
+
*
|
|
233
|
+
* @param props - The props to validate. Not mutated.
|
|
234
|
+
* @param schema - Per-property definitions, in either the shorthand
|
|
235
|
+
* (a bare {@link Validator}) or object form.
|
|
236
|
+
* @returns A new object: the props, plus any defaults that applied.
|
|
218
237
|
*/
|
|
219
238
|
declare function validateProps<Props extends object>(props: Partial<Props>, schema: PropSchema<Props>): Props;
|
|
220
239
|
/**
|
|
@@ -228,7 +247,9 @@ declare function defineStrictComponent<Props extends object>(config: {
|
|
|
228
247
|
}): (props: Partial<Props>) => HTMLElement;
|
|
229
248
|
/**
|
|
230
249
|
* Assert that a value satisfies a contract at runtime.
|
|
231
|
-
*
|
|
250
|
+
*
|
|
251
|
+
* No-op in production builds — genuinely, now. The previous guard returned early
|
|
252
|
+
* only when `process` existed, so in a browser it fell through and threw.
|
|
232
253
|
*/
|
|
233
254
|
declare function assertType<T>(value: unknown, validator: Validator<T>, label?: string): asserts value is T;
|
|
234
255
|
/**
|
package/dist/data.cjs
CHANGED
|
@@ -604,7 +604,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
604
604
|
}
|
|
605
605
|
|
|
606
606
|
// src/reactivity/track.ts
|
|
607
|
-
var _runtimeVersion = true ? "4.
|
|
607
|
+
var _runtimeVersion = true ? "4.4.0" : "dev";
|
|
608
608
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
609
609
|
function resolveReactiveApi() {
|
|
610
610
|
const g = globalThis;
|
package/dist/data.js
CHANGED
|
@@ -20,15 +20,15 @@ import {
|
|
|
20
20
|
syncAdapter,
|
|
21
21
|
throttle,
|
|
22
22
|
withRetry
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-6GSIXTWX.js";
|
|
24
|
+
import "./chunk-7NBDXVHS.js";
|
|
25
|
+
import "./chunk-W2EQ7X2L.js";
|
|
26
26
|
import "./chunk-IXKSNWV5.js";
|
|
27
27
|
import "./chunk-7ZHH77QA.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-7GIHSAWB.js";
|
|
29
29
|
import "./chunk-5DXA2J44.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-NVNJH22U.js";
|
|
31
|
+
import "./chunk-3BTTCZ5J.js";
|
|
32
32
|
import "./chunk-2WLZ6757.js";
|
|
33
33
|
export {
|
|
34
34
|
__resetQueryCache,
|
package/dist/devtools.cjs
CHANGED
|
@@ -736,7 +736,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
736
736
|
}
|
|
737
737
|
|
|
738
738
|
// src/reactivity/track.ts
|
|
739
|
-
var _runtimeVersion = true ? "4.
|
|
739
|
+
var _runtimeVersion = true ? "4.4.0" : "dev";
|
|
740
740
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
741
741
|
function resolveReactiveApi() {
|
|
742
742
|
const g = globalThis;
|
package/dist/devtools.js
CHANGED
|
@@ -35,14 +35,14 @@ import {
|
|
|
35
35
|
trackCleanup,
|
|
36
36
|
walkDependencyGraph,
|
|
37
37
|
withErrorTracking
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-4Z3SPQ67.js";
|
|
39
39
|
import "./chunk-IXKSNWV5.js";
|
|
40
40
|
import "./chunk-7ZHH77QA.js";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-7GIHSAWB.js";
|
|
42
42
|
import "./chunk-5DXA2J44.js";
|
|
43
43
|
import "./chunk-QKRPLZ2V.js";
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-NVNJH22U.js";
|
|
45
|
+
import "./chunk-3BTTCZ5J.js";
|
|
46
46
|
import {
|
|
47
47
|
isDev
|
|
48
48
|
} from "./chunk-2WLZ6757.js";
|