@madronejs/core 1.0.16 → 1.0.18
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 +1 -89
- package/dist/core.js +528 -0
- package/package.json +40 -37
- package/types/decorate.d.ts +1 -1
- package/types/global.d.ts +1 -1
- package/types/integrations/index.d.ts +0 -1
- package/types/reactivity/Observer.d.ts +0 -1
- package/types/util.d.ts +1 -1
- package/dist/core.mjs +0 -617
- package/dist/core.umd.js +0 -1
- package/types/integrations/MadroneVue2.d.ts +0 -3
- package/types/integrations/__spec__/vue2.spec.d.ts +0 -2
package/dist/core.mjs
DELETED
|
@@ -1,617 +0,0 @@
|
|
|
1
|
-
const U = /* @__PURE__ */ new Set();
|
|
2
|
-
let ee;
|
|
3
|
-
function be() {
|
|
4
|
-
return [...U];
|
|
5
|
-
}
|
|
6
|
-
function we() {
|
|
7
|
-
return be().at(-1);
|
|
8
|
-
}
|
|
9
|
-
function te() {
|
|
10
|
-
ee = we();
|
|
11
|
-
}
|
|
12
|
-
function ne(e) {
|
|
13
|
-
e && (U.add(e), te());
|
|
14
|
-
}
|
|
15
|
-
function Oe(e) {
|
|
16
|
-
U.delete(e), te();
|
|
17
|
-
}
|
|
18
|
-
function P() {
|
|
19
|
-
return ee;
|
|
20
|
-
}
|
|
21
|
-
const re = /* @__PURE__ */ new WeakMap();
|
|
22
|
-
function ce(e) {
|
|
23
|
-
var t;
|
|
24
|
-
return (((t = P()) == null ? void 0 : t.toRaw) ?? (() => e))(e);
|
|
25
|
-
}
|
|
26
|
-
function S(e) {
|
|
27
|
-
re.set(ce(e), Date.now());
|
|
28
|
-
}
|
|
29
|
-
function Ce(e) {
|
|
30
|
-
return re.get(ce(e));
|
|
31
|
-
}
|
|
32
|
-
function _(e, n, t) {
|
|
33
|
-
var a;
|
|
34
|
-
const r = P();
|
|
35
|
-
if (!r)
|
|
36
|
-
throw new Error("No integration specified");
|
|
37
|
-
typeof t.get == "function" && (r != null && r.defineComputed) ? r.defineComputed(e, n, {
|
|
38
|
-
get: t.get.bind(e),
|
|
39
|
-
set: (a = t.set) == null ? void 0 : a.bind(e),
|
|
40
|
-
enumerable: t.enumerable,
|
|
41
|
-
configurable: t.configurable,
|
|
42
|
-
cache: t.cache ?? !0
|
|
43
|
-
}) : !t.get && (r != null && r.defineProperty) && r.defineProperty(e, n, {
|
|
44
|
-
value: t.value,
|
|
45
|
-
enumerable: t.enumerable,
|
|
46
|
-
configurable: t.configurable,
|
|
47
|
-
deep: t.deep
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function Re(e, n) {
|
|
51
|
-
var a, f;
|
|
52
|
-
const t = Object.getOwnPropertyDescriptors(e), r = (u, d) => {
|
|
53
|
-
var l;
|
|
54
|
-
return (l = n == null ? void 0 : n[u]) == null ? void 0 : l[d];
|
|
55
|
-
};
|
|
56
|
-
for (const [u, d] of Object.entries(t))
|
|
57
|
-
_(e, u, {
|
|
58
|
-
get: (a = d.get) == null ? void 0 : a.bind(e),
|
|
59
|
-
set: (f = d.set) == null ? void 0 : f.bind(e),
|
|
60
|
-
value: r(u, "value") ?? d.value,
|
|
61
|
-
enumerable: r(u, "enumerable") ?? d.enumerable,
|
|
62
|
-
configurable: r(u, "configurable") ?? d.configurable,
|
|
63
|
-
cache: r(u, "cache") ?? !0,
|
|
64
|
-
deep: r(u, "deep") ?? !0
|
|
65
|
-
});
|
|
66
|
-
return e;
|
|
67
|
-
}
|
|
68
|
-
function ye(e, n, t) {
|
|
69
|
-
var a;
|
|
70
|
-
const r = P();
|
|
71
|
-
return (a = r == null ? void 0 : r.watch) == null ? void 0 : a.call(r, e, n, t);
|
|
72
|
-
}
|
|
73
|
-
const Y = Symbol("keys"), D = Symbol("computed"), K = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap();
|
|
74
|
-
let B = [], N = null;
|
|
75
|
-
const Se = (e) => K.has(e), ae = (e) => X.has(e), k = (e) => K.get(e), Pe = (e) => X.get(e), Ie = (e) => ae(e) ? Pe(e) : e, Te = (e, n) => {
|
|
76
|
-
K.set(e, n), X.set(n, e);
|
|
77
|
-
}, _e = () => {
|
|
78
|
-
N === null && (N = setTimeout(() => {
|
|
79
|
-
const e = B;
|
|
80
|
-
for (B = []; e.length > 0; )
|
|
81
|
-
e.shift()();
|
|
82
|
-
N = null;
|
|
83
|
-
}));
|
|
84
|
-
}, Ee = (e) => {
|
|
85
|
-
B.push(e), _e();
|
|
86
|
-
}, ue = (e, n) => {
|
|
87
|
-
const t = R.get(e), r = t == null ? void 0 : t.get(n);
|
|
88
|
-
if (r) {
|
|
89
|
-
for (const a of r)
|
|
90
|
-
C.get(a).delete(e);
|
|
91
|
-
r.clear(), t.delete(n), t.size === 0 && R.delete(e);
|
|
92
|
-
}
|
|
93
|
-
}, se = (e, n) => {
|
|
94
|
-
const t = Me();
|
|
95
|
-
if (!t)
|
|
96
|
-
return;
|
|
97
|
-
R.has(t) || R.set(t, /* @__PURE__ */ new Map()), C.has(e) || C.set(e, /* @__PURE__ */ new Map());
|
|
98
|
-
const r = C.get(e), a = R.get(t);
|
|
99
|
-
r.has(n) || r.set(n, /* @__PURE__ */ new Set()), a.has(n) || a.set(n, /* @__PURE__ */ new Set());
|
|
100
|
-
const f = r.get(n), u = a.get(n);
|
|
101
|
-
f.add(t), u.add(e);
|
|
102
|
-
}, ie = (e, n) => {
|
|
103
|
-
const t = k(e);
|
|
104
|
-
t && se(t, n);
|
|
105
|
-
}, fe = (e, n) => {
|
|
106
|
-
const t = C.get(e);
|
|
107
|
-
if (t != null && t.get(n))
|
|
108
|
-
for (const r of t.get(n))
|
|
109
|
-
r.setDirty(), ue(r, n);
|
|
110
|
-
}, y = (e, n) => {
|
|
111
|
-
fe(k(e), n);
|
|
112
|
-
}, W = [];
|
|
113
|
-
function Me() {
|
|
114
|
-
return W.at(-1);
|
|
115
|
-
}
|
|
116
|
-
class x {
|
|
117
|
-
static create(...n) {
|
|
118
|
-
return new x(...n);
|
|
119
|
-
}
|
|
120
|
-
constructor(n) {
|
|
121
|
-
this.name = n.name, this.get = n.get, this.set = n.set, this.cache = !!(n.cache ?? !0), this.alive = !0, this.dirty = !0, this.cachedVal = void 0, this.hooks = {
|
|
122
|
-
onGet: n.onGet,
|
|
123
|
-
onSet: n.onSet,
|
|
124
|
-
onChange: n.onChange,
|
|
125
|
-
onImmediateChange: n.onImmediateChange
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
callHook(n) {
|
|
129
|
-
typeof this.hooks[n] == "function" && this.hooks[n](this);
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Stop observing and dispose of the observer
|
|
133
|
-
* @returns {void}
|
|
134
|
-
*/
|
|
135
|
-
dispose() {
|
|
136
|
-
ue(this, D), this.alive = !1, this.dirty = !1, this.cachedVal = void 0, this.prev = void 0;
|
|
137
|
-
}
|
|
138
|
-
wrap(n) {
|
|
139
|
-
W.push(this);
|
|
140
|
-
const t = n();
|
|
141
|
-
return W.pop(), t;
|
|
142
|
-
}
|
|
143
|
-
setHook(n, t) {
|
|
144
|
-
this.hooks[n] = t;
|
|
145
|
-
}
|
|
146
|
-
setDirty() {
|
|
147
|
-
this.alive && !this.dirty && (this.dirty = !0, fe(this, D), this.prev = this.cachedVal, this.callHook(
|
|
148
|
-
"onImmediateChange"
|
|
149
|
-
/* onImmediateChange */
|
|
150
|
-
), Ee(() => this.notifyChange()));
|
|
151
|
-
}
|
|
152
|
-
notifyChange() {
|
|
153
|
-
this.callHook(
|
|
154
|
-
"onChange"
|
|
155
|
-
/* onChange */
|
|
156
|
-
), this.prev = void 0;
|
|
157
|
-
}
|
|
158
|
-
run() {
|
|
159
|
-
if (!this.alive)
|
|
160
|
-
return;
|
|
161
|
-
const n = this.wrap(() => ((this.cache && this.dirty || !this.cache) && (this.cachedVal = this.get(), this.dirty = !1), this.cachedVal));
|
|
162
|
-
return se(this, D), this.callHook(
|
|
163
|
-
"onGet"
|
|
164
|
-
/* onGet */
|
|
165
|
-
), n;
|
|
166
|
-
}
|
|
167
|
-
/** The value of the observer */
|
|
168
|
-
get value() {
|
|
169
|
-
return this.run();
|
|
170
|
-
}
|
|
171
|
-
set value(n) {
|
|
172
|
-
if (typeof this.set == "function")
|
|
173
|
-
this.set(n), this.callHook(
|
|
174
|
-
"onSet"
|
|
175
|
-
/* onSet */
|
|
176
|
-
);
|
|
177
|
-
else
|
|
178
|
-
throw new TypeError(`No setter defined for "${this.name}"`);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
function de(...e) {
|
|
182
|
-
return x.create(...e);
|
|
183
|
-
}
|
|
184
|
-
function Ae(e) {
|
|
185
|
-
return de(e);
|
|
186
|
-
}
|
|
187
|
-
const E = (e) => {
|
|
188
|
-
const {
|
|
189
|
-
name: n,
|
|
190
|
-
target: t,
|
|
191
|
-
key: r,
|
|
192
|
-
receiver: a,
|
|
193
|
-
value: f,
|
|
194
|
-
keysChanged: u = !1,
|
|
195
|
-
valueChanged: d = !1
|
|
196
|
-
} = e;
|
|
197
|
-
return {
|
|
198
|
-
name: n,
|
|
199
|
-
target: t,
|
|
200
|
-
key: r,
|
|
201
|
-
receiver: a,
|
|
202
|
-
value: f,
|
|
203
|
-
keysChanged: u,
|
|
204
|
-
valueChanged: d
|
|
205
|
-
};
|
|
206
|
-
}, Ge = (e, n, t, r) => {
|
|
207
|
-
var a;
|
|
208
|
-
ie(n, t), (a = e == null ? void 0 : e.onGet) == null || a.call(
|
|
209
|
-
e,
|
|
210
|
-
E({
|
|
211
|
-
name: e.name,
|
|
212
|
-
target: n,
|
|
213
|
-
key: t,
|
|
214
|
-
receiver: r
|
|
215
|
-
})
|
|
216
|
-
);
|
|
217
|
-
}, He = (e, n, t, r) => {
|
|
218
|
-
var l;
|
|
219
|
-
const a = n[t], f = Array.isArray(n);
|
|
220
|
-
let u = !1, d = !1;
|
|
221
|
-
t in n || (y(n, Y), d = !0, f && y(n, "length")), (a !== r || f) && (y(n, t), u = !0), (d || u) && ((l = e == null ? void 0 : e.onSet) == null || l.call(
|
|
222
|
-
e,
|
|
223
|
-
E({
|
|
224
|
-
name: e.name,
|
|
225
|
-
target: n,
|
|
226
|
-
key: t,
|
|
227
|
-
value: r,
|
|
228
|
-
keysChanged: d,
|
|
229
|
-
valueChanged: u
|
|
230
|
-
})
|
|
231
|
-
));
|
|
232
|
-
}, De = (e, n, t) => {
|
|
233
|
-
var r;
|
|
234
|
-
y(n, t), y(n, Y), (r = e == null ? void 0 : e.onDelete) == null || r.call(
|
|
235
|
-
e,
|
|
236
|
-
E({
|
|
237
|
-
name: e.name,
|
|
238
|
-
target: n,
|
|
239
|
-
key: t,
|
|
240
|
-
keysChanged: !0
|
|
241
|
-
})
|
|
242
|
-
);
|
|
243
|
-
}, J = (e, n, t) => {
|
|
244
|
-
var r;
|
|
245
|
-
ie(n, Y), (r = e == null ? void 0 : e.onHas) == null || r.call(
|
|
246
|
-
e,
|
|
247
|
-
E({
|
|
248
|
-
name: e.name,
|
|
249
|
-
target: n,
|
|
250
|
-
key: t
|
|
251
|
-
})
|
|
252
|
-
);
|
|
253
|
-
};
|
|
254
|
-
function oe(e) {
|
|
255
|
-
const n = e.needsProxy || (() => !0);
|
|
256
|
-
return {
|
|
257
|
-
get: (t, r, a) => {
|
|
258
|
-
var u;
|
|
259
|
-
Ge(e, t, r, a);
|
|
260
|
-
const f = Reflect.get(t, r, a);
|
|
261
|
-
return n({ target: t, key: r, value: f }) && (e != null && e.deep) && ((u = Object.getOwnPropertyDescriptor(t, r)) != null && u.configurable) ? w(f, e) : f;
|
|
262
|
-
},
|
|
263
|
-
set: (t, r, a) => (He(e, t, r, a), Reflect.set(t, r, a)),
|
|
264
|
-
deleteProperty: (...t) => (De(e, ...t), Reflect.deleteProperty(...t)),
|
|
265
|
-
has: (t, r) => (J(e, t), Reflect.has(t, r)),
|
|
266
|
-
ownKeys: (t) => (J(e, t), Reflect.ownKeys(t)),
|
|
267
|
-
getPrototypeOf: (t) => Object.getPrototypeOf(t)
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
const Ne = (e) => ({
|
|
271
|
-
...oe(e)
|
|
272
|
-
}), Ve = (e) => ({
|
|
273
|
-
...oe(e)
|
|
274
|
-
}), I = Object.freeze({
|
|
275
|
-
object: Ne,
|
|
276
|
-
array: Ve
|
|
277
|
-
// set: setHandler,
|
|
278
|
-
// map: mapHandler,
|
|
279
|
-
// weakset: weaksetHandler,
|
|
280
|
-
// weakmap: weakmapHandler,
|
|
281
|
-
});
|
|
282
|
-
function w(e, n) {
|
|
283
|
-
if (Se(e))
|
|
284
|
-
return k(e);
|
|
285
|
-
if (ae(e))
|
|
286
|
-
return e;
|
|
287
|
-
const t = n || {}, r = { ...t, deep: (t == null ? void 0 : t.deep) ?? !0 }, a = w.getStringType(e);
|
|
288
|
-
if (!w.hasHandler(a))
|
|
289
|
-
return e;
|
|
290
|
-
const f = new Proxy(e, w.typeHandler(a, r));
|
|
291
|
-
return Te(e, f), f;
|
|
292
|
-
}
|
|
293
|
-
w.getStringType = (e) => Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
|
|
294
|
-
w.hasHandler = (e) => !!I[e];
|
|
295
|
-
w.typeHandler = (e, n) => {
|
|
296
|
-
var t;
|
|
297
|
-
return (t = I[e]) == null ? void 0 : t.call(I, n);
|
|
298
|
-
};
|
|
299
|
-
function z(e, n, t) {
|
|
300
|
-
const r = de({
|
|
301
|
-
get: e,
|
|
302
|
-
onChange: ({ value: f, prev: u }) => n(f, u)
|
|
303
|
-
}), a = r.run();
|
|
304
|
-
return t != null && t.immediate && n(a), () => r.dispose();
|
|
305
|
-
}
|
|
306
|
-
function M(e, n, t) {
|
|
307
|
-
var f, u, d, l;
|
|
308
|
-
let r, a;
|
|
309
|
-
if (n.cache) {
|
|
310
|
-
const m = Ae({
|
|
311
|
-
...n,
|
|
312
|
-
get: n.get,
|
|
313
|
-
name: e,
|
|
314
|
-
onImmediateChange: (f = t == null ? void 0 : t.computed) == null ? void 0 : f.onImmediateChange,
|
|
315
|
-
onChange: (u = t == null ? void 0 : t.computed) == null ? void 0 : u.onChange,
|
|
316
|
-
onGet: (d = t == null ? void 0 : t.computed) == null ? void 0 : d.onGet,
|
|
317
|
-
onSet: (l = t == null ? void 0 : t.computed) == null ? void 0 : l.onSet
|
|
318
|
-
});
|
|
319
|
-
r = function() {
|
|
320
|
-
return S(this), m.value;
|
|
321
|
-
}, a = function(g) {
|
|
322
|
-
m.value = g;
|
|
323
|
-
};
|
|
324
|
-
} else
|
|
325
|
-
r = function() {
|
|
326
|
-
return S(this), n.get.call(this);
|
|
327
|
-
}, a = function(...h) {
|
|
328
|
-
n.set.call(this, ...h);
|
|
329
|
-
};
|
|
330
|
-
return {
|
|
331
|
-
enumerable: n.enumerable,
|
|
332
|
-
configurable: n.configurable,
|
|
333
|
-
get: r,
|
|
334
|
-
set: a
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
function A(e, n, t) {
|
|
338
|
-
var f, u, d, l, m, h;
|
|
339
|
-
const r = { value: n.value }, a = w(r, {
|
|
340
|
-
name: e,
|
|
341
|
-
onGet: (f = t == null ? void 0 : t.reactive) == null ? void 0 : f.onGet,
|
|
342
|
-
onHas: (u = t == null ? void 0 : t.reactive) == null ? void 0 : u.onHas,
|
|
343
|
-
onSet: (d = t == null ? void 0 : t.reactive) == null ? void 0 : d.onSet,
|
|
344
|
-
onDelete: (l = t == null ? void 0 : t.reactive) == null ? void 0 : l.onDelete,
|
|
345
|
-
needsProxy: (m = t == null ? void 0 : t.reactive) == null ? void 0 : m.needsProxy,
|
|
346
|
-
deep: n.deep ?? ((h = t == null ? void 0 : t.reactive) == null ? void 0 : h.deep)
|
|
347
|
-
});
|
|
348
|
-
return {
|
|
349
|
-
configurable: n.configurable,
|
|
350
|
-
enumerable: n.enumerable,
|
|
351
|
-
get: function() {
|
|
352
|
-
S(this);
|
|
353
|
-
const { value: v } = a;
|
|
354
|
-
return Array.isArray(v) && Reflect.get(v, "length"), v;
|
|
355
|
-
},
|
|
356
|
-
set: function(v) {
|
|
357
|
-
a.value = v;
|
|
358
|
-
}
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
function F(e, n, t, r) {
|
|
362
|
-
Object.defineProperty(e, n, M(n, t, r));
|
|
363
|
-
}
|
|
364
|
-
function p(e, n, t, r) {
|
|
365
|
-
Object.defineProperty(e, n, A(n, t, r));
|
|
366
|
-
}
|
|
367
|
-
const q = {
|
|
368
|
-
toRaw: Ie,
|
|
369
|
-
watch: z,
|
|
370
|
-
describeProperty: A,
|
|
371
|
-
defineProperty: p,
|
|
372
|
-
describeComputed: M,
|
|
373
|
-
defineComputed: F
|
|
374
|
-
}, V = /* @__PURE__ */ new Set(["__proto__", "__ob__"]), O = "value";
|
|
375
|
-
function je(e) {
|
|
376
|
-
const { observable: n, set: t } = e, r = /* @__PURE__ */ new WeakMap(), a = (c, s) => {
|
|
377
|
-
let o = r.get(c);
|
|
378
|
-
o || (o = /* @__PURE__ */ new Map(), r.set(c, o));
|
|
379
|
-
let b = o.get(s);
|
|
380
|
-
return b || (b = n({ [O]: 0 }), o.set(s, b)), b;
|
|
381
|
-
}, f = t ? (c) => t(c, O, c[O] + 1) : (c) => {
|
|
382
|
-
c[O] += 1;
|
|
383
|
-
}, u = (c, s) => {
|
|
384
|
-
V.has(s) || Reflect.get(a(c, s), O);
|
|
385
|
-
}, d = (c, s) => {
|
|
386
|
-
V.has(s) || f(a(c, s));
|
|
387
|
-
}, l = (c, s) => {
|
|
388
|
-
const o = r.get(c);
|
|
389
|
-
o && d(o, s), r.delete(c);
|
|
390
|
-
}, g = {
|
|
391
|
-
computed: {
|
|
392
|
-
onGet: (c) => {
|
|
393
|
-
u(c, c.name);
|
|
394
|
-
},
|
|
395
|
-
onImmediateChange: (c) => {
|
|
396
|
-
d(c, c.name);
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
reactive: {
|
|
400
|
-
onGet: ({ target: c, key: s }) => {
|
|
401
|
-
S(c), u(c, s);
|
|
402
|
-
},
|
|
403
|
-
onHas: ({ target: c, key: s }) => {
|
|
404
|
-
u(c, s);
|
|
405
|
-
},
|
|
406
|
-
onDelete: ({ target: c, key: s }) => {
|
|
407
|
-
l(c, s);
|
|
408
|
-
},
|
|
409
|
-
onSet: ({ target: c, key: s, keysChanged: o }) => {
|
|
410
|
-
d(c, s), o && d(c);
|
|
411
|
-
},
|
|
412
|
-
needsProxy: ({ key: c }) => !V.has(c)
|
|
413
|
-
}
|
|
414
|
-
};
|
|
415
|
-
function v(c, s) {
|
|
416
|
-
return M(c, s, g);
|
|
417
|
-
}
|
|
418
|
-
function G(c, s) {
|
|
419
|
-
return A(c, s, g);
|
|
420
|
-
}
|
|
421
|
-
function H(c, s, o) {
|
|
422
|
-
return F(c, s, o, g);
|
|
423
|
-
}
|
|
424
|
-
function i(c, s, o) {
|
|
425
|
-
return p(c, s, o, g);
|
|
426
|
-
}
|
|
427
|
-
return {
|
|
428
|
-
toRaw: q.toRaw,
|
|
429
|
-
watch: z,
|
|
430
|
-
describeProperty: G,
|
|
431
|
-
defineProperty: i,
|
|
432
|
-
describeComputed: v,
|
|
433
|
-
defineComputed: H
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
const $ = /* @__PURE__ */ new Set(["__proto__", "__ob__"]), j = "value", $e = (e) => {
|
|
437
|
-
e[j] += 1;
|
|
438
|
-
};
|
|
439
|
-
function Ue({ reactive: e, toRaw: n } = {}) {
|
|
440
|
-
const t = n ?? ((i) => i), r = /* @__PURE__ */ new WeakMap(), a = (i, c) => {
|
|
441
|
-
const s = t(i);
|
|
442
|
-
let o = r.get(s);
|
|
443
|
-
o || (o = /* @__PURE__ */ new Map(), r.set(s, o));
|
|
444
|
-
let b = o.get(c);
|
|
445
|
-
return b || (b = e({ [j]: 0 }), o.set(c, b)), b;
|
|
446
|
-
}, f = (i, c) => {
|
|
447
|
-
$.has(c) || Reflect.get(a(i, c), j);
|
|
448
|
-
}, u = (i, c) => {
|
|
449
|
-
$.has(c) || $e(a(i, c));
|
|
450
|
-
}, d = (i, c) => {
|
|
451
|
-
const s = t(i), o = r.get(s);
|
|
452
|
-
o && u(o, c), r.delete(s);
|
|
453
|
-
}, h = {
|
|
454
|
-
computed: {
|
|
455
|
-
onGet: (i) => {
|
|
456
|
-
f(i, i.name);
|
|
457
|
-
},
|
|
458
|
-
onImmediateChange: (i) => {
|
|
459
|
-
u(i, i.name);
|
|
460
|
-
}
|
|
461
|
-
},
|
|
462
|
-
reactive: {
|
|
463
|
-
onGet: ({ target: i, key: c }) => {
|
|
464
|
-
S(i), f(i, c);
|
|
465
|
-
},
|
|
466
|
-
onHas: ({ target: i, key: c }) => {
|
|
467
|
-
f(i, c);
|
|
468
|
-
},
|
|
469
|
-
onDelete: ({ target: i, key: c }) => {
|
|
470
|
-
d(i, c);
|
|
471
|
-
},
|
|
472
|
-
onSet: ({ target: i, key: c, keysChanged: s }) => {
|
|
473
|
-
u(i, c), s && u(i);
|
|
474
|
-
},
|
|
475
|
-
needsProxy: ({ key: i }) => !$.has(i)
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
function g(i, c) {
|
|
479
|
-
return M(i, c, h);
|
|
480
|
-
}
|
|
481
|
-
function v(i, c) {
|
|
482
|
-
return A(i, c, h);
|
|
483
|
-
}
|
|
484
|
-
function G(i, c, s) {
|
|
485
|
-
return F(i, c, s, h);
|
|
486
|
-
}
|
|
487
|
-
function H(i, c, s) {
|
|
488
|
-
return p(i, c, s, h);
|
|
489
|
-
}
|
|
490
|
-
return {
|
|
491
|
-
toRaw: q.toRaw,
|
|
492
|
-
watch: z,
|
|
493
|
-
describeProperty: v,
|
|
494
|
-
defineProperty: H,
|
|
495
|
-
describeComputed: g,
|
|
496
|
-
defineComputed: G
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
function Le(...e) {
|
|
500
|
-
const n = {}, t = {};
|
|
501
|
-
for (const r of e) {
|
|
502
|
-
const a = typeof r == "function" ? r() : r;
|
|
503
|
-
Object.assign(n, Object.getOwnPropertyDescriptors(a ?? r ?? {}));
|
|
504
|
-
}
|
|
505
|
-
return Object.defineProperties(t, n), t;
|
|
506
|
-
}
|
|
507
|
-
function Be(e, n) {
|
|
508
|
-
Object.defineProperties(
|
|
509
|
-
e.prototype,
|
|
510
|
-
Object.getOwnPropertyDescriptors(Le(...[...n, e].map((t) => t.prototype)))
|
|
511
|
-
);
|
|
512
|
-
}
|
|
513
|
-
const T = /* @__PURE__ */ new WeakMap();
|
|
514
|
-
function Ye(...e) {
|
|
515
|
-
return (n) => {
|
|
516
|
-
e != null && e.length && Be(n, e);
|
|
517
|
-
};
|
|
518
|
-
}
|
|
519
|
-
function le(e) {
|
|
520
|
-
T.has(e) || T.set(e, /* @__PURE__ */ new Set());
|
|
521
|
-
}
|
|
522
|
-
function he(e, n) {
|
|
523
|
-
return le(e), T.get(e).has(n);
|
|
524
|
-
}
|
|
525
|
-
function ge(e, n) {
|
|
526
|
-
le(e), T.get(e).add(n);
|
|
527
|
-
}
|
|
528
|
-
function Z(e, n, t, r) {
|
|
529
|
-
var f;
|
|
530
|
-
return P() && !he(e, n) ? (_(e, n, {
|
|
531
|
-
...t,
|
|
532
|
-
get: t.get.bind(e),
|
|
533
|
-
set: (f = t.set) == null ? void 0 : f.bind(e),
|
|
534
|
-
enumerable: !0,
|
|
535
|
-
...r == null ? void 0 : r.descriptors,
|
|
536
|
-
cache: !0
|
|
537
|
-
}), ge(e, n), !0) : !1;
|
|
538
|
-
}
|
|
539
|
-
function me(e, n, t, r) {
|
|
540
|
-
if (typeof t.get == "function") {
|
|
541
|
-
const a = {
|
|
542
|
-
...t,
|
|
543
|
-
enumerable: !0,
|
|
544
|
-
configurable: !0
|
|
545
|
-
};
|
|
546
|
-
return a.get = function() {
|
|
547
|
-
return Z(this, n, t, r), this[n];
|
|
548
|
-
}, a.set = function(u) {
|
|
549
|
-
Z(this, n, t, r), this[n] = u;
|
|
550
|
-
}, a;
|
|
551
|
-
}
|
|
552
|
-
return t;
|
|
553
|
-
}
|
|
554
|
-
function We(e, n, t) {
|
|
555
|
-
return me(e, n, t);
|
|
556
|
-
}
|
|
557
|
-
We.configure = function(n) {
|
|
558
|
-
return (t, r, a) => me(t, r, a, { descriptors: n });
|
|
559
|
-
};
|
|
560
|
-
function L(e, n, t) {
|
|
561
|
-
return P() && !he(e, n) ? (ge(e, n), _(e, n, {
|
|
562
|
-
...Object.getOwnPropertyDescriptor(e, n),
|
|
563
|
-
enumerable: !0,
|
|
564
|
-
...t == null ? void 0 : t.descriptors
|
|
565
|
-
}), !0) : !1;
|
|
566
|
-
}
|
|
567
|
-
function Q(e, n, t) {
|
|
568
|
-
typeof e == "function" ? L(e, n) : Object.defineProperty(e, n, {
|
|
569
|
-
configurable: !0,
|
|
570
|
-
enumerable: !0,
|
|
571
|
-
get() {
|
|
572
|
-
if (L(this, n, t))
|
|
573
|
-
return this[n];
|
|
574
|
-
},
|
|
575
|
-
set(r) {
|
|
576
|
-
L(this, n, t) && (this[n] = r);
|
|
577
|
-
}
|
|
578
|
-
});
|
|
579
|
-
}
|
|
580
|
-
function ve(e, n) {
|
|
581
|
-
return Q(e, n);
|
|
582
|
-
}
|
|
583
|
-
ve.shallow = function(n, t) {
|
|
584
|
-
return Q(n, t, { descriptors: { deep: !1 } });
|
|
585
|
-
};
|
|
586
|
-
ve.configure = function(n) {
|
|
587
|
-
return (t, r) => Q(t, r, { descriptors: n });
|
|
588
|
-
};
|
|
589
|
-
ne(q);
|
|
590
|
-
const Ke = {
|
|
591
|
-
/** Configure a global plugin */
|
|
592
|
-
use: ne,
|
|
593
|
-
/** Remove a global plugin */
|
|
594
|
-
unuse: Oe,
|
|
595
|
-
/** Create reactive objects */
|
|
596
|
-
auto: Re,
|
|
597
|
-
/** Define properties on objects */
|
|
598
|
-
define: _,
|
|
599
|
-
/** Watch reactive objects */
|
|
600
|
-
watch: ye,
|
|
601
|
-
/** Get the last time any reactive property was touched on a given object */
|
|
602
|
-
lastAccessed: Ce
|
|
603
|
-
};
|
|
604
|
-
export {
|
|
605
|
-
q as MadroneState,
|
|
606
|
-
je as MadroneVue2,
|
|
607
|
-
Ue as MadroneVue3,
|
|
608
|
-
Be as applyClassMixins,
|
|
609
|
-
Re as auto,
|
|
610
|
-
Ye as classMixin,
|
|
611
|
-
We as computed,
|
|
612
|
-
Ke as default,
|
|
613
|
-
Le as merge,
|
|
614
|
-
ve as reactive,
|
|
615
|
-
ce as toRaw,
|
|
616
|
-
ye as watch
|
|
617
|
-
};
|
package/dist/core.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(l,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(l=typeof globalThis<"u"?globalThis:l||self,y(l.madrone={}))})(this,function(l){"use strict";const y=new Set;let te;function Re(){return[...y]}function Pe(){return Re().at(-1)}function ne(){te=Pe()}function re(e){e&&(y.add(e),ne())}function Te(e){y.delete(e),ne()}function C(){return te}const ce=new WeakMap;function V(e){var t;return(((t=C())==null?void 0:t.toRaw)??(()=>e))(e)}function S(e){ce.set(V(e),Date.now())}function Ie(e){return ce.get(V(e))}function _(e,n,t){var a;const r=C();if(!r)throw new Error("No integration specified");typeof t.get=="function"&&(r!=null&&r.defineComputed)?r.defineComputed(e,n,{get:t.get.bind(e),set:(a=t.set)==null?void 0:a.bind(e),enumerable:t.enumerable,configurable:t.configurable,cache:t.cache??!0}):!t.get&&(r!=null&&r.defineProperty)&&r.defineProperty(e,n,{value:t.value,enumerable:t.enumerable,configurable:t.configurable,deep:t.deep})}function ae(e,n){var a,f;const t=Object.getOwnPropertyDescriptors(e),r=(u,d)=>{var h;return(h=n==null?void 0:n[u])==null?void 0:h[d]};for(const[u,d]of Object.entries(t))_(e,u,{get:(a=d.get)==null?void 0:a.bind(e),set:(f=d.set)==null?void 0:f.bind(e),value:r(u,"value")??d.value,enumerable:r(u,"enumerable")??d.enumerable,configurable:r(u,"configurable")??d.configurable,cache:r(u,"cache")??!0,deep:r(u,"deep")??!0});return e}function ue(e,n,t){var a;const r=C();return(a=r==null?void 0:r.watch)==null?void 0:a.call(r,e,n,t)}const N=Symbol("keys"),$=Symbol("computed"),L=new WeakMap,j=new WeakMap,R=new WeakMap,P=new WeakMap;let B=[],W=null;const _e=e=>L.has(e),ie=e=>j.has(e),U=e=>L.get(e),Me=e=>j.get(e),Ee=e=>ie(e)?Me(e):e,Ae=(e,n)=>{L.set(e,n),j.set(n,e)},He=()=>{W===null&&(W=setTimeout(()=>{const e=B;for(B=[];e.length>0;)e.shift()();W=null}))},Ge=e=>{B.push(e),He()},se=(e,n)=>{const t=P.get(e),r=t==null?void 0:t.get(n);if(r){for(const a of r)R.get(a).delete(e);r.clear(),t.delete(n),t.size===0&&P.delete(e)}},fe=(e,n)=>{const t=De();if(!t)return;P.has(t)||P.set(t,new Map),R.has(e)||R.set(e,new Map);const r=R.get(e),a=P.get(t);r.has(n)||r.set(n,new Set),a.has(n)||a.set(n,new Set);const f=r.get(n),u=a.get(n);f.add(t),u.add(e)},de=(e,n)=>{const t=U(e);t&&fe(t,n)},oe=(e,n)=>{const t=R.get(e);if(t!=null&&t.get(n))for(const r of t.get(n))r.setDirty(),se(r,n)},T=(e,n)=>{oe(U(e),n)},Y=[];function De(){return Y.at(-1)}class K{static create(...n){return new K(...n)}constructor(n){this.name=n.name,this.get=n.get,this.set=n.set,this.cache=!!(n.cache??!0),this.alive=!0,this.dirty=!0,this.cachedVal=void 0,this.hooks={onGet:n.onGet,onSet:n.onSet,onChange:n.onChange,onImmediateChange:n.onImmediateChange}}callHook(n){typeof this.hooks[n]=="function"&&this.hooks[n](this)}dispose(){se(this,$),this.alive=!1,this.dirty=!1,this.cachedVal=void 0,this.prev=void 0}wrap(n){Y.push(this);const t=n();return Y.pop(),t}setHook(n,t){this.hooks[n]=t}setDirty(){this.alive&&!this.dirty&&(this.dirty=!0,oe(this,$),this.prev=this.cachedVal,this.callHook("onImmediateChange"),Ge(()=>this.notifyChange()))}notifyChange(){this.callHook("onChange"),this.prev=void 0}run(){if(!this.alive)return;const n=this.wrap(()=>((this.cache&&this.dirty||!this.cache)&&(this.cachedVal=this.get(),this.dirty=!1),this.cachedVal));return fe(this,$),this.callHook("onGet"),n}get value(){return this.run()}set value(n){if(typeof this.set=="function")this.set(n),this.callHook("onSet");else throw new TypeError(`No setter defined for "${this.name}"`)}}function le(...e){return K.create(...e)}function Ve(e){return le(e)}const M=e=>{const{name:n,target:t,key:r,receiver:a,value:f,keysChanged:u=!1,valueChanged:d=!1}=e;return{name:n,target:t,key:r,receiver:a,value:f,keysChanged:u,valueChanged:d}},Ne=(e,n,t,r)=>{var a;de(n,t),(a=e==null?void 0:e.onGet)==null||a.call(e,M({name:e.name,target:n,key:t,receiver:r}))},$e=(e,n,t,r)=>{var h;const a=n[t],f=Array.isArray(n);let u=!1,d=!1;t in n||(T(n,N),d=!0,f&&T(n,"length")),(a!==r||f)&&(T(n,t),u=!0),(d||u)&&((h=e==null?void 0:e.onSet)==null||h.call(e,M({name:e.name,target:n,key:t,value:r,keysChanged:d,valueChanged:u})))},Le=(e,n,t)=>{var r;T(n,t),T(n,N),(r=e==null?void 0:e.onDelete)==null||r.call(e,M({name:e.name,target:n,key:t,keysChanged:!0}))},he=(e,n,t)=>{var r;de(n,N),(r=e==null?void 0:e.onHas)==null||r.call(e,M({name:e.name,target:n,key:t}))};function me(e){const n=e.needsProxy||(()=>!0);return{get:(t,r,a)=>{var u;Ne(e,t,r,a);const f=Reflect.get(t,r,a);return n({target:t,key:r,value:f})&&(e!=null&&e.deep)&&((u=Object.getOwnPropertyDescriptor(t,r))!=null&&u.configurable)?O(f,e):f},set:(t,r,a)=>($e(e,t,r,a),Reflect.set(t,r,a)),deleteProperty:(...t)=>(Le(e,...t),Reflect.deleteProperty(...t)),has:(t,r)=>(he(e,t),Reflect.has(t,r)),ownKeys:t=>(he(e,t),Reflect.ownKeys(t)),getPrototypeOf:t=>Object.getPrototypeOf(t)}}const E=Object.freeze({object:e=>({...me(e)}),array:e=>({...me(e)})});function O(e,n){if(_e(e))return U(e);if(ie(e))return e;const t=n||{},r={...t,deep:(t==null?void 0:t.deep)??!0},a=O.getStringType(e);if(!O.hasHandler(a))return e;const f=new Proxy(e,O.typeHandler(a,r));return Ae(e,f),f}O.getStringType=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),O.hasHandler=e=>!!E[e],O.typeHandler=(e,n)=>{var t;return(t=E[e])==null?void 0:t.call(E,n)};function X(e,n,t){const r=le({get:e,onChange:({value:f,prev:u})=>n(f,u)}),a=r.run();return t!=null&&t.immediate&&n(a),()=>r.dispose()}function A(e,n,t){var f,u,d,h;let r,a;if(n.cache){const v=Ve({...n,get:n.get,name:e,onImmediateChange:(f=t==null?void 0:t.computed)==null?void 0:f.onImmediateChange,onChange:(u=t==null?void 0:t.computed)==null?void 0:u.onChange,onGet:(d=t==null?void 0:t.computed)==null?void 0:d.onGet,onSet:(h=t==null?void 0:t.computed)==null?void 0:h.onSet});r=function(){return S(this),v.value},a=function(g){v.value=g}}else r=function(){return S(this),n.get.call(this)},a=function(...m){n.set.call(this,...m)};return{enumerable:n.enumerable,configurable:n.configurable,get:r,set:a}}function H(e,n,t){var f,u,d,h,v,m;const r={value:n.value},a=O(r,{name:e,onGet:(f=t==null?void 0:t.reactive)==null?void 0:f.onGet,onHas:(u=t==null?void 0:t.reactive)==null?void 0:u.onHas,onSet:(d=t==null?void 0:t.reactive)==null?void 0:d.onSet,onDelete:(h=t==null?void 0:t.reactive)==null?void 0:h.onDelete,needsProxy:(v=t==null?void 0:t.reactive)==null?void 0:v.needsProxy,deep:n.deep??((m=t==null?void 0:t.reactive)==null?void 0:m.deep)});return{configurable:n.configurable,enumerable:n.enumerable,get:function(){S(this);const{value:b}=a;return Array.isArray(b)&&Reflect.get(b,"length"),b},set:function(b){a.value=b}}}function k(e,n,t,r){Object.defineProperty(e,n,A(n,t,r))}function z(e,n,t,r){Object.defineProperty(e,n,H(n,t,r))}const G={toRaw:Ee,watch:X,describeProperty:H,defineProperty:z,describeComputed:A,defineComputed:k},F=new Set(["__proto__","__ob__"]),I="value";function je(e){const{observable:n,set:t}=e,r=new WeakMap,a=(c,i)=>{let o=r.get(c);o||(o=new Map,r.set(c,o));let w=o.get(i);return w||(w=n({[I]:0}),o.set(i,w)),w},f=t?c=>t(c,I,c[I]+1):c=>{c[I]+=1},u=(c,i)=>{F.has(i)||Reflect.get(a(c,i),I)},d=(c,i)=>{F.has(i)||f(a(c,i))},h=(c,i)=>{const o=r.get(c);o&&d(o,i),r.delete(c)},g={computed:{onGet:c=>{u(c,c.name)},onImmediateChange:c=>{d(c,c.name)}},reactive:{onGet:({target:c,key:i})=>{S(c),u(c,i)},onHas:({target:c,key:i})=>{u(c,i)},onDelete:({target:c,key:i})=>{h(c,i)},onSet:({target:c,key:i,keysChanged:o})=>{d(c,i),o&&d(c)},needsProxy:({key:c})=>!F.has(c)}};function b(c,i){return A(c,i,g)}function x(c,i){return H(c,i,g)}function ee(c,i,o){return k(c,i,o,g)}function s(c,i,o){return z(c,i,o,g)}return{toRaw:G.toRaw,watch:X,describeProperty:x,defineProperty:s,describeComputed:b,defineComputed:ee}}const q=new Set(["__proto__","__ob__"]),Q="value",Be=e=>{e[Q]+=1};function We({reactive:e,toRaw:n}={}){const t=n??(s=>s),r=new WeakMap,a=(s,c)=>{const i=t(s);let o=r.get(i);o||(o=new Map,r.set(i,o));let w=o.get(c);return w||(w=e({[Q]:0}),o.set(c,w)),w},f=(s,c)=>{q.has(c)||Reflect.get(a(s,c),Q)},u=(s,c)=>{q.has(c)||Be(a(s,c))},d=(s,c)=>{const i=t(s),o=r.get(i);o&&u(o,c),r.delete(i)},m={computed:{onGet:s=>{f(s,s.name)},onImmediateChange:s=>{u(s,s.name)}},reactive:{onGet:({target:s,key:c})=>{S(s),f(s,c)},onHas:({target:s,key:c})=>{f(s,c)},onDelete:({target:s,key:c})=>{d(s,c)},onSet:({target:s,key:c,keysChanged:i})=>{u(s,c),i&&u(s)},needsProxy:({key:s})=>!q.has(s)}};function g(s,c){return A(s,c,m)}function b(s,c){return H(s,c,m)}function x(s,c,i){return k(s,c,i,m)}function ee(s,c,i){return z(s,c,i,m)}return{toRaw:G.toRaw,watch:X,describeProperty:b,defineProperty:ee,describeComputed:g,defineComputed:x}}function ge(...e){const n={},t={};for(const r of e){const a=typeof r=="function"?r():r;Object.assign(n,Object.getOwnPropertyDescriptors(a??r??{}))}return Object.defineProperties(t,n),t}function ve(e,n){Object.defineProperties(e.prototype,Object.getOwnPropertyDescriptors(ge(...[...n,e].map(t=>t.prototype))))}const D=new WeakMap;function Ue(...e){return n=>{e!=null&&e.length&&ve(n,e)}}function be(e){D.has(e)||D.set(e,new Set)}function we(e,n){return be(e),D.get(e).has(n)}function Oe(e,n){be(e),D.get(e).add(n)}function ye(e,n,t,r){var f;return C()&&!we(e,n)?(_(e,n,{...t,get:t.get.bind(e),set:(f=t.set)==null?void 0:f.bind(e),enumerable:!0,...r==null?void 0:r.descriptors,cache:!0}),Oe(e,n),!0):!1}function Ce(e,n,t,r){if(typeof t.get=="function"){const a={...t,enumerable:!0,configurable:!0};return a.get=function(){return ye(this,n,t,r),this[n]},a.set=function(u){ye(this,n,t,r),this[n]=u},a}return t}function Se(e,n,t){return Ce(e,n,t)}Se.configure=function(n){return(t,r,a)=>Ce(t,r,a,{descriptors:n})};function J(e,n,t){return C()&&!we(e,n)?(Oe(e,n),_(e,n,{...Object.getOwnPropertyDescriptor(e,n),enumerable:!0,...t==null?void 0:t.descriptors}),!0):!1}function Z(e,n,t){typeof e=="function"?J(e,n):Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get(){if(J(this,n,t))return this[n]},set(r){J(this,n,t)&&(this[n]=r)}})}function p(e,n){return Z(e,n)}p.shallow=function(n,t){return Z(n,t,{descriptors:{deep:!1}})},p.configure=function(n){return(t,r)=>Z(t,r,{descriptors:n})},re(G);const Ye={use:re,unuse:Te,auto:ae,define:_,watch:ue,lastAccessed:Ie};l.MadroneState=G,l.MadroneVue2=je,l.MadroneVue3=We,l.applyClassMixins=ve,l.auto=ae,l.classMixin=Ue,l.computed=Se,l.default=Ye,l.merge=ge,l.reactive=p,l.toRaw=V,l.watch=ue,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|