@player-ui/player 0.5.2--canary.256.8666 → 0.6.0-next.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/dist/index.cjs.js +99 -42
- package/dist/index.d.ts +21 -3
- package/dist/index.esm.js +97 -43
- package/dist/player.dev.js +100 -43
- package/dist/player.prod.js +1 -1
- package/package.json +3 -3
- package/src/controllers/flow/flow.ts +10 -0
- package/src/player.ts +2 -2
- package/src/view/parser/index.ts +37 -3
- package/src/view/parser/types.ts +9 -0
- package/src/view/parser/utils.ts +21 -0
- package/src/view/plugins/switch.ts +7 -1
- package/src/view/resolver/index.ts +59 -47
- package/src/view/resolver/utils.ts +13 -0
- package/src/view/view.ts +6 -0
package/dist/index.cjs.js
CHANGED
|
@@ -2353,10 +2353,24 @@ exports.NodeType = void 0;
|
|
|
2353
2353
|
NodeType2["Value"] = "value";
|
|
2354
2354
|
NodeType2["MultiNode"] = "multi-node";
|
|
2355
2355
|
NodeType2["Switch"] = "switch";
|
|
2356
|
+
NodeType2["Async"] = "async";
|
|
2356
2357
|
NodeType2["Unknown"] = "unknown";
|
|
2357
2358
|
NodeType2["Empty"] = "empty";
|
|
2358
2359
|
})(exports.NodeType || (exports.NodeType = {}));
|
|
2359
2360
|
|
|
2361
|
+
function hasAsync(obj) {
|
|
2362
|
+
return Object.prototype.hasOwnProperty.call(obj, "async");
|
|
2363
|
+
}
|
|
2364
|
+
function getNodeID(node) {
|
|
2365
|
+
var _a;
|
|
2366
|
+
if (!node) {
|
|
2367
|
+
return;
|
|
2368
|
+
}
|
|
2369
|
+
if ("value" in node && typeof node.value === "object" && typeof ((_a = node.value) == null ? void 0 : _a.id) === "string") {
|
|
2370
|
+
return node.value.id;
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2360
2374
|
var __defProp$9 = Object.defineProperty;
|
|
2361
2375
|
var __defProps$7 = Object.defineProperties;
|
|
2362
2376
|
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
@@ -2407,6 +2421,18 @@ class Parser {
|
|
|
2407
2421
|
}
|
|
2408
2422
|
return viewNode;
|
|
2409
2423
|
}
|
|
2424
|
+
parseAsync(obj, type, options) {
|
|
2425
|
+
const parsedAsync = this.parseObject(timm.omit(obj, "async"), type, options);
|
|
2426
|
+
const parsedNodeId = getNodeID(parsedAsync);
|
|
2427
|
+
if (parsedAsync !== null && parsedNodeId) {
|
|
2428
|
+
return this.createASTNode({
|
|
2429
|
+
id: parsedNodeId,
|
|
2430
|
+
type: exports.NodeType.Async,
|
|
2431
|
+
value: parsedAsync
|
|
2432
|
+
}, obj);
|
|
2433
|
+
}
|
|
2434
|
+
return null;
|
|
2435
|
+
}
|
|
2410
2436
|
createASTNode(node, value) {
|
|
2411
2437
|
const tapped = this.hooks.onCreateASTNode.call(node, value);
|
|
2412
2438
|
if (tapped === void 0) {
|
|
@@ -2513,6 +2539,14 @@ class Parser {
|
|
|
2513
2539
|
]
|
|
2514
2540
|
});
|
|
2515
2541
|
}
|
|
2542
|
+
} else if (localValue && hasAsync(localValue)) {
|
|
2543
|
+
const localAsync = this.parseAsync(localValue, exports.NodeType.Value, options);
|
|
2544
|
+
if (localAsync) {
|
|
2545
|
+
children2.push({
|
|
2546
|
+
path: [...path, localKey],
|
|
2547
|
+
value: localAsync
|
|
2548
|
+
});
|
|
2549
|
+
}
|
|
2516
2550
|
} else if (localValue && Array.isArray(localValue)) {
|
|
2517
2551
|
const childValues = localValue.map((childVal) => this.parseObject(childVal, exports.NodeType.Value, options)).filter((child) => !!child);
|
|
2518
2552
|
if (childValues.length > 0) {
|
|
@@ -2632,6 +2666,15 @@ function toNodeResolveOptions(resolverOptions) {
|
|
|
2632
2666
|
evaluate: (exp) => resolverOptions.evaluator.evaluate(exp, resolverOptions)
|
|
2633
2667
|
});
|
|
2634
2668
|
}
|
|
2669
|
+
function unpackAndPush(item, initial) {
|
|
2670
|
+
if (Array.isArray(item)) {
|
|
2671
|
+
item.forEach((i) => {
|
|
2672
|
+
unpackAndPush(i, initial);
|
|
2673
|
+
});
|
|
2674
|
+
} else {
|
|
2675
|
+
initial.push(item);
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2635
2678
|
|
|
2636
2679
|
var __defProp$7 = Object.defineProperty;
|
|
2637
2680
|
var __defProps$5 = Object.defineProperties;
|
|
@@ -2707,22 +2750,13 @@ class Resolver {
|
|
|
2707
2750
|
getResolveCache() {
|
|
2708
2751
|
return new Map(this.resolveCache);
|
|
2709
2752
|
}
|
|
2710
|
-
getNodeID(node) {
|
|
2711
|
-
var _a;
|
|
2712
|
-
if (!node) {
|
|
2713
|
-
return;
|
|
2714
|
-
}
|
|
2715
|
-
if ((node.type === exports.NodeType.Asset || node.type === exports.NodeType.View || node.type === exports.NodeType.Value) && typeof node.value === "object" && typeof ((_a = node.value) == null ? void 0 : _a.id) === "string") {
|
|
2716
|
-
return node.value.id;
|
|
2717
|
-
}
|
|
2718
|
-
}
|
|
2719
2753
|
getPreviousResult(node) {
|
|
2720
2754
|
var _a, _b;
|
|
2721
2755
|
if (!node) {
|
|
2722
2756
|
return;
|
|
2723
2757
|
}
|
|
2724
2758
|
const isFirstUpdate = this.resolveCache.size === 0;
|
|
2725
|
-
const id =
|
|
2759
|
+
const id = getNodeID(node);
|
|
2726
2760
|
if (id) {
|
|
2727
2761
|
if (this.idCache.has(id)) {
|
|
2728
2762
|
if (isFirstUpdate) {
|
|
@@ -2750,8 +2784,8 @@ class Resolver {
|
|
|
2750
2784
|
});
|
|
2751
2785
|
return clonedNode;
|
|
2752
2786
|
}
|
|
2753
|
-
computeTree(node,
|
|
2754
|
-
var _a, _b;
|
|
2787
|
+
computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap) {
|
|
2788
|
+
var _a, _b, _c;
|
|
2755
2789
|
const dependencyModel = new DependencyModel(options.data.model);
|
|
2756
2790
|
dependencyModel.trackSubset("core");
|
|
2757
2791
|
const depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
|
|
@@ -2766,15 +2800,21 @@ class Resolver {
|
|
|
2766
2800
|
const previousDeps = previousResult == null ? void 0 : previousResult.dependencies;
|
|
2767
2801
|
const dataChanged = caresAboutDataChanges(dataChanges, previousDeps);
|
|
2768
2802
|
const shouldUseLastValue = this.hooks.skipResolve.call(!dataChanged, node, resolveOptions);
|
|
2769
|
-
|
|
2803
|
+
const clonedNode = __spreadProps$5(__spreadValues$7({}, this.cloneNode(node)), {
|
|
2804
|
+
parent: partiallyResolvedParent
|
|
2805
|
+
});
|
|
2806
|
+
const resolvedAST = (_a = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) != null ? _a : {
|
|
2807
|
+
type: exports.NodeType.Empty
|
|
2808
|
+
};
|
|
2809
|
+
const isNestedMultiNode = resolvedAST.type === exports.NodeType.MultiNode && ((_b = partiallyResolvedParent == null ? void 0 : partiallyResolvedParent.parent) == null ? void 0 : _b.type) === exports.NodeType.MultiNode && partiallyResolvedParent.type === exports.NodeType.Value;
|
|
2810
|
+
if (previousResult && shouldUseLastValue) {
|
|
2770
2811
|
const update2 = __spreadProps$5(__spreadValues$7({}, previousResult), {
|
|
2771
2812
|
updated: false
|
|
2772
2813
|
});
|
|
2773
|
-
cacheUpdate.set(node, update2);
|
|
2774
2814
|
const repopulateASTMapFromCache = (resolvedNode, AST, ASTParent) => {
|
|
2775
2815
|
var _a2;
|
|
2776
|
-
const { node:
|
|
2777
|
-
this.ASTMap.set(
|
|
2816
|
+
const { node: resolvedASTLocal } = resolvedNode;
|
|
2817
|
+
this.ASTMap.set(resolvedASTLocal, AST);
|
|
2778
2818
|
const resolvedUpdate = __spreadProps$5(__spreadValues$7({}, resolvedNode), {
|
|
2779
2819
|
updated: false
|
|
2780
2820
|
});
|
|
@@ -2787,24 +2827,18 @@ class Resolver {
|
|
|
2787
2827
|
return;
|
|
2788
2828
|
repopulateASTMapFromCache(previousChildResult, originalChildNode, AST);
|
|
2789
2829
|
};
|
|
2790
|
-
if ("children" in
|
|
2791
|
-
(_a2 =
|
|
2792
|
-
} else if (
|
|
2793
|
-
|
|
2830
|
+
if ("children" in resolvedASTLocal) {
|
|
2831
|
+
(_a2 = resolvedASTLocal.children) == null ? void 0 : _a2.forEach(({ value: childAST }) => handleChildNode(childAST));
|
|
2832
|
+
} else if (resolvedASTLocal.type === exports.NodeType.MultiNode) {
|
|
2833
|
+
resolvedASTLocal.values.forEach(handleChildNode);
|
|
2794
2834
|
}
|
|
2795
2835
|
this.hooks.afterNodeUpdate.call(AST, ASTParent, resolvedUpdate);
|
|
2796
2836
|
};
|
|
2797
|
-
previousResult.node.parent =
|
|
2798
|
-
repopulateASTMapFromCache(previousResult, node,
|
|
2837
|
+
previousResult.node.parent = partiallyResolvedParent;
|
|
2838
|
+
repopulateASTMapFromCache(previousResult, node, rawParent);
|
|
2799
2839
|
return update2;
|
|
2800
2840
|
}
|
|
2801
|
-
|
|
2802
|
-
parent: parentNode
|
|
2803
|
-
});
|
|
2804
|
-
const resolvedAST = (_a = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) != null ? _a : {
|
|
2805
|
-
type: exports.NodeType.Empty
|
|
2806
|
-
};
|
|
2807
|
-
resolvedAST.parent = parentNode;
|
|
2841
|
+
resolvedAST.parent = partiallyResolvedParent;
|
|
2808
2842
|
resolveOptions.node = resolvedAST;
|
|
2809
2843
|
this.ASTMap.set(resolvedAST, node);
|
|
2810
2844
|
let resolved = this.hooks.resolve.call(void 0, resolvedAST, resolveOptions);
|
|
@@ -2815,7 +2849,7 @@ class Resolver {
|
|
|
2815
2849
|
const childDependencies = new Set();
|
|
2816
2850
|
dependencyModel.trackSubset("children");
|
|
2817
2851
|
if ("children" in resolvedAST) {
|
|
2818
|
-
const newChildren = (
|
|
2852
|
+
const newChildren = (_c = resolvedAST.children) == null ? void 0 : _c.map((child) => {
|
|
2819
2853
|
const computedChildTree = this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
2820
2854
|
const {
|
|
2821
2855
|
dependencies: childTreeDeps,
|
|
@@ -2838,10 +2872,18 @@ class Resolver {
|
|
|
2838
2872
|
resolvedAST.children = newChildren;
|
|
2839
2873
|
} else if (resolvedAST.type === exports.NodeType.MultiNode) {
|
|
2840
2874
|
const childValue = [];
|
|
2875
|
+
const rawParentToPassIn = isNestedMultiNode ? partiallyResolvedParent == null ? void 0 : partiallyResolvedParent.parent : node;
|
|
2841
2876
|
const newValues = resolvedAST.values.map((mValue) => {
|
|
2842
|
-
|
|
2877
|
+
var _a2;
|
|
2878
|
+
const mTree = this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
2843
2879
|
if (mTree.value !== void 0 && mTree.value !== null) {
|
|
2844
|
-
|
|
2880
|
+
if (((_a2 = mTree.node.parent) == null ? void 0 : _a2.type) === exports.NodeType.MultiNode && Array.isArray(mTree.value)) {
|
|
2881
|
+
mTree.value.forEach((v) => {
|
|
2882
|
+
unpackAndPush(v, childValue);
|
|
2883
|
+
});
|
|
2884
|
+
} else {
|
|
2885
|
+
childValue.push(mTree.value);
|
|
2886
|
+
}
|
|
2845
2887
|
}
|
|
2846
2888
|
mTree.dependencies.forEach((bindingDep) => childDependencies.add(bindingDep));
|
|
2847
2889
|
updated = updated || mTree.updated;
|
|
@@ -2867,7 +2909,7 @@ class Resolver {
|
|
|
2867
2909
|
...childDependencies
|
|
2868
2910
|
])
|
|
2869
2911
|
};
|
|
2870
|
-
this.hooks.afterNodeUpdate.call(node, parent, update);
|
|
2912
|
+
this.hooks.afterNodeUpdate.call(node, isNestedMultiNode ? partiallyResolvedParent == null ? void 0 : partiallyResolvedParent.parent : rawParent, update);
|
|
2871
2913
|
cacheUpdate.set(node, update);
|
|
2872
2914
|
return update;
|
|
2873
2915
|
}
|
|
@@ -3269,6 +3311,12 @@ class ViewInstance {
|
|
|
3269
3311
|
this.templatePlugin = new TemplatePlugin(pluginOptions);
|
|
3270
3312
|
this.templatePlugin.apply(this);
|
|
3271
3313
|
}
|
|
3314
|
+
updateAsync() {
|
|
3315
|
+
var _a;
|
|
3316
|
+
const update = (_a = this.resolver) == null ? void 0 : _a.update();
|
|
3317
|
+
this.lastUpdate = update;
|
|
3318
|
+
this.hooks.onUpdate.call(update);
|
|
3319
|
+
}
|
|
3272
3320
|
update(changes) {
|
|
3273
3321
|
var _a;
|
|
3274
3322
|
if (this.rootNode === void 0) {
|
|
@@ -3370,6 +3418,7 @@ var __async$2 = (__this, __arguments, generator) => {
|
|
|
3370
3418
|
};
|
|
3371
3419
|
class FlowInstance {
|
|
3372
3420
|
constructor(id, flow, options) {
|
|
3421
|
+
this.isTransitioning = false;
|
|
3373
3422
|
this.hooks = {
|
|
3374
3423
|
beforeStart: new tapableTs.SyncBailHook(),
|
|
3375
3424
|
onStart: new tapableTs.SyncHook(),
|
|
@@ -3412,20 +3461,23 @@ class FlowInstance {
|
|
|
3412
3461
|
});
|
|
3413
3462
|
}
|
|
3414
3463
|
transition(transitionValue, options) {
|
|
3415
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3416
|
-
if (
|
|
3417
|
-
(
|
|
3464
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
3465
|
+
if (this.isTransitioning) {
|
|
3466
|
+
throw new Error(`Transitioning while ongoing transition from ${(_a = this.currentState) == null ? void 0 : _a.name} is in progress is not supported`);
|
|
3467
|
+
}
|
|
3468
|
+
if (((_b = this.currentState) == null ? void 0 : _b.value.state_type) === "END") {
|
|
3469
|
+
(_c = this.log) == null ? void 0 : _c.warn(`Skipping transition using ${transitionValue}. Already at and END state`);
|
|
3418
3470
|
return;
|
|
3419
3471
|
}
|
|
3420
3472
|
if (this.currentState === void 0) {
|
|
3421
3473
|
throw new Error("Cannot transition when there's no current state");
|
|
3422
3474
|
}
|
|
3423
3475
|
if (options == null ? void 0 : options.force) {
|
|
3424
|
-
(
|
|
3476
|
+
(_d = this.log) == null ? void 0 : _d.debug(`Forced transition. Skipping validation checks`);
|
|
3425
3477
|
} else {
|
|
3426
3478
|
const skipTransition = this.hooks.skipTransition.call(this.currentState);
|
|
3427
3479
|
if (skipTransition) {
|
|
3428
|
-
(
|
|
3480
|
+
(_e = this.log) == null ? void 0 : _e.debug(`Skipping transition from ${this.currentState.name} b/c hook told us to`);
|
|
3429
3481
|
return;
|
|
3430
3482
|
}
|
|
3431
3483
|
}
|
|
@@ -3436,10 +3488,10 @@ class FlowInstance {
|
|
|
3436
3488
|
const { transitions } = state;
|
|
3437
3489
|
const nextState = transitions[transitionValue] || transitions["*"];
|
|
3438
3490
|
if (nextState === void 0) {
|
|
3439
|
-
(
|
|
3491
|
+
(_f = this.log) == null ? void 0 : _f.warn(`No transition from ${this.currentState.name} using ${transitionValue} or *`);
|
|
3440
3492
|
return;
|
|
3441
3493
|
}
|
|
3442
|
-
(
|
|
3494
|
+
(_g = this.log) == null ? void 0 : _g.debug(`Transitioning from ${this.currentState.name} to ${nextState} using ${transitionValue} `);
|
|
3443
3495
|
return this.pushHistory(nextState, options);
|
|
3444
3496
|
}
|
|
3445
3497
|
pushHistory(stateName, options) {
|
|
@@ -3453,6 +3505,7 @@ class FlowInstance {
|
|
|
3453
3505
|
return;
|
|
3454
3506
|
}
|
|
3455
3507
|
const prevState = this.currentState;
|
|
3508
|
+
this.isTransitioning = true;
|
|
3456
3509
|
nextState = this.hooks.resolveTransitionNode.call(nextState);
|
|
3457
3510
|
const newCurrentState = {
|
|
3458
3511
|
name: stateName,
|
|
@@ -3464,6 +3517,7 @@ class FlowInstance {
|
|
|
3464
3517
|
this.hooks.onEnd.call(this.flow.onEnd);
|
|
3465
3518
|
}
|
|
3466
3519
|
this.hooks.transition.call(prevState, __spreadValues$5({}, newCurrentState));
|
|
3520
|
+
this.isTransitioning = false;
|
|
3467
3521
|
this.hooks.afterTransition.call(this);
|
|
3468
3522
|
}
|
|
3469
3523
|
}
|
|
@@ -4821,8 +4875,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
4821
4875
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
4822
4876
|
});
|
|
4823
4877
|
};
|
|
4824
|
-
const PLAYER_VERSION = "0.
|
|
4825
|
-
const COMMIT = "
|
|
4878
|
+
const PLAYER_VERSION = "0.6.0-next.0";
|
|
4879
|
+
const COMMIT = "7c26e7b867b837ac89a482c8adbf3792336da50f";
|
|
4826
4880
|
const _Player = class {
|
|
4827
4881
|
constructor(config) {
|
|
4828
4882
|
this.logger = new TapableLogger();
|
|
@@ -5172,6 +5226,8 @@ exports.findClosestNodeAtPosition = findClosestNodeAtPosition;
|
|
|
5172
5226
|
exports.findInArray = findInArray;
|
|
5173
5227
|
exports.findNextExp = findNextExp;
|
|
5174
5228
|
exports.getBindingSegments = getBindingSegments;
|
|
5229
|
+
exports.getNodeID = getNodeID;
|
|
5230
|
+
exports.hasAsync = hasAsync;
|
|
5175
5231
|
exports.isBinding = isBinding;
|
|
5176
5232
|
exports.isExpressionNode = isExpressionNode;
|
|
5177
5233
|
exports.isObjectExpression = isObjectExpression;
|
|
@@ -5185,6 +5241,7 @@ exports.resolveExpressionsInString = resolveExpressionsInString;
|
|
|
5185
5241
|
exports.severities = severities;
|
|
5186
5242
|
exports.toModel = toModel;
|
|
5187
5243
|
exports.toNodeResolveOptions = toNodeResolveOptions;
|
|
5244
|
+
exports.unpackAndPush = unpackAndPush;
|
|
5188
5245
|
exports.withParser = withParser;
|
|
5189
5246
|
exports.withoutContext = withoutContext;
|
|
5190
5247
|
Object.keys(types).forEach(function (k) {
|
package/dist/index.d.ts
CHANGED
|
@@ -620,6 +620,7 @@ declare class FlowInstance {
|
|
|
620
620
|
private flow;
|
|
621
621
|
private log?;
|
|
622
622
|
private history;
|
|
623
|
+
private isTransitioning;
|
|
623
624
|
private flowPromise?;
|
|
624
625
|
readonly id: string;
|
|
625
626
|
currentState?: NamedState;
|
|
@@ -679,6 +680,7 @@ declare enum NodeType {
|
|
|
679
680
|
Value = "value",
|
|
680
681
|
MultiNode = "multi-node",
|
|
681
682
|
Switch = "switch",
|
|
683
|
+
Async = "async",
|
|
682
684
|
Unknown = "unknown",
|
|
683
685
|
Empty = "empty"
|
|
684
686
|
}
|
|
@@ -752,6 +754,12 @@ declare namespace Node {
|
|
|
752
754
|
/** The value to use if this case is true */
|
|
753
755
|
value: Value;
|
|
754
756
|
}
|
|
757
|
+
interface Async extends Base<NodeType.Async> {
|
|
758
|
+
/** The unique id of the node */
|
|
759
|
+
id: string;
|
|
760
|
+
/** The value representing the node */
|
|
761
|
+
value: Node;
|
|
762
|
+
}
|
|
755
763
|
interface PluginOptions {
|
|
756
764
|
/** A list of plugins */
|
|
757
765
|
plugins?: {
|
|
@@ -768,9 +776,14 @@ declare namespace Node {
|
|
|
768
776
|
type Unknown = Base<NodeType.Unknown>;
|
|
769
777
|
type Empty = Base<NodeType.Empty>;
|
|
770
778
|
type ViewOrAsset = View | Asset;
|
|
771
|
-
type Node = Asset | Applicability | Template | Value | View | MultiNode | Switch | Unknown | Empty;
|
|
779
|
+
type Node = Asset | Applicability | Template | Value | View | MultiNode | Switch | Async | Unknown | Empty;
|
|
772
780
|
}
|
|
773
781
|
|
|
782
|
+
/** Check to see if the object contains async */
|
|
783
|
+
declare function hasAsync(obj: object): boolean;
|
|
784
|
+
/** Get the ID of the Node if there is one */
|
|
785
|
+
declare function getNodeID(node?: Node.Node | null): string | undefined;
|
|
786
|
+
|
|
774
787
|
declare const EMPTY_NODE: Node.Empty;
|
|
775
788
|
interface ParseObjectOptions {
|
|
776
789
|
/** how nested the templated is */
|
|
@@ -805,6 +818,7 @@ declare class Parser {
|
|
|
805
818
|
parseNode: SyncBailHook<[obj: object, nodeType: Node.ChildrenTypes, parseOptions: ParseObjectOptions, determinedNodeType: NodeType | null], Node.Node, Record<string, any>>;
|
|
806
819
|
};
|
|
807
820
|
parseView(value: AnyAssetType): Node.View;
|
|
821
|
+
private parseAsync;
|
|
808
822
|
createASTNode(node: Node.Node | null, value: any): Node.Node | null;
|
|
809
823
|
/**
|
|
810
824
|
* Checks if there are templated values in the object
|
|
@@ -984,6 +998,10 @@ declare namespace Resolve {
|
|
|
984
998
|
declare function caresAboutDataChanges(dataChanges?: Set<BindingInstance>, dependencies?: Set<BindingInstance>): boolean;
|
|
985
999
|
/** Convert the options object for a resolver to one for a node */
|
|
986
1000
|
declare function toNodeResolveOptions(resolverOptions: Resolve.ResolverOptions): Resolve.NodeResolveOptions;
|
|
1001
|
+
/**
|
|
1002
|
+
* helper function to flatten a potential nested array and combine with initial array
|
|
1003
|
+
*/
|
|
1004
|
+
declare function unpackAndPush(item: any | any[], initial: any[]): void;
|
|
987
1005
|
|
|
988
1006
|
interface NodeUpdate extends Resolve.ResolvedNode {
|
|
989
1007
|
/** A flag to track if a node has changed since the last resolution */
|
|
@@ -1047,7 +1065,6 @@ declare class Resolver {
|
|
|
1047
1065
|
getSourceNode(convertedAST: Node.Node): Node.Node | undefined;
|
|
1048
1066
|
update(changes?: Set<BindingInstance>): any;
|
|
1049
1067
|
getResolveCache(): Map<Node.Node, Resolve.ResolvedNode>;
|
|
1050
|
-
private getNodeID;
|
|
1051
1068
|
private getPreviousResult;
|
|
1052
1069
|
private cloneNode;
|
|
1053
1070
|
private computeTree;
|
|
@@ -1142,6 +1159,7 @@ declare class ViewInstance implements ValidationProvider {
|
|
|
1142
1159
|
private templatePlugin;
|
|
1143
1160
|
lastUpdate: Record<string, any> | undefined;
|
|
1144
1161
|
constructor(initialView: View$1, resolverOptions: Resolve.ResolverOptions);
|
|
1162
|
+
updateAsync(): void;
|
|
1145
1163
|
update(changes?: Set<BindingInstance>): any;
|
|
1146
1164
|
getValidationsForBinding(binding: BindingInstance): ValidationObject[] | undefined;
|
|
1147
1165
|
}
|
|
@@ -1793,4 +1811,4 @@ declare class FlowExpPlugin implements PlayerPlugin {
|
|
|
1793
1811
|
apply(player: Player): void;
|
|
1794
1812
|
}
|
|
1795
1813
|
|
|
1796
|
-
export { AnyAssetType, ApplicabilityPlugin, ArrayExpressionNode, AssetTransformCorePlugin, AssignmentNode, BINDING_BRACKETS_REGEX, BaseFlowState, BaseNode, BasicExpressionTypes, BatchSetTransaction, BeforeTransformFunction, BinaryNode, BinaryOperator, BinaryOperatorAdvanced, BinaryOperatorBasic, BindingFactory, BindingInstance, BindingLike, BindingParser, BindingParserOptions, BindingTracker, Builder, CallExpressionNode, CompletedState, CompoundNode, ConditionalExpressionNode, ConsoleLogger, ConstantsController, ConstantsProvider, ControllerState, DataController, DataModelImpl, DataModelMiddleware, DataModelOptions, DataModelWithParser, DataPipeline, DependencyMiddleware, DependencyModel, DependencySets, DependencyTracker, DirectionalNode, EMPTY_NODE, ErrorState, ErrorValidationResponse, ExpNodeOpaqueIdentifier, ExpressionContext, ExpressionEvaluator, ExpressionEvaluatorFunction, ExpressionEvaluatorOptions, ExpressionHandler, ExpressionLiteralType, ExpressionNode, ExpressionNodeType, ExpressionObjectType, ExpressionType, ExtendedPlayerPlugin, FlowController, FlowExpPlugin, FlowInstance, FormatDefinition, FormatFunction, FormatHandler, FormatOptions, FormatType, Getter, HookOptions, IdentifierNode, InProgressState, LiteralNode, LocalModel, LocalStateStore, LogFn, Logger, LoggerProvider, LogicalNode, MemberExpressionNode, MiddlewareChecker, ModelRefNode, ModificationNode, NOOPDataModel, NOOP_MODEL, NOT_STARTED_STATE, NamedState, Node, NodeLocation, NodePosition, NodeType, NoopLogger, NotStartedState, ObjectNode, OperatorProcessingOptions, Options, ParseObjectOptions, Parser, PipelinedDataModel, Player, PlayerConfigOptions, PlayerFlowExecutionData, PlayerFlowState, PlayerFlowStatus, PlayerInfo, PlayerPlugin, PlayerUtils, ProxyLogger, ROOT_BINDING, RawBinding, RawBindingSegment, RawSetTransaction, RawSetType, Resolve, Resolver, SCHEMA_VALIDATION_PROVIDER_NAME, SIMPLE_BINDING_REGEX, SchemaController, Severity, StatefulValidationObject, Store, StringResolverPlugin, StrongOrWeakBinding, SwitchPlugin, TapableLogger, TemplatePlugin, ThisNode, TransformFunction, TransformFunctions, TransformRegistry, TransitionFunction, TransitionOptions, UnaryNode, UnaryOperator, Updates, VALIDATION_PROVIDER_NAME_SYMBOL, VIEW_VALIDATION_PROVIDER_NAME, ValidationBindingTrackerViewPlugin, ValidationController, ValidationGetResolveOptions, ValidationMiddleware, ValidationObject, ValidationObjectWithHandler, ValidationObjectWithSource, ValidationProvider, ValidationResponse, ValidatorContext, ValidatorFunction, ValidatorRegistry, ViewController, ViewControllerOptions, ViewInstance, ViewPlugin, WarningValidationResponse, caresAboutDataChanges, constructModelForPipeline, findClosestNodeAtPosition, findInArray, findNextExp, getBindingSegments, isBinding, isExpressionNode, isObjectExpression, maybeConvertToNum, parse, parseExpression, removeBindingAndChildrenFromMap, resolveDataRefs, resolveDataRefsInString, resolveExpressionsInString, severities, toModel, toNodeResolveOptions, withParser, withoutContext };
|
|
1814
|
+
export { AnyAssetType, ApplicabilityPlugin, ArrayExpressionNode, AssetTransformCorePlugin, AssignmentNode, BINDING_BRACKETS_REGEX, BaseFlowState, BaseNode, BasicExpressionTypes, BatchSetTransaction, BeforeTransformFunction, BinaryNode, BinaryOperator, BinaryOperatorAdvanced, BinaryOperatorBasic, BindingFactory, BindingInstance, BindingLike, BindingParser, BindingParserOptions, BindingTracker, Builder, CallExpressionNode, CompletedState, CompoundNode, ConditionalExpressionNode, ConsoleLogger, ConstantsController, ConstantsProvider, ControllerState, DataController, DataModelImpl, DataModelMiddleware, DataModelOptions, DataModelWithParser, DataPipeline, DependencyMiddleware, DependencyModel, DependencySets, DependencyTracker, DirectionalNode, EMPTY_NODE, ErrorState, ErrorValidationResponse, ExpNodeOpaqueIdentifier, ExpressionContext, ExpressionEvaluator, ExpressionEvaluatorFunction, ExpressionEvaluatorOptions, ExpressionHandler, ExpressionLiteralType, ExpressionNode, ExpressionNodeType, ExpressionObjectType, ExpressionType, ExtendedPlayerPlugin, FlowController, FlowExpPlugin, FlowInstance, FormatDefinition, FormatFunction, FormatHandler, FormatOptions, FormatType, Getter, HookOptions, IdentifierNode, InProgressState, LiteralNode, LocalModel, LocalStateStore, LogFn, Logger, LoggerProvider, LogicalNode, MemberExpressionNode, MiddlewareChecker, ModelRefNode, ModificationNode, NOOPDataModel, NOOP_MODEL, NOT_STARTED_STATE, NamedState, Node, NodeLocation, NodePosition, NodeType, NoopLogger, NotStartedState, ObjectNode, OperatorProcessingOptions, Options, ParseObjectOptions, Parser, PipelinedDataModel, Player, PlayerConfigOptions, PlayerFlowExecutionData, PlayerFlowState, PlayerFlowStatus, PlayerInfo, PlayerPlugin, PlayerUtils, ProxyLogger, ROOT_BINDING, RawBinding, RawBindingSegment, RawSetTransaction, RawSetType, Resolve, Resolver, SCHEMA_VALIDATION_PROVIDER_NAME, SIMPLE_BINDING_REGEX, SchemaController, Severity, StatefulValidationObject, Store, StringResolverPlugin, StrongOrWeakBinding, SwitchPlugin, TapableLogger, TemplatePlugin, ThisNode, TransformFunction, TransformFunctions, TransformRegistry, TransitionFunction, TransitionOptions, UnaryNode, UnaryOperator, Updates, VALIDATION_PROVIDER_NAME_SYMBOL, VIEW_VALIDATION_PROVIDER_NAME, ValidationBindingTrackerViewPlugin, ValidationController, ValidationGetResolveOptions, ValidationMiddleware, ValidationObject, ValidationObjectWithHandler, ValidationObjectWithSource, ValidationProvider, ValidationResponse, ValidatorContext, ValidatorFunction, ValidatorRegistry, ViewController, ViewControllerOptions, ViewInstance, ViewPlugin, WarningValidationResponse, caresAboutDataChanges, constructModelForPipeline, findClosestNodeAtPosition, findInArray, findNextExp, getBindingSegments, getNodeID, hasAsync, isBinding, isExpressionNode, isObjectExpression, maybeConvertToNum, parse, parseExpression, removeBindingAndChildrenFromMap, resolveDataRefs, resolveDataRefsInString, resolveExpressionsInString, severities, toModel, toNodeResolveOptions, unpackAndPush, withParser, withoutContext };
|