@player-ui/player 0.10.4-next.2 → 0.10.4
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/Player.native.js +41 -6
- package/dist/Player.native.js.map +1 -1
- package/dist/cjs/index.cjs +32 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.legacy-esm.js +32 -3
- package/dist/index.mjs +32 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/view/builder/index.test.ts +38 -0
- package/src/view/builder/index.ts +27 -2
- package/src/view/parser/types.ts +4 -0
- package/src/view/resolver/index.ts +23 -3
- package/types/view/builder/index.d.ts +9 -2
- package/types/view/parser/types.d.ts +4 -0
package/dist/index.legacy-esm.js
CHANGED
|
@@ -2844,7 +2844,13 @@ var Resolver = class {
|
|
|
2844
2844
|
prevASTMap
|
|
2845
2845
|
);
|
|
2846
2846
|
if (mTree.value !== void 0 && mTree.value !== null) {
|
|
2847
|
-
|
|
2847
|
+
if (mValue.type === "async" /* Async */ && mValue.flatten && mTree.value.asset && Array.isArray(mTree.value.asset.values)) {
|
|
2848
|
+
mTree.value.asset.values.forEach((v) => {
|
|
2849
|
+
unpackAndPush(v, childValue);
|
|
2850
|
+
});
|
|
2851
|
+
} else {
|
|
2852
|
+
childValue.push(mTree.value);
|
|
2853
|
+
}
|
|
2848
2854
|
}
|
|
2849
2855
|
mTree.dependencies.forEach(
|
|
2850
2856
|
(bindingDep) => childDependencies.add(bindingDep)
|
|
@@ -2983,7 +2989,7 @@ var ViewInstance = class {
|
|
|
2983
2989
|
};
|
|
2984
2990
|
|
|
2985
2991
|
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/player/src/view/builder/index.ts
|
|
2986
|
-
var Builder = class {
|
|
2992
|
+
var Builder = class _Builder {
|
|
2987
2993
|
/**
|
|
2988
2994
|
* Creates an asset node
|
|
2989
2995
|
*
|
|
@@ -2995,6 +3001,11 @@ var Builder = class {
|
|
|
2995
3001
|
value
|
|
2996
3002
|
};
|
|
2997
3003
|
}
|
|
3004
|
+
static assetWrapper(value) {
|
|
3005
|
+
const valueNode = _Builder.value();
|
|
3006
|
+
_Builder.addChild(valueNode, "asset", value);
|
|
3007
|
+
return valueNode;
|
|
3008
|
+
}
|
|
2998
3009
|
/**
|
|
2999
3010
|
* Creates a value node
|
|
3000
3011
|
*
|
|
@@ -3010,7 +3021,7 @@ var Builder = class {
|
|
|
3010
3021
|
* Creates a multiNode and associates the multiNode as the parent
|
|
3011
3022
|
* of all the value nodes
|
|
3012
3023
|
*
|
|
3013
|
-
* @param values - the value or
|
|
3024
|
+
* @param values - the value, applicability or async nodes to put in the multinode
|
|
3014
3025
|
*/
|
|
3015
3026
|
static multiNode(...values) {
|
|
3016
3027
|
const m = {
|
|
@@ -3023,6 +3034,24 @@ var Builder = class {
|
|
|
3023
3034
|
});
|
|
3024
3035
|
return m;
|
|
3025
3036
|
}
|
|
3037
|
+
/**
|
|
3038
|
+
* Creates an async node
|
|
3039
|
+
*
|
|
3040
|
+
* @param id - the id of async node. It should be identical for each async node
|
|
3041
|
+
*/
|
|
3042
|
+
static asyncNode(id, flatten2 = true) {
|
|
3043
|
+
return {
|
|
3044
|
+
id,
|
|
3045
|
+
type: "async" /* Async */,
|
|
3046
|
+
flatten: flatten2,
|
|
3047
|
+
value: {
|
|
3048
|
+
type: "value" /* Value */,
|
|
3049
|
+
value: {
|
|
3050
|
+
id
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
};
|
|
3054
|
+
}
|
|
3026
3055
|
/**
|
|
3027
3056
|
* Adds a child node to a node
|
|
3028
3057
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -2844,7 +2844,13 @@ var Resolver = class {
|
|
|
2844
2844
|
prevASTMap
|
|
2845
2845
|
);
|
|
2846
2846
|
if (mTree.value !== void 0 && mTree.value !== null) {
|
|
2847
|
-
|
|
2847
|
+
if (mValue.type === "async" /* Async */ && mValue.flatten && mTree.value.asset && Array.isArray(mTree.value.asset.values)) {
|
|
2848
|
+
mTree.value.asset.values.forEach((v) => {
|
|
2849
|
+
unpackAndPush(v, childValue);
|
|
2850
|
+
});
|
|
2851
|
+
} else {
|
|
2852
|
+
childValue.push(mTree.value);
|
|
2853
|
+
}
|
|
2848
2854
|
}
|
|
2849
2855
|
mTree.dependencies.forEach(
|
|
2850
2856
|
(bindingDep) => childDependencies.add(bindingDep)
|
|
@@ -2983,7 +2989,7 @@ var ViewInstance = class {
|
|
|
2983
2989
|
};
|
|
2984
2990
|
|
|
2985
2991
|
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/player/src/view/builder/index.ts
|
|
2986
|
-
var Builder = class {
|
|
2992
|
+
var Builder = class _Builder {
|
|
2987
2993
|
/**
|
|
2988
2994
|
* Creates an asset node
|
|
2989
2995
|
*
|
|
@@ -2995,6 +3001,11 @@ var Builder = class {
|
|
|
2995
3001
|
value
|
|
2996
3002
|
};
|
|
2997
3003
|
}
|
|
3004
|
+
static assetWrapper(value) {
|
|
3005
|
+
const valueNode = _Builder.value();
|
|
3006
|
+
_Builder.addChild(valueNode, "asset", value);
|
|
3007
|
+
return valueNode;
|
|
3008
|
+
}
|
|
2998
3009
|
/**
|
|
2999
3010
|
* Creates a value node
|
|
3000
3011
|
*
|
|
@@ -3010,7 +3021,7 @@ var Builder = class {
|
|
|
3010
3021
|
* Creates a multiNode and associates the multiNode as the parent
|
|
3011
3022
|
* of all the value nodes
|
|
3012
3023
|
*
|
|
3013
|
-
* @param values - the value or
|
|
3024
|
+
* @param values - the value, applicability or async nodes to put in the multinode
|
|
3014
3025
|
*/
|
|
3015
3026
|
static multiNode(...values) {
|
|
3016
3027
|
const m = {
|
|
@@ -3023,6 +3034,24 @@ var Builder = class {
|
|
|
3023
3034
|
});
|
|
3024
3035
|
return m;
|
|
3025
3036
|
}
|
|
3037
|
+
/**
|
|
3038
|
+
* Creates an async node
|
|
3039
|
+
*
|
|
3040
|
+
* @param id - the id of async node. It should be identical for each async node
|
|
3041
|
+
*/
|
|
3042
|
+
static asyncNode(id, flatten2 = true) {
|
|
3043
|
+
return {
|
|
3044
|
+
id,
|
|
3045
|
+
type: "async" /* Async */,
|
|
3046
|
+
flatten: flatten2,
|
|
3047
|
+
value: {
|
|
3048
|
+
type: "value" /* Value */,
|
|
3049
|
+
value: {
|
|
3050
|
+
id
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
};
|
|
3054
|
+
}
|
|
3026
3055
|
/**
|
|
3027
3056
|
* Adds a child node to a node
|
|
3028
3057
|
*
|