tutuca 0.9.10 → 0.9.11
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/tutuca-dev.js +41 -25
- package/dist/tutuca-dev.min.js +3 -3
- package/dist/tutuca-extra.js +21 -25
- package/dist/tutuca-extra.min.js +3 -3
- package/dist/tutuca.js +19 -23
- package/dist/tutuca.min.js +3 -3
- package/package.json +1 -1
package/dist/tutuca-dev.js
CHANGED
|
@@ -2639,13 +2639,13 @@ function hasIterator(maybeIterable) {
|
|
|
2639
2639
|
}
|
|
2640
2640
|
return !!getIteratorFn(maybeIterable);
|
|
2641
2641
|
}
|
|
2642
|
-
var isIterator = (maybeIterator) =>
|
|
2642
|
+
var isIterator = (maybeIterator) => typeof maybeIterator?.next === "function";
|
|
2643
2643
|
function getIterator(iterable) {
|
|
2644
2644
|
const iteratorFn = getIteratorFn(iterable);
|
|
2645
2645
|
return iteratorFn?.call(iterable);
|
|
2646
2646
|
}
|
|
2647
2647
|
function getIteratorFn(iterable) {
|
|
2648
|
-
const iteratorFn = iterable
|
|
2648
|
+
const iteratorFn = iterable?.[Symbol.iterator];
|
|
2649
2649
|
if (typeof iteratorFn === "function") {
|
|
2650
2650
|
return iteratorFn;
|
|
2651
2651
|
}
|
|
@@ -2740,12 +2740,10 @@ function flipFactory(collection) {
|
|
|
2740
2740
|
flipSequence.__iterate = function(fn, reverse) {
|
|
2741
2741
|
return collection.__iterate((v, k) => fn(k, v, this), reverse);
|
|
2742
2742
|
};
|
|
2743
|
-
flipSequence.__iteratorUncached =
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
});
|
|
2748
|
-
};
|
|
2743
|
+
flipSequence.__iteratorUncached = (reverse) => mapEntries(collection.__iterator(reverse), (k, v, entry) => {
|
|
2744
|
+
entry[0] = v;
|
|
2745
|
+
entry[1] = k;
|
|
2746
|
+
});
|
|
2749
2747
|
return flipSequence;
|
|
2750
2748
|
}
|
|
2751
2749
|
function mapFactory(collection, mapper, context) {
|
|
@@ -2759,12 +2757,10 @@ function mapFactory(collection, mapper, context) {
|
|
|
2759
2757
|
mappedSequence.__iterate = function(fn, reverse) {
|
|
2760
2758
|
return collection.__iterate((v, k) => fn(mapper.call(context, v, k, collection), k, this), reverse);
|
|
2761
2759
|
};
|
|
2762
|
-
mappedSequence.__iteratorUncached =
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
});
|
|
2767
|
-
};
|
|
2760
|
+
mappedSequence.__iteratorUncached = (reverse) => mapEntries(collection.__iterator(reverse), (k, v, entry) => {
|
|
2761
|
+
entry[0] = k;
|
|
2762
|
+
entry[1] = mapper.call(context, v, k, collection);
|
|
2763
|
+
});
|
|
2768
2764
|
return mappedSequence;
|
|
2769
2765
|
}
|
|
2770
2766
|
function reverseFactory(collection, useKeys) {
|
|
@@ -2917,7 +2913,7 @@ function maxFactory(collection, comparator, mapper) {
|
|
|
2917
2913
|
}
|
|
2918
2914
|
if (mapper) {
|
|
2919
2915
|
const entry = collection.toSeq().map((v, k) => [v, mapper(v, k, collection)]).reduce((a, b) => maxCompare(comparator, a[1], b[1]) ? b : a);
|
|
2920
|
-
return entry
|
|
2916
|
+
return entry?.[0];
|
|
2921
2917
|
}
|
|
2922
2918
|
return collection.reduce((a, b) => maxCompare(comparator, a, b) ? b : a);
|
|
2923
2919
|
}
|
|
@@ -3522,7 +3518,7 @@ class CollectionImpl {
|
|
|
3522
3518
|
}
|
|
3523
3519
|
findKey(predicate, context) {
|
|
3524
3520
|
const entry = this.findEntry(predicate, context);
|
|
3525
|
-
return entry
|
|
3521
|
+
return entry?.[0];
|
|
3526
3522
|
}
|
|
3527
3523
|
findLast(predicate, context, notSetValue) {
|
|
3528
3524
|
return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);
|
|
@@ -5390,7 +5386,7 @@ class ListImpl extends IndexedCollectionImpl {
|
|
|
5390
5386
|
if (index >= 0 && index < this.size) {
|
|
5391
5387
|
index += this._origin;
|
|
5392
5388
|
const node = listNodeFor(this, index);
|
|
5393
|
-
return node
|
|
5389
|
+
return node?.array[index & MASK];
|
|
5394
5390
|
}
|
|
5395
5391
|
return notSetValue;
|
|
5396
5392
|
}
|
|
@@ -5621,7 +5617,7 @@ function iterateList(list, reverse) {
|
|
|
5621
5617
|
function pushFrame(node, level, offset) {
|
|
5622
5618
|
if (level === 0) {
|
|
5623
5619
|
const array = offset === tailPos ? tail?.array : node?.array;
|
|
5624
|
-
|
|
5620
|
+
const from = offset > left ? 0 : left - offset;
|
|
5625
5621
|
let to = right - offset;
|
|
5626
5622
|
if (to > SIZE) {
|
|
5627
5623
|
to = SIZE;
|
|
@@ -5636,7 +5632,7 @@ function iterateList(list, reverse) {
|
|
|
5636
5632
|
}
|
|
5637
5633
|
} else {
|
|
5638
5634
|
const array = node?.array;
|
|
5639
|
-
|
|
5635
|
+
const from = offset > left ? 0 : left - offset >> level;
|
|
5640
5636
|
let to = (right - offset >> level) + 1;
|
|
5641
5637
|
if (to > SIZE) {
|
|
5642
5638
|
to = SIZE;
|
|
@@ -5738,7 +5734,7 @@ function updateVNode(node, ownerID, level, index, value, didAlter) {
|
|
|
5738
5734
|
}
|
|
5739
5735
|
let newNode;
|
|
5740
5736
|
if (level > 0) {
|
|
5741
|
-
const lowerNode = node
|
|
5737
|
+
const lowerNode = node?.array[idx];
|
|
5742
5738
|
const newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);
|
|
5743
5739
|
if (newLowerNode === lowerNode) {
|
|
5744
5740
|
return node;
|
|
@@ -5831,14 +5827,14 @@ function setListBounds(list, begin, end) {
|
|
|
5831
5827
|
node.array[oldTailOffset >>> SHIFT & MASK] = oldTail;
|
|
5832
5828
|
}
|
|
5833
5829
|
if (newCapacity < oldCapacity) {
|
|
5834
|
-
newTail = newTail
|
|
5830
|
+
newTail = newTail?.removeAfter(owner, 0, newCapacity);
|
|
5835
5831
|
}
|
|
5836
5832
|
if (newOrigin >= newTailOffset) {
|
|
5837
5833
|
newOrigin -= newTailOffset;
|
|
5838
5834
|
newCapacity -= newTailOffset;
|
|
5839
5835
|
newLevel = SHIFT;
|
|
5840
5836
|
newRoot = null;
|
|
5841
|
-
newTail = newTail
|
|
5837
|
+
newTail = newTail?.removeBefore(owner, 0, newOrigin);
|
|
5842
5838
|
} else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {
|
|
5843
5839
|
offsetShift = 0;
|
|
5844
5840
|
while (newRoot) {
|
|
@@ -6846,7 +6842,7 @@ function fromJSWith(stack, converter, value, key, keyPath, parentValue) {
|
|
|
6846
6842
|
if (keyPath && key !== "") {
|
|
6847
6843
|
keyPath.push(key);
|
|
6848
6844
|
}
|
|
6849
|
-
const converted = converter.call(parentValue, key, Seq(value).map((v, k) => fromJSWith(stack, converter, v, k, keyPath, value)), keyPath
|
|
6845
|
+
const converted = converter.call(parentValue, key, Seq(value).map((v, k) => fromJSWith(stack, converter, v, k, keyPath, value)), keyPath?.slice());
|
|
6850
6846
|
stack.pop();
|
|
6851
6847
|
if (keyPath) {
|
|
6852
6848
|
keyPath.pop();
|
|
@@ -7956,8 +7952,8 @@ async function compileClassesToStyle(app, compileClasses, styleId = "margaui-css
|
|
|
7956
7952
|
injectCss(styleId, css2);
|
|
7957
7953
|
return t2 - t1;
|
|
7958
7954
|
}
|
|
7959
|
-
async function compileClassesToStyleText(app, compileClasses, extraCSSClasses) {
|
|
7960
|
-
app.ParseContext =
|
|
7955
|
+
async function compileClassesToStyleText(app, compileClasses, extraCSSClasses, Ctx = ParseCtxClassSetCollector) {
|
|
7956
|
+
app.ParseContext = Ctx;
|
|
7961
7957
|
app.compile();
|
|
7962
7958
|
const classes = new Set(extraCSSClasses ?? []);
|
|
7963
7959
|
for (const Comp of app.comps.byId.values()) {
|
|
@@ -8193,6 +8189,25 @@ class LintParseContext extends ParseContext {
|
|
|
8193
8189
|
this.attrs.push({ attrs, wrapperAttrs, textChild });
|
|
8194
8190
|
}
|
|
8195
8191
|
}
|
|
8192
|
+
// dev.js
|
|
8193
|
+
class LintClassCollectorCtx extends ParseCtxClassSetCollector {
|
|
8194
|
+
constructor(...args) {
|
|
8195
|
+
super(...args);
|
|
8196
|
+
this.attrs = [];
|
|
8197
|
+
}
|
|
8198
|
+
enterMacro(macroName, macroVars, macroSlots) {
|
|
8199
|
+
const { DOMParser: DP, Text, Comment, nodes, events, macroNodes } = this;
|
|
8200
|
+
const frame = { macroName, macroVars, macroSlots };
|
|
8201
|
+
const v = new LintClassCollectorCtx(DP, Text, Comment, nodes, events, macroNodes, frame, this);
|
|
8202
|
+
v.classes = this.classes;
|
|
8203
|
+
v.attrs = this.attrs;
|
|
8204
|
+
return v;
|
|
8205
|
+
}
|
|
8206
|
+
onAttributes(attrs, wrapperAttrs, textChild) {
|
|
8207
|
+
super.onAttributes(attrs, wrapperAttrs, textChild);
|
|
8208
|
+
this.attrs.push({ attrs, wrapperAttrs, textChild });
|
|
8209
|
+
}
|
|
8210
|
+
}
|
|
8196
8211
|
export {
|
|
8197
8212
|
version,
|
|
8198
8213
|
updateIn$1 as updateIn,
|
|
@@ -8262,6 +8277,7 @@ export {
|
|
|
8262
8277
|
List,
|
|
8263
8278
|
LintParseContext,
|
|
8264
8279
|
LintContext,
|
|
8280
|
+
LintClassCollectorCtx,
|
|
8265
8281
|
LEVEL_WARN,
|
|
8266
8282
|
LEVEL_HINT,
|
|
8267
8283
|
LEVEL_ERROR,
|